瀏覽代碼

医生端增加"药食同源"功能

cgp 17 小時之前
父節點
當前提交
3e400f1a48
共有 2 個文件被更改,包括 37 次插入11 次删除
  1. 35 9
      src/views/his/scrmPrescribe/DoctorAdviceDialog.vue
  2. 2 2
      src/views/his/scrmPrescribe/index.vue

+ 35 - 9
src/views/his/scrmPrescribe/DoctorAdviceDialog.vue

@@ -126,12 +126,20 @@
         </el-table>
       </el-form-item>
 
-      <!-- 不建议使用复选框 -->
-      <el-form-item label="不建议使用" label-width="120px">
-        <el-checkbox v-model="formData.notRecommendUse" :disabled="readonly">不建议使用</el-checkbox>
-      </el-form-item>
+      <el-row :gutter="10">
+        <el-col :span="10">
+          <el-form-item label="不建议使用" label-width="90px">
+            <el-checkbox v-model="formData.notRecommendUse" :disabled="readonly" @change="handleNotRecommendChange">不建议使用</el-checkbox>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="" label-width="60px">
+            <el-checkbox v-model="formData.foodAsMedicine" :disabled="readonly" @change="handleFoodAsMedicineChange">完成</el-checkbox>
+          </el-form-item>
+        </el-col>
+      </el-row>
 
-      <!-- 医生及药师信息(紧凑三列) -->
+      <!-- 医生及药师信息 -->
       <el-divider content-position="left">医生及药师信息</el-divider>
       <el-row :gutter="20">
         <el-col :span="12">
@@ -204,7 +212,8 @@ export default {
         foodAndExerciseGuidance: '',
         healingList: [],
         noteTaboos: '',
-        notRecommendUse: false
+        notRecommendUse: false,
+        foodAsMedicine: false
       },
       formRules: {
         diagnose: [{ required: true, message: '请输入诊断', trigger: 'blur' }],
@@ -280,13 +289,25 @@ export default {
         foodAndExerciseGuidance: '',
         healingList: [],
         noteTaboos: '',
-        notRecommendUse: false
+        notRecommendUse: false,
+        foodAsMedicine: false
       };
       if (!this.readonly) this.addHealingRow();
       this.$nextTick(() => {
         if (this.$refs.adviceForm) this.$refs.adviceForm.clearValidate();
       });
     },
+    handleNotRecommendChange(val) {
+      if (val) {
+        this.formData.foodAsMedicine = false;
+      }
+    },
+
+    handleFoodAsMedicineChange(val) {
+      if (val) {
+        this.formData.notRecommendUse = false;
+      }
+    },
     addHealingRow() {
       this.formData.healingList.push({ diagnosisContent: '', suggestTreatment: '' });
     },
@@ -361,6 +382,7 @@ export default {
           this.formData.foodAndExerciseGuidance = data.foodAndExerciseGuidance || '';
           this.formData.noteTaboos = data.noteTaboos || '';
           this.formData.notRecommendUse = data.notRecommendUse || false;
+          this.formData.foodAsMedicine = data.foodAsMedicine || false;
           if (data.healingAreaJson) {
             try {
               const list = JSON.parse(data.healingAreaJson);
@@ -392,13 +414,17 @@ export default {
           foodAndExerciseGuidance: this.formData.foodAndExerciseGuidance,
           healingAreaJson: healingAreaJson,
           noteTaboos: this.formData.noteTaboos,
-          notRecommendUse: this.formData.notRecommendUse
+          notRecommendUse: this.formData.notRecommendUse,
+          foodAsMedicine: this.formData.foodAsMedicine,
         };
         this.submitLoading = true;
         submitDoctorAdvice(params).then(() => {
           this.$message.success('处方建议提交成功');
           this.dialogVisible = false;
-          this.$emit('success', { notRecommendUse: this.formData.notRecommendUse });
+          this.$emit('success', {
+            notRecommendUse: this.formData.notRecommendUse,
+            foodAsMedicine: this.formData.foodAsMedicine
+          });
         }).catch(error => {
           console.error('提交失败', error);
           this.$message.error('提交失败,请重试');

+ 2 - 2
src/views/his/scrmPrescribe/index.vue

@@ -300,8 +300,8 @@ export default {
     // 完善处方成功后的回调(询问是否开方)
     handleAdviceSuccess(payload) {
       this.getList();
-      // 如果是不建议使用,直接返回,不弹出开方询问
-      if (payload && payload.notRecommendUse === true) {
+      // 如果勾选了“不建议使用”或“完成”,不弹出开方询问
+      if (payload && (payload.notRecommendUse || payload.foodAsMedicine)) {
         return;
       }
       if (!this.isReadonlyAdvice) {