|
@@ -40,7 +40,7 @@
|
40
|
40
|
</div>
|
41
|
41
|
<div class="schedulingTable" style="display:flex;justify-content: space-between;">
|
42
|
42
|
<div style="width: 70%">
|
43
|
|
- <el-table :data="tableData" border :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}" :row-style="{ color: '#303133' }" @cell-click="clickThis">
|
|
43
|
+ <el-table :data="tableData" border :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}" :row-style="{ color: '#303133' }" @cell-click="clickThis" :cell-style="tableCellStyle">
|
44
|
44
|
<el-table-column prop="name" label="医护姓名" style="width:16%" align="center">
|
45
|
45
|
<template slot-scope="scope">
|
46
|
46
|
{{scope.row.user_name}}
|
|
@@ -450,7 +450,6 @@ export default {
|
450
|
450
|
getStaffScheduleList(params).then(response=>{
|
451
|
451
|
if(response.data.state == 1){
|
452
|
452
|
var staffList = response.data.data.staffList
|
453
|
|
- console.log("所有排班数据",staffList)
|
454
|
453
|
for(let i=0;i<staffList.length;i++){
|
455
|
454
|
if(staffList[i].schedule_week == 0){
|
456
|
455
|
staffList[i].class_index = 0
|
|
@@ -474,7 +473,6 @@ export default {
|
474
|
473
|
staffList[i].class_index = 6
|
475
|
474
|
}
|
476
|
475
|
}
|
477
|
|
- console.log("staffList--------",staffList)
|
478
|
476
|
let tempArr = [], newArr = []
|
479
|
477
|
for (let i = 0; i < staffList.length; i++) {
|
480
|
478
|
if (tempArr.indexOf(staffList[i].user_name) === -1) {
|
|
@@ -501,7 +499,6 @@ export default {
|
501
|
499
|
|
502
|
500
|
}else{
|
503
|
501
|
arr.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type})
|
504
|
|
- // console.log("arr",arr)
|
505
|
502
|
}
|
506
|
503
|
})
|
507
|
504
|
console.log("arr=======",arr)
|
|
@@ -626,7 +623,6 @@ export default {
|
626
|
623
|
// console.log("arr",arr)
|
627
|
624
|
}
|
628
|
625
|
})
|
629
|
|
- console.log("全部=======",arr)
|
630
|
626
|
arr.sort(this.compare('user_type'))
|
631
|
627
|
this.tableData = arr
|
632
|
628
|
}
|
|
@@ -675,8 +671,6 @@ export default {
|
675
|
671
|
})
|
676
|
672
|
},
|
677
|
673
|
toSearch(){
|
678
|
|
- console.log("医护人员姓名",this.keywords)
|
679
|
|
-
|
680
|
674
|
const params = {
|
681
|
675
|
user_name: this.keywords,
|
682
|
676
|
start_time:this.getTimestamp(this.weekDayArr[0]),
|
|
@@ -685,7 +679,6 @@ export default {
|
685
|
679
|
toSearchScheduleList(params).then(response=>{
|
686
|
680
|
if(response.data.state == 1){
|
687
|
681
|
var staffList = response.data.data.staffList
|
688
|
|
- console.log("stafflist",staffList)
|
689
|
682
|
let tempArr = [], newArr = []
|
690
|
683
|
for (let i = 0; i < staffList.length; i++) {
|
691
|
684
|
if (tempArr.indexOf(staffList[i].user_name) === -1) {
|
|
@@ -729,7 +722,6 @@ export default {
|
729
|
722
|
start_time:this.getTimestamp(this.weekDayArr[0]),
|
730
|
723
|
end_time:this.getTimestamp(this.weekDayArr[6])
|
731
|
724
|
}
|
732
|
|
- console.log("params",params)
|
733
|
725
|
this.$confirm(
|
734
|
726
|
'是否要清除当周排班? <br>清除后,信息将无法恢复',
|
735
|
727
|
'删除提示',
|
|
@@ -780,7 +772,6 @@ export default {
|
780
|
772
|
UpdateContinusSchedule(params).then(response=>{
|
781
|
773
|
if(response.data.state == 1){
|
782
|
774
|
var schedule = response.data.data.schedule
|
783
|
|
- console.log("schedule",schedule)
|
784
|
775
|
this.$message.success("保存成功")
|
785
|
776
|
}
|
786
|
777
|
})
|
|
@@ -798,8 +789,6 @@ export default {
|
798
|
789
|
this.currentFirstDate1 = num + 1
|
799
|
790
|
},
|
800
|
791
|
submitAction(formName){
|
801
|
|
- console.log("数据",this.typeOptions)
|
802
|
|
- console.log("2222",this.timeOptions)
|
803
|
792
|
var label = ""
|
804
|
793
|
for(let i=0;i<this.timeOptions.length;i++){
|
805
|
794
|
if(this.form.copyWeek == this.timeOptions[i].value){
|
|
@@ -808,9 +797,7 @@ export default {
|
808
|
797
|
}
|
809
|
798
|
var start = label.split('~')
|
810
|
799
|
var copy_startime = this.getTimestamp(start[0])
|
811
|
|
- console.log("copy_startime",copy_startime)
|
812
|
800
|
var copy_endtime = this.getTimestamp(start[1])
|
813
|
|
- console.log("copy_endtime",copy_endtime)
|
814
|
801
|
|
815
|
802
|
const params = {
|
816
|
803
|
start_time:this.getTimestamp(this.weekDayArr[0]),
|
|
@@ -818,13 +805,11 @@ export default {
|
818
|
805
|
copy_startime:copy_startime,
|
819
|
806
|
copy_endtime:copy_endtime,
|
820
|
807
|
}
|
821
|
|
- console.log("params",params)
|
822
|
808
|
this.$refs[formName].validate(valid=>{
|
823
|
809
|
if(valid){
|
824
|
810
|
copyStaffSchedule(params).then(response=>{
|
825
|
811
|
if(response.data.state == 1){
|
826
|
812
|
var msg = response.data.data.msg
|
827
|
|
- console.log("msg",msg)
|
828
|
813
|
this.$message.success("复制成功")
|
829
|
814
|
this.newVisible = false
|
830
|
815
|
}else{
|
|
@@ -841,6 +826,16 @@ export default {
|
841
|
826
|
return value2 - value1;
|
842
|
827
|
}
|
843
|
828
|
},
|
|
829
|
+ tableCellStyle (row, rowIndex, column) {
|
|
830
|
+ var week = (row.column.label).split('');
|
|
831
|
+ var weeks = week[4]+week[5]+week[6]+week[7]+week[8]+week[9]+week[10]+week[11]+week[12]
|
|
832
|
+ // console.log("week",week)
|
|
833
|
+ console.log("weeks",weeks)
|
|
834
|
+ var weekdate = this.getTimestamp(weeks)
|
|
835
|
+ if(weekdate < this.timeNow){
|
|
836
|
+ return 'background-color:#e5e5e5;'
|
|
837
|
+ }
|
|
838
|
+ },
|
844
|
839
|
},
|
845
|
840
|
created(){
|
846
|
841
|
//获取医护人员
|
|
@@ -877,9 +872,7 @@ export default {
|
877
|
872
|
|
878
|
873
|
}
|
879
|
874
|
var now = moment().locale('zh-cn').format('YYYY-MM-DD 00:00:00')
|
880
|
|
- console.log('now',now)
|
881
|
875
|
this.timeNow = this.getTimestamp(now)
|
882
|
|
- console.log("timenow",this.timeNow)
|
883
|
876
|
|
884
|
877
|
}
|
885
|
878
|
}
|