<!--
  @description: 确认来款信息
  @Modifier: sunxinman
  @routerPath: /fee/confirmCollectionInfo
  @date: 2020/03/25-10:45
-->
<template>
  <div>
    <section class="title p0-16 clearfix">
      <!-- 返回 -->
      <div class="title-back pointer" @click="back()">
        <i class="iconfont icon-fanhui mr10" />{{ title }}
      </div>
    </section>
    <section class="p0-16">
      <!-- 表格部分 -->
      <table class="tableData">
        <tr>
          <td>子账号</td>
          <td>{{ formData.accountNo }}</td>
          <td>交易金额（元）</td>
          <td>{{ formData.amount }}</td>
        </tr>
        <tr>
          <td>投标人名称</td>
          <td>{{ formData.supplierName }}</td>
          <td>收款编号</td>
          <td>{{ formData.seqNo }}</td>
        </tr>
        <tr>
          <td>交易类型</td>
          <td>普通外部转账</td>
          <td>交易日期</td>
          <td>
            {{ formData.inDate }}
          </td>
        </tr>
        <tr>
          <td>对方账号</td>
          <td>{{ formData.payerNo }}</td>
          <td>对方账户名称</td>
          <td>{{ formData.payerName }}</td>
        </tr>
        <tr>
          <td>状态</td>
          <td>
            {{ filterDictText(cashDepositStatuslist, formData.payStatus) }}
          </td>
          <td>手续费金额（元）</td>
          <td />
        </tr>
        <tr>
          <td>联行号</td>
          <td>{{ formData.payerBankNo }}</td>
          <td>摘要</td>
          <td />
        </tr>
        <tr v-if="isShowAffirm==='00'">
          <td><i class="red-star">*</i> 来款是否正确</td>
          <td colspan="3">
            <el-radio-group v-model="confirmStatus">
              <el-radio
                v-for="(item,index) in isThePaymentCorrectList"
                :key="index"
                :label="item.typecode"
              >
                {{ item.typename }}
              </el-radio>
            </el-radio-group>
          </td>
        </tr>
      </table>
    </section>
    <!--操作按钮-->
    <div class="but_footer">
      <div class="but_footer-h">
        <div class="but_footer-but">
          <el-button v-if="isShowAffirm==='00'" type="primary" @click="confirmationInfo()">
            确认
          </el-button>
          <el-button @click="back">
            关闭
          </el-button>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
/* 接口*/
import { getAccountBillInfo, confirmBillStatus } from '@api/fee/bailfee'
/* 混合开发方法-参数字段*/
import { cashDepositGroupMixin } from '../../mixins/cashDepositGroupMixin'

export default {
  name: 'ConfirmCollectionInfo',
  components: {
  },
  mixins: [cashDepositGroupMixin],
  data() {
    return {
      isShowAffirm: this.$route.params.type, // 是否显示确认 00显示确认 01不显示
      title: '确认来款信息',
      formData: {},
      billId: this.$route.params.billId, // 交易信息ID
      confirmStatus: '01' // 来框是否正确 01正确 02错误
    }
  },
  created() {
    this.getAccountBillInfoDetail()
    if (this.isShowAffirm === '01') {
      this.title = '查看来款信息'
    }
  },
  methods: {
    // 获取账号交易信息详情
    getAccountBillInfoDetail() {
      getAccountBillInfo(this.billId).then(res => {
        this.formData = res.data
      })
    },
    // 确认
    confirmationInfo() {
      const params = {
        billId: this.billId,
        confirmStatus: this.confirmStatus
      }
      confirmBillStatus(params).then(res => {
        this.$message({
          type: 'success',
          message: '操作成功'
        })
        this.back()
      })
    },
    // 返回
    back() {
      this.$router.push({
        path: '/fee/collectionRecords',
        name: 'CollectionRecordsList',
        params: {
          packId: this.$route.params.packId
        }
      })
    }
  }
}
</script>
<style lang="less" scoped>

</style>
