<template>
  <div class="app-container">
    <div>
      <!--标题按钮部分开始-->
      <div class="tab-header webtop">
        <!--标题-->
        <div>{{ viewTitle }}</div>
        <!--start 添加修改按钮-->
        <div>
          <el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
        </div>
      </div>
      <!--标题按钮部分结束-->
      <!--Start 新增修改部分-->
      <div class="listconadd">
        <el-form ref="form_obj" :rules="rules" class="formadd">
          <el-table :key="tableKey" :data="list" :index="index" border style="width: 100%">
            <el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center" />
            <el-table-column prop="createOrgName" label="分公司" align="center" width="150" />
            <el-table-column prop="purchaseSystemName" label="采购系统" align="center" width="140" />
            <el-table-column prop="brandName" label="品牌" align="center" width="120" />
            <el-table-column prop="createTime" label="创建日期" align="center" width="120" />
            <el-table-column prop="rebateTypeValue" label="返利类型" align="center" width="150" />
            <el-table-column prop="rebateName" label="返利名称" align="center" min-width="150" />
            <el-table-column prop="estimateRebate" label="预计返利" align="center" width="120" />
            <el-table-column prop="expectItureCost" label="其中支出费用" align="center" width="130" />
            <el-table-column prop="expectTreatCost" label="其中待支付费用" align="center" width="150" />
            <el-table-column prop="expectSuppCost" label="其中抵顶费用" align="center" width="130" />
            <el-table-column prop="expectSuppRemark" label="抵顶费用说明" align="center" min-width="200" />
            <el-table-column prop="palceGenDate" label="所属年月" align="center" width="120" />
            <el-table-column prop="remarks" label="备注" align="center" min-width="200" />
          </el-table>
        </el-form>
      </div>
    </div>
    <!--End 添加修改部分-->
  </div>
</template>

<script>
import req from '@/api/specialrebate/specialrebatewithholding'

export default {
  name: 'ZhuanXiangFanLiInfo',
  data() {
    return {
      viewTitle: '',
      index: 0,
      tableKey: 0,
      list: [],
      // 表单数据
      rules: {},
      submitdisabled: false
    }
  },
  methods: {
    showInfo(row) {
      this.$nextTick(() => {
        this.$refs['form_obj'].clearValidate()
      })
      this.viewTitle = '待预提专项返利明细'
      console.log('编辑回显', row.sid)
      req.vehRebateWithDetails(row.specialRebateSids).then((resp) => {
        if (resp.success) {
          this.list = resp.data
        }
      }).catch((e) => {
        this.formobj = row
      })
    },
    // 返回（===既判断）
    handleReturn() {
      // 表单数据
      this.list = []
      this.$refs['form_obj'].resetFields()
      this.$emit('doback')
    }
  }
}
</script>
<style scoped>
</style>

