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

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

@@ -0,0 +1,60 @@
# 2026-04-29 客户号查询选择客户内码实施记录
## 修改内容
- 后端新增个人/企业客户号映射业务接口:
- `GET /loanPricing/workflow/customer-map/personal?custId=...`
- `GET /loanPricing/workflow/customer-map/corporate?custId=...`
- 后端新增个人/企业客户号映射 mock 接口:
- `GET /rate/pricing/mock/customer-map/personal?cust_id=...`
- `GET /rate/pricing/mock/customer-map/corporate?cust_id=...`
- 配置文件新增 `customer-map` 个人/企业地址,并在 `dev``uat``pro` profile 中统一指向本项目 mock。
- 前端新增客户号查询选择弹窗。
- 客户号查询选择弹窗宽度调整为窗口宽度的 `80%`
- 客户号查询输入值在查询前去除前后空格;后端转发个人/企业客户号映射接口前同步去除前后空格,并对下游 `cust_id` 查询参数做 URI 编码,避免尾随空格进入 request target 触发 TongWeb `HTTP Status 400`
- 选中客户号查询结果后,返回参数 `cust_id` 去除前三位后自动回填到新增弹窗基础信息的 `证件号码` 字段。
- 个人/企业新增流程改为先查询客户号、选择客户内码,再打开新增弹窗。
- 新增弹窗客户内码和客户名称由选中记录自动带入并只读。
## 验证结果
- 后端针对性测试:通过。
- 命令:`mvn -pl ruoyi-loan-pricing -am -Dtest=CustomerMapRecordVOTest,LoanPricingCustomerMapServiceTest,LoanRatePricingMockControllerCustomerMapTest,LoanPricingWorkflowControllerCustomerMapTest -Dsurefire.failIfNoSpecifiedTests=false test`
- 结果:`Tests run: 8, Failures: 0, Errors: 0, Skipped: 0`
- 客户号空格 400 修复补充测试:通过。
- 命令:`mvn -pl ruoyi-loan-pricing -am -Dtest=LoanPricingCustomerMapServiceTest,LoanRatePricingMockControllerCustomerMapTest -Dsurefire.failIfNoSpecifiedTests=false test`
- 结果:`Tests run: 6, Failures: 0, Errors: 0, Skipped: 0`
- 后端打包与启动验证:通过。
- 命令:`mvn -pl ruoyi-admin -am -DskipTests package`
- 命令:`java -jar ruoyi-admin/target/ruoyi-admin.jar --spring.profiles.active=dev`
- 结果:后端以 `dev` profile 启动成功,端口 `63310` 可用。
- 接口验证:通过。
- `GET /rate/pricing/mock/customer-map/personal?cust_id=P001` 返回随机个人客户映射列表,字段为 `cust_id``cust_isn``cust_name``faith_day``balance_avg``loan_count_his``last_loan_date`
- `GET /rate/pricing/mock/customer-map/corporate?cust_id=C001` 返回随机企业客户映射列表,字段同上。
- `GET /rate/pricing/mock/customer-map/personal?cust_id=` 返回 `客户号不能为空`
- 登录后调用 `GET /loanPricing/workflow/customer-map/personal?custId=P001``GET /loanPricing/workflow/customer-map/corporate?custId=C001` 均返回对应映射列表。
- 登录后调用 `GET /loanPricing/workflow/customer-map/personal?custId=` 返回 `客户号不能为空`
- 补充验证:以最新后端临时端口 `63311` 调用 `GET /loanPricing/workflow/customer-map/personal?custId=1w0xc20xb7%20` 返回 `code=200`,返回 `cust_id``1w0xc20xb7`;调用 `GET /loanPricing/workflow/customer-map/corporate?custId=C001%20` 返回 `code=200`,返回 `cust_id``C001`;调用 `GET /loanPricing/workflow/customer-map/personal?custId=%20` 返回 `客户号不能为空`
- 前端针对性测试:通过。
- 命令:`zsh -lic 'nvm use 14.21.3 >/dev/null && node ruoyi-ui/tests/customer-map-selection.test.js && npm --prefix ruoyi-ui run test:personal-create-input-params && npm --prefix ruoyi-ui run test:corporate-create-input-params && node ruoyi-ui/tests/workflow-index-refresh.test.js'`
- 结果:`customer map selection assertions passed``personal create input params assertions passed``corporate create input params assertions passed``workflow-index-refresh test passed`
- 补充命令:`zsh -lic 'nvm use 14.21.3 >/dev/null && node ruoyi-ui/tests/customer-map-selection.test.js'`
- 补充结果:`customer map selection assertions passed`,覆盖客户号去前三位回填证件号码断言。
- 补充回归命令:`zsh -lic 'nvm use 14.21.3 >/dev/null && node ruoyi-ui/tests/customer-map-selection.test.js && npm --prefix ruoyi-ui run test:personal-create-input-params && npm --prefix ruoyi-ui run test:corporate-create-input-params && node ruoyi-ui/tests/id-number-validation-removal.test.js'`
- 补充回归结果:`customer map selection assertions passed``personal create input params assertions passed``corporate create input params assertions passed``id number validation removal assertions passed`
- 前端生产构建:通过。
- 命令:`zsh -lic 'nvm use 14.21.3 >/dev/null && npm --prefix ruoyi-ui run build:prod'`
- 结果:构建成功;输出 2 个既有体积 warning。
- 真实页面验证:通过。
- 启动前端 `http://localhost:18080/`,登录后进入真实页面 `http://localhost:18080/loanPricing/workflow`
- 个人客户:点击 `新增` -> `个人客户` -> 客户号查询输入 `PTEST003` -> 返回多条客户映射 -> 选择首行 -> 打开 `新增个人利率定价流程`,客户内码自动带入 `81000450472`,客户名称自动带入 `个人客户1`,两个字段均为 `readonly`
- 企业客户:点击 `新增` -> `企业客户` -> 客户号查询输入 `CTEST001` -> 返回多条客户映射 -> 选择首行 -> 打开 `新增企业利率定价流程`,客户内码自动带入 `81000448819`,客户名称自动带入 `企业客户1`,两个字段均为 `readonly`
- 弹窗宽度补充验证:点击 `新增` -> `个人客户` 后,`客户号查询` 弹窗 DOM 样式为 `margin-top: 15vh; width: 80%;`
- 客户号空格补充验证:点击 `新增` -> `个人客户`,客户号输入 `1w0xc20xb7 ` 后查询,输入框显示为 `1w0xc20xb7`,列表正常返回客户映射,页面未出现 `400``Bad Request`
- 客户号到证件号码补充验证:点击 `新增` -> `个人客户`,客户号输入 `ABC123456789` 并选择返回行后,新增个人弹窗基础信息的 `证件号码` 自动填入 `123456789`
- 页面验证仅验证查询选择与自动回填链路,未提交新增表单,避免写入额外流程测试数据。
- 回归补充说明:
- `LoanPricingModelServiceTest` 已通过。
- 组合回归命令包含 `LoanPricingWorkflowServiceImplTest` 时,当前本机 Oracle JDK 21 环境下 Mockito inline/Byte Buddy self-attach 失败,属于既有测试环境限制,不是本次客户号映射功能断言失败。
- 进程清理:已关闭本次启动的后端和前端进程。
- 本次宽度与客户号空格补充验证结束后,`18080``63311` 无监听;`63310` 为验证前已存在的后端进程,未处理。

