Explorar el Código

[FE]修改考勤页面布局

as1565066165 %!s(int64=4) %!d(string=hace) años
padre
commit
4c073ba04e

+ 2 - 0
security-protection-platform/.gitignore

@ -8,6 +8,8 @@ yarn.lock
8 8
npm-debug.log
9 9
.ipu/temp/
10 10
.aid/temp/
11
.aid/aid.js
12
src/conf/axios.config.js
11 13
selenium-debug.log
12 14
.idea/
13 15
build/

+ 23 - 20
security-protection-platform/src/assets/styles/pages/_index.scss

@ -2,23 +2,26 @@
2 2
 * 本文件是项目各页面样式入口文件
3 3
**/
4 4
5
.page-main{
6
    .dropdown div{
7
        width:200px;
8
    }
9
    .clearfix{
10
        display: flex;
11
    }
12
    .cascader{
13
        display: flex;
14
    }.cascader__wrap{
15
        display: flex;
16
    }.table th > .cell{
17
        font-size: 14px;
18
    }.table .cell{
19
        font-size: 14px;
20
    }
21
    .modal-body{
22
        padding: 24px !important;
23
    }
24
}
5
.page-main {
6
  .dropdown div {
7
    width: 200px;
8
  }
9
  .clearfix {
10
    display: flex;
11
  }
12
  .cascader {
13
    display: flex;
14
  }
15
  .cascader__wrap {
16
    display: flex;
17
  }
18
  .table th > .cell {
19
    font-size: 14px;
20
  }
21
  .table .cell {
22
    font-size: 14px;
23
  }
24
  .modal-body {
25
    padding: 24px !important;
26
  }
27
}

+ 192 - 51
security-protection-platform/src/modules/attendance/abnormal/index.vue

@ -1,66 +1,97 @@
1 1
<template>
2
  <div class="page-main">
2
  <div class="page-main1">
3 3
    <div class="page-content">
4
      <div class="row mt-32">
5
        <div class="keep-row">
6
          <span>月份:</span>
7
          <t-date-picker v-model="form.month" style="width:200px" type="month" placeholder="请选择月份" />
8
        </div>
9
        <div class="keep-row">
10
          <span>部门/员工:</span>
11
          <dept-staff-cascader v-model="form" @inited="handleInited" @getOrgId="getDailyOrgId" @getDepId="getDailyDepId" @getStaffId="getDailyStaffId" />
12
          <div class="search-btn">
13
            <t-button color="primary" @click="handSearchAttendance">查询</t-button>
4
      <div class="track-container">
5
        <div class="search-container">
6
          <div class="search-ctn">
7
            <div>
8
              <div style="display: flex;">
9
                <t-date-picker v-model="form.month" style="width:200px" type="month" placeholder="请选择月份" />
10
                <template>
11
                  <t-button style="margin-left:10px" color="primary" icon="search-outline" @click="handSearchAttendance">查询</t-button>
12
                </template>
13
                <t-button icon="filter-outline" style="margin: 0 10px;" @click="slideVisible = !slideVisible"></t-button>
14
              </div>
15
            </div>
16
            <div class="btns">
17
              <t-button color="primary">
18
                <t-icon size="14" icon="upload-outline"></t-icon> 导出至Excel
19
              </t-button>
20
              <t-dropdown :visibled="customVisibled" trigger-mode="custom">
21
                <t-button slot="trigger" color="secondary" icon="tile-four-outline" @click="onTriggerClick"></t-button>
22
                <div slot="popper">
23
                  <div style="border-radius: 5px;padding: 20px 20px 20px 20px;background-color: white;">
24
                    <t-checkbox-group v-model="social" vertical @change="checkAllGroupChange">
25
                      <t-checkbox v-for="(item) in columns" :key="item.label" :value="item.label" :label="item.label">
26
                        <span>{{ item.label }}</span>
27
                      </t-checkbox>
28
                    </t-checkbox-group>
29
                    <div style="padding-bottom: 10px">
30
                      <t-checkbox :indeterminate="indeterminate" :checked.sync="checkAll" @click.prevent.native="handleCheckAll">全选
31
                      </t-checkbox>
32
                    </div>
33
                    <t-button color="primary" size="sm" @click="onCloseClick">确认</t-button>
34
                  </div>
35
                </div>
36
              </t-dropdown>
37
              <t-button color="secondary" icon="loading" class="reset-btn" @click="resetData"></t-button>
38
            </div>
39
          </div>
40
          <div class="animate-demo-wrapper">
41
            <transition name="slide-up">
