<template>
|
<div class="search-form">
|
<CommForm
|
:inline="true"
|
:list="formList"
|
@updateValue="updateValue"
|
@buttonAction="buttonAction"
|
ref="form"
|
:buttons="formButtons"
|
:isShowAll="isShowAll"
|
formType="search"
|
></CommForm>
|
|
<CommTable
|
:pageInfo="pageInfo"
|
:total="total"
|
@doAction="doAction"
|
@handleCurrentChange="handleCurrentChange"
|
@handleSizeChange="handleSizeChange"
|
:loading="loading"
|
:list="records"
|
:header="tableHeader"
|
v-bind="$attrs"
|
></CommTable>
|
|
<!-- <a
|
href="http://10.0.22.88:8880/#/comm/apply?pageId=&applySerialno=&transLogSerialno=2019122316302920876058125X9150f6&phaseNo=1000&objectType=TransactionApply&transCode=3006&isApplyPhase=2&isHiddenAppoveOpinion=1&imageEditStatus=2"
|
>测试代码-请忽略</a> -->
|
</div>
|
</template>
|
<script>
|
// 贷后申请资料补传列表查询
|
import CommForm from '@/components/CommForm'
|
import CommTable from '@/components/CommTable'
|
|
import qryFlowPhaseList from '@/controller/qryFlowPhaseList'
|
import qryProdList from '@/controller/qryProdList'
|
import queryTransCodeNameList from '@/controller/queryTransCodeNameList'
|
|
const recordButtons = [
|
{
|
text: '详情',
|
prop: 'detailButton'
|
},
|
{
|
text: '补传资料',
|
prop: 'imagAddButton'
|
}
|
]
|
|
export default {
|
components: {
|
CommForm,
|
CommTable
|
},
|
props: {
|
model: {
|
type: Object,
|
required: true
|
},
|
// 初始值
|
initValue: {
|
type: Object,
|
default: () => ({})
|
},
|
// 默认请求参数
|
fetchInfo: {
|
type: Object,
|
default: () => ({})
|
},
|
|
// NORMALPAYMENT('2001', '正常/逾期还款'),
|
// PARTPREPAYMENT('2000', '提前部分还款'),
|
// PREPAYMENT('2002', '提前结清'),
|
// ADVANCEFEE('2005', '预收息费'),
|
// ADVANCEDISCOUNT('2006', '预收贴息'),
|
// WAIVEFEE('5001', '息费减免'),
|
// CHANNELPAYMENT('2003', '其他渠道还款'),
|
// CLAIMPAYMENT('2004', '认领还款/指定项还款'),
|
// WASHPAYMENT('4002', '还款冲账'),
|
// RATECHANGE('3002', '利率变更'),
|
// PAYMENTSCHEDULECHANGE('3006', '还款计划变更'),
|
// REFUNDFEE('5002', '息费退款'),
|
// DISCOUNTSETTLE('5004', '贴息结算'),
|
// WASHDISCOUNTSETTLE('5006', '冲贴息结算'),
|
// PAYMENTACCOUNTCHANGE('3003', '还款账户变更'),
|
// LOANBACKOUT('5005', '贷款撤销')
|
transCode: {
|
type: String,
|
default: ''
|
},
|
|
codeNo: {
|
type: String,
|
default: ''
|
},
|
|
pageId: {
|
type: String,
|
default: ''
|
}
|
},
|
data() {
|
return {
|
loading: false,
|
isShowAll: false,
|
tempRecord: {},
|
// trxnBr: '',
|
buttonProp: '',
|
tempInfo: {},
|
formList: [],
|
formRules: {},
|
tableHeader: [],
|
formButtons: [
|
{ text: '重置', type: 'default' },
|
{ text: '搜索' },
|
{ text: '展开', type: 'fold' }
|
],
|
pageInfo: {
|
currentPage: 1,
|
pageSize: 10
|
},
|
total: 0,
|
records: []
|
}
|
},
|
created() {
|
this.init()
|
},
|
methods: {
|
init() {
|
this.$route.meta.keepAlive = true
|
const { model, initValue } = this
|
model.computedItem = item => {
|
return {
|
...item,
|
action: {
|
buttons: recordButtons.filter(
|
button => Number(item[button.prop]) === 1
|
)
|
}
|
}
|
}
|
this.formList = model.getFormList(initValue)
|
this.tableHeader = model.getTableList()
|
|
this.setSelectOptions()
|
this.getList()
|
},
|
|
// 设置表单下拉菜单
|
setSelectOptions() {
|
const { formList } = this
|
formList.forEach(({ name }) => {
|
// 贷后交易名称
|
if (name === 'transCodeArr') {
|
this.queryTransCodeNameList(name)
|
}
|
|
// 当前流程阶段
|
if (name === 'phaseNoArray') {
|
this.qryFlowPhaseList(name)
|
}
|
|
// 产品名称
|
if (name === 'productIdArray') {
|
this.qryProdList(name)
|
}
|
})
|
},
|
|
// 获取列表
|
async getList() {
|
this.loading = true
|
let { pageInfo, formValues, model, fetchInfo, transCode = '' } = this
|
const res = await model.request({
|
...fetchInfo,
|
transCode,
|
...pageInfo,
|
...formValues
|
})
|
this.loading = false
|
const { list = [], total } = res
|
this.records = list
|
this.total = parseInt(total)
|
},
|
|
// 更新表单数据
|
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 })
|
}
|
},
|
|
// 贷后交易名称下拉列表
|
async queryTransCodeNameList(name) {
|
const { transCode } = this
|
const tempModel = queryTransCodeNameList()
|
const { list } = await tempModel.request({ transCode })
|
this.updateValue(name, { options: list })
|
},
|
|
// 修改翻页条数
|
handleSizeChange(val) {
|
this.pageInfo.pageSize = val
|
this.getList()
|
},
|
|
// 修改翻页数
|
handleCurrentChange(val) {
|
this.pageInfo.currentPage = val
|
this.getList()
|
},
|
|
// 表单按钮事件处理
|
buttonAction(id) {
|
if (id === 0) {
|
this.resetForm()
|
}
|
if (id === 1) {
|
this.resetList()
|
}
|
if (id === 2) {
|
const { isShowAll } = this
|
this.isShowAll = !isShowAll
|
}
|
},
|
|
// 表格按钮事件处理
|
doAction(item, record) {
|
const { prop } = item
|
// const { trxnBr } = record
|
this.tempRecord = { ...record }
|
// this.trxnBr = trxnBr
|
this.buttonProp = prop
|
|
// 详情
|
if (prop === 'detailButton') {
|
this.toEdit({
|
phaseNo: '1000',
|
isApplyPhase: 2,
|
isHiddenAppoveOpinion: 1
|
})
|
}
|
|
// 补传资料
|
if (prop === 'imagAddButton') {
|
this.toEdit({
|
phaseNo: '1000',
|
isApplyPhase: 2,
|
isHiddenAppoveOpinion: 1,
|
// 控制编辑状态: 1 可新增可删除,2可新增不可删除,3不可新增可删除
|
imageEditStatus: '2'
|
})
|
}
|
},
|
|
// 获取流程阶段列表
|
async qryFlowPhaseList(name) {
|
const { transCode } = this
|
const tempModel = qryFlowPhaseList()
|
const { list } = await tempModel.request({ transCode })
|
this.updateValue(name, {
|
options: list
|
})
|
},
|
|
// 产品名称下拉列表
|
async qryProdList(name) {
|
const tempModel = qryProdList()
|
const { list } = await tempModel.request({ productTypeNo: '' })
|
this.updateValue(name, { options: list })
|
},
|
|
// async beforeEdit(info) {
|
// const { beforeEditModel, tempRecord } = this
|
// const { trxnBr } = tempRecord
|
// const {
|
// objectType = 'TransferRefundFlow',
|
// ...other
|
// } = await beforeEditModel.request({
|
// trxnBr,
|
// ...info
|
// })
|
// this.toEdit({
|
// ...info,
|
// objectType,
|
// ...other
|
// })
|
// },
|
|
// async toDetail(info) {
|
// const { detailModel, tempRecord } = this
|
// const { transLogSerialNo } = tempRecord
|
// // // const { transLogSerialno } = await detailModel.request({
|
// // // taskId: taskSerialno
|
// // // })
|
// // this.toEdit({
|
// // trxnBr,
|
// // withholdStatus: '',
|
// // ...info
|
// // })
|
// this.toEdit({
|
// withholdStatus: '1',
|
// // phaseNo: '1000',
|
// ...info
|
// })
|
// },
|
|
toEdit(info = {}) {
|
const { tempRecord, pageId } = this
|
const {
|
applySerialno = '',
|
transLogSerialNo,
|
phaseNo = '',
|
objectType,
|
transCode
|
// withholdStatus = '',
|
} = tempRecord
|
|
const baseQuery = {
|
pageId,
|
applySerialno,
|
transLogSerialno: transLogSerialNo,
|
phaseNo,
|
objectType,
|
transCode
|
}
|
|
this.$router.push({
|
path: '/comm/apply',
|
query: {
|
...baseQuery,
|
...info
|
}
|
})
|
},
|
|
resetList() {
|
this.pageInfo.currentPage = 1
|
this.getList()
|
},
|
|
resetForm() {
|
const { model } = this
|
this.formList = model.getFormList()
|
this.setSelectOptions()
|
}
|
},
|
computed: {
|
// 表单值信息
|
formValues() {
|
const { model, formList } = this
|
return model.getFormValues(formList)
|
}
|
}
|
}
|
</script>
|
<style lang="postcss" scoped>
|
</style>
|