View File

@@ -82,6 +82,10 @@ model:
personal-url: http://localhost:63310/rate/pricing/mock/invokeModel/personal
corporate-url: http://localhost:63310/rate/pricing/mock/invokeModel/corporate
customer-map:
personal-url: http://localhost:63310/rate/pricing/mock/customer-map/personal
corporate-url: http://localhost:63310/rate/pricing/mock/customer-map/corporate
security:
password-transfer:
key: "1234567890abcdef"

View File

@@ -81,6 +81,11 @@ spring:
model:
personal-url: http://64.202.32.40:8083/api/service/interface/invokeService/syllcs
corporate-url: http://64.202.32.40:8083/api/service/interface/invokeService/sydgllcs
customer-map:
personal-url: http://552f7aff0acd4c09ac3b83dbfee57fa0.apigateway.res.dc-pdt-zj96596.com/shangyu_lilvcesuan_ind_idmapno?appCode=1a89fa84abda480ba93ed73fd01ffd07&cust_id=
corporate-url: http://552f7aff0acd4c09ac3b83dbfee57fa0.apigateway.res.dc-pdt-zj96596.com/shangyu_lilvcesuan_ent_idmapno?appCode=1a89fa84abda480ba93ed73fd01ffd07&cust_id=
security:
password-transfer:
key: "1234567890abcdef"

