Просмотр исходного кода

增加购买链接和跳转类型

张田田 7 месяцев назад
Родитель
Сommit
897a44bdad

+ 2 - 0
src/model/care.model.ts

@@ -72,6 +72,8 @@ export interface SystemItemModel {
   attrThird: string; // 制法
   attrSecond: string; // 功效
   types?: string[]; // 项目应用
+  attrEighth: string; // 购买链接
+  attrNinth: string; // 跳转类型
 }
 
 export type SystemIteQuery = Partial<SystemItemModel>;

+ 6 - 4
src/model/health-report-analysis.config.ts

@@ -9,12 +9,14 @@ export const HealthReportAnalysisItemConfig = [
   { category: 'face', key: 'faceColor', subcategory: '面色' },
   { category: 'face', key: 'mainColor', subcategory: '主色' },
   { category: 'face', key: 'shine', subcategory: '光泽' },
-  { category: 'face', key: 'leftBlackEye', subcategory: '左黑眼圈' },
-  { category: 'face', key: 'rightBlackEye', subcategory: '右黑眼圈' },
+  // { category: 'face', key: 'leftBlackEye', subcategory: '左黑眼圈' },
+  // { category: 'face', key: 'rightBlackEye', subcategory: '右黑眼圈' },
+  { category: 'face', key: 'blackEye', subcategory: '黑眼圈' },
   { category: 'face', key: 'lipColor', subcategory: '唇色' },
   { category: 'face', key: 'eyeContact', subcategory: '眼神' },
-  { category: 'face', key: 'leftEyeColor', subcategory: '左目色' },
-  { category: 'face', key: 'rightEyeColor', subcategory: '右目色' },
+  // { category: 'face', key: 'leftEyeColor', subcategory: '左目色' },
+  // { category: 'face', key: 'rightEyeColor', subcategory: '右目色' },
+  { category: 'face', key: 'eyeColor', subcategory: '目色' },
   { category: 'face', key: 'hecticCheek', subcategory: '两颧红' },
   { category: 'face', key: 'noseFold', subcategory: '鼻褶' },
   { category: 'face', key: 'cyanGlabella', subcategory: '眉间/鼻柱青色' },

+ 27 - 11
src/service/AddItems.vue

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

+ 0 - 2
src/service/CareProgress.vue

@@ -65,7 +65,6 @@ function openIndicatorRecordsPreview() {
     VxeUI.modal.close(id);
   };
   onDestroy();
-  console.log(patient.value, 'patient.value');
   VxeUI.modal.open({
     id,
     remember: true,
@@ -180,7 +179,6 @@ const option = ref({
 watch(
   () => careProcessList.value?.patientConditioningScores,
   (newScores) => {
-    console.log(newScores, 'newScores');
     if (newScores && newScores.length > 0) {
       option.value.xAxis.data = newScores.map((item) => item.time4);
       option.value.series[0].data = newScores.map((item) => item.score);

+ 8 - 0
src/service/ServiceDetail.vue

@@ -217,6 +217,14 @@ const hasAnyDerivation = computed(() => {
         </div>
       </div>
     </div>
+    <div class="detail-item" v-if="data?.attrEighth"> 
+      <div class="label">购买链接:</div>
+      <div class="content">{{ data?.attrEighth }}</div>
+    </div>
+    <div class="detail-item" v-if="data?.attrNinth">
+      <div class="label">跳转类型:</div>
+      <div class="content">{{ data?.attrNinth }}</div>
+    </div>
     <div class="detail-item" v-if="data?.institutionName">
       <div class="label">机构名称:</div>
       <div class="content">{{ data?.institutionName }}</div>