张保健 5 years ago
parent
commit
f76331d604
1 changed files with 129 additions and 147 deletions
  1. 129 147
      src/xt_pages/dialysis/details/index.vue

+ 129 - 147
src/xt_pages/dialysis/details/index.vue View File

595
       headNurses: [],
595
       headNurses: [],
596
       lastDialysisPrescribe: { id: 0 },
596
       lastDialysisPrescribe: { id: 0 },
597
       //
597
       //
598
-      activeName:'first',
598
+      activeName: 'first',
599
       selected_date: new Date(),
599
       selected_date: new Date(),
600
       // search_input 和 search_keyword,使输入关键字时不会经常刷新 filtedSchedules
600
       // search_input 和 search_keyword,使输入关键字时不会经常刷新 filtedSchedules
601
       search_keyword: '', // 确定用于搜索的关键字
601
       search_keyword: '', // 确定用于搜索的关键字
602
       search_input: '', // 输入中的关键字
602
       search_input: '', // 输入中的关键字
603
-      patient_state:[
604
-        {value: 0,label: '全部'},
605
-        {value: 1,label: '已签到'},
606
-        {value: 2,label: '未签到'},
607
-        {value: 3,label: '已上机'},
608
-        {value: 4,label: '已下机'},
603
+      patient_state: [
604
+        { value: 0, label: '全部' },
605
+        { value: 1, label: '已签到' },
606
+        { value: 2, label: '未签到' },
607
+        { value: 3, label: '已上机' },
608
+        { value: 4, label: '已下机' }
609
       ],
609
       ],
610
       patientStateVal: 0,
610
       patientStateVal: 0,
611
-      treat_state:[
612
-        {value: 0,label: '全部'},
613
-        {value: 1,label: '待开处方'},
614
-        {value: 2,label: '待开小结'},
611
+      treat_state: [
612
+        { value: 0, label: '全部' },
613
+        { value: 1, label: '待开处方' },
614
+        { value: 2, label: '待开小结' }
615
       ],
615
       ],
616
       treatStateVal: 0,
616
       treatStateVal: 0,
617
-      schedule_options:[
618
-        {value: 0,label: '全部'},
619
-        {value: 1,label: '上午'},
620
-        {value: 2,label: '下午'},
621
-        {value: 3,label: '晚上'},
617
+      schedule_options: [
618
+        { value: 0, label: '全部' },
619
+        { value: 1, label: '上午' },
620
+        { value: 2, label: '下午' },
621
+        { value: 3, label: '晚上' }
622
       ],
622
       ],
623
       scheduleStateVal: 0,
623
       scheduleStateVal: 0,
624
-      zone_options:[
624
+      zone_options: [
625
         { id: 0, text: '全部' }
625
         { id: 0, text: '全部' }
626
       ],
626
       ],
627
-      zoneVal:0,
627
+      zoneVal: 0,
628
       tableData: [],
628
       tableData: [],
629
-      tableData1:[],
630
-      arr:[],
631
-      newName:'',
632
-      newTime:''
629
+      tableData1: [],
630
+      arr: [],
631
+      newName: '',
632
+      newTime: ''
633
     }
633
     }
634
   },
634
   },
635
   created() {
635
   created() {
636
-    var patient_id = this.$route.query.patient_id;
637
-    var date = this.$route.query.date;
638
-    this.patient_id = patient_id;
639
-    this.date = date;
640
-    
641
-    this.getScheduleDetail();
642
-    this.getLongAdvice();
643
-    
636
+    var patient_id = this.$route.query.patient_id
637
+    var date = this.$route.query.date
638
+    this.patient_id = patient_id
639
+    this.date = date
640
+
641
+    this.getScheduleDetail()
642
+    this.getLongAdvice()
643
+
644
     this.selected_date = this.$route.query.date * 1000
644
     this.selected_date = this.$route.query.date * 1000
645
     var schedule_type_selected = this.$store.getters.schedule_type_selected
645
     var schedule_type_selected = this.$store.getters.schedule_type_selected
646
     var zone_selected = this.$store.getters.zone_selected
646
     var zone_selected = this.$store.getters.zone_selected
659
     if (treat_state_selected) {
659
     if (treat_state_selected) {
660
       this.treatStateVal = treat_state_selected.treat_state_selected
660
       this.treatStateVal = treat_state_selected.treat_state_selected
661
     }
661
     }
662
-    if(selected_date.selected_date){
662
+    if (selected_date.selected_date) {
663
       this.selected_date = selected_date.selected_date
663
       this.selected_date = selected_date.selected_date
664
-      
665
     }
664
     }
666
 
665
 
667
-    this.getInitData();
668
-    
669
-    
670
-    
666
+    this.getInitData()
671
   },
667
   },
