<template>
<div>
  <el-descriptions :column="5"  size="mini">
    <el-descriptions-item label="付款单">{{record.paymentNo}}</el-descriptions-item>
    <el-descriptions-item label="客户名称">{{record.customerName}}</el-descriptions-item>
    <el-descriptions-item label="创建时间">{{parseTime(record.createTime)}}</el-descriptions-item>
    <el-descriptions-item label="业务员">{{record.salesmanName}}</el-descriptions-item>
    <el-descriptions-item label="付款金额">{{record.totalAmount}}rmb</el-descriptions-item>
    <el-descriptions-item v-if="record.reason" label="申请理由">{{record.reason}}</el-descriptions-item>
  </el-descriptions>
  <router-link :to="{path:'/financial/commission-requestFunds',query:{lookId: this.record.id}}">
    <el-button type="primary">查看详情</el-button>
  </router-link>
</div>
</template>

<script>

import {commissionPaymentGetPaymentApprove, getCommissionPayment} from "@/api/ecw/financial";
import {parseTime} from "../../../../utils/ruoyi";

export default {
  name: "commissionPaymentDetails",
  methods: {parseTime},
  props:{
    id:{
      type:[Number, String],
      default:()=>0
    },
  },
  data(){
    return {
      record:{}
    }
  },
  watch:{
    id:{
      handler:function (newVal){
        commissionPaymentGetPaymentApprove({id:newVal}).then(r => {
          getCommissionPayment({id:r.data.paymentId}).then(res => {
            this.record = res.data;
            this.record.reason = r.data.reason //申请理由
          })
        })
      },
      immediate:true,
    }
  }
}
</script>

<style scoped lang="scss">

</style>
