Ver código fonte

药品开单

1178232204@qq.com 3 anos atrás
pai
commit
2701504e5e
1 arquivos alterados com 27 adições e 8 exclusões
  1. 27 8
      src/components/knowledgeExtra/AddNewRule.vue

+ 27 - 8
src/components/knowledgeExtra/AddNewRule.vue

@@ -409,6 +409,7 @@ export default {
               const dragArr = list[0].remark.split("|")[1].split(",");
               this.dragArr = dragArr;
               this.dragVal = item.subLenCode;
+              item.dragArr = dragArr
               //取出互斥项
               const screenArr = obj.subMenuList.filter((item) =>
                 dragArr.some(
@@ -428,6 +429,7 @@ export default {
               this.$set(item, "baseTermTypeList", screenArr);
             }
           }
+          console.log(this.form);
         }
       });
     },
@@ -662,7 +664,7 @@ export default {
       let dragType = false;
       let isDel = false;
       let screenArr;
-      let type
+      let type;
       //药品开单合理判断
       if (dragDel.length > 0) {
         dragType = true;
@@ -675,13 +677,15 @@ export default {
         } else if (key == 2) {
           type = arr[1].subLenCode == "" ? false : true;
         }
-        if (this.dragArr && arr.length == 3 && key != 0 && type) {
+        if (arr.length == 3 && key != 0 && type) {
           //获取互斥项code
           const list = obj.subMenuList.filter((it) => {
             return it.code == this.dragVal && it.remark.split("|")[0] == 3;
           });
+          arr[1].aa = "0";
           const dragArr = list[0].remark.split("|")[1].split(",");
           this.dragArr = dragArr;
+          arr[1].dragArr = arr[2].dragArr = dragArr;
           //取出互斥项
           screenArr = obj.subMenuList.filter((item) =>
             dragArr.some(
@@ -816,17 +820,18 @@ export default {
               }
             });
           });
-          if (key == 1 && len[1].subLenCode) {
-            this.dragVal = len[1].subLenCode;
+          if (len.length == 3 && (key == 1 || key == 0)) {
+            const dragVal = key==0?len[2].subLenCode:len[1].subLenCode
+            this.dragVal =dragVal;
             const subobj = this.baseTypeList.find((it) => it.type == 1);
             const list = subobj.subMenuList.filter((it) => {
               return (
-                it.code == len[1].subLenCode && it.remark.split("|")[0] == 3
+                it.code == dragVal && it.remark.split("|")[0] == 3
               );
             });
             // //获取互斥项code
             const dragArr = list[0].remark.split("|")[1].split(",");
-            this.dragArr = dragArr;
+            len[1].dragArr = len[2].dragArr = dragArr;
           }
         }
       } else {
@@ -1076,7 +1081,13 @@ export default {
       ) {
         if (len.length == 3 && type) {
           //判断是否存在符合互斥条件的两条出具,若存在,置空另一条出具
-          if (code != "" && this.dragArr.indexOf(val) > -1 && lens == 4) {
+          if (
+            code != "" &&
+            (key == 1
+              ? len[2].dragArr.indexOf(val)
+              : len[1].dragArr.indexOf(val)) > -1 &&
+            lens == 4
+          ) {
             //剂型给药途径互斥判断
             const arr = this.baseTypeList.filter((it) => {
               return it.type == 1;
@@ -1111,13 +1122,21 @@ export default {
           //获取互斥项code
           const dragArr = list[0].remark.split("|")[1].split(",");
           this.dragArr = dragArr;
+          if (len[1]) {
+            len[1].dragArr = dragArr;
+          } else if (len[2]) {
+            len[2].dragArr = dragArr;
+          }
           //获取互斥项
           const screenArr = subobj.subMenuList.filter((item) =>
             dragArr.some(
               (ele) => ele === item.code && item.remark.split("|")[0] == 3
             )
           );
-          if (this.form.klRuleByIdSub[inx] && this.form.klRuleByIdSub[inx].subType !='') {
+          if (
+            this.form.klRuleByIdSub[inx] &&
+            this.form.klRuleByIdSub[inx].subType != ""
+          ) {
             this.$set(
               this.form.klRuleByIdSub[inx],
               "baseTermTypeList",