wyq il y a 4 ans
Parent
commit
cd722b89e1
1 fichiers modifiés avec 58 ajouts et 46 suppressions
  1. 58 46
      src/components/icss/plan/AddPlan.vue

+ 58 - 46
src/components/icss/plan/AddPlan.vue

@@ -43,7 +43,7 @@
                     <transition name="plus-icon">
                       <div v-if="isOpenCloseItems">
                         <ul class="sub" v-for="(item,index) in  planDefaultList" :key="item.id">
-                          <li class="planItem" >
+                          <li class="planItem">
                             <div class="sort" v-if="item.ismove">
                               <div class="top">
                                 <img
@@ -98,21 +98,26 @@
                               </el-select>
                             </div>
                           </li>
-                          <li class="planItem" v-if="item.arr.length>0" v-for="i in  item.arr" :key="i.id">
-                            <div class="sort" ></div>
-                            <div class="openOrClose" >
-                                <span class="planInfo">{{i.name}}</span>
-                                <div class="switch">
-                                  <el-switch
-                                    v-model="i.status"
-                                    :active-value="1"
-                                    :inactive-value="0"
-                                    active-color="#4BC4D7"
-                                    inactive-color="#BBBBBB"
-                                  ></el-switch>
-                                </div>
-                                <span class="planStatus">{{i.status === 1 ? '启用中' : '未启用'}}</span>
+                          <li
+                            class="planItem"
+                            v-if="item.arr.length>0"
+                            v-for="i in  item.arr"
+                            :key="i.id"
+                          >
+                            <div class="sort"></div>
+                            <div class="openOrClose">
+                              <span class="planInfo">{{i.name}}</span>
+                              <div class="switch">
+                                <el-switch
+                                  v-model="i.status"
+                                  :active-value="1"
+                                  :inactive-value="0"
+                                  active-color="#4BC4D7"
+                                  inactive-color="#BBBBBB"
+                                ></el-switch>
                               </div>
+                              <span class="planStatus">{{i.status === 1 ? '启用中' : '未启用'}}</span>
+                            </div>
                             <div class="showNum" v-if="item.number">
                               <span style="marginRight:8px;">默认显示个数</span>
                               <el-select
@@ -130,7 +135,6 @@
                               </el-select>
                             </div>
                           </li>
-                          
                         </ul>
                       </div>
                     </transition>
@@ -335,10 +339,10 @@ export default {
         // });
         // this.planDefaultList = [...arr];
       } else {
-         tempList.splice(index - 1, 0, item);
-        tempList.splice(index+1, 1);
-        [tempList[index - 1].orderNo, tempList[index+1].orderNo] = [
-          tempList[index+1].orderNo,
+        tempList.splice(index - 1, 0, item);
+        tempList.splice(index + 1, 1);
+        [tempList[index - 1].orderNo, tempList[index].orderNo] = [
+          tempList[index].orderNo,
           tempList[index - 1].orderNo
         ];
         this.planDefaultList = tempList;
@@ -366,6 +370,7 @@ export default {
         // });
         // this.planDefaultList = [...arr];
       }
+      console.log(this.planDefaultList);
     },
 
     // 展开列表项
@@ -521,39 +526,46 @@ export default {
         }
       });
       planDefaultList
-            .slice()
-            .reverse()
-            .forEach((item, i, arr) => {
-              if (
-                item.name == '高危' ||
-                item.name == '危急值提醒' ||
-                item.name == '其他提醒'
-              ) {
-                planDefaultList.splice(arr.length - 1 - i, 1);
-                planDefaultList
-                  .find(items => {
-                    return items.name == '开单合理性';
-                  })
-                  .arr.push(item);
-              }
-            });
+        .slice()
+        .reverse()
+        .forEach((item, i, arr) => {
+          if (
+            item.name == '高危' ||
+            item.name == '危急值提醒' ||
+            item.name == '其他提醒'
+          ) {
+            planDefaultList.splice(arr.length - 1 - i, 1);
+            planDefaultList
+              .find(items => {
+                return items.name == '开单合理性';
+              })
+              .arr.push(item);
+          }
+        });
       this.planDefaultList = planDefaultList;
     },
 
     // format处理细项数据
     handleSendData() {
       this.planDefaultList.forEach((item, i) => {
-        if(item.name == '开单合理性'){
-          item.arr.slice().reverse().forEach(items => {
-            if (items.name == '高危' ||items.name == '危急值提醒' ||items.name == '其他提醒') {
-              console.log(i)
-              this.planDefaultList.splice(i+1, 0, items);
-            }
-          })
-          item.arr = []
+        if (item.name == '开单合理性') {
+          item.arr
+            .slice()
+            .reverse()
+            .forEach(items => {
+              if (
+                items.name == '高危' ||
+                items.name == '危急值提醒' ||
+                items.name == '其他提醒'
+              ) {
+                console.log(i);
+                this.planDefaultList.splice(i + 1, 0, items);
+              }
+            });
+          item.arr = [];
         }
-      })
-      console.log(this.planDefaultList)
+      });
+      console.log(this.planDefaultList);
       let TempPlanDetail = [];
       TempPlanDetail = this.planDefaultList.map((item, index) => {
         return {