CommonLoanListModal.vue 15.6 KB
<template>
  <a-modal :title="title" :width="1000" :centered="false" :visible="visible" :footer="null" :confirmLoading="confirmLoading" @ok="handleSubmit" @cancel="handleCancel" cancelText :maskClosable="false" style="top:20px;" class="scope-loan">
    <a-tabs defaultActiveKey="1" v-model="defaultTabKey" @change="callback" :animated="false">
      <a-tab-pane tab="借款信息" key="1">
        <a-spin :spinning="confirmLoading">
          <a-card title="个人基本信息" :bordered="false" v-if="userType == 1">
            <a-row :gutter="24">
              <a-col :span="12">
                <a-form-item label="客户名称" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div>{{detailData.idcardName}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="身份证号码" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div>{{detailData.idcardNoView}}</div>
                </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}">
                  <div>{{detailData.mobilePhoneView}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="授信申请单号" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div>{{detailData.mobilePhoneView}}</div>
                </a-form-item>
              </a-col>
            </a-row>
          </a-card>
          <a-card title="企业基本信息" :bordered="false" v-else-if="userType == 2">
            <a-row :gutter="24">
              <a-col :span="12">
                <a-form-item label="企业名称" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div>{{detailData.enterpriseName}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="统一社会信用代码" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div>{{detailData.orgCode}}</div>
                </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}">
                  <div>{{detailData.contactsName}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="联系人手机号" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div>{{detailData.contactsPhone}}</div>
                </a-form-item>
              </a-col>
            </a-row>
          </a-card>
          <a-card title="企业法定代表人基本信息" :bordered="false" v-else-if="userType==3">
            <a-row :gutter="24">
              <a-col :span="12">
                <a-form-item label="客户名称" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div>{{detailData.idcardName}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="身份证号码" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div>{{detailData.idcardNoView}}</div>
                </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}">
                  <div>{{detailData.mobilePhoneView}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="企业名称" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div>{{detailData.enterpriseName}}</div>
                </a-form-item>
              </a-col>
            </a-row>
          </a-card>
          <a-card title="用信申请信息" :bordered="false">
            <a-row :gutter="24" v-if="detailData.status!=31 && detailData.status!=21 ">
              <a-button style="margin-bottom:10px;float:right;position:relative;z-index:10;" @click="handleRepaymentPlanTrial" type="primary">还款计划试算</a-button>
            </a-row>
            <a-row :gutter="24">
              <a-col :span="12">
                <a-form-item label="借款订单号" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div>{{detailData.orderNo}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="申请时间" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div>{{detailData.applyDate}}</div>
                </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}">
                  <div class="c189 fw">{{this.$numMoney(detailData.applyMoney)}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="借款审批状态" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div class="c189" v-for="(item,index) in loanApplyStatusCode" :key="index" v-if="detailData.status==item.name">
                    {{item.title}}
                  </div>
                </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}">
                  <div>{{detailData.productName}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="产品类型" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div v-for="(item,index) in dbProductType" :key="index" v-if="detailData.productType==item.name">{{item.title}}</div>
                </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}">
                  <div>{{detailData.termType==2?detailData.term+'&nbsp;&nbsp;个月':detailData.termType==1?detailData.term+'&nbsp;&nbsp;天':detailData.term+'&nbsp;&nbsp;年'}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="还款方式" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div v-for="(item,index) in dbRepaymentType" :key="index" v-if="detailData.repaymentType==item.name">{{item.title}}</div>
                </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}">
                  <div>{{detailData.repaymentDay?detailData.repaymentDay+'&nbsp;日':''}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="产品利率(%)" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div>{{detailData.interestRate}}</div>
                </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}">
                  <div>{{detailData.penaltyRate}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="服务费用合计(元)" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div>{{detailData.feeSum}}</div>
                </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}">
                  <div>{{detailData.fundNo}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="资金方名称" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div>{{detailData.fundName}}</div>
                </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}">
                  <div v-for="(item,index) in programOffices" :key="index" v-if="detailData.businessDepartmentNo==item.name">{{item.title}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="业务名称" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div v-for="(item,index) in dbBusinessChannel" :key="index" v-if="detailData.businessChannelNo==item.name">{{item.title}}</div>
                </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}">
                  <div v-for="(item,index) in dbCooPerationPlatform" :key="index" v-if="detailData.cooperationPlatformNo==item.name">{{item.title}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="产品分类名称" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div v-for="(item,index) in dbProductCategory" :key="index" v-if="detailData.productCategoryNo==item.name">{{item.title}}</div>
                </a-form-item>
              </a-col>
            </a-row> -->
          </a-card>
        </a-spin>
        <repayment-plan-modal ref="repaymentPlanModal"></repayment-plan-modal>
        <cost-detail-modal :userType.sync="userType" ref="costDetailModal"></cost-detail-modal>
      </a-tab-pane>
      <a-tab-pane tab="放款信息" key="2" forceRender>
        <record-lending :userType.sync="userType" ref="lending" :orderNo.sync="orderNo">
        </record-lending>
      </a-tab-pane>
      <a-tab-pane tab="还款计划" key="3" forceRender>
        <repayment-plan :userType.sync="userType" ref="repaymentPlan" :orderNo.sync="orderNo">
        </repayment-plan>
      </a-tab-pane>
    </a-tabs>
  </a-modal>
</template>
<script>
import { JeecgListMixin } from '@/mixins/CoreListMixin'
import { queryChargeList, onceInterestRepaymentCalculation, repaymentPlanCalculation } from '@/api/makeLoan'
import repaymentPlanModal from './common/repaymentPlanModal' // 还款计划试算
import recordLending from './common/recordLending'// tab切换 放款信息
import costDetailModal from './common/costDetailModal' // 费用详细查看
import repaymentPlan from './common/repaymentPlan' // 还款计划

export default {
  name: 'CommonLoanListModal',
  mixins: [JeecgListMixin],
  components: {
    repaymentPlanModal, // 还款计划试算
    recordLending, // 放款信息
    costDetailModal, // 费用详细查看
    repaymentPlan, // 还款计划
  },
  data () {
    return {
      visible: false,
      confirmLoading: false,
      title: '',
      disableSubmit: false,
      orderNo: '',
      defaultTabKey: '',
      userType: '',
      programOffices: JSON.parse(sessionStorage.getItem('PROGRAMOFFICES')), // 组织机构
      dbBusinessChannel: JSON.parse(sessionStorage.getItem('DB_BUSINESS_CHANNEL')), // 业务线名称
      dbCooPerationPlatform: JSON.parse(sessionStorage.getItem('DB_COOPERATION_PLATFORM')), // 合作平台
      dbProductCategory: JSON.parse(sessionStorage.getItem('DB_PRODUCT_CATEGORY')), // 产品分类
      loanApplyStatusCode: JSON.parse(sessionStorage.getItem('LOAN_APPLY_STATUS_CODE')), // 借款审批状态
      dbProductType: JSON.parse(sessionStorage.getItem('DB_PRODUCT_TYPE')), // 产品类型
      dbRepaymentType: JSON.parse(sessionStorage.getItem('DB_REPAYMENT_TYPE')), // 还款方式
      model: {},
      detailData: {},
      collPersonalApply: {}, // 进件信息
      collCusBasicInfo: {}, // 个人基本信息
      collCusContactInfoList: [], // 联系人信息
      collCusBankAccountList: [], // 银行账户信息
      collCusExtAttachmentList: {}, // 自定义附件信息
      collCusExtObjDataList: {}, // 自定义文本信息
      collCreditStatusList: {}, // 认证状态信息
      form: this.$form.createForm(this),
      disableMixinCreated: true,
    }
  },
  methods: {
    edit (res, orderNo, userType) {
      this.userType = userType
      console.log(this.loanApplyStatusCode)
      this.defaultTabKey = '1'
      this.detailData = res
      this.assignment(res)
      this.orderNo = orderNo
      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 = []
    },
    handleCancel () {
      this.close()
    },
    handleSubmit () {

    },
    // tabs 回调
    callback (key) {
      if (key == 2) {
        this.$refs.lending.loadData()
      } else if (key == 3) {
        this.$refs.repaymentPlan.loadData()
      }
    },
    assignment (res) {
      this.model = res ? res : {}
      this.collPersonalApply = this.model.collPersonalApply
      this.collCusBasicInfo = this.model.collCusBasicInfo
      this.collCusContactInfoList = this.model.collCusContactInfoList
      this.collCusBankAccountList = this.model.collCusBankAccountList
      this.collCusExtAttachmentList = this.model.collCusExtAttachmentList
      this.collCusExtObjDataList = this.model.collCusExtObjDataList
      this.collCreditStatusList = this.model.collCreditStatusList
    },
    handleRepaymentPlanTrial () { // 还款计划试算
      console.log(this.detailData.productVersion)
      let _p = {
        "productNo": this.detailData.productNo,
        'loanMoney': this.detailData.applyMoney,
        'version': this.detailData.productVersion
      }
      console.log(_p)
      if (this.detailData.productType == 1) { //产品类型 1 非分期 2分期
        onceInterestRepaymentCalculation(_p).then(res => {
          if (res.status.statusCode == 0) {
            this.$refs.repaymentPlanModal.edit(res.result, 1)
            this.$refs.repaymentPlanModal.disableSubmit = true
          } else {
            this.$message.warning(res.status.statusReason)
          }
        })
      } else {
        repaymentPlanCalculation(_p).then(res => {
          if (res.status.statusCode == 0) {
            this.$refs.repaymentPlanModal.edit(res.result.repaymentPlanList, 2)
            this.$refs.repaymentPlanModal.disableSubmit = true
          } else {
            this.$message.warning(res.status.statusReason)
          }
        })
      }
    },
    costDetailLook () { // 费用详细查看
      let _p = { "orderNo": this.orderNo }
      queryChargeList(_p).then(res => {
        if (res.status.statusCode == 0) {
          this.$refs.costDetailModal.edit(res.result)
          this.$refs.costDetailModal.disableSubmit = true
        } else {
          this.$message.warning(res.status.statusReason)
        }
      })
    },
  }
}
</script>
<style>
.scope-loan .ant-form-item {
  margin-bottom: 12px;
}
.scope-loan .ant-card-body {
  padding: 20px 24px 0;
}
.scope-loan .c189 {
  color: #1890ff;
}
.scope-loan .fw {
  font-weight: bold;
}
</style>