672
-  mounted(){
673
-    const timer = setInterval(() =>{
674
-      // this.getInitData();      
675
-      this.requestDialysisSchedules()         
676
-    }, 1000 * 60);            
668
+  mounted() {
669
+    const timer = setInterval(() => {
670
+      // this.getInitData();
671
+      this.requestDialysisSchedules()
672
+    }, 1000 * 60)
677
     // 通过$once来监听定时器,在beforeDestroy钩子可以被清除。
673
     // 通过$once来监听定时器,在beforeDestroy钩子可以被清除。
678
-    this.$once('hook:beforeDestroy', () => {            
679
-        clearInterval(timer);                                    
674
+    this.$once('hook:beforeDestroy', () => {
675
+      clearInterval(timer)
680
     })
676
     })
681
-    
682
   },
677
   },
683
   computed: {
678
   computed: {
684
     steps: function() {
679
     steps: function() {
788
       //     schedules.push({ zone_id: scheduleInfo.zone_id, zone_name: scheduleInfo.zone_name, schedules: filtedSchedules })
783
       //     schedules.push({ zone_id: scheduleInfo.zone_id, zone_name: scheduleInfo.zone_name, schedules: filtedSchedules })
789
       //   }
784
       //   }
790
       // }
785
       // }
791
-      
786
+
792
       // return schedules
787
       // return schedules
793
     }
788
     }
794
   },
789
   },
871
             if (prescription.body_fluid == -2) {
866
             if (prescription.body_fluid == -2) {
872
               prescription.body_fluid = 0
867
               prescription.body_fluid = 0
873
             }
868
             }
874
-
875
           }
869
           }
876
           console.log('透析处方', prescription)
870
           console.log('透析处方', prescription)
877
           var solution = resp.data.solution // 透析方案
871
           var solution = resp.data.solution // 透析方案
931
             schedual,
925
             schedual,
932
             system_prescribe
926
             system_prescribe
933
           )
927
           )
934
-          
935
 
928
 
936
           var headNurses = resp.data.headNurse
929
           var headNurses = resp.data.headNurse
937
 
930
 
1027
         '/dialysis/print?xtdate=' + xtdate + '&xtno=' + this.patient.dialysis_no
1020
         '/dialysis/print?xtdate=' + xtdate + '&xtno=' + this.patient.dialysis_no
1028
       )
1021
       )
1029
     },
1022
     },
1030
-    //日期
1023
+    // 日期
1031
     handleScheduleDateChange: function(index) {
1024
     handleScheduleDateChange: function(index) {
1032
       this.treatStateVal = 0
1025
       this.treatStateVal = 0
1033
       this.patientStateVal = 0
1026
       this.patientStateVal = 0
1043
       this.$store.dispatch('SetSelectedDate', { selected_date: index })
1036
       this.$store.dispatch('SetSelectedDate', { selected_date: index })
1044
       this.requestDialysisSchedules()
1037
       this.requestDialysisSchedules()
1045
     },
1038
     },
