<!--  -->
<template>
  <div> 
    <el-table
    :data="tableData"
    style="width: 100%">
      <el-table-column
        prop="ruleno"
        label="收款条件编号"
        width="200">
      </el-table-column>
      <el-table-column
          prop="remarks"
          label="描述"
          >
      </el-table-column>
      <el-table-column label="应收款期计算依据">
        <el-table-column
          prop="name"
          label="订单">
          <el-table-column
            prop="point"
            label="订单审核"
            width="150">
            <template slot-scope="scope">
              <div v-if="scope.row.point == '订单审核'" style="color: red">是</div>
              <div v-else>--</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="amountrate"
            label="立账额度"
            width="150">
            <template slot-scope="scope">
              <div v-if="scope.row.point == '订单审核'">{{scope.row.amountrate * 100}}%</div>
              <div v-else>--</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="days"
            label="后置天数"
            width="150">
            <template slot-scope="scope">
              <div v-if="scope.row.point == '订单审核'">{{scope.row.days}}</div>
              <div v-else>--</div>
            </template>
          </el-table-column>
        </el-table-column>
        <el-table-column
          prop="name"
          label="发货">
          <el-table-column
            prop="point"
            label="销售出库审核"
            width="150">
            <template slot-scope="scope">
              <div v-if="scope.row.point == '销售出库审核'" style="color: red">是</div>
              <div v-else>--</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="days"
            label="后置天数"
            width="150">
            <template slot-scope="scope">
              <div v-if="scope.row.point == '销售出库审核'">{{scope.row.days}}</div>
              <div v-else>--</div>
            </template>
          </el-table-column>
        </el-table-column>
        <el-table-column
          prop="name"
          label="发票">
          <el-table-column
            prop="point"
            label="发票审核"
            width="150">
            <template slot-scope="scope">
              <div v-if="scope.row.point == '发票审核'" style="color: red">是</div>
              <div v-else>--</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="days"
            label="后置天数"
            width="150">
            <template slot-scope="scope">
              <div v-if="scope.row.point == '发票审核'">{{scope.row.days}}</div>
              <div v-else>--</div>
            </template>
          </el-table-column>
        </el-table-column>
      </el-table-column>
      <el-table-column
        prop="isdefault"
        label="是否默认条件"
        width="120">
        <template slot-scope="scope">
          <span v-if="scope.row.isdefault" style="color: red">是</span>
          <span v-else>否</span>
        </template>
      </el-table-column>
      <el-table-column
       prop="a" 
       label="操作"
       width="150px">
       <template slot-scope="scope">
         <el-button type="text" size="mini" @click="goDetail(scope.row)">详 情</el-button>
       </template>
      </el-table-column>
  </el-table>
  </div>
</template>

<script>
export default {
  props:['tableData'],
  data () {
    return {
    }
  },
  methods: {
    goDetail (data) {
      let query = {id:data.sa_receivableruleid,rowindex:data.rowindex}
      this.$router.push({path:'/collectionRuleDetail',query:query})
      this.$store.dispatch('changeDetailDrawer',true)
    }
  }
}
</script>

<style  scoped>

</style>
