|
@@ -247,6 +247,7 @@ function doSubmit() {
|
|
|
message.error('请选择计价规则');
|
|
message.error('请选择计价规则');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ // console.log(form.pricingType, 'form.pricingType==>', form);
|
|
|
// 计价规则相关字段校验
|
|
// 计价规则相关字段校验
|
|
|
if (form.pricingType === '0') {
|
|
if (form.pricingType === '0') {
|
|
|
const { unitPrice, pricingUnit, convertDose, convertUnit } = form.cpFixedPricingRule || {};
|
|
const { unitPrice, pricingUnit, convertDose, convertUnit } = form.cpFixedPricingRule || {};
|
|
@@ -255,15 +256,20 @@ function doSubmit() {
|
|
|
message.error('请将单价、计价单位、相当于、使用单位全部填写');
|
|
message.error('请将单价、计价单位、相当于、使用单位全部填写');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ form.cpDynamicPricingRule = undefined;
|
|
|
} else if (form.pricingType === '1') {
|
|
} else if (form.pricingType === '1') {
|
|
|
const rule1 = form.cpDynamicPricingRule[0] || {};
|
|
const rule1 = form.cpDynamicPricingRule[0] || {};
|
|
|
const rule2 = form.cpDynamicPricingRule[1] || {};
|
|
const rule2 = form.cpDynamicPricingRule[1] || {};
|
|
|
const allFilled1 = rule1.min && typeof rule1.priceType !== 'undefined' && rule1.price;
|
|
const allFilled1 = rule1.min && typeof rule1.priceType !== 'undefined' && rule1.price;
|
|
|
const allFilled2 = rule2.max && typeof rule2.priceType !== 'undefined' && rule2.price;
|
|
const allFilled2 = rule2.max && typeof rule2.priceType !== 'undefined' && rule2.price;
|
|
|
|
|
+ rule1.max = 0;
|
|
|
|
|
+ rule2.min = 0;
|
|
|
if (!(allFilled1 && allFilled2)) {
|
|
if (!(allFilled1 && allFilled2)) {
|
|
|
message.error('请将按穴位/经络/部位的所有计价字段全部填写');
|
|
message.error('请将按穴位/经络/部位的所有计价字段全部填写');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ // 按穴位模式:清空一口价数据
|
|
|
|
|
+ form.cpFixedPricingRule = undefined;
|
|
|
}
|
|
}
|
|
|
// 供应商
|
|
// 供应商
|
|
|
if (form.addType === 'itemsList' && checkedList.value.includes('1')) {
|
|
if (form.addType === 'itemsList' && checkedList.value.includes('1')) {
|
|
@@ -295,6 +301,10 @@ function doSubmit() {
|
|
|
message.error('单价、计价单位、相当于、使用单位要么全部填写,要么全部为空');
|
|
message.error('单价、计价单位、相当于、使用单位要么全部填写,要么全部为空');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ // 一口价模式:清空按穴位数据
|
|
|
|
|
+ if (allFilled) {
|
|
|
|
|
+ form.cpDynamicPricingRule = undefined;
|
|
|
|
|
+ }
|
|
|
} else if (form.pricingType === '1') {
|
|
} else if (form.pricingType === '1') {
|
|
|
const rule1 = form.cpDynamicPricingRule[0] || {};
|
|
const rule1 = form.cpDynamicPricingRule[0] || {};
|
|
|
const rule2 = form.cpDynamicPricingRule[1] || {};
|
|
const rule2 = form.cpDynamicPricingRule[1] || {};
|
|
@@ -306,6 +316,10 @@ function doSubmit() {
|
|
|
message.error('按穴位/经络/部位的所有计价字段要么全部填写,要么全部为空');
|
|
message.error('按穴位/经络/部位的所有计价字段要么全部填写,要么全部为空');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ // 按穴位模式:清空一口价数据
|
|
|
|
|
+ if (allFilled1 && allFilled2) {
|
|
|
|
|
+ form.cpFixedPricingRule = undefined;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// 调理方案项目相关必填
|
|
// 调理方案项目相关必填
|
|
@@ -643,15 +657,24 @@ function handleVideoChange(info: any) {
|
|
|
watch(
|
|
watch(
|
|
|
() => form.pricingType,
|
|
() => form.pricingType,
|
|
|
(val) => {
|
|
(val) => {
|
|
|
- if (val === '0' && !form.cpFixedPricingRule) {
|
|
|
|
|
- form.cpFixedPricingRule = {
|
|
|
|
|
- unitPrice: '',
|
|
|
|
|
- pricingUnit: '',
|
|
|
|
|
- convertDose: '',
|
|
|
|
|
- convertUnit: '',
|
|
|
|
|
- };
|
|
|
|
|
- } else {
|
|
|
|
|
- form.cpFixedPricingRule = null;
|
|
|
|
|
|
|
+ if (val === '0') {
|
|
|
|
|
+ // 一口价模式:确保 cpFixedPricingRule 存在
|
|
|
|
|
+ if (!form.cpFixedPricingRule) {
|
|
|
|
|
+ form.cpFixedPricingRule = {
|
|
|
|
|
+ unitPrice: '',
|
|
|
|
|
+ pricingUnit: '',
|
|
|
|
|
+ convertDose: '',
|
|
|
|
|
+ convertUnit: '',
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (val === '1') {
|
|
|
|
|
+ // 按穴位模式:确保 cpDynamicPricingRule 存在
|
|
|
|
|
+ if (!form.cpDynamicPricingRule) {
|
|
|
|
|
+ form.cpDynamicPricingRule = [
|
|
|
|
|
+ { min: '', max: '', priceType: '', price: '' },
|
|
|
|
|
+ { min: '', max: '', priceType: '', price: '' },
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
@@ -766,14 +789,7 @@ function handleDerivation() {
|
|
|
|
|
|
|
|
<span style="margin-left: 32px">相当于</span>
|
|
<span style="margin-left: 32px">相当于</span>
|
|
|
<a-input v-model:value="form.cpFixedPricingRule.convertDose" placeholder="请输入" style="width: 100px; margin-left: 8px" />
|
|
<a-input v-model:value="form.cpFixedPricingRule.convertDose" placeholder="请输入" style="width: 100px; margin-left: 8px" />
|
|
|
- <vxe-select
|
|
|
|
|
- v-model="form.cpFixedPricingRule.convertUnit"
|
|
|
|
|
- :options="unitOptions"
|
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
- clearable
|
|
|
|
|
- transfer
|
|
|
|
|
- style="width: 100px; margin-left: 8px"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <vxe-select v-model="form.cpFixedPricingRule.convertUnit" :options="unitOptions" placeholder="请选择" clearable transfer style="width: 100px; margin-left: 8px" />
|
|
|
|
|
|
|
|
<span style="color: #aaa; margin-left: 8px">(使用单位)</span>
|
|
<span style="color: #aaa; margin-left: 8px">(使用单位)</span>
|
|
|
</div>
|
|
</div>
|