浏览代码

模拟数据

wangkang3 4 年之前
父节点
当前提交
1b56b5f875
共有 2 个文件被更改,包括 198 次插入104 次删除
  1. 97 75
      ebc-middle-platform/src/modules/attendance/attendance.vue
  2. 101 29
      ebc-middle-platform/src/modules/attendance/track.vue

+ 97 - 75
ebc-middle-platform/src/modules/attendance/attendance.vue

@ -40,20 +40,20 @@
40 40
        <t-table-column v-if="queryCondition.currentIndex === 0" prop="IN_DATE" label="打卡时间"></t-table-column>
41 41
        <t-table-column v-if="queryCondition.currentIndex !== 0" prop="gateDays" label="出勤天数(天)"></t-table-column>
42 42
        <t-table-column
43
            v-if="queryCondition.currentIndex === 1"
44
            fixed="right"
45
            label="操作"
46
            width="120"
43
          v-if="queryCondition.currentIndex === 1"
44
          fixed="right"
45
          label="操作"
46
          width="120"
47 47
        >
48 48
          <template slot-scope="scope">
49 49
            <a href="javascript:void(0)" size="sm" @click="detail(scope.row)">详情</a>
50 50
          </template>
51 51
        </t-table-column>
52 52
        <t-table-column
53
            v-if="queryCondition.currentIndex === 2"
54
            fixed="right"
55
            label="操作"
56
            width="120"
53
          v-if="queryCondition.currentIndex === 2"
54
          fixed="right"
55
          label="操作"
56
          width="120"
57 57
        >
58 58
          <template slot-scope="scope">
59 59
            <a href="javascript:void(0)" size="sm" @click="monthDetail(scope.row)">详情</a>
