zouyu
2 天以前 119ead459f17a1a1c2fd5e0f4d08febc681d6d86
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
<script>
import {getClockInRecord,changeEnableReport} from '@/api/performance/attendance'
 
export default {
  name: "staffClockInRecord",
  props: {
    queryParams: {
      type: Object,
      default: () => ({
        personCode:null,//人员编号
        swingDate:null,//刷卡时间
        shiftId:null//班次id
      }),
    },
  },
  data() {
    return {
      loading: false,
      tableData: [],
      //进出门类型列表
      enterOrExitList:[
        {
          label:'进门',
          value:1
        },
        {
          label:'出门',
          value:2
        },
        {
          label:'进/出门',
          value:3
        }
      ],
      //开门类型列表
      openTypeList:[
        {
          "value": 42,
          "label": "合法密码开门"
        },
        {
          "value": 43,
          "label": "非法密码开门"
        },
        {
          "value": 45,
          "label": "合法指纹开门"
        },
        {
          "value": 46,
          "label": "非法指纹开门"
        },
        {
          "value": 48,
          "label": "远程开门"
        },
        {
          "value": 49,
          "label": "按钮开门"
        },
        {
          "value": 50,
          "label": "钥匙开门"
        },
        {
          "value": 51,
          "label": "合法刷卡开门"
        },
        {
          "value": 52,
          "label": "非法刷卡开门"
        },
        {
          "value": 53,
          "label": "门磁事件"
        },
        {
          "value": 54,
          "label": "异常开门"
        },
        {
          "value": 55,
          "label": "异常关门"
        },
        {
          "value": 56,
          "label": "正常关门"
        },
        {
          "value": 57,
          "label": "正常开门"
        },
        {
          "value": 59,
          "label": "对讲请求事件"
        },
        {
          "value": 61,
          "label": "人脸合法开门"
        },
        {
          "value": 62,
          "label": "人脸非法开门"
        },
        {
          "value": 1421,
          "label": "RFID有源合法"
        },
        {
          "value": 1422,
          "label": "RFID无源合法"
        },
        {
          "value": 1423,
          "label": "RFID有源非法"
        },
        {
          "value": 1424,
          "label": "RFID无源非法"
        },
        {
          "value": 1433,
          "label": "黑名单事件"
        },
        {
          "value": 1436,
          "label": "人证合法开门"
        },
        {
          "value": 1437,
          "label": "人证非法开门"
        },
        {
          "value": 1438,
          "label": "人证和身份证非法开门"
        },
        {
          "value": 1439,
          "label": "人证和身份证合法开门"
        },
        {
          "value": 1448,
          "label": "RFID感应事件"
        },
        {
          "value": 1449,
          "label": "RFID非法感应事件"
        },
        {
          "value": 1450,
          "label": "RFID按键事件"
        },
        {
          "value": 1451,
          "label": "RFID非法按键事件"
        },
        {
          "value": 1455,
          "label": "先刷卡后密码合法开门"
        },
        {
          "value": 1456,
          "label": "先刷卡后密码非法开门"
        },
        {
          "value": 1461,
          "label": "刷卡+指纹组合合法开门"
        },
        {
          "value": 1462,
          "label": "刷卡+指纹组合非法开门"
        },
        {
          "value": 1463,
          "label": "多人合法开门"
        },
        {
          "value": 1464,
          "label": "多人非法开门"
        },
        {
          "value": 1467,
          "label": "人员编号+密码合法开门"
        },
        {
          "value": 1468,
          "label": "人员编号+密码非法开门"
        },
        {
          "value": 1469,
          "label": "人脸+密码合法开门"
        },
        {
          "value": 1470,
          "label": "人脸+密码非法开门"
        },
        {
          "value": 1471,
          "label": "指纹+密码合法开门"
        },
        {
          "value": 1472,
          "label": "指纹+密码非法开门"
        },
        {
          "value": 1473,
          "label": "指纹+人脸合法开门"
        },
        {
          "value": 1474,
          "label": "指纹+人脸非法开门"
        },
        {
          "value": 1475,
          "label": "刷卡+人脸合法开门"
        },
        {
          "value": 1476,
          "label": "刷卡+人脸非法开门"
        },
        {
          "value": 1487,
          "label": "指纹+人脸+密码合法开门"
        },
        {
          "value": 1488,
          "label": "指纹+人脸+密码非法开门"
        },
        {
          "value": 1489,
          "label": "刷卡+人脸+密码合法开门"
        },
        {
          "value": 1490,
          "label": "刷卡+人脸+密码非法开门"
        },
        {
          "value": 1491,
          "label": "刷卡+指纹+密码合法开门"
        },
        {
          "value": 1492,
          "label": "刷卡+指纹+密码非法开门"
        },
        {
          "value": 1493,
          "label": "卡+指纹+人脸组合合法开门"
        },
        {
          "value": 1494,
          "label": "卡+指纹+人脸组合非法开门"
        },
        {
          "value": 4603,
          "label": "卡+指纹+人脸+密码组合合法开门"
        },
        {
          "value": 4604,
          "label": "卡+指纹+人脸+密码组合非法开门"
        },
        {
          "value": 4626,
          "label": "人脸+安全帽合法开门"
        },
        {
          "value": 4627,
          "label": "人脸+安全帽非法开门"
        },
        {
          "value": 10001,
          "label": "健康码合法开门"
        },
        {
          "value": 10002,
          "label": "异常健康码开门"
        }
      ]
    };
  },
  watch: {
    queryParams: {
      handler(newVal, oldVal) {
        this.refreshTable();
      },
      deep: true,
    },
  },
  created() {
    this.refreshTable();
  },
  methods: {
    changeEnableReport(row){
      let data = {
        id:row.id,
        enableReport:row.enableReport
      }
      changeEnableReport(data).then(res=>{
        if(res.code===200){
          this.$message.success("操作成功")
          this.$emit("changeEnable")
        }
      })
    },
    formatterAttendanceType(value){
      let label = "";
      this.openTypeList.forEach(item=>{
        if(item.value===value){
          label = item.label
        }
      })
      return label;
    },
    formatterEnterOrExitType(value){
      let label = "";
      this.enterOrExitList.forEach(item=>{
        if(item.value===value){
          label = item.label
        }
      })
      return label;
    },
    getDataSourceTypeTag(type) {
      const tagMap = {
        0: 'success',
        1: '',
      };
      return tagMap[type] || '';
    },
    getDataSourceTypeText(type) {
      const textMap = {
        0: 'ICC同步',
        1: '手动新增',
      };
      return textMap[type] || '未知';
    },
    refreshTable() {
      this.loading = true;
      getClockInRecord({...this.queryParams}).then(res => {
        this.tableData = res.data;
        this.loading = false;
      }).catch(() => {
        this.loading = false;
      });
    },
  },
};
</script>
 
