|
@@ -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>
|
|
@@ -15,17 +15,17 @@
|
15
|
15
|
style="width: 150px;"
|
16
|
16
|
class="filter-item"
|
17
|
17
|
v-model.trim="keywords"
|
18
|
|
- placeholder="病人名称/透析号"
|
|
18
|
+ placeholder="请输入医护人员姓名"
|
19
|
19
|
/>
|
20
|
20
|
<el-button
|
21
|
21
|
size="small"
|
22
|
22
|
class="filter-item"
|
23
|
23
|
type="primary"
|
24
|
24
|
icon="el-icon-search"
|
25
|
|
- @click="search"
|
|
25
|
+ @click="toSearch"
|
26
|
26
|
>搜索</el-button
|
27
|
27
|
>
|
28
|
|
- <el-select style="margin-left:10px;width:150px;" v-model="typeValue" placeholder="请选择">
|
|
28
|
+ <el-select style="margin-left:10px;width:150px;" v-model="typeValue" placeholder="请选择" @change="changeOption">
|
29
|
29
|
<el-option
|
30
|
30
|
v-for="item in options"
|
31
|
31
|
:key="item.value"
|
|
@@ -39,43 +39,121 @@
|
39
|
39
|
</div>
|
40
|
40
|
<div style="display:flex;justify-content: space-between;">
|
41
|
41
|
<div style="width: 70%">
|
42
|
|
- <el-table :data="tableData" border :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}" :row-style="{ color: '#303133' }">
|
43
|
|
- <el-table-column prop="name" label="医护姓名" style="width:16%" align="center"></el-table-column>
|
44
|
|
- <el-table-column label="周一" style="width:14%" align="center">
|
|
42
|
+ <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-column prop="name" label="医护姓名" style="width:16%" align="center">
|
|
44
|
+ <template slot-scope="scope">
|
|
45
|
+ {{scope.row.user_name}}
|
|
46
|
+ </template>
|
|
47
|
+ </el-table-column>
|
|
48
|
+ <el-table-column :label="'周一 (' + weekDayArr[0] + ')'" style="width:200px" align="center">
|
45
|
49
|
<template slot-scope="scope">
|
46
|
50
|
<div @click="hangdleClick(scope.row,scope.$index)">
|
47
|
51
|
<el-dropdown trigger="click" @command="changeSchedule">
|
48
|
52
|
<span class="el-dropdown-link">
|
49
|
|
- {{scope.row.class_name}}<i class="el-icon-arrow-down el-icon--right"></i>
|
|
53
|
+ <span v-if="scope.row.class_index == 1">{{scope.row.class_name}}</span><i class="el-icon-arrow-down el-icon--right"></i>
|
|
54
|
+ </span>
|
|
55
|
+ <el-dropdown-menu slot="dropdown" >
|
|
56
|
+ <el-dropdown-item :command="item.id" icon="el-icon-plus" v-for="(item,index) in schedulelist" :key="index">{{item.class_name}}</el-dropdown-item>
|
|
57
|
+ </el-dropdown-menu>
|
|
58
|
+ </el-dropdown>
|
|
59
|
+ </div>
|
|
60
|
+ </template>
|
|
61
|
+ </el-table-column>
|
|
62
|
+ <el-table-column prop="name" :label="'周二 (' + weekDayArr[1] + ')'" style="width:14%" align="center">
|
|
63
|
+ <template slot-scope="scope">
|
|
64
|
+ <div @click="hangdleClick(scope.row,scope.$index)">
|
|
65
|
+ <el-dropdown trigger="click" @command="changeSchedule">
|
|
66
|
+ <span class="el-dropdown-link">
|
|
67
|
+ <span v-if="scope.row.class_index == 2">{{scope.row.class_name}}</span><i class="el-icon-arrow-down el-icon--right"></i>
|
|
68
|
+ </span>
|
|
69
|
+ <el-dropdown-menu slot="dropdown" >
|
|
70
|
+ <el-dropdown-item :command="item.id" icon="el-icon-plus" v-for="(item,index) in schedulelist" :key="index">{{item.class_name}}</el-dropdown-item>
|
|
71
|
+ </el-dropdown-menu>
|
|
72
|
+ </el-dropdown>
|
|
73
|
+ </div>
|
|
74
|
+ </template>
|
|
75
|
+ </el-table-column>
|
|
76
|
+ <el-table-column prop="name" :label="'周三 (' + weekDayArr[2] + ')'" style="width:14%" align="center">
|
|
77
|
+ <template slot-scope="scope">
|
|
78
|
+ <div @click="hangdleClick(scope.row,scope.$index)">
|
|
79
|
+ <el-dropdown trigger="click" @command="changeSchedule">
|
|
80
|
+ <span class="el-dropdown-link">
|
|
81
|
+ <span v-if="scope.row.class_index == 3">{{scope.row.class_name}}</span><i class="el-icon-arrow-down el-icon--right"></i>
|
|
82
|
+ </span>
|
|
83
|
+ <el-dropdown-menu slot="dropdown" >
|
|
84
|
+ <el-dropdown-item :command="item.id" icon="el-icon-plus" v-for="(item,index) in schedulelist" :key="index">{{item.class_name}}</el-dropdown-item>
|
|
85
|
+ </el-dropdown-menu>
|
|
86
|
+ </el-dropdown>
|
|
87
|
+ </div>
|
|
88
|
+ </template>
|
|
89
|
+ </el-table-column>
|
|
90
|
+ <el-table-column prop="name" :label="'周四 (' + weekDayArr[3] + ')'" style="width:14%" align="center">
|
|
91
|
+ <template slot-scope="scope">
|
|
92
|
+ <div @click="hangdleClick(scope.row,scope.$index)">
|
|
93
|
+ <el-dropdown trigger="click" @command="changeSchedule">
|
|
94
|
+ <span class="el-dropdown-link">
|
|
95
|
+ <span v-if="scope.row.class_index ==4">{{scope.row.class_name}}</span><i class="el-icon-arrow-down el-icon--right"></i>
|
|
96
|
+ </span>
|
|
97
|
+ <el-dropdown-menu slot="dropdown" >
|
|
98
|
+ <el-dropdown-item :command="item.id" icon="el-icon-plus" v-for="(item,index) in schedulelist" :key="index">{{item.class_name}}</el-dropdown-item>
|
|
99
|
+ </el-dropdown-menu>
|
|
100
|
+ </el-dropdown>
|
|
101
|
+ </div>
|
|
102
|
+ </template>
|
|
103
|
+ </el-table-column>
|
|
104
|
+ <el-table-column prop="name" :label="'周五 (' + weekDayArr[4] + ')'" style="width:14%" align="center">
|
|
105
|
+ <template slot-scope="scope">
|
|
106
|
+ <div @click="hangdleClick(scope.row,scope.$index)">
|
|
107
|
+ <el-dropdown trigger="click" @command="changeSchedule">
|
|
108
|
+ <span class="el-dropdown-link">
|
|
109
|
+ <span v-if="scope.row.class_index == 5">{{scope.row.class_name}}</span><i class="el-icon-arrow-down el-icon--right"></i>
|
|
110
|
+ </span>
|
|
111
|
+ <el-dropdown-menu slot="dropdown" >
|
|
112
|
+ <el-dropdown-item :command="item.id" icon="el-icon-plus" v-for="(item,index) in schedulelist" :key="index">{{item.class_name}}</el-dropdown-item>
|
|
113
|
+ </el-dropdown-menu>
|
|
114
|
+ </el-dropdown>
|
|
115
|
+ </div>
|
|
116
|
+ </template>
|
|
117
|
+ </el-table-column>
|
|
118
|
+ <el-table-column prop="name" :label="'周六 (' + weekDayArr[5] + ')'" style="width:14%" align="center">
|
|
119
|
+ <template slot-scope="scope">
|
|
120
|
+ <div @click="hangdleClick(scope.row,scope.$index)">
|
|
121
|
+ <el-dropdown trigger="click" @command="changeSchedule">
|
|
122
|
+ <span class="el-dropdown-link">
|
|
123
|
+ <span v-if="scope.row.class_index==6">{{scope.row.class_name}}</span><i class="el-icon-arrow-down el-icon--right"></i>
|
|
124
|
+ </span>
|
|
125
|
+ <el-dropdown-menu slot="dropdown" >
|
|
126
|
+ <el-dropdown-item :command="item.id" icon="el-icon-plus" v-for="(item,index) in schedulelist" :key="index">{{item.class_name}}</el-dropdown-item>
|
|
127
|
+ </el-dropdown-menu>
|
|
128
|
+ </el-dropdown>
|
|
129
|
+ </div>
|
|
130
|
+ </template>
|
|
131
|
+ </el-table-column>
|
|
132
|
+ <el-table-column prop="name" :label="'周日 (' + weekDayArr[6] + ')'" style="width:14%" align="center">
|
|
133
|
+ <template slot-scope="scope">
|
|
134
|
+ <div @click="hangdleClick(scope.row,scope.$index)">
|
|
135
|
+ <el-dropdown trigger="click" @command="changeSchedule">
|
|
136
|
+ <span class="el-dropdown-link">
|
|
137
|
+ <span v-if="scope.row.class_index == 0">{{scope.row.class_name}}</span><i class="el-icon-arrow-down el-icon--right"></i>
|
50
|
138
|
</span>
|
51
|
139
|
<el-dropdown-menu slot="dropdown" >
|
52
|
140
|
<el-dropdown-item :command="item.id" icon="el-icon-plus" v-for="(item,index) in schedulelist" :key="index">{{item.class_name}}</el-dropdown-item>
|
53
|
141
|
</el-dropdown-menu>
|
54
|
142
|
</el-dropdown>
|
55
|
143
|
</div>
|
56
|
|
-
|
57
|
|
-
|
58
|
144
|
</template>
|
59
|
145
|
</el-table-column>
|
60
|
|
- <el-table-column prop="name" label="周二" style="width:14%" align="center"></el-table-column>
|
61
|
|
- <el-table-column prop="name" label="周三" style="width:14%" align="center"></el-table-column>
|
62
|
|
- <el-table-column prop="name" label="周四" style="width:14%" align="center"></el-table-column>
|
63
|
|
- <el-table-column prop="name" label="周五" style="width:14%" align="center"></el-table-column>
|
64
|
|
- <el-table-column prop="name" label="周六" style="width:14%" align="center"></el-table-column>
|
65
|
|
- <el-table-column prop="name" label="周日" style="width:14%" align="center"></el-table-column>
|
66
|
146
|
</el-table>
|
67
|
147
|
</div>
|
68
|
148
|
<div class="classBox">
|
69
|
149
|
<div class="classTitle">班种</div>
|
70
|
150
|
<div class="classMain">
|
71
|
|
- <div>
|
72
|
|
- <p>早班(08:00~12:00)</p>
|
73
|
|
- <p>中班(12:00~18:00)</p>
|
74
|
|
- <p>晚班(18:00~24:00)</p>
|
75
|
|
- <p>全班(08:00~18:00)</p>
|
|
151
|
+ <div v-for="(item,index) in schedulelist" :key="index">
|
|
152
|
+ <p>
|
|
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
|
+ </p>
|
76
|
155
|
</div>
|
77
|
|
-
|
78
|
|
- <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>
|
79
|
157
|
</div>
|
80
|
158
|
</div>
|
81
|
159
|
</div>
|
|
@@ -86,7 +164,7 @@
|
86
|
164
|
|
87
|
165
|
<script>
|
88
|
166
|
import BreadCrumb from '@/xt_pages/components/bread-crumb'
|
89
|
|
-import { getDoctorList,getScheduleList,addSchedule } from '@/api/doctorSchedule'
|
|
167
|
+import { getDoctorList,getScheduleList,addSchedule,getStaffScheduleList,getNextWeekList,getScheduleByDoctorId,toSearchScheduleList,DeleteStaffSchedule,copyStaffSchedule,UpdateContinusSchedule } from '@/api/doctorSchedule'
|
90
|
168
|
export default {
|
91
|
169
|
components:{
|
92
|
170
|
BreadCrumb
|
|
@@ -109,54 +187,31 @@ export default {
|
109
|
187
|
label: '护士'
|
110
|
188
|
}],
|
111
|
189
|
typeValue:'1',
|
112
|
|
- tableData: [{
|
113
|
|
- date: '2016-05-02',
|
114
|
|
- name: '王小虎',
|
115
|
|
- address: '上海市普陀区金沙江路 1518 弄'
|
116
|
|
- }, {
|
117
|
|
- date: '2016-05-04',
|
118
|
|
- name: '王小虎',
|
119
|
|
- address: '上海市普陀区金沙江路 1517 弄'
|
120
|
|
- }, {
|
121
|
|
- date: '2016-05-01',
|
122
|
|
- name: '王小虎',
|
123
|
|
- address: '上海市普陀区金沙江路 1519 弄'
|
124
|
|
- }, {
|
125
|
|
- date: '2016-05-03',
|
126
|
|
- name: '王小虎',
|
127
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
128
|
|
- }],
|
|
190
|
+ tableData: [],
|
129
|
191
|
isChecked:true,
|
|
192
|
+ schedulelist:[],
|
130
|
193
|
weekNum:'',
|
131
|
194
|
weekDayArr:[],
|
132
|
195
|
todayDate:'',
|
133
|
196
|
clen:7,
|
134
|
|
- nowYear: new Date().getFullYear(),
|
135
|
|
- weekNum:'',
|
136
|
|
- weekDayArr:[],
|
137
|
|
- todayDate:'',
|
138
|
|
- clen:7,
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
139
|
202
|
nowYear: new Date().getFullYear(),
|
140
|
203
|
schedule_week:0,
|
141
|
204
|
docobj:{},
|
142
|
|
- class_name:""
|
|
205
|
+ class_name:"",
|
|
206
|
+ doctorlist:[],
|
|
207
|
+ schedule_date:"",
|
143
|
208
|
}
|
144
|
209
|
},
|
145
|
|
- created(){
|
146
|
|
- let year = new Date().getFullYear()
|
147
|
|
- let month = new Date().getMonth() + 1
|
148
|
|
- let date = new Date().getDate()
|
149
|
|
- this.weekNum = this.getYearWeek(year,month,date)
|
150
|
|
-
|
151
|
|
- this.todayDate=this.formatDate(new Date())
|
152
|
|
- this.setDate(new Date())
|
153
|
|
-
|
154
|
|
- },
|
155
|
210
|
methods:{
|
156
|
211
|
search(){},
|
157
|
212
|
toPrint(){
|
158
|
213
|
this.$router.push({
|
159
|
|
- path: '/medicalScheduling/schedule/print',
|
|
214
|
+ path: '/medicalScheduling/schedule/print?starttime='+this.getTimestamp(this.weekDayArr[0])+"&endtime="+this.getTimestamp(this.weekDayArr[6]),
|
160
|
215
|
// query: { date: date }
|
161
|
216
|
})
|
162
|
217
|
},
|
|
@@ -164,33 +219,11 @@ export default {
|
164
|
219
|
getDoctorList().then(response=>{
|
165
|
220
|
if(response.data.state == 1){
|
166
|
221
|
var list = response.data.data.list
|
|
222
|
+ console.log("医护列表",list)
|
167
|
223
|
this.tableData = list
|
168
|
|
-
|
169
|
|
-
|
170
|
|
-
|
171
|
|
-
|
172
|
|
-
|
173
|
|
-
|
174
|
|
-
|
175
|
|
-
|
176
|
|
-
|
177
|
|
-
|
178
|
|
-
|
179
|
|
-
|
180
|
|
-
|
181
|
|
-
|
182
|
|
-
|
183
|
|
-
|
184
|
|
-
|
185
|
|
-
|
186
|
|
-
|
187
|
|
-
|
188
|
|
-
|
189
|
|
-
|
190
|
|
-
|
191
|
|
-
|
192
|
|
-
|
193
|
|
-
|
|
224
|
+ this.doctorlist = list
|
|
225
|
+ //获取班种列表
|
|
226
|
+ this.getStaffScheduleList()
|
194
|
227
|
}
|
195
|
228
|
})
|
196
|
229
|
},
|
|
@@ -198,6 +231,7 @@ export default {
|
198
|
231
|
getScheduleList().then(response=>{
|
199
|
232
|
if(response.data.state == 1){
|
200
|
233
|
var schedulelist = response.data.data.scheduleList
|
|
234
|
+ console.log("schedulelist",schedulelist)
|
201
|
235
|
for(let i=0;i<schedulelist.length;i++){
|
202
|
236
|
if(schedulelist[i].timeone_type == 1){
|
203
|
237
|
schedulelist[i].timeone_type = "当日"
|
|
@@ -217,9 +251,44 @@ export default {
|
217
|
251
|
})
|
218
|
252
|
},
|
219
|
253
|
hangdleClick(val,index){
|
220
|
|
- this.schedule_week = index
|
221
|
254
|
this.docobj = val
|
222
|
255
|
},
|
|
256
|
+ clickThis(row, column, cell, event){
|
|
257
|
+ // console.log("row",row)
|
|
258
|
+ // console.log("column",column)
|
|
259
|
+ // console.log("日期",this.weekDayArr)
|
|
260
|
+ var week = (column.label).split('');
|
|
261
|
+ var weeks = week[0]+week[1]
|
|
262
|
+ console.log("weeks",weeks)
|
|
263
|
+ if(weeks == "周日"){
|
|
264
|
+ this.schedule_week = 0
|
|
265
|
+ this.schedule_date = this.weekDayArr[6]
|
|
266
|
+ }
|
|
267
|
+ if(weeks == "周一"){
|
|
268
|
+ this.schedule_week = 1
|
|
269
|
+ this.schedule_date = this.weekDayArr[0]
|
|
270
|
+ }
|
|
271
|
+ if(weeks=="周二"){
|
|
272
|
+ this.schedule_week = 2
|
|
273
|
+ this.schedule_date = this.weekDayArr[1]
|
|
274
|
+ }
|
|
275
|
+ if(weeks=="周三"){
|
|
276
|
+ this.schedule_week = 3
|
|
277
|
+ this.schedule_date = this.weekDayArr[2]
|
|
278
|
+ }
|
|
279
|
+ if(weeks=="周四"){
|
|
280
|
+ this.schedule_week = 4
|
|
281
|
+ this.schedule_date = this.weekDayArr[3]
|
|
282
|
+ }
|
|
283
|
+ if(weeks == "周五"){
|
|
284
|
+ this.schedule_week = 5
|
|
285
|
+ this.schedule_date = this.weekDayArr[4]
|
|
286
|
+ }
|
|
287
|
+ if(weeks== "周六"){
|
|
288
|
+ this.schedule_week = 6
|
|
289
|
+ this.schedule_date = this.weekDayArr[5]
|
|
290
|
+ }
|
|
291
|
+ },
|
223
|
292
|
changeSchedule(id){
|
224
|
293
|
var class_name = ""
|
225
|
294
|
for(let i=0;i<this.schedulelist.length;i++){
|
|
@@ -231,8 +300,10 @@ export default {
|
231
|
300
|
for(let i=0;i<arr.length;i++){
|
232
|
301
|
if(this.docobj.id == arr[i].id){
|
233
|
302
|
arr[i].class_name = class_name
|
|
303
|
+ arr[i].class_index = this.schedule_week
|
234
|
304
|
}
|
235
|
305
|
}
|
|
306
|
+ console.log("arr",arr)
|
236
|
307
|
this.tableData = arr
|
237
|
308
|
const params = {
|
238
|
309
|
doctor_id:this.docobj.admin_user_id,
|
|
@@ -240,18 +311,19 @@ export default {
|
240
|
311
|
schedule_type:id,
|
241
|
312
|
schedule_week:this.schedule_week,
|
242
|
313
|
start_time:this.getTimestamp(this.weekDayArr[0]),
|
243
|
|
- end_time:this.getTimestamp(this.weekDayArr[6])
|
|
314
|
+ end_time:this.getTimestamp(this.weekDayArr[6]),
|
|
315
|
+ schedule_date:this.getTimestamp(this.schedule_date)
|
244
|
316
|
}
|
245
|
317
|
console.log("params",params)
|
246
|
|
-
|
247
|
318
|
addSchedule(params).then(response=>{
|
248
|
319
|
if(response.data.state == 1){
|
249
|
320
|
var schedule = response.data.data.schedule
|
250
|
321
|
console.log("schedule",schedule)
|
|
322
|
+ this.$message.success("保存成功")
|
|
323
|
+ this.getStaffScheduleList()
|
251
|
324
|
}
|
252
|
325
|
})
|
253
|
326
|
},
|
254
|
|
-
|
255
|
327
|
formatDate(date){
|
256
|
328
|
var year = date.getFullYear()+'.'
|
257
|
329
|
var month = (date.getMonth()+1)+'.';
|
|
@@ -290,6 +362,7 @@ export default {
|
290
|
362
|
this.weekNum = this.getYearWeek(year,month,date)
|
291
|
363
|
this.nowYear = this.nowYear - 1
|
292
|
364
|
}
|
|
365
|
+ this.getNextWeekList()
|
293
|
366
|
},
|
294
|
367
|
//下一周
|
295
|
368
|
nextclick(){
|
|
@@ -303,6 +376,7 @@ export default {
|
303
|
376
|
this.weekNum = this.getYearWeek(year,month,date)
|
304
|
377
|
this.nowYear = this.nowYear + 1
|
305
|
378
|
}
|
|
379
|
+ this.getNextWeekList()
|
306
|
380
|
},
|
307
|
381
|
|
308
|
382
|
getYearWeek(year,month,date){
|
|
@@ -325,7 +399,161 @@ export default {
|
325
|
399
|
'command': item,
|
326
|
400
|
'row': row
|
327
|
401
|
}
|
328
|
|
- }
|
|
402
|
+ },
|
|
403
|
+
|
|
404
|
+ //获取所有医护排班数据
|
|
405
|
+ getStaffScheduleList(){
|
|
406
|
+ const params = {
|
|
407
|
+ start_time:this.getTimestamp(this.weekDayArr[0]),
|
|
408
|
+ end_time:this.getTimestamp(this.weekDayArr[6])
|
|
409
|
+ }
|
|
410
|
+ getStaffScheduleList(params).then(response=>{
|
|
411
|
+ if(response.data.state == 1){
|
|
412
|
+ var staffList = response.data.data.staffList
|
|
413
|
+ for(let i=0;i<staffList.length;i++){
|
|
414
|
+ if(staffList[i].schedule_week == 0){
|
|
415
|
+ staffList[i].class_index = 0
|
|
416
|
+ }
|
|
417
|
+ if(staffList[i].schedule_week == 1){
|
|
418
|
+ staffList[i].class_index = 1
|
|
419
|
+ }
|
|
420
|
+ if(staffList[i].schedule_week == 2){
|
|
421
|
+ staffList[i].class_index = 2
|
|
422
|
+ }
|
|
423
|
+ if(staffList[i].schedule_week == 3){
|
|
424
|
+ staffList[i].class_index = 3
|
|
425
|
+ }
|
|
426
|
+ if(staffList[i].schedule_week == 4){
|
|
427
|
+ staffList[i].class_index = 4
|
|
428
|
+ }
|
|
429
|
+ if(staffList[i].schedule_week == 5){
|
|
430
|
+ staffList[i].class_index = 5
|
|
431
|
+ }
|
|
432
|
+ if(staffList[i].schedule_week == 6){
|
|
433
|
+ staffList[i].class_index = 6
|
|
434
|
+ }
|
|
435
|
+ }
|
|
436
|
+ // console.log("staffList--------",staffList)
|
|
437
|
+ // if(staffList.length == 0){
|
|
438
|
+ // this.tableData = this.doctorlist
|
|
439
|
+ // }else{
|
|
440
|
+ // this.tableData = []
|
|
441
|
+ // this.tableData = staffList
|
|
442
|
+ // }
|
|
443
|
+
|
|
444
|
+ }
|
|
445
|
+ })
|
|
446
|
+ },
|
|
447
|
+
|
|
448
|
+ //获取上一周下一周的排班数据
|
|
449
|
+ getNextWeekList(){
|
|
450
|
+ const params = {
|
|
451
|
+ start_time:this.getTimestamp(this.weekDayArr[0]),
|
|
452
|
+ end_time:this.getTimestamp(this.weekDayArr[6])
|
|
453
|
+ }
|
|
454
|
+ getNextWeekList(params).then(response=>{
|
|
455
|
+ if(response.data.state == 1){
|
|
456
|
+ var staffList = response.data.data.staffList
|
|
457
|
+ console.log("上下周数据",staffList)
|
|
458
|
+ }
|
|
459
|
+ })
|
|
460
|
+ },
|
|
461
|
+
|
|
462
|
+ changeOption(id){
|
|
463
|
+ const params = {
|
|
464
|
+ start_time:this.getTimestamp(this.weekDayArr[0]),
|
|
465
|
+ end_time:this.getTimestamp(this.weekDayArr[6]),
|
|
466
|
+ doctor_id:id
|
|
467
|
+ }
|
|
468
|
+ getScheduleByDoctorId(params).then(response=>{
|
|
469
|
+ if(response.data.state == 1){
|
|
470
|
+ var staffList = response.data.data.staffList
|
|
471
|
+ console.log("staffList",staffList)
|
|
472
|
+
|
|
473
|
+ }
|
|
474
|
+ })
|
|
475
|
+ },
|
|
476
|
+ toSearch(){
|
|
477
|
+ console.log("医护人员姓名",this.keywords)
|
|
478
|
+ var id = 0
|
|
479
|
+ for(let i = 0 ;i<this.doctorlist.length;i++){
|
|
480
|
+ if(this.keywords == this.doctorlist[i].user_name){
|
|
481
|
+ id = this.doctorlist[i].admin_user_id
|
|
482
|
+ }
|
|
483
|
+ }
|
|
484
|
+ const params = {
|
|
485
|
+ doctor_id:id,
|
|
486
|
+ start_time:this.getTimestamp(this.weekDayArr[0]),
|
|
487
|
+ end_time:this.getTimestamp(this.weekDayArr[6])
|
|
488
|
+ }
|
|
489
|
+ toSearchScheduleList(params).then(response=>{
|
|
490
|
+ if(response.data.state == 1){
|
|
491
|
+ var staffList = response.data.data.staffList
|
|
492
|
+ console.log("stafflist",staffList)
|
|
493
|
+ }
|
|
494
|
+ })
|
|
495
|
+ },
|
|
496
|
+
|
|
497
|
+ DeleteStaffSchedule(){
|
|
498
|
+ const params = {
|
|
499
|
+ start_time:this.getTimestamp(this.weekDayArr[0]),
|
|
500
|
+ end_time:this.getTimestamp(this.weekDayArr[6])
|
|
501
|
+ }
|
|
502
|
+ console.log("params",params)
|
|
503
|
+ this.$confirm(
|
|
504
|
+ '是否要清除当周排班? <br>清除后,信息将无法恢复',
|
|
505
|
+ '删除提示',
|
|
506
|
+ {
|
|
507
|
+ dangerouslyUseHTMLString: true,
|
|
508
|
+ confirmButtonText: '确定',
|
|
509
|
+ cancelButtonText: '取消',
|
|
510
|
+ type: 'warning'
|
|
511
|
+ }
|
|
512
|
+ ).then(()=>{
|
|
513
|
+ DeleteStaffSchedule(params).then(response=>{
|
|
514
|
+ if(response.data.state == 1){
|
|
515
|
+ var msg = response.data.data.msg
|
|
516
|
+ this.$message.success("清除成功")
|
|
517
|
+ this.getStaffScheduleList()
|
|
518
|
+ }
|
|
519
|
+ })
|
|
520
|
+ })
|
|
521
|
+ },
|
|
522
|
+
|
|
523
|
+ copyStaffSchedule(){
|
|
524
|
+ const params = {
|
|
525
|
+ start_time:this.getTimestamp(this.weekDayArr[0]),
|
|
526
|
+ end_time:this.getTimestamp(this.weekDayArr[6])
|
|
527
|
+ }
|
|
528
|
+ copyStaffSchedule(params).then(response=>{
|
|
529
|
+ if(response.data.state == 1){
|
|
530
|
+ var msg = response.data.data.msg
|
|
531
|
+ console.log("msg",msg)
|
|
532
|
+ this.$message.success("复制成功")
|
|
533
|
+ }else{
|
|
534
|
+ this.$message.error("排班已存在")
|
|
535
|
+ }
|
|
536
|
+ })
|
|
537
|
+ },
|
|
538
|
+ toContinuous(){
|
|
539
|
+ var is_status = 0
|
|
540
|
+ if(this.isChecked == false){
|
|
541
|
+ is_status = 0
|
|
542
|
+ }
|
|
543
|
+ if(this.isChecked == true){
|
|
544
|
+ is_status = 1
|
|
545
|
+ }
|
|
546
|
+ const params = {
|
|
547
|
+ is_status:is_status
|
|
548
|
+ }
|
|
549
|
+ UpdateContinusSchedule(params).then(response=>{
|
|
550
|
+ if(response.data.state == 1){
|
|
551
|
+ var schedule = response.data.data.schedule
|
|
552
|
+ console.log("schedule",schedule)
|
|
553
|
+ this.$message.success("保存成功")
|
|
554
|
+ }
|
|
555
|
+ })
|
|
556
|
+ }
|
329
|
557
|
},
|
330
|
558
|
created(){
|
331
|
559
|
//获取医护人员
|