1046
-    //初始化数据
1039
+    // 初始化数据
1047
     getInitData: function() {
1040
     getInitData: function() {
1048
       getDialysisRecordInitData().then(rs => {
1041
       getDialysisRecordInitData().then(rs => {
1049
         var resp = rs.data
1042
         var resp = rs.data
1059
           // this.zone_schedules = this.processedDialysisSchedules(schedules, this.zone_options)
1052
           // this.zone_schedules = this.processedDialysisSchedules(schedules, this.zone_options)
1060
           this.arr = this.processedDialysisSchedules(schedules, this.zone_options)
1053
           this.arr = this.processedDialysisSchedules(schedules, this.zone_options)
1061
           this.requestDialysisSchedules()
1054
           this.requestDialysisSchedules()
1062
-          this.getData()
1063
         } else {
1055
         } else {
1064
           this.$message.error(resp.msg)
1056
           this.$message.error(resp.msg)
1065
         }
1057
         }
1072
       this.search_keyword = this.search_input = ''
1064
       this.search_keyword = this.search_input = ''
1073
       this.getData()
1065
       this.getData()
1074
     },
1066
     },
1075
-    //分区
1067
+    // 分区
1076
     handleZoneChange: function(index) {
1068
     handleZoneChange: function(index) {
1077
       this.zoneVal = index
1069
       this.zoneVal = index
1078
       this.$store.dispatch('SetZoneSelected', { zone_selected: index })
1070
       this.$store.dispatch('SetZoneSelected', { zone_selected: index })
1079
       this.search_keyword = this.search_input = ''
1071
       this.search_keyword = this.search_input = ''
1080
       this.getData()
1072
       this.getData()
1081
     },
1073
     },
1082
-    //患者状态
1074
+    // 患者状态
1083
     handleStateChange: function(index) {
1075
     handleStateChange: function(index) {
1084
       this.patientStateVal = index
1076
       this.patientStateVal = index
1085
       this.$store.dispatch('SetPatientStateSelected', { patient_state_selected: index })
1077
       this.$store.dispatch('SetPatientStateSelected', { patient_state_selected: index })
1123
       this.zoneVal = 0
1115
       this.zoneVal = 0
1124
       this.treatStateVal = 0
1116
       this.treatStateVal = 0
1125
       this.patientStateVal = 0
1117
       this.patientStateVal = 0
1126
-      if(this.search_input != ''){
1127
-        let arr = []
1118
+      if (this.search_input != '') {
1119
+        const arr = []
1128
         this.filtedSchedules.map(item => {
1120
         this.filtedSchedules.map(item => {
1129
           arr.push(...item.schedules)
1121
           arr.push(...item.schedules)
1130
         })
1122
         })
1131
-        if(this.activeName == "first"){
1123
+        if (this.activeName == 'first') {
1132
           this.tableData = arr
1124
           this.tableData = arr
1133
-        }else if(this.activeName == "second"){
1125
+        } else if (this.activeName == 'second') {
1134
           this.tableData1 = arr
1126
           this.tableData1 = arr
1135
         }
1127
         }
1136
-        
1137
-      }else{
1128
+      } else {
1138
         this.getData()
1129
         this.getData()
1139
       }
1130
       }
1140
     },
1131
     },
1145
         if (resp.state == 1) {
1136
         if (resp.state == 1) {
1146
           var schedules = resp.data.schedules
1137
           var schedules = resp.data.schedules
1147
           this.zone_schedules = this.processedDialysisSchedules(schedules, this.zone_options)
1138
           this.zone_schedules = this.processedDialysisSchedules(schedules, this.zone_options)
1148
-          let patientArr = JSON.parse(JSON.stringify(this.zone_schedules))
1149
-          if(this.activeName == "first"){
1139
+          const patientArr = JSON.parse(JSON.stringify(this.zone_schedules))
1140
+          if (this.activeName == 'first') {
1150
             for (let i = 0; i < patientArr.length; i++) {
1141
             for (let i = 0; i < patientArr.length; i++) {
1151
-              
1152
               for (let j = 0; j < patientArr[i].schedules.length; j++) {
1142
               for (let j = 0; j < patientArr[i].schedules.length; j++) {
1153
                 if (patientArr[i].schedules.length > 0 && patientArr[i].schedules[j].dialysis_order != null) {
1143
                 if (patientArr[i].schedules.length > 0 && patientArr[i].schedules[j].dialysis_order != null) {
1154
                   // 删除元素后改变i的值
1144
                   // 删除元素后改变i的值
1155
-                  patientArr[i].schedules.splice(j--, 1);
1145
+                  patientArr[i].schedules.splice(j--, 1)
1156
                 }
1146
                 }
1157
               }
1147
               }
1158
             }
1148
             }
1159
-          }else if(this.activeName == "second"){
1149
+          } else if (this.activeName == 'second') {
1160
             for (let i = 0; i < patientArr.length; i++) {
1150
             for (let i = 0; i < patientArr.length; i++) {
1161
               for (let j = 0; j < patientArr[i].schedules.length; j++) {
1151
               for (let j = 0; j < patientArr[i].schedules.length; j++) {
1162
                 if (patientArr[i].schedules.length > 0 && patientArr[i].schedules[j].dialysis_order == null) {
1152
                 if (patientArr[i].schedules.length > 0 && patientArr[i].schedules[j].dialysis_order == null) {
1163
                   // 删除元素后改变i的值
1153
                   // 删除元素后改变i的值
1164
-                  patientArr[i].schedules.splice(j--, 1);
1154
+                  patientArr[i].schedules.splice(j--, 1)
1165
                 }
1155
                 }
1166
               }
1156
               }
1167
             }
1157
             }
1168
           }
1158
           }
1169
-          let newArr = []
1159
+          const newArr = []
1170
           patientArr.map(item => {
1160
           patientArr.map(item => {
1171
             newArr.push(...item.schedules)
1161
             newArr.push(...item.schedules)
1172
           })
1162
           })
1173
           this.tableData = newArr
1163
           this.tableData = newArr
1164
+          this.getData()
1174
           // console.log(66666666666,this.tableData)
1165
           // console.log(66666666666,this.tableData)
1175
         } else {
1166
         } else {
1176
           this.$message.error(resp.msg)
1167
           this.$message.error(resp.msg)
1177
         }
1168
         }
1178
       })
