zhouna hace 4 años
padre
commit
2b179c6ea4
Se han modificado 1 ficheros con 4 adiciones y 65 borrados
  1. 4 65
      src/components/knowledgeExtra/AddDiagBase.vue

+ 4 - 65
src/components/knowledgeExtra/AddDiagBase.vue

@@ -172,7 +172,7 @@
                           height="18"
                           width="18"
                           class="icon"
-                          @click="addRule(scope.row,scope.$index,index)"
+                          @click="addRule(scope.row,scope.$index,index,i)"
                         />
                         <img
                           src="../../images/icon-delete.png"
@@ -690,37 +690,7 @@ export default {
       return dest;
     }
   },
-  // mounted() {
-  //   this.onscroll();
-  // },
   methods: {
-    // onscroll() {
-    //   this.$nextTick(function() {
-    //     // 监听当前组件的滚动事件
-    //     this.box = this.$refs.tableList.bodyWrapper;
-    //     this.box.addEventListener(
-    //       'scroll',
-    //       () => {
-    //         // select组件层级太高,滚动隐藏
-    //         if (this.$refs.tableList.bodyWrapper.scrollLeft > 0) {
-    //           console.log(this.$refs.aa.handleClose)
-    //           // this.$refs.aa.handleClose()
-    //           // this.$refs.aa.blur()
-    //           // const SELECTWRAP_BODY = document.body; // body
-    //           // const SELECTWRAP_DOWNALL = document.querySelectorAll(
-    //           //   '.el-select-dropdown'
-    //           // ); // select下拉框
-    //           // SELECTWRAP_BODY.click();
-
-    //           // SELECTWRAP_DOWNALL.forEach(item => {
-    //           //   item.blur();
-    //           // });
-    //         }
-    //       },
-    //       false
-    //     );
-    //   });
-    // },
     // 最大值 选择rule
     maxOperator(items, rule, value, callback) {
       const { maxVal, minOperator, minVal } = items;
@@ -896,38 +866,6 @@ export default {
         this.form.klDiagnoseTypeVO.splice(i + index + 1, 0, item);
       });
       // console.log(this.form.klDiagnoseTypeVO);
-
-      
-      // let map = {},
-      //   dest = [];
-      // for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
-      //   let ai = formData.klDiagnoseTypeVO[i];
-      //   if (!map[ai.depart_id]) {
-      //     dest.push({
-      //       depart_id: ai.depart_id,
-      //       conditionType: ai.conditionType,
-      //       groupVO: ai.groupVO
-      //     });
-      //     map[ai.depart_id] = ai;
-      //   } else {
-      //     for (let j = 0; j < dest.length; j++) {
-      //       var dj = dest[j];
-      //       if (dj.depart_id == ai.depart_id) {
-      //         dj.groupVO = dj.groupVO.concat(ai.groupVO);
-      //         break;
-      //       }
-      //     }
-      //   }
-      // }
-      // var index = dest.findIndex(item => {
-      //   return item.depart_id == id;
-      // });
-      // JSON.parse(JSON.stringify(dest[index])).depart_id=this.i
-      // dest.splice(index + 1, 0, JSON.parse(JSON.stringify(dest[index])));
-      // dest.forEach((item, i) => {
-      //   item.depart_id = i;
-      // });
-      // this.form.klDiagnoseTypeVO = JSON.parse(JSON.stringify(dest));
     },
     //删除依据
     delDiag(id, inx) {
@@ -977,7 +915,7 @@ export default {
       this.form.klDiagnoseTypeVO.splice(i, 1);
     },
     //新增基础依据
-    addRule(row, index, i) {
+    addRule(row, index, inx,i) {
       let temp = {
         dataType: '',
         basNameType: false,
@@ -998,7 +936,8 @@ export default {
         minUnit: '',
         minVal: '',
       };
-      this.form.klDiagnoseTypeVO[index].groupVO[i].klDiagnoseDetail.push(temp);
+      this.form.klDiagnoseTypeVO[index].groupVO[inx].klDiagnoseDetail.splice(i + 1, 0, temp);
+      this.form.klDiagnoseTypeVO = JSON.parse(JSON.stringify(this.form.klDiagnoseTypeVO))   //8525更新对象触发滚动条更新
     },
     delRule(row, inx, index, i) {
         const klDiagnoseDetail =  this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail;