瀏覽代碼

药品合理

1178232204@qq.com 3 年之前
父節點
當前提交
fe8068a362
共有 2 個文件被更改,包括 74 次插入9 次删除
  1. 73 8
      src/components/knowledgeExtra/AddNewRule.vue
  2. 1 1
      src/components/knowledgeExtra/AddNewRuleTable.vue

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

@@ -415,7 +415,6 @@ export default {
       this.subRuleMaxNum = obj.number;
       this.form.parHasSub = obj.subMenuList.length ? 1 : 0;
       this.setInitGroupData();
-      console.log(val);
     },
     // 医学标准术语
     parConceptIdChange(val) {
@@ -515,11 +514,13 @@ export default {
           .match(new RegExp(this.ruleTermCodeStrs, 'g')) || [];
       const obj = this.baseTypeList.find(it => it.type === val);
       let dragType = false;
-      let subMenuList;
+      let isDel = false;
+      let screenArr;
+      //药品开单合理判断
       if (dragDel.length > 0) {
         dragType = true;
         const types = dragDel[0].split('-');
-        subMenuList = obj.subMenuList.filter(item => {
+        screenArr = obj.subMenuList.filter(item => {
           if (item.remark == '') {
             return item;
           } else {
@@ -527,11 +528,34 @@ export default {
           }
         });
       }
+      //危急值实验室子项目已选医学标准术语判断
+      if (this.form.parHasSub && this.firstPlace) {
+        const del =
+          localStorage
+            .getItem('zskDelDict')
+            .match(
+              new RegExp(this.firstPlace.checkedType + '-\\d+' + '-\\d+', 'g')
+            ) || [];
+        if (del.length > 0) {
+          isDel = true;
+          const types = del[0].split('-');
+          let baseTypeList = JSON.parse(JSON.stringify(this.baseTypeList));
+          const subobj = this.baseTypeList.find(it => it.type == types[2]);
+          screenArr = subobj.subMenuList.filter(item => {
+            return !types[3].includes(item.code);
+          });
+        }
+      }
       this.$set(
         this.form.klRuleByIdSub[index],
         'baseTermTypeList',
-        dragType ? subMenuList : obj.subMenuList
+        (isDel && val == 2) || dragType ? screenArr : obj.subMenuList
       );
+      // this.$set(
+      //   this.form.klRuleByIdSub[index],
+      //   'baseTermTypeList',
+      //   dragType ? subMenuList : obj.subMenuList
+      // );
 
       this.$set(this.form.klRuleByIdSub[index], 'subLenCode', '');
       this.$set(this.form.klRuleByIdSub[index], 'dataType', '');
@@ -630,10 +654,50 @@ export default {
       this.form.klRuleByIdSub = list;
     },
     // 删除规则
-    delGroupChild(groupChildId) {
-      const newGroupList = this.form.klRuleByIdSub.filter(
-        item => item.groupChildId != groupChildId
-      );
+    delGroupChild(groupChildId, index) {
+      let newGroupList;
+      const dragDel =
+        localStorage
+          .getItem('zskDragDict')
+          .match(new RegExp(this.ruleTermCodeStrs, 'g')) || [];
+      let list;
+      if (dragDel.length > 0) {
+        if (index == 0) {
+          const date = new Date().valueOf();
+          newGroupList = [{
+            groupId: date,
+            groupChildId: 'child' + new Date().valueOf(),
+            baseTypes: this.baseTypeList,
+            baseTermTypeList: [],
+            conceptList: [],
+            subDescription: '',
+            parRuleType: '',
+            subConceptId: '',
+            subType: '',
+            subMaxOperator: '',
+            subMaxUnit: '',
+            subMaxValue: '',
+            subMinOperator: '',
+            subMinUnit: '',
+            subMinValue: '',
+            subEqValue: '',
+            subLenCode: '',
+            dataType: ''
+          }];
+        } else if (index == 0 || index == 1) {
+          newGroupList = this.form.klRuleByIdSub.filter((item, i) => {
+            return i == 0;
+          });
+        } else {
+          newGroupList = this.form.klRuleByIdSub.filter(
+            item => item.groupChildId != groupChildId
+          );
+        }
+      } else {
+        newGroupList = this.form.klRuleByIdSub.filter(
+          item => item.groupChildId != groupChildId
+        );
+      }
       this.form.klRuleByIdSub = newGroupList;
     },
     setDict() {
@@ -744,6 +808,7 @@ export default {
     'form.klRuleByIdSub': {
       handler(val) {
         this.form.klRuleByIdSub.forEach((item, i, arr) => {
+        
           if (i == 0) {
             item.rowIndex = 1;
           } else if (item.groupId == arr[i - 1].groupId) {

+ 1 - 1
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -187,7 +187,7 @@
             
             <div class="btn_div" v-if="klRuleByIdSub.length > 1 && !scope.row.disabled">
               <img
-                @click="$emit('delGroupChild', scope.row.groupChildId)"
+                @click="$emit('delGroupChild', scope.row.groupChildId,scope.$index)"
                 src="../../images/add-new-rule-del.png"
                 alt
               />