See999 4 years ago
parent
commit
f3665591c5

+ 6 - 1
src/xt_pages/dialysis/details/dialog/dialysisPrescriptionDialog.vue View File

@@ -983,7 +983,12 @@ export default {
983 983
   },
984 984
   computed: {
985 985
     dialysis_date: function() {
986
-      return uParseTime(this.$route.query.date, '{y}/{m}/{d}')
986
+      if(this.$route.query.date){
987
+        return uParseTime(this.$route.query.date, '{y}/{m}/{d}')
988
+      }else{
989
+        return this.record_date
990
+      }
991
+      
987 992
     }
988 993
   },
989 994
   data() {

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

@@ -24,12 +24,12 @@
24 24
       <el-tabs v-model="activeName" @tab-click="handleClick">
25 25
         <el-tab-pane label="候诊区" name="first">
26 26
           <div class="cell clearfix" style="margin-bottom:10px;">
27
-            <el-date-picker v-model="selected_date" prefix-icon="el-icon-date" @change="handleScheduleDateChange" :editable="false" :clearable="false" style="width: 130px;" type="date" placeholder="选择日期时间" align="right" ></el-date-picker>
28
-            <el-input size="small" style="width:80px;" v-model.trim="search_input" class="filter-item"/>
29
-            <el-button size="small" class="filter-item" type="primary" @click="searchAction">搜索</el-button>
27
+            <el-date-picker v-model="selected_date" prefix-icon="el-icon-date" @change="handleScheduleDateChange" :editable="false" :clearable="false" style="width: 45%;margin-right:10px;" type="date" placeholder="选择日期时间" align="right" ></el-date-picker>
28
+            <el-input size="small" style="width:24%;" v-model.trim="search_input" class="filter-item"/>
29
+            <el-button size="small" class="filter-item" type="primary" style="margin-right:20px;" @click="searchAction">搜索</el-button>
30 30
           </div>
31
-          <div class="cell clearfix" style="margin-bottom:10px;">
32
-            <el-select v-model="patientStateVal" placeholder="全部患者状态" style="width:130px;" @change="handleStateChange">
31
+          <div class="cell clearfix" style="margin-bottom:10px;display:flex;">
32
+            <el-select v-model="patientStateVal" placeholder="全部患者状态" style="margin-right:10px;" @change="handleStateChange">
33 33
               <el-option
34 34
                 v-for="item in patient_state"
35 35
                 :key="item.value"
@@ -37,7 +37,7 @@
37 37
                 :value="item.value">
38 38
               </el-option>
39 39
             </el-select>
40
-            <el-select v-model="treatStateVal" placeholder="全部治疗状态" style="width:130px;" @change="handleTreatChange">
40
+            <el-select v-model="treatStateVal" placeholder="全部治疗状态" style="margin-right:20px;" @change="handleTreatChange">
41 41
               <el-option
42 42
                 v-for="item in treat_state"
43 43
                 :key="item.value"
@@ -46,8 +46,8 @@
46 46
               </el-option>
47 47
             </el-select>
48 48
           </div>
49
-          <div class="cell clearfix" style="margin-bottom:10px;">
50
-            <el-select v-model="scheduleStateVal" placeholder="班次" style="width:130px;" @change="handletimeType">
49
+          <div class="cell clearfix" style="margin-bottom:10px;display:flex;">
50
+            <el-select v-model="scheduleStateVal" placeholder="班次" style="margin-right:10px;" @change="handletimeType">
51 51
               <el-option
52 52
                 v-for="item in schedule_options"
53 53
                 :key="item.value"
@@ -55,7 +55,7 @@
55 55
                 :value="item.value">
56 56
               </el-option>
57 57
             </el-select>
58
-            <el-select v-model="zoneVal" placeholder="分区" style="width:130px;" @change="handleZoneChange">
58
+            <el-select v-model="zoneVal" placeholder="分区" style="margin-right:20px;" @change="handleZoneChange">
59 59
               <el-option
60 60
                 v-for="item in zone_options"
61 61
                 :key="item.id"
@@ -1211,7 +1211,7 @@ export default {
1211 1211
           arr = patientArr
1212 1212
           for (let i = 0; i <arr.length; i++) {
1213 1213
             for (let j = 0; j < arr[i].schedules.length; j++) {
1214
-              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 == '')) {
1214
+              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 1215
                 // 删除元素后改变i的值
1216 1216
                 arr[i].schedules.splice(j--, 1);
1217 1217
               }

+ 519 - 84
src/xt_pages/dialysis/dialysisPrintOrder.vue View File

@@ -201,97 +201,176 @@
201 201
       <!--</div>-->
202 202
 
203 203
       <!--<dialysis-print-order-two :patientInfo="patientInfo" :receiverTreatmentAccess="receiverTreatmentAccess" :predialysis="predialysis"></dialysis-print-order-two>-->
204
+      <el-container class="newContainer">
205
+        <div style="width:270px;margin-right:20px;">
206
+            <div class="cell clearfix" style="margin-bottom:10px;">
207
+            <el-date-picker v-model="selected_date" prefix-icon="el-icon-date" @change="handleScheduleDateChange" :editable="false" :clearable="false" style="width: 130px;margin-right:10px;" type="date" placeholder="选择日期时间" align="right" ></el-date-picker>
208
+            <el-input size="small" style="width:80px;" v-model.trim="search_input" class="filter-item"/>
209
+            <el-button size="small" class="filter-item" type="primary" @click="searchAction">搜索</el-button>
210
+          </div>
211
+          <div class="cell clearfix" style="margin-bottom:10px;">
212
+            <el-select v-model="patientStateVal" placeholder="全部患者状态" style="width:130px;margin-right:10px;" @change="handleStateChange">
213
+              <el-option
214
+                v-for="item in patient_state"
215
+                :key="item.value"
216
+                :label="item.label"
217
+                :value="item.value">
218
+              </el-option>
219
+            </el-select>
220
+            <el-select v-model="treatStateVal" placeholder="全部治疗状态" style="width:130px;margin-right:10px;" @change="handleTreatChange">
221
+              <el-option
222
+                v-for="item in treat_state"
223
+                :key="item.value"
224
+                :label="item.label"
225
+                :value="item.value">
226
+              </el-option>
227
+            </el-select>
228
+          </div>
229
+          <div class="cell clearfix" style="margin-bottom:10px;">
230
+            <el-select v-model="scheduleStateVal" placeholder="班次" style="width:130px;margin-right:10px;" @change="handletimeType">
231
+              <el-option
232
+                v-for="item in schedule_options"
233
+                :key="item.value"
234
+                :label="item.label"
235
+                :value="item.value">
236
+              </el-option>
237
+            </el-select>
238
+            <el-select v-model="zoneVal" placeholder="分区" style="width:130px;margin-right:10px;" @change="handleZoneChange">
239
+              <el-option
240
+                v-for="item in zone_options"
241
+                :key="item.id"
242
+                :label="item.text"
243
+                :value="item.id">
244
+              </el-option>
245
+            </el-select>
246
+          </div>
247
+          <div style="padding-right:20px;">
248
+            <el-table
249
+              ref="tab"
250
+              @row-click="changePatient"
251
+              highlight-current-row
252
+              :data="tableData"
253
+              height="500"
254
+              border
255
+              style="width: 100%">
256
+              <el-table-column
257
+                prop="date"
258
+                label="患者"
259
+                >
260
+                <template slot-scope="scope">
261
+                  {{ scope.row.patient.name }}
262
+                </template>
263
+              </el-table-column>
264
+              <el-table-column
265
+                prop="name"
266
+                label="透析号"
267
+                >
268
+                <template slot-scope="scope">
269
+                  {{ scope.row.patient.dialysis_no }}
270
+                </template>
271
+              </el-table-column>
272
+            </el-table>
273
+          </div>
274
+        </div>
275
+        <div>
276
+          <DialysisPrintOrderOne
277
+            v-bind:childResponse="childResponse"
278
+            v-if="org_template_info.template_id == 1"
279
+          >
280
+          </DialysisPrintOrderOne>
281
+
282
+          <DialysisPrintOrderTwo
283
+            v-bind:childResponse="childResponse"
284
+            v-if="
285
+              org_template_info.template_id == 2 ||
286
+                org_template_info.template_id == 0
287
+            "
288
+          ></DialysisPrintOrderTwo>
289
+
290
+          <DialysisPrintOrderThree
291
+            v-bind:childResponse="childResponse"
292
+            v-if="org_template_info.template_id == 3"
293
+          >
294
+          </DialysisPrintOrderThree>
204 295
 
205
-      <DialysisPrintOrderOne
206
-        v-bind:childResponse="childResponse"
207
-        v-if="org_template_info.template_id == 1"
208
-      >
209
-      </DialysisPrintOrderOne>
210
-
211
-      <DialysisPrintOrderTwo
212
-        v-bind:childResponse="childResponse"
213
-        v-if="
214
-          org_template_info.template_id == 2 ||
215
-            org_template_info.template_id == 0
216
-        "
217
-      ></DialysisPrintOrderTwo>
218
-
219
-      <DialysisPrintOrderThree
220
-        v-bind:childResponse="childResponse"
221
-        v-if="org_template_info.template_id == 3"
222
-      >
223
-      </DialysisPrintOrderThree>
224
-
225
-      <DialysisPrintOrderFour
226
-        v-bind:childResponse="childResponse"
227
-        v-if="org_template_info.template_id == 4"
228
-      >
229
-      </DialysisPrintOrderFour>
296
+          <DialysisPrintOrderFour
297
+            v-bind:childResponse="childResponse"
298
+            v-if="org_template_info.template_id == 4"
299
+          >
300
+          </DialysisPrintOrderFour>
230 301
 
231
-      <DialysisPrintOrderFive
232
-        v-bind:childResponse="childResponse"
233
-        v-if="org_template_info.template_id == 5"
234
-      >
235
-      </DialysisPrintOrderFive>
302
+          <DialysisPrintOrderFive
303
+            v-bind:childResponse="childResponse"
304
+            v-if="org_template_info.template_id == 5"
305
+          >
306
+          </DialysisPrintOrderFive>
236 307
 
237
-      <DialysisPrintOrderSix
238
-        v-bind:childResponse="childResponse"
239
-        v-if="org_template_info.template_id == 6"
240
-      >
241
-      </DialysisPrintOrderSix>
308
+          <DialysisPrintOrderSix
309
+            v-bind:childResponse="childResponse"
310
+            v-if="org_template_info.template_id == 6"
311
+          >
312
+          </DialysisPrintOrderSix>
242 313
 
243
-      <DialysisPrintOrderSeven
244
-        v-bind:childResponse="childResponse"
245
-        v-if="org_template_info.template_id == 7"
246
-      >
247
-      </DialysisPrintOrderSeven>
314
+          <DialysisPrintOrderSeven
315
+            v-bind:childResponse="childResponse"
316
+            v-if="org_template_info.template_id == 7"
317
+          >
318
+          </DialysisPrintOrderSeven>
248 319
 
249
-      <DialysisPrintOrderEight
250
-        v-bind:childResponse="childResponse"
251
-        v-if="org_template_info.template_id == 8"
252
-      >
253
-      </DialysisPrintOrderEight>
254
-
255
-      <!--<DialysisPrintOrderTen></DialysisPrintOrderTen>-->
256
-      <DialysisPrintOrderTen
257
-        v-bind:childResponse="childResponse"
258
-        v-if="org_template_info.template_id == 10"
259
-      ></DialysisPrintOrderTen>
260
-
261
-      <DialysisPrintOrderNine
262
-        v-bind:childResponse="childResponse"
263
-        v-if="org_template_info.template_id == 9"
264
-      ></DialysisPrintOrderNine>
265
-
266
-      <DialysisPrintOrderEleven
267
-        v-bind:childResponse="childResponse"
268
-        v-if="org_template_info.template_id == 11"
269
-      ></DialysisPrintOrderEleven>
270
-      <DialysisPrintOrderTwelve
271
-        v-bind:childResponse="childResponse"
272
-        v-if="org_template_info.template_id == 12"
273
-      ></DialysisPrintOrderTwelve>
274
-      <DialysisPrintOrderThirteen
275
-        v-bind:childResponse="childResponse"
276
-        v-if="org_template_info.template_id == 13"
277
-      ></DialysisPrintOrderThirteen>
278
-      <DialysisPrintOrderFourteen
279
-        v-bind:childResponse="childResponse"
280
-        v-if="org_template_info.template_id == 14"
281
-      ></DialysisPrintOrderFourteen>
282
-      <DialysisPrintOrderFifteen
283
-        v-bind:childResponse="childResponse"
284
-        v-if="org_template_info.template_id == 15"
285
-      ></DialysisPrintOrderFifteen>
286
-      <DialysisPrintOrderSixteen
287
-        v-bind:childResponse="childResponse"
288
-        v-if="org_template_info.template_id == 16"
289
-      ></DialysisPrintOrderSixteen>
320
+          <DialysisPrintOrderEight
321
+            v-bind:childResponse="childResponse"
322
+            v-if="org_template_info.template_id == 8"
323
+          >
324
+          </DialysisPrintOrderEight>
325
+
326
+          <!--<DialysisPrintOrderTen></DialysisPrintOrderTen>-->
327
+          <DialysisPrintOrderTen
328
+            v-bind:childResponse="childResponse"
329
+            v-if="org_template_info.template_id == 10"
330
+          ></DialysisPrintOrderTen>
331
+
332
+          <DialysisPrintOrderNine
333
+            v-bind:childResponse="childResponse"
334
+            v-if="org_template_info.template_id == 9"
335
+          ></DialysisPrintOrderNine>
336
+
337
+          <DialysisPrintOrderEleven
338
+            v-bind:childResponse="childResponse"
339
+            v-if="org_template_info.template_id == 11"
340
+          ></DialysisPrintOrderEleven>
341
+          <DialysisPrintOrderTwelve
342
+            v-bind:childResponse="childResponse"
343
+            v-if="org_template_info.template_id == 12"
344
+          ></DialysisPrintOrderTwelve>
345
+          <DialysisPrintOrderThirteen
346
+            v-bind:childResponse="childResponse"
347
+            v-if="org_template_info.template_id == 13"
348
+          ></DialysisPrintOrderThirteen>
349
+          <DialysisPrintOrderFourteen
350
+            v-bind:childResponse="childResponse"
351
+            v-if="org_template_info.template_id == 14"
352
+          ></DialysisPrintOrderFourteen>
353
+          <DialysisPrintOrderFifteen
354
+            v-bind:childResponse="childResponse"
355
+            v-if="org_template_info.template_id == 15"
356
+          ></DialysisPrintOrderFifteen>
357
+          <DialysisPrintOrderSixteen
358
+            v-bind:childResponse="childResponse"
359
+            v-if="org_template_info.template_id == 16"
360
+          ></DialysisPrintOrderSixteen>
361
+        </div>
362
+      </el-container>
290 363
     </div>
291 364
   </div>
292 365
 </template>
293 366
 
294 367
 <script>
368
+
369
+import {
370
+  getDialysisRecordInitData,
371
+  getDialysisSchedules
372
+} from "@/api/dialysis_record";
373
+import { parseTime } from "@/utils";
295 374
 import { getDialysisRecord } from "@/api/dialysis";
296 375
 import { getDataConfig } from "@/utils/data";
297 376
 import { jsGetAge, uParseTime } from "@/utils/tools";
@@ -429,7 +508,40 @@ export default {
429 508
         zongliang_unit: "mg",
430 509
         gaimingcheng_unit: "",
431 510
         gaijiliang_unit: ""
432
-      }
511
+      },
512
+
513
+
514
+      //
515
+      tableData: [],
516
+      selected_date: new Date(),
517
+      // search_input 和 search_keyword,使输入关键字时不会经常刷新 filtedSchedules
518
+      search_keyword: '', // 确定用于搜索的关键字
519
+      search_input: '', // 输入中的关键字
520
+      patient_state:[
521
+          {value: 0,label: '全部'},
522
+          {value: 1,label: '已签到'},
523
+          {value: 2,label: '未签到'},
524
+          {value: 3,label: '已上机'},
525
+          {value: 4,label: '已下机'},
526
+      ],
527
+      patientStateVal: 0,
528
+      treat_state:[
529
+          {value: 0,label: '全部'},
530
+          {value: 1,label: '待开处方'},
531
+          {value: 2,label: '待开小结'},
532
+      ],
533
+      treatStateVal: 0,
534
+      schedule_options:[
535
+          {value: 0,label: '全部'},
536
+          {value: 1,label: '上午'},
537
+          {value: 2,label: '下午'},
538
+          {value: 3,label: '晚上'},
539
+      ],
540
+      scheduleStateVal: 0,
541
+      zone_options:[
542
+          { id: 0, text: '全部' }
543
+      ],
544
+      zoneVal:0,
433 545
     };
434 546
   },
435 547
   methods: {
@@ -977,7 +1089,287 @@ export default {
977 1089
           // checker: 0,
978 1090
         }
979 1091
       );
980
-    }
1092
+    },
1093
+    //日期
1094
+        handleScheduleDateChange: function() {
1095
+            this.treatStateVal = 0
1096
+            this.patientStateVal = 0
1097
+            this.zoneVal = 0
1098
+            this.scheduleStateVal = 0
1099
+            this.search_keyword = this.search_input = ''
1100
+            // this.$store.dispatch("SaveDialysisAreaSelectIndexs", {
1101
+            //   zone: this.zone_selected,
1102
+            //   schedule_type: this.schedule_type_selected,
1103
+            //   schedule_date: this.selected_date,
1104
+            // })
1105
+            this.requestDialysisSchedules()
1106
+        },
1107
+        //初始化数据
1108
+        getInitData: function() {
1109
+            getDialysisRecordInitData().then(rs => {
1110
+                var resp = rs.data
1111
+                if (resp.state == 1) {
1112
+                var zones = resp.data.zones
1113
+                var schedules = resp.data.schedules
1114
+                var zone_options = [{ id: 0, text: '全部' }]
1115
+                for (let z_i = 0; z_i < zones.length; z_i++) {
1116
+                    const zone = zones[z_i]
1117
+                    zone_options.push({ id: zone.id, text: zone.name })
1118
+                }
1119
+                this.zone_options = zone_options
1120
+                this.zone_schedules = this.processedDialysisSchedules(schedules, this.zone_options)
1121
+                this.arr = this.processedDialysisSchedules(schedules, this.zone_options)
1122
+                this.getData()
1123
+                } else {
1124
+                this.$message.error(resp.msg)
1125
+                }
1126
+            })
1127
+        },
1128
+        // 班次
1129
+        handletimeType: function(index) {
1130
+            this.scheduleStateVal = index
1131
+            // this.$store.dispatch('SetScheduleTypeSelected', { schedule_type_selected: index })
1132
+            this.search_keyword = this.search_input = ''
1133
+            this.getData()
1134
+        },
1135
+        //分区
1136
+        handleZoneChange: function(index) {
1137
+            this.zoneVal = index
1138
+            // this.$store.dispatch('SetZoneSelected', { zone_selected: index })
1139
+            this.search_keyword = this.search_input = ''
1140
+            this.getData()
1141
+        },
1142
+        //患者状态
1143
+        handleStateChange: function(index) {
1144
+            this.patientStateVal = index
1145
+            // this.$store.dispatch('SetPatientStateSelected', { patient_state_selected: index })
1146
+            this.search_keyword = this.search_input = ''
1147
+            this.getData()
1148
+        },
1149
+        handleTreatChange: function(index) {
1150
+            this.treatStateVal = index
1151
+            // this.$store.dispatch('SetTreatStateSelected', { treat_state_selected: index })
1152
+            this.search_keyword = this.search_input = ''
1153
+            this.getData()
1154
+        },
1155
+        processedDialysisSchedules: function(schedules, zone_options) {
1156
+            var zoneMap = {}
1157
+            var scheduleMap = {}
1158
+            for (let z_i = 0; z_i < zone_options.length; z_i++) {
1159
+                const zone = zone_options[z_i]
1160
+                if (zone.id == 0) {
1161
+                continue
1162
+                }
1163
+                scheduleMap[zone.id] = []
1164
+            }
1165
+            for (let index = 0; index < schedules.length; index++) {
1166
+                const schedule = schedules[index]
1167
+                scheduleMap[schedule.device_number.zone.id].push(schedule)
1168
+            }
1169
+            var zone_schedules = []
1170
+            for (let index = 0; index < zone_options.length; index++) {
1171
+                const zone = zone_options[index]
1172
+                if (zone.id == 0) {
1173
+                continue
1174
+                }
1175
+                var schedules = scheduleMap[zone.id]
1176
+                zone_schedules.push({ zone_id: zone.id, zone_name: zone.text, schedules: schedules })
1177
+            }
1178
+            return zone_schedules
1179
+        },
1180
+        searchAction: function() {
1181
+            this.search_keyword = this.search_input
1182
+            this.scheduleStateVal = 0
1183
+            this.zoneVal = 0
1184
+            this.treatStateVal = 0
1185
+            this.patientStateVal = 0
1186
+            if(this.search_input != ''){
1187
+                let arr = []
1188
+                this.filtedSchedules.map(item => {
1189
+                arr.push(...item.schedules)
1190
+                })
1191
+                if(this.activeName == "first"){
1192
+                this.tableData = arr
1193
+                }else if(this.activeName == "second"){
1194
+                this.tableData1 = arr
1195
+                }
1196
+                
1197
+            }else{
1198
+                this.getData()
1199
+            }
1200
+        },
1201
+        requestDialysisSchedules: function() {
1202
+            var ymd = parseTime(this.selected_date, '{y}-{m}-{d}')
1203
+            getDialysisSchedules(ymd).then(rs => {
1204
+                var resp = rs.data
1205
+                if (resp.state == 1) {
1206
+                var schedules = resp.data.schedules
1207
+                this.zone_schedules = this.processedDialysisSchedules(schedules, this.zone_options)
1208
+                let newArr = []
1209
+                this.zone_schedules.map(item => {
1210
+                    newArr.push(...item.schedules)
1211
+                })
1212
+                this.tableData = newArr
1213
+                } else {
1214
+                this.$message.error(resp.msg)
1215
+                }
1216
+            })
1217
+        },
1218
+        changePatient(schedual){
1219
+              console.log(schedual)
1220
+              var xtdate = parseTime(schedual.schedule_date, '{y}-{m}-{d}')
1221
+              this.$router.push(
1222
+                '/dialysis/print?xtdate=' + xtdate + '&xtno=' + schedual.patient.dialysis_no
1223
+              )
1224
+            //   this.patient_id = schedual.patient_id;
1225
+            //   this.date = schedual.schedule_date;
1226
+            //   // this.getScheduleDetail();
1227
+            //   // this.getLongAdvice();
1228
+            
1229
+            //   var patient_id = schedual.patient_id;
1230
+            //   var date = schedual.schedule_date;
1231
+            //   this.$router.push({
1232
+            //     path: "/dialysis/details",
1233
+            //     query: {
1234
+            //       patient_id: patient_id,
1235
+            //       date: date,
1236
+            //       patient_name: schedual.patient.name
1237
+            //     }
1238
+            //   });
1239
+        },
1240
+        getData(){
1241
+            let patientArr = []
1242
+            patientArr = JSON.parse(JSON.stringify(this.zone_schedules))
1243
+            console.log('patientArr',patientArr)
1244
+            let arr1 = []
1245
+            if(this.patientStateVal == 0){
1246
+                arr1 = patientArr
1247
+                console.log(arr1)
1248
+            }else if(this.patientStateVal == 1){
1249
+                let arr = []
1250
+                arr = patientArr
1251
+                for (let i = 0; i <arr.length; i++) {
1252
+                    for (let j = 0; j < arr[i].schedules.length; j++) {
1253
+                        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 == ''))) {
1254
+                            // 删除元素后改变i的值
1255
+                            arr[i].schedules.splice(j--, 1);
1256
+                        }
1257
+                    }
1258
+                }
1259
+                console.log("执行1",arr)
1260
+                arr1 = arr
1261
+            }else if(this.patientStateVal == 2){
1262
+                let arr = []
1263
+                arr = patientArr
1264
+                for (let i = 0; i < arr.length; i++) {
1265
+                    for (let j = 0; j < arr[i].schedules.length; j++) {
1266
+                        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))) {
1267
+                            // 删除元素后改变i的值
1268
+                            console.log('几次')
1269
+                            arr[i].schedules.splice(j--, 1);
1270
+                        }
1271
+                    }
1272
+                }
1273
+                console.log("执行2",arr)
1274
+                arr1 = arr
1275
+            }else if(this.patientStateVal == 3){
1276
+                let arr = []
1277
+                arr = patientArr
1278
+                for (let i = 0; i <arr.length; i++) {
1279
+                    for (let j = 0; j < arr[i].schedules.length; j++) {
1280
+                        if (arr[i].schedules.length > 0 && (arr[i].schedules[j].dialysis_order == null || (arr[i].schedules[j].dialysis_order != null && arr[i].schedules[j].dialysis_order.stage != 1))) {
1281
+                            // 删除元素后改变i的值
1282
+                            arr[i].schedules.splice(j--, 1);
1283
+                        }
1284
+                    }
1285
+                }
1286
+                console.log("执行1",arr)
1287
+                arr1 = arr
1288
+            }else if(this.patientStateVal == 4){
1289
+                let arr = []
1290
+                arr = patientArr
1291
+                for (let i = 0; i < arr.length; i++) {
1292
+                    for (let j = 0; j < arr[i].schedules.length; j++) {
1293
+                        if (arr[i].schedules.length > 0 && (arr[i].schedules[j].dialysis_order == null || (arr[i].schedules[j].dialysis_order != null && arr[i].schedules[j].dialysis_order.stage != 2))) {
1294
+                            // 删除元素后改变i的值
1295
+                            arr[i].schedules.splice(j--, 1);
1296
+                        }
1297
+                    }
1298
+                }
1299
+                console.log("执行2",arr)
1300
+                arr1 = arr
1301
+            }
1302
+
1303
+            let arr2 = []
1304
+            if(this.treatStateVal == 0){
1305
+                arr2 = JSON.parse(JSON.stringify(arr1))
1306
+            }else if(this.treatStateVal == 1){
1307
+                let arr = []
1308
+                arr = JSON.parse(JSON.stringify(arr1))
1309
+                for (let i = 0; i < arr.length; i++) {
1310
+                    for (let j = 0; j < arr[i].schedules.length; j++) {
1311
+                        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)) {
1312
+                            // 删除元素后改变i的值
1313
+                            arr[i].schedules.splice(j--, 1);
1314
+                        }
1315
+                    }
1316
+                }
1317
+                arr2 = arr
1318
+            }else if(this.treatStateVal == 2){
1319
+                let arr = []
1320
+                arr = JSON.parse(JSON.stringify(arr1))
1321
+                for (let i = 0; i < arr.length; i++) {
1322
+                    for (let j = 0; j < arr[i].schedules.length; j++) {
1323
+                        if (arr[i].schedules.length > 0 && arr[i].schedules[j].treatment_summary != null && arr[i].schedules[j].treatment_summary.dialysis_summary != '') {
1324
+                            // 删除元素后改变i的值
1325
+                            arr[i].schedules.splice(j--, 1);
1326
+                        }
1327
+                    }
1328
+                }
1329
+                arr2 = arr
1330
+            }
1331
+            
1332
+
1333
+            let arr3 = []
1334
+            if(this.scheduleStateVal == 0){
1335
+                arr3 = JSON.parse(JSON.stringify(arr2))
1336
+            }else{
1337
+                let arr = []
1338
+                arr = JSON.parse(JSON.stringify(arr2))
1339
+                for (let i = 0; i < arr.length; i++) {
1340
+                    for (let j = 0; j < arr[i].schedules.length; j++) {
1341
+                        if (this.scheduleStateVal != arr[i].schedules[j].schedule_type) {
1342
+                            // 删除元素后改变i的值
1343
+                            arr[i].schedules.splice(j--, 1);
1344
+                        }
1345
+                    }
1346
+                }
1347
+                arr3 = arr
1348
+                console.log("上午",arr)
1349
+            }
1350
+            
1351
+
1352
+            let arr4 = []
1353
+            if(this.zoneVal == 0){
1354
+                arr4 = JSON.parse(JSON.stringify(arr3))
1355
+            }else{
1356
+                let arr = []
1357
+                arr = JSON.parse(JSON.stringify(arr3))
1358
+                for (let i = 0; i < arr.length; i++) {
1359
+                    if (this.zoneVal != arr[i].zone_id) {
1360
+                    // 删除元素后改变i的值
1361
+                    arr.splice(i--, 1);
1362
+                    }
1363
+                }
1364
+                arr4 = arr
1365
+            }
1366
+            let newArr = []
1367
+            arr4.map(item => {
1368
+            newArr.push(...item.schedules)
1369
+            })
1370
+            this.tableData = newArr
1371
+            console.log('table',this.tableData)
1372
+        },
981 1373
   },
