|
@@ -3,8 +3,8 @@
|
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">清除</el-button>
|
7
|
|
- <el-button type="primary">复制</el-button>
|
|
6
|
+ <el-button type="primary" @click="DeleteStaffSchedule">清除</el-button>
|
|
7
|
+ <el-button type="primary" @click="copyStaffSchedule">复制</el-button>
|
8
|
8
|
<el-button type="primary" icon="el-icon-printer" @click="toPrint">打印</el-button>
|
9
|
9
|
</div>
|
10
|
10
|
</div>
|
|
@@ -45,7 +45,7 @@
|
45
|
45
|
{{scope.row.user_name}}
|
46
|
46
|
</template>
|
47
|
47
|
</el-table-column>
|
48
|
|
- <el-table-column label="周一" style="width:14%" align="center">
|
|
48
|
+ <el-table-column :label="'周一 (' + weekDayArr[0] + ')'" style="width:200px" align="center">
|
49
|
49
|
<template slot-scope="scope">
|
50
|
50
|
<div @click="hangdleClick(scope.row,scope.$index)">
|
51
|
51
|
<el-dropdown trigger="click" @command="changeSchedule">
|
|
@@ -59,7 +59,7 @@
|
59
|
59
|
</div>
|
60
|
60
|
</template>
|
61
|
61
|
</el-table-column>
|
62
|
|
- <el-table-column prop="name" label="周二" style="width:14%" align="center">
|
|
62
|
+ <el-table-column prop="name" :label="'周二 (' + weekDayArr[1] + ')'" style="width:14%" align="center">
|
63
|
63
|
<template slot-scope="scope">
|
64
|
64
|
<div @click="hangdleClick(scope.row,scope.$index)">
|
65
|
65
|
<el-dropdown trigger="click" @command="changeSchedule">
|
|
@@ -73,7 +73,7 @@
|
73
|
73
|
</div>
|
74
|
74
|
</template>
|
75
|
75
|
</el-table-column>
|
76
|
|
- <el-table-column prop="name" label="周三" style="width:14%" align="center">
|
|
76
|
+ <el-table-column prop="name" :label="'周三 (' + weekDayArr[2] + ')'" style="width:14%" align="center">
|
77
|
77
|
<template slot-scope="scope">
|
78
|
78
|
<div @click="hangdleClick(scope.row,scope.$index)">
|
79
|
79
|
<el-dropdown trigger="click" @command="changeSchedule">
|
|
@@ -87,7 +87,7 @@
|
87
|
87
|
</div>
|
88
|
88
|
</template>
|
89
|
89
|
</el-table-column>
|
90
|
|
- <el-table-column prop="name" label="周四" style="width:14%" align="center">
|
|
90
|
+ <el-table-column prop="name" :label="'周四 (' + weekDayArr[3] + ')'" style="width:14%" align="center">
|
91
|
91
|
<template slot-scope="scope">
|
92
|
92
|
<div @click="hangdleClick(scope.row,scope.$index)">
|
93
|
93
|
<el-dropdown trigger="click" @command="changeSchedule">
|
|
@@ -101,7 +101,7 @@
|
101
|
101
|
</div>
|
102
|
102
|
</template>
|
103
|
103
|
</el-table-column>
|
104
|
|
- <el-table-column prop="name" label="周五" style="width:14%" align="center">
|
|
104
|
+ <el-table-column prop="name" :label="'周五 (' + weekDayArr[4] + ')'" style="width:14%" align="center">
|
105
|
105
|
<template slot-scope="scope">
|
106
|
106
|
<div @click="hangdleClick(scope.row,scope.$index)">
|
107
|
107
|
<el-dropdown trigger="click" @command="changeSchedule">
|
|
@@ -115,7 +115,7 @@
|
115
|
115
|
</div>
|
116
|
116
|
</template>
|
117
|
117
|
</el-table-column>
|
118
|
|
- <el-table-column prop="name" label="周六" style="width:14%" align="center">
|
|
118
|
+ <el-table-column prop="name" :label="'周六 (' + weekDayArr[5] + ')'" style="width:14%" align="center">
|
119
|
119
|
<template slot-scope="scope">
|
120
|
120
|
<div @click="hangdleClick(scope.row,scope.$index)">
|
121
|
121
|
<el-dropdown trigger="click" @command="changeSchedule">
|
|
@@ -129,7 +129,7 @@
|
129
|
129
|
</div>
|
130
|
130
|
</template>
|
131
|
131
|
</el-table-column>
|
132
|
|
- <el-table-column prop="name" label="周日" style="width:14%" align="center">
|
|
132
|
+ <el-table-column prop="name" :label="'周日 (' + weekDayArr[6] + ')'" style="width:14%" align="center">
|
133
|
133
|
<template slot-scope="scope">
|
134
|
134
|
<div @click="hangdleClick(scope.row,scope.$index)">
|
135
|
135
|
<el-dropdown trigger="click" @command="changeSchedule">
|
|
@@ -153,7 +153,7 @@
|
153
|
153
|
{{item.class_name}} ({{item.timeone_start}}~{{item.timeone_type}}{{item.timeone_end}} <span v-if="item.timetwo_start!=''">{{item.timetwo_start}}~{{item.timetwo_type}}{{item.timetwo_end}}</span> )
|
154
|
154
|
</p>
|
155
|
155
|
</div>
|
156
|
|
- <el-checkbox style="text-align:center" v-model="isChecked">连续排班</el-checkbox>
|
|
156
|
+ <el-checkbox style="text-align:center" v-model="isChecked" @change="toContinuous">连续排班</el-checkbox>
|
157
|
157
|
</div>
|
158
|
158
|
</div>
|
159
|
159
|
</div>
|
|
@@ -164,7 +164,7 @@
|
164
|
164
|
|
165
|
165
|
<script>
|
166
|
166
|
import BreadCrumb from '@/xt_pages/components/bread-crumb'
|
167
|
|
-import { getDoctorList,getScheduleList,addSchedule,getStaffScheduleList,getNextWeekList,getScheduleByDoctorId,toSearchScheduleList } from '@/api/doctorSchedule'
|
|
167
|
+import { getDoctorList,getScheduleList,addSchedule,getStaffScheduleList,getNextWeekList,getScheduleByDoctorId,toSearchScheduleList,DeleteStaffSchedule,copyStaffSchedule,UpdateContinusSchedule } from '@/api/doctorSchedule'
|
168
|
168
|
export default {
|
169
|
169
|
components:{
|
170
|
170
|
BreadCrumb
|
|
@@ -199,13 +199,14 @@ export default {
|
199
|
199
|
docobj:{},
|
200
|
200
|
class_name:"",
|
201
|
201
|
doctorlist:[],
|
|
202
|
+ schedule_date:"",
|
202
|
203
|
}
|
203
|
204
|
},
|
204
|
205
|
methods:{
|
205
|
206
|
search(){},
|
206
|
207
|
toPrint(){
|
207
|
208
|
this.$router.push({
|
208
|
|
- path: '/medicalScheduling/schedule/print',
|
|
209
|
+ path: '/medicalScheduling/schedule/print?starttime='+this.getTimestamp(this.weekDayArr[0])+"&endtime="+this.getTimestamp(this.weekDayArr[6]),
|
209
|
210
|
// query: { date: date }
|
210
|
211
|
})
|
211
|
212
|
},
|
|
@@ -249,26 +250,39 @@ export default {
|
249
|
250
|
this.docobj = val
|
250
|
251
|
},
|
251
|
252
|
clickThis(row, column, cell, event){
|
252
|
|
- if(column.label == "周日"){
|
|
253
|
+ console.log("row",row)
|
|
254
|
+ console.log("column",column)
|
|
255
|
+ console.log("日期",this.weekDayArr)
|
|
256
|
+ var week = (column.label).split('');
|
|
257
|
+ var weeks = week[0]+week[1]
|
|
258
|
+ console.log("weeks",weeks)
|
|
259
|
+ if(weeks == "周日"){
|
253
|
260
|
this.schedule_week = 0
|
|
261
|
+ this.schedule_date = this.weekDayArr[6]
|
254
|
262
|
}
|
255
|
|
- if(column.label == "周一"){
|
|
263
|
+ if(weeks == "周一"){
|
256
|
264
|
this.schedule_week = 1
|
|
265
|
+ this.schedule_date = this.weekDayArr[0]
|
257
|
266
|
}
|
258
|
|
- if(column.label=="周二"){
|
|
267
|
+ if(weeks=="周二"){
|
259
|
268
|
this.schedule_week = 2
|
|
269
|
+ this.schedule_date = this.weekDayArr[1]
|
260
|
270
|
}
|
261
|
|
- if(column.label=="周三"){
|
|
271
|
+ if(weeks=="周三"){
|
262
|
272
|
this.schedule_week = 3
|
|
273
|
+ this.schedule_date = this.weekDayArr[2]
|
263
|
274
|
}
|
264
|
|
- if(column.label=="周四"){
|
|
275
|
+ if(weeks=="周四"){
|
265
|
276
|
this.schedule_week = 4
|
|
277
|
+ this.schedule_date = this.weekDayArr[3]
|
266
|
278
|
}
|
267
|
|
- if(column.label == "周五"){
|
|
279
|
+ if(weeks == "周五"){
|
268
|
280
|
this.schedule_week = 5
|
|
281
|
+ this.schedule_date = this.weekDayArr[4]
|
269
|
282
|
}
|
270
|
|
- if(column.label == "周六"){
|
271
|
|
- this.schedule_week = 6
|
|
283
|
+ if(weeks== "周六"){
|
|
284
|
+ this.schedule_week = 6
|
|
285
|
+ this.schedule_date = this.weekDayArr[5]
|
272
|
286
|
}
|
273
|
287
|
},
|
274
|
288
|
changeSchedule(id){
|
|
@@ -293,14 +307,15 @@ export default {
|
293
|
307
|
schedule_type:id,
|
294
|
308
|
schedule_week:this.schedule_week,
|
295
|
309
|
start_time:this.getTimestamp(this.weekDayArr[0]),
|
296
|
|
- end_time:this.getTimestamp(this.weekDayArr[6])
|
|
310
|
+ end_time:this.getTimestamp(this.weekDayArr[6]),
|
|
311
|
+ schedule_date:this.getTimestamp(this.schedule_date)
|
297
|
312
|
}
|
298
|
313
|
console.log("params",params)
|
299
|
|
- // return false
|
300
|
314
|
addSchedule(params).then(response=>{
|
301
|
315
|
if(response.data.state == 1){
|
302
|
316
|
var schedule = response.data.data.schedule
|
303
|
317
|
console.log("schedule",schedule)
|
|
318
|
+ this.$message.success("保存成功")
|
304
|
319
|
this.getStaffScheduleList()
|
305
|
320
|
}
|
306
|
321
|
})
|
|
@@ -473,6 +488,67 @@ export default {
|
473
|
488
|
console.log("stafflist",staffList)
|
474
|
489
|
}
|
475
|
490
|
})
|
|
491
|
+ },
|
|
492
|
+
|
|
493
|
+ DeleteStaffSchedule(){
|
|
494
|
+ const params = {
|
|
495
|
+ start_time:this.getTimestamp(this.weekDayArr[0]),
|
|
496
|
+ end_time:this.getTimestamp(this.weekDayArr[6])
|
|
497
|
+ }
|
|
498
|
+ console.log("params",params)
|
|
499
|
+ this.$confirm(
|
|
500
|
+ '是否要清除当周排班? <br>清除后,信息将无法恢复',
|
|
501
|
+ '删除提示',
|
|
502
|
+ {
|
|
503
|
+ dangerouslyUseHTMLString: true,
|
|
504
|
+ confirmButtonText: '确定',
|
|
505
|
+ cancelButtonText: '取消',
|
|
506
|
+ type: 'warning'
|
|
507
|
+ }
|
|
508
|
+ ).then(()=>{
|
|
509
|
+ DeleteStaffSchedule(params).then(response=>{
|
|
510
|
+ if(response.data.state == 1){
|
|
511
|
+ var msg = response.data.data.msg
|
|
512
|
+ this.$message.success("清除成功")
|
|
513
|
+ this.getStaffScheduleList()
|
|
514
|
+ }
|
|
515
|
+ })
|
|
516
|
+ })
|
|
517
|
+ },
|
|
518
|
+
|
|
519
|
+ copyStaffSchedule(){
|
|
520
|
+ const params = {
|
|
521
|
+ start_time:this.getTimestamp(this.weekDayArr[0]),
|
|
522
|
+ end_time:this.getTimestamp(this.weekDayArr[6])
|
|
523
|
+ }
|
|
524
|
+ copyStaffSchedule(params).then(response=>{
|
|
525
|
+ if(response.data.state == 1){
|
|
526
|
+ var msg = response.data.data.msg
|
|
527
|
+ console.log("msg",msg)
|
|
528
|
+ this.$message.success("复制成功")
|
|
529
|
+ }else{
|
|
530
|
+ this.$message.error("排班已存在")
|
|
531
|
+ }
|
|
532
|
+ })
|
|
533
|
+ },
|
|
534
|
+ toContinuous(){
|
|
535
|
+ var is_status = 0
|
|
536
|
+ if(this.isChecked == false){
|
|
537
|
+ is_status = 0
|
|
538
|
+ }
|
|
539
|
+ if(this.isChecked == true){
|
|
540
|
+ is_status = 1
|
|
541
|
+ }
|
|
542
|
+ const params = {
|
|
543
|
+ is_status:is_status
|
|
544
|
+ }
|
|
545
|
+ UpdateContinusSchedule(params).then(response=>{
|
|
546
|
+ if(response.data.state == 1){
|
|
547
|
+ var schedule = response.data.data.schedule
|
|
548
|
+ console.log("schedule",schedule)
|
|
549
|
+ this.$message.success("保存成功")
|
|
550
|
+ }
|
|
551
|
+ })
|
476
|
552
|
}
|
477
|
553
|
},
|
478
|
554
|
created(){
|