Browse Source

医护排班

XMLWAN 4 years ago
parent
commit
998b9bc46c

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

100
     params: params
100
     params: params
101
   })
101
   })
102
 }
102
 }
103
+
104
+export function DeleteStaffSchedule(params) {
105
+  return request({
106
+    url: '/api/schedule/deletestaffschedule',
107
+    methods: 'get',
108
+    params: params
109
+  })
110
+}
111
+
112
+export function copyStaffSchedule(params) {
113
+  return request({
114
+    url: '/api/schedule/copystaffschedule',
115
+    methods: 'get',
116
+    params: params
117
+  })
118
+}
119
+
120
+export function UpdateContinusSchedule(params) {
121
+  return request({
122
+    url: '/api/scheudle/updatecontinusschedule',
123
+    methods: 'get',
124
+    params: params
125
+  })
126
+}

+ 6 - 6
src/xt_pages/medicalScheduling/class.vue View File

86
                     style="width:140px;"
86
                     style="width:140px;"
87
                     v-model="form.timeone_start"
87
                     v-model="form.timeone_start"
88
                     :picker-options="{
88
                     :picker-options="{
89
-                    start: '08:00',
89
+                    start: '01:00',
90
                     step: '00:15',
90
                     step: '00:15',
91
                     end: '24:00'
91
                     end: '24:00'
92
                     }"
92
                     }"
105
                     style="width:140px;"
105
                     style="width:140px;"
106
                     v-model="form.timeone_end"
106
                     v-model="form.timeone_end"
107
                     :picker-options="{
107
                     :picker-options="{
108
-                    start: '08:00',
108
+                    start: '01:00',
109
                     step: '00:15',
109
                     step: '00:15',
110
                     end: '24:00'
110
                     end: '24:00'
111
                     }"
111
                     }"
190
                     style="width:140px;"
190
                     style="width:140px;"
191
                     v-model="form.timeone_start"
191
                     v-model="form.timeone_start"
192
                     :picker-options="{
192
                     :picker-options="{
193
-                    start: '08:00',
193
+                    start: '01:00',
194
                     step: '00:15',
194
                     step: '00:15',
195
                     end: '24:00'
195
                     end: '24:00'
196
                     }"
196
                     }"
209
                     style="width:140px;"
209
                     style="width:140px;"
210
                     v-model="form.timeone_end"
210
                     v-model="form.timeone_end"
211
                     :picker-options="{
211
                     :picker-options="{
212
-                    start: '08:00',
212
+                    start: '01:00',
213
                     step: '00:15',
213
                     step: '00:15',
214
                     end: '24:00'
214
                     end: '24:00'
215
                     }"
215
                     }"
225
                     style="width:140px;"
225
                     style="width:140px;"
226
                     v-model="form.timetwo_start"
226
                     v-model="form.timetwo_start"
227
                     :picker-options="{
227
                     :picker-options="{
228
-                    start: '08:00',
228
+                    start: '01:00',
229
                     step: '00:15',
229
                     step: '00:15',
230
                     end: '24:00'
230
                     end: '24:00'
231
                     }"
231
                     }"
243
                     style="width:140px;"
243
                     style="width:140px;"
244
                     v-model="form.timetwo_end"
244
                     v-model="form.timetwo_end"
245
                     :picker-options="{
245
                     :picker-options="{
246
-                    start: '08:00',
246
+                    start: '01:00',
247
                     step: '00:15',
247
                     step: '00:15',
248
                     end: '24:00'
248
                     end: '24:00'
249
                     }"
249
                     }"

+ 98 - 22
src/xt_pages/medicalScheduling/index.vue View File

3
         <div class="position">
3
         <div class="position">
4
             <bread-crumb :crumbs="crumbs"></bread-crumb>
4
             <bread-crumb :crumbs="crumbs"></bread-crumb>
5
             <div style="display:flex;align-items:center">
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
                 <el-button type="primary" icon="el-icon-printer" @click="toPrint">打印</el-button>
8
                 <el-button type="primary" icon="el-icon-printer" @click="toPrint">打印</el-button>
9
             </div>
9
             </div>
10
         </div>
10
         </div>
45
                                  {{scope.row.user_name}}
45
                                  {{scope.row.user_name}}
46
                             </template>
46
                             </template>
47
                         </el-table-column>
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
                             <template slot-scope="scope">
49
                             <template slot-scope="scope">