982 1374
   watch: {
983 1375
     "patientInfo.gender": function() {
@@ -1006,6 +1398,8 @@ export default {
1006 1398
     }
1007 1399
   },
1008 1400
   created() {
1401
+    this.getInitData();
1402
+
1009 1403
     var xtuser = this.$store.getters.xt_user;
1010 1404
     this.orgname = xtuser.org.org_name;
1011 1405
     // this.orgname = "遂溪方济医院";
@@ -1049,7 +1443,34 @@ export default {
1049 1443
       this.$message.error("参数不齐");
1050 1444
       return false;
1051 1445
     }
1052
-  }
1446
+  },
1447
+  computed:{
1448
+    filtedSchedules: function() {
1449
+      var search_keyword = this.search_keyword
1450
+      if (search_keyword.length > 0) {
1451
+        var schedules = []
1452
+        for (let o_i = 0; o_i < this.zone_schedules.length; o_i++) {
1453
+        const scheduleInfo = this.zone_schedules[o_i]
1454
+        var originSchedules = scheduleInfo.schedules
1455
+        if (originSchedules.length == 0) {
1456
+            continue
1457
+        }
1458
+        var filtedSchedules = []
1459
+        for (let s_i = 0; s_i < originSchedules.length; s_i++) {
1460
+            const schedule = originSchedules[s_i]
1461
+            if (schedule.patient.name.indexOf(search_keyword) != -1) {
1462
+            filtedSchedules.push(schedule)
1463
+            // break
1464
+            }
1465
+        }
1466
+        if (filtedSchedules.length > 0) {
1467
+            schedules.push({ zone_id: scheduleInfo.zone_id, zone_name: scheduleInfo.zone_name, schedules: filtedSchedules })
1468
+        }
1469
+        }
1470
+        return schedules
1471
+      }
1472
+    }
1473
+  },
1053 1474
 };
