See999 4 years ago
parent
commit
d2fdb57d40

+ 40 - 0
src/api/doctorSchedule.js View File

@@ -124,3 +124,43 @@ export function UpdateContinusSchedule(params) {
124 124
     params: params
125 125
   })
126 126
 }
127
+
128
+export function SaveNurseSort(params) {
129
+  return request({
130
+    url: '/api/schedule/savenursesort',
131
+    methods: 'Get',
132
+    params: params
133
+  })
134
+}
135
+
136
+export function SaveIsSchedule(params) {
137
+  return request({
138
+    url: '/api/schedule/saveisschedule',
139
+    methods: 'get',
140
+    params: params
141
+  })
142
+}
143
+
144
+export function getScheduleListTotal(params) {
145
+  return request({
146
+    url: '/api/schedule/getscheudlelisttotal',
147
+    methods: 'get',
148
+    params: params
149
+  })
150
+}
151
+
152
+export function toSearchTotal(params) {
153
+  return request({
154
+    url: '/api/schedule/tosearchtotal',
155
+    methods: 'get',
156
+    params: params
157
+  })
158
+}
159
+
160
+export function changeOption(params) {
161
+  return request({
162
+    url: '/api/schedule/changeoption',
163
+    methods: 'get',
164
+    params: params
165
+  })
166
+}

+ 1 - 1
src/router/index.js View File

@@ -101,7 +101,7 @@ var _constant_router_map = [{
101 101
 var _asy_router_map = [
102 102
   patient,
103 103
   workforce,
104
-  // medicalScheduling,
104
+  medicalScheduling,
105 105
   weight_sign,
106 106
   dialysis,
107 107
   stock,

+ 53 - 0
src/router/modules/dialysis.js View File

@@ -38,6 +38,59 @@ export default {
38 38
         noCache: true
39 39
       }
40 40
     },
41
+    {
42
+      path: '/dialysis/consumableDrugs',
43
+      component: () => import('@/xt_pages/dialysis/consumableDrugs'),
44
+      name: '耗材药品',
45
+      meta: {
46
+        title: '耗材药品',
47
+        noCache: true
48
+      }
49
+    },
50
+    {
51
+      path: '/dialysis/consumableDrugs_print',
52
+      component: () => import('@/xt_pages/dialysis/consumableDrugs_print'),
53
+      hidden: true,
54
+      is_menu: false,
55
+      name: 'consumableDrugs_print',
56
+      meta: {
57
+        title: 'consumableDrugs_print',
58
+        noCache: true
59
+      }
60
+    },
61
+    {
62
+      path: '/dialysis/dialysisDrugs_print',
63
+      component: () => import('@/xt_pages/dialysis/dialysisDrugs_print'),
64
+      hidden: true,
65
+      is_menu: false,
66
+      name: 'dialysisDrugs_print',
67
+      meta: {
68
+        title: 'dialysisDrugs_print',
69
+        noCache: true
70
+      }
71
+    },
72
+    {
73
+      path: '/dialysis/dialysisParameters_print',
74
+      component: () => import('@/xt_pages/dialysis/dialysisParameters_print'),
75
+      hidden: true,
76
+      is_menu: false,
77
+      name: 'dialysisParameters_print',
78
+      meta: {
79
+        title: 'dialysisParameters_print',
80
+        noCache: true
81
+      }
82
+    },
83
+    {
84
+      path: '/dialysis/allSummary_print',
85
+      component: () => import('@/xt_pages/dialysis/allSummary_print'),
86
+      hidden: true,
87
+      is_menu: false,
88
+      name: 'allSummary_print',
89
+      meta: {
90
+        title: 'allSummary_print',
91
+        noCache: true
92
+      }
93
+    },
41 94
     {
42 95
       path: '/dialysis/record/:id',
43 96
       component: () => import('@/xt_pages/dialysis/dialysisPage'),

+ 2 - 2
src/xt_pages/dialysis/batch_print/batch_print_order.vue View File

@@ -71,9 +71,9 @@
71 71
             </div>
72 72
           </div>
73 73
           <div class="row flex">
74
-            <div class="inline_block">
74
+            <div class="inline_block" style="display:flex;align-items:center">
75 75
               诊断:
76
-              <div class="under_line" style="width: 500px;">
76
+              <div style="border-bottom: 1px solid #999;width: 700px;text-align:left;display:block; word-wrap: break-word; word-break: normal;">
77 77
                 {{ record.patient.diagnose }}
78 78
               </div>
79 79
             </div>

+ 258 - 119
src/xt_pages/medicalScheduling/index.vue View File

@@ -3,7 +3,7 @@
3 3
         <div class="position">
4 4
             <bread-crumb :crumbs="crumbs"></bread-crumb>
5 5
             <div style="display:flex;align-items:center">
6
-                <!-- <el-button type="primary" @click="setting">设置</el-button> -->
6
+                <el-button type="primary" @click="setting">设置</el-button>
7 7
                 <el-button type="primary" @click="DeleteStaffSchedule">清除</el-button>
8 8
                 <el-button type="primary" @click="copyStaffSchedule">复制</el-button>
9 9
                 <el-button type="primary" icon="el-icon-printer" @click="toPrint">打印</el-button>
@@ -214,7 +214,7 @@
214 214
                     <el-tabs v-model="activeName">
215 215
                         <el-tab-pane label="护士" name="nurse">
216 216
                             <el-table
217
-                                :data="nurseList"
217
+                                :data="nurseTableData"
218 218
                                 border
219 219
                                 height="250"
220 220
                                 style="width: 100%">
@@ -262,7 +262,7 @@
262 262
 
263 263
                         <el-tab-pane label="医生" name="doctor">
264 264
                             <el-table
265
-                                :data="doctorList"
265
+                                :data="doctorTableData"
266 266
                                 border
267 267
                                 height="250"
268 268
                                 style="width: 100%">
@@ -333,6 +333,7 @@
333 333
 const moment = require('moment')
334 334
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
335 335
 import { getDoctorList,getScheduleList,addSchedule,getStaffScheduleList,getNextWeekList,getScheduleByDoctorId,toSearchScheduleList,DeleteStaffSchedule,copyStaffSchedule,UpdateContinusSchedule,SaveNurseSort,SaveIsSchedule } from '@/api/doctorSchedule'
336
+import { constants } from 'crypto'
336 337
 export default {
337 338
     components:{
338 339
         BreadCrumb
@@ -391,28 +392,11 @@ export default {
391 392
            arrSeven:[],
392 393
 
393 394
            //
394
-           nurseTableData: [{
395
-            date: '2016-05-02',
396
-            name: '王小虎',
397
-            address: '上海市普陀区金沙江路 1518 弄'
398
-            }, {
399
-            date: '2016-05-04',
400
-            name: '王小虎',
401
-            address: '上海市普陀区金沙江路 1517 弄'
402
-            }, {
403
-            date: '2016-05-01',
404
-            name: '王小虎',
405
-            address: '上海市普陀区金沙江路 1519 弄'
406
-            }, {
407
-            date: '2016-05-03',
408
-            name: '王小虎',
409
-            address: '上海市普陀区金沙江路 1516 弄'
410
-            }],
411 395
             nurseVisible:false,
412 396
             activeName:'nurse',
413 397
             radio:'1',
414
-            nurseList:[],
415
-            doctorList:[],
398
+            nurseTableData:[],
399
+            doctorTableData:[],
416 400
         }
417 401
     },
418 402
     methods:{
@@ -428,26 +412,33 @@ export default {
428 412
                 if(response.data.state == 1){
429 413
                     var list =  response.data.data.list
430 414
                     console.log("医护列表",list)
431
-                    this.tableData = list
432
-                    this.doctorlist = list
415
+                    // this.tableData = list
416
+                    // let arr = []
417
+                    // list.map(item => {
418
+                    //     if(item.is_sort == 1){
419
+                    //         arr.push(item)
420
+                    //     }
421
+                    // })
422
+                    // this.doctorlist = arr
433 423
                     //获取班种列表
434 424
                     this.getStaffScheduleList()
435 425
 
436
-                    // var doctorlist =  response.data.data.doctorlist
437
-                    // for(let i=0;i<doctorlist.length;i++){
438
-                    //    if(doctorlist[i].sort == 0){
439
-                    //       doctorlist[i].sort = ""
440
-                    //    }
441
-                    // }
442
-                    // console.log('doctorlist',doctorlist)
443
-                    // this.doctorList = doctorlist
444
-                    // var nurselist = response.data.data.nurselist
445
-                    // for(let i=0;i<nurselist.length;i++){
446
-                    //    if(nurselist[i].sort == 0){
447
-                    //        nurselist[i].sort = ""
448
-                    //    }
449
-                    // }
450
-                    // this.nurseList = nurselist
426
+                    var doctorlist =  response.data.data.doctorlist
427
+                    let arr = []
428
+                    for(let i=0;i<doctorlist.length;i++){
429
+                        if(doctorlist[i].sort == 0){
430
+                          doctorlist[i].sort = ""
431
+                        }
432
+                    }
433
+                    console.log('doctorlist',doctorlist)
434
+                    this.doctorTableData = doctorlist
435
+                    var nurselist = response.data.data.nurselist
436
+                    for(let i=0;i<nurselist.length;i++){
437
+                        if(nurselist[i].sort == 0){
438
+                           nurselist[i].sort = ""
439
+                        }
440
+                    }
441
+                    this.nurseTableData = nurselist
451 442
                 }
452 443
             })
453 444
         },
@@ -852,7 +843,8 @@ export default {
852 843
                                 user_name: staffList[i].user_name,
853 844
                                 admin_user_id:staffList[i].admin_user_id,
854 845
                                 user_type:staffList[i].doctor_type,
855
-                                user_type:staffList[i].doctor_type,
846
+                                is_sort:staffList[i].is_sort,
847
+                                sort:staffList[i].sort,
856 848
                                 list: [{class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes}]
857 849
                             })
858 850
                             tempArr.push(staffList[i].user_name);
@@ -864,17 +856,65 @@ export default {
864 856
                             }
865 857
                         }
866 858
                     }