50
                                 <div @click="hangdleClick(scope.row,scope.$index)">
50
                                 <div @click="hangdleClick(scope.row,scope.$index)">
51
                                     <el-dropdown trigger="click" @command="changeSchedule">
51
                                     <el-dropdown trigger="click" @command="changeSchedule">
59
                                 </div>
59
                                 </div>
60
                             </template>
60
                             </template>
61
                         </el-table-column>
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
                              <template slot-scope="scope">
63
                              <template slot-scope="scope">
64
                                 <div @click="hangdleClick(scope.row,scope.$index)">
64
                                 <div @click="hangdleClick(scope.row,scope.$index)">
65
                                     <el-dropdown trigger="click" @command="changeSchedule">
65
                                     <el-dropdown trigger="click" @command="changeSchedule">
73
                                 </div>
73
                                 </div>
74
                             </template>
74
                             </template>
75
                         </el-table-column>
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
                              <template slot-scope="scope">
77
                              <template slot-scope="scope">
78
                                 <div @click="hangdleClick(scope.row,scope.$index)">
78
                                 <div @click="hangdleClick(scope.row,scope.$index)">
79
                                     <el-dropdown trigger="click" @command="changeSchedule">
79
                                     <el-dropdown trigger="click" @command="changeSchedule">
87
                                 </div>
87
                                 </div>
88
                             </template>
88
                             </template>
89
                         </el-table-column>
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
                              <template slot-scope="scope">
91
                              <template slot-scope="scope">
92
                                 <div @click="hangdleClick(scope.row,scope.$index)">
92
                                 <div @click="hangdleClick(scope.row,scope.$index)">
93
                                     <el-dropdown trigger="click" @command="changeSchedule">
93
                                     <el-dropdown trigger="click" @command="changeSchedule">
101
                                 </div>
101
                                 </div>
102
                             </template>
102
                             </template>
103
                         </el-table-column>
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
                              <template slot-scope="scope">
105
                              <template slot-scope="scope">
106
                                 <div @click="hangdleClick(scope.row,scope.$index)">
106
                                 <div @click="hangdleClick(scope.row,scope.$index)">
107
                                     <el-dropdown trigger="click" @command="changeSchedule">
107
                                     <el-dropdown trigger="click" @command="changeSchedule">
115
                                 </div>
115
                                 </div>
116
                             </template>
116
                             </template>
117
                         </el-table-column>
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
                              <template slot-scope="scope">
119
                              <template slot-scope="scope">
120
                                 <div @click="hangdleClick(scope.row,scope.$index)">
120
                                 <div @click="hangdleClick(scope.row,scope.$index)">
121
                                     <el-dropdown trigger="click" @command="changeSchedule">
121
                                     <el-dropdown trigger="click" @command="changeSchedule">
129
                                 </div>
129
                                 </div>
130
                             </template>
130
                             </template>
131
                         </el-table-column>
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
                              <template slot-scope="scope">
133
                              <template slot-scope="scope">
134
                                 <div @click="hangdleClick(scope.row,scope.$index)">
134
                                 <div @click="hangdleClick(scope.row,scope.$index)">
135
                                     <el-dropdown trigger="click" @command="changeSchedule">
135
                                     <el-dropdown trigger="click" @command="changeSchedule">