1054 1475
 </script>
1055 1476
 
@@ -1208,4 +1629,18 @@ export default {
1208 1629
 .table-box1 tr {
1209 1630
   border-bottom: 1px solid #000;
1210 1631
 }
1632
+
1633
+</style>
1634
+
1635
+<style lang="scss">
1636
+.newContainer{
1637
+  .el-date-editor{
1638
+    .el-input__inner{
1639
+      padding-right:0px;
1640
+    }
1641
+  }
1642
+  .el-table td, .el-table th{
1643
+    text-align: center;
1644
+  }
1645
+}
1211 1646
 </style>

+ 1 - 1
src/xt_pages/dialysis/schedualPatient.vue View File

@@ -416,7 +416,7 @@ import { getDialysisRecordInitData, getDialysisSchedules } from '@/api/dialysis_
416 416
           arr = patientArr
417 417
           for (let i = 0; i <arr.length; i++) {
418 418
             for (let j = 0; j < arr[i].schedules.length; j++) {
419
-              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 == '')) {
419
+              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 == ''))) {
420 420
                 // 删除元素后改变i的值
421 421
                 arr[i].schedules.splice(j--, 1);
422 422
               }

+ 41 - 45
src/xt_pages/upload/fast/FastProvince.vue View File

@@ -106,26 +106,17 @@
106 106
               border