View File

@@ -82,6 +82,10 @@ model:
personal-url: http://localhost:63310/rate/pricing/mock/invokeModel/personal
corporate-url: http://localhost:63310/rate/pricing/mock/invokeModel/corporate
customer-map:
personal-url: http://localhost:63310/rate/pricing/mock/customer-map/personal
corporate-url: http://localhost:63310/rate/pricing/mock/customer-map/corporate
security:
password-transfer:
key: "1234567890abcdef"

View File

@@ -15,6 +15,7 @@ import com.ruoyi.loanpricing.domain.entity.LoanPricingWorkflow;
import com.ruoyi.loanpricing.domain.vo.LoanPricingWorkflowListVO;
import com.ruoyi.loanpricing.domain.vo.LoanPricingWorkflowVO;
import com.ruoyi.loanpricing.service.ILoanPricingWorkflowService;
import com.ruoyi.loanpricing.service.LoanPricingCustomerMapService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -38,6 +39,9 @@ public class LoanPricingWorkflowController extends BaseController
@Autowired
private ILoanPricingWorkflowService loanPricingWorkflowService;
@Autowired
private LoanPricingCustomerMapService customerMapService;
/**
* 发起个人客户利率定价流程
*/
@@ -61,6 +65,26 @@ public class LoanPricingWorkflowController extends BaseController
return success(result);
}
/**
* 查询个人客户号映射
*/
@Operation(summary = "查询个人客户号映射")
@GetMapping("/customer-map/personal")
public AjaxResult queryPersonalCustomerMap(@RequestParam("custId") String custId)
{
return success(customerMapService.queryPersonal(custId));
}
/**
* 查询企业客户号映射
*/
@Operation(summary = "查询企业客户号映射")
@GetMapping("/customer-map/corporate")
public AjaxResult queryCorporateCustomerMap(@RequestParam("custId") String custId)
{
return success(customerMapService.queryCorporate(custId));
}
/**
* 查询利率定价流程列表
*/

View File

@@ -6,15 +6,22 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.loanpricing.domain.dto.ModelInvokeDTO;
import com.ruoyi.loanpricing.domain.vo.CustomerMapRecordVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.core.io.ClassPathResource;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import java.io.InputStream;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
/**
@@ -40,6 +47,22 @@ public class LoanRatePricingMockController extends BaseController {
return new AjaxResult(10000, "success", loadJsonFromResource("data/corp_output.json"));
}
@Anonymous
@Operation(summary = "模拟个人客户号映射查询")
@GetMapping("/customer-map/personal")
public AjaxResult queryPersonalCustomerMap(@RequestParam("cust_id") String custId)
{
return success(randomCustomerMapRecords(custId, "个人客户"));
}
@Anonymous
@Operation(summary = "模拟企业客户号映射查询")
@GetMapping("/customer-map/corporate")
public AjaxResult queryCorporateCustomerMap(@RequestParam("cust_id") String custId)
{
return success(randomCustomerMapRecords(custId, "企业客户"));
}
private ObjectNode loadJsonFromResource(String resourcePath){
ClassPathResource classPathResource = new ClassPathResource(resourcePath);
try (InputStream inputStream = classPathResource.getInputStream();){
@@ -51,5 +74,28 @@ public class LoanRatePricingMockController extends BaseController {
}
}
private List<CustomerMapRecordVO> randomCustomerMapRecords(String custId, String namePrefix)
{
String normalizedCustId = StringUtils.trimWhitespace(custId);
if (!StringUtils.hasText(normalizedCustId))
{
throw new ServiceException("客户号不能为空");
}
int count = ThreadLocalRandom.current().nextInt(1, 4);
List<CustomerMapRecordVO> records = new ArrayList<>();
for (int i = 1; i <= count; i++)
{
CustomerMapRecordVO record = new CustomerMapRecordVO();
record.setCustId(normalizedCustId);
record.setCustIsn(String.valueOf(81000000000L + ThreadLocalRandom.current().nextInt(1000000)));
record.setCustName(namePrefix + i);
record.setFaithDay(String.valueOf(ThreadLocalRandom.current().nextInt(1, 365)));
record.setBalanceAvg(String.valueOf(ThreadLocalRandom.current().nextInt(10000, 900000)));
record.setLoanCountHis(String.valueOf(ThreadLocalRandom.current().nextInt(0, 10)));
record.setLastLoanDate(LocalDate.now().minusDays(ThreadLocalRandom.current().nextInt(1, 800)).toString());
records.add(record);
}
return records;
}
}

View File

@@ -0,0 +1,35 @@
package com.ruoyi.loanpricing.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import lombok.Data;
/**
* 客户号与客户内码映射记录。
*/
@Data
public class CustomerMapRecordVO implements Serializable
{
private static final long serialVersionUID = 1L;
@JsonProperty("cust_id")
private String custId;
@JsonProperty("cust_isn")
private String custIsn;
@JsonProperty("cust_name")
private String custName;
@JsonProperty("faith_day")
private String faithDay;
@JsonProperty("balance_avg")
private String balanceAvg;
@JsonProperty("loan_count_his")
private String loanCountHis;
@JsonProperty("last_loan_date")
private String lastLoanDate;
}

