<!--
  @description: 减免收费单-详情
  @Modifier：王俊楠
  @routerPath:
  @date：  2020-11-03 09:31:27
-->
<template>
  <div>
    <table class="tableData mb10">
      <tr>
        <td>流水号</td>
        <td>{{ formData.orderCode }}</td>
        <td>供应商名称</td>
        <td>{{ formData.supplierName }}</td>
      </tr>
      <tr>
        <td>应收服务费金额（元）</td>
        <td>
          {{ numFilter(formData.shouldChargeMoney) }}
        </td>
        <td>减免服务费金额（元）</td>
        <td>
          {{ numFilter(formData.reliefMoney) }}
        </td>
      </tr>
      <tr>
        <td>收取服务费金额（元）</td>
        <td colspan="3">
          {{ numFilter(formData.voucherMoney) }}
        </td>
      </tr>
      <tr>
        <td>
          减免收费原因
        </td>
        <td colspan="3">
          {{ formData.remark }}
        </td>
      </tr>
      <tr>
        <td>说明文件</td>
        <td colspan="3">
          <downloadFile v-if="jmskdFileTypeData.bizId" :data="jmskdFileTypeData" />
        </td>
      </tr>
    </table>
    <el-table
      ref="singleTable"
      :data="formData.reductionServiceFeeDtos"
    >
      <el-table-column
        type="index"
        label="序号"
        align="center"
        width="50"
      />
      <el-table-column
        prop="orderCode"
        label="订单编号"
        align="center"
        width="180"
      />
      <el-table-column
        :formatter="formatterOrderTotalMoney"
        prop="orderTotalMoney"
        label="订单含税金额（元）"
        align="right"
        min-width="120"
        header-align="center"
      />
      <el-table-column
        :formatter="formatterOrderTotalMoney"
        prop="amountServiceFeeMoney"
        label="应收服务费金额（元）"
        align="right"
        min-width="150"
        header-align="center"
      />
      <el-table-column
        :formatter="formatterOrderTotalMoney"
        prop="reductionServiceFeeMoney"
        label="减免金额"
        min-width="200"
        header-align="center"
        align="center"
      />
      <el-table-column
        prop="tenderNo"
        label="采购单结果"
        min-width="200"
        header-align="center"
        align="center"
      />
    </el-table>
  </div>
</template>

<script>
/* api*/
import { payeeSingleDetails } from '@/api/procurement/procurementOrder'
/* 常用方法 */
import { moneyFormat } from '@assets/js/utils'
/* 公用方法*/
import downloadFile from '@comp/common/updownload/downloadFile' // 获取附件信息 下载组件
import { orderServeFeeMixins } from '../../mixins/orderServeFeeMixins'
export default {
  name: 'ProcurementServeOrderReceiptSureDialog',
  components: {
    downloadFile // 文件下载
  },
  mixins: [orderServeFeeMixins],
  props: {
    orderReceiptInfo: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      flowStatus: this.$route.query.flowStatus, // 工作流进入
      // 说明文件类型
      upLoadData: {},
      formData: {
        ifRelief: '', // 是否减免 0 否 1是
        purchaseDepartName: '', // 采购单位名称
        // 服务费明细
        reductionServiceFeeDtos: [],
        reliefMoney: '', // 减免 金额
        remark: '', // 备注
        serviceFeeIds: '', // 服务费详情Id 用逗号分隔
        supplierId: '', // 供应商id
        supplierName: '', // 供应商名称
        voucherMoney: '', // 服务费金额
        shouldChargeMoney: '' // 应收服务费金额
      }
    }
  },
  mounted() {
    // 工作流进入
    let id = ''
    if (this.flowStatus) {
      id = this.$route.query.packId
    } else {
      id = this.orderReceiptInfo.id
    }
    this.getPayeeSingleDetails(id)
  },
  methods: {
    moneyFormat,
    // 审批详情--收款单、减免收款单
    getPayeeSingleDetails(id) {
      payeeSingleDetails(id).then(res => {
        this.formData = res.data
        this.jmskdFileTypeData.bizId = this.formData.bizId
      }).catch(() => {
      })
    }
  }
}
</script>

<style scoped lang="less">
</style>
