CommonBillListModal.vue 11.8 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="titleName" key="1">
        <a-spin :spinning="confirmLoading">
          <a-card title="客户信息" :bordered="false">
            <a-row :gutter="24">
              <a-col :span="8">
                <a-form-item v-if="userType == 1 || userType == 3" label="客户名称" :labelCol="{ span: 8 }"
                  :wrapperCol="{ span: 16 }">
                  <div>{{ detailData.idCardName }}</div>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item v-if="userType == 1 || userType == 3" label="身份证号码" :labelCol="{ span: 8 }"
                  :wrapperCol="{ span: 16 }">
                  <div>{{ detailData.idCardNoView }}</div>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item v-if="userType == 1 || userType == 3" label="客户手机号" :labelCol="{ span: 8 }"
                  :wrapperCol="{ span: 16 }">
                  <div>{{ detailData.mobilePhoneView }}</div>
                </a-form-item>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :span="8">
                <a-form-item v-if="userType == 2 || userType == 3" label="企业名称" :labelCol="{ span: 8 }"
                  :wrapperCol="{ span: 16 }">
                  <div>{{ detailData.enterpriseName }}</div>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item v-if="userType == 2 || userType == 3" label="统一社会信用代码" :labelCol="{ span: 10 }"
                  :wrapperCol="{ span: 14 }">
                  <div>{{ detailData.orgCode }}</div>
                </a-form-item>
              </a-col>
            </a-row>
          </a-card>
          <div v-if="billType == 10">
            <!-- 借款 -->
            <a-card title="账单信息" :bordered="false">
              <a-row :gutter="24">
                <a-col :span="8">
                  <a-form-item label="账单编号" :labelCol="{ span: 6 }" :wrapperCol="{ span: 18 }">
                    <div>{{ detailData.billNo }}</div>
                  </a-form-item>
                </a-col>
                <a-col :span="8">
                  <a-form-item label="产品名称" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
                    <div>{{ detailData.productName }}</div>
                  </a-form-item>
                </a-col>
                <a-col :span="8">
                  <a-form-item label="还款状态" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
                    <div class="c189" v-for="(item, index) in dbShowPayStatus" :key="index"
                      v-if="detailData.repaymentStatus == item.name || detailData.viewPayStatus == item.name">
                      {{ item.title }}
                    </div>
                  </a-form-item>
                </a-col>
              </a-row>
              <a-row :gutter="24">
                <a-col :span="8">
                  <a-form-item label="应还款总额(元)" :labelCol="{ span: 8 }" :wrapperCol="{ span: 14 }">
                    <div>{{ this.$numMoney(detailData.dueSumMoney) }}</div>
                  </a-form-item>
                </a-col>
                <a-col :span="8">
                  <a-form-item label="应还款日期" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
                    <div>{{ detailData.planTime ? detailData.planTime.slice(0, 10) : '' }}</div>
                  </a-form-item>
                </a-col>
                <a-col :span="8">
                  <a-form-item label="逾期天数" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
                    <div>{{ detailData.overDueDay }}</div>
                  </a-form-item>
                </a-col>
              </a-row>
              <a-row :gutter="24">
                <a-col :span="8">
                  <a-form-item label="应还本金(元)" :labelCol="{ span: 8 }" :wrapperCol="{ span: 14 }">
                    <div>{{ this.$numMoney(detailData.userPlanPrincipalMoney) }}</div>
                  </a-form-item>
                </a-col>
                <a-col :span="8">
                  <a-form-item label="应还利息(元)" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
                    <div>{{ this.$numMoney(detailData.userPlanInterestMoney) }}</div>
                  </a-form-item>
                </a-col>
                <a-col :span="8">
                  <a-form-item label="应还罚息(元)" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
                    <div>{{ this.$numMoney(detailData.userPlanPenaltyMoney) }}</div>
                  </a-form-item>
                </a-col>
              </a-row>
            </a-card>
            <a-card title="" :bordered="true">
              <a-row :gutter="24">
                <a-col :span="8">
                  <a-form-item label="已还款总额(元)" :labelCol="{ span: 10 }" :wrapperCol="{ span: 14 }">
                    <div>{{ this.$numMoney(detailData.userActualSumMoney) }}</div>
                  </a-form-item>
                </a-col>
                <a-col :span="8">
                  <a-form-item label="已还款本金(元)" :labelCol="{ span: 10 }" :wrapperCol="{ span: 14 }">
                    <div>{{ this.$numMoney(detailData.userActualPrincipalMoney) }}</div>
                  </a-form-item>
                </a-col>
                <a-col :span="8">
                  <a-form-item label="已还款利息(元)" :labelCol="{ span: 10 }" :wrapperCol="{ span: 14 }">
                    <div>{{ this.$numMoney(detailData.userActualInterestMoney) }}</div>
                  </a-form-item>
                </a-col>
              </a-row>
              <a-row :gutter="24">
                <a-col :span="8">
                  <a-form-item label="已还款罚息(元)" :labelCol="{ span: 10 }" :wrapperCol="{ span: 14 }">
                    <div>
                      {{ this.$numMoney(detailData.userActualPenaltyMoney) }}
                    </div>
                  </a-form-item>
                </a-col>
              </a-row>
            </a-card>
            <a-card title="" :bordered="false">
              <a-row :gutter="24">
                <a-col :span="8">
                  <a-form-item label="剩余应还本金(元)" :labelCol="{ span: 10 }" :wrapperCol="{ span: 14 }">
                    <div>
                      {{ this.$numMoney(detailData.userDuePrincipalMoney) }}
                    </div>
                  </a-form-item>
                </a-col>
                <a-col :span="8">
                  <a-form-item label="剩余应还利息(元)" :labelCol="{ span: 10 }" :wrapperCol="{ span: 14 }">
                    <div>{{ this.$numMoney(detailData.userDueInterestMoney) }}
                    </div>
                  </a-form-item>
                </a-col>
                <a-col :span="8">
                  <a-form-item label="剩余应还罚息(元)" :labelCol="{ span: 10 }" :wrapperCol="{ span: 14 }">
                    <div>{{ this.$numMoney(detailData.userDuePenaltyMoney) }}
                    </div>
                  </a-form-item>
                </a-col>
              </a-row>
            </a-card>
          </div>

          <!-- 费用 -->
          <a-card v-else title="账单信息" :bordered="false">
            <a-row :gutter="24">
              <a-col :span="8">
                <a-form-item label="子账单编号" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
                  <div>{{ detailData.billNo }}</div>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="产品名称" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
                  <div>{{ detailData.productName }}</div>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="还款状态" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
                  <div class="c189" v-for="(item, index) in dbShowPayStatus" :key="index"
                    v-if="detailData.repaymentStatus == item.name || detailData.viewPayStatus == item.name">
                    {{ item.title }}
                  </div>
                </a-form-item>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :span="8">
                <a-form-item label="应还费用(元)" :labelCol="{span:8}" :wrapperCol="{span:14}">
                  <div>{{detailData.dueSumMoney}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="应还款日期" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div>{{detailData.planTime?detailData.planTime.slice(0,10):''}}</div>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="逾期天数" :labelCol="{span:8}" :wrapperCol="{span:16}">
                  <div>{{detailData.overDueDay}}</div>
                </a-form-item>
              </a-col>
            </a-row>
          </a-card>
        </a-spin>
      </a-tab-pane>
      <a-tab-pane tab="还款信息" key="2" forceRender>
        <repay-msg :userType.sync="userType" ref="msg" :billNo.sync="billNo">
        </repay-msg>
      </a-tab-pane>
      <!-- <a-tab-pane tab="回购信息" key="3" forceRender>
        <back-msg :userType.sync="userType" ref="backMsg" :billNo.sync="billNo">
        </back-msg>
      </a-tab-pane> -->
    </a-tabs>
  </a-modal>
</template>
<script>
import { JeecgListMixin } from '@/mixins/CoreListMixin'
import { queryChargeList } from '@/api/makeLoan'
import repayMsg from './common/repayMsg'// tab切换 放款信息
import backMsg from './common/backMsg' // 还款计划

export default {
  name: 'CommonBillListModal',
  mixins: [JeecgListMixin],
  components: {
    repayMsg, // 放款信息
    backMsg, // 还款计划
  },
  data() {
    return {
      visible: false,
      confirmLoading: false,
      title: '',
      disableSubmit: false,
      billNo: '',
      defaultTabKey: '',
      userType: '',
      titleName: '',
      billType: '', // 1 借款 2 费用
      dbShowPayStatus: JSON.parse(sessionStorage.getItem('DB_SHOW_PAY_STATUS')), // 还款状态
      dbBillType: JSON.parse(sessionStorage.getItem('DB_BILL_TYPE')), // 账单类型
      model: {},
      detailData: {},
      form: this.$form.createForm(this),
      disableMixinCreated: true,
    }
  },
  methods: {
    edit(res, billType, billNo, userType) {
      console.log(res)
      billType == 10 ? this.titleName = '账单信息(借款)' : this.titleName = '账单信息(费用)'
      // 账单类型:10借款账单、20服务费账单、30借款服务费账单
      this.billType = billType
      this.userType = userType
      this.defaultTabKey = '1'
      this.detailData = res
      this.billNo = billNo
      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.msg.loadData()
      } else if (key == 3) {
        this.$refs.backMsg.loadData()
      }
    },
  }
}
</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>