<template>
|
<div>
|
<div class="search-form">
|
<EditForm
|
:inline="true"
|
:list="formList"
|
@updateValue="updateValue"
|
ref="form"
|
:buttons="buttons"
|
:isShowAll="isShowAll"
|
:formValues="formValues"
|
:formRules="formRules"
|
formType="search"
|
@buttonAction="buttonAction"
|
></EditForm>
|
</div>
|
|
<p class="export-excle">
|
<Download :type="0" :values="formValues"></Download>
|
</p>
|
|
<div class="list-content">
|
<TableList
|
:pageInfo="pageInfo"
|
:total="total"
|
@doAction="doAction"
|
@handleCurrentChange="handleCurrentChange"
|
@handleSizeChange="handleSizeChange"
|
:isAutoIndex="true"
|
:isPaddingRight="false"
|
:list="records"
|
:header="tableList"
|
:loading="loading"
|
></TableList>
|
</div>
|
|
<p class="message">
|
提示:超过<b style="color: #000;">1</b>个月数据。请输入查询条件:申请编号或姓名。<b style="font-size:13px">授信/放款总金额:{{totalSum}}</b>
|
</p>
|
|
<CallIng></CallIng>
|
</div>
|
</template>
|
<script>
|
/**
|
* 贷款申请查询页面
|
*/
|
import EditForm from './components/EditForm'
|
import TableList from './components/TableList'
|
import Download from './components/Download'
|
import qryApplyList from '@comprehensive/model/qryApplyList'
|
import qryFlowPhaseList from '@comprehensive/model/qryFlowPhaseList'
|
import qryDimensionList from '@comprehensive/model/qryDimensionList'
|
import qryProdList from '@comprehensive/model/qryProdList'
|
import getDictionaryList from '@comprehensive/model/getDictionaryList'
|
import getAllCityAreaList from '@comprehensive/model/getAllCityAreaList'
|
import CallIng from '@comprehensive/components/CallIng'
|
import { qryApplyHeader } from '@comprehensive/utils/tableHeaders'
|
const queryFlag = '02'
|
|
export default {
|
name: 'LoanApply',
|
components: {
|
TableList,
|
Download,
|
EditForm,
|
CallIng
|
},
|
data() {
|
return {
|
// 是否显示详情页
|
isShowList: true,
|
totalSum:0,
|
formList: [],
|
|
// 贷款申请过滤字段
|
formListFilter: [
|
'customerId',
|
'discountFlag',
|
'discountType',
|
'poundageCharge',
|
'isIssuePartners'
|
],
|
|
tableList: [...qryApplyHeader],
|
|
formRules: {},
|
|
listModel: null,
|
|
query: {},
|
|
records: [],
|
|
pageInfo: {
|
currentPage: 1,
|
pageSize: 10
|
},
|
total: 0,
|
serialNo: '',
|
objectType: '',
|
customerID: '',
|
loading: false,
|
|
// 是否显示所有表单项
|
isShowAll: false,
|
buttons: [
|
{ text: '重置', type: '' },
|
{ text: '搜索' },
|
{ type: 'fold', text: '展开' }
|
]
|
}
|
},
|
created() {
|
if(this.$route.name === 'loanApply') {
|
this.init()
|
}
|
},
|
methods: {
|
// 页面初始化处理
|
init() {
|
const { query } = this.$route
|
this.query = query
|
const listModel = qryApplyList()
|
const formList = listModel.getFormList(query)
|
// this.tableList = listModel.getTableList()
|
this.formRules = listModel.getFormRules()
|
this.formList = formList
|
this.listModel = listModel
|
this.qryPaymentName()
|
this.qryApplyList()
|
this.qryFlowPhaseList()
|
this.qryDimensionList()
|
this.qryProdList()
|
this.getAllCityAreaList()
|
this.getDictionaryList()
|
this.discountTypeList()
|
this.isIssuePartnersList()
|
this.getOccurTypeList()
|
},
|
|
// 获取当前列表数据
|
async qryApplyList() {
|
this.loading = true
|
let { pageInfo, listModel, formValues, query } = this
|
const { customerPhone, from } = query
|
const res = await listModel.request({ ...pageInfo, ...formValues })
|
this.loading = false
|
const { list, total } = res
|
this.records = list
|
var totalSum = 0
|
this.records.forEach(item => {
|
totalSum += Number(item.amountloan)
|
})
|
this.totalSum = this.getMoney(totalSum)
|
this.total = total
|
// 客服查询只有一条记录的时候,直接到详情页
|
if (list.length === 1 && from === 'customer' && customerPhone) {
|
this.doAction('serialNo', list[0])
|
}
|
},
|
|
// 当前流程阶段下拉列表
|
async qryFlowPhaseList() {
|
const res = await qryFlowPhaseList().request()
|
const { list } = res
|
this.updateValue('phaseNo', { options: list })
|
},
|
|
|
|
// 还款方式
|
async qryPaymentName() {
|
|
const res = await getDictionaryList().request({
|
codeNo: 'PaymentName'
|
})
|
const { list } = res
|
this.updateValue('paymentNameCodes', { options: list })
|
},
|
|
// 当前流程阶段下拉列表
|
async qryFlowPhaseList() {
|
const res = await qryFlowPhaseList().request()
|
const { list } = res
|
this.updateValue('phaseNo', { options: list })
|
},
|
|
// 表单按钮操作
|
buttonAction(index, button) {
|
let { listModel, isShowAll } = this
|
if (index === 0) {
|
// 重置
|
// this.formList = listModel.getFormList()
|
this.init()
|
}
|
if (index === 1) {
|
// 搜索
|
this.pageInfo.currentPage = 1
|
this.qryApplyList()
|
}
|
if (index === 2) {
|
// 展开/收起
|
this.isShowAll = !isShowAll
|
}
|
},
|
|
// 产品名称下拉列表
|
async qryProdList() {
|
const res = await qryProdList().request({ searchType: 'all' })
|
const { list } = res
|
this.updateValue('productid', { options: list })
|
},
|
|
// 手续费收取方式
|
async getDictionaryList() {
|
const res = await getDictionaryList().request({
|
codeNo: 'PoundageCharge'
|
})
|
const { list } = res
|
this.updateValue('poundageCharge', { options: list })
|
},
|
// 格式化金额
|
getMoney(money) {
|
if (money && money != null) {
|
money = String(money)
|
let left = money.split('.')[0]
|
let right = money.split('.')[1]
|
right = right
|
? right.length >= 2
|
? '.' + right.substr(0, 2)
|
: '.' + right + '0'
|
: '.00'
|
var temp = left
|
.split('')
|
.reverse()
|
.join('')
|
.match(/(\d{1,3})/g)
|
return (
|
(Number(money) < 0 ? '-' : '') +
|
temp
|
.join(',')
|
.split('')
|
.reverse()
|
.join('') +
|
right
|
)
|
} else if (Number(money) === 0) {
|
// 注意===在这里的使用,如果传入的money为0,if中会将其判定为boolean类型,故而要另外做===判断
|
return '0.00'
|
} else {
|
return ''
|
}
|
},
|
// 贴息类型
|
async discountTypeList() {
|
const res = await getDictionaryList().request({
|
codeNo: 'DiscountType'
|
})
|
const { list } = res
|
this.updateValue('discountType', { options: list })
|
},
|
|
// 贷款发放商家标志
|
async isIssuePartnersList() {
|
const res = await getDictionaryList().request({
|
codeNo: 'YesNo'
|
})
|
const { list } = res
|
this.updateValue('isIssuePartners', { options: list })
|
},
|
|
// 产品维度下拉列表
|
async qryDimensionList() {
|
let { formValues } = this
|
const res = await qryDimensionList().request({
|
productid: formValues.productid || ''
|
})
|
const { list } = res
|
this.updateValue('productDimension', { options: list })
|
},
|
|
// 业务城市下拉列表
|
async getAllCityAreaList() {
|
const res = await getAllCityAreaList().request({ queryFlag })
|
const { list } = res
|
this.updateValue('businessCity', { options: list })
|
},
|
|
async getOccurTypeList() {
|
const res = await getDictionaryList().request({
|
codeNo: 'BuildingBusinessTypeCredit'
|
})
|
const { list } = res
|
this.updateValue('occurType', { options: list })
|
},
|
|
qryDictionaryList(code){
|
return new Promise(resolve=>{
|
getDictionaryList({
|
codeNo: code
|
}).then(res=>{
|
resolve(res.result)
|
})
|
})
|
},
|
// 更新表单数据
|
updateValue(index, info) {
|
const { formList } = this
|
if (isNaN(index)) {
|
// index is name
|
index = formList.findIndex(({ name }) => name === index)
|
}
|
if (!isNaN(index) && index > -1) {
|
const preInfo = formList[index]
|
this.$set(formList, index, { ...preInfo, ...info })
|
if (preInfo.name === 'productid') {
|
this.qryDimensionList()
|
}
|
}
|
},
|
|
// 表单事件回调
|
doAction(name, item) {
|
// 点击申请编号的处理
|
if (name === 'serialNo') {
|
const { serialNo, flowno, objectType, customerID, occurType ,productID} = item
|
this.serialNo = serialNo
|
this.customerID = customerID
|
|
// 注意objecttype非驼峰命名,跟接口一致
|
this.objectType = objectType
|
|
this.$router.push(
|
`/comprehensiveTransaction/loanDetail/${serialNo}?occurType=${occurType}&flowno=${flowno}&objectType=${objectType}&customerID=${customerID}&productID=${productID}`
|
)
|
}
|
},
|
|
// 点击详情页返回的处理
|
backList(flg = true) {
|
this.isShowList = flg
|
},
|
|
// 修改翻页条数
|
handleSizeChange(val) {
|
this.pageInfo.pageSize = val
|
this.qryApplyList()
|
},
|
|
// 修改翻页数
|
handleCurrentChange(val) {
|
this.pageInfo.currentPage = val
|
this.qryApplyList()
|
}
|
},
|
computed: {
|
// 表单值信息
|
formValues() {
|
const { listModel, formList } = this
|
return listModel && listModel.getFormValues(formList)
|
}
|
},
|
// watch: {
|
// $route() {
|
// this.init()
|
// }
|
// }
|
}
|
</script>
|
<style lang="postcss" scoped>
|
.search-form {
|
padding-top: 16px;
|
}
|
.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>
|