107 107
               style="width: 100%">
108 108
               <el-table-column
109
-                prop="date"
110 109
                 label="患者"
111 110
                 >
112 111
                 <template slot-scope="scope">
113
-                  {{ scope.row.patient.name }}
112
+                  {{ scope.row.patient ? scope.row.patient.name : '' }}
114 113
                 </template>
115 114
               </el-table-column>
116 115
               <el-table-column
117
-                prop="name"
118
-                label="状态"
116
+                label="透析号"
119 117
                 >
120 118
                 <template slot-scope="scope">
121
-                  <div style="display:flex;align-items:center;justify-content:space-around;">
122
-                    <span class="tip1" v-if="scope.row.prescription == null || scope.row.prescription.creater == 0">
123
-                      待开处方
124
-                    </span>
125
-                    <span class="tip2" v-if="scope.row.assessment_before_dislysis == null || scope.row.assessment_before_dislysis.weight_before == ''">
126
-                      待称重
127
-                    </span>
128
-                  </div>
119
+                  {{ scope.row.patient ? scope.row.patient.dialysis_no : '' }}
129 120
                 </template>
130 121
               </el-table-column>
131 122
             </el-table>
@@ -229,31 +220,31 @@ import { parseTime } from "@/utils";
229 220
       }
230 221
     }, 
