yaozc
2023-07-07 c752e33fe402e2179e7e6795f567d41c044ca3c6
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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <div>
        <el-date-picker v-model="query.attendanceDate" type="month" clearable placeholder="统计年月" style="width: 185px;" class="filter-item" />
        <el-select v-model="query.companyId" filterable clearable placeholder="所属公司" style="width: 185px;" class="filter-item">
          <el-option
            v-for="item in companys"
            :key="item.id"
            :label="item.label"
            :value="item.id"
          />
        </el-select>
        <el-select v-model="query.userId" filterable clearable placeholder="所属员工" style="width: 185px;" class="filter-item">
          <el-option
            v-for="item in users"
            :key="item.id"
            :label="item.nickName"
            :value="item.id"
          />
        </el-select>
        <rrOperation />
      </div>
      <!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
      <crudOperation :permission="permission">
        <el-button
          slot="right"
          v-permission="permission.publicity"
          class="filter-item"
          size="mini"
          type="primary"
          icon="el-icon-s-check"
          :disabled="crud.selections.length === 0"
          style="margin-right: 6px;"
          @click="multiplePublicity(crud.selections)"
        >公示</el-button>
        <el-button
          slot="right"
          v-permission="permission.admit"
          class="filter-item"
          size="mini"
          type="primary"
          icon="el-icon-share"
          :disabled="crud.selections.length === 0 || crud.selections.length > 1"
          @click="attendanceMAdmit(crud.selections[0])"
        >承认</el-button>
      </crudOperation>
      <!--表单组件-->
      <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
        <el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
          <el-form-item label="统计年月" prop="attendanceDate">
            <el-date-picker
              v-model="form.attendanceDate"
              type="month"
              style="width: 350px;"
              placeholder="请选择"
              value-format="yyyy-MM-dd HH:mm:ss"
            />
          </el-form-item>
          <el-form-item label="所属员工" prop="userId">
            <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 350px;">
              <el-option
                v-for="item in users"
                :key="item.id"
                :label="item.nickName"
                :value="item.id"
                :disabled="!item.enabled"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="所属公司" prop="companyId">
            <el-select v-model="form.companyId" filterable clearable placeholder="请选择" style="width: 350px;">
              <el-option
                v-for="item in companys"
                :key="item.id"
                :label="item.label"
                :value="item.id"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="所属部门" prop="deptId">
            <treeselect
              v-model="form.deptId"
              :options="depts"
              :load-options="loadDepts"
              style="width: 350px"
              placeholder="选择部门"
            />
          </el-form-item>
          <el-form-item label="所属岗位" prop="jobId">
            <el-select
              v-model="form.jobId"
              style="width: 350px"
              :multiple-limit="1"
              placeholder="请选择"
            >
              <el-option
                v-for="item in jobs"
                :key="item.name"
                :label="item.name"
                :value="item.id"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="应出勤天数" prop="requiredAttendanceDays">
            <el-input v-model="form.requiredAttendanceDays" style="width: 350px;" />
          </el-form-item>
          <el-form-item label="应出勤时长" prop="requiredAttendanceTime">
            <el-input v-model="form.requiredAttendanceTime" style="width: 350px;" />
          </el-form-item>
          <el-form-item label="实际出勤天数" prop="actualAttendanceDays">
            <el-input v-model="form.actualAttendanceDays" style="width: 350px;" />
          </el-form-item>
          <el-form-item label="实际出勤时长" prop="actualAttendanceTime">
            <el-input v-model="form.actualAttendanceTime" style="width: 350px;" />
          </el-form-item>
          <el-form-item label="迟到次数" prop="countOfBeingLate">
            <el-input v-model="form.countOfBeingLate" style="width: 350px;" />
          </el-form-item>
          <el-form-item label="迟到时长" prop="timeOfBeingLate">
            <el-input v-model="form.timeOfBeingLate" style="width: 350px;" />
          </el-form-item>
          <el-form-item label="早退次数" prop="countOfBeingEarly">
            <el-input v-model="form.countOfBeingEarly" style="width: 350px;" />
          </el-form-item>
          <el-form-item label="早退时长" prop="timeOfBeingEarly">
            <el-input v-model="form.timeOfBeingEarly" style="width: 350px;" />
          </el-form-item>
          <el-form-item label="外出次数" prop="goOutNumber">
            <el-input v-model="form.goOutNumber" style="width: 350px;" />
          </el-form-item>
          <el-form-item label="外出时长" prop="goOutTime">
            <el-input v-model="form.goOutTime" style="width: 350px;" />
          </el-form-item>
          <el-form-item label="出差次数" prop="bussNumber">
            <el-input v-model="form.bussNumber" style="width: 350px;" />
          </el-form-item>
          <el-form-item label="出差时长" prop="bussTime">
            <el-input v-model="form.bussTime" style="width: 350px;" />
          </el-form-item>
          <el-form-item label="上班缺卡次数" prop="onCardNumber">
            <el-input v-model="form.onCardNumber" style="width: 350px;" />
          </el-form-item>
          <el-form-item label="下班缺卡次数" prop="offCardNumber">
            <el-input v-model="form.offCardNumber" style="width: 350px;" />
          </el-form-item>
          <el-form-item label="备注">
            <el-input v-model="form.remarks" :rows="3" type="textarea" style="width: 350px;" />
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button type="text" @click="crud.cancelCU">取消</el-button>
          <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
        </div>
      </el-dialog>
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" row-key="id" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" fixed="left" width="55" />
        <el-table-column fixed="left" type="expand">
          <template slot-scope="scope">
            <el-form label-position="left" class="my-demo-table-expand" style="margin-left: 264px;">
              <template v-if="scope.row.yearTime == undefined">
                <el-form-item
                  v-for="(item,adIndex) in (scope.row.leaveTypeList)"
                  :key="adIndex"
                  :label="'请假类型:' + dict.label[dictLeaveType][item.leaveType] + '\u00a0\u00a0\u00a0' + '请假次数:'
                    + item.leaveCount + '\u00a0\u00a0\u00a0' +'请假时间:'
                    + item.leaveTime + '(时)' + '\u00a0\u00a0\u00a0' + (item.leaveYearTime == undefined ? '' : '年假剩余:'
                      + item.leaveYearTime + '(时)')"
                />
              </template>
              <template v-if="scope.row.yearTime !== undefined">
                <el-form-item label="年假剩余:">
                  <span>{{ scope.row.yearTime + '(时)' }}</span>
                </el-form-item>
              </template>
            </el-form>
          </template>
        </el-table-column>
        <el-table-column prop="attendanceDate" label="统计年月" fixed="left" width="125" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ crud.toMonth(scope.row.attendanceDate) }}
          </template>
        </el-table-column>
        <el-table-column prop="userId" label="姓名" fixed="left" width="125" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag>{{ scope.row.nickName }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column label="基本信息" align="center" show-overflow-tooltip>
          <el-table-column prop="companyId" label="公司" width="150">
            <template slot-scope="scope">
              <el-tag>{{ scope.row.companyName }}</el-tag>
            </template>
          </el-table-column>
          <el-table-column prop="deptId" label="部门" width="150" show-overflow-tooltip>
            <template slot-scope="scope">
              <el-tag>{{ scope.row.deptName }}</el-tag>
            </template>
          </el-table-column>
          <el-table-column prop="jobId" label="岗位" width="150" show-overflow-tooltip>
            <template slot-scope="scope">
              <el-tag>{{ scope.row.jobName }}</el-tag>
            </template>
          </el-table-column>
        </el-table-column>
        <el-table-column prop="requiredAttendanceDays" label="应出勤天数 / 应出勤时长" width="160" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ (scope.row.requiredAttendanceDays == null ? 0 : scope.row.requiredAttendanceDays) + ' / ' + (scope.row.requiredAttendanceTime == null ? 0 : scope.row.requiredAttendanceTime) }}
          </template>
        </el-table-column>
        <el-table-column prop="actualAttendanceDays" label="实际出勤天数 / 实际出勤时长" width="180" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ (scope.row.actualAttendanceDays == null ? 0 : scope.row.actualAttendanceDays) + ' / ' + (scope.row.actualAttendanceTime == null ? 0 : scope.row.actualAttendanceTime) }}
          </template>
        </el-table-column>
        <el-table-column prop="countOfBeingLate" label="迟到次数 / 迟到时长" width="150" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ (scope.row.countOfBeingLate == null ? 0 : scope.row.countOfBeingLate) + ' / ' + (scope.row.timeOfBeingLate == null ? 0 : scope.row.timeOfBeingLate) }}
          </template>
        </el-table-column>
        <el-table-column prop="countOfBeingEarly" label="早退次数 / 早退时长" width="150" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ (scope.row.countOfBeingEarly == null ? 0 : scope.row.countOfBeingEarly) + ' / ' + (scope.row.timeOfBeingEarly == null ? 0 : scope.row.timeOfBeingEarly) }}
          </template>
        </el-table-column>
        <el-table-column prop="onCardNumber" label=" 上班缺卡次数" width="150" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ (scope.row.onCardNumber == null ? 0 : scope.row.onCardNumber) }}
          </template>
        </el-table-column>
        <el-table-column prop="offCardNumber" label=" 下班缺卡次数" width="150" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ (scope.row.offCardNumber == null ? 0 : scope.row.offCardNumber) }}
          </template>
        </el-table-column>
        <el-table-column prop="goOutNumber" label="外出次数 / 外出时长" width="150" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ (scope.row.goOutNumber == null ? 0 : scope.row.goOutNumber) + ' / ' + (scope.row.goOutTime == null ? 0 : scope.row.goOutTime) }}
          </template>
        </el-table-column>
        <el-table-column prop="bussNumber" label="出差次数 / 出差时长" width="150" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ (scope.row.bussNumber == null ? 0 : scope.row.bussNumber) + ' / ' + (scope.row.bussTime == null ? 0 : scope.row.bussTime) }}
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="isPublicity" label="公示状态" width="80" fixed="right">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.isPublicity != null">{{ dict.label[publicityStatus][scope.row.isPublicity] }}</el-tag>
            <el-tag v-if="scope.row.isPublicity == null">{{ '未公示' }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="isAdmit" label="承认状态" width="80" fixed="right">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.isAdmit != null">{{ dict.label[approveStatus][scope.row.isAdmit] }}</el-tag>
            <el-tag v-if="scope.row.isAdmit == null">{{ '未承认' }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column v-if="checkPer(['admin','attendanceMonth:edit','attendanceMonth:del'])" label="操作" fixed="right" width="210px" align="center">
          <template slot-scope="scope">
            <udOperation
              :data="scope.row"
              :permission="permission"
            >
              <el-popover slot="left" :ref="`publicity_${scope.row.id}`" v-permission="permission.publicity" placement="top" width="180">
                <p>确定公示本条数据吗?</p>
                <div style="text-align: right; margin: 0">
                  <el-button size="mini" type="text" @click="publicityCancel(scope.row)">取消</el-button>
                  <el-button :loading="publicityLoading" type="primary" size="mini" @click="doPublicity(scope.row)">确定</el-button>
                </div>
                <el-button slot="reference" type="primary" icon="el-icon-s-check" size="mini" />
              </el-popover>
              <el-popover slot="left" :ref="`admit_${scope.row.id}`" v-permission="permission.admit" placement="top" width="180">
                <p>确定承认本条数据吗?</p>
                <div style="text-align: right; margin: 0">
                  <el-button size="mini" type="text" @click="approveCancel(scope.row)">取消</el-button>
                  <el-button :loading="approveLoading" type="primary" size="mini" @click="doApprove(scope.row)">确定</el-button>
                </div>
                <el-button slot="reference" type="primary" icon="el-icon-finished" size="mini" style="margin-left: 3px;" />
              </el-popover>
            </udOperation>
          </template>
        </el-table-column>
      </el-table>
      <!--分页组件-->
      <pagination />
    </div>
  </div>
</template>
 
<script>
import crudAttendanceMonth from '@/api/attendance/attendanceMonth'
import crudSysCompany from '@/api/system/sysCompany'
import crudDept from '@/api/system/dept'
import crudJob from '@/api/system/job'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
import Treeselect from '@riophae/vue-treeselect'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import crudUser from '@/api/system/user'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import constant from '@/utils/constant'
 
const defaultForm = { id: null, attendanceDate: null, userId: null, companyId: null, deptId: null, jobId: null, requiredAttendanceDays: null, requiredAttendanceTime: null, actualAttendanceDays: null, actualAttendanceTime: null, countOfBeingLate: null, timeOfBeingLate: null, countOfBeingEarly: null, timeOfBeingEarly: null, goOutNumber: null, goOutTime: null, bussNumber: null, bussTime: null, onCardNumber: null, offCardNumber: null, isPublicity: null, isAdmit: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null }
export default {
  name: 'AttendanceMonth',
  components: { pagination, crudOperation, rrOperation, udOperation, Treeselect },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '考勤月报', url: 'api/attendanceMonth', idField: 'id', sort: 'id,desc', crudMethod: { ...crudAttendanceMonth }})
  },
  // 数据字典
  dicts: [constant.LEAVE_TYPE, constant.PUBLICITY_STATUS, constant.APPROVE_STATUS],
  data() {
    // 时长(千内)验证
    var durationValidate = (rule, value, callback) => {
      const reg = /^([0-9]|[1-9]\d{1,2})(\.\d{1,2})?$|1000$/
      if (value != null && value !== '' && !reg.test(value)) {
        callback(new Error('请输入 一千 以内的正整数或两位小数'))
      } else {
        callback()
      }
    }
    return {
      permission: {
        add: ['admin', 'attendanceMonth:add'],
        edit: ['admin', 'attendanceMonth:edit'],
        del: ['admin', 'attendanceMonth:del'],
        download: ['admin', 'attendanceMonth:download'],
        admit: ['admin', 'attendanceMonth:admit'],
        publicity: ['admin', 'attendanceMonth:publicity']
      },
      rules: {
        attendanceDate: [
          { required: true, message: '统计年月不能为空', trigger: 'blur' }
        ],
        userId: [
          { required: true, message: '所属用户不能为空', trigger: 'change' }
        ],
        companyId: [
          { required: true, message: '所属公司不能为空', trigger: 'change' }
        ],
        deptId: [
          { required: true, message: '所属部门不能为空', trigger: 'change' }
        ],
        jobId: [
          { required: true, message: '所属岗位不能为空', trigger: 'change' }
        ],
        requiredAttendanceDays: [
          { validator: durationValidate, trigger: 'blur' }
        ],
        requiredAttendanceTime: [
          { validator: durationValidate, trigger: 'blur' }
        ],
        actualAttendanceDays: [
          { validator: durationValidate, trigger: 'blur' }
        ],
        actualAttendanceTime: [
          { validator: durationValidate, trigger: 'blur' }
        ],
        countOfBeingLate: [
          { validator: durationValidate, trigger: 'blur' }
        ],
        timeOfBeingLate: [
          { validator: durationValidate, trigger: 'blur' }
        ],
        countOfBeingEarly: [
          { validator: durationValidate, trigger: 'blur' }
        ],
        timeOfBeingEarly: [
          { validator: durationValidate, trigger: 'blur' }
        ],
        goOutNumber: [
          { validator: durationValidate, trigger: 'blur' }
        ],
        goOutTime: [
          { validator: durationValidate, trigger: 'blur' }
        ],
        bussNumber: [
          { validator: durationValidate, trigger: 'blur' }
        ],
        bussTime: [
          { validator: durationValidate, trigger: 'blur' }
        ],
        onCardNumber: [
          { validator: durationValidate, trigger: 'blur' }
        ],
        offCardNumber: [
          { validator: durationValidate, trigger: 'blur' }
        ]
      },
      users: [],
      dictLeaveType: constant.LEAVE_TYPE,
      // 字典:公示状态
      publicityStatus: constant.PUBLICITY_STATUS,
      // 字典:承认状态
      approveStatus: constant.APPROVE_STATUS,
      // 承认弹窗加载
      approveLoading: false,
      // 公示弹窗加载
      publicityLoading: false,
      // 公司
      companys: [],
      // 部门
      depts: [],
      // 岗位
      jobs: [] }
  },
  methods: {
    // 钩子:在获取表格数据之前执行,false 则代表不获取数据
    [CRUD.HOOK.beforeRefresh]() {
      crudUser.getAll().then(res => {
        this.users = res
      })
      crudSysCompany.getAll().then(res => {
        this.companys = res
      })
      return true
    },
    // 新增与编辑前做的操作
    [CRUD.HOOK.afterToCU](crud, form) {
      if (form.id == null) {
        this.getDepts()
      } else {
        this.getSupDepts(form.deptId)
      }
      this.getJobs()
    },
    // 获取弹窗内部门数据
    loadDepts({ action, parentNode, callback }) {
      if (action === LOAD_CHILDREN_OPTIONS) {
        crudDept.getDepts({ enabled: true, pid: parentNode.id }).then(res => {
          parentNode.children = res.content.map(function(obj) {
            if (obj.hasChildren) {
              obj.children = null
            }
            return obj
          })
          setTimeout(() => {
            callback()
          }, 200)
        })
      }
    },
    getDepts() {
      crudDept.getDepts({ enabled: true }).then(res => {
        this.depts = res.content.map(function(obj) {
          if (obj.hasChildren) {
            obj.children = null
          }
          return obj
        })
      })
    },
    getSupDepts(deptId) {
      crudDept.getDeptSuperior(deptId).then(res => {
        const date = res.content
        this.buildDepts(date)
        this.depts = date
      })
    },
    buildDepts(depts) {
      depts.forEach(data => {
        if (data.children) {
          this.buildDepts(data.children)
        }
        if (data.hasChildren && !data.children) {
          data.children = null
        }
      })
    },
    getJobs() {
      crudJob.getAll().then(res => {
        this.jobs = res
      }).catch(() => { })
    },
    // 公示按钮
    multiplePublicity(data) {
      // 确认框
      this.$confirm('此操作将公示 ' + data.length + ' 条月报, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'success'
      }).then(() => {
        // ID列表
        const ids = []
        // 循环数据
        for (let i = 0; i < data.length; i++) {
          // ID列表
          ids.push(data[i].id)
          // 判断循环是否结束
          if (i === data.length - 1) {
            // 公示月报
            crudAttendanceMonth.publicity(ids).then(res => {
              // 搜索:刷新表格
              this.crud.toQuery()
              // 消息提示
              this.crud.notify('公示成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
            })
          }
        }
      })
    },
    // 个人承认(选择按钮)
    attendanceMAdmit(value) {
      // 确认框
      this.$confirm('此操作将承认月报内容是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'success'
      }).then(() => {
        this.form.id = value.id
        crudAttendanceMonth.updateIsConfirm(this.form).then(res => {
          // 消息提示
          this.$message({
            type: 'success',
            message: '月报已承认!'
          })
          // 刷新数据
          this.crud.refresh()
        })
      })
    },
    // 公示弹窗确认
    doPublicity(data) {
      // 公示弹窗加载
      this.publicityLoading = true
      // 公示工资
      crudAttendanceMonth.publicity([data.id]).then(res => {
        // 搜索:刷新表格
        this.crud.toQuery()
        // 消息提示
        this.crud.notify('公示成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
        // 公示弹窗加载
        this.publicityLoading = false
        // 公示弹窗隐藏
        this.$refs[`publicity_${data.id}`].showPopper = false
      }).catch(() => {
        // 公示弹窗加载
        this.publicityLoading = false
      })
    },
    // 个人承认(按钮)
    doApprove(value) {
      // 承认弹窗加载
      this.approveLoading = true
      this.form.id = value.id
      crudAttendanceMonth.updateIsConfirm(this.form).then(res => {
        // 搜索:刷新表格
        this.crud.toQuery()
        // 消息提示
        this.crud.notify('承认成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
        // 承认弹窗加载
        this.approveLoading = false
        // 承认弹窗隐藏
        this.$refs[`admit_${value.id}`].showPopper = false
      }).catch(() => {
        // 承认弹窗加载
        this.approveLoading = false
      })
    },
    // 公示弹窗关闭
    publicityCancel(data) {
      // 公示弹窗隐藏
      this.$refs[`publicity_${data.id}`].showPopper = false
    },
    // 承认弹窗关闭
    approveCancel(data) {
      // 承认弹窗隐藏
      this.$refs[`admit_${data.id}`].showPopper = false
    }
  }
}
</script>
 
<style scoped>
.isConfirmCol{
  color:red
}
 
.isConfirmSucc{
  color: rgb(34, 207, 63);
}
::v-deep .vue-treeselect__control,::v-deep .vue-treeselect__placeholder,::v-deep .vue-treeselect__single-value {
    height: 30px;
    line-height: 30px;
}
</style>