|
|
@@ -91,6 +91,8 @@ const form = reactive<SystemItemModel>({
|
|
|
status: '0', // 状态
|
|
|
isForWrap: null, // 是否服务包项目
|
|
|
isForInfer: null, // 是否调理方案项目
|
|
|
+ attrEighth: '', // 购买链接
|
|
|
+ attrNinth: '', // 跳转类型
|
|
|
});
|
|
|
|
|
|
const checkedList = ref<string[]>(['1']); // 默认选中第一个
|
|
|
@@ -251,10 +253,8 @@ function doSubmit() {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- // console.log(form.pricingType, 'form.pricingType==>', form);
|
|
|
// 计价规则相关字段校验
|
|
|
if (form.pricingType === '0') {
|
|
|
- console.log(form.cpFixedPricingRule, 'form.cpFixedPricingRule');
|
|
|
const { unitPrice, pricingUnit, convertDose, convertUnit } = form.cpFixedPricingRule || {};
|
|
|
const allFilled = (unitPrice !== '' && unitPrice !== null && unitPrice !== undefined) && pricingUnit && (convertDose !== '' && convertDose !== null && convertDose !== undefined) && convertUnit;
|
|
|
if (!allFilled) {
|
|
|
@@ -341,9 +341,9 @@ function doSubmit() {
|
|
|
|
|
|
// 购买链接与跳转类型联动校验:有购买链接则必须选择跳转类型
|
|
|
if (form.addType === 'itemsList') {
|
|
|
- const hasBuyUrl = !!(form.buyUrl && String(form.buyUrl).trim());
|
|
|
- if (hasBuyUrl && !form.jumpType) {
|
|
|
- message.error('有“购买链接”时必须选择“跳转类型”');
|
|
|
+ const hasBuyUrl = !!(form.attrEighth && String(form.attrEighth).trim());
|
|
|
+ if (hasBuyUrl && !form.attrNinth) {
|
|
|
+ message.error('请选择跳转类型');
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
@@ -382,6 +382,24 @@ async function getConditioningProgramType() {
|
|
|
typeOptionsLoading.value = false;
|
|
|
}
|
|
|
}
|
|
|
+const jumpTypeOptionsLoading = ref(false);
|
|
|
+const jumpTypeOptions = ref<{ label: string; value: string }[]>([]);
|
|
|
+// 获取跳转类型
|
|
|
+async function getJumpType() {
|
|
|
+ jumpTypeOptionsLoading.value = true;
|
|
|
+ try {
|
|
|
+ const res = await getDictionaryMethod('fdhb_cpbuy_type');
|
|
|
+ if (res?.length > 0) {
|
|
|
+ jumpTypeOptions.value = res;
|
|
|
+ }
|
|
|
+} catch (error: any) {
|
|
|
+ notification.error({
|
|
|
+ message: error.message,
|
|
|
+ });
|
|
|
+} finally {
|
|
|
+ jumpTypeOptionsLoading.value = false;
|
|
|
+}
|
|
|
+}
|
|
|
|
|
|
// 处理下拉框点击事件
|
|
|
function handleSelectClick() {
|
|
|
@@ -470,6 +488,8 @@ onMounted(async () => {
|
|
|
}
|
|
|
// 获取方案类型
|
|
|
getConditioningProgramType();
|
|
|
+ // 获取跳转类型
|
|
|
+ getJumpType();
|
|
|
});
|
|
|
const emits = defineEmits<{
|
|
|
submit: [data?: SystemItemModel];
|
|
|
@@ -771,10 +791,6 @@ function handleDerivation() {
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
-const jumpTypeOptions = [
|
|
|
- { label: '小程序', value: '1' },
|
|
|
- { label: 'H5', value: '2' },
|
|
|
-];
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
@@ -1040,11 +1056,11 @@ const jumpTypeOptions = [
|
|
|
</a-form-item>
|
|
|
<!-- 购买链接 -->
|
|
|
<a-form-item label="购买链接:" v-if="form.addType === 'itemsList'">
|
|
|
- <a-input v-model:value="form.buyUrl" placeholder="请输入" />
|
|
|
+ <a-input v-model:value="form.attrEighth" placeholder="请输入" />
|
|
|
</a-form-item>
|
|
|
<!-- 跳转类型 -->
|
|
|
<a-form-item label="跳转类型:" v-if="form.addType === 'itemsList'" style="width: 100%">
|
|
|
- <Vxe-select v-model="form.jumpType" :options="jumpTypeOptions" placeholder="请选择" clearable transfer style="width: 100%" />
|
|
|
+ <Vxe-select v-model="form.attrNinth" :options="jumpTypeOptions" placeholder="请选择" clearable transfer style="width: 100%" />
|
|
|
</a-form-item>
|
|
|
<!-- 机构名称 -->
|
|
|
<a-form-item label="机构名称:" v-if="form?.addType === 'itemsList'" required name="institutionId">
|