231 222
     computed:{
232
-        filtedSchedules: function() {
233
-            var search_keyword = this.search_keyword
234
-            if (search_keyword.length > 0) {
235
-                var schedules = []
236
-                for (let o_i = 0; o_i < this.zone_schedules.length; o_i++) {
237
-                const scheduleInfo = this.zone_schedules[o_i]
238
-                var originSchedules = scheduleInfo.schedules
239
-                if (originSchedules.length == 0) {
240
-                    continue
241
-                }
242
-                var filtedSchedules = []
243
-                for (let s_i = 0; s_i < originSchedules.length; s_i++) {
244
-                    const schedule = originSchedules[s_i]
245
-                    if (schedule.patient.name.indexOf(search_keyword) != -1) {
246
-                    filtedSchedules.push(schedule)
247
-                    // break
248
-                    }
249
-                }
250
-                if (filtedSchedules.length > 0) {
251
-                    schedules.push({ zone_id: scheduleInfo.zone_id, zone_name: scheduleInfo.zone_name, schedules: filtedSchedules })
252
-                }
253
-                }
254
-                return schedules
223
+      filtedSchedules: function() {
224
+        var search_keyword = this.search_keyword
225
+        if (search_keyword.length > 0) {
226
+          var schedules = []
227
+          for (let o_i = 0; o_i < this.zone_schedules.length; o_i++) {
228
+            const scheduleInfo = this.zone_schedules[o_i]
229
+            var originSchedules = scheduleInfo.schedules
230
+            if (originSchedules.length == 0) {
231
+              continue
232
+            }
233
+            var filtedSchedules = []
234
+            for (let s_i = 0; s_i < originSchedules.length; s_i++) {
235
+              const schedule = originSchedules[s_i]
236
+              if (schedule.patient.name.indexOf(search_keyword) != -1) {
237
+                filtedSchedules.push(schedule)
238
+                // break
239
+              }
240
+            }
241
+            if (filtedSchedules.length > 0) {
242
+              schedules.push({ zone_id: scheduleInfo.zone_id, zone_name: scheduleInfo.zone_name, schedules: filtedSchedules })
255 243
             }
244
+          }
245
+          return schedules
256 246
         }
247
+      }
257 248
     },
258 249
     created() {
259 250
       this.getDistricts()
@@ -263,6 +254,7 @@ import { parseTime } from "@/utils";
263 254
       } else {
264 255
         this.form.province = parseInt(province)
265 256
       }
257
+      
266 258
 
267 259
       this.getInitData();
268 260
 
@@ -300,6 +292,7 @@ import { parseTime } from "@/utils";
300 292
       chooseWay(way) {
301 293
         this.wayType = way;
302 294
       },
295
+      onSearch(){},
303 296
       //日期
304 297
         handleScheduleDateChange: function() {
305 298
             this.treatStateVal = 0
@@ -394,16 +387,11 @@ import { parseTime } from "@/utils";
394 387
             this.treatStateVal = 0
395 388
             this.patientStateVal = 0
396 389
             if(this.search_input != ''){
397
-                let arr = []
398
-                this.filtedSchedules.map(item => {
390
+              let arr = []
391
+              this.filtedSchedules.map(item => {
399 392
                 arr.push(...item.schedules)
400
-                })
401
-                if(this.activeName == "first"){
402
-                this.tableData = arr
403
-                }else if(this.activeName == "second"){
404
-                this.tableData1 = arr
405
-                }
406
-                
393
+              })
394
+              this.tableData = arr
407 395
             }else{
408 396
                 this.getData()
409 397
             }
@@ -456,7 +444,7 @@ import { parseTime } from "@/utils";
456 444
                 arr = patientArr
457 445
                 for (let i = 0; i <arr.length; i++) {
458 446
                     for (let j = 0; j < arr[i].schedules.length; j++) {
459
-                        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 == '')) {
447
+                        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 == ''))) {
460 448
                             // 删除元素后改变i的值
461 449
                             arr[i].schedules.splice(j--, 1);
462 450
                         }
@@ -577,6 +565,11 @@ import { parseTime } from "@/utils";
577 565
             console.log('table',this.tableData)
578 566
         },
579 567
 
568
+    },
569
+    mounted(){
570
+      setTimeout(()=>{
571
+        this.$refs.tab.setCurrentRow(this.tableData[0]);
572
+      },10)
580 573
     }
581 574
   }
582 575
 </script>
@@ -611,5 +604,8 @@ import { parseTime } from "@/utils";
611 604
             padding-right:0px;
612 605
         }
613 606
     }
607
+    .el-table td, .el-table th{
608
+      text-align: center;
609
+    }
614 610
 }
615 611
 </style>