|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+<template>
|
|
|
2
|
+ <div class="restDay">
|
|
|
3
|
+ <el-row style="margin-bottom: 10px">
|
|
|
4
|
+ <!-- <el-input v-model="name" clearable placeholder="请输入班别名称" class="filter-item" size="small" style="width: 200px;" /> -->
|
|
|
5
|
+ <!-- <el-select v-model="name" placeholder="请选择班别" size="small" style="width: 200px;">
|
|
|
6
|
+ <el-option v-for="item in dataclassLists" :key="item.F_Id" :label="item.F_Name" :value="item.F_Id"></el-option>
|
|
|
7
|
+ </el-select> -->
|
|
|
8
|
+ <el-date-picker v-model="times" size="mini" type="daterange" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
|
|
|
9
|
+ range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
|
|
10
|
+ <select-gzbx-dept-tree :deptparam="deptidArr" @post-deptid="getDeptid" style="width: 300px" />
|
|
|
11
|
+ <el-button type="primary" class="filter-item" @click="btn_search">查询</el-button>
|
|
|
12
|
+ <el-button type="primary" class="filter-item" @click="btn_export">导出</el-button>
|
|
|
13
|
+ </el-row>
|
|
|
14
|
+ <el-row>
|
|
|
15
|
+ <table class="tabbox" cellspacing="0" cellpadding="0">
|
|
|
16
|
+ <thead>
|
|
|
17
|
+ <tr>
|
|
|
18
|
+ <th style="width:120px;">
|
|
|
19
|
+ <div class="out"> <b>班别</b> <em>姓名</em> </div>
|
|
|
20
|
+ </th>
|
|
|
21
|
+ <th style="background-color: #D6D3D6;" v-for="item in headData" :key="item.F_Id">{{item.F_Name}}</th>
|
|
|
22
|
+ </tr>
|
|
|
23
|
+ </thead>
|
|
|
24
|
+ <tbody>
|
|
|
25
|
+ <tr v-for="item in mainData">
|
|
|
26
|
+ <td class="t1">{{item.F_username}}</td>
|
|
|
27
|
+ <td v-for="(items,index) in item.numarr" :key="index">{{items}}</td>
|
|
|
28
|
+ </tr>
|
|
|
29
|
+ </tbody>
|
|
|
30
|
+ </table>
|
|
|
31
|
+ <!-- <FullCalendar ref="myCalendar" :options="calendarOptions" @eventDrop="calendarEventDrop" /> -->
|
|
|
32
|
+ </el-row>
|
|
|
33
|
+ </div>
|
|
|
34
|
+</template>
|
|
|
35
|
+
|
|
|
36
|
+<script>
|
|
|
37
|
+ import {
|
|
|
38
|
+ getWorkOffDays,
|
|
|
39
|
+ setOfforOn,
|
|
|
40
|
+ getBeOnDutyList,
|
|
|
41
|
+ getClassByCode,
|
|
|
42
|
+ getAllClassList,
|
|
|
43
|
+ addGroupClass,
|
|
|
44
|
+ GetGroupClassList,
|
|
|
45
|
+ OrderListExport,
|
|
|
46
|
+ getUserlistByDeptId,
|
|
|
47
|
+ getClassList,
|
|
|
48
|
+ GetShiftStatistics,
|
|
|
49
|
+ ShiftStatisticsExport
|
|
|
50
|
+ } from "@/api/telCall/restDay";
|
|
|
51
|
+ import FullCalendar from "@fullcalendar/vue";
|
|
|
52
|
+ import dayGridPlugin from "@fullcalendar/daygrid";
|
|
|
53
|
+ import timeGridPlugin from "@fullcalendar/timegrid";
|
|
|
54
|
+ import interactionPlugin from "@fullcalendar/interaction";
|
|
|
55
|
+ import listPlugin from "@fullcalendar/list";
|
|
|
56
|
+ import {
|
|
|
57
|
+ exportExcel
|
|
|
58
|
+ } from "@/utils";
|
|
|
59
|
+ import selectGzbxDeptTree from "@/components/context/commonSelect/selectGzbxDeptTree.vue";
|
|
|
60
|
+ import {
|
|
|
61
|
+ getNowDate,
|
|
|
62
|
+ getFirstDayInCurrentMonth,
|
|
|
63
|
+ getLastDay,
|
|
|
64
|
+ } from "@/utils/index";
|
|
|
65
|
+ import {
|
|
|
66
|
+ GetPerson
|
|
|
67
|
+ } from "@/api/commonAPI";
|
|
|
68
|
+ export default {
|
|
|
69
|
+ name: "RestDay",
|
|
|
70
|
+ components: {
|
|
|
71
|
+ selectGzbxDeptTree,
|
|
|
72
|
+ FullCalendar,
|
|
|
73
|
+ },
|
|
|
74
|
+ data() {
|
|
|
75
|
+ return {
|
|
|
76
|
+ headData: [],
|
|
|
77
|
+ mainData: [],
|
|
|
78
|
+ dataclassLists: [],
|
|
|
79
|
+ times: "",
|
|
|
80
|
+ deptid: "",
|
|
|
81
|
+ usercodes: "",
|
|
|
82
|
+ deptidArr: [],
|
|
|
83
|
+ repairman: [],
|
|
|
84
|
+ tabData: [],
|
|
|
85
|
+ timeData: [],
|
|
|
86
|
+ classList: [],
|
|
|
87
|
+ classcode: "",
|
|
|
88
|
+ usercode: "",
|
|
|
89
|
+ dataTime: "",
|
|
|
90
|
+ time: {
|
|
|
91
|
+ startTime: "",
|
|
|
92
|
+ endTime: "",
|
|
|
93
|
+ },
|
|
|
94
|
+ popindex: "",
|
|
|
95
|
+ name: ''
|
|
|
96
|
+ };
|
|
|
97
|
+ },
|
|
|
98
|
+ watch: {
|
|
|
99
|
+
|
|
|
100
|
+ },
|
|
|
101
|
+ created() {
|
|
|
102
|
+ // this.time.startTime = getFirstDayInCurrentMonth();
|
|
|
103
|
+ // this.time.endTime = getNowDate();
|
|
|
104
|
+ this.deptid = localStorage.getItem("deptId");
|
|
|
105
|
+ // this.times = [this.time.startTime, this.time.endTime];
|
|
|
106
|
+ // console.log(this.time, "1234");
|
|
|
107
|
+ this.getList();
|
|
|
108
|
+ // this.getClasses();
|
|
|
109
|
+ },
|
|
|
110
|
+ methods: {
|
|
|
111
|
+ getDeptid(data) {
|
|
|
112
|
+ this.deptidArr = data;
|
|
|
113
|
+ this.deptid = data[data.length - 1];
|
|
|
114
|
+ // this.repairman = [];
|
|
|
115
|
+ // this.usercodes = "";
|
|
|
116
|
+ // this.getRepairman(data[data.length - 1]);
|
|
|
117
|
+ // this.getAllClass();
|
|
|
118
|
+ },
|
|
|
119
|
+ getClasses() {
|
|
|
120
|
+ const params = {
|
|
|
121
|
+ page: 1, // 第几页
|
|
|
122
|
+ pagesize: 99999, // 每页几条信息
|
|
|
123
|
+ name: "",
|
|
|
124
|
+ code: "",
|
|
|
125
|
+ }
|
|
|
126
|
+ getClassList(params).then((response) => {
|
|
|
127
|
+ if (response.rows.length >= 0) {
|
|
|
128
|
+ this.dataclassLists = response.rows;
|
|
|
129
|
+ }
|
|
|
130
|
+ });
|
|
|
131
|
+ },
|
|
|
132
|
+ getList() {
|
|
|
133
|
+ if(!this.deptid){
|
|
|
134
|
+ this.deptid = localStorage.getItem("deptId");
|
|
|
135
|
+ }
|
|
|
136
|
+ const params = {
|
|
|
137
|
+ starttime: this.times && this.times[0],
|
|
|
138
|
+ endtime: this.times && this.times[1],
|
|
|
139
|
+ deptid: this.deptid,
|
|
|
140
|
+ isdc: 0
|
|
|
141
|
+ };
|
|
|
142
|
+ GetShiftStatistics(params).then((res) => {
|
|
|
143
|
+ if (res.state == 'success') {
|
|
|
144
|
+ this.headData = res.data.cols
|
|
|
145
|
+ var alldata = JSON.parse(res.data.dt)
|
|
|
146
|
+ var colarr = []
|
|
|
147
|
+ //获取表头colarr
|
|
|
148
|
+ for (var i = 0; i < res.data.cols.length; i++) {
|
|
|
149
|
+ colarr.push(res.data.cols[i].F_Name)
|
|
|
150
|
+ }
|
|
|
151
|
+ //遍历dt表头的数据,重新赋值numarr
|
|
|
152
|
+ for (var j = 0; j < alldata.length; j++) {
|
|
|
153
|
+ var arr = []
|
|
|
154
|
+ for (var key in alldata[j]) {
|
|
|
155
|
+ if (colarr.indexOf(key) >= 0) {
|
|
|
156
|
+ arr.push(alldata[j][key])
|
|
|
157
|
+ }
|
|
|
158
|
+ }
|
|
|
159
|
+ alldata[j].numarr = arr
|
|
|
160
|
+ }
|
|
|
161
|
+ this.mainData = alldata
|
|
|
162
|
+ //无数据
|
|
|
163
|
+ if(res.data.cols.length==0){
|
|
|
164
|
+ this.headData = [{F_Name:'暂无数据'}]
|
|
|
165
|
+ this.mainData = [{F_username:'暂无数据',numarr:[0]}]
|
|
|
166
|
+ }
|
|
|
167
|
+ }
|
|
|
168
|
+ });
|
|
|
169
|
+ },
|
|
|
170
|
+ btn_search() {
|
|
|
171
|
+ this.getList();
|
|
|
172
|
+ },
|
|
|
173
|
+ btn_export() {
|
|
|
174
|
+ if(!this.deptid){
|
|
|
175
|
+ this.deptid = localStorage.getItem("deptId");
|
|
|
176
|
+ }
|
|
|
177
|
+ const params = {
|
|
|
178
|
+ starttime: this.times && this.times[0],
|
|
|
179
|
+ endtime: this.times && this.times[1],
|
|
|
180
|
+ deptid: this.deptid,
|
|
|
181
|
+ isdc: 1,
|
|
|
182
|
+ };
|
|
|
183
|
+ exportExcel(params, ShiftStatisticsExport);
|
|
|
184
|
+ },
|
|
|
185
|
+ },
|
|
|
186
|
+ };
|
|
|
187
|
+</script>
|
|
|
188
|
+
|
|
|
189
|
+<style rel="stylesheet/scss" lang="scss" scoped>
|
|
|
190
|
+ caption {
|
|
|
191
|
+ font-size: 14px;
|
|
|
192
|
+ font-weight: bold;
|
|
|
193
|
+ }
|
|
|
194
|
+
|
|
|
195
|
+ table {
|
|
|
196
|
+ border-collapse: collapse;
|
|
|
197
|
+ border: 1px #525152 solid;
|
|
|
198
|
+ width: 50%;
|
|
|
199
|
+ margin: 0 auto;
|
|
|
200
|
+ margin-top: 20px;
|
|
|
201
|
+ }
|
|
|
202
|
+
|
|
|
203
|
+ th,
|
|
|
204
|
+ td {
|
|
|
205
|
+ border: 1px #525152 solid;
|
|
|
206
|
+ text-align: center;
|
|
|
207
|
+ font-size: 12px;
|
|
|
208
|
+ line-height: 30px;
|
|
|
209
|
+ // background: #C6C7C6;
|
|
|
210
|
+ }
|
|
|
211
|
+
|
|
|
212
|
+ th {
|
|
|
213
|
+ // background: #e5e3e5;
|
|
|
214
|
+ }
|
|
|
215
|
+
|
|
|
216
|
+ /*模拟对角线*/
|
|
|
217
|
+ .out {
|
|
|
218
|
+ border-top: 60px #D6D3D6 solid;
|
|
|
219
|
+ /*上边框宽度等于表格第一行行高*/
|
|
|
220
|
+ width: 0px;
|
|
|
221
|
+ /*让容器宽度为0*/
|
|
|
222
|
+ height: 0px;
|
|
|
223
|
+ /*让容器高度为0*/
|
|
|
224
|
+ border-left: 120px #BDBABD solid;
|
|
|
225
|
+ /*左边框宽度等于表格第一行第一格宽度*/
|
|
|
226
|
+ position: relative;
|
|
|
227
|
+ /*让里面的两个子容器绝对定位*/
|
|
|
228
|
+ }
|
|
|
229
|
+
|
|
|
230
|
+ b {
|
|
|
231
|
+ font-style: normal;
|
|
|
232
|
+ display: block;
|
|
|
233
|
+ position: absolute;
|
|
|
234
|
+ top: -50px;
|
|
|
235
|
+ left: -50px;
|
|
|
236
|
+ width: 35px;
|
|
|
237
|
+ }
|
|
|
238
|
+
|
|
|
239
|
+ em {
|
|
|
240
|
+ font-style: normal;
|
|
|
241
|
+ display: block;
|
|
|
242
|
+ position: absolute;
|
|
|
243
|
+ top: -35px;
|
|
|
244
|
+ left: -110px;
|
|
|
245
|
+ width: 55px;
|
|
|
246
|
+ }
|
|
|
247
|
+
|
|
|
248
|
+ .t1 {
|
|
|
249
|
+ // background: #BDBABD;
|
|
|
250
|
+ }
|
|
|
251
|
+
|
|
|
252
|
+ .tabbox {
|
|
|
253
|
+ width: 100%;
|
|
|
254
|
+ border: 0.5px solid rgb(236, 236, 236);
|
|
|
255
|
+ }
|
|
|
256
|
+
|
|
|
257
|
+ // .tabbox td {
|
|
|
258
|
+ // width: 200px !important;
|
|
|
259
|
+ // padding: 5px;
|
|
|
260
|
+ // text-align: center;
|
|
|
261
|
+ // border: 0.5px solid rgb(236, 236, 236);
|
|
|
262
|
+ // }
|
|
|
263
|
+
|
|
|
264
|
+ .restDay {
|
|
|
265
|
+ overflow: scroll;
|
|
|
266
|
+ padding: 20px;
|
|
|
267
|
+ background-color: #fff;
|
|
|
268
|
+ margin-top: 10px;
|
|
|
269
|
+ }
|
|
|
270
|
+
|
|
|
271
|
+ @media only screen and (max-width: 990px) {
|
|
|
272
|
+ .restDay {
|
|
|
273
|
+ .calendar_img {
|
|
|
274
|
+ display: none;
|
|
|
275
|
+ }
|
|
|
276
|
+ }
|
|
|
277
|
+ }
|
|
|
278
|
+</style>
|