@ -109,7 +109,7 @@
109 109
</template>
110 110
<script>
111 111
import './attendance.scss'
112
import services from "../../conf/services";
112
import services from '../../conf/services'
113 113
export default {
114 114
  data() {
115 115
    return {
@ -191,41 +191,63 @@ export default {
191 191
      this.getList()
192 192
    },
193 193
    getList() {
194
      var mark
195
      if (this.queryCondition.currentIndex === 0) {
196
        mark = 'day'
197
      } else if (this.queryCondition.currentIndex === 1) {
198
        mark = 'week'
199
      } else {
200
        mark = 'month'
201
      }
202
      var params = new FormData()
203
      params.append(
204
          'data',
205
          JSON.stringify({
206
            currentDate: this.queryCondition.singleDateVal,
207
            mark: mark,
208
            userName: this.queryCondition.alarmPerson,
209
            pageNum: this.table.pager.currentPage,
210
            pageSize: this.table.pager.size
211
          })
212
      )
213
      this.$test
214
          .post(services.areaInOutRecord.GET_ATTENDANCE, {
215
            currentDate: this.queryCondition.singleDateVal,
216
            mark: mark,
217
            userName: this.queryCondition.alarmPerson,
218
            pageNum: this.table.pager.currentPage,
219
            pageSize: this.table.pager.size
220
          })
221
          .then((res) => {
222
            // 请求成功处理...
223
            this.table.data = res.data.list
224
            this.table.pager.total = res.data.total
225
          })
226
          .catch((res) => {
227
            // 请求失败处理...
228
          })
194
      this.table.data = [{
195
        userName: '周杰',
196
        duty: '员工',
197
        IN_DATE: '2020-11-25 10:57:02',
198
        gateDays: 5
199
      }, {
200
        userName: '李雷',
201
        duty: '员工',
202
        IN_DATE: '2020-11-25 11:05:30',
203
        gateDays: 5
204
      }, {
205
        userName: '刘伟',
206
        duty: '员工',
207
        IN_DATE: '2020-11-25 11:03:04',
208
        gateDays: 5
209
      }, {
210
        userName: '韩梅梅',
211
        duty: '救援',
212
        IN_DATE: '2020-11-25 11:02:32',
213
        gateDays: 4
214
      }]
215
      this.table.pager.total = 10
216
      // var mark
217
      // if (this.queryCondition.currentIndex === 0) {
218
      //   mark = 'day'
219
      // } else if (this.queryCondition.currentIndex === 1) {
220
      //   mark = 'week'
221
      // } else {
222
      //   mark = 'month'
223
      // }
224
      // var params = new FormData()
225
      // params.append(
226
      //     'data',
227
      //     JSON.stringify({
228
      //       currentDate: this.queryCondition.singleDateVal,
229
      //       mark: mark,
230
      //       userName: this.queryCondition.alarmPerson,
231
      //       pageNum: this.table.pager.currentPage,
232
      //       pageSize: this.table.pager.size
233
      //     })
234
      // )
235
      // this.$test
236
      //     .post(services.areaInOutRecord.GET_ATTENDANCE, {
237
      //       currentDate: this.queryCondition.singleDateVal,
238
      //       mark: mark,
239
      //       userName: this.queryCondition.alarmPerson,
240
      //       pageNum: this.table.pager.currentPage,
241
      //       pageSize: this.table.pager.size
242
      //     })
243
      //     .then((res) => {
244
      //       // 请求成功处理...
245
      //       this.table.data = res.data.list
246
      //       this.table.pager.total = res.data.total
247
      //     })
248
      //     .catch((res) => {
249
      //       // 请求失败处理...
250
      //     })
229 251
    },
230 252
    onSearch() {
231 253
      this.table.pager.currentPage = 1
@ -266,22 +288,22 @@ export default {
266 288
      this.modalData.days = row.gateDays
267 289
      var params = new FormData()
268 290
      params.append(
269
          'data',
270
          JSON.stringify({
271
            EMPLOYEE_ID: row.EMPLOYEE_ID,
272
            mark: 'week',
273
            currentDate: this.queryCondition.singleDateVal
274
          })
291
        'data',
292
        JSON.stringify({
293
          EMPLOYEE_ID: row.EMPLOYEE_ID,
294
          mark: 'week',
295
          currentDate: this.queryCondition.singleDateVal
296
        })
275 297
      )
276 298
      this.$test
277
          .post(services.areaInOutRecord.GET_ATTENDANCE_DETAILE, params)
278
          .then((res) => {
279
            // 请求成功处理...
280
            this.modalData.table = res.data.list
281
          })
282
          .catch((res) => {
283
            // 请求失败处理...
284
          })
299
        .post(services.areaInOutRecord.GET_ATTENDANCE_DETAILE, params)
300
        .then((res) => {
301
          // 请求成功处理...
302
          this.modalData.table = res.data.list
303
        })
304
        .catch((res) => {
305
          // 请求失败处理...
306
        })
285 307
    },
286 308
    monthDetail(row) {
287 309
      this.monthModal = true
@ -299,25 +321,25 @@ export default {
299 321
    getMonthDetail() {
300 322
      var params = new FormData()
301 323
      params.append(
302
          'data',
303
          JSON.stringify({
304
            EMPLOYEE_ID: this.monthModalData.EMPLOYEE_ID,
305
            mark: 'month',
306
            currentDate: this.queryCondition.singleDateVal,
307
            pageNum: this.monthModalData.table.pager.currentPage,
308
            pageSize: this.monthModalData.table.pager.size
309
          })
324
        'data',
325
        JSON.stringify({
326
          EMPLOYEE_ID: this.monthModalData.EMPLOYEE_ID,
327
          mark: 'month',
328
          currentDate: this.queryCondition.singleDateVal,
329
          pageNum: this.monthModalData.table.pager.currentPage,
330
          pageSize: this.monthModalData.table.pager.size
331
        })
310 332
      )
311 333
      this.$test
312
          .post(services.areaInOutRecord.GET_ATTENDANCE_DETAILE, params)
313
          .then((res) => {
314
            // 请求成功处理...
315
            this.monthModalData.table.data = res.data.list
316
            this.monthModalData.table.pager.total = res.data.total
317
          })
318
          .catch((res) => {
319
            // 请求失败处理...
320
          })
334
        .post(services.areaInOutRecord.GET_ATTENDANCE_DETAILE, params)
335
        .then((res) => {
336
          // 请求成功处理...
337
          this.monthModalData.table.data = res.data.list
338
          this.monthModalData.table.pager.total = res.data.total
339
        })
340
        .catch((res) => {
341
          // 请求失败处理...
342
        })
321 343
    },
322 344
    getTime(type) {
323 345
      var date = new Date()

+ 101 - 29
ebc-middle-platform/src/modules/attendance/track.vue

@ -32,8 +32,8 @@
32 32
        <t-table-column prop="duty" label="职务"></t-table-column>
33 33
        <t-table-column prop="RECORD_LOCATION" label="位置区域"></t-table-column>
34 34
        <t-table-column prop="stayTime" label="停留时长(h)"></t-table-column>
35
        <t-table-column :formatter="timestampToTime" prop="IN_DATE" label="进入时间"></t-table-column>
36
        <t-table-column :formatter="timestampToTime" prop="OUT_DATE" label="离开时间"></t-table-column>
35
        <t-table-column prop="IN_DATE" label="进入时间"></t-table-column>
36
        <t-table-column prop="OUT_DATE" label="离开时间"></t-table-column>
37 37
      </t-table>
38 38
      <t-pager :total="table.pager.total" :current.sync="table.pager.currentPage"
39 39
               :page-size.sync="table.pager.size"
@ -48,7 +48,7 @@
48 48
</template>
49 49
<script>
50 50
import './track.scss'
51
import services from "../../conf/services";
51
import services from '../../conf/services'
52 52
export default {
53 53
  data() {
54 54
    return {
@ -71,32 +71,104 @@ export default {
71 71
  },
72 72
  methods: {
73 73
    getList() {
74
      var start = ''
75
      var end = ''
76
      if (this.queryCondition.rangeDate.length > 0) {
77
        start = this.queryCondition.rangeDate[0]
78
        end = this.queryCondition.rangeDate[1]
79
      }
80
      var params = new FormData()
81
      params.append(
82
        'data',
83
        JSON.stringify({
84
          pageNum: this.table.pager.currentPage,
85
          pageSize: this.table.pager.size,
86
          queryStartDate: start,
87
          queryEndDate: end
88
        })
89
      )
90
      this.$test
91
        .post(services.trackAnalysis.GET_TRACKANALYSIS, params)
92
        .then((res) => {
93
        // 请求成功处理...
94
          this.table.data = res.data.result.list
95
          this.table.pager.total = res.data.result.total
96
        })
97
        .catch((res) => {
98
        // 请求失败处理...
99
        })
74
      this.table.data = [{
75
        userName: '周杰',
76
        duty: '员工',
77
        RECORD_LOCATION: '休息区',
78
        stayTime: '0.5',
79
        IN_DATE: '2020-11-25 10:30:30',
80
        OUT_DATE: '2020-11-25 11:00:30'
81
      }, {
82
        userName: '李雷',
83
        duty: '员工',
84
        RECORD_LOCATION: '禁区',
85
        stayTime: '1',
86
        IN_DATE: '2020-11-25 9:30:33',
87
        OUT_DATE: '2020-11-25 10:30:44'
88
      }, {
89
        userName: '刘伟',
90
        duty: '员工',
91
        RECORD_LOCATION: '考勤区',
92
        stayTime: '3',
93
        IN_DATE: '2020-11-25 08:30:23',
94
        OUT_DATE: '2020-11-25 11:30:45'
95
      }, {
96
        userName: '韩梅梅',
97
        duty: '救援',
98
        RECORD_LOCATION: '作业区',
99
        stayTime: '4',
100
        IN_DATE: '2020-11-25 07:28:30',
101
        OUT_DATE: '2020-11-25 11:34:36'
102
      }, {
103
        userName: '韩梅梅',
104
        duty: '救援',
105
        RECORD_LOCATION: ' 考勤区',
106
        stayTime: '1',
107
        IN_DATE: '2020-11-24 09:30:30',
108
        OUT_DATE: '2020-11-24 10:35:26'
109
      }, {
110
        userName: '李雷',
111
        duty: '员工',
112
        RECORD_LOCATION: '考勤区',
113
        stayTime: '11.5',
114
        IN_DATE: '2020-11-24 07:18:12',
115
        OUT_DATE: '2020-11-24 18:44:06'
116
      }, {
117
        userName: '李雷',
118
        duty: '员工',
119
        RECORD_LOCATION: '作业区',
120
        stayTime: '11',
121
        IN_DATE: '2020-11-24 07:21:25',
122
        OUT_DATE: '2020-11-24 18:34:04'
123
      }, {
124
        userName: '李雷',
125
        duty: '员工',
126
        RECORD_LOCATION: '禁区',
127
        stayTime: '1',
128
        IN_DATE: '2020-11-24 16:37:23',
129
        OUT_DATE: '2020-11-25 17:24:35'
130
      }, {
131
        userName: '刘伟',
132
        duty: '员工',
133
        RECORD_LOCATION: '休息区',
134
        stayTime: '0.5',
135
        IN_DATE: '2020-11-24 13:28:36',
136
        OUT_DATE: '2020-11-24 13:58:29'
137
      }, {
138
        userName: '刘伟',
139
        duty: '员工',
140
        RECORD_LOCATION: '休息区',
141
        stayTime: '1',
142
        IN_DATE: '2020-11-24 18:38:27',
143
        OUT_DATE: '2020-11-24 19:24:41'
144
      }]
145
      this.table.pager.total = 10
146
      // var start = ''
147
      // var end = ''
148
      // if (this.queryCondition.rangeDate.length > 0) {
149
      //   start = this.queryCondition.rangeDate[0]
150
      //   end = this.queryCondition.rangeDate[1]
151
      // }
152
      // var params = new FormData()
153
      // params.append(
154
      //   'data',
155
      //   JSON.stringify({
156
      //     pageNum: this.table.pager.currentPage,
157
      //     pageSize: this.table.pager.size,
158
      //     queryStartDate: start,
159
      //     queryEndDate: end
160
      //   })
161
      // )
162
      // this.$test
163
      //   .post(services.trackAnalysis.GET_TRACKANALYSIS, params)
164
      //   .then((res) => {
165
      //   // 请求成功处理...
166
      //     this.table.data = res.data.result.list
167
      //     this.table.pager.total = res.data.result.total
168
      //   })
169
      //   .catch((res) => {
170
      //   // 请求失败处理...
171
      //   })
100 172
    },
101 173
    onChange(value) {
102 174
      console.log('date change:' + value)