|
|
@@ -114,6 +114,7 @@ const isDerivationModalOpen = ref(false);
|
|
|
const rules: any = {
|
|
|
name: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
|
|
|
conditioningProgramType: [{ required: true, message: '请选择方案类型', trigger: 'change' }],
|
|
|
+ offlineDuration: [{ required: true, message: '请输入服务所需时间', trigger: 'blur' }],
|
|
|
institutionId: [
|
|
|
{
|
|
|
required: true,
|
|
|
@@ -207,10 +208,10 @@ function cancel() {
|
|
|
}
|
|
|
function doSubmit() {
|
|
|
// 手动验证方案类型
|
|
|
- if (!form.conditioningProgramType) {
|
|
|
- message.error('请选择方案类型');
|
|
|
- return;
|
|
|
- }
|
|
|
+ // if (!form.conditioningProgramType) {
|
|
|
+ // message.error('请选择方案类型');
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
|
|
|
// 自定义验证:检查项目应用是否已选择
|
|
|
if (!checkedList.value || checkedList.value.length === 0) {
|
|
|
@@ -269,10 +270,10 @@ function doSubmit() {
|
|
|
return;
|
|
|
}
|
|
|
// 线下服务:服务所需时间必填
|
|
|
- if (form.sellType === '2' && !form.offlineDuration) {
|
|
|
- message.error('请输入服务所需时间');
|
|
|
- return;
|
|
|
- }
|
|
|
+ // if (form.sellType === '2' && !form.offlineDuration) {
|
|
|
+ // message.error('请输入服务所需时间');
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
// 实体商品:配送必填(itemsList 和 system 类型都需要)
|
|
|
if (form.sellType === '1' && (!deliverArr.value || deliverArr.value.length === 0)) {
|
|
|
message.error('请选择配送方式');
|
|
|
@@ -336,10 +337,10 @@ function doSubmit() {
|
|
|
}
|
|
|
|
|
|
// 商品图片必填
|
|
|
- if (!fileList.value || fileList.value.length === 0) {
|
|
|
- message.error('请上传商品图片');
|
|
|
- return;
|
|
|
- }
|
|
|
+ // if (!fileList.value || fileList.value.length === 0) {
|
|
|
+ // message.error('请上传商品图片');
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
|
|
|
formRef.value?.validate().then(() => {
|
|
|
form.photo = fileList.value[0]?.response?.url || fileList.value[0]?.url || '';
|
|
|
@@ -781,6 +782,17 @@ watch(
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
+
|
|
|
+// 监听项目应用变化,当只选择调理方案项目时,自动设置为一口价
|
|
|
+watch(
|
|
|
+ () => checkedList.value,
|
|
|
+ (newVal) => {
|
|
|
+ // 如果只选择了调理方案项目(包含 '2' 但不包含 '1'),自动设置为一口价
|
|
|
+ if (newVal.includes('2') && !newVal.includes('1')) {
|
|
|
+ form.pricingType = '0';
|
|
|
+ }
|
|
|
+ }
|
|
|
+);
|
|
|
function deliveryChange(value: any) {
|
|
|
form.isDelivery = value[value.length - 1];
|
|
|
}
|
|
|
@@ -885,7 +897,7 @@ function handleDerivation() {
|
|
|
<a-radio value="3">线上权益</a-radio>
|
|
|
</a-radio-group>
|
|
|
</a-form-item>
|
|
|
- <a-form-item label="计价规则:" name="pricingType" :required="checkedList.includes('1')">
|
|
|
+ <a-form-item label="计价规则:" name="pricingType" :required="checkedList.includes('1') || (checkedList.includes('2') && !checkedList.includes('1'))">
|
|
|
<a-radio-group v-model:value="form.pricingType">
|
|
|
<a-radio value="0">一口价</a-radio>
|
|
|
<a-radio value="1" v-if="!checkedList.includes('2')">按穴位/经络/部位</a-radio>
|
|
|
@@ -947,6 +959,7 @@ function handleDerivation() {
|
|
|
</div>
|
|
|
</a-form-item>
|
|
|
<a-form-item label="服务所需时间:"
|
|
|
+ name="offlineDuration"
|
|
|
v-if="(form.addType === 'itemsList' || form.addType === 'system') && showServiceRequiredTime" required>
|
|
|
<a-input v-model:value="form.offlineDuration" placeholder="请输入" style="width: 200px" />
|
|
|
<span style="margin-left: 8px">分钟</span>
|