859
+
867 860
                     let arr = [...newArr]
868
-                    arr.sort(this.compare('admin_user_id'))
869
-                    this.doctorlist.sort(this.compare('admin_user_id'))
870
-                    this.doctorlist.forEach((item, index) => {
871
-                      if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
861
+                    let newNurse = []
862
+                    let newDoctor = []
863
+                    arr.map(item => {
864
+                        if(item.user_type == 2){
865
+                            newDoctor.push(item)
866
+                        }
867
+                        if(item.user_type == 3){
868
+                            newNurse.push(item)
869
+                        }
870
+                    })
871
+                    //护士
872
+                    newNurse.sort(this.compare('admin_user_id'))
873
+                    let newNurseTableData = []
874
+                    this.nurseTableData.map(item => {
875
+                        if(item.is_sort == 1){
876
+                            newNurseTableData.push(item)
877
+                        }
878
+                    })
879
+                    newNurseTableData.sort(this.compare('admin_user_id'))
880
+                    newNurseTableData.map((item,index) => {
881
+                        if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
872 882
                     
873
-                      }else{
874
-                        arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
875
-                      }
883
+                        }else{
884
+                            newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
885
+                        }
886
+                    })
887
+                    newNurse.sort(this.compare('sort'))
888
+
889
+                    //医生
890
+                    newDoctor.sort(this.compare('admin_user_id'))
891
+                    let newDoctorTableData = []
892
+                    this.doctorTableData.map(item => {
893
+                        if(item.is_sort == 1){
894
+                            newDoctorTableData.push(item)
895
+                        }
876 896
                     })
877
-                    arr.sort(this.compare('user_type'))
897
+                    newDoctorTableData.sort(this.compare('admin_user_id'))
898
+                    newDoctorTableData.map((item,index) => {
899
+                        if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
900
+                    
901
+                        }else{
902
+                            newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
903
+                        }
904
+                    })
905
+                    newDoctor.sort(this.compare('sort'))
906
+
907
+
908
+                    // arr.sort(this.compare('admin_user_id'))
909
+                    // this.doctorlist.sort(this.compare('admin_user_id'))
910
+                    // this.doctorlist.forEach((item, index) => {
911
+                    //   if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
912
+                    
913
+                    //   }else{
914
+                    //     arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
915
+                    //   }
916
+                    // })
917
+                    // arr.sort(this.compare('user_type'))
878 918
                     
879 919
                     let arr2 = []
880 920
                     arr2.push({class_name:oneStr,schedule_week:1})
@@ -890,7 +930,12 @@ export default {
890 930
                     obj.user_type = 10
891 931
                     obj.list = arr2
892 932
                     arr.push(obj)
893
-                    this.tableData = arr
933
+
934
+                    let data = []
935
+                    data.push(...newNurse)
936
+                    data.push(...newDoctor)
937
+                    data.push(obj)
938
+                    this.tableData = data
894 939
         
895 940
                 
896 941
                 }
@@ -1160,33 +1205,83 @@ export default {
1160 1205
                     let tempArr = [], newArr = []
1161 1206
                     for (let i = 0; i < staffList.length; i++) {
1162 1207
                         if (tempArr.indexOf(staffList[i].user_name) === -1) {
1163
-                        newArr.push({
1164
-                            user_name: staffList[i].user_name,
1165
-                            admin_user_id:staffList[i].admin_user_id,
1166
-                            user_type:staffList[i].doctor_type,
1167
-                            list: [{class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes}]
1168
-                        })
1169
-                        tempArr.push(staffList[i].user_name);
1208
+                            newArr.push({
1209
+                                user_name: staffList[i].user_name,
1210
+                                admin_user_id:staffList[i].admin_user_id,
1211
+                                user_type:staffList[i].doctor_type,
1212
+                                is_sort:staffList[i].is_sort,
1213
+                                sort:staffList[i].sort,
1214
+                                list: [{class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes}]
1215
+                            })
1216
+                            tempArr.push(staffList[i].user_name);
1170 1217
                         } else {
1171
-                        for (let j = 0; j < newArr.length; j++) {
1172
-                            if (newArr[j].user_name == staffList[i].user_name) {
1173
-                            newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes})
1218
+                            for (let j = 0; j < newArr.length; j++) {
1219
+                                if (newArr[j].user_name == staffList[i].user_name) {
1220
+                                    newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes})
1221
+                                }
1174 1222
                             }
1175 1223
                         }
1176
-                        }
1177 1224
                     }
1225
+                    
1178 1226
                     let arr = [...newArr]
1179
-                    arr.sort(this.compare('admin_user_id'))
1180
-                    this.doctorlist.sort(this.compare('admin_user_id'))
1181
-                    this.doctorlist.forEach((item, index) => {
1182
-                      if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
1227
+                    let newNurse = []
1228
+                    let newDoctor = []
1229
+                    arr.map(item => {
1230
+                        if(item.user_type == 2){
1231
+                            newDoctor.push(item)
1232
+                        }
1233
+                        if(item.user_type == 3){
1234
+                            newNurse.push(item)
1235
+                        }
1236
+                    })
1237
+                    //护士
1238
+                    newNurse.sort(this.compare('admin_user_id'))
1239
+                    let newNurseTableData = []
1240
+                    this.nurseTableData.map(item => {
1241
+                        if(item.is_sort == 1){
1242
+                            newNurseTableData.push(item)
1243
+                        }
1244
+                    })
1245
+                    newNurseTableData.sort(this.compare('admin_user_id'))
1246
+                    newNurseTableData.map((item,index) => {
1247
+                        if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
1248
+                    
1249
+                        }else{
1250
+                            newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
1251
+                        }
1252
+                    })
1253
+                    newNurse.sort(this.compare('sort'))
1254
+
1255
+                    //医生
1256
+                    newDoctor.sort(this.compare('admin_user_id'))
1257
+                    let newDoctorTableData = []
1258
+                    this.doctorTableData.map(item => {
1259
+                        if(item.is_sort == 1){
1260
+                            newDoctorTableData.push(item)
1261
+                        }
1262
+                    })
1263
+                    newDoctorTableData.sort(this.compare('admin_user_id'))
1264
+                    newDoctorTableData.map((item,index) => {
1265
+                        if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
1183 1266
                     
1184
-                      }else{
1185
-                        arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
1186
-                        // console.log("arr",arr)
1187
-                      }
1267
+                        }else{
1268
+                            newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
1269
+                        }
1188 1270
                     })
1189
-                    arr.sort(this.compare('user_type'))
1271
+                    newDoctor.sort(this.compare('sort'))
1272
+
1273
+
1274
+                    // arr.sort(this.compare('admin_user_id'))
1275
+                    // this.doctorlist.sort(this.compare('admin_user_id'))
1276
+                    // this.doctorlist.forEach((item, index) => {
1277
+                    //   if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
1278
+                    
1279
+                    //   }else{
1280
+                    //     arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
1281
+                    //   }
1282
+                    // })
1283
+                    // arr.sort(this.compare('user_type'))
1284
+                    
1190 1285
                     let arr2 = []
1191 1286
                     arr2.push({class_name:oneStr,schedule_week:1})
1192 1287
                     arr2.push({class_name:twoStr,schedule_week:2})
@@ -1196,12 +1291,17 @@ export default {
1196 1291
                     arr2.push({class_name:sixStr,schedule_week:6})
1197 1292
                     arr2.push({class_name:zeroStr,schedule_week:0})
1198 1293
                     var obj = {}
1199
-                     obj.admin_user_id = "1000000"
1200
-                     obj.user_name = "合计"
1201
-                     obj.user_type = 10
1202
-                     obj.list = arr2
1203
-                     arr.push(obj)
1204
-                    this.tableData = arr
1294
+                    obj.admin_user_id = "1000000"
1295
+                    obj.user_name = "合计"
1296
+                    obj.user_type = 10
1297
+                    obj.list = arr2
1298
+                    arr.push(obj)
1299
+
1300
+                    let data = []
1301
+                    data.push(...newNurse)
1302
+                    data.push(...newDoctor)
1303
+                    data.push(obj)
1304
+                    this.tableData = data
1205 1305
                 }
1206 1306
             })
1207 1307
         },
