新增客户号查询并回填客户信息
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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>
|
||||
@@ -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() {
|
||||
|
||||
@@ -81,17 +81,33 @@
|
||||
<!-- 客户类型选择对话框 -->
|
||||
<customer-type-selector :visible.sync="showTypeSelector" @select="handleSelectType"/>
|
||||
|
||||
<!-- 客户号查询选择对话框 -->
|
||||
<customer-map-selector
|
||||
:visible.sync="showCustomerMapSelector"
|
||||
:customer-type="selectedCustomerType"
|
||||
@select="handleCustomerMapSelect"
|
||||
/>
|
||||
|
||||
<!-- 个人客户创建对话框 -->
|
||||
<personal-create-dialog :visible.sync="showPersonalDialog" @success="handleCreateSuccess"/>
|
||||
<personal-create-dialog
|
||||
:visible.sync="showPersonalDialog"
|
||||
:customer-map="selectedCustomerMap"
|
||||
@success="handleCreateSuccess"
|
||||
/>
|
||||
|
||||
<!-- 企业客户创建对话框 -->
|
||||
<corporate-create-dialog :visible.sync="showCorporateDialog" @success="handleCreateSuccess"/>
|
||||
<corporate-create-dialog
|
||||
:visible.sync="showCorporateDialog"
|
||||
:customer-map="selectedCustomerMap"
|
||||
@success="handleCreateSuccess"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listWorkflow} from "@/api/loanPricing/workflow"
|
||||
import CustomerTypeSelector from "./components/CustomerTypeSelector"
|
||||
import CustomerMapSelector from "./components/CustomerMapSelector"
|
||||
import PersonalCreateDialog from "./components/PersonalCreateDialog"
|
||||
import CorporateCreateDialog from "./components/CorporateCreateDialog"
|
||||
|
||||
@@ -99,6 +115,7 @@ export default {
|
||||
name: "LoanPricingWorkflow",
|
||||
components: {
|
||||
CustomerTypeSelector,
|
||||
CustomerMapSelector,
|
||||
PersonalCreateDialog,
|
||||
CorporateCreateDialog
|
||||
},
|
||||
@@ -114,6 +131,12 @@ export default {
|
||||
workflowList: [],
|
||||
// 是否显示客户类型选择弹出层
|
||||
showTypeSelector: false,
|
||||
// 是否显示客户号查询选择弹出层
|
||||
showCustomerMapSelector: false,
|
||||
// 当前选择的客户类型
|
||||
selectedCustomerType: undefined,
|
||||
// 当前选择的客户号映射记录
|
||||
selectedCustomerMap: null,
|
||||
// 是否显示个人客户创建弹出层
|
||||
showPersonalDialog: false,
|
||||
// 是否显示企业客户创建弹出层
|
||||
@@ -134,6 +157,18 @@ export default {
|
||||
activated() {
|
||||
this.getList()
|
||||
},
|
||||
watch: {
|
||||
showPersonalDialog(val) {
|
||||
if (!val && !this.showCorporateDialog) {
|
||||
this.clearSelectedCustomer()
|
||||
}
|
||||
},
|
||||
showCorporateDialog(val) {
|
||||
if (!val && !this.showPersonalDialog) {
|
||||
this.clearSelectedCustomer()
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 查询利率定价流程列表 */
|
||||
getList() {
|
||||
@@ -167,15 +202,28 @@ export default {
|
||||
},
|
||||
/** 选择客户类型回调 */
|
||||
handleSelectType(type) {
|
||||
if (type === 'personal') {
|
||||
this.selectedCustomerType = type
|
||||
this.selectedCustomerMap = null
|
||||
this.showCustomerMapSelector = true
|
||||
},
|
||||
/** 选择客户号映射记录回调 */
|
||||
handleCustomerMapSelect(row) {
|
||||
this.selectedCustomerMap = row
|
||||
if (this.selectedCustomerType === 'personal') {
|
||||
this.showPersonalDialog = true
|
||||
} else if (type === 'corporate') {
|
||||
} else if (this.selectedCustomerType === 'corporate') {
|
||||
this.showCorporateDialog = true
|
||||
}
|
||||
},
|
||||
/** 创建成功回调 */
|
||||
handleCreateSuccess() {
|
||||
this.clearSelectedCustomer()
|
||||
this.getList()
|
||||
},
|
||||
/** 清空已选客户信息 */
|
||||
clearSelectedCustomer() {
|
||||
this.selectedCustomerMap = null
|
||||
this.selectedCustomerType = undefined
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user