View File

@@ -0,0 +1,89 @@
package com.ruoyi.loanpricing.service;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.loanpricing.domain.vo.CustomerMapRecordVO;
import java.net.URI;
import java.util.Collections;
import java.util.List;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
/**
* 客户号与客户内码映射查询服务。
*/
@Service
public class LoanPricingCustomerMapService
{
private final RestTemplate restTemplate;
@Value("${customer-map.personal-url}")
private String personalUrl;
@Value("${customer-map.corporate-url}")
private String corporateUrl;
public LoanPricingCustomerMapService()
{
this(new RestTemplate());
}
LoanPricingCustomerMapService(RestTemplate restTemplate)
{
this.restTemplate = restTemplate;
}
LoanPricingCustomerMapService(RestTemplate restTemplate, String personalUrl, String corporateUrl)
{
this.restTemplate = restTemplate;
this.personalUrl = personalUrl;
this.corporateUrl = corporateUrl;
}
public List<CustomerMapRecordVO> queryPersonal(String custId)
{
return query(personalUrl, custId);
}
public List<CustomerMapRecordVO> queryCorporate(String custId)
{
return query(corporateUrl, custId);
}
private List<CustomerMapRecordVO> query(String url, String custId)
{
String normalizedCustId = StringUtils.trimWhitespace(custId);
if (!StringUtils.hasText(normalizedCustId))
{
throw new ServiceException("客户号不能为空");
}
URI uri = UriComponentsBuilder.fromHttpUrl(url)
.queryParam("cust_id", normalizedCustId)
.build()
.encode()
.toUri();
CustomerMapResponse response = restTemplate.getForObject(uri, CustomerMapResponse.class);
if (response == null)
{
throw new ServiceException("客户号映射接口无返回");
}
if (response.getCode() != null && response.getCode() != 200)
{
throw new ServiceException(StringUtils.hasText(response.getMsg()) ? response.getMsg() : "客户号映射查询失败");
}
return response.getData() == null ? Collections.emptyList() : response.getData();
}
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
static class CustomerMapResponse
{
private Integer code;
private String msg;
private List<CustomerMapRecordVO> data;
}
}

View File

@@ -35,6 +35,24 @@ export function createCorporateWorkflow(data) {
})
}
// 查询个人客户号映射
export function queryPersonalCustomerMap(custId) {
return request({
url: '/loanPricing/workflow/customer-map/personal',
method: 'get',
params: { custId: custId }
})
}
// 查询企业客户号映射
export function queryCorporateCustomerMap(custId) {
return request({
url: '/loanPricing/workflow/customer-map/corporate',
method: 'get',
params: { custId: custId }
})
}
// 设定执行利率
export function setExecuteRate(serialNum, executeRate) {
return request({

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() {

View File

@@ -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
}
}
}