@@ -1221,75 +1321,114 @@ export default {
1221 1321
                     for (let i = 0; i < staffList.length; i++) {
1222 1322
                         if (tempArr.indexOf(staffList[i].user_name) === -1) {
1223 1323
                             newArr.push({
1224
-                                user_type:staffList[i].doctor_type,
1225 1324
                                 user_name: staffList[i].user_name,
1226 1325
                                 admin_user_id:staffList[i].admin_user_id,
1227
-                                list: [{class_name:staffList[i].class_name,schedule_week:staffList[i].schedule_week}]
1326
+                                user_type:staffList[i].doctor_type,
1327
+                                is_sort:staffList[i].is_sort,
1328
+                                sort:staffList[i].sort,
1329
+                                list: [{class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes}]
1228 1330
                             })
1229 1331
                             tempArr.push(staffList[i].user_name);
1230 1332
                         } else {
1231 1333
                             for (let j = 0; j < newArr.length; j++) {
1232 1334
                                 if (newArr[j].user_name == staffList[i].user_name) {
1233
-                                    newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week, user_type:staffList[i].doctor_type})
1335
+                                    newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes})
1234 1336
                                 }
1235 1337
                             }
1236 1338
                         }
1237 1339
                     }
1238 1340
 
1341
+                    let arr = [...newArr]
1342
+                    let newNurse = []
1343
+                    let newDoctor = []
1344
+                    arr.map(item => {
1345
+                        if(item.user_type == 2){
1346
+                            newDoctor.push(item)
1347
+                        }
1348
+                        if(item.user_type == 3){
1349
+                            newNurse.push(item)
1350
+                        }
1351
+                    })
1352
+
1239 1353
                     if(id == 0){
1240
-                        let arr = [...newArr]
1241
-                        arr.sort(this.compare('admin_user_id'))
1242
-                        this.doctorlist.sort(this.compare('admin_user_id'))
1243
-                        this.doctorlist.forEach((item, index) => {
1244
-                          if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
1354
+                        //护士
1355
+                        newNurse.sort(this.compare('admin_user_id'))
1356
+                        let newNurseTableData = []
1357
+                        this.nurseTableData.map(item => {
1358
+                            if(item.is_sort == 1){
1359
+                                newNurseTableData.push(item)
1360
+                            }
1361
+                        })
1362
+                        newNurseTableData.sort(this.compare('admin_user_id'))
1363
+                        newNurseTableData.map((item,index) => {
1364
+                            if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
1245 1365
                         
1246
-                          }else{
1247
-                            arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
1248
-                            // console.log("arr",arr)
1249
-                          }
1366
+                            }else{
1367
+                                newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
1368
+                            }
1250 1369
                         })
1251
-                        arr.sort(this.compare('user_type'))
1252
-                        this.tableData = arr
1370
+                        newNurse.sort(this.compare('sort'))
1371
+
1372
+                        //医生
1373
+                        newDoctor.sort(this.compare('admin_user_id'))
1374
+                        let newDoctorTableData = []
1375
+                        this.doctorTableData.map(item => {
1376
+                            if(item.is_sort == 1){
1377
+                                newDoctorTableData.push(item)
1378
+                            }
1379
+                        })
1380
+                        newDoctorTableData.sort(this.compare('admin_user_id'))
1381
+                        newDoctorTableData.map((item,index) => {
1382
+                            if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
1383
+                        
1384
+                            }else{
1385
+                                newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
1386
+                            }
1387
+                        })
1388
+                        newDoctor.sort(this.compare('sort'))
1389
+                        
1390
+                        let data = []
1391
+                        data.push(...newNurse)
1392
+                        data.push(...newDoctor)
1393
+                        this.tableData = data
1253 1394
                     }
1254 1395
                     if(id == 2){
1255
-                        let arr = [...newArr]
1256
-                        arr.sort(this.compare('admin_user_id'))
1257
-                        this.doctorlist.sort(this.compare('admin_user_id'))
1258
-                        let newDoctor = []
1259
-                        this.doctorlist.map(item => {
1260
-                        if (item.user_type == 2) {
1261
-                            newDoctor.push(item)
1262
-                        }
1396
+                        newDoctor.sort(this.compare('admin_user_id'))
1397
+                        let newDoctorTableData = []
1398
+                        this.doctorTableData.map(item => {
1399
+                            if(item.is_sort == 1){
1400
+                                newDoctorTableData.push(item)
1401
+                            }
1263 1402
                         })
1264
-                        newDoctor.map((item, index) => {
1265
-                        if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
1403
+                        newDoctorTableData.sort(this.compare('admin_user_id'))
1404
+                        newDoctorTableData.map((item,index) => {
1405
+                            if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
1266 1406
                         
1267
-                          }else{
1268
-                            arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: []})
1269
-                            // console.log("arr",arr)
1270
-                          }
1407
+                            }else{
1408
+                                newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
1409
+                            }
1271 1410
                         })
1272
-                        this.tableData = arr
1411
+                        newDoctor.sort(this.compare('sort'))
1412
+                        this.tableData = newDoctor
1273 1413
                     }
1274 1414
                     if(id == 3){
1275
-                        let arr = [...newArr]
1276
-                        arr.sort(this.compare('admin_user_id'))
1277
-                        this.doctorlist.sort(this.compare('admin_user_id'))
1278
-                        let newDoctor = []
1279
-                        this.doctorlist.map(item => {
1280
-                        if (item.user_type == 3) {
1281
-                            newDoctor.push(item)
1282
-                        }
1415
+                        newNurse.sort(this.compare('admin_user_id'))
1416
+                        let newNurseTableData = []
1417
+                        this.nurseTableData.map(item => {
1418
+                            if(item.is_sort == 1){
1419
+                                newNurseTableData.push(item)
1420
+                            }
1283 1421
                         })
1284
-                        newDoctor.map((item, index) => {
1285
-                        if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
1422
+                        newNurseTableData.sort(this.compare('admin_user_id'))
1423
+                        newNurseTableData.map((item,index) => {
1424
+                            if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
1286 1425
                         
1287
-                          }else{
1288
-                            arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: []})
1289
-                            // console.log("arr",arr)
1290
-                          }
1426
+                            }else{
1427
+                                newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
1428
+                            }
1291 1429
                         })
1292
-                        this.tableData = arr
1430
+                        newNurse.sort(this.compare('sort'))
1431
+                        this.tableData = newNurse
1293 1432
                     }
1294 1433
 
1295 1434
             }

+ 371 - 320
src/xt_pages/medicalScheduling/medical_print.vue View File

@@ -79,6 +79,9 @@ export default {
79 79
           arrSix:[],
80 80
           arrSeven:[],
81 81
           typevalue:0,
82
+          
83
+          doctorTableData:[],
84
+          nurseTableData:[]
82 85
         }
83 86
     },
84 87
     methods:{
@@ -98,352 +101,400 @@ export default {
98 101
           var list =  response.data.data.list
99 102
           this.doctorlist = list
100 103
           this.getScheduleByDoctorId()
104
+
105
+          //
106
+          var doctorlist =  response.data.data.doctorlist
107
+          let arr = []
108
+          for(let i=0;i<doctorlist.length;i++){
109
+              if(doctorlist[i].sort == 0){
110
+                doctorlist[i].sort = ""
111
+              }
112
+          }
113
+          console.log('doctorlist',doctorlist)
114
+          this.doctorTableData = doctorlist
115
+          var nurselist = response.data.data.nurselist
116
+          for(let i=0;i<nurselist.length;i++){
117
+              if(nurselist[i].sort == 0){
118
+                  nurselist[i].sort = ""
119
+              }
120
+          }
121
+          this.nurseTableData = nurselist
101 122
         })
102 123
       },
103 124
       //获取本周的所有排班列表