153
                             {{item.class_name}}&nbsp;({{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> )
153
                             {{item.class_name}}&nbsp;({{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>
154
                            </p>
155
                         </div>
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
                     </div>
157
                     </div>
158
                 </div>
158
                 </div>
159
             </div>
159
             </div>
164
 
164
 
165
 <script>
165
 <script>
166
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
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
 export default {
168
 export default {
169
     components:{
169
     components:{
170
         BreadCrumb
170
         BreadCrumb
199
             docobj:{},
199
             docobj:{},
200
             class_name:"",
200
             class_name:"",
201
             doctorlist:[],
201
             doctorlist:[],
202
+            schedule_date:"",
202
         }
203
         }
203
     },
204
     },
204
     methods:{
205
     methods:{
205
         search(){},
206
         search(){},
206
         toPrint(){
207
         toPrint(){
207
             this.$router.push({
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
                 // query: { date: date }
210
                 // query: { date: date }
210
             })
211
             })
211
         },
212
         },
249
       this.docobj = val
250
       this.docobj = val
250
      },
251
      },
251
      clickThis(row, column, cell, event){
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
            this.schedule_week = 0
260
            this.schedule_week = 0
261
+           this.schedule_date = this.weekDayArr[6]
254
         }
262
         }
255
-        if(column.label == "周一"){
263
+        if(weeks == "周一"){
256
            this.schedule_week = 1
264
            this.schedule_week = 1
265
+           this.schedule_date = this.weekDayArr[0]
257
         }
266
         }
258
-        if(column.label=="周二"){
267
+        if(weeks=="周二"){
259
            this.schedule_week = 2
268
            this.schedule_week = 2
269
+           this.schedule_date = this.weekDayArr[1]
260
         }
270
         }
261
-        if(column.label=="周三"){
271
+        if(weeks=="周三"){
262
           this.schedule_week = 3
272
           this.schedule_week = 3
273
+          this.schedule_date = this.weekDayArr[2]
263
         }
274
         }
264
-        if(column.label=="周四"){
275
+        if(weeks=="周四"){
265
           this.schedule_week = 4
276
           this.schedule_week = 4
277
+          this.schedule_date = this.weekDayArr[3]
266
         }
278
         }
267
-        if(column.label == "周五"){
279
+        if(weeks == "周五"){
268
            this.schedule_week = 5
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
      changeSchedule(id){
288
      changeSchedule(id){
293
           schedule_type:id,
307
           schedule_type:id,
294
           schedule_week:this.schedule_week,
308
           schedule_week:this.schedule_week,
295
           start_time:this.getTimestamp(this.weekDayArr[0]),
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
         console.log("params",params)
313
         console.log("params",params)
299
-    //    return false
300
        addSchedule(params).then(response=>{
314
        addSchedule(params).then(response=>{
301
          if(response.data.state == 1){
315
          if(response.data.state == 1){
302
              var schedule = response.data.data.schedule
316
              var schedule = response.data.data.schedule
303
              console.log("schedule",schedule)
317
              console.log("schedule",schedule)
318
+             this.$message.success("保存成功")
304
              this.getStaffScheduleList()
319
              this.getStaffScheduleList()
305
            }
320
            }
306
        })
321
        })
473
             console.log("stafflist",staffList)
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
    created(){
554
    created(){

+ 38 - 5
src/xt_pages/medicalScheduling/medical_print.vue View File

51
 <script>
51
 <script>
52
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
52
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
53
 import print from 'print-js'
53
 import print from 'print-js'
54
+import { getDoctorList,getStaffScheduleList } from '@/api/doctorSchedule'
54
 export default {
55
 export default {
55
     components:{
56
     components:{
56
         BreadCrumb
57
         BreadCrumb
57
     },
58
     },
58
     data(){
59
     data(){
59
         return{
60
         return{
60
-            crumbs: [
61
-                { path: false, name: '医护排班' },
62
-                { path: false, name: '排班打印' }
63
-            ],
61
+          crumbs: [
62
+            { path: false, name: '医护排班' },
63
+            { path: false, name: '排班打印' }
64
+          ],
65
+          start_time:"",
66
+          end_time:"",
64
         }
67
         }
65
     },
68
     },
66
     methods:{
69
     methods:{
74
             style: style,
77
             style: style,
75
             scanStyles: false
78
             scanStyles: false
76
             })
79
             })
77
-        }
80
+        },
81
+        getDoctorList(){
82
+          getDoctorList().then(response=>{
83
+             var list =  response.data.data.list
84
+             console.log("医护列表",list)
85
+              this.getStaffScheduleList()
86
+          })
87
+        },
88
+        //获取本周的所有排班列表
89
+       getStaffScheduleList(){
90
+          const params = {
91
+            start_time:this.start_time,
92
+            end_time:this.end_time,
93
+         }
94
+         getStaffScheduleList(params).then(response=>{
95
+            if(response.data.state == 1){
96
+              var staffList = response.data.data.staffList
97
+              console.log("staffList",staffList)
98
+            }
99
+         })
100
+       }
101
+    },
102
+    created(){
103
+      var starttime =  this.$route.query.starttime
104
+      console.log("starttime",starttime)
105
+      this.start_time = starttime
106
+      var endtime =  this.$route.query.endtime
107
+      console.log("endtime",endtime)
108
+      this.end_time = endtime
109
+      //获取该机构所有医护人员
110
+      this.getDoctorList()
78
     }
111
     }
79
 }
112
 }
80
 </script>
113
 </script>