Переглянути джерело

Merge remote-tracking branch 'origin/master' into referMaster

zhouna 3 роки тому
батько
коміт
6f2b57401d

+ 3 - 8
src/components/base/LtModal.vue

@@ -252,7 +252,6 @@ export default {
         this.searchType = 2;
         name = this.data.hisDetailName;
       }
-      console.log(this.ty);
       this.getTermMatching(this.ty, name);
       this.getRelatedMapping();
     }
@@ -302,11 +301,7 @@ export default {
         return;
       }
       const { hisName, hisDetailName } = this.form;
-      if (
-        hisName !== '' &&
-        (this.data.hisDetailName == null || this.data.hisDetailName === '') &&
-        this.type == 1
-      ) {
+      if (hisName !== '' && hisDetailName === '' && this.type == 1) {
         this.ty = 1;
       } else if (hisName !== '' && hisDetailName !== '' && this.type == 1) {
         this.ty = 2;
@@ -395,6 +390,7 @@ export default {
           name = hisDetailName;
         }
       }
+
       this.getTermMatching(type, name);
     },
     clear() {
@@ -429,10 +425,9 @@ export default {
             source
           } = this.form;
           // 当标准术语是套餐时,细项必须为空
-          console.log(hisDetailName);
+          console.log(this.searchType);
 
           if (this.searchType === 1 && hisDetailName !== '') {
-            console.log(123);
             this.warning('医院术语与标准术语类型不匹配,请修改');
             return;
           }

+ 76 - 5
src/components/knowledgeExtra/AddNewRule.vue

@@ -350,8 +350,24 @@ export default {
 
         // disable
         if (this.form.parHasSub && this.firstPlace) {
+          const del =
+            localStorage
+              .getItem('zskDelDict')
+              .match(
+                new RegExp(this.firstPlace.checkedType + '-\\d+' + '-\\d+', 'g')
+              ) || [];
           if (arr[i - 1] && arr[i - 1].groupId == item.groupId) {
             this.$set(item, 'disabled', false);
+            if (del.length > 0 && item.subType == del[0].split('-')[2]) {
+              const delType = del[0].split('-');
+              const types = del[0].split('-');
+              let baseTypeList = JSON.parse(JSON.stringify(this.baseTypeList));
+              const subobj = this.baseTypeList.find(it => it.type == types[2]);
+              const screenArr = subobj.subMenuList.filter(item => {
+                return !types[3].includes(item.code);
+              });
+              this.$set(item, 'baseTermTypeList', screenArr);
+            }
           } else {
             this.$set(item, 'disabled', true);
           }
@@ -436,11 +452,45 @@ export default {
               .getItem('zskDicts')
               .match(new RegExp(this.firstPlace.checkedType + '-\\d+', 'g')) ||
             [];
+          const del =
+            localStorage
+              .getItem('zskDelDict')
+              .match(
+                new RegExp(this.firstPlace.checkedType + '-\\d+' + '-\\d+', 'g')
+              ) || [];
           const types = dict[0].split('-');
           let obj = this.form.klRuleByIdSub;
           obj.forEach((item, i, arr) => {
             if (arr[i - 1] && arr[i - 1].groupId == item.groupId) {
               this.$set(item, 'disabled', false);
+              if (del.length > 0) {
+                const delType = del[0].split('-');
+                if (
+                  item.subType == delType[2] ||
+                  item.subLenCode == delType[3]
+                ) {
+                  this.$set(this.form.klRuleByIdSub, i, {
+                    groupId: item.groupId,
+                    groupChildId: 'child' + new Date().valueOf(),
+                    baseTypes: this.baseTypeList,
+                    baseTermTypeList: [],
+                    conceptList: [],
+                    subDescription: '',
+                    parRuleType: '',
+                    subConceptId: '',
+                    subType: '',
+                    subMaxOperator: '',
+                    subMaxUnit: '',
+                    subMaxValue: '',
+                    subMinOperator: '',
+                    subMinUnit: '',
+                    subMinValue: '',
+                    subEqValue: '',
+                    subLenCode: '',
+                    dataType: ''
+                  });
+                }
+              }
             } else {
               this.$set(item, 'disabled', true);
               this.$set(item, 'subType', parseInt(types[2]));
@@ -508,12 +558,30 @@ export default {
     // 基础规则类型切换
     subTypeChange(val, index) {
       // index
+      let isDel = false;
+      let screenArr;
       const obj = this.baseTypeList.find(it => it.type === val);
-
+      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',
-        obj.subMenuList
+        isDel && val == 2 ? screenArr : obj.subMenuList
       );
       this.$set(this.form.klRuleByIdSub[index], 'subLenCode', '');
       this.$set(this.form.klRuleByIdSub[index], 'dataType', '');
@@ -547,6 +615,7 @@ export default {
        *    arg:{index:添加规则用索引,groupId:添加分组用确切id}
        */
       !date && (date = new Date().valueOf());
+
       const obj = {
         groupId: date,
         groupChildId: 'child' + new Date().valueOf(),
@@ -567,6 +636,8 @@ export default {
         subLenCode: '',
         dataType: ''
       };
+      console.log(obj);
+
       if (typeof arg.index == 'number') {
         // 添加规则 直接在当前位置之后添加
         this.form.klRuleByIdSub.splice(arg.index + 1, 0, obj);
@@ -637,7 +708,7 @@ export default {
       const param = {
         excludedConceptIds: [this.form.parRuleType],
         libType: this.form.parLenCode,
-        name: val,
+        name: val
       };
       api
         .searchConcept(param)
@@ -754,7 +825,7 @@ export default {
       if (str.length <= 1) {
         return '';
       }
-      
+
       return str;
     },
     ruleTermCodeStrs: function() {
@@ -777,7 +848,7 @@ export default {
       );
     },
     showHasSub() {
-      console.log(this.subDict.indexOf(this.ruleTermCodeStrs))
+      console.log(this.subDict.indexOf(this.ruleTermCodeStrs));
       if (this.ruleTermCodeStrs.length > 2) {
         return this.subDict.indexOf(this.ruleTermCodeStrs) != -1;
       }

+ 1 - 0
src/components/knowledgeExtra/RuleManager.vue

@@ -202,6 +202,7 @@ export default {
             );
             localStorage.setItem('zskNumDict', data['22'][0].val);
             localStorage.setItem('zskSubDict', (data['23'].map(it => it.val) || []).join(','));
+            localStorage.setItem('zskDelDict', data['26'][0].val);
           }
         })
         .catch(error => {