42
              <div v-show="slideVisible" class="transition-box allCondition">
43
                <div class="input-rule">
44
                  <span>部门/员工:</span>
45
                  <dept-staff-cascader v-model="form" @inited="handleInited" @getOrgId="getDailyOrgId" @getDepId="getDailyDepId" @getStaffId="getDailyStaffId" />
46
                </div>
47
              </div>
48
            </transition>
14 49
          </div>
15 50
        </div>
16
17
        <t-button class="export-excel" color="primary">
18
          <t-icon size="14" class="icon-txt" icon="upload-outline"></t-icon>导出至Excel
19
        </t-button>
20 51
      </div>
21 52
      <t-table :data="tableData" :loading="loadTable" size="sm" line class="table-detail">
22 53
        <t-table-column type="selection"></t-table-column>
23
        <t-table-column   prop="name" label="姓名"></t-table-column>
24
        <t-table-column   prop="userid" label="员工编号"></t-table-column>
25
        <t-table-column   prop="duty" label="职务"></t-table-column>
26
        <t-table-column   prop="daysAttendance" label="出勤天数(天)"></t-table-column>
27
        <t-table-column   prop="timesLate" label="迟到次数(次)">
54
        <t-table-column v-if="columns[0].show" prop="name" label="姓名"></t-table-column>
55
        <t-table-column v-if="columns[1].show" prop="userid" label="员工编号"></t-table-column>
56
        <t-table-column v-if="columns[2].show" prop="duty" label="职务"></t-table-column>
57
        <t-table-column v-if="columns[3].show" prop="daysAttendance" label="出勤天数(天)"></t-table-column>
58
        <t-table-column v-if="columns[4].show" prop="timesLate" label="迟到次数(次)">
28 59
          <template slot-scope="scope">
29 60
            <span v-if="scope.row.timesLate===0" size="sm">{{ scope.row.timesLate }}</span>
30 61
            <span v-else class="abnormalState">{{ scope.row.timesLate }}</span>
31 62
          </template>
32 63
        </t-table-column>
33
        <t-table-column   prop="hoursLate" label="迟到时长(h)">
64
        <t-table-column v-if="columns[5].show" prop="hoursLate" label="迟到时长(h)">
34 65
          <template slot-scope="scope">
35 66
            <span v-if="scope.row.hoursLate===0" size="sm">{{ scope.row.hoursLate }}</span>
36 67
            <span v-else class="abnormalState">{{ scope.row.hoursLate }}</span>
37 68
          </template>
38 69
        </t-table-column>
39
        <t-table-column   prop="timesLeftearly" label="早退次数(次)">
70
        <t-table-column v-if="columns[6].show" prop="timesLeftearly" label="早退次数(次)">
40 71
          <template slot-scope="scope">
41 72
            <span v-if="scope.row.timesLeftearly===0" size="sm">{{ scope.row.timesLeftearly }}</span>
42 73
            <span v-else class="abnormalState">{{ scope.row.timesLeftearly }}</span>
43 74
          </template>
44 75
        </t-table-column>
45
        <t-table-column  prop="hoursLeftearly" label="早退时长(h)">
76
        <t-table-column v-if="columns[7].show" prop="hoursLeftearly" label="早退时长(h)">
46 77
          <template slot-scope="scope">
47 78
            <span v-if="scope.row.hoursLeftearly===0" size="sm">{{ scope.row.hoursLeftearly }}</span>
48 79
            <span v-else class="abnormalState">{{ scope.row.hoursLeftearly }}</span>
49 80
          </template>
50 81
        </t-table-column>
51
        <t-table-column prop="timesAbsence" label="旷工次数(次)">
82
        <t-table-column v-if="columns[8].show" prop="timesAbsence" label="旷工次数(次)">
52 83
          <template slot-scope="scope">
53 84
            <span v-if="scope.row.timesAbsence===0" size="sm">{{ scope.row.timesAbsence }}</span>
54 85
            <span v-else class="abnormalState">{{ scope.row.timesAbsence }}</span>
55 86
          </template>
56 87
        </t-table-column>
57
        <t-table-column  prop="daysAbsence" label="旷工时长(天)">
88
        <t-table-column v-if="columns[9].show" prop="daysAbsence" label="旷工时长(天)">
58 89
          <template slot-scope="scope">
59 90
            <span v-if="scope.row.daysAbsence===0" size="sm">{{ scope.row.daysAbsence }}</span>
60 91
            <span v-else class="abnormalState">{{ scope.row.daysAbsence }}</span>
61 92
          </template>
