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