<!--
  @description: 查看退款信息
  @Modifier: sunxinman/haofengxian
  @routerPath: /fee/refundInfoDetail
  @date: 2020/03/30-18:30
-->
<template>
  <div>
    <section class="title p0-16 clearfix">
      <!-- 返回 -->
      <div class="title-back pointer" @click="back()">
        <i class="iconfont icon-fanhui mr10" />查看退款信息
      </div>
    </section>
    <section class="p0-16">
      <!-- 表格部分 -->
      <table class="tableData">
        <tr>
          <td>项目编号</td>
          <td>{{ tenderFormData.tenderNo }}</td>
          <td>项目名称</td>
          <td>{{ tenderFormData.tenderName }}</td>
        </tr>
        <tr>
          <td>标段（包）编号</td>
          <td>{{ tenderFormData.packNo }}</td>
          <td>标段（包）名称</td>
          <td>{{ tenderFormData.packName }}</td>
        </tr>
        <tr>
          <td>投标人</td>
          <td>{{ formData.supplierName }}</td>
          <td>联系电话</td>
          <td>{{ formData.supplierTel }}</td>
        </tr>
        <tr>
          <td>子账号</td>
          <td>{{ formData.accountNo }}</td>
          <td>保证金余额（元）</td>
          <td>{{ tenderFormData.totalBalance }}</td>
        </tr>
        <tr>
          <td>退款账户名称</td>
          <td>{{ formData.desName }}</td>
          <td>退款开户行</td>
          <td>{{ formData.desBankName }}</td>
        </tr>
        <tr>
          <td>联行号</td>
          <td>{{ formData.desBankNo }}</td>
          <td>退款账号</td>
          <td>{{ formData.desNo }}</td>
        </tr>
        <tr>
          <td>退款金额小写（元）</td>
          <td>{{ formData.refundAmount }}</td>
          <td>退款金额大写</td>
          <td>{{ numberChinese(formData.refundAmount) }}</td>
        </tr>
        <tr>
          <td>退款状态</td>
          <td>
            {{ filterDictText(detailRefundStatuList,formData.refundStatus) }}
          </td>
          <td>提交时间</td>
          <td>{{ formData.createTime }}</td>
        </tr>
        <tr>
          <td>退款时间</td>
          <td>{{ formData.refundTime }}</td>
          <td>退款成功时间</td>
          <td>{{ formData.refundEndTime }}</td>
        </tr>
        <tr>
          <td>备注</td>
          <td colspan="3">
            {{ formData.remark }}
          </td>
        </tr>
      </table>
    </section>
    <!--操作按钮-->
    <div class="but_footer">
      <div class="but_footer-h">
        <div class="but_footer-but">
          <el-button @click="back">
            关闭
          </el-button>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
/* 接口*/
import { detailDepositRefundDetailInfo, getPackSupplierUniqueBailfeeAccountInfo } from '@api/fee/bailfee'
/* 混合开发方法-参数字段*/
import { ListMixin } from '@/mixins/ListMixin'
import { cashDepositGroupMixin } from '../../mixins/cashDepositGroupMixin'
export default {
  name: 'RefundInfoDetail',
  mixins: [ListMixin, cashDepositGroupMixin],
  data() {
    return {
      refundDetailId: this.$route.params.refundDetailId,
      formData: {
        accountName: '', // 收款账户名称
        accountNo: '', // 收款账户
        bankName: '', // 收款银行名称
        bankNo: '', // 收款银行编号
        billId: '', // 保证金账号ID
        changeStatus: '', // 变更状态00未变更01有变更
        createTime: '', // 提交日期
        createUser: '', // 提交人
        createUserName: '', // 提交人名称
        desBankName: '', // 退款开户行
        desBankNo: '', // 退款联行号
        desName: '', // 退款账户名称
        desNo: '', // 退款账号
        errorStatus: '', // 是否错误来账00正常01错误
        packId: '', // 标段ID
        refundAmount: 0, // 退款金额
        refundDetailId: '', // 退款明细ID
        refundEndTime: '', // 退款完成时间
        refundId: '', // 退款主表ID
        refundStatus: '', // 退款状态
        refundStt: '', // 是否中标00未中01中标
        refundTime: '', // 退款时间
        refundType: '', // 退款类型01原路退款02跨行转账
        remark: '', // 备注说明
        seqNo: '', // 交易编号
        supplierName: '', // 投标人名称
        supplierTel: '', // 投标人联系电话
        winStatus: '' // 是否中标00未中01中标
      },
      tenderFormData: {
        tenderNo: '',
        tenderName: '',
        packNo: '',
        packName: ''
      }
    }
  },
  created() {
    // 查看保证金退款详细信息
    this.getDetailInfo()
    this.getBailfeeAccountInfo()
  },
  methods: {
    // 查看保证金退款详细信息
    getDetailInfo() {
      detailDepositRefundDetailInfo(this.refundDetailId).then(res => {
        this.formData = res.data
      }).catch(() => {
      })
    },
    // 通过指定包组供应商获取唯一保证金虚拟子账号
    getBailfeeAccountInfo() {
      const supplierId = this.$route.params.supplierId
      const packId = this.$route.params.packId
      getPackSupplierUniqueBailfeeAccountInfo(packId, supplierId).then(res => {
        const { data } = res
        if (data) {
          this.tenderFormData = {
            tenderNo: data.tenderNo,
            tenderName: data.tenderName,
            packNo: data.packNo,
            packName: data.packName,
            totalBalance: data.totalBalance
          }
        }
      }).catch(() => {
      })
    },
    // 返回
    back() {
      const queryData = {
        ...this.$route.params
      }
      delete queryData.refundDetailId
      this.$router.push({
        path: '/fee/refundManage',
        name: 'RefundManageList',
        params: {
          ...queryData
        }
      })
    }
  }
}
</script>
<style lang="less" scoped>

</style>
