Ver Fonte

Merge tag '20250508-01' into develop

cc12458 há 1 ano atrás
pai
commit
a858cc8fc4
2 ficheiros alterados com 22 adições e 6 exclusões
  1. 20 5
      src/components/TCMDiagnosis.vue
  2. 2 1
      src/views/diagnosis/Prescribing.vue

+ 20 - 5
src/components/TCMDiagnosis.vue

@@ -9,6 +9,7 @@
       <div class="value">
         <el-popover placement="bottom" width="180" trigger="focus" :close-delay="100">
           <el-input
+            :class="{invalid: name && !zy_dise_id}"
             :size="size"
             slot="reference"
             :placeholder="key1?key1:'中医病名'"
@@ -267,6 +268,7 @@ export default {
       this.key1 = item.disname;
       this.$refs.zybm.blur();
 
+      this.key2 = '';
       this.syndrome = "";
       this.zhengxingid = "";
       this.therapy = "";
@@ -369,17 +371,30 @@ export default {
           zhengxing: ""
         }
       };
-      let res = await addDiagnosisData(params);
-      if (res.ResultCode == 0) {
-        this.addRecipeFrom();
-      } else {
-        this.$message.error(res.ResultInfo);
+      let res = await addDiagnosisData(params).catch(() => ({ResultCode: -1}));
+      if (+res.ResultCode === 0) {
+        if (!this.name) {
+          res.ResultCode = -1;
+          res.ResultInfo = `请选择${this.title}病名`;
+        } else if (!this.zy_dise_id) {
+          res.ResultCode = -1;
+          res.ResultInfo = `当前疾病编码与医保不匹配,请更换中医病名等诊断信息!`;
+        } else {
+          this.addRecipeFrom().catch();
+        }
       }
+      if (+res.ResultCode !== 0 && res.ResultInfo) this.$message.error(res.ResultInfo)
+      return +res.ResultCode === 0;
     }
   }
 };
 </script>
 <style scoped lang="scss">
+.el-input.invalid::v-deep {
+  input {
+    color: #ff0000;
+  }
+}
 div {
   box-sizing: border-box;
 }

+ 2 - 1
src/views/diagnosis/Prescribing.vue

@@ -2601,6 +2601,8 @@ export default {
       let zhongPrescriptionVo = this.dealRecipe1();
       if (!zhongPrescriptionVo.length) return;
 
+      if (!await this.$refs.TCM.saveDiagnosisData()) return;
+
       this.saving = true;
       try {
         const {options, force} = await this.getRationalSafeUse();
@@ -2668,7 +2670,6 @@ export default {
         )
           return;*/
 
-        this.$refs.TCM.saveDiagnosisData();
         this._getRecipePriview(
           zhongPrescriptionVo,
           chengPrescriptionVo,