See999 3 年之前
父節點
當前提交
f384790785
共有 1 個文件被更改,包括 129 次插入147 次删除
  1. 129 147
      src/xt_pages/dialysis/details/index.vue

+ 129 - 147
src/xt_pages/dialysis/details/index.vue 查看文件

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
         })
1308
         }
1295
         }
1309
         console.log('排序',newArr)
1296
         console.log('排序',newArr)
1310
         this.tableData = newArr
1297
         this.tableData = newArr
1311
-        let name = this.$route.query.patient_name
1312
-        this.tableData.map((item,index) => {
1313
-          if(name == item.patient.name){
1314
-            if(item.assessment_before_dislysis != null){
1298
+        const name = this.$route.query.patient_name
1299
+        this.tableData.map((item, index) => {
1300
+          if (name == item.patient.name) {
1301
+            if (item.assessment_before_dislysis != null) {
1315
               this.newTime = parseTime(item.assessment_before_dislysis.created_time, '{h}:{i}')
1302
               this.newTime = parseTime(item.assessment_before_dislysis.created_time, '{h}:{i}')
1316
             }
1303
             }
1317
-            
1318
-            setTimeout(()=>{
1319
-              this.$refs.tab.setCurrentRow(this.tableData[index]);
1320
-            },10)
1304
+
1305
+            setTimeout(() => {
1306
+              this.$refs.tab.setCurrentRow(this.tableData[index])
1307
+            }, 10)
1321
           }
1308
           }
1322
         })
1309
         })
