|
@@ -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:{
|
|
@@ -427,27 +411,34 @@ export default {
|
427
|
411
|
getDoctorList().then(response=>{
|
428
|
412
|
if(response.data.state == 1){
|
429
|
413
|
var list = response.data.data.list
|
430
|
|
- console.log("医护列表",list)
|
431
|
|
- this.tableData = list
|
432
|
|
- this.doctorlist = list
|
|
414
|
+ // console.log("医护列表",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
|
426
|
var doctorlist = response.data.data.doctorlist
|
|
427
|
+ let arr = []
|
437
|
428
|
for(let i=0;i<doctorlist.length;i++){
|
438
|
|
- if(doctorlist[i].sort == 0){
|
|
429
|
+ if(doctorlist[i].sort == 0){
|
439
|
430
|
doctorlist[i].sort = ""
|
440
|
|
- }
|
|
431
|
+ }
|
441
|
432
|
}
|
442
|
433
|
console.log('doctorlist',doctorlist)
|
443
|
|
- this.doctorList = doctorlist
|
|
434
|
+ this.doctorTableData = doctorlist
|
444
|
435
|
var nurselist = response.data.data.nurselist
|
445
|
436
|
for(let i=0;i<nurselist.length;i++){
|
446
|
|
- if(nurselist[i].sort == 0){
|
|
437
|
+ if(nurselist[i].sort == 0){
|
447
|
438
|
nurselist[i].sort = ""
|
448
|
|
- }
|
|
439
|
+ }
|
449
|
440
|
}
|
450
|
|
- this.nurseList = nurselist
|
|
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,18 +856,66 @@ 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) {
|
|
882
|
+
|
|
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'))
|
872
|
888
|
|
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
|
|
- }
|
|
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
|
+ }
|
|
896
|
+ })
|
|
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
|
+ }
|
876
|
904
|
})
|
877
|
|
- arr.sort(this.compare('user_type'))
|
|
905
|
+ newDoctor.sort(this.compare('sort'))
|
878
|
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'))
|
|
918
|
+
|
879
|
919
|
let arr2 = []
|
880
|
920
|
arr2.push({class_name:oneStr,schedule_week:1})
|
881
|
921
|
arr2.push({class_name:twoStr,schedule_week:2})
|
|
@@ -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) {
|
1183
|
1248
|
|
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
|
|
- }
|
|
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
|
+ }
|
1188
|
1262
|
})
|
1189
|
|
- arr.sort(this.compare('user_type'))
|
|
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) {
|
|
1266
|
+
|
|
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
|
+ }
|
|
1270
|
+ })
|
|
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
|
},
|
|
@@ -1216,80 +1316,382 @@ export default {
|
1216
|
1316
|
if(response.data.state == 1){
|
1217
|
1317
|
var staffList = response.data.data.staffList
|
1218
|
1318
|
// console.log("staffList",staffList)
|
|
1319
|
+ var sevenStr = ""
|
|
1320
|
+ var oneStr = ""
|
|
1321
|
+ var twoStr = ""
|
|
1322
|
+ var threeStr = ""
|
|
1323
|
+ var fourStr = ""
|
|
1324
|
+ var fiveStr = ""
|
|
1325
|
+ var sixStr = ""
|
|
1326
|
+ this.arrZero = []
|
|
1327
|
+ this.arrOne = []
|
|
1328
|
+ this.arrTwo = []
|
|
1329
|
+ this.arrThree = []
|
|
1330
|
+ this.arrFour = []
|
|
1331
|
+ this.arrFive = []
|
|
1332
|
+ this.arrSix = []
|
|
1333
|
+ for(let i=0;i<staffList.length;i++){
|
|
1334
|
+ if(staffList[i].schedule_week == 0){
|
|
1335
|
+ staffList[i].class_index = 0
|
|
1336
|
+ var arr = []
|
|
1337
|
+ this.arrZero.push(staffList[i].class_name)
|
|
1338
|
+ for(let i=0;i<this.arrZero.length;i++){
|
|
1339
|
+ if(this.arrZero[i]!=''){
|
|
1340
|
+ arr.push(this.arrZero[i])
|
|
1341
|
+ }
|
|
1342
|
+ }
|
|
1343
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
1344
|
+ if (name in allNames) {
|
|
1345
|
+ allNames[name]++;
|
|
1346
|
+ }
|
|
1347
|
+ else {
|
|
1348
|
+ allNames[name] = 1;
|
|
1349
|
+ }
|
|
1350
|
+ return allNames;
|
|
1351
|
+ }, {});
|
|
1352
|
+ let objKey = Object.keys(countedNames)
|
|
1353
|
+ let objVal = Object.values(countedNames)
|
|
1354
|
+ var zeroStr = ''
|
|
1355
|
+ objKey.map((item,index) => {
|
|
1356
|
+ let objVal = Object.values(countedNames)
|
|
1357
|
+ zeroStr += item + objVal[index] + '\n'
|
|
1358
|
+ })
|
|
1359
|
+ sevenStr = zeroStr
|
|
1360
|
+ }
|
|
1361
|
+ if(staffList[i].schedule_week == 1){
|
|
1362
|
+ staffList[i].class_index = 1
|
|
1363
|
+ var arr = []
|
|
1364
|
+ this.arrOne.push(staffList[i].class_name)
|
|
1365
|
+ for(let i=0;i<this.arrOne.length;i++){
|
|
1366
|
+ if(this.arrOne[i]!=''){
|
|
1367
|
+ arr.push(this.arrOne[i])
|
|
1368
|
+ }
|
|
1369
|
+ }
|
|
1370
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
1371
|
+ if (name in allNames) {
|
|
1372
|
+ allNames[name]++;
|
|
1373
|
+ }
|
|
1374
|
+ else {
|
|
1375
|
+ allNames[name] = 1;
|
|
1376
|
+ }
|
|
1377
|
+ return allNames;
|
|
1378
|
+ }, {});
|
|
1379
|
+ let objKey = Object.keys(countedNames)
|
|
1380
|
+ let objVal = Object.values(countedNames)
|
|
1381
|
+ let strOne = ''
|
|
1382
|
+ objKey.map((item,index) => {
|
|
1383
|
+ let objVal = Object.values(countedNames)
|
|
1384
|
+ strOne += item + objVal[index] + '\n'
|
|
1385
|
+ })
|
|
1386
|
+ oneStr = strOne
|
|
1387
|
+ }
|
|
1388
|
+ if(staffList[i].schedule_week == 2){
|
|
1389
|
+ staffList[i].class_index = 2
|
|
1390
|
+ var arr = []
|
|
1391
|
+ this.arrTwo.push(staffList[i].class_name)
|
|
1392
|
+ for(let i=0;i<this.arrTwo.length;i++){
|
|
1393
|
+ if(this.arrTwo[i]!=''){
|
|
1394
|
+ arr.push(this.arrTwo[i])
|
|
1395
|
+ }
|
|
1396
|
+ }
|
|
1397
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
1398
|
+ if (name in allNames) {
|
|
1399
|
+ allNames[name]++;
|
|
1400
|
+ }
|
|
1401
|
+ else {
|
|
1402
|
+ allNames[name] = 1;
|
|
1403
|
+ }
|
|
1404
|
+ return allNames;
|
|
1405
|
+ }, {});
|
|
1406
|
+ let objKey = Object.keys(countedNames)
|
|
1407
|
+ let objVal = Object.values(countedNames)
|
|
1408
|
+ let strTwo = ''
|
|
1409
|
+ objKey.map((item,index) => {
|
|
1410
|
+ let objVal = Object.values(countedNames)
|
|
1411
|
+ strTwo += item + objVal[index] + '\n'
|
|
1412
|
+ })
|
|
1413
|
+ twoStr = strTwo
|
|
1414
|
+ }
|
|
1415
|
+ if(staffList[i].schedule_week == 3){
|
|
1416
|
+ staffList[i].class_index = 3
|
|
1417
|
+ var arr = []
|
|
1418
|
+ this.arrThree.push(staffList[i].class_name)
|
|
1419
|
+ for(let i=0;i<this.arrThree.length;i++){
|
|
1420
|
+ if(this.arrThree[i]!=''){
|
|
1421
|
+ arr.push(this.arrThree[i])
|
|
1422
|
+ }
|
|
1423
|
+ }
|
|
1424
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
1425
|
+ if (name in allNames) {
|
|
1426
|
+ allNames[name]++;
|
|
1427
|
+ }
|
|
1428
|
+ else {
|
|
1429
|
+ allNames[name] = 1;
|
|
1430
|
+ }
|
|
1431
|
+ return allNames;
|
|
1432
|
+ }, {});
|
|
1433
|
+ let objKey = Object.keys(countedNames)
|
|
1434
|
+ let objVal = Object.values(countedNames)
|
|
1435
|
+ let strThree = ''
|
|
1436
|
+ objKey.map((item,index) => {
|
|
1437
|
+ let objVal = Object.values(countedNames)
|
|
1438
|
+ strThree += item + objVal[index] + '\n'
|
|
1439
|
+ })
|
|
1440
|
+ threeStr = strThree
|
|
1441
|
+ }
|
|
1442
|
+ if(staffList[i].schedule_week == 4){
|
|
1443
|
+ staffList[i].class_index = 4
|
|
1444
|
+ var arr = []
|
|
1445
|
+ this.arrFour.push(staffList[i].class_name)
|
|
1446
|
+ for(let i=0;i<this.arrFour.length;i++){
|
|
1447
|
+ if(this.arrFour[i]!=''){
|
|
1448
|
+ arr.push(this.arrFour[i])
|
|
1449
|
+ }
|
|
1450
|
+ }
|
|
1451
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
1452
|
+ if (name in allNames) {
|
|
1453
|
+ allNames[name]++;
|
|
1454
|
+ }
|
|
1455
|
+ else {
|
|
1456
|
+ allNames[name] = 1;
|
|
1457
|
+ }
|
|
1458
|
+ return allNames;
|
|
1459
|
+ }, {});
|
|
1460
|
+ let objKey = Object.keys(countedNames)
|
|
1461
|
+ let objVal = Object.values(countedNames)
|
|
1462
|
+ let strFour = ''
|
|
1463
|
+ objKey.map((item,index) => {
|
|
1464
|
+ let objVal = Object.values(countedNames)
|
|
1465
|
+ strFour += item + objVal[index] + '\n'
|
|
1466
|
+ })
|
|
1467
|
+ fourStr = strFour
|
|
1468
|
+ }
|
|
1469
|
+ if(staffList[i].schedule_week == 5){
|
|
1470
|
+ staffList[i].class_index = 5
|
1219
|
1471
|
|
|
1472
|
+ var arr = []
|
|
1473
|
+ this.arrFive.push(staffList[i].class_name)
|
|
1474
|
+ for(let i=0;i<this.arrFive.length;i++){
|
|
1475
|
+ if(this.arrFive[i]!=''){
|
|
1476
|
+ arr.push(this.arrFive[i])
|
|
1477
|
+ }
|
|
1478
|
+ }
|
|
1479
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
1480
|
+ if (name in allNames) {
|
|
1481
|
+ allNames[name]++;
|
|
1482
|
+ }
|
|
1483
|
+ else {
|
|
1484
|
+ allNames[name] = 1;
|
|
1485
|
+ }
|
|
1486
|
+ return allNames;
|
|
1487
|
+ }, {});
|
|
1488
|
+ let objKey = Object.keys(countedNames)
|
|
1489
|
+ let objVal = Object.values(countedNames)
|
|
1490
|
+ let strFive = ''
|
|
1491
|
+ objKey.map((item,index) => {
|
|
1492
|
+ let objVal = Object.values(countedNames)
|
|
1493
|
+ strFive += item + objVal[index] + '\n'
|
|
1494
|
+ })
|
|
1495
|
+ fiveStr = strFive
|
|
1496
|
+ }
|
|
1497
|
+ if(staffList[i].schedule_week == 6){
|
|
1498
|
+ staffList[i].class_index = 6
|
|
1499
|
+ var arr = []
|
|
1500
|
+ this.arrSix.push(staffList[i].class_name)
|
|
1501
|
+ for(let i=0;i<this.arrSix.length;i++){
|
|
1502
|
+ if(this.arrSix[i]!=''){
|
|
1503
|
+ arr.push(this.arrSix[i])
|
|
1504
|
+ }
|
|
1505
|
+ }
|
|
1506
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
1507
|
+ if (name in allNames) {
|
|
1508
|
+ allNames[name]++;
|
|
1509
|
+ }
|
|
1510
|
+ else {
|
|
1511
|
+ allNames[name] = 1;
|
|
1512
|
+ }
|
|
1513
|
+ return allNames;
|
|
1514
|
+ }, {});
|
|
1515
|
+ let objKey = Object.keys(countedNames)
|
|
1516
|
+ let objVal = Object.values(countedNames)
|
|
1517
|
+ let strSix = ''
|
|
1518
|
+ objKey.map((item,index) => {
|
|
1519
|
+ let objVal = Object.values(countedNames)
|
|
1520
|
+ strSix += item + objVal[index] + '\n'
|
|
1521
|
+ })
|
|
1522
|
+ sixStr = strSix
|
|
1523
|
+ }
|
|
1524
|
+ }
|
1220
|
1525
|
let tempArr = [], newArr = []
|
1221
|
1526
|
for (let i = 0; i < staffList.length; i++) {
|
1222
|
1527
|
if (tempArr.indexOf(staffList[i].user_name) === -1) {
|
1223
|
1528
|
newArr.push({
|
1224
|
|
- user_type:staffList[i].doctor_type,
|
1225
|
1529
|
user_name: staffList[i].user_name,
|
1226
|
1530
|
admin_user_id:staffList[i].admin_user_id,
|
1227
|
|
- list: [{class_name:staffList[i].class_name,schedule_week:staffList[i].schedule_week}]
|
|
1531
|
+ user_type:staffList[i].doctor_type,
|
|
1532
|
+ is_sort:staffList[i].is_sort,
|
|
1533
|
+ sort:staffList[i].sort,
|
|
1534
|
+ 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
|
1535
|
})
|
1229
|
1536
|
tempArr.push(staffList[i].user_name);
|
1230
|
1537
|
} else {
|
1231
|
1538
|
for (let j = 0; j < newArr.length; j++) {
|
1232
|
1539
|
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})
|
|
1540
|
+ 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
|
1541
|
}
|
1235
|
1542
|
}
|
1236
|
1543
|
}
|
1237
|
1544
|
}
|
1238
|
1545
|
|
|
1546
|
+ let arr = [...newArr]
|
|
1547
|
+ let newNurse = []
|
|
1548
|
+ let newDoctor = []
|
|
1549
|
+ arr.map(item => {
|
|
1550
|
+ if(item.user_type == 2){
|
|
1551
|
+ newDoctor.push(item)
|
|
1552
|
+ }
|
|
1553
|
+ if(item.user_type == 3){
|
|
1554
|
+ newNurse.push(item)
|
|
1555
|
+ }
|
|
1556
|
+ })
|
|
1557
|
+
|
1239
|
1558
|
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) {
|
|
1559
|
+ //护士
|
|
1560
|
+ newNurse.sort(this.compare('admin_user_id'))
|
|
1561
|
+ let newNurseTableData = []
|
|
1562
|
+ this.nurseTableData.map(item => {
|
|
1563
|
+ if(item.is_sort == 1){
|
|
1564
|
+ newNurseTableData.push(item)
|
|
1565
|
+ }
|
|
1566
|
+ })
|
|
1567
|
+ newNurseTableData.sort(this.compare('admin_user_id'))
|
|
1568
|
+ newNurseTableData.map((item,index) => {
|
|
1569
|
+ if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
|
1245
|
1570
|
|
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
|
|
- }
|
|
1571
|
+ }else{
|
|
1572
|
+ 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})
|
|
1573
|
+ }
|
1250
|
1574
|
})
|
1251
|
|
- arr.sort(this.compare('user_type'))
|
1252
|
|
- this.tableData = arr
|
|
1575
|
+ newNurse.sort(this.compare('sort'))
|
|
1576
|
+
|
|
1577
|
+ //医生
|
|
1578
|
+ newDoctor.sort(this.compare('admin_user_id'))
|
|
1579
|
+ let newDoctorTableData = []
|
|
1580
|
+ this.doctorTableData.map(item => {
|
|
1581
|
+ if(item.is_sort == 1){
|
|
1582
|
+ newDoctorTableData.push(item)
|
|
1583
|
+ }
|
|
1584
|
+ })
|
|
1585
|
+ newDoctorTableData.sort(this.compare('admin_user_id'))
|
|
1586
|
+ newDoctorTableData.map((item,index) => {
|
|
1587
|
+ if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
|
|
1588
|
+
|
|
1589
|
+ }else{
|
|
1590
|
+ 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})
|
|
1591
|
+ }
|
|
1592
|
+ })
|
|
1593
|
+ newDoctor.sort(this.compare('sort'))
|
|
1594
|
+
|
|
1595
|
+ // let data = []
|
|
1596
|
+ // data.push(...newNurse)
|
|
1597
|
+ // data.push(...newDoctor)
|
|
1598
|
+ // this.tableData = data
|
|
1599
|
+ let arr2 = []
|
|
1600
|
+ arr2.push({class_name:oneStr,schedule_week:1})
|
|
1601
|
+ arr2.push({class_name:twoStr,schedule_week:2})
|
|
1602
|
+ arr2.push({class_name:threeStr,schedule_week:3})
|
|
1603
|
+ arr2.push({class_name:fourStr,schedule_week:4})
|
|
1604
|
+ arr2.push({class_name:fiveStr,schedule_week:5})
|
|
1605
|
+ arr2.push({class_name:sixStr,schedule_week:6})
|
|
1606
|
+ arr2.push({class_name:zeroStr,schedule_week:0})
|
|
1607
|
+ var obj = {}
|
|
1608
|
+ obj.admin_user_id = "1000000"
|
|
1609
|
+ obj.user_name = "合计"
|
|
1610
|
+ obj.user_type = 10
|
|
1611
|
+ obj.list = arr2
|
|
1612
|
+ arr.push(obj)
|
|
1613
|
+
|
|
1614
|
+ let data = []
|
|
1615
|
+ data.push(...newNurse)
|
|
1616
|
+ data.push(...newDoctor)
|
|
1617
|
+ data.push(obj)
|
|
1618
|
+ this.tableData = data
|
1253
|
1619
|
}
|
1254
|
1620
|
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
|
|
- }
|
|
1621
|
+ newDoctor.sort(this.compare('admin_user_id'))
|
|
1622
|
+ let newDoctorTableData = []
|
|
1623
|
+ this.doctorTableData.map(item => {
|
|
1624
|
+ if(item.is_sort == 1){
|
|
1625
|
+ newDoctorTableData.push(item)
|
|
1626
|
+ }
|
1263
|
1627
|
})
|
1264
|
|
- newDoctor.map((item, index) => {
|
1265
|
|
- if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
|
|
1628
|
+ newDoctorTableData.sort(this.compare('admin_user_id'))
|
|
1629
|
+ newDoctorTableData.map((item,index) => {
|
|
1630
|
+ if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
|
1266
|
1631
|
|
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
|
|
- }
|
|
1632
|
+ }else{
|
|
1633
|
+ 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})
|
|
1634
|
+ }
|
1271
|
1635
|
})
|
1272
|
|
- this.tableData = arr
|
|
1636
|
+ newDoctor.sort(this.compare('sort'))
|
|
1637
|
+ // this.tableData = newDoctor
|
|
1638
|
+ let arr2 = []
|
|
1639
|
+ arr2.push({class_name:oneStr,schedule_week:1})
|
|
1640
|
+ arr2.push({class_name:twoStr,schedule_week:2})
|
|
1641
|
+ arr2.push({class_name:threeStr,schedule_week:3})
|
|
1642
|
+ arr2.push({class_name:fourStr,schedule_week:4})
|
|
1643
|
+ arr2.push({class_name:fiveStr,schedule_week:5})
|
|
1644
|
+ arr2.push({class_name:sixStr,schedule_week:6})
|
|
1645
|
+ arr2.push({class_name:zeroStr,schedule_week:0})
|
|
1646
|
+ var obj = {}
|
|
1647
|
+ obj.admin_user_id = "1000000"
|
|
1648
|
+ obj.user_name = "合计"
|
|
1649
|
+ obj.user_type = 10
|
|
1650
|
+ obj.list = arr2
|
|
1651
|
+ arr.push(obj)
|
|
1652
|
+
|
|
1653
|
+ let data = []
|
|
1654
|
+ data.push(...newDoctor)
|
|
1655
|
+ data.push(obj)
|
|
1656
|
+ this.tableData = data
|
1273
|
1657
|
}
|
1274
|
1658
|
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
|
|
- }
|
|
1659
|
+ newNurse.sort(this.compare('admin_user_id'))
|
|
1660
|
+ let newNurseTableData = []
|
|
1661
|
+ this.nurseTableData.map(item => {
|
|
1662
|
+ if(item.is_sort == 1){
|
|
1663
|
+ newNurseTableData.push(item)
|
|
1664
|
+ }
|
1283
|
1665
|
})
|
1284
|
|
- newDoctor.map((item, index) => {
|
1285
|
|
- if (arr[index] && item.admin_user_id == arr[index].admin_user_id) {
|
|
1666
|
+ newNurseTableData.sort(this.compare('admin_user_id'))
|
|
1667
|
+ newNurseTableData.map((item,index) => {
|
|
1668
|
+ if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
|
1286
|
1669
|
|
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
|
|
- }
|
|
1670
|
+ }else{
|
|
1671
|
+ 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})
|
|
1672
|
+ }
|
1291
|
1673
|
})
|
1292
|
|
- this.tableData = arr
|
|
1674
|
+ newNurse.sort(this.compare('sort'))
|
|
1675
|
+ // this.tableData = newNurse
|
|
1676
|
+ let arr2 = []
|
|
1677
|
+ arr2.push({class_name:oneStr,schedule_week:1})
|
|
1678
|
+ arr2.push({class_name:twoStr,schedule_week:2})
|
|
1679
|
+ arr2.push({class_name:threeStr,schedule_week:3})
|
|
1680
|
+ arr2.push({class_name:fourStr,schedule_week:4})
|
|
1681
|
+ arr2.push({class_name:fiveStr,schedule_week:5})
|
|
1682
|
+ arr2.push({class_name:sixStr,schedule_week:6})
|
|
1683
|
+ arr2.push({class_name:zeroStr,schedule_week:0})
|
|
1684
|
+ var obj = {}
|
|
1685
|
+ obj.admin_user_id = "1000000"
|
|
1686
|
+ obj.user_name = "合计"
|
|
1687
|
+ obj.user_type = 10
|
|
1688
|
+ obj.list = arr2
|
|
1689
|
+ arr.push(obj)
|
|
1690
|
+
|
|
1691
|
+ let data = []
|
|
1692
|
+ data.push(...newNurse)
|
|
1693
|
+ data.push(obj)
|
|
1694
|
+ this.tableData = data
|
1293
|
1695
|
}
|
1294
|
1696
|
|
1295
|
1697
|
}
|
|
@@ -1370,19 +1772,19 @@ export default {
|
1370
|
1772
|
|
1371
|
1773
|
copyStaffSchedule(){
|
1372
|
1774
|
this.newVisible = true
|
1373
|
|
- // const params = {
|
1374
|
|
- // start_time:this.getTimestamp(this.weekDayArr[0]),
|
1375
|
|
- // end_time:this.getTimestamp(this.weekDayArr[6])
|
1376
|
|
- // }
|
1377
|
|
- // copyStaffSchedule(params).then(response=>{
|
1378
|
|
- // if(response.data.state == 1){
|
1379
|
|
- // var msg = response.data.data.msg
|
1380
|
|
- // console.log("msg",msg)
|
1381
|
|
- // this.$message.success("复制成功")
|
1382
|
|
- // }else{
|
1383
|
|
- // this.$message.error("排班已存在")
|
1384
|
|
- // }
|
1385
|
|
- // })
|
|
1775
|
+ const params = {
|
|
1776
|
+ start_time:this.getTimestamp(this.weekDayArr[0]),
|
|
1777
|
+ end_time:this.getTimestamp(this.weekDayArr[6])
|
|
1778
|
+ }
|
|
1779
|
+ copyStaffSchedule(params).then(response=>{
|
|
1780
|
+ if(response.data.state == 1){
|
|
1781
|
+ var msg = response.data.data.msg
|
|
1782
|
+ console.log("msg",msg)
|
|
1783
|
+ this.$message.success("复制成功")
|
|
1784
|
+ }else{
|
|
1785
|
+ this.$message.error("排班已存在")
|
|
1786
|
+ }
|
|
1787
|
+ })
|
1386
|
1788
|
},
|
1387
|
1789
|
toContinuous(){
|
1388
|
1790
|
var is_status = 0
|
|
@@ -1461,9 +1863,6 @@ export default {
|
1461
|
1863
|
if (week.length == 14) {
|
1462
|
1864
|
weeks = week[4]+week[5]+week[6]+week[7]+week[8]+week[9]+week[10]+week[11]+week[12]
|
1463
|
1865
|
}
|
1464
|
|
-
|
1465
|
|
- // console.log("week",week)
|
1466
|
|
- // console.log("weeks",weeks)
|
1467
|
1866
|
var weekdate = this.getTimestamp(weeks)
|
1468
|
1867
|
if(weekdate < this.timeNow){
|
1469
|
1868
|
return 'background-color:#e5e5e5;'
|
|
@@ -1482,13 +1881,13 @@ export default {
|
1482
|
1881
|
id:val.id,
|
1483
|
1882
|
}
|
1484
|
1883
|
console.log("params",params)
|
1485
|
|
- // SaveNurseSort(params).then(response=>{
|
1486
|
|
- // if(response.data.state == 1){
|
1487
|
|
- // var role = response.data.data.role
|
1488
|
|
- // this.$message.success("保存成功")
|
1489
|
|
- // this.getDoctorList()
|
1490
|
|
- // }
|
1491
|
|
- // })
|
|
1884
|
+ SaveNurseSort(params).then(response=>{
|
|
1885
|
+ if(response.data.state == 1){
|
|
1886
|
+ var role = response.data.data.role
|
|
1887
|
+ this.$message.success("保存成功")
|
|
1888
|
+ this.getDoctorList()
|
|
1889
|
+ }
|
|
1890
|
+ })
|
1492
|
1891
|
},
|
1493
|
1892
|
changeRadio(val){
|
1494
|
1893
|
console.log("val",val)
|
|
@@ -1496,19 +1895,19 @@ export default {
|
1496
|
1895
|
id:val.id,
|
1497
|
1896
|
is_sort:val.is_sort,
|
1498
|
1897
|
}
|
1499
|
|
- // SaveIsSchedule(params).then(response=>{
|
1500
|
|
- // if(response.data.state == 1){
|
1501
|
|
- // var role = response.data.data.role
|
1502
|
|
- // this.$message.success("保存成功")
|
1503
|
|
- // this.getDoctorList()
|
1504
|
|
- // }
|
1505
|
|
- // })
|
|
1898
|
+ SaveIsSchedule(params).then(response=>{
|
|
1899
|
+ if(response.data.state == 1){
|
|
1900
|
+ var role = response.data.data.role
|
|
1901
|
+ this.$message.success("保存成功")
|
|
1902
|
+ this.getDoctorList()
|
|
1903
|
+ }
|
|
1904
|
+ })
|
1506
|
1905
|
}
|
1507
|
1906
|
},
|
1508
|
1907
|
created(){
|
1509
|
1908
|
//获取医护人员
|
1510
|
1909
|
this.getDoctorList()
|
1511
|
|
- //获取班种
|
|
1910
|
+ //获取班种班种
|
1512
|
1911
|
this.getScheduleList()
|
1513
|
1912
|
|
1514
|
1913
|
let year = new Date().getFullYear()
|