修改测试

This commit is contained in:
wuweihua
2026-09-10 14:23:58 +08:00
parent 05c8d3f90d
commit 6d718320e6
24 changed files with 475 additions and 210 deletions
+19 -9
View File
@@ -222,16 +222,18 @@
title="套餐创建后处于草稿状态,可暂不绑定客户。一个客户只能绑定一个套餐。"
/>
<el-table :data="form.customers" border empty-text="暂未绑定客户">
<el-table-column label="客户ID" min-width="120">
<el-table-column label="客户" min-width="220">
<template #default="{ row }">
<el-input v-model="row.customerId" placeholder="客户ID" />
</template>
</el-table-column>
<el-table-column label="客户名称" min-width="140">
<template #default="{ row }">
<el-input v-model="row.customerName" placeholder="客户名称" />
<customer-select
v-model="row.customerCode"
value-key="customerCode"
placeholder="请选择客户"
@change="(code, item) => onBindCustomerChange(row, code, item)"
/>
</template>
</el-table-column>
<el-table-column label="客户代码" prop="customerCode" min-width="120" show-overflow-tooltip />
<el-table-column label="客户名称" prop="customerName" min-width="140" show-overflow-tooltip />
<el-table-column label="优先级" width="110">
<template #default="{ row }">
<el-input-number v-model="row.bindPriority" :min="1" controls-position="right" style="width: 100%" />
@@ -448,6 +450,7 @@ function emptyDetail() {
function emptyCustomer() {
return {
customerId: undefined,
customerCode: undefined,
customerName: '',
bindPriority: form.customers.length + 1,
prBegindate: form.effectiveDate,
@@ -463,6 +466,13 @@ function addCustomerRow() {
form.customers.push(emptyCustomer())
}
function onBindCustomerChange(row, code, item) {
console.log('onBindCustomerChange', row, code, item)
row.customerCode = code || undefined
row.customerName = item ? item.customerName : ''
row.customerId = item ? item.customerId : undefined
}
function clearCascadeAfterProduct(row) {
row.countryCode = undefined
row.countryName = undefined
@@ -545,10 +555,10 @@ function buildPayload(submitFlag) {
roundMode: d.roundMode || 'HALF_UP'
}))
const customers = (form.customers || [])
.filter(c => c.customerId)
.filter(c => c.customerCode)
.map(c => ({
...c,
customerId: Number(c.customerId)
customerCode: c.customerCode
}))
console.log('details', details)