<template>
|
<div class="search-form">
|
<CommForm
|
:inline="true"
|
:list="formList"
|
@updateValue="updateValue"
|
@buttonAction="buttonAction"
|
ref="form"
|
:formValues="formValues"
|
:buttons="formButtons"
|
:isShowAll="isShowAll"
|
title="交易信息"
|
></CommForm>
|
|
<CommTable
|
:pageInfo="pageInfo"
|
:total="total"
|
@doAction="doAction"
|
@handleCurrentChange="handleCurrentChange"
|
@handleSizeChange="handleSizeChange"
|
:loading="loading"
|
:list="records"
|
:header="tableHeader"
|
v-bind="$attrs"
|
></CommTable>
|
|
<el-dialog
|
:visible.sync="dialogEditClaim"
|
custom-class="comm-dialog"
|
:modal-append-to-body="false"
|
>
|
<EditClaim
|
:info="tempRecord"
|
@close="dialogEditClaim = false"
|
:isShow="dialogEditClaim"
|
:detail="tempInfo"
|
:trxnBr="trxnBr"
|
:buttonProp="buttonProp"
|
:isEdit="false"
|
></EditClaim>
|
</el-dialog>
|
|
<el-dialog
|
:visible.sync="dialogRefundTransInfo"
|
custom-class="comm-dialog"
|
:modal-append-to-body="false"
|
width="940px"
|
>
|
<RefundTransInfo :info="tempRecord"></RefundTransInfo>
|
</el-dialog>
|
</div>
|
</template>
|
<script>
|
// 交易信息
|
import CommForm from '@/components/CommForm'
|
import CommTable from '@/components/CommTable'
|
import EditClaim from '@/components/EditClaim'
|
import RefundTransInfo from '@/components/RefundTransInfo'
|
import claimRefundTransList from '@/controller/claimRefundTransList'
|
import queryCodeValueList from '@/controller/queryCodeValueList'
|
import claimRefundInfo from '@/controller/claimRefundInfo'
|
import transDataAuthority from '@/controller/transDataAuthority'
|
|
const recordButtons = [
|
{
|
text: '详情',
|
prop: 'detailsButton'
|
},
|
{
|
text: '交易入账明细',
|
prop: 'transButton'
|
}
|
]
|
|
export default {
|
components: {
|
CommForm,
|
CommTable,
|
EditClaim,
|
RefundTransInfo
|
},
|
data() {
|
return {
|
loading: false,
|
isShowAll: false,
|
dialogEditClaim: false,
|
dialogRefundTransInfo: false,
|
query: {},
|
trxnBr: '',
|
buttonProp: '',
|
tempInfo: {},
|
model: null,
|
detailModel: null,
|
claimRefundModel: null,
|
formList: [],
|
tableHeader: [],
|
formButtons: [
|
{ text: '重置', type: 'default' },
|
{ text: '搜索' },
|
{ text: '展开', type: 'fold' }
|
],
|
pageInfo: {
|
currentPage: 1,
|
pageSize: 10
|
},
|
total: 0,
|
records: [],
|
tempRecord: {}
|
}
|
},
|
created() {
|
this.init()
|
},
|
methods: {
|
init() {
|
const { query } = this.$route
|
const { trxnBr } = query
|
this.query = query
|
this.trxnBr = trxnBr
|
const model = claimRefundTransList()
|
this.formList = model.getFormList()
|
this.tableHeader = model.getTableList()
|
this.model = model
|
this.codeNameModel = queryCodeValueList()
|
this.claimRefundModel = claimRefundInfo('remark')
|
this.detailModel = transDataAuthority()
|
|
model.computedItem = item => {
|
return {
|
...item,
|
action: {
|
buttons: recordButtons.filter(
|
button => Number(item[button.prop]) === 1
|
)
|
}
|
}
|
}
|
|
this.setSelectOptions()
|
this.getList()
|
},
|
|
// 设置表单下拉菜单
|
setSelectOptions() {
|
const { formList } = this
|
formList.forEach(({ name }) => {
|
if (name === 'transTypeArray') {
|
this.queryCodeValueList(name)
|
}
|
if (name === 'status') {
|
this.claimRefundTransList(name, { codeNo: 'ClaimStatus' })
|
}
|
})
|
},
|
|
// 获取列表
|
async getList() {
|
this.loading = true
|
let { pageInfo, formValues, model, trxnBr } = this
|
// 自动扣款挂起管理新增查询条件字段loanUpStatus
|
if (formValues.loanUpStatusArray) {
|
formValues.loanUpStatus = formValues.loanUpStatusArray
|
}
|
const res = await model.request({
|
trxnBr,
|
...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 = 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()
|
}
|
}
|
},
|
|
// 贷后交易名称下拉列表
|
async queryCodeValueList(name) {
|
// const codeNameModel = queryTransCodeNameList()
|
const codeNameModel = queryCodeValueList()
|
const { list } = await codeNameModel.request({ codeNo: 'TransCodeEnum' })
|
this.updateValue(name, { options: list })
|
},
|
|
// 获取select中options数据
|
async claimRefundTransList(name, info = {}) {
|
const tempModel = claimRefundTransList()
|
const { list } = await tempModel.request(info)
|
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
|
this.tempRecord = { ...record }
|
if (prop === 'transButton') {
|
this.dialogRefundTransInfo = true
|
} else {
|
this.doDetail()
|
}
|
},
|
|
// 表格按钮事件处理
|
doDetail() {
|
const { tempRecord } = this
|
const { transType } = tempRecord
|
|
// 按钮部分待完善
|
// 点击打开对应申请-查询详情
|
// 当为“预收息费认领”时暂不需支持显示详情页,详情按钮灰显示
|
// 当为“还款认领”时,显示“转账还款认领-处理&查询详情”内容
|
// 当为“虚拟认领”时,显示“虚拟认领确认”弹窗内容,无提交按钮。
|
// 当为“虚拟认领撤销”时,显示“虚拟认领撤销确认”弹窗字段,无提交按钮。
|
// 当为“贴息结算认领”时,显示“贴息结算-详情”内容
|
// 当为“预收息费认领撤销”、“贴息结算认领撤销”、“还款认领撤销”时,显示“转账认领撤销申请-处理&查询详情”内容
|
|
// transType
|
// 交易编号6001打开转账退款审批阶段一详情
|
// 交易编号6002打开显示“虚拟认领确认”弹窗内容
|
// 交易编号6003打开虚拟认领撤销显示“虚拟认领撤销确认”弹窗字段
|
// 交易编号2004, 2021打开转账还款认领详情
|
// 交易编号5004打开贴息结算详情
|
// 交易编号4002 ,5006,4004打开认领撤销详情
|
|
// 打开转账退款审批阶段一详情
|
if (['6001'].includes(transType)) {
|
this.toDetail({
|
isApplyPhase: 2,
|
isHiddenAppoveOpinion: 1,
|
phaseNo: '0010', // 该参数可能有问题
|
transCode: 'T1007',
|
objectType: 'TransferRefundApply',
|
pageId: '30',
|
withholdStatus: ''
|
})
|
}
|
|
// 显示“虚拟认领确认/虚拟认领撤销确认”弹窗内容
|
if (['6002', '6003'].includes(transType)) {
|
this.buttonProp =
|
transType === '6003' ? 'virtualClaimUndoButton' : 'virtualClaimButton'
|
this.showClaim()
|
}
|
|
// 转账还款认领详情(applyType可能需要)
|
if (['2004', '2021'].includes(transType)) {
|
this.toDetail({
|
isApplyPhase: 2,
|
isHiddenAppoveOpinion: 1,
|
phaseNo: '0010',
|
transCode: 'T1005'
|
// applyType: ''
|
})
|
}
|
|
// 贴息详情
|
if (['5004'].includes(transType)) {
|
this.toDetail({
|
isApplyPhase: 2,
|
isHiddenAppoveOpinion: 1,
|
phaseNo: '0010',
|
transCode: 'T1002'
|
})
|
}
|
|
// 认领撤销详情
|
if (['4002', '5006', '4004'].includes(transType)) {
|
this.toDetail({
|
pageId: '30',
|
isApplyPhase: 2,
|
isHiddenAppoveOpinion: 1,
|
transCode: 'TCR1001'
|
})
|
}
|
},
|
|
async showClaim() {
|
const { claimRefundModel, trxnBr } = this
|
const res = await claimRefundModel.request({
|
trxnBr
|
})
|
this.tempInfo = res
|
this.dialogEditClaim = true
|
},
|
|
// async toCtsDetail() {
|
// const { loanDetailModel, tempRecord } = this
|
// const { applySerialno } = tempRecord
|
// const res = await loanDetailModel.request({
|
// applySerialno
|
// })
|
// this.$goDetail(res)
|
// },
|
|
async toDetail(info) {
|
const { detailModel, tempRecord, trxnBr } = this
|
const { transSerialNo = '', transType } = tempRecord
|
const {
|
objectNo = '',
|
objectType = '',
|
serialNo = '',
|
productId = '',
|
productDimension = '',
|
transSerialNoHis = '',
|
transCodeHis = '',
|
applyType = '',
|
transLogSerialno = ''
|
} = await detailModel.request({
|
transSerialNo,
|
transType,
|
trxnBr
|
})
|
this.toEdit({
|
objectNo,
|
objectType,
|
serialNo: serialNo || transSerialNoHis,
|
productId,
|
trxnBr,
|
productDimension,
|
transCodeOne: transCodeHis,
|
transSerialNo: transSerialNo || serialNo,
|
applyType,
|
transLogSerialno,
|
...info
|
})
|
},
|
|
toEdit(info = {}) {
|
const { tempRecord, transCode, codeNo, pageId } = this
|
const {
|
applySerialno = '',
|
phaseNo = '',
|
transCode: tempTransCode,
|
withholdStatus = '',
|
loanSerialno = ''
|
} = tempRecord
|
|
const baseQuery = {
|
applySerialno,
|
transCode: tempTransCode || transCode,
|
codeNo,
|
phaseNo,
|
pageId,
|
loanSerialno,
|
withholdStatus
|
}
|
|
// 贷后变更记录(入口在贷前详情)
|
// isApplyPhase=2 isHiddenAppoveOpinion=2
|
|
// 复核 “继续处理” 和“立即处理” 的时候 isApplyPhase=2 isHiddenAppoveOpinion=2
|
// 非复核 “继续处理” 和“立即处理” 的时候 isApplyPhase=2 isHiddenAppoveOpinion=2
|
// 所有 “详情” isApplyPhase=2 isHiddenAppoveOpinion=1
|
// 所有 “申请” isApplyPhase=1 isHiddenAppoveOpinion=2
|
|
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>
|