hetong.vue 4.92 KB
<template>
  <a-modal
    title="担保详情"
    :width="1000"
    :centered="true"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :okButtonProps="{ props: { disabled: disableSubmit } }"
    @cancel="handleCancel"
    cancelText="关闭"
    style="top: 20px"
    :maskClosable="false"
  >
    <a-spin :spinning="confirmLoading">
      <a-table
        ref="table"
        size="middle"
        bordered
        :columns="bankData"
        :dataSource="model"
        :pagination="false"
        :loading="loading"
        :rowKey="(record, index) => index"
      >
        <!-- 字符串超长截取省略号显示-->
        <span slot="esContent" slot-scope="text">
          <j-ellipsis :value="text" :length="10" />
        </span>
      </a-table>
    </a-spin>
    <hetong-modal
      ref="commonBankAccountModal"
      :recordOrderNo.sync="recordOrderNo"
      :customerType.sync="customerType"
      :orderNo.sync="orderNo"
      :modelList.sync="modelList"
      @ok="load"
    ></hetong-modal>
    <template slot="footer">
      <a-button @click="handleCancel">关闭</a-button>
    </template>
  </a-modal>
</template>

<script>
import { changPassword } from '@/api/api'
import { deleteContractManagement, listIContractManagement } from '@/api/insys'
// import hetongModal from './hetongModal.vue';
export default {
  name: 'hetong',
  // components: { hetongModal },
  data() {
    return {
      visible: false,
      confirmLoading: false,
      confirmDirty: false,
      loading: false,
      bankData: [
        {
          title: '序号',
          dataIndex: '',
          key: 'rowIndex',
          align: 'center',
          width: 60,
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '担保签约日期',
          align: 'center',
          dataIndex: 'guaranteeTimeContract',
        },
        {
          title: '借款订单编号',
          align: 'center',
          dataIndex: 'orderNo',
        },
        {
          title: '借款人名称',
          align: 'center',
          dataIndex: 'orderName',
        },
        {
          title: '担保额度(元)',
          align: 'center',
          dataIndex: 'guarantorAmount',
          customRender: (t, r, index) => {
            return this.$numMoney(t)
          }
        },
        {
          title: '本次担保金额(元)',
          align: 'center',
          dataIndex: 'guaranteeAmount',
          customRender: (t, r, index) => {
            return this.$numMoney(t)
          }
        },
        {
          title: '释放日期',
          align: 'center',
          dataIndex: 'releaseDate',
        },
      ],
      disableMixinCreated: true,
      title: '',
      type: 'add',
      dbList: [],
      onlyread: false,
      disableSubmit: true,
      model: [],
      modelList: [],
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 },
      },
      form: this.$form.createForm(this),
      id: '',
      bao: '1',
      recordOrderNo: '',
      customerType: '',
      orderNo: '',
    }
  },
  created() {
    console.log('created')
  },
  methods: {
    edit(username) {
      console.log(username)
      this.type = 'edit'
      this.form.resetFields()
      this.visible = true
      this.modelList = username
      this.model = username
      this.$nextTick(() => {
        this.form.setFieldsValue(username)
      })
    },
    onChange() {
      this.close()
    },
    close() {
      this.$emit('close')
      this.visible = false
      this.disableSubmit = false
      this.selectedRole = []
    },
    handleAddModal(title) {
      this.$refs.commonBankAccountModal.add(this.applyNo)
      this.$refs.commonBankAccountModal.title = title ? title : '新增'
      this.$refs.commonBankAccountModal.disableSubmit = false
      this.$emit('success')
      // alert(this.addList)
    },
    handleAddModalEdit(title, record) {
      this.$refs.commonBankAccountModal.edit(record)
      this.$refs.commonBankAccountModal.title = title ? title : '修改'
      this.$refs.commonBankAccountModal.disableSubmit = false
      this.$emit('success')
    },
    load() {
      let _p = {
        params: {
          customerNo: this.recordOrderNo,
        },
      }
      listIContractManagement(_p).then((res) => {
        if (res.status.statusCode == 0) {
          this.model = res.result.records
        } else {
          this.$message.warning(res.status.statusReason)
        }
      })
    },
    handleDelete(record) {
      console.log(record)
      let _p = { id: record.id }
      deleteContractManagement(_p).then((res) => {
        if (res.status.statusCode == 0) {
          this.load()
          this.$message.success(res.status.statusReason)
        } else {
          this.$message.warning(res.status.statusReason)
        }
      })
    },
    handleCancel() {
      this.close()
    },
  },
}
</script>