新增客户号查询并回填客户信息

This commit is contained in:
wkc
2026-04-29 14:13:27 +08:00
parent a90ab42be6
commit 3180c33500
13 changed files with 474 additions and 22 deletions

View File

@@ -7,12 +7,12 @@
<el-row>
<el-col :span="12">
<el-form-item label="客户内码" prop="custIsn">
<el-input v-model="form.custIsn" placeholder="请输入客户内码"/>
<el-input v-model="form.custIsn" placeholder="请选择客户内码" :readonly="true"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="客户名称" prop="custName">
<el-input v-model="form.custName" placeholder="请输入客户名称"/>
<el-input v-model="form.custName" placeholder="请选择客户名称" :readonly="true"/>
</el-form-item>
</el-col>
</el-row>
@@ -109,6 +109,10 @@ export default {
visible: {
type: Boolean,
default: false
},
customerMap: {
type: Object,
default: null
}
},
data() {
@@ -150,10 +154,10 @@ export default {
form: {
orgCode: '892000',
runType: '1',
custIsn: undefined,
custName: undefined,
custIsn: this.customerMap ? this.customerMap.cust_isn : undefined,
custName: this.customerMap ? this.customerMap.cust_name : undefined,
idType: undefined,
idNum: undefined,
idNum: this.customerMap ? (this.customerMap.cust_id || '').substring(3) : undefined,
guarType: undefined,
applyAmt: undefined,
loanTerm: undefined,
@@ -232,10 +236,10 @@ export default {
this.form = {
orgCode: '892000',
runType: '1',
custIsn: undefined,
custName: undefined,
custIsn: this.customerMap ? this.customerMap.cust_isn : undefined,
custName: this.customerMap ? this.customerMap.cust_name : undefined,
idType: undefined,
idNum: undefined,
idNum: this.customerMap ? (this.customerMap.cust_id || '').substring(3) : undefined,
guarType: undefined,
applyAmt: undefined,
loanTerm: undefined,
@@ -245,7 +249,11 @@ export default {
collThirdParty: false
}
this.submitting = false
this.resetForm("form")
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.clearValidate()
}
})
},
/** 对话框关闭处理 */
handleClose() {

View File

@@ -0,0 +1,103 @@
<template>
<el-dialog title="客户号查询" :visible.sync="dialogVisible" width="80%" append-to-body
:close-on-click-modal="false" @close="handleClose">
<el-form :model="queryForm" inline size="small">
<el-form-item label="客户号">
<el-input v-model="queryForm.custId" placeholder="请输入客户号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" :loading="loading" @click="handleQuery">查询</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="customerList">
<el-table-column label="客户号" prop="cust_id" align="center" :show-overflow-tooltip="true"/>
<el-table-column label="客户内码" prop="cust_isn" align="center" :show-overflow-tooltip="true"/>
<el-table-column label="客户名称" prop="cust_name" align="center" :show-overflow-tooltip="true"/>
<el-table-column label="用信天数" prop="faith_day" align="center"/>
<el-table-column label="存款年日均" prop="balance_avg" align="center"/>
<el-table-column label="历史贷款次数" prop="loan_count_his" align="center"/>
<el-table-column label="上次贷款日期" prop="last_loan_date" align="center" width="130"/>
<el-table-column label="操作" align="center" width="90">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="handleSelect(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
</template>
<script>
import {queryPersonalCustomerMap, queryCorporateCustomerMap} from "@/api/loanPricing/workflow"
export default {
name: "CustomerMapSelector",
props: {
visible: {
type: Boolean,
default: false
},
customerType: {
type: String,
default: undefined
}
},
data() {
return {
loading: false,
queryForm: {
custId: undefined
},
customerList: []
}
},
computed: {
dialogVisible: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
},
methods: {
handleQuery() {
const custId = this.queryForm.custId ? this.queryForm.custId.trim() : ''
this.queryForm.custId = custId
if (!custId) {
this.$modal.msgWarning("请输入客户号")
return
}
this.loading = true
let request
if (this.customerType === 'personal') {
request = queryPersonalCustomerMap
} else if (this.customerType === 'corporate') {
request = queryCorporateCustomerMap
} else {
this.loading = false
this.$modal.msgWarning("请选择客户类型")
return
}
request(custId).then(response => {
this.customerList = response.data || []
if (this.customerList.length === 0) {
this.$modal.msgWarning("未查询到客户信息")
}
}).finally(() => {
this.loading = false
})
},
handleSelect(row) {
this.$emit('select', row)
this.dialogVisible = false
},
handleClose() {
this.queryForm.custId = undefined
this.customerList = []
this.loading = false
}
}
}
</script>

View File

@@ -7,12 +7,12 @@
<el-row>
<el-col :span="12">
<el-form-item label="客户内码" prop="custIsn">
<el-input v-model="form.custIsn" placeholder="请输入客户内码"/>
<el-input v-model="form.custIsn" placeholder="请选择客户内码" :readonly="true"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="客户名称" prop="custName">
<el-input v-model="form.custName" placeholder="请输入客户名称"/>
<el-input v-model="form.custName" placeholder="请选择客户名称" :readonly="true"/>
</el-form-item>
</el-col>
</el-row>
@@ -114,6 +114,10 @@ export default {
visible: {
type: Boolean,
default: false
},
customerMap: {
type: Object,
default: null
}
},
data() {
@@ -141,10 +145,10 @@ export default {
form: {
orgCode: '892000',
runType: '1',
custIsn: undefined,
custName: undefined,
custIsn: this.customerMap ? this.customerMap.cust_isn : undefined,
custName: this.customerMap ? this.customerMap.cust_name : undefined,
idType: undefined,
idNum: undefined,
idNum: this.customerMap ? (this.customerMap.cust_id || '').substring(3) : undefined,
guarType: undefined,
applyAmt: undefined,
loanPurpose: undefined,
@@ -224,10 +228,10 @@ export default {
this.form = {
orgCode: '892000',
runType: '1',
custIsn: undefined,
custName: undefined,
custIsn: this.customerMap ? this.customerMap.cust_isn : undefined,
custName: this.customerMap ? this.customerMap.cust_name : undefined,
idType: undefined,
idNum: undefined,
idNum: this.customerMap ? (this.customerMap.cust_id || '').substring(3) : undefined,
guarType: undefined,
applyAmt: undefined,
loanPurpose: undefined,
@@ -238,7 +242,11 @@ export default {
collThirdParty: false
}
this.submitting = false
this.resetForm("form")
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.clearValidate()
}
})
},
/** 对话框关闭处理 */
handleClose() {