Selaa lähdekoodia

适宜技术 合方穴位重复,换方操作指南重复

cc12458 11 kuukautta sitten
vanhempi
commit
54f68fd4e7
1 muutettua tiedostoa jossa 14 lisäystä ja 15 poistoa
  1. 14 15
      src/views/diagnosis/Prescribing.vue

+ 14 - 15
src/views/diagnosis/Prescribing.vue

@@ -1420,7 +1420,7 @@ export default {
       else if (query.type === "tuidao") {
         this.isTuiDaoSuit = false;
         this.isTuiDaoZy = false;
-        await Pthis.inferRecipe();
+        await this.inferRecipe();
       }
       // 处方编辑 recipeType
       else if (query.from !== 'his' && this.getEditPreNo()) await this.getRecipeDataByid(this.getEditPreNo());
@@ -2931,24 +2931,21 @@ export default {
     suitChnageOrJoin(type = "") {
       // type = '' 专访 type == 1 和方
       if (this.container_i == 1) return;
+
+      const child = this.$children.find(child => child.name === '适宜技术处方');
+      if (!child) return;
+
       const loading = this.$loading({
         lock: true,
         text: "正在处理数据,请稍后",
         spinner: "el-icon-loading",
         background: "rgba(0, 0, 0, 0.7)"
       });
-      let children = this.$children.filter(item => {
-        return (
-          item.name == "中药处方" ||
-          item.name == "中药制剂" ||
-          item.name == "适宜技术处方"
-        );
-      });
-      let child = children[2];
 
       let drugs = this.getDrugInfo;
 
       if (type == "") {
+        child.bottom_form.caozuo = '';
         // 转方
         child.tableData4 = [];
         drugs.forEach((item, index) => {
@@ -2959,8 +2956,7 @@ export default {
             acuid: item.acuid
           };
           // 锚点
-          child.bottom_form.caozuo +=
-            obj.acuname + ":" + item.acuoperation + " ";
+          if (item.acuoperation) child.bottom_form.caozuo += obj.acuname + ':' + item.acuoperation + ' ';
           child.tableData4.push(obj);
         });
         child.tableData4.push({
@@ -2975,15 +2971,18 @@ export default {
         });
       } else if (type == 1) {
         child.tableData4.pop();
-        drugs.forEach((item, index) => {
+        for (const item of drugs) {
+          if (child.tableData4.find(({acuid}) => acuid === item.acuid)) continue;
           let obj = {
-            id: index + 1,
+            id: child.tableData4.length + 1,
             name: item.acuname,
             acuname: item.acuname,
-            acuid: item.acuid
+            acuid: item.acuid,
           };
+          // 锚点
+          if (item.acuoperation) child.bottom_form.caozuo += obj.acuname + ':' + item.acuoperation + ' ';
           child.tableData4.push(obj);
-        });
+        }
         child.tableData4.push({
           id: "",
           name: "",