<!--
  @description: 异常缴费处理-详情
  @Modifier: haofengxian
  @routerPath:
  @date: 2021-3-11-14:03
-->
<template>
  <div>
    <table class="tableData">
      <tr>
        <td>
          异常虚拟订单号
        </td>
        <td>{{ formData.excepFictOrderCode }}</td>
        <td>
          供应商名称
        </td>
        <td>{{ formData.supplierName }}</td>
      </tr>
      <tr>
        <td>
          入账银行账号
        </td>
        <td>{{ formData.bankno }}</td>
        <td>
          入账时间
        </td>
        <td>{{ formData.entryTime }}</td>
      </tr>
      <tr>
        <td>
          需处理异常金额(元)
        </td>
        <td colspan="3">
          {{ numFilter(formData.excepHandMoney) }}
        </td>
      </tr>
      <tr>
        <td>
          异常原因
        </td>
        <td colspan="3">
          {{ formData.excepRemarks }}
        </td>
      </tr>
      <tr>
        <td>说明文件</td>
        <td colspan="3">
          <downloadFile :data="upLoadData" />
        </td>
      </tr>
    </table>
  </div>
</template>

<script>
/* api*/
import { payeeSingleExcepHandDetails, excepPayeeHandDetailsInfo } from '@/api/procurement/procurementOrder'
/* 公用方法*/
import downloadFile from '@comp/common/updownload/downloadFile' // 获取附件信息 下载组件
import { orderServeFeeMixins } from '../../mixins/orderServeFeeMixins'
export default {
  name: 'ServiceOrderAbnormalPayProcessingDialog',
  components: {
    downloadFile // 文件下载
  },
  mixins: [orderServeFeeMixins],
  props: {
    orderReceiptInfo: {
      type: Object,
      default: () => {}
    },
    // 详情类型 00审核中服务费查看 01异常处理记录查看
    detailType: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      flowStatus: this.$route.query.flowStatus, // 工作流进入
      formData: {
        excepFictOrderCode: 'O99999999999',
        recordId: '', // 异常费用ID
        excepRemarks: '', // 备注
        supplierId: '', // 供应商ID
        supplierName: '', // 供应商名称
        excepHandMoney: '' // 需处理异常金额
      },
      upLoadData: {
        bizId: '',
        fileType: 'excep_pay_handle'
      }
    }
  },
  mounted() {
    this.handleFlow()
  },
  methods: {
    // 工作流进入
    handleFlow() {
      let id = ''
      if (this.flowStatus) {
        id = this.$route.query.packId
        this.getExcepPayeeHandDetailsInfo(id)
      } else {
        id = this.orderReceiptInfo.id
        if (this.detailType === '00') {
          this.getPayeeSingleExcepHandDetails(id)
        }
        if (this.detailType === '01') {
          this.getExcepPayeeHandDetailsInfo(id)
        }
      }
    },
    // 审批详情-- 异常缴纳处理
    getPayeeSingleExcepHandDetails(id) {
      payeeSingleExcepHandDetails(id).then(res => {
        this.formData = res.data
      }).catch(() => {
      })
    },
    // 异常缴费处理记录详情
    getExcepPayeeHandDetailsInfo(id) {
      excepPayeeHandDetailsInfo(id).then(res => {
        this.formData = res.data
      }).catch(() => {
      })
    }
  }
}
</script>

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