104 125
       getScheduleByDoctorId(){
105
-          const params = {
106
-            start_time:this.start_time,
107
-            end_time:this.end_time,
108
-            doctor_id:this.typevalue,
109
-         }
110
-         console.log("parasm",params)
111
-         getScheduleByDoctorId(params).then(response=>{
112
-            if(response.data.state == 1){
126
+        const params = {
127
+          start_time:this.start_time,
128
+          end_time:this.end_time,
129
+          doctor_id:this.typevalue,
130
+        }
131
+        console.log("parasm",params)
132
+        getScheduleByDoctorId(params).then(response=>{
133
+          if(response.data.state == 1){
113 134
               var staffList = response.data.data.staffList
114
-               console.log("stafflist",staffList)
135
+              console.log("stafflist",staffList)
115 136
 
116
-                   var sevenStr = ""
117
-                    var oneStr = ""
118
-                    var twoStr = ""
119
-                    var threeStr = ""
120
-                    var fourStr = ""
121
-                    var fiveStr = ""
122
-                    var sixStr = ""
123
-                    for(let i=0;i<staffList.length;i++){
124
-                    if(staffList[i].schedule_week == 0){
125
-                        staffList[i].class_index = 0
126
-                         var arr = []
127
-                        this.arrZero.push(staffList[i].class_name)
128
-                        for(let i=0;i<this.arrZero.length;i++){
129
-                           if(this.arrZero[i]!=''){
130
-                              arr.push(this.arrZero[i])
131
-                           }
132
-                        }
133
-                        var countedNames = arr.reduce(function (allNames, name) { 
134
-                            if (name in allNames) {
135
-                                allNames[name]++;
136
-                            }
137
-                            else {
138
-                                allNames[name] = 1;
139
-                            }
140
-                            return allNames;
141
-                        }, {});
142
-                        let objKey = Object.keys(countedNames)
143
-                        let objVal = Object.values(countedNames)
144
-                        var zeroStr = ''
145
-                        objKey.map((item,index) => {
146
-                        let objVal = Object.values(countedNames)
147
-                            zeroStr += item + objVal[index] + '\n'
148
-                        })
149
-                        sevenStr = zeroStr
150
-                    }
151
-                    if(staffList[i].schedule_week == 1){
152
-                        staffList[i].class_index = 1
153
-                        var arr = []
154
-                        this.arrOne.push(staffList[i].class_name)
155
-                        for(let i=0;i<this.arrOne.length;i++){
156
-                           if(this.arrOne[i]!=''){
157
-                              arr.push(this.arrOne[i])
158
-                           }
159
-                        }
160
-                        var countedNames = arr.reduce(function (allNames, name) { 
161
-                            if (name in allNames) {
162
-                                allNames[name]++;
163
-                            }
164
-                            else {
165
-                                allNames[name] = 1;
166
-                            }
167
-                            return allNames;
168
-                        }, {});
169
-                        let objKey = Object.keys(countedNames)
170
-                        let objVal = Object.values(countedNames)
171
-                        let strOne = ''
172
-                        objKey.map((item,index) => {
173
-                        let objVal = Object.values(countedNames)
174
-                            strOne += item + objVal[index] + '\n'
175
-                        })
176
-                        oneStr  = strOne
177
-                    }
178
-                    if(staffList[i].schedule_week == 2){
179
-                        staffList[i].class_index = 2
180
-                         var arr = []
181
-                        this.arrTwo.push(staffList[i].class_name)
182
-                        for(let i=0;i<this.arrTwo.length;i++){
183
-                           if(this.arrTwo[i]!=''){
184
-                              arr.push(this.arrTwo[i])
185
-                           }
186
-                        }
187
-                        var countedNames = arr.reduce(function (allNames, name) { 
188
-                            if (name in allNames) {
189
-                                allNames[name]++;
190
-                            }
191
-                            else {
192
-                                allNames[name] = 1;
193
-                            }
194
-                            return allNames;
195
-                        }, {});
196
-                        let objKey = Object.keys(countedNames)
197
-                        let objVal = Object.values(countedNames)
198
-                        let strTwo = ''
199
-                        objKey.map((item,index) => {
200
-                        let objVal = Object.values(countedNames)
201
-                            strTwo += item + objVal[index] + '\n'
202
-                        })
203
-                         twoStr = strTwo
204
-                    }
205
-                    if(staffList[i].schedule_week == 3){
206
-                        staffList[i].class_index = 3
207
-                         var arr = []
208
-                        this.arrThree.push(staffList[i].class_name)
209
-                        for(let i=0;i<this.arrThree.length;i++){
210
-                           if(this.arrThree[i]!=''){
211
-                              arr.push(this.arrThree[i])
212
-                           }
213
-                        }
214
-                        var countedNames = arr.reduce(function (allNames, name) { 
215
-                            if (name in allNames) {
216
-                                allNames[name]++;
217
-                            }
218
-                            else {
219
-                                allNames[name] = 1;
220
-                            }
221
-                            return allNames;
222
-                        }, {});
223
-                        let objKey = Object.keys(countedNames)
224
-                        let objVal = Object.values(countedNames)
225
-                        let strThree = ''
226
-                        objKey.map((item,index) => {
227
-                        let objVal = Object.values(countedNames)
228
-                            strThree += item + objVal[index] + '\n'
229
-                        })
230
-                        threeStr = strThree
231
-                    }
232
-                    if(staffList[i].schedule_week == 4){
233
-                        staffList[i].class_index = 4
234
-                        var arr = []
235
-                        this.arrFour.push(staffList[i].class_name)
236
-                        for(let i=0;i<this.arrFour.length;i++){
237
-                           if(this.arrFour[i]!=''){
238
-                              arr.push(this.arrFour[i])
239
-                           }
240
-                        }
241
-                        var countedNames = arr.reduce(function (allNames, name) { 
242
-                            if (name in allNames) {
243
-                                allNames[name]++;
244
-                            }
245
-                            else {
246
-                                allNames[name] = 1;
247
-                            }
248
-                            return allNames;
249
-                        }, {});
250
-                        let objKey = Object.keys(countedNames)
251
-                        let objVal = Object.values(countedNames)
252
-                        let strFour = ''
253
-                        objKey.map((item,index) => {
254
-                        let objVal = Object.values(countedNames)
255
-                            strFour += item + objVal[index] + '\n'
256
-                        })
257
-                        fourStr = strFour
258
-                    }
259
-                    if(staffList[i].schedule_week == 5){
260
-                        staffList[i].class_index = 5
137
+              var sevenStr = ""
138
+              var oneStr = ""
139
+              var twoStr = ""
140
+              var threeStr = ""
141
+              var fourStr = ""
142
+              var fiveStr = ""
143
+              var sixStr = ""
144
+              for(let i=0;i<staffList.length;i++){
145
+              if(staffList[i].schedule_week == 0){
146
+                  staffList[i].class_index = 0
147
+                    var arr = []
148
+                  this.arrZero.push(staffList[i].class_name)
149
+                  for(let i=0;i<this.arrZero.length;i++){
150
+                      if(this.arrZero[i]!=''){
151
+                        arr.push(this.arrZero[i])
152
+                      }
153
+                  }
154
+                  var countedNames = arr.reduce(function (allNames, name) { 
155
+                      if (name in allNames) {
156
+                          allNames[name]++;
157
+                      }
158
+                      else {
159
+                          allNames[name] = 1;
160
+                      }
161
+                      return allNames;
162
+                  }, {});
163
+                  let objKey = Object.keys(countedNames)
164
+                  let objVal = Object.values(countedNames)
165
+                  var zeroStr = ''
166
+                  objKey.map((item,index) => {
167
+                  let objVal = Object.values(countedNames)
168
+                      zeroStr += item + objVal[index] + '\n'
169
+                  })
170
+                  sevenStr = zeroStr
171
+              }
172
+              if(staffList[i].schedule_week == 1){
173
+                  staffList[i].class_index = 1
174
+                  var arr = []
175
+                  this.arrOne.push(staffList[i].class_name)
176
+                  for(let i=0;i<this.arrOne.length;i++){
177
+                      if(this.arrOne[i]!=''){
178
+                        arr.push(this.arrOne[i])
179
+                      }
180
+                  }
181
+                  var countedNames = arr.reduce(function (allNames, name) { 
182
+                      if (name in allNames) {
183
+                          allNames[name]++;
184
+                      }
185
+                      else {
186
+                          allNames[name] = 1;
187
+                      }
188
+                      return allNames;
189
+                  }, {});
190
+                  let objKey = Object.keys(countedNames)
191
+                  let objVal = Object.values(countedNames)
192
+                  let strOne = ''
193
+                  objKey.map((item,index) => {
194
+                  let objVal = Object.values(countedNames)
195
+                      strOne += item + objVal[index] + '\n'
196
+                  })
197
+                  oneStr  = strOne
198
+              }
199
+              if(staffList[i].schedule_week == 2){
200
+                  staffList[i].class_index = 2
201
+                    var arr = []
202
+                  this.arrTwo.push(staffList[i].class_name)
203
+                  for(let i=0;i<this.arrTwo.length;i++){
204
+                      if(this.arrTwo[i]!=''){
205
+                        arr.push(this.arrTwo[i])
206
+                      }
207
+                  }
208
+                  var countedNames = arr.reduce(function (allNames, name) { 
209
+                      if (name in allNames) {
210
+                          allNames[name]++;
211
+                      }
212
+                      else {
213
+                          allNames[name] = 1;
214
+                      }
215
+                      return allNames;
216
+                  }, {});
217
+                  let objKey = Object.keys(countedNames)
218
+                  let objVal = Object.values(countedNames)
219
+                  let strTwo = ''
220
+                  objKey.map((item,index) => {
221
+                  let objVal = Object.values(countedNames)
222
+                      strTwo += item + objVal[index] + '\n'
223
+                  })
224
+                    twoStr = strTwo
225
+              }
226
+              if(staffList[i].schedule_week == 3){
227
+                  staffList[i].class_index = 3
228
+                    var arr = []
229
+                  this.arrThree.push(staffList[i].class_name)
230
+                  for(let i=0;i<this.arrThree.length;i++){
231
+                      if(this.arrThree[i]!=''){
232
+                        arr.push(this.arrThree[i])
233
+                      }
234
+                  }
235
+                  var countedNames = arr.reduce(function (allNames, name) { 
236
+                      if (name in allNames) {
237
+                          allNames[name]++;
238
+                      }
239
+                      else {
240
+                          allNames[name] = 1;
241
+                      }
242
+                      return allNames;
243
+                  }, {});
244
+                  let objKey = Object.keys(countedNames)
245
+                  let objVal = Object.values(countedNames)
246
+                  let strThree = ''
247
+                  objKey.map((item,index) => {
248
+                  let objVal = Object.values(countedNames)
249
+                      strThree += item + objVal[index] + '\n'
250
+                  })
251
+                  threeStr = strThree
252
+              }
253
+              if(staffList[i].schedule_week == 4){
254
+                  staffList[i].class_index = 4
255
+                  var arr = []
256
+                  this.arrFour.push(staffList[i].class_name)
257
+                  for(let i=0;i<this.arrFour.length;i++){
258
+                      if(this.arrFour[i]!=''){
259
+                        arr.push(this.arrFour[i])
260
+                      }
261
+                  }
262
+                  var countedNames = arr.reduce(function (allNames, name) { 
263
+                      if (name in allNames) {
264
+                          allNames[name]++;
265
+                      }
266
+                      else {
267
+                          allNames[name] = 1;
268
+                      }
269
+                      return allNames;
270
+                  }, {});
271
+                  let objKey = Object.keys(countedNames)
272
+                  let objVal = Object.values(countedNames)
273
+                  let strFour = ''
274
+                  objKey.map((item,index) => {
275
+                  let objVal = Object.values(countedNames)
276
+                      strFour += item + objVal[index] + '\n'
277
+                  })
278
+                  fourStr = strFour
279
+              }
280
+              if(staffList[i].schedule_week == 5){
281
+                  staffList[i].class_index = 5
261 282
 
262
-                         var arr = []
263
-                        this.arrFive.push(staffList[i].class_name)
264
-                        for(let i=0;i<this.arrFive.length;i++){
265
-                           if(this.arrFive[i]!=''){
266
-                              arr.push(this.arrFive[i])
267
-                           }
268
-                        }
269
-                        var countedNames = arr.reduce(function (allNames, name) { 
270
-                            if (name in allNames) {
271
-                                allNames[name]++;
272
-                            }
273
-                            else {
274
-                                allNames[name] = 1;
275
-                            }
276
-                            return allNames;
277
-                        }, {});
278
-                        let objKey = Object.keys(countedNames)
279
-                        let objVal = Object.values(countedNames)
280
-                        let strFive = ''
281
-                        objKey.map((item,index) => {
282
-                        let objVal = Object.values(countedNames)
283
-                            strFive += item + objVal[index] + '\n'
284
-                        })
285
-                         fiveStr = strFive
286
-                    }
287
-                    if(staffList[i].schedule_week == 6){
288
-                        staffList[i].class_index = 6
289
-                         var arr = []
290
-                        this.arrSix.push(staffList[i].class_name)
291
-                        for(let i=0;i<this.arrSix.length;i++){
292
-                           if(this.arrSix[i]!=''){
293
-                              arr.push(this.arrSix[i])
294
-                           }
295
-                        }
296
-                        var countedNames = arr.reduce(function (allNames, name) { 
297
-                            if (name in allNames) {
298
-                                allNames[name]++;
299
-                            }
300
-                            else {
301
-                                allNames[name] = 1;
302
-                            }
303
-                            return allNames;
304
-                        }, {});
305
-                        let objKey = Object.keys(countedNames)
306
-                        let objVal = Object.values(countedNames)
307
-                        let strSix = ''
308
-                        objKey.map((item,index) => {
309
-                        let objVal = Object.values(countedNames)
310
-                            strSix += item + objVal[index] + '\n'
311
-                        })
312
-                        sixStr = strSix
313
-                     }
314
-                    }
283
+                    var arr = []
284
+                  this.arrFive.push(staffList[i].class_name)
285
+                  for(let i=0;i<this.arrFive.length;i++){
286
+                      if(this.arrFive[i]!=''){
287
+                        arr.push(this.arrFive[i])
288
+                      }
289
+                  }
290
+                  var countedNames = arr.reduce(function (allNames, name) { 
291
+                      if (name in allNames) {
292
+                          allNames[name]++;
293
+                      }
294
+                      else {
295
+                          allNames[name] = 1;
296
+                      }
297
+                      return allNames;
298
+                  }, {});
299
+                  let objKey = Object.keys(countedNames)
300
+                  let objVal = Object.values(countedNames)
301
+                  let strFive = ''
302
+                  objKey.map((item,index) => {
303
+                  let objVal = Object.values(countedNames)
304
+                      strFive += item + objVal[index] + '\n'
305
+                  })
306
+                    fiveStr = strFive
307
+              }
308
+              if(staffList[i].schedule_week == 6){
309
+                  staffList[i].class_index = 6
310
+                    var arr = []
311
+                  this.arrSix.push(staffList[i].class_name)
312
+                  for(let i=0;i<this.arrSix.length;i++){
313
+                      if(this.arrSix[i]!=''){
314
+                        arr.push(this.arrSix[i])
315
+                      }
316
+                  }
317
+                  var countedNames = arr.reduce(function (allNames, name) { 
318
+                      if (name in allNames) {
319
+                          allNames[name]++;
320
+                      }
321
+                      else {
322
+                          allNames[name] = 1;
323
+                      }
324
+                      return allNames;
325
+                  }, {});
326
+                  let objKey = Object.keys(countedNames)
327
+                  let objVal = Object.values(countedNames)
328
+                  let strSix = ''
329
+                  objKey.map((item,index) => {
330
+                  let objVal = Object.values(countedNames)
331
+                      strSix += item + objVal[index] + '\n'
332
+                  })
333
+                  sixStr = strSix
334
+                }
335
+              }
315 336
               let tempArr = [], newArr = []
316 337
               for (let i = 0; i < staffList.length; i++) {
317
-                if(tempArr.indexOf(staffList[i].user_name) === -1) {
338
+                if (tempArr.indexOf(staffList[i].user_name) === -1) {
318 339
                   newArr.push({
319
-                    user_type:staffList[i].doctor_type,
320 340
                     user_name: staffList[i].user_name,
321 341
                     admin_user_id:staffList[i].admin_user_id,
322
-                    list: [{class_name:staffList[i].class_name,schedule_week:staffList[i].schedule_week}]
342
+                    user_type:staffList[i].doctor_type,
343
+                    is_sort:staffList[i].is_sort,
344
+                    sort:staffList[i].sort,
345
+                    list: [{class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes}]
323 346
                   })
324 347
                   tempArr.push(staffList[i].user_name);
325 348
                 } else {
326 349
                   for (let j = 0; j < newArr.length; j++) {
327 350
                     if (newArr[j].user_name == staffList[i].user_name) {
328
-                      newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type})
351
+                      newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes})
329 352
                     }
330 353
                   }
331 354
                 }
332 355
               }
333
-              // let arr = [...newArr]
334
-              // arr.sort(this.compare('admin_user_id'))
335
-              // this.doctorlist.sort(this.compare('admin_user_id'))
336
-              // this.doctorlist.forEach((item, index) => {
337
-              //   if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
338
-              
339
-              //   }else{
340
-              //     arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
341
-              //   }
342
-              // })
343
-              // arr.sort(this.compare('user_type'))
344
-              // console.log("arr======",arr)
345 356
 
346
-                if(this.typevalue == 0){
347
-                   let arr = [...newArr]
348
-                    arr.sort(this.compare('admin_user_id'))
349
-                    this.doctorlist.sort(this.compare('admin_user_id'))
350
-                        this.doctorlist.forEach((item, index) => {
351
-                          if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
352
-                        
353
-                          }else{
354
-                            arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
355
-                            // console.log("arr",arr)
356
-                          }
357
-                        })
358
-                        arr.sort(this.compare('user_type'))
359
-                        let arr2 = []
360
-                          arr2.push({class_name:oneStr,schedule_week:1})
361
-                          arr2.push({class_name:twoStr,schedule_week:2})
362
-                          arr2.push({class_name:threeStr,schedule_week:3})
363
-                          arr2.push({class_name:fourStr,schedule_week:4})
364
-                          arr2.push({class_name:fiveStr,schedule_week:5})
365
-                          arr2.push({class_name:sixStr,schedule_week:6})
366
-                          arr2.push({class_name:zeroStr,schedule_week:0})
367
-                          var obj = {}
368
-                          obj.admin_user_id = "1000000"
369
-                          obj.user_name = "合计"
370
-                          obj.user_type = 10
371
-                          obj.list = arr2
372
-                          arr.push(obj)
373
-                          this.tableData = arr
357
+              let arr = [...newArr]
358
+              let newNurse = []
359
+              let newDoctor = []
360
+              arr.map(item => {
361
+                if(item.user_type == 2){
362
+                  newDoctor.push(item)
363
+                }
364
+                if(item.user_type == 3){
365
+                  newNurse.push(item)
366
+                }
367
+              })
368
+
369
+              if(this.typevalue == 0){
370
+                //护士
371
+                newNurse.sort(this.compare('admin_user_id'))
372
+                let newNurseTableData = []
373
+                this.nurseTableData.map(item => {
374
+                    if(item.is_sort == 1){
375
+                        newNurseTableData.push(item)
376
+                    }
377
+                })
378
+                newNurseTableData.sort(this.compare('admin_user_id'))
379
+                newNurseTableData.map((item,index) => {
380
+                    if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
381
+                
382
+                    }else{
383
+                        newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
384
+                    }
385
+                })
386
+                newNurse.sort(this.compare('sort'))
387
+
388
+                //医生
389
+                newDoctor.sort(this.compare('admin_user_id'))
390
+                let newDoctorTableData = []
391
+                this.doctorTableData.map(item => {
392
+                    if(item.is_sort == 1){
393
+                        newDoctorTableData.push(item)
374 394
                     }
375
-                    if(this.typevalue == 2){
376
-                        let arr = [...newArr]
377
-                        arr.sort(this.compare('admin_user_id'))
378
-                        this.doctorlist.sort(this.compare('admin_user_id'))
379
-                        let newDoctor = []
380
-                        this.doctorlist.map(item => {
381
-                        if (item.user_type == 2) {
382
-                            newDoctor.push(item)
383
-                        }
384
-                        })
385
-                        newDoctor.map((item, index) => {
386
-                        if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
387
-                        
388
-                          }else{
389
-                            arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: []})
390
-                            // console.log("arr",arr)
391
-                          }
392
-                        })
393
-                        let arr2 = []
394
-                          arr2.push({class_name:oneStr,schedule_week:1})
395
-                          arr2.push({class_name:twoStr,schedule_week:2})
396
-                          arr2.push({class_name:threeStr,schedule_week:3})
397
-                          arr2.push({class_name:fourStr,schedule_week:4})
398
-                          arr2.push({class_name:fiveStr,schedule_week:5})
399
-                          arr2.push({class_name:sixStr,schedule_week:6})
400
-                          arr2.push({class_name:zeroStr,schedule_week:0})
401
-                          var obj = {}
402
-                          obj.admin_user_id = "1000000"
403
-                          obj.user_name = "合计"
404
-                          obj.user_type = 10
405
-                          obj.list = arr2
406
-                          arr.push(obj)
407
-                          this.tableData = arr
395
+                })
396
+                newDoctorTableData.sort(this.compare('admin_user_id'))
397
+                newDoctorTableData.map((item,index) => {
398
+                    if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
399
+                
400
+                    }else{
401
+                        newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
402
+                    }
403
+                })
404
+                newDoctor.sort(this.compare('sort'))
405
+                
406
+                
407
+
408
+                let arr2 = []
409
+                arr2.push({class_name:oneStr,schedule_week:1})
410
+                arr2.push({class_name:twoStr,schedule_week:2})
411
+                arr2.push({class_name:threeStr,schedule_week:3})
412
+                arr2.push({class_name:fourStr,schedule_week:4})
413
+                arr2.push({class_name:fiveStr,schedule_week:5})
414
+                arr2.push({class_name:sixStr,schedule_week:6})
415
+                arr2.push({class_name:zeroStr,schedule_week:0})
416
+                var obj = {}
417
+                obj.admin_user_id = "1000000"
418
+                obj.user_name = "合计"
419
+                obj.user_type = 10
420
+                obj.list = arr2
421
+                arr.push(obj)
422
+
423
+                let data = []
424
+                data.push(...newNurse)
425
+                data.push(...newDoctor)
426
+                data.push(obj)
427
+                this.tableData = data
428
+              }
429
+              if(this.typevalue == 2){
430
+                newDoctor.sort(this.compare('admin_user_id'))
431
+                let newDoctorTableData = []
432
+                this.doctorTableData.map(item => {
433
+                    if(item.is_sort == 1){
434
+                        newDoctorTableData.push(item)
408 435
                     }
409
-                    if(this.typevalue == 3){
410
-                        let arr = [...newArr]
411
-                        arr.sort(this.compare('admin_user_id'))
412
-                        this.doctorlist.sort(this.compare('admin_user_id'))
413
-                        let newDoctor = []
414
-                        this.doctorlist.map(item => {
415
-                        if (item.user_type == 3) {
416
-                            newDoctor.push(item)
417
-                        }
418
-                        })
419
-                        newDoctor.map((item, index) => {
420
-                        if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
421
-                        
422
-                          }else{
423
-                            arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: []})
424
-                            // console.log("arr",arr)
425
-                          }
426
-                        })
427
-                          let arr2 = []
428
-                          arr2.push({class_name:oneStr,schedule_week:1})
429
-                          arr2.push({class_name:twoStr,schedule_week:2})
430
-                          arr2.push({class_name:threeStr,schedule_week:3})
431
-                          arr2.push({class_name:fourStr,schedule_week:4})
432
-                          arr2.push({class_name:fiveStr,schedule_week:5})
433
-                          arr2.push({class_name:sixStr,schedule_week:6})
434
-                          arr2.push({class_name:zeroStr,schedule_week:0})
435
-                          var obj = {}
436
-                          obj.admin_user_id = "1000000"
437
-                          obj.user_name = "合计"
438
-                          obj.user_type = 10
439
-                          obj.list = arr2
440
-                          arr.push(obj)
441
-                          this.tableData = arr
436
+                })
437
+                newDoctorTableData.sort(this.compare('admin_user_id'))
438
+                newDoctorTableData.map((item,index) => {
439
+                    if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
440
+                
441
+                    }else{
442
+                        newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
442 443
                     }
443
-            
444
-              
444
+                })
445
+                newDoctor.sort(this.compare('sort'))
446
+                
447
+                let arr2 = []
448
+                arr2.push({class_name:oneStr,schedule_week:1})
449
+                arr2.push({class_name:twoStr,schedule_week:2})
450
+                arr2.push({class_name:threeStr,schedule_week:3})
451
+                arr2.push({class_name:fourStr,schedule_week:4})
452
+                arr2.push({class_name:fiveStr,schedule_week:5})
453
+                arr2.push({class_name:sixStr,schedule_week:6})
454
+                arr2.push({class_name:zeroStr,schedule_week:0})
455
+                var obj = {}
456
+                obj.admin_user_id = "1000000"
457
+                obj.user_name = "合计"
458
+                obj.user_type = 10
459
+                obj.list = arr2
460
+                newDoctor.push(obj)
461
+                this.tableData = newDoctor
462
+              }
463
+              if(this.typevalue == 3){
464
+                newNurse.sort(this.compare('admin_user_id'))
465
+                let newNurseTableData = []
466
+                this.nurseTableData.map(item => {
467
+                    if(item.is_sort == 1){
468
+                        newNurseTableData.push(item)
469
+                    }
470
+                })
471
+                newNurseTableData.sort(this.compare('admin_user_id'))
472
+                newNurseTableData.map((item,index) => {
473
+                    if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
474
+                
475
+                    }else{
476
+                        newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
477
+                    }
478
+                })
479
+                newNurse.sort(this.compare('sort'))
480
+                let arr2 = []
481
+                arr2.push({class_name:oneStr,schedule_week:1})
482
+                arr2.push({class_name:twoStr,schedule_week:2})
483
+                arr2.push({class_name:threeStr,schedule_week:3})
484
+                arr2.push({class_name:fourStr,schedule_week:4})
485
+                arr2.push({class_name:fiveStr,schedule_week:5})
486
+                arr2.push({class_name:sixStr,schedule_week:6})
487
+                arr2.push({class_name:zeroStr,schedule_week:0})
488
+                var obj = {}
489
+                obj.admin_user_id = "1000000"
490
+                obj.user_name = "合计"
491
+                obj.user_type = 10
492
+                obj.list = arr2
493
+                newNurse.push(obj)
494
+                this.tableData = newNurse
495
+              }
445 496
             }
