<template>
|
<div>
|
<div class="form-content">
|
<FormList
|
:info="formInfo"
|
:isShowDetail="isShowDetail"
|
@handleClick="isShowDetail = !isShowDetail"
|
@updateValue="updateValue"
|
@onSubmit="onSubmit"
|
@setValueInfo="setValueInfo"
|
:isChangeArray="false"
|
></FormList>
|
</div>
|
|
<p class="export-excle">
|
<Download :type="0" :values="valueInfo" @handleClick="download"></Download>
|
<el-button icon="el-icon-download" size="small" type="primary" @click="downloadCustomerImagesForGM">导出协议影像</el-button>
|
</p>
|
|
<div class="list-content">
|
<TableList
|
:isAutoIndex="false"
|
:isPaddingRight="false"
|
:list="records"
|
:header="tableHeader"
|
:height="tableHeight"
|
:loading="loading"
|
:pageInfo="pageInfo"
|
:isMultipleSelect="true"
|
@doAction="doAction"
|
@handleCurrentChange="handleCurrentChange"
|
@handleSizeChange="handleSizeChange"
|
@handleSelectionChange="handleSelectionChange"
|
:rowKey="'applyserialno'"
|
:isReserve="true"
|
ref="CommTable"
|
></TableList>
|
</div>
|
<p class="message">
|
提示:超过12个月数据。请输入查询条件:申请编号或姓名。
|
</p>
|
|
</div>
|
</template>
|
<script>
|
/**
|
* 借据查询页面-资方
|
*/
|
import FormList from './components/FormList'
|
import TableList from './components/TableList'
|
import Download from './components/Download'
|
import {
|
qryProdList,
|
qryDimensionList,
|
qryFlowPhaseList,
|
getAllCityAreaList,
|
// qryRepayTypeList,
|
qryCustomRepayList,
|
loanList,
|
getDictionaryList,
|
qryFirstInternalOrgInfo,
|
createExportLoan,
|
applyDownloadCustomerImagesForGM
|
} from '@comprehensive/serve/public'
|
import { capitalLoanListHeader } from '@comprehensive/utils/tableHeaders'
|
import { debitCapitalSearch } from '@comprehensive/utils/formItems'
|
import { alert } from '@comprehensive/utils/comm'
|
|
const queryFlag = '02'
|
|
export default {
|
name: 'LoanApply',
|
components: {
|
FormList,
|
TableList,
|
Download
|
},
|
data() {
|
return {
|
// 是否显示详情页
|
isShowList: true,
|
|
// 搜索表单字段及描述
|
// formInfo: [...debitCapitalSearch],
|
formInfo: [],
|
// 借据查询过滤字段
|
formInfoFilter: [
|
'customerid',
|
'paymentNameCodes',
|
'businesssum',
|
'businesstermmonth',
|
'businesstermday',
|
'extendtimes',
|
'changePsLimit',
|
'waiveLimit',
|
'loanupStatus',
|
'discountflag',
|
'discounttype',
|
'a1FeePayTypeCodes',
|
'loanPutoutBTypeCode',
|
'rfactorflag'
|
],
|
// 表单结果数据
|
valueInfo: {},
|
records: [],
|
selectionRows: [], // 选中行
|
tableHeader: [...capitalLoanListHeader],
|
pageInfo: {
|
currentPage: 1,
|
pageSize: 10,
|
total: 0
|
},
|
// 是否显示所有表单项
|
isShowDetail: false,
|
|
tableHeight: '560px',
|
serialNo: '',
|
objectType: '',
|
customerID: '',
|
loading: false
|
}
|
},
|
created() {
|
this.init()
|
},
|
methods: {
|
// 页面初始化处理
|
init() {
|
// 修改借据查询条件过滤
|
const { formInfoFilter } = this
|
this.formInfo = debitCapitalSearch.filter(
|
({ name }) => !formInfoFilter.includes(name)
|
)
|
this.qryProdList()
|
this.qryDimensionList()
|
this.qryFlowPhaseList()
|
this.getAllCityAreaList()
|
this.loanList()
|
this.getDictionaryList()
|
this.qryFirstInternalOrgInfo()
|
this.qryCustomRepayList()
|
this.a1feepaytypeList()
|
this.discountTypeList()
|
this.loanputoutbtypeCodeList()
|
this.discountLoanupStatus()
|
},
|
|
// 设置表单结果数据
|
setValueInfo(info = {}) {
|
this.valueInfo = info
|
},
|
|
// 产品名称下拉列表
|
async qryProdList() {
|
const res = await qryProdList({ productTypeNo: '' })
|
const { result } = res
|
this.setOrGetFormInfo('productids', { options: result })
|
},
|
|
// 贴息类型
|
async discountTypeList() {
|
const res = await getDictionaryList({ codeNo: 'DiscountType' })
|
const { result } = res
|
this.setOrGetFormInfo('discounttype', { options: result })
|
},
|
|
// 借据状态
|
async getDictionaryList() {
|
const res = await getDictionaryList({ codeNo: 'LoanStatus' })
|
const { result } = res
|
this.setOrGetFormInfo('loanStatuses', { options: result })
|
},
|
|
// 手续费收取方式
|
async a1feepaytypeList() {
|
const res = await getDictionaryList({ codeNo: 'PoundageCharge' })
|
const { result } = res
|
this.setOrGetFormInfo('a1FeePayTypeCodes', { options: result })
|
},
|
|
// 贷款发放商家标志
|
async loanputoutbtypeCodeList() {
|
const res = await getDictionaryList({ codeNo: 'YesNo' })
|
const { result } = res
|
this.setOrGetFormInfo('loanPutoutBTypeCode', { options: result })
|
},
|
|
// 挂起状态
|
async discountLoanupStatus() {
|
const res = await getDictionaryList({ codeNo: 'YesNo' })
|
const { result } = res
|
this.setOrGetFormInfo('loanupStatus', { options: result })
|
},
|
|
// 产品维度下拉列表
|
async qryDimensionList() {
|
const { valueInfo } = this
|
let { productid = '' } = valueInfo
|
const res = await qryDimensionList({ productid })
|
const { result } = res
|
this.setOrGetFormInfo('dimensions', { options: result })
|
},
|
|
// 当前流程阶段下拉列表
|
async qryFlowPhaseList() {
|
const res = await qryFlowPhaseList({})
|
const { result } = res
|
this.setOrGetFormInfo('phaseNo', { options: result })
|
},
|
|
// 业务城市下拉列表
|
async getAllCityAreaList() {
|
const res = await getAllCityAreaList({ queryFlag })
|
const { result } = res
|
this.setOrGetFormInfo('businesscities', { options: result })
|
},
|
|
// 查询一级内部机构列表
|
async qryFirstInternalOrgInfo() {
|
const res = await qryFirstInternalOrgInfo({})
|
const { result } = res
|
this.setOrGetFormInfo('refereebllevel1iorg', { options: result })
|
this.setOrGetFormInfo('formbllevel1iorg', { options: result })
|
},
|
|
// // 获取还款方式列表
|
// async qryRepayTypeList() {
|
// const res = await qryRepayTypeList({
|
// // 贷款期限
|
// creditTerm: '',
|
|
// // 产品维度编号
|
// dimensionCode: '',
|
|
// // 产品编号
|
// productCode: '',
|
|
// // 还款方式 字典:PaymentName
|
// repaymentType: '',
|
|
// // 期限单位 M:月,D:日
|
// termUnit: ''
|
// })
|
// const { result } = res
|
// this.setOrGetFormInfo('paymentNameCodes', { options: result })
|
// },
|
|
// 获取自定义还款方式列表
|
async qryCustomRepayList() {
|
const res = await qryCustomRepayList({})
|
const { result } = res
|
this.setOrGetFormInfo('paymentNameCodes', { options: result })
|
},
|
|
// 获取当前数据列表
|
async loanList() {
|
this.loading = true
|
let { valueInfo, pageInfo, serialNo } = this
|
const res = await loanList({
|
...valueInfo,
|
...pageInfo,
|
fundunitNo: 'GMXT'
|
})
|
const { records = [], total, pages } = res.result
|
this.loading = false
|
this.records = records.reduce((pre, curr) => {
|
// 贷款期限处理
|
const { termUnit, businessTermMonth, businessTermDay } = curr
|
let businessTerm = ''
|
if (termUnit === 'M' && businessTermMonth) {
|
businessTerm = `${businessTermMonth}月`
|
}
|
if (termUnit === 'D' && businessTermDay) {
|
businessTerm = `${businessTermDay}天`
|
}
|
pre.push({
|
...curr,
|
businessTerm
|
})
|
return pre
|
}, [])
|
|
this.pageInfo = {
|
...pageInfo,
|
total
|
}
|
},
|
|
// 更新表单数据或查找某项数据
|
setOrGetFormInfo(nameKey, newInfo) {
|
let { formInfo } = this
|
let index = formInfo.findIndex(({ name }) => name === nameKey)
|
let result = {}
|
if (!isNaN(index)) {
|
this.$set(this.formInfo, index, { ...formInfo[index], ...newInfo })
|
result = this.formInfo[index]
|
}
|
if (typeof newInfo === 'undefined') {
|
return result
|
}
|
},
|
|
// 更新数据
|
updateValue(value, item) {
|
let { name } = item
|
this.setOrGetFormInfo(name, { value })
|
if (name === 'productid') {
|
this.qryDimensionList()
|
}
|
},
|
|
// 查询操作
|
onSubmit() {
|
// let { valueInfo } = this
|
this.$refs.CommTable.clearTableSelection()
|
this.pageInfo.currentPage = 1
|
this.loanList()
|
},
|
|
// 表单事件回调
|
doAction(name, item, index) {
|
// 点击申请编号的处理
|
if (name === 'applyserialno') {
|
const {
|
applyserialno,
|
flowno,
|
objecttype,
|
customerid,
|
occurType
|
} = item
|
// flowno objecttype 两个字段接口暂时缺失
|
this.serialNo = applyserialno
|
this.customerID = customerid
|
|
// 注意objecttype非驼峰命名,跟接口一致
|
this.objectType = objecttype
|
|
this.isShowList = false
|
this.$router.push(
|
`/comprehensiveTransaction/loanDetail/${applyserialno}?occurType=${occurType}&flowno=${flowno}&objectType=${objecttype}&customerID=${customerid}&source=capital`
|
)
|
|
// // 案场贷款申请详情
|
// if (flowno === 'CreditFlowCase') {
|
// this.isShowList = false
|
// this.$router.push(
|
// `/comprehensiveTransaction/loanDetail/${applyserialno}?flowno=${flowno}&objectType=${objecttype}&customerID=${customerid}`
|
// )
|
// } else {
|
// this.$message('目前仅完成案场功能!')
|
// }
|
|
// // 非案场贷款申请详情
|
// if (flowno === 'CreditFlowCommon') {
|
// }
|
|
// // 易贷贷款申请详情
|
// if (flowno === 'MortgageFlow') {
|
// }
|
|
// // 快贷贷款申请详情
|
// if (flowno === 'BuildingBusinessFlow') {
|
// }
|
// console.log(
|
// `name: ${name}, flowno: ${flowno}, serialNo: ${applyserialno}`
|
// )
|
}
|
},
|
|
// 点击详情页返回的处理
|
backList(flg = true) {
|
this.isShowList = flg
|
},
|
|
// 修改翻页条数
|
handleSizeChange(val) {
|
this.pageInfo.pageSize = val
|
this.loanList()
|
},
|
|
// 修改翻页数
|
handleCurrentChange(val) {
|
this.pageInfo.currentPage = val
|
this.loanList()
|
},
|
|
handleSelectionChange(rows) {
|
let rowIds = []
|
rows.map(item => {
|
rowIds.push(item.applyserialno)
|
})
|
this.selectionRows = [...rowIds]
|
console.log('rows:', rowIds)
|
},
|
|
// 导出excle
|
async download(values = {}) {
|
const res = await createExportLoan({...values, fundunitNo: 'GMXT' })
|
if(res.code == '00'){
|
alert('提交成功',res.msg,() => {})
|
}
|
},
|
// 导出协议影像信息
|
async downloadCustomerImagesForGM() {
|
let {selectionRows} = this
|
if(!selectionRows.length) {
|
this.$message.warning('请至少选择一条要导出的数据!')
|
return
|
}
|
const res = await applyDownloadCustomerImagesForGM({objectnos: [...selectionRows] })
|
if(res.code == '00'){
|
alert('提交成功',res.msg,() => {})
|
}
|
},
|
}
|
}
|
</script>
|
<style lang="postcss" scoped>
|
.list-content {
|
font-size: 14px;
|
}
|
.export-excle {
|
margin: 0 0 20px 0;
|
}
|
.message{
|
font-size: 12px;
|
color: #666666;
|
padding: 10px 20px;
|
background-color: #FAFAFA;
|
}
|
</style>
|