<template>
  <div>
    <div class="sty">
      <el-page-header @back="goBack" content="详情"> </el-page-header>
    </div>
    <br />
    <br />
    <span>返利互转单</span>
    <el-divider></el-divider>
    <!-- 筛选条件 -->
    <div>
      <el-form label-width="100px" size="small" label-position="left">
        <el-row :gutter="20">
          <el-col :xs="24" :sm="12" :lg="6">
            <el-form-item label="返利互转单号" prop="">
              <el-input disabled v-model="detailList.id" placeholder=""></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :lg="6">
            <el-form-item label="单据日期" prop="">
              <el-input disabled v-model="detailList.theTime" placeholder=""></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :lg="6">
            <el-form-item label="单据状态" prop="">
              <el-input v-if="detailList.examineStatus == 'SAVE'" disabled placeholder="保存"></el-input>
              <el-input v-if="detailList.examineStatus == 'WAIT'" disabled placeholder="待审核"></el-input>
              <el-input v-if="detailList.examineStatus == 'OK_ONE'" disabled placeholder="初审通过"></el-input>
              <el-input v-if="detailList.examineStatus == 'FAIL_ONE'" disabled placeholder="初审不通过"></el-input>
              <el-input v-if="detailList.examineStatus == 'OK'" disabled placeholder="复核通过"></el-input>
              <el-input v-if="detailList.examineStatus == 'FALL'" disabled placeholder="复核不通过"></el-input>
              <el-input v-if="detailList.examineStatus == 'CLOSE'" disabled placeholder="已关闭"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :lg="6">
            <el-form-item label="制单人" prop="">
              <el-input v-model="detailList.createBy" disabled placeholder=""></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :lg="6">
            <el-form-item label="经销商编号" prop="">
              <el-input disabled v-model="detailList.customerNumber" placeholder=""></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :lg="6">
            <el-form-item label="经销商名称" prop="">
              <el-input disabled v-model="detailList.customerName" placeholder=""></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :lg="6">
            <el-form-item label="备注信息" prop="">
              <el-input disabled v-model="detailList.remark" placeholder=""></el-input>
            </el-form-item>
          </el-col>
          <el-col v-if="detailList.examineBy" :xs="24" :sm="12" :lg="6">
            <el-form-item label="审核人" prop="">
              <el-input disabled v-model="detailList.examineBy" placeholder=""></el-input>
            </el-form-item>
          </el-col>
          <el-col v-if="detailList.examineBy" :xs="24" :sm="12" :lg="6">
            <el-form-item label="审核日期" prop="">
              <el-input disabled v-model="detailList.examineTime" placeholder=""></el-input>
            </el-form-item>
          </el-col>
          <!-- <el-col :xs="24" :sm="12" :lg="6">
            <el-form-item label="关闭人" prop="">
              <el-input disabled placeholder="请输入"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :lg="6">
            <el-form-item label="关闭日期" prop="">
              <el-input disabled placeholder="请输入"></el-input>
            </el-form-item>
          </el-col> -->
        </el-row>
      </el-form>
    </div>
    <!-- 列表 -->
    <div class="mymain-container">
      <div class="table">
        <el-table
          v-loading="listLoading"
          :data="dataList"
          element-loading-text="Loading"
          border
          fit
          highlight-current-row
          stripe
        >
          <el-table-column label="序号" align="left" width="100" type="index" show-overflow-tooltip></el-table-column>
          <el-table-column
            align="left"
            label="返利类型"
            prop="customerWalletName"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="left"
            label="返利金额"
            prop="amount"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="left"
            label="折让金额"
            prop="allowanceAmount"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="left"
            label="发起方经销商名称"
            prop="customerName"
            min-width="260"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <CopyButton :copyText="scope.row.customerName" />
              <span>{{ scope.row.customerName }}</span>
            </template>
          </el-table-column>
          <el-table-column
            align="left"
            label="接收方经销商名称"
            prop="receiverCustomerName"
            min-width="260"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <CopyButton :copyText="scope.row.receiverCustomerName" />
              <span>{{ scope.row.receiverCustomerName }}</span>
            </template>
          </el-table-column>
          <el-table-column
            align="left"
            label="备注"
            prop="remark"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
        </el-table>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    detailList: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      dataList: [], // 列表数据
      searchForm: {}, //搜索表单
      listLoading: false // 列表加载loading
    }
  },
  created() {
    this.dataList = [
      {
        customerWalletName: this.detailList.initiatorCustomerWalletName,
        customerName:this.detailList.customerName,
        receiverCustomerName:this.detailList.receiverCustomerName,
        remark: this.detailList.initiatorRemark,
        amount: -this.detailList.initiatorAmount
      },
      {
        customerWalletName: this.detailList.receiverCustomerWalletName,
        customerName:this.detailList.customerName,
        receiverCustomerName:this.detailList.receiverCustomerName,
        remark: this.detailList.receiverRemark,
        amount: this.detailList.amount,
        allowanceAmount: this.detailList.allowanceAmount
      }
    ]
  },
  methods: {
    goBack() {
     this.$emit('refresh')
    }
  }
}
</script>

<style></style>
