|
@@ -2,7 +2,10 @@
|
2
|
2
|
<div class="bgColor">
|
3
|
3
|
<div slot="content" class="scroll-wrapper" style="height:100%;">
|
4
|
4
|
<div class="demo" style="height:100%;">
|
5
|
|
- <div class="header">上下班记录查看</div>
|
|
5
|
+ <div class="header">
|
|
6
|
+ <div class="nav" :class="{active:searchType1 === '1'}" @click="tapClick('1')">上班记录</div>
|
|
7
|
+ <div class="nav" :class="{active:searchType1 === '2'}" @click="tapClick('2')">下班记录</div>
|
|
8
|
+ </div>
|
6
|
9
|
<div class="stateSearch">
|
7
|
10
|
<cube-button
|
8
|
11
|
light
|
|
@@ -10,12 +13,12 @@
|
10
|
13
|
@click="showDatePicker"
|
11
|
14
|
>{{ nowDate | timeFormat("MM-dd") }}<i class="cube-select-icon"></i
|
12
|
15
|
></cube-button>
|
13
|
|
- <cube-select
|
|
16
|
+ <!-- <cube-select
|
14
|
17
|
class="stateSearch_item"
|
15
|
18
|
v-model="searchType1"
|
16
|
19
|
:options="searchsType1"
|
17
|
20
|
@change="stateChange1()"
|
18
|
|
- ></cube-select>
|
|
21
|
+ ></cube-select> -->
|
19
|
22
|
<cube-select
|
20
|
23
|
class="stateSearch_item"
|
21
|
24
|
v-model="searchType2"
|
|
@@ -30,17 +33,15 @@
|
30
|
33
|
<div class="head">
|
31
|
34
|
<div class="head_d">
|
32
|
35
|
<span>{{ item.userName }}</span>
|
33
|
|
- <span
|
34
|
|
- :style="{
|
35
|
|
- color: item.extra2 === '正常' ? 'green' : 'red'
|
36
|
|
- }"
|
37
|
|
- >{{ item.extra2 }}</span
|
38
|
|
- >
|
|
36
|
+ <span v-if="item.opValue" :style="{
|
|
37
|
+ color: (item.extra2 === '正常' && item.opValue) ? 'green' : 'red'
|
|
38
|
+ }">{{ item.extra2 }}</span>
|
|
39
|
+ <span style="color:red" v-if="!item.opValue">未打卡</span>
|
39
|
40
|
<span>{{ item.opTime }}</span>
|
40
|
41
|
</div>
|
41
|
42
|
</div>
|
42
|
43
|
<div class="center">
|
43
|
|
- <div>{{ item.opValue == 1 ? "上班" : "下班" }}打卡</div>
|
|
44
|
+ <!-- <div>{{ item.opValue == 1 ? "上班" : "下班" }}打卡</div> -->
|
44
|
45
|
<div style="word-break:break-all;text-align:justify;">
|
45
|
46
|
打卡地址:{{ item.extra1 || "无" }}
|
46
|
47
|
</div>
|
|
@@ -66,6 +67,8 @@ export default {
|
66
|
67
|
return {
|
67
|
68
|
items: [],
|
68
|
69
|
itemsSave: [],
|
|
70
|
+ itemsSaveNoOn: [],//未打卡-上班
|
|
71
|
+ itemsSaveNoOff: [],//未打卡-下班
|
69
|
72
|
wushuju: false,
|
70
|
73
|
searchsType1: [
|
71
|
74
|
{
|
|
@@ -81,21 +84,40 @@ export default {
|
81
|
84
|
value: "2"
|
82
|
85
|
}
|
83
|
86
|
],
|
84
|
|
- searchsType2: [
|
|
87
|
+ searchsType2: [],
|
|
88
|
+ searchsType2_on:[
|
85
|
89
|
{
|
86
|
90
|
text: "全部",
|
87
|
91
|
value: "0"
|
88
|
92
|
},
|
89
|
93
|
{
|
90
|
|
- text: "迟到",
|
|
94
|
+ text: "实到",
|
91
|
95
|
value: "1"
|
92
|
96
|
},
|
93
|
97
|
{
|
94
|
|
- text: "早退",
|
|
98
|
+ text: "迟到",
|
95
|
99
|
value: "2"
|
96
|
|
- }
|
|
100
|
+ },
|
|
101
|
+ {
|
|
102
|
+ text: "未打卡",
|
|
103
|
+ value: "4"
|
|
104
|
+ },
|
|
105
|
+ ],
|
|
106
|
+ searchsType2_off:[
|
|
107
|
+ {
|
|
108
|
+ text: "全部",
|
|
109
|
+ value: "0"
|
|
110
|
+ },
|
|
111
|
+ {
|
|
112
|
+ text: "早退",
|
|
113
|
+ value: "3"
|
|
114
|
+ },
|
|
115
|
+ {
|
|
116
|
+ text: "未打卡",
|
|
117
|
+ value: "4"
|
|
118
|
+ },
|
97
|
119
|
],
|
98
|
|
- searchType1: "0",
|
|
120
|
+ searchType1: '1',
|
99
|
121
|
searchType2: "0",
|
100
|
122
|
stateClass: "",
|
101
|
123
|
loadShow: false,
|
|
@@ -112,6 +134,13 @@ export default {
|
112
|
134
|
}
|
113
|
135
|
},
|
114
|
136
|
methods: {
|
|
137
|
+ // 上班记录或者下班记录
|
|
138
|
+ tapClick(type){
|
|
139
|
+ this.searchType1 = type;
|
|
140
|
+ this.searchType2 = '0';
|
|
141
|
+ this.searchsType2 = this.searchType1 === '1' ? this.searchsType2_on : this.searchsType2_off;
|
|
142
|
+ this.stateChange();
|
|
143
|
+ },
|
115
|
144
|
showDatePicker() {
|
116
|
145
|
if (!this.datePicker) {
|
117
|
146
|
this.datePicker = this.$createDatePicker({
|
|
@@ -129,29 +158,45 @@ export default {
|
129
|
158
|
},
|
130
|
159
|
stateChange() {
|
131
|
160
|
var arr = [];
|
132
|
|
- if (this.searchType2 === "1") {
|
133
|
|
- //迟到
|
134
|
|
- arr = this.itemsSave.filter(v => v.extra2 == "迟到");
|
135
|
|
- } else if (this.searchType2 === "2") {
|
136
|
|
- //早退
|
137
|
|
- arr = this.itemsSave.filter(v => v.extra2 == "早退");
|
138
|
|
- } else if (this.searchType2 === "0") {
|
139
|
|
- //全部
|
140
|
|
- arr = JSON.parse(JSON.stringify(this.itemsSave));
|
141
|
|
- }
|
142
|
161
|
if (this.searchType1 === "1") {
|
143
|
162
|
//上班
|
144
|
|
- this.items = arr.filter(v => v.opValue === "1");
|
145
|
|
- this.wushuju = this.items.length === 0;
|
|
163
|
+ arr = this.itemsSave.filter(v => v.opValue === "1");
|
146
|
164
|
} else if (this.searchType1 === "2") {
|
147
|
165
|
//下班
|
148
|
|
- this.items = arr.filter(v => v.opValue === "0");
|
149
|
|
- this.wushuju = this.items.length === 0;
|
|
166
|
+ arr = this.itemsSave.filter(v => v.opValue === "0");
|
150
|
167
|
} else if (this.searchType1 === "0") {
|
151
|
168
|
//全部
|
152
|
|
- this.items = arr;
|
153
|
|
- this.wushuju = this.items.length === 0;
|
|
169
|
+ arr = JSON.parse(JSON.stringify(this.itemsSave));
|
154
|
170
|
}
|
|
171
|
+ if (this.searchType2 === "1") {
|
|
172
|
+ //实到
|
|
173
|
+ this.items = arr.filter(v => v.extra2 == "正常");
|
|
174
|
+ } else if (this.searchType2 === "2") {
|
|
175
|
+ //迟到
|
|
176
|
+ this.items = arr.filter(v => v.extra2 == "迟到");
|
|
177
|
+ } else if (this.searchType2 === "3") {
|
|
178
|
+ //早退
|
|
179
|
+ this.items = arr.filter(v => v.extra2 == "早退");
|
|
180
|
+ } else if (this.searchType2 === "4") {
|
|
181
|
+ //未打卡
|
|
182
|
+ if(this.searchType1 === '1'){
|
|
183
|
+ // 上班
|
|
184
|
+ this.items = JSON.parse(JSON.stringify(this.itemsSaveNoOn));
|
|
185
|
+ }else if(this.searchType1 === '2'){
|
|
186
|
+ // 下班
|
|
187
|
+ this.items = JSON.parse(JSON.stringify(this.itemsSaveNoOff));
|
|
188
|
+ }
|
|
189
|
+ } else if (this.searchType2 === "0") {
|
|
190
|
+ //全部
|
|
191
|
+ if(this.searchType1 === '1'){
|
|
192
|
+ // 上班
|
|
193
|
+ this.items = JSON.parse(JSON.stringify(arr.concat(this.itemsSaveNoOn)));
|
|
194
|
+ }else if(this.searchType1 === '2'){
|
|
195
|
+ // 下班
|
|
196
|
+ this.items = JSON.parse(JSON.stringify(arr.concat(this.itemsSaveNoOff)));
|
|
197
|
+ }
|
|
198
|
+ }
|
|
199
|
+ this.wushuju = this.items.length === 0;
|
155
|
200
|
},
|
156
|
201
|
stateChange1() {
|
157
|
202
|
this.stateChange();
|
|
@@ -173,10 +218,14 @@ export default {
|
173
|
218
|
}
|
174
|
219
|
// this.items = res.data.data;
|
175
|
220
|
this.itemsSave = JSON.parse(JSON.stringify(res.data.data));
|
|
221
|
+ this.itemsSaveNoOn = res.data.unOnlineList?JSON.parse(JSON.stringify(res.data.unOnlineList)):[];
|
|
222
|
+ this.itemsSaveNoOff = res.data.unOnlineList?JSON.parse(JSON.stringify(res.data.unOfflineList)):[];
|
176
|
223
|
this.stateChange();
|
177
|
224
|
} else if (res.data.data.length === 0) {
|
178
|
225
|
this.items = [];
|
179
|
226
|
this.itemsSave = [];
|
|
227
|
+ this.itemsSaveNoOn = [];
|
|
228
|
+ this.itemsSaveNoOff = [];
|
180
|
229
|
this.wushuju = true;
|
181
|
230
|
}
|
182
|
231
|
this.loadShow = false;
|
|
@@ -184,17 +233,26 @@ export default {
|
184
|
233
|
}
|
185
|
234
|
},
|
186
|
235
|
created() {
|
|
236
|
+ console.log(this.$route)
|
|
237
|
+ const { type, status } = this.$route.params;//type是上班1还是下班2,status是具体的状态
|
|
238
|
+ this.searchType1 = type;
|
|
239
|
+ this.searchType2 = status;
|
|
240
|
+ if(status === '3'){
|
|
241
|
+ // 昨日早退
|
|
242
|
+ this.nowDate = new Date(new Date().getTime() - 24*60*60*1000);
|
|
243
|
+ }
|
|
244
|
+ this.searchsType2 = this.searchType1 === '1' ? this.searchsType2_on : this.searchsType2_off;
|
187
|
245
|
this.getData();
|
188
|
246
|
}
|
189
|
247
|
};
|
190
|
248
|
</script>
|
191
|
249
|
<style lang="stylus" rel="stylesheet/stylus" scoped>
|
192
|
250
|
.scroll-list-wrap {
|
193
|
|
- height: calc(100% - 1.76rem);
|
|
251
|
+ height: calc(100% - 1.81rem);
|
194
|
252
|
border-radius: 5px;
|
195
|
253
|
transform: rotate(0deg); // fix 子元素超出边框圆角部分不隐藏的问题
|
196
|
254
|
overflow: hidden;
|
197
|
|
- padding-top: 1.76rem;
|
|
255
|
+ padding-top: 1.81rem;
|
198
|
256
|
}
|
199
|
257
|
|
200
|
258
|
.foods-wrapper {
|
|
@@ -298,9 +356,6 @@ export default {
|
298
|
356
|
.cont {
|
299
|
357
|
margin-top: 1.86rem;
|
300
|
358
|
}
|
301
|
|
-.scroll-list-wrap {
|
302
|
|
- padding-top: 1.76rem;
|
303
|
|
-}
|
304
|
359
|
.header {
|
305
|
360
|
width: 100%;
|
306
|
361
|
height: 0.88rem;
|
|
@@ -308,15 +363,28 @@ export default {
|
308
|
363
|
text-align: center;
|
309
|
364
|
color: #fff;
|
310
|
365
|
font-size: 0.37rem;
|
311
|
|
- background: linear-gradient(#2e2f32, #414246);
|
312
|
366
|
position: fixed;
|
313
|
367
|
top: 0;
|
314
|
368
|
z-index: 6;
|
|
369
|
+ display: flex;
|
|
370
|
+ color: #2e2f32;
|
|
371
|
+ border-bottom: 0.05rem solid #2e2f32;
|
|
372
|
+}
|
|
373
|
+.header .nav{
|
|
374
|
+ flex: 1;
|
|
375
|
+ border-right: 0.02rem solid #2e2f32;
|
|
376
|
+}
|
|
377
|
+.header :last-child{
|
|
378
|
+ border-right: none;
|
|
379
|
+}
|
|
380
|
+.header .nav.active{
|
|
381
|
+ background: linear-gradient(#2e2f32, #414246);
|
|
382
|
+ color:#fff;
|
315
|
383
|
}
|
316
|
384
|
.stateSearch {
|
317
|
385
|
width: 100%;
|
318
|
386
|
position: fixed;
|
319
|
|
- top: 0.88rem;
|
|
387
|
+ top: 0.93rem;
|
320
|
388
|
z-index: 6;
|
321
|
389
|
display: flex;
|
322
|
390
|
justify-content: center;
|
|
@@ -367,6 +435,9 @@ export default {
|
367
|
435
|
color: #333333;
|
368
|
436
|
background-color: #fff;
|
369
|
437
|
}
|
|
438
|
+.cube-btn{
|
|
439
|
+ border-top: 0.02rem solid #e5e5e5;
|
|
440
|
+}
|
370
|
441
|
.title {
|
371
|
442
|
display: flex;
|
372
|
443
|
justify-content: space-between;
|
|
@@ -483,7 +554,6 @@ export default {
|
483
|
554
|
}
|
484
|
555
|
.center {
|
485
|
556
|
color: #333333;
|
486
|
|
- border-bottom: 0.01rem solid #e6e6e6;
|
487
|
557
|
div {
|
488
|
558
|
padding: 0.12rem 0.48rem;
|
489
|
559
|
}
|