1323
-
1324
-      }else if(this.activeName == "second"){
1310
+      } else if (this.activeName == 'second') {
1325
         for (let i = 0; i < patientArr.length; i++) {
1311
         for (let i = 0; i < patientArr.length; i++) {
1326
           for (let j = 0; j < patientArr[i].schedules.length; j++) {
1312
           for (let j = 0; j < patientArr[i].schedules.length; j++) {
1327
             if (patientArr[i].schedules.length > 0 && patientArr[i].schedules[j].dialysis_order == null) {
1313
             if (patientArr[i].schedules.length > 0 && patientArr[i].schedules[j].dialysis_order == null) {
1328
               // 删除元素后改变i的值
1314
               // 删除元素后改变i的值
1329
-              console.log("透析区",patientArr[i].schedules[j])
1330
-              patientArr[i].schedules.splice(j--, 1);
1315
+              console.log('透析区', patientArr[i].schedules[j])
1316
+              patientArr[i].schedules.splice(j--, 1)
1331
             }
1317
             }
1332
           }
1318
           }
1333
         }
1319
         }
1334
         let arr1 = []
1320
         let arr1 = []
1335
-        console.log('patientArr',patientArr)
1336
-        // let patientArr = 
1337
-        if(this.patientStateVal == 0){
1321
+        console.log('patientArr', patientArr)
1322
+        // let patientArr =
1323
+        if (this.patientStateVal == 0) {
1338
           arr1 = patientArr
1324
           arr1 = patientArr
1339
-        }else if(this.patientStateVal == 3){
1325
+        } else if (this.patientStateVal == 3) {
1340
           let arr = []
1326
           let arr = []
1341
           arr = patientArr
1327
           arr = patientArr
1342
-          for (let i = 0; i <arr.length; i++) {
1328
+          for (let i = 0; i < arr.length; i++) {
1343
             for (let j = 0; j < arr[i].schedules.length; j++) {
1329
             for (let j = 0; j < arr[i].schedules.length; j++) {
1344
               if (arr[i].schedules.length > 0 && (arr[i].schedules[j].dialysis_order != null && arr[i].schedules[j].dialysis_order.stage != 1)) {
1330
               if (arr[i].schedules.length > 0 && (arr[i].schedules[j].dialysis_order != null && arr[i].schedules[j].dialysis_order.stage != 1)) {
1345
                 // 删除元素后改变i的值
1331
                 // 删除元素后改变i的值
1346
-                arr[i].schedules.splice(j--, 1);
1332
+                arr[i].schedules.splice(j--, 1)
1347
               }
1333
               }
1348
             }
1334
             }
1349
           }
1335
           }
1350
-          console.log("执行1",arr)
1336
+          console.log('执行1', arr)
1351
           arr1 = arr
1337
           arr1 = arr
1352
-        }else if(this.patientStateVal == 4){
1338
+        } else if (this.patientStateVal == 4) {
1353
           let arr = []
1339
           let arr = []
1354
           arr = patientArr
1340
           arr = patientArr
1355
           for (let i = 0; i < arr.length; i++) {
1341
           for (let i = 0; i < arr.length; i++) {
1356
             for (let j = 0; j < arr[i].schedules.length; j++) {
1342
             for (let j = 0; j < arr[i].schedules.length; j++) {
1357
               if (arr[i].schedules.length > 0 && (arr[i].schedules[j].dialysis_order != null && arr[i].schedules[j].dialysis_order.stage != 2)) {
1343
               if (arr[i].schedules.length > 0 && (arr[i].schedules[j].dialysis_order != null && arr[i].schedules[j].dialysis_order.stage != 2)) {
1358
                 // 删除元素后改变i的值
1344
                 // 删除元素后改变i的值
1359
-                arr[i].schedules.splice(j--, 1);
1345
+                arr[i].schedules.splice(j--, 1)
1360
               }
1346
               }
1361
             }
1347
             }
1362
           }
1348
           }
1363
-          console.log("执行2",arr)
1349
+          console.log('执行2', arr)
1364
           arr1 = arr
1350
           arr1 = arr
1365
         }
1351
         }
1366
 
1352
 
1367
         let arr2 = []
1353
         let arr2 = []
1368
-        if(this.treatStateVal == 0){
1354
+        if (this.treatStateVal == 0) {
1369
           arr2 = JSON.parse(JSON.stringify(arr1))
1355
           arr2 = JSON.parse(JSON.stringify(arr1))
1370
-        }else if(this.treatStateVal == 2){
1356
+        } else if (this.treatStateVal == 2) {
1371
           let arr = []
1357
           let arr = []
1372
           arr = JSON.parse(JSON.stringify(arr1))
1358
           arr = JSON.parse(JSON.stringify(arr1))
1373
           for (let i = 0; i < arr.length; i++) {
1359
           for (let i = 0; i < arr.length; i++) {
1374
             for (let j = 0; j < arr[i].schedules.length; j++) {
1360
             for (let j = 0; j < arr[i].schedules.length; j++) {
1375
               if (arr[i].schedules.length > 0 && arr[i].schedules[j].treatment_summary != null && arr[i].schedules[j].treatment_summary.dialysis_summary != '') {
1361
               if (arr[i].schedules.length > 0 && arr[i].schedules[j].treatment_summary != null && arr[i].schedules[j].treatment_summary.dialysis_summary != '') {
1376
                 // 删除元素后改变i的值
1362
                 // 删除元素后改变i的值
1377
-                arr[i].schedules.splice(j--, 1);
1363
+                arr[i].schedules.splice(j--, 1)
1378
               }
1364
               }
1379
             }
1365
             }
1380
           }
1366
           }
1381
           arr2 = arr
1367
           arr2 = arr
1382
         }
1368
         }
1383
-        
1384
 
1369
 
1385
         let arr3 = []
1370
         let arr3 = []
1386
-        if(this.scheduleStateVal == 0){
1371
+        if (this.scheduleStateVal == 0) {
1387
           arr3 = JSON.parse(JSON.stringify(arr2))
1372
           arr3 = JSON.parse(JSON.stringify(arr2))
1388
-        }else{
1373
+        } else {
1389
           let arr = []
1374
           let arr = []
1390
           arr = JSON.parse(JSON.stringify(arr2))
1375
           arr = JSON.parse(JSON.stringify(arr2))
1391
           for (let i = 0; i < arr.length; i++) {
1376
           for (let i = 0; i < arr.length; i++) {
1392
             for (let j = 0; j < arr[i].schedules.length; j++) {
1377
             for (let j = 0; j < arr[i].schedules.length; j++) {
1393
               if (this.scheduleStateVal != arr[i].schedules[j].schedule_type) {
1378
               if (this.scheduleStateVal != arr[i].schedules[j].schedule_type) {
1394
                 // 删除元素后改变i的值
1379
                 // 删除元素后改变i的值
1395
-                arr[i].schedules.splice(j--, 1);
1380
+                arr[i].schedules.splice(j--, 1)
1396
               }
1381
               }
1397
             }
1382
             }
1398
           }
1383
           }
1399
           arr3 = arr
1384
           arr3 = arr
1400
         }
1385
         }
1401
-        
1402
 
1386
 
1403
         let arr4 = []
1387
         let arr4 = []
1404
-        if(this.zoneVal == 0){
1388
+        if (this.zoneVal == 0) {
1405
           arr4 = JSON.parse(JSON.stringify(arr3))
1389
           arr4 = JSON.parse(JSON.stringify(arr3))
1406
-        }else{
1390
+        } else {
1407
           let arr = []
1391
           let arr = []
1408
           arr = JSON.parse(JSON.stringify(arr3))
1392
           arr = JSON.parse(JSON.stringify(arr3))
1409
           for (let i = 0; i < arr.length; i++) {
1393
           for (let i = 0; i < arr.length; i++) {
1410
             if (this.zoneVal != arr[i].zone_id) {
1394
             if (this.zoneVal != arr[i].zone_id) {
1411
               // 删除元素后改变i的值
1395
               // 删除元素后改变i的值
1412
-              arr.splice(i--, 1);
1396
+              arr.splice(i--, 1)
1413
             }
1397
             }
1414
           }
1398
           }
1415
           arr4 = arr
1399
           arr4 = arr
1416
         }
1400
         }
1417
-        let newArr = []
1401
+        const newArr = []
1418
         arr4.map(item => {
1402
         arr4.map(item => {
1419
           newArr.push(...item.schedules)
1403
           newArr.push(...item.schedules)
1420
         })
1404
         })
1421
         this.tableData1 = newArr
1405
         this.tableData1 = newArr
1422
-        let name = this.$route.query.patient_name
1423
-        this.tableData1.map((item,index) => {
1424
-          if(name == item.patient.name){
1425
-            if(item.assessment_before_dislysis != null){
1406
+        const name = this.$route.query.patient_name
1407
+        this.tableData1.map((item, index) => {
1408
+          if (name == item.patient.name) {
1409
+            if (item.assessment_before_dislysis != null) {
1426
               this.newTime = parseTime(item.assessment_before_dislysis.created_time, '{h}:{i}')
1410
               this.newTime = parseTime(item.assessment_before_dislysis.created_time, '{h}:{i}')
1427
             }
1411
             }
1428
-            
1429
-            setTimeout(()=>{
1430
-              this.$refs.tab1.setCurrentRow(this.tableData1[index]);
1431
-            },10)
1412
+
1413
+            setTimeout(() => {
1414
+              this.$refs.tab1.setCurrentRow(this.tableData1[index])
1415
+            }, 10)
1432
           }
1416
           }
1433
         })
1417
         })
1434
       }
1418
       }
1435
-
1436
-      
1437
     },
1419
     },
1438
     compare(property){
1420
     compare(property){
1439
       return function(a,b){
1421
       return function(a,b){
1442
         return value1 - value2;
1424
         return value1 - value2;
1443
       }
1425
       }
1444
     }
1426
     }
1445
-  },
1427
+  }
1446
 }
1428
 }
1447
 </script>
1429
 </script>
1448
 
1430