1169
       })
1179
     },
1170
     },
1180
-    changePatient(schedual){
1171
+    changePatient(schedual) {
1181
       console.log(schedual)
1172
       console.log(schedual)
1182
-      this.patient_id = schedual.patient_id;
1183
-      this.date = schedual.schedule_date;
1173
+      this.patient_id = schedual.patient_id
1174
+      this.date = schedual.schedule_date
1184
       // this.getScheduleDetail();
1175
       // this.getScheduleDetail();
1185
       // this.getLongAdvice();
1176
       // this.getLongAdvice();
1186
-      
1187
-      var patient_id = schedual.patient_id;
1188
-      var date = schedual.schedule_date;
1177
+
1178
+      var patient_id = schedual.patient_id
1179
+      var date = schedual.schedule_date
1189
       this.$router.push({
1180
       this.$router.push({
1190
-        path: "/dialysis/details",
1181
+        path: '/dialysis/details',
1191
         query: {
1182
         query: {
1192
           patient_id: patient_id,
1183
           patient_id: patient_id,
1193
           date: date,
1184
           date: date,
1194
           patient_name: schedual.patient.name
1185
           patient_name: schedual.patient.name
1195
         }
1186
         }
1196
-      });
1187
+      })
1197
     },
1188
     },
1198
-    handleClick(){
1189
+    handleClick() {
1199
       this.getData()
1190
       this.getData()
1200
     },
1191
     },