62 93
        </t-table-column>
63
        <t-table-column prop="operation" label="操作" fixed="right">
94
        <t-table-column width="120" prop="operation" label="操作" fixed="right">
64 95
          <template slot-scope="scope">
65 96
            <a class="link" size="sm" @click="handleClick(scope.row)">详情</a>
66 97
          </template>
@ -79,19 +110,58 @@ import AttendanceDialog from '../components/AttendanceDialog'
79 110
import formatDateTime from '@/utils/formatDateTime.js'
80 111
import DeptStaffCascader from '../components/DeptStaffCascader'
81 112
113
const defaultSearchData = {
114
  month: formatDateTime(new Date().setMonth(new Date().getMonth() - 1), 'yyyy-MM'),
115
  userid: null,
116
  depId: '',
117
  orgId: '',
118
  current: 1,
119
  pageSize: 10
120
}
82 121
export default {
83 122
  components: { AttendanceDialog, DeptStaffCascader },
84 123
  data () {
85 124
    const now = new Date()
86 125
    return {
87
      form: {
88
        month: formatDateTime(new Date().setMonth(now.getMonth() - 1), 'yyyy-MM'),
89
        userid: null,
90
        depId: '',
91
        orgId: '',
92
        current: 1,
93
        pageSize: 10
94
      },
126
      slideVisible: false,
127
      indeterminate: true,
128
      checkAll: true,
129
      social: ['姓名', '员工编号', '职务', '出勤天数(天)', '迟到次数(次)', '迟到时长(h)', '早退次数(次)', '早退时长(h)', '旷工次数(次)', '旷工时长(天)'],
130
      columns: [
131
        {
132
          label: '姓名',
133
          show: true
134
        }, {
135
          label: '员工编号',
136
          show: true
137
        }, {
138
          label: '职务',
139
          show: true
140
        }, {
141
          label: '出勤天数(天)',
142
          show: true
143
        }, {
144
          label: '迟到次数(次)',
145
          show: true
146
        }, {
147
          label: '迟到时长(h)',
148
          show: true
149
        }, {
150
          label: '早退次数(次)',
151
          show: true
152
        }, {
153
          label: '早退时长(h)',
154
          show: true
155
        }, {
156
          label: '旷工次数(次)',
157
          show: true
158
        }, {
159
          label: '旷工时长(天)',
160
          show: true
161
        }
162
      ],
163
      customVisibled: false,
164
      form: JSON.parse(JSON.stringify(defaultSearchData)),
95 165
      total: 0,
96 166
      attendanceModal: false,
97 167
      agreement: '',
@ -103,6 +173,40 @@ export default {
103 173
    }
104 174
  },
105 175
  methods: {
176
    checkAllGroupChange () {
177
      if (this.social.length === 10) {
178
        this.indeterminate = false
179
        this.checkAll = true
180
      } else if (this.social.length > 0) {
181
        this.indeterminate = true
182
        this.checkAll = false
183
      } else {
184
        this.indeterminate = false
185
        this.checkAll = false
186
      }
187
    },
188
    handleCheckAll () {
189
      if (this.indeterminate) {
190
        this.checkAll = false
191
      } else {
192
        this.checkAll = !this.checkAll
193
      }
194
      this.indeterminate = false
195
      if (this.checkAll) {
196
        this.social = ['姓名', '员工编号', '职务', '出勤天数(天)', '迟到次数(次)', '迟到时长(h)', '早退次数(次)', '早退时长(h)', '旷工次数(次)', '旷工时长(天)']
197
      } else {
198
        this.social = []
199
      }
200
    },
201
    onTriggerClick () {
202
      this.customVisibled = true
203
    },
204
    onCloseClick () {
205
      this.columns.forEach(e => {
206
        e.show = this.social.indexOf(e.label) >= 0
207
      })
208
      this.customVisibled = false
209
    },
106 210
    getDailyOrgId (id) {
107 211
      this.form.orgId = id
108 212
    },
@ -144,6 +248,9 @@ export default {
144 248
        this.loadTable = false
145 249
      })
146 250
    },
251
    resetData () {
252
      this.form = JSON.parse(JSON.stringify(defaultSearchData))
253
    },
147 254
    // 弹窗打开
148 255
    handleClick (data) {
149 256
      const { userid, beginDay, endDay } = data
@ -169,28 +276,62 @@ export default {
169 276
}
170 277
</script>
171 278
<style lang="scss" scoped>
172
.page-main {
279
.page-main1 {
173 280
  margin: 20px 20px 16px 20px;
174 281
  .abnormalState {
175 282
    color: #eda30f;
176 283
    font-size: 14px;
177 284
  }
178
  .keep-row {
179
    margin-left: 24px;
180
    display: flex;
181
    align-items: center;
182
  }
183
  .search-btn {
184
    margin-left: auto;
185
    margin-right: 15px;
186
  }
187
  .icon-txt {
188
    margin-right: 8px;
189
  }
190
  .export-excel {
191
    margin-top: 24px;
192
    display: flex;
193
    align-items: center;
285
  .track-container {
286
    width: 100%;
287
    margin: 24px 0;
288
    // padding: 20px;
289
    box-sizing: border-box;
290
    .search-container {
291
      width: 100%;
292
      .search-ctn {
293
        width: 100%;
294
        overflow: hidden;
295
        margin: 0;
296
        padding: 0;
297
        display: flex;
298
        position: relative;
299
        > div {
300
          // margin: 0 20px 16px 0;
301
          line-height: 2;
302
        }
303
        .btns {
304
          margin-left: auto;
305
          display: block;
306
          button {
307
            margin: 0 2px;
308
          }
309
        }
310
      }
311
    }
312
    .table-pager {
313
      margin: 20px auto;
314
    }
315
    .allCondition {
316
      display: flex;
317
      justify-content: space-between;
318
      border: 1px solid rgba(0, 0, 0, 0.09);
319
      background-color: #f8f9fa;
320
      flex-wrap: wrap;
321
      padding: 20px;
322
      margin: 5px auto;
323
      .input-rule {
324
        display: flex;
325
        flex: 1;
326
        width: 80%;
327
        min-width: 80%;
328
        max-width: 80%;
329
        padding: 10px 0 10px 20px;
330
        > span {
331
          line-height: 32px;
332
        }
333
      }
334
    }
194 335
  }
195 336
  .table-detail {
196 337
    margin-top: 20px;

+ 303 - 66
security-protection-platform/src/modules/attendance/report/index.vue

@ -1,30 +1,64 @@
1 1
<template>
2
  <div class="page-main">
2
  <div class="page-main1">
3 3
    <div class="page-content">
4
      <t-tabs :animated="false" @change="changeTabs">
4
      <t-tabs v-model="activePanel" :animated="false">
5 5
        <!-- 日报 -->
6 6
        <t-tab-panel label="日报" panel-id="tab-1">
7
          <div class="row mt-32">
8
            <div class="keep-row">
9
              <span>日期:</span>
10
              <t-date-picker v-model="dailyForm.workDay" style="width:200px" placeholder="请选择日期"></t-date-picker>
11
            </div>
12
            <div class="keep-row">
13
              <span>部门/员工:</span>
14
              <dept-staff-cascader v-model="dailyForm" @inited="handleDailyInited" @getOrgId="getDailyOrgId" @getDepId="getDailyDepId" @getStaffId="getDailyStaffId" />
15
              <div class="search-btn">
16
                <t-button color="primary" @click="handSearchDay">查询</t-button>
17
                <t-button @click="resetDailyData">重置</t-button>
7
          <div class="track-container">
8
            <div class="search-container">
9
              <div class="search-ctn">
10
                <div>
11
                  <div style="display: flex;">
12
                    <t-date-picker v-model="dailyForm.workDay" style="width:200px" placeholder="请选择日期"></t-date-picker>
13
                    <template>
14
                      <t-button style="margin-left:10px" color="primary" icon="search-outline" @click="handSearchDay">查询</t-button>
15
                    </template>
16
                    <t-button icon="filter-outline" style="margin: 0 10px;" @click="slideVisible0 = !slideVisible0"></t-button>
17
                  </div>
18
                </div>
19
                <div class="btns">
20
                  <t-button color="primary">
21
                    <t-icon size="14" icon="upload-outline"></t-icon> 导出至Excel
22
                  </t-button>
23
                  <t-dropdown :visibled="customVisibled0" trigger-mode="custom">
24
                    <t-button slot="trigger" color="secondary" icon="tile-four-outline" @click="onTriggerClick"></t-button>
25
                    <div slot="popper">
26
                      <div style="border-radius: 5px;padding: 20px 20px 20px 20px;background-color: white;">
27
                        <t-checkbox-group v-model="social0" vertical @change="checkAllGroupChange">
28
                          <t-checkbox v-for="(item) in columns0" :key="item.label" :value="item.label" :label="item.label">
29
                            <span>{{ item.label }}</span>
30
                          </t-checkbox>
31
                        </t-checkbox-group>
32
                        <div style="padding-bottom: 10px">
33
                          <t-checkbox :indeterminate0="indeterminate0" :checked.sync="checkAll0" @click.prevent.native="handleCheckAll">全选
34
                          </t-checkbox>
35
                        </div>
36
                        <t-button color="primary" size="sm" @click="onCloseClick">确认</t-button>
37
                      </div>
38
                    </div>
39
                  </t-dropdown>
40
                  <t-button color="secondary" icon="loading" class="reset-btn" @click="resetDailyData"></t-button>
41
                </div>
18 42
              </div>
19
            </div>
43
              <div class="animate-demo-wrapper">
44
                <transition name="slide-up">
45
                  <div v-show="slideVisible0" class="transition-box allCondition">
46
                    <div class="input-rule">
47
                      <span>部门/员工:</span>
48
                      <dept-staff-cascader v-model="dailyForm" @inited="handleDailyInited" @getOrgId="getDailyOrgId" @getDepId="getDailyDepId" @getStaffId="getDailyStaffId" />
49
                    </div>
20 50
51
                  </div>
52
                </transition>
53
              </div>
54
            </div>
21 55
          </div>
22 56
          <t-table :data="dailyTableData" :loading="loadDailyTable" size="sm" line class="table-detail">
23 57
            <t-table-column size="sm" type="selection"></t-table-column>
24
            <t-table-column size="sm" prop="name" label="姓名"></t-table-column>
25
            <t-table-column size="sm" prop="userid" label="员工编号"></t-table-column>
26
            <t-table-column size="sm" prop="duty" label="职务"></t-table-column>
27
            <t-table-column size="sm" prop="status" label="考勤状态">
58
            <t-table-column v-if="columns0[0].show" size="sm" prop="name" label="姓名"></t-table-column>
59
            <t-table-column v-if="columns0[1].show" size="sm" prop="userid" label="员工编号"></t-table-column>
60
            <t-table-column v-if="columns0[2].show" size="sm" prop="duty" label="职务"></t-table-column>
61
            <t-table-column v-if="columns0[3].show" size="sm" prop="status" label="考勤状态">
28 62
              <template slot-scope="scope">
29 63
                <span :class="getStatusClass(scope.row.goToWorkStatus)">{{ scope.row.goToWorkStatus }}</span>
30 64
                <span :class="getStatusClass(scope.row.goOffWorkStatus)">{{ scope.row.goOffWorkStatus }}</span>
@ -35,68 +69,100 @@
35 69
        </t-tab-panel>
36 70
        <!-- 月报 -->
37 71
        <t-tab-panel label="月报" panel-id="tab-2">
38
          <div class="row mt-32">
39
            <div class="keep-row">
40
              <span>月份:</span>
41
              <t-date-picker v-model="monthlyForm.month" style="width:200px" type="month" placeholder="请选择月份"></t-date-picker>
42
            </div>
43
            <div class="keep-row">
44
              <span>部门/员工:</span>
45
              <dept-staff-cascader v-model="monthlyForm" @getOrgId="getMonthOrgId" @getDepId="getMonthDepId" @getStaffId="getMonthStaffId" />
46
              <div class="search-btn">
47
                <t-button color="primary" @click="handSearchMonth">查询</t-button>
48
                <t-button @click="resetMonthData">重置</t-button>
72
          <div class="track-container">
73
            <div class="search-container">
74
              <div class="search-ctn">
75
                <div>
76
                  <div style="display: flex;">
77
                    <t-date-picker v-model="monthlyForm.month" style="width:200px" type="month" placeholder="请选择月份"></t-date-picker>
78
                    <template>
79
                      <t-button style="margin-left:10px" color="primary" icon="search-outline" @click="handSearchMonth">查询</t-button>
80
                    </template>
81
                    <t-button icon="filter-outline" style="margin: 0 10px;" @click="slideVisible1 = !slideVisible1"></t-button>
82
                  </div>
83
                </div>
84
                <div class="btns">
85
                  <t-button color="primary">
86
                    <t-icon size="14" icon="upload-outline"></t-icon> 导出至Excel
87
                  </t-button>
88
                  <t-dropdown :visibled="customVisibled1" trigger-mode="custom">
89
                    <t-button slot="trigger" color="secondary" icon="tile-four-outline" @click="onTriggerClick"></t-button>
90
                    <div slot="popper">
91
                      <div style="border-radius: 5px;padding: 20px 20px 20px 20px;background-color: white;">
92
                        <t-checkbox-group v-model="social1" vertical @change="checkAllGroupChange">
93
                          <t-checkbox v-for="(item) in columns1" :key="item.label" :value="item.label" :label="item.label">
94
                            <span>{{ item.label }}</span>
95
                          </t-checkbox>
96
                        </t-checkbox-group>
97
                        <div style="padding-bottom: 10px">
98
                          <t-checkbox :indeterminate0="indeterminate1" :checked.sync="checkAll1" @click.prevent.native="handleCheckAll">全选
99
                          </t-checkbox>
100
                        </div>
101
                        <t-button color="primary" size="sm" @click="onCloseClick">确认</t-button>
102
                      </div>
103
                    </div>
104
                  </t-dropdown>
105
                  <t-button color="secondary" icon="loading" class="reset-btn" @click="resetMonthData"></t-button>
106
                </div>
49 107
              </div>
50
            </div>
108
              <div class="animate-demo-wrapper">
109
                <transition name="slide-up">
110
                  <div v-show="slideVisible1" class="transition-box allCondition">
111
                    <div class="input-rule">
112
                      <span>部门/员工:</span>
113
                      <dept-staff-cascader v-model="monthlyForm" @getOrgId="getMonthOrgId" @getDepId="getMonthDepId" @getStaffId="getMonthStaffId" />
114
                      <div class="search-btn">
115
                      </div>
51 116
117
                    </div>
118
                  </div>
119
                </transition>
120
              </div>
121
            </div>
52 122
          </div>
53
          <t-button class="export-excel" color="primary">
54
            <t-icon size="14" class="icon-txt" icon="upload-outline"></t-icon>导出至Excel
55
          </t-button>
56
57 123
          <t-table :data="monthTableData" :loading="loadMonthTable" size="sm" line class="table-detail">
58 124
            <t-table-column type="selection"></t-table-column>
59
            <t-table-column width="75" prop="name" label="姓名"></t-table-column>
60
            <t-table-column width="90" prop="userid" label="员工编号"></t-table-column>
61
            <t-table-column width="90" prop="duty" label="职务"></t-table-column>
62
            <t-table-column width="120" prop="daysAttendance" label="出勤天数(天)"></t-table-column>
63
            <t-table-column width="120" prop="timesLate" label="迟到次数(次)">
125
            <t-table-column v-if="columns1[0].show" width="75" prop="name" label="姓名"></t-table-column>
126
            <t-table-column v-if="columns1[1].show" width="90" prop="userid" label="员工编号"></t-table-column>
127
            <t-table-column v-if="columns1[2].show" width="90" prop="duty" label="职务"></t-table-column>
128
            <t-table-column v-if="columns1[3].show" width="120" prop="daysAttendance" label="出勤天数(天)"></t-table-column>
129
            <t-table-column v-if="columns1[4].show" width="120" prop="timesLate" label="迟到次数(次)">
64 130
              <template slot-scope="scope">
65 131
                <span v-if="scope.row.timesLate===0" size="sm">{{ scope.row.timesLate }}</span>
66 132
                <span v-else class="abnormalState">{{ scope.row.timesLate }}</span>
67 133
              </template>
68 134
            </t-table-column>
69
            <t-table-column width="110" prop="hoursLate" label="迟到时长(h)">
135
            <t-table-column v-if="columns1[5].show" width="110" prop="hoursLate" label="迟到时长(h)">
70 136
              <template slot-scope="scope">
71 137
                <span v-if="scope.row.hoursLate===0" size="sm">{{ scope.row.hoursLate }}</span>
72 138
                <span v-else class="abnormalState">{{ scope.row.hoursLate }}</span>
73 139
              </template>
74 140
            </t-table-column>
75
            <t-table-column width="120" prop="timesLeftearly" label="早退次数(次)">
141
            <t-table-column v-if="columns1[6].show" width="120" prop="timesLeftearly" label="早退次数(次)">
76 142
              <template slot-scope="scope">
77 143
                <span v-if="scope.row.timesLeftearly===0" size="sm">{{ scope.row.timesLeftearly }}</span>
78 144
                <span v-else class="abnormalState">{{ scope.row.timesLeftearly }}</span>
79 145
              </template>
80 146
            </t-table-column>
81
            <t-table-column width="120" prop="hoursLeftearly" label="早退时长(h)">
147
            <t-table-column v-if="columns1[7].show" width="120" prop="hoursLeftearly" label="早退时长(h)">
82 148
              <template slot-scope="scope">
83 149
                <span v-if="scope.row.hoursLeftearly===0" size="sm">{{ scope.row.hoursLeftearly }}</span>
84 150
                <span v-else class="abnormalState">{{ scope.row.hoursLeftearly }}</span>
85 151
              </template>
86 152
            </t-table-column>
87
            <t-table-column width="120" prop="timesAbsence" label="旷工次数(次)">
153
            <t-table-column v-if="columns1[8].show" width="120" prop="timesAbsence" label="旷工次数(次)">
88 154
              <template slot-scope="scope">
89 155
                <span v-if="scope.row.timesAbsence===0" size="sm">{{ scope.row.timesAbsence }}</span>
90 156
                <span v-else class="abnormalState">{{ scope.row.timesAbsence }}</span>
91 157
              </template>
92 158
            </t-table-column>
93
            <t-table-column width="120" prop="daysAbsence" label="旷工时长(天)">
159
            <t-table-column v-if="columns1[9].show" width="120" prop="daysAbsence" label="旷工时长(天)">
94 160
              <template slot-scope="scope">
95 161
                <span v-if="scope.row.daysAbsence===0" size="sm">{{ scope.row.daysAbsence }}</span>
96 162
                <span v-else class="abnormalState">{{ scope.row.daysAbsence }}</span>
97 163
              </template>
98 164
            </t-table-column>
99
            <t-table-column prop="operation" label="操作" fixed="right">
165
            <t-table-column width="120" prop="operation" label="操作" fixed="right">
100 166
              <template slot-scope="scope">
101 167
                <a class="link" size="sm" @click="handleClick(scope.row)">详情</a>
102 168
              </template>
@ -120,6 +186,64 @@ export default {
120 186
  data () {
121 187
    const now = new Date()
122 188
    return {
189
      slideVisible0: false,
190
      slideVisible1: false,
191
      indeterminate0: true,
192
      indeterminate1: true,
193
      checkAll0: true,
194
      checkAll1: true,
195
      social0: ['姓名', '员工编号', '职务', '考勤状态'],
196
      social1: ['姓名', '员工编号', '职务', '出勤天数(天)', '迟到次数(次)', '迟到时长(h)', '早退次数(次)', '早退时长(h)', '旷工次数(次)', '旷工时长(天)'],
197
      columns0: [
198
        {
199
          label: '姓名',
200
          show: true
201
        }, {
202
          label: '员工编号',
203
          show: true
204
        }, {
205
          label: '职务',
206
          show: true
207
        }, {
208
          label: '考勤状态',
209
          show: true
210
        }
211
      ],
212
      columns1: [
213
        {
214
          label: '姓名',
215
          show: true
216
        }, {
217
          label: '员工编号',
218
          show: true
219
        }, {
220
          label: '职务',
221
          show: true
222
        }, {
223
          label: '出勤天数(天)',
224
          show: true
225
        }, {
226
          label: '迟到次数(次)',
227
          show: true
228
        }, {
229
          label: '迟到时长(h)',
230
          show: true
231
        }, {
232
          label: '早退次数(次)',
233
          show: true
234
        }, {
235
          label: '早退时长(h)',
236
          show: true
237
        }, {
238
          label: '旷工次数(次)',
239
          show: true
240
        }, {
241
          label: '旷工时长(天)',
242
          show: true
243
        }
244
      ],
245
      customVisibled0: false,
246
      customVisibled1: false,
123 247
      attendanceModal: false,
124 248
      modalData: {},
125 249
      tabName: 'tab-1',
@ -152,10 +276,92 @@ export default {
152 276
        pageSize: 10
153 277
      },
154 278
      isFirstCreatedMonth: true,
155
      isFirstCreatedDaily: true
279
      isFirstCreatedDaily: true,
280
      // 当前tab
281
      activePanel: 'tab-1'
282
    }
283
  },
284
  watch: {
285
    activePanel () {
286
      this.customVisibled0 = false
287
      this.customVisibled1 = false
156 288
    }
157 289
  },
158 290
  methods: {
291
    checkAllGroupChange () {
292
      if (this.activePanel === 'tab-1') {
293
        if (this.social0.length === 4) {
294
          this.indeterminate0 = false
295
          this.checkAll0 = true
296
        } else if (this.social0.length > 0) {
297
          this.indeterminate0 = true
298
          this.checkAll0 = false
299
        } else {
300
          this.indeterminate0 = false
301
          this.checkAll0 = false
302
        }
303
      } else {
304
        if (this.social1.length === 10) {
305
          this.indeterminate1 = false
306
          this.checkAll1 = true
307
        } else if (this.social1.length > 0) {
308
          this.indeterminate1 = true
309
          this.checkAll1 = false
310
        } else {
311
          this.indeterminate1 = false
312
          this.checkAll1 = false
313
        }
314
      }
315
    },
316
    handleCheckAll () {
317
      if (this.activePanel === 'tab-1') {
318
        if (this.indeterminate0) {
319
          this.checkAll0 = false
320
        } else {
321
          this.checkAll0 = !this.checkAll0
322
        }
323
        this.indeterminate0 = false
324
        if (this.checkAll0) {
325
          this.social0 = ['姓名', '员工编号', '职务', '考勤状态']
326
        } else {
327
          this.social0 = []
328
        }
329
      } else {
330
        if (this.indeterminate1) {
331
          this.checkAll1 = false
332
        } else {
333
          this.checkAll1 = !this.checkAll1
334
        }
335
        this.indeterminate1 = false
336
        if (this.checkAll1) {
337
          this.social1 = ['姓名', '员工编号', '职务', '出勤天数(天)', '迟到次数(次)', '迟到时长(h)', '早退次数(次)', '早退时长(h)', '旷工次数(次)', '旷工时长(天)']
338
        } else {
339
          this.social1 = []
340
        }
341
      }
342
    },
343
    onTriggerClick () {
344
      if (this.activePanel === 'tab-1') {
345
        this.customVisibled0 = true
346
      } else {
347
        this.customVisibled1 = true
348
        // 我加了一个这个事件 避免点击事件时对话框不显示
349
        window.scrollTo(0, 1)
350
      }
351
    },
352
    onCloseClick () {
353
      if (this.activePanel === 'tab-1') {
354
        this.columns0.forEach(e => {
355
          e.show = this.social0.indexOf(e.label) >= 0
356
        })
357
        this.customVisibled0 = false
358
      } else {
359
        this.columns1.forEach(e => {
360
          e.show = this.social1.indexOf(e.label) >= 0
361
        })
362
        this.customVisibled1 = false
363
      }
364
    },
159 365
    getDailyOrgId (id) {
160 366
      this.dailyForm.orgId = id
161 367
    },
@ -187,9 +393,6 @@ export default {
187 393
    handleDailyInited () {
188 394
      // this.getDailyTable()
189 395
    },
190
    changeTabs (tabName) {
191
      this.tabName = tabName
192
    },
193 396
    // 搜索
194 397
    handSearchDay () {
195 398
      if (this.dailyForm.workDay && this.dailyForm.orgId) {
@ -356,28 +559,62 @@ export default {
356 559
}
357 560
</script>
358 561
<style lang="scss" scoped>
359
.page-main {
562
.page-main1 {
360 563
  margin: 20px 20px 16px 20px;
361 564
  .abnormalState {
362 565
    color: #eda30f;
363 566
    font-size: 14px;
364 567
  }
365
  .keep-row {
366
    display: flex;
367
    align-items: center;
368
    margin-left: 24px;
369
  }
370
  .search-btn {
371
    margin-left: auto;
372
    margin-right: 15px;
373
  }
374
  .icon-txt {
375
    margin-right: 8px;
376
  }
377
  .export-excel {
378
    margin-top: 24px;
379
    display: flex;
380
    align-items: center;
568
  .track-container {
569
    width: 100%;
570
    margin: 24px 0;
571
    // padding: 20px;
572
    box-sizing: border-box;
573
    .search-container {
574
      width: 100%;
575
      .search-ctn {
576
        width: 100%;
577
        overflow: hidden;
578
        margin: 0;
579
        padding: 0;
580
        display: flex;
581
        position: relative;
582
        > div {
583
          // margin: 0 20px 16px 0;
584
          line-height: 2;
585
        }
586
        .btns {
587
          margin-left: auto;
588
          display: block;
589
          button {
590
            margin: 0 2px;
591
          }
592
        }
593
      }
594
    }
595
    .table-pager {
596
      margin: 20px auto;
597
    }
598
    .allCondition {
599
      display: flex;
600
      justify-content: space-between;
601
      border: 1px solid rgba(0, 0, 0, 0.09);
602
      background-color: #f8f9fa;
603
      flex-wrap: wrap;
604
      padding: 20px;
605
      margin: 5px auto;
606
      .input-rule {
607
        display: flex;
608
        flex: 1;
609
        width: 80%;
610
        min-width: 80%;
611
        max-width: 80%;
612
        padding: 10px 0 10px 20px;
613
        > span {
614
          line-height: 32px;
615
        }
616
      }
617
    }
381 618
  }
382 619
  .table-detail {
383 620
    margin-top: 20px;