|
@@ -15,31 +15,40 @@
|
15
|
15
|
<span class="main_title">{{ $store.getters.xt_user.org.org_name }}医护排班统计表</span>
|
16
|
16
|
</div>
|
17
|
17
|
<div style="text-align:right;margin-bottom:20px;font-size: 18px;">
|
18
|
|
- 打印时间:
|
|
18
|
+ 打印时间:{{ getNowFormatDate()}}
|
19
|
19
|
</div>
|
20
|
20
|
<div class="table_panel">
|
21
|
21
|
<table class="table">
|
22
|
22
|
<thead>
|
23
|
23
|
<tr>
|
24
|
|
- <td width="120">医护姓名</td>
|
25
|
|
- <td width="120">医护姓名</td>
|
26
|
|
- <td width="120">医护姓名</td>
|
27
|
|
- <td width="120">医护姓名</td>
|
28
|
|
- <td width="120">医护姓名</td>
|
29
|
|
- <td width="120">医护姓名</td>
|
|
24
|
+ <td width="150">医护姓名</td>
|
|
25
|
+ <td width="120" v-for="(modeItem, index) in scheduleList" :key="index">{{modeItem.class_name}}</td>
|
|
26
|
+ <td width="120">总工时/小时</td>
|
|
27
|
+ <td width="120">出勤/天</td>
|
|
28
|
+ <td width="120">缺勤/天</td>
|
30
|
29
|
</tr>
|
31
|
30
|
</thead>
|
32
|
31
|
<tbody>
|
33
|
|
- <tr>
|
34
|
|
- <td width="120">医护姓名</td>
|
35
|
|
- <td width="120">医护姓名</td>
|
36
|
|
- <td width="120">医护姓名</td>
|
37
|
|
- <td width="120">医护姓名</td>
|
38
|
|
- <td width="120">医护姓名</td>
|
39
|
|
- <td width="120">医护姓名</td>
|
|
32
|
+ <tr v-for="(item,i) in tableData" :key="i">
|
|
33
|
+ <td width="120">
|
|
34
|
+ {{ item.user_name}}
|
|
35
|
+ </td>
|
|
36
|
+ <td width="120" v-for="(it,i) in scheduleList" :key="i">
|
|
37
|
+ {{ getCount(item.doctor_id,it.class_name) }}
|
|
38
|
+ </td>
|
|
39
|
+ <td width="120">
|
|
40
|
+ {{ item.user_name}}
|
|
41
|
+ </td>
|
|
42
|
+ <td width="120">
|
|
43
|
+ {{item.attendance}}
|
|
44
|
+ </td>
|
|
45
|
+ <td width="120">
|
|
46
|
+ {{item.absence}}
|
|
47
|
+ </td>
|
40
|
48
|
</tr>
|
41
|
49
|
</tbody>
|
42
|
50
|
</table>
|
|
51
|
+
|
43
|
52
|
</div>
|
44
|
53
|
</div>
|
45
|
54
|
</div>
|
|
@@ -49,6 +58,8 @@
|
49
|
58
|
|
50
|
59
|
<script>
|
51
|
60
|
import BreadCrumb from '@/xt_pages/components/bread-crumb'
|
|
61
|
+import { getDoctorList,getScheduleListTotal,getScheduleList } from '@/api/doctorSchedule'
|
|
62
|
+import { parseTime } from '@/utils'
|
52
|
63
|
import print from 'print-js'
|
53
|
64
|
export default {
|
54
|
65
|
components:{
|
|
@@ -60,13 +71,195 @@ export default {
|
60
|
71
|
{ path: false, name: '医护排班' },
|
61
|
72
|
{ path: false, name: '排班统计打印' }
|
62
|
73
|
],
|
|
74
|
+ start_time:0,
|
|
75
|
+ end_time:0,
|
|
76
|
+ doctorlist:[],
|
|
77
|
+ tableData:[],
|
|
78
|
+ scheduleList:[],
|
63
|
79
|
}
|
64
|
80
|
},
|
65
|
81
|
created(){
|
66
|
|
-
|
|
82
|
+
|
|
83
|
+ var startime = this.$route.query.start_time
|
|
84
|
+ this.start_time = parseInt(startime)
|
|
85
|
+ console.log("开始时间",this.start_time)
|
|
86
|
+ var end_time = this.$route.query.end_time
|
|
87
|
+ this.end_time = parseInt(end_time)
|
|
88
|
+ console.log("结束时间",this.end_time)
|
|
89
|
+ //获取该机构所有医护人员
|
|
90
|
+ this.getDoctorList()
|
|
91
|
+ // 获取统计表的数据
|
|
92
|
+ this.getlist()
|
|
93
|
+ //获取所有排班种
|
|
94
|
+ this.getScheduleList()
|
67
|
95
|
},
|
68
|
96
|
methods:{
|
|
97
|
+ getDoctorList(){
|
|
98
|
+ getDoctorList().then(response=>{
|
|
99
|
+ var list = response.data.data.list
|
|
100
|
+ var doctorlist = response.data.data.doctorlist
|
|
101
|
+ var nurselist = response.data.data.nurselist
|
|
102
|
+ this.doctorArr = doctorlist
|
|
103
|
+ this.nurseArr = nurselist
|
|
104
|
+ this.doctorlist.push(...nurselist)
|
|
105
|
+ this.doctorlist.push(...doctorlist)
|
|
106
|
+ })
|
|
107
|
+ },
|
|
108
|
+
|
|
109
|
+ //获取统计表数据
|
|
110
|
+ getlist(){
|
|
111
|
+ if(this.timeSlot == 1){
|
|
112
|
+ this.start_time = this.getTimestamp(this.weekDayArr[0]),
|
|
113
|
+ this.end_time = this.getTimestamp(this.weekDayArr[6])
|
|
114
|
+ }
|
|
115
|
+ const params = {
|
|
116
|
+ start_time:this.start_time,
|
|
117
|
+ end_time:this.end_time,
|
|
118
|
+ }
|
|
119
|
+ // console.log("params",params)
|
|
120
|
+ getScheduleListTotal(params).then(response=>{
|
|
121
|
+ if(response.data.state == 1){
|
|
122
|
+ //获取每个班次对应的次数
|
|
123
|
+ var scheudleTotal = response.data.data.scheudletotal
|
|
124
|
+ // console.log("scheudletotal",scheudleTotal)
|
|
125
|
+ //获取总分钟数
|
|
126
|
+ var list = response.data.data.list
|
|
127
|
+ // console.log("list",list)
|
|
128
|
+ var workday = response.data.data.workDay
|
|
129
|
+ // console.log("workday",workday)
|
|
130
|
+ var noWorkDay = response.data.data.noWorkDay
|
|
131
|
+ // console.log("noWorkDay",noWorkDay)
|
|
132
|
+
|
|
133
|
+ let tempArr = [], newArr = []
|
|
134
|
+ for (let i = 0; i < scheudleTotal.length; i++) {
|
|
135
|
+ if (tempArr.indexOf(scheudleTotal[i].user_name) === -1) {
|
|
136
|
+ newArr.push({
|
|
137
|
+ user_name: scheudleTotal[i].user_name,
|
|
138
|
+ doctor_id:scheudleTotal[i].doctor_id,
|
|
139
|
+ list: [{class_name:scheudleTotal[i].class_name,doctor_id:scheudleTotal[i].doctor_id,Count:scheudleTotal[i].Count}]
|
|
140
|
+ })
|
|
141
|
+ tempArr.push(scheudleTotal[i].user_name);
|
|
142
|
+ } else {
|
|
143
|
+ for (let j = 0; j < newArr.length; j++) {
|
|
144
|
+ if (newArr[j].user_name == scheudleTotal[i].user_name) {
|
|
145
|
+ newArr[j].list.push({class_name:scheudleTotal[i].class_name,doctor_id:scheudleTotal[i].doctor_id,Count:scheudleTotal[i].Count})
|
|
146
|
+ }
|
|
147
|
+ }
|
|
148
|
+ }
|
|
149
|
+ }
|
|
150
|
+
|
|
151
|
+ newArr.map(item => {
|
|
152
|
+ list.map(it => {
|
|
153
|
+ if(item.doctor_id == it.doctor_id){
|
|
154
|
+ item.totalminute = it.totalminute
|
|
155
|
+ }
|
|
156
|
+ })
|
|
157
|
+ })
|
|
158
|
+ newArr.map(item => {
|
|
159
|
+ workday.map(it => {
|
|
160
|
+ if(item.doctor_id == it.doctor_id){
|
|
161
|
+ item.attendance = it.Count
|
|
162
|
+ }
|
|
163
|
+ })
|
|
164
|
+ })
|
|
165
|
+ newArr.map(item => {
|
|
166
|
+ noWorkDay.map(it => {
|
|
167
|
+ if(item.doctor_id == it.doctor_id){
|
|
168
|
+ item.absence = it.Count
|
|
169
|
+ }
|
|
170
|
+ })
|
|
171
|
+ })
|
|
172
|
+
|
|
173
|
+ let arr = [...newArr]
|
|
174
|
+
|
|
175
|
+ arr.sort(this.compare('doctor_id'))
|
|
176
|
+ this.doctorlist.sort(this.compare('admin_user_id'))
|
|
177
|
+ this.doctorlist.forEach((item, index) => {
|
|
178
|
+ if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
|
|
179
|
+
|
|
180
|
+ }else{
|
|
181
|
+ arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id, list: []})
|
|
182
|
+ }
|
|
183
|
+ })
|
69
|
184
|
|
|
185
|
+
|
|
186
|
+ console.log('打印数据',arr)
|
|
187
|
+ this.tableData = arr
|
|
188
|
+ this.$nextTick(() => {
|
|
189
|
+ this.$refs.tab.doLayout()
|
|
190
|
+ })
|
|
191
|
+ }
|
|
192
|
+ })
|
|
193
|
+ },
|
|
194
|
+ compare(property){
|
|
195
|
+ return function(a,b){
|
|
196
|
+ var value1 = a[property];
|
|
197
|
+ var value2 = b[property];
|
|
198
|
+ return value2 - value1;
|
|
199
|
+ }
|
|
200
|
+ },
|
|
201
|
+ //获取所有班种
|
|
202
|
+ getScheduleList(){
|
|
203
|
+ getScheduleList().then(response=>{
|
|
204
|
+ if(response.data.state == 1){
|
|
205
|
+ var schedulelist = response.data.data.scheduleList
|
|
206
|
+ // console.log("schedulelist",schedulelist)
|
|
207
|
+ this.scheduleList = schedulelist
|
|
208
|
+ }
|
|
209
|
+ })
|
|
210
|
+ },
|
|
211
|
+
|
|
212
|
+ printAction: function() {
|
|
213
|
+ const style = '@media print { .print_main_content { background-color: white; width:960px; margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 10px 5px; white-space: pre-line;} .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
|
|
214
|
+
|
|
215
|
+ printJS({
|
|
216
|
+ printable: 'print_content',
|
|
217
|
+ type: 'html',
|
|
218
|
+ documentTitle: ' ',
|
|
219
|
+ style: style,
|
|
220
|
+ scanStyles: false
|
|
221
|
+ })
|
|
222
|
+ },
|
|
223
|
+ getCount(id,name){
|
|
224
|
+ if(id != undefined){
|
|
225
|
+ let Count = '';
|
|
226
|
+ this.tableData.map(item => {
|
|
227
|
+ if(item.doctor_id == id){
|
|
228
|
+ if(item.list){
|
|
229
|
+ item.list.map(it => {
|
|
230
|
+ if(it.class_name == name){
|
|
231
|
+ Count = it.Count
|
|
232
|
+ }
|
|
233
|
+ })
|
|
234
|
+ }
|
|
235
|
+
|
|
236
|
+ }
|
|
237
|
+ })
|
|
238
|
+ return Count
|
|
239
|
+ }
|
|
240
|
+ },
|
|
241
|
+ getTime(value, temp) {
|
|
242
|
+ if (value != undefined) {
|
|
243
|
+ return parseTime(value, temp)
|
|
244
|
+ }
|
|
245
|
+ return ''
|
|
246
|
+ },
|
|
247
|
+
|
|
248
|
+ getNowFormatDate() {
|
|
249
|
+ var date = new Date();
|
|
250
|
+ var seperator1 = "-";
|
|
251
|
+ var year = date.getFullYear();
|
|
252
|
+ var month = date.getMonth() + 1;
|
|
253
|
+ var strDate = date.getDate();
|
|
254
|
+ if (month >= 1 && month <= 9) {
|
|
255
|
+ month = "0" + month;
|
|
256
|
+ }
|
|
257
|
+ if (strDate >= 0 && strDate <= 9) {
|
|
258
|
+ strDate = "0" + strDate;
|
|
259
|
+ }
|
|
260
|
+ var currentdate = year + seperator1 + month + seperator1 + strDate;
|
|
261
|
+ return currentdate;
|
|
262
|
+ },
|
70
|
263
|
}
|
71
|
264
|
}
|
72
|
265
|
</script>
|