446
-         })
497
+        })
447 498
       },
448 499
       getClass(name,index){
449 500
         if(name != undefined){

+ 232 - 75
src/xt_pages/medicalScheduling/schedulingStatistics.vue View File

@@ -57,17 +57,19 @@
57 57
                     v-model="customTime1"
58 58
                     type="date"
59 59
                     placeholder="选择日期"
60
-                    :picker-options="pickerOptions">
60
+                    :picker-options="pickerOptions"
61
+                    @change="changeTime">
61 62
                     </el-date-picker>-
62 63
                     <el-date-picker
63 64
                     style="width:140px;"
64 65
                     v-model="customTime2"
65 66
                     type="date"
66 67
                     placeholder="选择日期"
67
-                    :picker-options="pickerOptions">
68
+                    :picker-options="pickerOptions"
69
+                    @change="changeTimeTwo">
68 70
                     </el-date-picker>
69 71
                 </div>
70
-                
72
+
71 73
             </div>
72 74
             <div class="tableTitle">统计图</div>
73 75
             <div class="cell clearfix" style="margin:0;">
@@ -78,40 +80,27 @@
78 80
                 <line-chart :options="chart"></line-chart>
79 81
             </div>
80 82
             <div class="tableTitle">统计表</div>
81
-            <el-table
82
-                :data="tableData"
83
-                height="250"
84
-                border
85
-                style="width: 100">
86
-                <el-table-column
87
-                align="center"
88
-                prop="date"
89
-                label="医护姓名"
90
-                width="180">
83
+            <el-table :data="tableData" height="250" border style="width: 100">
84
+                <el-table-column align="center" prop="date" label="医护姓名" width="100">
85
+                    <template slot-scope="scope">
86
+                        <span>{{scope.row.user_name}}</span>
87
+                    </template>
91 88
                 </el-table-column>
92
-                <el-table-column
93
-                 :label="modeItem.class_name"
94
-                 property="number"
95
-                 align="center"
96
-                 min-width="100"
97
-                 v-for="(modeItem, index) in scheduleList"
98
-                 :key="index"
99
-                >
89
+                <el-table-column :label="modeItem.class_name" property="number" align="center" min-width="100" v-for="(modeItem, index) in scheduleList" :key="index">
90
+                    <template slot-scope="scope">
91
+                        <span>{{ getCount(scope.row.doctor_id,modeItem.class_name) }}</span>
92
+                    </template>
100 93
                 </el-table-column>
101
-                <el-table-column
102
-                 align="center"
103
-                 prop="address"
104
-                 label="总工时/小时">
94
+                <el-table-column align="center" prop="address" label="总工时/小时">
95
+                   <template slot-scope="scope">
96
+                        <span v-if="scope.row.totalminute">{{ scope.row.totalminute / 60 }}</span>
97
+                    </template> 
105 98
                 </el-table-column>
106
-                <el-table-column
107
-                 align="center"
108
-                 prop="address"
109
-                 label="出勤/天">
99
+                <el-table-column align="center" prop="attendance" label="出勤/天">
100
+                    <!-- <span v-if='scope.row.attendance'>{{ scope.row.attendance ? scope.row.attendance : '' }}</span> -->
110 101
                 </el-table-column>
111
-                 <el-table-column
112
-                 align="center"
113
-                 prop="address"
114
-                 label="缺勤/天">
102
+                <el-table-column align="center" prop="absence" label="缺勤/天">
103
+                    <!-- <span v-if="scope.row.absence">{{ scope.row.absence ? scope.row.absence : '' }}</span> -->
115 104
                 </el-table-column>
116 105
             </el-table>
117 106
         </div>
@@ -123,7 +112,7 @@
123 112
 import echarts from "echarts";
124 113
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
125 114
 import LineChart from "../qcd/components/LineChart";
126
-import { getScheduleList,getScheduleListTotal }  from '@/api/doctorSchedule'
115
+import {getDoctorList,getScheduleList,getScheduleListTotal,toSearchTotal,changeOption }  from '@/api/doctorSchedule'
127 116
 export default {
128 117
     components:{
129 118
         BreadCrumb,
@@ -263,6 +252,10 @@ export default {
263 252
             },
264 253
             tableData: [],
265 254
             scheduleList:[],
255
+            start_time:0,
256
+            end_time:0,
257
+
258
+            doctorlist:[]
266 259
 
267 260
         }
268 261
     },
@@ -273,39 +266,79 @@ export default {
273 266
         this.weekNum = this.getYearWeek(year,month,date)
274 267
         this.todayDate=this.formatDate(new Date())
275 268
         this.setDate(new Date())
276
-      
277 269
 
278
-      //获取所有排班种
279
-      this.getScheduleList()
280
-  
281
-      //获取统计表的数据
282
-      this.getlist()
270
+        //获取所以医护人员
271
+        this.getDoctorList()
272
+
273
+
274
+        //获取所有排班种
275
+        this.getScheduleList()
276
+    
277
+        // 获取统计表的数据
278
+        this.getlist()
279
+
280
+      
283 281
     },
284 282
     methods:{
285
-        toSearch(){},
286
-        formatDate(date){      
287
-            var year = date.getFullYear()+'.'       
283
+        getDoctorList(){
284
+           getDoctorList().then(response=>{
285
+             if(response.data.state == 1){
286
+                 var list =  response.data.data.list
287
+                 var doctorlist =  response.data.data.doctorlist
288
+                 var nurselist =  response.data.data.nurselist
289
+                 this.doctorlist.push(...nurselist)
290
+                 this.doctorlist.push(...doctorlist)
291
+                 
292
+                 console.log("医护列表",this.doctorlist)
293
+               }
294
+           })
295
+        },
296
+        //搜索
297
+        toSearch(){
298
+            if(this.timeSlot == 1){
299
+               this.start_time = this.getTimestamp(this.weekDayArr[0]),
300
+               this.end_time = this.getTimestamp(this.weekDayArr[6])
301
+            }
302
+            const params = {
303
+              keyword:this.keywords, 
304
+            }
305
+            console.log("params",params)
306
+            toSearchTotal(params).then(response=>{
307
+             if(response.data.state == 1){
308
+                var scheduleTotal = response.data.data.scheduletotal 
309
+                console.log("scheduletotal",scheduleTotal) 
310
+                var list = response.data.data.list
311
+                console.log("list",list)
312
+                var workday = response.data.data.workDay
313
+                console.log("workday",workday)
314
+                var noWorkDay = response.data.data.noWorkDay
315
+                console.log("noworkday",noWorkDay)
316
+              }
317
+          })  
318
+        },
319
+        formatDate(date){
320
+            var year = date.getFullYear()+'.'
288 321
             var month = (date.getMonth()+1)+'.';
289 322
             var day = date.getDate();
290 323
             return year+month+day
291
-        }, 
292
-        addDate(date,n){        
293
-            date.setDate(date.getDate()+n);        
324
+        },
325
+        addDate(date,n){
326
+            date.setDate(date.getDate()+n);
294 327
             return date;
295
-        },  
296
-        setDate(date){           
328
+        },
329
+        setDate(date){
297 330
             var week = date.getDay()-1;
298 331
             date = this.addDate(date,week*-1);
299 332
             this.currentFirstDate = new Date(date);
300 333
             this.currentDate = new Date(date)
301
-            for(var i = 0;i<this.clen; i++){     
334
+            for(var i = 0;i<this.clen; i++){
302 335
                 this.weekDayArr.push(this.formatDate(i==0 ? date : this.addDate(date,1)))
303
-            }         
336
+            }
304 337
         },
305
-        //上一周 
338
+        //上一周
306 339
         lastclick(){
307 340
             this.weekDayArr=[]
308
-            this.setDate(this.addDate(this.currentFirstDate,-7));   
341
+            this.setDate(this.addDate(this.currentFirstDate,-7));
309 342
             if (this.weekNum == 1) {
310 343
                 let year = this.nowYear - 1
311 344
                 let month = 12
@@ -316,8 +349,8 @@ export default {
316 349
             this.weekNum = this.weekNum - 1
317 350
         },
318 351
         //下一周
319
-        nextclick(){ 
320
-            this.weekDayArr=[]                
352
+        nextclick(){
353
+            this.weekDayArr=[]
321 354
             this.setDate(this.addDate(this.currentFirstDate,7));
322 355
             this.weekNum = this.weekNum + 1
323 356
             if (this.weekNum == 53) {
@@ -329,16 +362,16 @@ export default {
329 362
             }
330 363
         },
331 364
         getYearWeek(year,month,date){
332
-            /*  
333
-                dateNow是当前日期 
334
-                dateFirst是当年第一天  
335
-                dataNumber是当前日期是今年第多少天  
336
-                用dataNumber + 当前年的第一天的周差距的和在除以7就是本年第几周  
337
-            */      
365
+            /*
366
+                dateNow是当前日期
367
+                dateFirst是当年第一天
368
+                dataNumber是当前日期是今年第多少天
369
+                用dataNumber + 当前年的第一天的周差距的和在除以7就是本年第几周
370
+            */
338 371
             let dateNow = new Date(year, parseInt(month) - 1, date);
339 372
             let dateFirst = new Date(year, 0, 1);
340 373
             let dataNumber = Math.round((dateNow.valueOf() - dateFirst.valueOf()) / 86400000);
341
-            return Math.ceil((dataNumber + ((dateFirst.getDay() + 1) - 1)) / 7);        
374
+            return Math.ceil((dataNumber + ((dateFirst.getDay() + 1) - 1)) / 7);
342 375
             },
343 376
             getTimestamp(time) { //把时间日期转成时间戳
344 377
             return (new Date(time)).getTime() / 1000
@@ -354,10 +387,10 @@ export default {
354 387
             var month = nowDate.getMonth() + 1; // getMonth 方法返回 0-11,代表1-12月
355 388
             var endOfMonth = new Date(fullYear, month, 0).getDate(); // 获取本月最后一天
356 389
             let monthEndTime = this.getFullDate(cloneNowDate.setDate(endOfMonth))
357
-            
358
-            
390
+            this.start_time = monthStartTime
391
+            this.end_time = this.getTimestamp(monthEndTime)
359 392
             console.log('monthEndTime',this.getTimestamp(monthEndTime))
360
-            
393
+            this.getlist()
361 394
         },
362 395
         getFullDate(targetDate) {
363 396
             var D, y, m, d;
@@ -386,22 +419,146 @@ export default {
386 419
                 var schedulelist = response.data.data.scheduleList
387 420
                 console.log("schedulelist",schedulelist)
388 421
                 this.scheduleList = schedulelist
389
-             } 
422
+             }
390 423
           })
391 424
         },
392 425
 
393 426
         //获取统计表数据
394 427
         getlist(){
395
-          const params = {
396
-             start_time:this.getTimestamp(this.weekDayArr[0]),
397
-             end_time:this.getTimestamp(this.weekDayArr[6])
398
-           }
399
-          getScheduleListTotal(params).then(response=>{
400
-             if(response.data.state == 1){
401
-               var list =  response.data.data.list
402
-               console.log("list",list)
403
-             }
404
-          })
428
+            if(this.timeSlot == 1){
429
+               this.start_time = this.getTimestamp(this.weekDayArr[0]),
430
+               this.end_time = this.getTimestamp(this.weekDayArr[6])
431
+            }
432
+            const params = {
433
+                start_time:this.start_time,
434
+                end_time:this.end_time,
435
+            }
436
+            console.log("params",params)
437
+            getScheduleListTotal(params).then(response=>{
438
+                if(response.data.state == 1){
439
+                    //获取每个班次对应的次数
440
+                    var scheudleTotal =  response.data.data.scheudletotal
441
+                    console.log("scheudletotal",scheudleTotal)
442
+                    //获取总分钟数
443
+                    var list = response.data.data.list
444
+                    console.log("list",list)
445
+                    var workday = response.data.data.workDay
446
+                    console.log("workday",workday)
447
+                    var noWorkDay = response.data.data.noWorkDay
448
+                    console.log("noWorkDay",noWorkDay)
449
+
450
+                    let tempArr = [], newArr = []
451
+                    for (let i = 0; i < scheudleTotal.length; i++) {
452
+                        if (tempArr.indexOf(scheudleTotal[i].user_name) === -1) {
453
+                            newArr.push({
454
+                                user_name: scheudleTotal[i].user_name,
455
+                                doctor_id:scheudleTotal[i].doctor_id,
456
+                                list: [{class_name:scheudleTotal[i].class_name,doctor_id:scheudleTotal[i].doctor_id,Count:scheudleTotal[i].Count}]
457
+                            })
458
+                            tempArr.push(scheudleTotal[i].user_name);
459
+                        } else {
460
+                            for (let j = 0; j < newArr.length; j++) {
461
+                                if (newArr[j].user_name == scheudleTotal[i].user_name) {
462
+                                    newArr[j].list.push({class_name:scheudleTotal[i].class_name,doctor_id:scheudleTotal[i].doctor_id,Count:scheudleTotal[i].Count})
463
+                                }
464
+                            }
465
+                        }
466
+                    }
467
+
468
+                    newArr.map(item => {
469
+                        list.map(it => {
470
+                            if(item.doctor_id == it.doctor_id){
471
+                                item.totalminute = it.totalminute
472
+                            }
473
+                        })
474
+                    })
475
+                    newArr.map(item => {
476
+                        workday.map(it => {
477
+                            if(item.doctor_id == it.doctor_id){
478
+                                item.attendance = it.Count
479
+                            }
480
+                        })
481
+                    })
482
+                    newArr.map(item => {
483
+                        noWorkDay.map(it => {
484
+                            if(item.doctor_id == it.doctor_id){
485
+                                item.absence = it.Count
486
+                            }
487
+                        })
488
+                    })
489
+                    
490
+                    let arr = [...newArr]
491
+
492
+                    arr.sort(this.compare('doctor_id'))
493
+                    this.doctorlist.sort(this.compare('admin_user_id'))
494
+                    this.doctorlist.forEach((item, index) => {
495
+                      if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
496
+                    
497
+                      }else{
498
+                        arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
499
+                      }
500
+                    })
501
+                    
502
+
503
+                    console.log('newArr',arr)
504
+                    this.tableData = arr
505
+                }
506
+            })
507
+        },
508
+        changeOption(val){
509
+            if(this.timeSlot == 1){
510
+               this.start_time = this.getTimestamp(this.weekDayArr[0]),
511
+               this.end_time = this.getTimestamp(this.weekDayArr[6])
512
+            }
513
+            const params = {
514
+              doctor_type: parseInt(val),
515
+            }
516
+            console.log("params",params)
517
+            changeOption(params).then(response=>{
518
+              if(response.data.state == 1){
519
+                var scheduletotal =  response.data.data.scheduletotal
520
+                console.log("scheduletotal",scheduletotal)
521
+                var list = response.data.data.list
522
+                console.log("list",list)
523
+                var workday = response.data.data.workday
524
+                console.log("workday",workday)
525
+                var worknoday = response.data.data.workday
526
+                console.log("worknoday",worknoday)
527
+              }
528
+            })
529
+        },
530
+        changeTime(val){
531
+            this.start_time = val.getTime()/1000
532
+            this.getlist()
533
+        },
534
+        changeTimeTwo(val){
535
+            this.end_time = val.getTime()/1000
536
+            this.getlist()
537
+        },
538
+        compare(property){
539
+            return function(a,b){
540
+                var value1 = a[property];
541
+                var value2 = b[property];
542
+                return value2 - value1;
543
+            }
544
+        },
545
+        getCount(id,name){
546
+            if(id != undefined){
547
+                let Count = '';
548
+                this.tableData.map(item => {
549
+                    if(item.doctor_id == id){
550
+                        if(item.list){
551
+                            item.list.map(it => {
552
+                                if(it.class_name == name){
553
+                                    Count = it.Count
554
+                                }
555
+                            })
556
+                        }
557
+                        
558
+                    }
559
+                })
560
+                return Count
561
+            }   
405 562
         }
406 563
     }
407 564
 }

+ 2 - 2
src/xt_pages/user/components/PatientDetail.vue View File

@@ -953,8 +953,8 @@
953 953
             </table>
954 954
             <div class="print_footnote_panel">
955 955
               <div class="proj">
956
-                <span class="proj_title">日期:</span
957
-                >{{ getTime(patientPrint.created_time) }}
956
+                <span class="proj_title">日期:</span>
957
+                <!-- {{ getTime(patientPrint.created_time) }} -->
958 958
               </div>
959 959
               <div class="proj"><span class="proj_title">医生签名:</span></div>
960 960
             </div>

+ 36 - 10
src/xt_pages/workforce/schedule_print.vue View File

@@ -32,21 +32,21 @@
32 32
                 <td :width="td_3_width" valign="top">
33 33
                   <div style="min-height: 80px;">
34 34
                     <div class="proj" v-if="Object.keys(main_collection.all.am).length > 0">
35
-                      <div class="proj_title">上午:</div>
35
+                      <div class="proj_title">上午: <span>{{ getPatientNum(main_collection.weekday,1) }}人</span> </div>
36 36
                       <div class="proj_item" v-for="(zone_schs, zone_name) in main_collection.all.am" :key="zone_name">
37 37
                         <span class="zone_name">{{ zone_name }}: </span>
38 38
                         {{ patient_names(zone_schs) }}
39 39
                       </div>
40 40
                     </div>
41 41
                     <div class="proj" v-if="Object.keys(main_collection.all.pm).length > 0">
42
-                      <div class="proj_title">下午:</div>
42
+                      <div class="proj_title">下午:<span>{{ getPatientNum(main_collection.weekday,2) }}人</span></div>
43 43
                       <div class="proj_item" v-for="(zone_schs, zone_name) in main_collection.all.pm" :key="zone_name">
44 44
                         <span class="zone_name">{{ zone_name }}: </span>
45 45
                         {{ patient_names(zone_schs) }}
46 46
                       </div>
47 47
                     </div>
48 48
                     <div class="proj" v-if="Object.keys(main_collection.all.evening).length > 0">
49
-                      <div class="proj_title">晚上:</div>
49
+                      <div class="proj_title">晚上: <span>{{ getPatientNum(main_collection.weekday,3) }}人</span></div>
50 50
                       <div class="proj_item" v-for="(zone_schs, zone_name) in main_collection.all.evening"
51 51
                            :key="zone_name">
52 52
                         <span class="zone_name">{{ zone_name }}: </span>
@@ -249,7 +249,9 @@
249 249
               evening: { /* zone_name: [ schedule, ... ] */ }
250 250
             }
251 251
           }
252
-        ]
252
+        ],
253
+
254
+        total:[]
253 255
       }