<template>
  <div class="clock-in-record">
    <div v-loading="loading">
      <el-table
        :data="tableData"
        border
        style="width: 100%"
        height="300"
        :header-cell-style="{textAlign:'center'}"
        :cell-style="{textAlign:'center'}"
      >
        <el-table-column type="index" label="序号" width="60"></el-table-column>
        <el-table-column label="是否纳入考勤" prop="enableReport" width="120">
          <template slot-scope="scope">
            <el-switch
              @change="changeEnableReport(scope.row)"
              v-model="scope.row.enableReport"
              active-color="#13ce66"
              inactive-color="#ff4949">
            </el-switch>
          </template>
        </el-table-column>
        <el-table-column prop="personCode" label="工号" min-width="150" width="150"></el-table-column>
        <el-table-column prop="personName" label="姓名" min-width="150" width="150"></el-table-column>
        <el-table-column prop="deptName" label="部门名称" min-width="150" width="150"></el-table-column>
        <el-table-column prop="cardNumber" label="卡号" min-width="150" width="150"></el-table-column>
        <el-table-column prop="swingTime" label="刷卡时间" min-width="180" width="180"></el-table-column>
        <el-table-column prop="channelName" label="考勤点通道名称" min-width="180" width="180"></el-table-column>
        <el-table-column prop="deviceName" label="考勤设备名称" min-width="150" width="150"></el-table-column>
        <el-table-column prop="deviceCode" label="考勤设备编码" min-width="150" width="150"></el-table-column>
        <el-table-column prop="enterOrExit" label="进出门类型" min-width="150" width="150" :formatter="(row)=>formatterEnterOrExitType(row.enterOrExit)"></el-table-column>
        <el-table-column prop="openType" label="开门类型" min-width="150" width="150" :formatter="(row)=>formatterAttendanceType(row.openType)"></el-table-column>
        <el-table-column prop="isSync" label="数据来源" min-width="150" width="150">
          <template slot-scope="scope">
            <el-tag :type="getDataSourceTypeTag(scope.row.isSync)">
              {{ getDataSourceTypeText(scope.row.isSync) }}
            </el-tag>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>
 
<style scoped lang="scss">
 
</style>