1201
-    getData(){
1202
-    
1192
+    getData() {
1203
       let patientArr = []
1193
       let patientArr = []
1204
       patientArr = JSON.parse(JSON.stringify(this.zone_schedules))
1194
       patientArr = JSON.parse(JSON.stringify(this.zone_schedules))
1205
-        
1206
-      if(this.activeName == "first"){
1195
+
1196
+      if (this.activeName == 'first') {
1207
         for (let i = 0; i < patientArr.length; i++) {
1197
         for (let i = 0; i < patientArr.length; i++) {
1208
-          
1209
           for (let j = 0; j < patientArr[i].schedules.length; j++) {
1198
           for (let j = 0; j < patientArr[i].schedules.length; j++) {
1210
             if (patientArr[i].schedules.length > 0 && patientArr[i].schedules[j].dialysis_order != null) {
1199
             if (patientArr[i].schedules.length > 0 && patientArr[i].schedules[j].dialysis_order != null) {
1211
               // 删除元素后改变i的值
1200
               // 删除元素后改变i的值
1212
-              
1213
-              console.log("候诊区",patientArr[i].schedules[j])
1214
-              patientArr[i].schedules.splice(j--, 1);
1201
+
1202
+              console.log('候诊区', patientArr[i].schedules[j])
1203
+              patientArr[i].schedules.splice(j--, 1)
1215
             }
1204
             }
1216
           }
1205
           }
1217
         }
1206
         }
1218
         let arr1 = []
1207
         let arr1 = []
1219
-        if(this.patientStateVal == 0){
1208
+        if (this.patientStateVal == 0) {
1220
           arr1 = patientArr
1209
           arr1 = patientArr
1221
-        }else if(this.patientStateVal == 1){
1210
+        } else if (this.patientStateVal == 1) {
1222
           let arr = []
1211
           let arr = []
1223
           arr = patientArr
1212
           arr = patientArr
1224
-          for (let i = 0; i <arr.length; i++) {
1213
+          for (let i = 0; i < arr.length; i++) {
1225
             for (let j = 0; j < arr[i].schedules.length; j++) {
1214
             for (let j = 0; j < arr[i].schedules.length; j++) {
1226
               if (arr[i].schedules.length > 0 && (arr[i].schedules[j].assessment_before_dislysis == null || (arr[i].schedules[j].assessment_before_dislysis.weight_before == '' && arr[i].schedules[j].assessment_before_dislysis.diastolic_blood_pressure == '' && arr[i].schedules[j].assessment_before_dislysis.systolic_blood_pressure == ''))) {
1215
               if (arr[i].schedules.length > 0 && (arr[i].schedules[j].assessment_before_dislysis == null || (arr[i].schedules[j].assessment_before_dislysis.weight_before == '' && arr[i].schedules[j].assessment_before_dislysis.diastolic_blood_pressure == '' && arr[i].schedules[j].assessment_before_dislysis.systolic_blood_pressure == ''))) {
1227
                 // 删除元素后改变i的值
1216
                 // 删除元素后改变i的值
1228
-                arr[i].schedules.splice(j--, 1);
1217
+                arr[i].schedules.splice(j--, 1)
1229
               }
1218
               }
1230
             }
1219
             }
1231
           }
1220
           }
1232
-          console.log("执行1",arr)
1221
+          console.log('执行1', arr)
1233
           arr1 = arr
1222
           arr1 = arr
1234
-        }else if(this.patientStateVal == 2){
1223
+        } else if (this.patientStateVal == 2) {
1235
           let arr = []
1224
           let arr = []
1236
           arr = patientArr
1225
           arr = patientArr
1237
           for (let i = 0; i < arr.length; i++) {
1226
           for (let i = 0; i < arr.length; i++) {
1238
             for (let j = 0; j < arr[i].schedules.length; j++) {
1227
             for (let j = 0; j < arr[i].schedules.length; j++) {
1239
               if (arr[i].schedules.length > 0 && (arr[i].schedules[j].assessment_before_dislysis != null && (arr[i].schedules[j].assessment_before_dislysis.weight_before != 0 || arr[i].schedules[j].assessment_before_dislysis.diastolic_blood_pressure != 0 || arr[i].schedules[j].assessment_before_dislysis.systolic_blood_pressure != 0))) {
1228
               if (arr[i].schedules.length > 0 && (arr[i].schedules[j].assessment_before_dislysis != null && (arr[i].schedules[j].assessment_before_dislysis.weight_before != 0 || arr[i].schedules[j].assessment_before_dislysis.diastolic_blood_pressure != 0 || arr[i].schedules[j].assessment_before_dislysis.systolic_blood_pressure != 0))) {
1240
                 // 删除元素后改变i的值
1229
                 // 删除元素后改变i的值
1241
-                arr[i].schedules.splice(j--, 1);
1230
+                arr[i].schedules.splice(j--, 1)
1242
               }
1231
               }
1243
             }
1232
             }
1244
           }
1233
           }
1245
-          console.log("执行2",arr)
1234
+          console.log('执行2', arr)
1246
           arr1 = arr
1235
           arr1 = arr
1247
         }
1236
         }
1248
 
1237
 
1249
         let arr2 = []
1238
         let arr2 = []
1250
-        if(this.treatStateVal == 0){
1239
+        if (this.treatStateVal == 0) {
1251
           arr2 = JSON.parse(JSON.stringify(arr1))
1240
           arr2 = JSON.parse(JSON.stringify(arr1))
1252
-        }else if(this.treatStateVal == 1){
1241
+        } else if (this.treatStateVal == 1) {
1253
           let arr = []
1242
           let arr = []
1254
           arr = JSON.parse(JSON.stringify(arr1))
1243
           arr = JSON.parse(JSON.stringify(arr1))
1255
           for (let i = 0; i < arr.length; i++) {
1244
           for (let i = 0; i < arr.length; i++) {
1256
             for (let j = 0; j < arr[i].schedules.length; j++) {
1245
             for (let j = 0; j < arr[i].schedules.length; j++) {
1257
               if (arr[i].schedules.length > 0 && (arr[i].schedules[j].prescription != null || arr[i].schedules[j].prescription != null ? arr[i].schedules[j].prescription.creater != 0 : false)) {
1246
               if (arr[i].schedules.length > 0 && (arr[i].schedules[j].prescription != null || arr[i].schedules[j].prescription != null ? arr[i].schedules[j].prescription.creater != 0 : false)) {
1258
                 // 删除元素后改变i的值
1247
                 // 删除元素后改变i的值
1259
-                arr[i].schedules.splice(j--, 1);
1248
+                arr[i].schedules.splice(j--, 1)
1260
               }
1249
               }
1261
             }
1250
             }
1262
           }
1251
           }
1263
           arr2 = arr
1252
           arr2 = arr
1264
         }
1253
         }
1265
-        
1266
 
1254
 
1267
         let arr3 = []
1255
         let arr3 = []
1268
-        if(this.scheduleStateVal == 0){
1256
+        if (this.scheduleStateVal == 0) {
1269
           arr3 = JSON.parse(JSON.stringify(arr2))
1257
           arr3 = JSON.parse(JSON.stringify(arr2))
1270
-        }else{
1258
+        } else {
1271
           let arr = []
1259
           let arr = []
1272
           arr = JSON.parse(JSON.stringify(arr2))
1260
           arr = JSON.parse(JSON.stringify(arr2))
1273
           for (let i = 0; i < arr.length; i++) {
1261
           for (let i = 0; i < arr.length; i++) {
1274
             for (let j = 0; j < arr[i].schedules.length; j++) {
1262
             for (let j = 0; j < arr[i].schedules.length; j++) {
1275
               if (this.scheduleStateVal != arr[i].schedules[j].schedule_type) {
1263
               if (this.scheduleStateVal != arr[i].schedules[j].schedule_type) {
1276
                 // 删除元素后改变i的值
1264
                 // 删除元素后改变i的值
1277
-                arr[i].schedules.splice(j--, 1);
1265
+                arr[i].schedules.splice(j--, 1)
1278
               }
1266
               }
1279
             }
1267
             }
1280
           }
1268
           }
1281
           arr3 = arr
1269
           arr3 = arr
1282
         }
1270
         }
1283
-        
1284
 
1271
 
1285
         let arr4 = []
1272
         let arr4 = []
1286
-        if(this.zoneVal == 0){
1273
+        if (this.zoneVal == 0) {
1287
           arr4 = JSON.parse(JSON.stringify(arr3))
1274
           arr4 = JSON.parse(JSON.stringify(arr3))
1288
-        }else{
1275
+        } else {
1289
           let arr = []
1276
           let arr = []
1290
           arr = JSON.parse(JSON.stringify(arr3))
1277
           arr = JSON.parse(JSON.stringify(arr3))
1291
           for (let i = 0; i < arr.length; i++) {
1278
           for (let i = 0; i < arr.length; i++) {
1292
             if (this.zoneVal != arr[i].zone_id) {
1279
             if (this.zoneVal != arr[i].zone_id) {
1293
               // 删除元素后改变i的值
1280
               // 删除元素后改变i的值
1294
-              arr.splice(i--, 1);
1281
+              arr.splice(i--, 1)
1295
             }
1282
             }
1296
           }
1283
           }
1297
           arr4 = arr
1284
           arr4 = arr
1298
         }
1285
         }
1299
-        let newArr = []
1286
+        const newArr = []
1300
         arr4.map(item => {
1287
         arr4.map(item => {
1301
           newArr.push(...item.schedules)
1288
           newArr.push(...item.schedules)
1302
         })
1289
         })
1303
         this.tableData = newArr
1290
         this.tableData = newArr
1304
-        let name = this.$route.query.patient_name
1305
-        this.tableData.map((item,index) => {
1306
-          if(name == item.patient.name){
1307
-            if(item.assessment_before_dislysis != null){
1291
+        const name = this.$route.query.patient_name
1292
+        this.tableData.map((item, index) => {
1293
+          if (name == item.patient.name) {
1294
+            if (item.assessment_before_dislysis != null) {
1308
               this.newTime = parseTime(item.assessment_before_dislysis.created_time, '{h}:{i}')
1295
               this.newTime = parseTime(item.assessment_before_dislysis.created_time, '{h}:{i}')
1309
             }
1296
             }
1310
-            
1311
-            setTimeout(()=>{
1312
-              this.$refs.tab.setCurrentRow(this.tableData[index]);
1313
-            },10)
1297
+
1298
+            setTimeout(() => {
1299
+              this.$refs.tab.setCurrentRow(this.tableData[index])
1300
+            }, 10)
1314
           }
1301
           }
1315
         })
1302
         })
1316
-
1317
-      }else if(this.activeName == "second"){
1303
+      } else if (this.activeName == 'second') {
1318
         for (let i = 0; i < patientArr.length; i++) {
1304
         for (let i = 0; i < patientArr.length; i++) {
1319
           for (let j = 0; j < patientArr[i].schedules.length; j++) {
1305
           for (let j = 0; j < patientArr[i].schedules.length; j++) {
1320
             if (patientArr[i].schedules.length > 0 && patientArr[i].schedules[j].dialysis_order == null) {
1306
             if (patientArr[i].schedules.length > 0 && patientArr[i].schedules[j].dialysis_order == null) {
1321
               // 删除元素后改变i的值
1307
               // 删除元素后改变i的值
1322
-              console.log("透析区",patientArr[i].schedules[j])
1323
-              patientArr[i].schedules.splice(j--, 1);
1308
+              console.log('透析区', patientArr[i].schedules[j])
1309
+              patientArr[i].schedules.splice(j--, 1)
1324
             }
1310
             }
1325
           }
1311
           }
1326
         }
1312
         }
1327
         let arr1 = []
1313
         let arr1 = []
1328
-        console.log('patientArr',patientArr)
1329
-        // let patientArr = 
1330
-        if(this.patientStateVal == 0){
1314
+        console.log('patientArr', patientArr)
1315
+        // let patientArr =
1316
+        if (this.patientStateVal == 0) {
1331
           arr1 = patientArr
1317
           arr1 = patientArr
1332
-        }else if(this.patientStateVal == 3){
1318
+        } else if (this.patientStateVal == 3) {
1333
           let arr = []
1319
           let arr = []
1334
           arr = patientArr
1320
           arr = patientArr
1335
-          for (let i = 0; i <arr.length; i++) {
1321
+          for (let i = 0; i < arr.length; i++) {
1336
             for (let j = 0; j < arr[i].schedules.length; j++) {
1322
             for (let j = 0; j < arr[i].schedules.length; j++) {
1337
               if (arr[i].schedules.length > 0 && (arr[i].schedules[j].dialysis_order != null && arr[i].schedules[j].dialysis_order.stage != 1)) {
1323
               if (arr[i].schedules.length > 0 && (arr[i].schedules[j].dialysis_order != null && arr[i].schedules[j].dialysis_order.stage != 1)) {
1338
                 // 删除元素后改变i的值
1324
                 // 删除元素后改变i的值
1339
-                arr[i].schedules.splice(j--, 1);
1325
+                arr[i].schedules.splice(j--, 1)
1340
               }
1326
               }
1341
             }
1327
             }
1342
           }
1328
           }
1343
-          console.log("执行1",arr)
1329
+          console.log('执行1', arr)
1344
           arr1 = arr
1330
           arr1 = arr
1345
-        }else if(this.patientStateVal == 4){
1331
+        } else if (this.patientStateVal == 4) {
1346
           let arr = []
1332
           let arr = []
1347
           arr = patientArr
1333
           arr = patientArr
1348
           for (let i = 0; i < arr.length; i++) {
1334
           for (let i = 0; i < arr.length; i++) {
1349
             for (let j = 0; j < arr[i].schedules.length; j++) {
1335
             for (let j = 0; j < arr[i].schedules.length; j++) {
1350
               if (arr[i].schedules.length > 0 && (arr[i].schedules[j].dialysis_order != null && arr[i].schedules[j].dialysis_order.stage != 2)) {
1336
               if (arr[i].schedules.length > 0 && (arr[i].schedules[j].dialysis_order != null && arr[i].schedules[j].dialysis_order.stage != 2)) {
1351
                 // 删除元素后改变i的值
1337
                 // 删除元素后改变i的值
1352
-                arr[i].schedules.splice(j--, 1);
1338
+                arr[i].schedules.splice(j--, 1)
1353
               }
1339
               }
1354
             }
1340
             }
1355
           }
1341
           }
1356
-          console.log("执行2",arr)
1342
+          console.log('执行2', arr)
1357
           arr1 = arr
1343
           arr1 = arr
1358
         }
1344
         }
1359
 
1345
 
1360
         let arr2 = []
1346
         let arr2 = []
1361
-        if(this.treatStateVal == 0){
1347
+        if (this.treatStateVal == 0) {
1362
           arr2 = JSON.parse(JSON.stringify(arr1))
1348
           arr2 = JSON.parse(JSON.stringify(arr1))
1363
-        }else if(this.treatStateVal == 2){
1349
+        } else if (this.treatStateVal == 2) {
1364
           let arr = []
1350
           let arr = []
1365
           arr = JSON.parse(JSON.stringify(arr1))
1351
           arr = JSON.parse(JSON.stringify(arr1))
1366
           for (let i = 0; i < arr.length; i++) {
1352
           for (let i = 0; i < arr.length; i++) {
1367
             for (let j = 0; j < arr[i].schedules.length; j++) {
1353
             for (let j = 0; j < arr[i].schedules.length; j++) {
1368
               if (arr[i].schedules.length > 0 && arr[i].schedules[j].treatment_summary != null && arr[i].schedules[j].treatment_summary.dialysis_summary != '') {
1354
               if (arr[i].schedules.length > 0 && arr[i].schedules[j].treatment_summary != null && arr[i].schedules[j].treatment_summary.dialysis_summary != '') {
1369
                 // 删除元素后改变i的值
1355
                 // 删除元素后改变i的值
1370
-                arr[i].schedules.splice(j--, 1);
1356
+                arr[i].schedules.splice(j--, 1)
1371
               }
1357
               }
1372
             }
1358
             }
1373
           }
1359
           }
1374
           arr2 = arr
1360
           arr2 = arr
1375
         }
1361
         }
1376
-        
1377
 
1362
 
1378
         let arr3 = []
1363
         let arr3 = []
1379
-        if(this.scheduleStateVal == 0){
1364
+        if (this.scheduleStateVal == 0) {
1380
           arr3 = JSON.parse(JSON.stringify(arr2))
1365
           arr3 = JSON.parse(JSON.stringify(arr2))
1381
-        }else{
1366
+        } else {
1382
           let arr = []
1367
           let arr = []
1383
           arr = JSON.parse(JSON.stringify(arr2))
1368
           arr = JSON.parse(JSON.stringify(arr2))
1384
           for (let i = 0; i < arr.length; i++) {
1369
           for (let i = 0; i < arr.length; i++) {
1385
             for (let j = 0; j < arr[i].schedules.length; j++) {
1370
             for (let j = 0; j < arr[i].schedules.length; j++) {
1386
               if (this.scheduleStateVal != arr[i].schedules[j].schedule_type) {
1371
               if (this.scheduleStateVal != arr[i].schedules[j].schedule_type) {
1387
                 // 删除元素后改变i的值
1372
                 // 删除元素后改变i的值
1388
-                arr[i].schedules.splice(j--, 1);
1373
+                arr[i].schedules.splice(j--, 1)
1389
               }
1374
               }
1390
             }
1375
             }
1391
           }
1376
           }
1392
           arr3 = arr
1377
           arr3 = arr
1393
         }
1378
         }
1394
-        
1395
 
1379
 
1396
         let arr4 = []
1380
         let arr4 = []
1397
-        if(this.zoneVal == 0){
1381
+        if (this.zoneVal == 0) {
1398
           arr4 = JSON.parse(JSON.stringify(arr3))
1382
           arr4 = JSON.parse(JSON.stringify(arr3))
1399
-        }else{
1383
+        } else {
1400
           let arr = []
1384
           let arr = []
1401
           arr = JSON.parse(JSON.stringify(arr3))
1385
           arr = JSON.parse(JSON.stringify(arr3))
1402
           for (let i = 0; i < arr.length; i++) {
1386
           for (let i = 0; i < arr.length; i++) {
1403
             if (this.zoneVal != arr[i].zone_id) {
1387
             if (this.zoneVal != arr[i].zone_id) {
1404
               // 删除元素后改变i的值
1388
               // 删除元素后改变i的值
1405
-              arr.splice(i--, 1);
1389
+              arr.splice(i--, 1)
1406
             }
1390
             }
1407
           }
1391
           }
1408
           arr4 = arr
1392
           arr4 = arr
1409
         }
1393
         }
1410
-        let newArr = []
1394
+        const newArr = []
1411
         arr4.map(item => {
1395
         arr4.map(item => {
1412
           newArr.push(...item.schedules)
1396
           newArr.push(...item.schedules)
1413
         })
1397
         })
1414
         this.tableData1 = newArr
1398
         this.tableData1 = newArr
1415
-        let name = this.$route.query.patient_name
1416
-        this.tableData1.map((item,index) => {
1417
-          if(name == item.patient.name){
1418
-            if(item.assessment_before_dislysis != null){
1399
+        const name = this.$route.query.patient_name
1400
+        this.tableData1.map((item, index) => {
1401
+          if (name == item.patient.name) {
1402
+            if (item.assessment_before_dislysis != null) {
1419
               this.newTime = parseTime(item.assessment_before_dislysis.created_time, '{h}:{i}')
1403
               this.newTime = parseTime(item.assessment_before_dislysis.created_time, '{h}:{i}')
1420
             }
1404
             }
1421
-            
1422
-            setTimeout(()=>{
1423
-              this.$refs.tab1.setCurrentRow(this.tableData1[index]);
1424
-            },10)
1405
+
1406
+            setTimeout(() => {
1407
+              this.$refs.tab1.setCurrentRow(this.tableData1[index])
1408
+            }, 10)
1425
           }
1409
           }
1426
         })
1410
         })
1427
       }
1411
       }
1428
-
1429
-      
1430
     }
1412
     }
1431
-  },
1413
+  }
1432
 }
1414
 }
1433
 </script>
1415
 </script>
1434
 
1416