huanKuanModal.vue 9.92 KB
<template>
  <a-modal
    :maskClosable="false"
    :title="title"
    :width="1000"
    :centered="false"
    :visible="visible"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    :confirmLoading="confirmLoading"
    @ok="handleSubmit"
    @cancel="handleCancel"
    cancelText
    style="top:20px;"
    class="scoped-person"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-card title="还款基本信息" :bordered="false">
          <!-- <a-row :gutter="24">
                <a-col :span="12">
                  <a-form-item label="进件流编号" :labelCol="{span:8}" :wrapperCol="{span:16}">
                    <a-select v-decorator="[ 'collectionNo', {'initialValue':repaymentAccountInfo?repaymentAccountInfo.collectionNo:'',rules:[{required: true,message: '请选择进件流编号'}]}]" :disabled="!!repaymentAccountInfo.collectionNo" placeholder="请选择进件流编号">
                      <a-select-option v-for="(item, index) in creditList" :key="index" :value="item.collectionNo">
                          {{item.collectionName}}
                        </a-select-option>
                    </a-select>
                  </a-form-item>
                </a-col>
          </a-row>-->
          <a-row :gutter="24">
            <a-col :span="12">
              <a-form-item label="还款支付流水号" :labelCol="{span:8}" :wrapperCol="{span:16}" hasFeedback>
                <p>{{recodes.paymentOrderNo||'暂无'}}</p>
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item label="还款时间" :labelCol="{span:8}" :wrapperCol="{span:16}" hasFeedback>
                <p>{{recodes.repaymentDate||'暂无'}}</p>
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item label="还款金额(元)" :labelCol="{span:8}" :wrapperCol="{span:16}" hasFeedback>
                <p>{{this.$numMoney(recodes.money)||'暂无'}}</p>
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item label="还款方式" :labelCol="{span:8}" :wrapperCol="{span:16}" hasFeedback>
                <p>{{recodes.paymentWay==1?'线上':'线下'}}</p>
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item label="还款通道" :labelCol="{span:8}" :wrapperCol="{span:16}" hasFeedback>
                <p>{{recodes.paymentChannel||'暂无'}}</p>
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item label="还款状态" :labelCol="{span:8}" :wrapperCol="{span:16}" hasFeedback>
                <p>{{changePay(recodes.paymentState)}}</p>
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item label="备注" :labelCol="{span:8}" :wrapperCol="{span:16}" hasFeedback>
                <p>{{recodes.remark||'暂无'}}</p>
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item label="失败原因" :labelCol="{span:8}" :wrapperCol="{span:16}" hasFeedback>
                <p>{{recodes.failDesc||'暂无'}}</p>
              </a-form-item>
            </a-col>
          </a-row>
        </a-card>
        <a-card title="还款账单信息" :bordered="false">
          <a-row :gutter="24">
            <a-col>
              <a-table
                ref="table"
                size="middle"
                bordered
                :columns="textData"
                :dataSource="bills"
                :pagination="false"
              >
                <span slot="action" slot-scope="text, record">
                  <!-- <a @click="handleTextLook(record)">查看</a>
                  <a-divider type="vertical" />-->
                </span>
              </a-table>
            </a-col>
          </a-row>
          <!-- <a-row :gutter="24" v-show="!disableSubmit" style="float:right;margin-right:20px;">
                <a-button style="margin-right:10px;" @click="handleCancel">取消</a-button>
                <a-button type="primary" @click="handleSubmit">确定</a-button>
          </a-row>-->
        </a-card>
        <a-card title="还款账户信息" :bordered="false">
          <a-row :gutter="24">
            <a-col :span="12">
              <a-form-item label="还款账户名称" :labelCol="{span:8}" :wrapperCol="{span:16}" hasFeedback>
                <p>{{repaymentAccountInfo.accountName}}</p>
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item label="还款账户号" :labelCol="{span:8}" :wrapperCol="{span:16}" hasFeedback>
                <p>{{repaymentAccountInfo.accountNo}}</p>
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item label="还款银行名称" :labelCol="{span:8}" :wrapperCol="{span:16}" hasFeedback>
                <p>{{repaymentAccountInfo.bankName}}</p>
              </a-form-item>
            </a-col>
          </a-row>
        </a-card>
        <a-card title="收款账户信息" :bordered="false">
          <a-row :gutter="24">
            <a-col :span="12">
              <a-form-item label="收款账户名称" :labelCol="{span:8}" :wrapperCol="{span:16}" hasFeedback>
                <p>{{paymentAccountInfo.accountName}}</p>
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item label="收款账户号" :labelCol="{span:8}" :wrapperCol="{span:16}" hasFeedback>
                <p>{{paymentAccountInfo.accountNo}}</p>
              </a-form-item>
            </a-col>
          </a-row>
        </a-card>
      </a-form>
    </a-spin>
  </a-modal>