254 256
     },
255 257
     components: {
@@ -271,7 +273,7 @@
271 273
             const collection = this.schedules[index]
272 274
             collection.day = resp.data.days[index].split("-")[1]+"-"+resp.data.days[index].split("-")[2]
273 275
           }
274
-
276
+          this.total = resp.data.total
275 277
           var schedules = resp.data.schedules
276 278
 
277 279
           for (let index = 0; index < schedules.length; index++) {
@@ -295,6 +297,7 @@
295 297
             } else {
296 298
               time_type_schedules = main_collection.all.evening
297 299
             }
300
+            
298 301
 
299 302
             var zone_schedules = time_type_schedules[schedule.zone.name] ? time_type_schedules[schedule.zone.name] : []
300 303
 
@@ -312,7 +315,6 @@
312 315
 
313 316
           }
314 317
 
315
-
316 318
         } else {
317 319
           this.$message.error(resp.msg)
318 320
         }
@@ -321,6 +323,30 @@
321 323
       })
322 324
     },
323 325
     methods: {
326
+      getPatientNum(week,type){
327
+        if(week == '星期一'){
328
+          week = 1
329
+        }else if(week == '星期二'){
330
+          week = 2
331
+        }else if(week == '星期三'){
332
+          week = 3
333
+        }else if(week == '星期四'){
334
+          week = 4
335
+        }else if(week == '星期五'){
336
+          week = 5
337
+        }else if(week == '星期六'){
338
+          week = 6
339
+        }else if(week == '星期日'){
340
+          week = 7
341
+        }
342
+        let num = 0
343
+        this.total.map(item => {
344
+          if(item.schedule_week == week && item.schedule_type == type){
345
+            num = item.Count
346
+          }
347
+        })
348
+        return num
349
+      },
324 350
       patient_names: function(schedules) {
325 351
         var names = []
326 352
         for (let index = 0; index < schedules.length; index++) {
@@ -334,7 +360,7 @@
334 360
           obj[next] ? '' : obj[next] = true && cur.push(next)
335 361
           return cur
336 362
         }, []) // 设置cur默认类型为数组,并且初始值为空的数组
337
-
363
+        console.log('names',names)
338 364
         return names.join('、')
339 365
       },
340 366
       patient_other_names: function(schedules) {
@@ -368,15 +394,15 @@
368 394
         var str= ""
369 395
 
370 396
         if(am.length > 0){
371
-          str = "上午:"+ am.join("、") +"<br/>"
397
+          str = "上午:"+ am.length + '人' +"<br/>" + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + am.join("、") +"<br/>"
372 398
         }
373 399
 
374 400
         if(pm.length > 0){
375
-          str = str + "下午:"+ pm.join("、")+"<br/>"
401
+          str = str + "下午:" + pm.length + '人' + "<br/>" + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + pm.join("、")+"<br/>"
376 402
         }
377 403
 
378 404
         if(evening.length > 0){
379
-          str = str + "晚上:"+ evening.join("、")
405
+          str = str + "晚上:" + evening.length + '人' +"<br/>" + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + evening.join("、")
380 406
         }
381 407
         return str
382 408
       },