</template>
<script>
function getBase64(img, callback) {
  const reader = new FileReader()
  reader.addEventListener('load', () => callback(reader.result))
  reader.readAsDataURL(img)
}

import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
import pick from 'lodash.pick'
import moment from 'moment'
import { JeecgListMixin } from '@/mixins/CoreListMixin'
import { paymentState } from '@/data/params'
import { modifyCollPersonalApply, queryCollPersonalApplyDetail, postAction } from '@/api/configApi'

export default {
  name: 'huanKuanModal',
  mixins: [JeecgListMixin],
  components: {},
  data() {
    return {
      title:'',
      visible: false,
      confirmLoading: false,
      disableSubmit: false,
      onlyread: true,
      paymentState: paymentState,
      recodes: {}, //详情基础信息
      id: '',
      validatorRules: {
        idCard: {
          rules: [
            {
              required: true,
              pattern: /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X|x)$/,
              message: '请输入身份证号'
            }
          ]
        }
      },
      creditList: '',
      model: {},
      textData: [
        {
          title: '序号',
          dataIndex: '',
          key: 'rowIndex',
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '账单编号',
          align: 'center',
          dataIndex: 'billNo'
        },
        {
          title: '子账单编号',
          align: 'center',
          dataIndex: 'subBillNo'
        },
        {
          title: '账单类型',
          align: 'center',
          dataIndex: 'billType',
          customRender: function(t, r, index) {
            switch (t) {
              // 10借款账单、20服务费账单
              case 10:
                return '借款账单'
                break;
              case 20:
                return '服务费账单'
                break;
              case 30:
                return '借款服务费账单'
                break;
            }
          }
        }
      ],
      repaymentAccountInfo: {}, // 还款账户信息
      paymentAccountInfo: {}, // 收款账户信息
      bills: [], // 账单列表
      form: this.$form.createForm(this),
      dateFormat: 'YYYY-MM-DD',
      disableMixinCreated: true,
      url: {
        imgerver: window._CONFIG['domianURL'] + '/sys/common/view',
        syncUser: '/process/extActProcess/doSyncUser'
        // list: '/repaymentAccountInfo/queryCollPersonalApplyList',
      }
    }
  },
  created() {
    console.log('created')
  },
  methods: {
    //转化还款状态
    changePay(t) {
      for (var i = 0; i < this.paymentState.length; i++) {
        if (t == this.paymentState[i].value) {
          return this.paymentState[i].label
        }
      }
      // console.log(t)
      return '暂无'
    },
    moment,
    edit(res, applyNo) {
      this.defaultTabKey = '1'
      this.recodes = res
      this.repaymentAccountInfo = res.repaymentAccountInfo || {}
      this.paymentAccountInfo = res.paymentAccountInfo || {}
      console.log(this.paymentAccountInfo)
      this.bills = res.bills || []
      this.form.resetFields()
      this.visible = true
      this.$nextTick(() => {})
    },
    add() {
      this.model = {}
      this.form.resetFields()
      this.visible = true
      this.$nextTick(() => {})
    },

    close() {
      this.$emit('close')
      this.visible = false
      this.disableSubmit = false
      this.selectedRole = []
    },
    handleSubmit() {
      this.$emit('ok')
    },
    handleCancel() {
      this.close()
    },
    // tabs 回调
    callback() {}
  }
}
</script>
<style>
.scoped-person .ant-modal-body {
  padding: 0 24px !important;
}
.scoped-person .ant-modal-body {
  overflow-y: scroll;
  min-height: 600px;
  max-height: 600px !important;
}
.scoped-person .ant-tabs-bar {
  margin-bottom: 0;
}
.scoped-person .ant-card-body {
  padding: 10px 24px;
}
.scoped-person .ant-layout-sider {
  flex: 0 0 300px;
  max-width: 300px !important;
  min-width: 300px !important;
  width: 300px !important;
}
.scoped-person .ant-modal-footer {
  display: none;
}
.scoped-person .scoped-img img {
  width: 200px;
}
</style>