Bladeren bron

考勤联调修改

chenxr3 4 jaren geleden
bovenliggende
commit
bb26e85731
1 gewijzigde bestanden met toevoegingen van 33 en 10 verwijderingen
  1. 33 10
      ebc-middle-platform/src/modules/attendance/attendance.vue

+ 33 - 10
ebc-middle-platform/src/modules/attendance/attendance.vue

@ -168,6 +168,7 @@ export default {
168 168
      // }
169 169
      this.queryCondition.singleDateVal = this.getTime(2)
170 170
      this.queryCondition.dateType = !(index === 2)
171
      this.table.pager.currentPage = 1
171 172
      this.getList()
172 173
    },
173 174
    onChangeDate(value) {
@ -266,9 +267,9 @@ export default {
266 267
      }
267 268
      this.modalData.date = this.getBeforeDate(6, data) + ' ~ ' + data
268 269
      var beginDay = this.getBeforeDate(6, data)
269
      this.modalData.userName = row.userName
270
      this.modalData.duty = row.duty
271
      this.modalData.days = row.gateDays
270
      this.modalData.userName = row.name
271
      this.modalData.duty = row.mainJobPositionId
272
      this.modalData.days = row.clockingDays
272 273
      this.$test
273 274
        .post(services.areaInOutRecord.GET_ATTENDANCE_DETAILE, {
274 275
          data:{
@ -282,7 +283,12 @@ export default {
282 283
        })
283 284
        .then((res) => {
284 285
          // 请求成功处理...
285
          this.modalData.table = res.data
286
          var arr = []
287
          res.data.forEach(e => {
288
            if (e.goToWorkTime)
289
              arr.push(e)
290
          })
291
          this.modalData.table = arr
286 292
        })
287 293
        .catch((res) => {
288 294
          // 请求失败处理...
@ -295,24 +301,31 @@ export default {
295 301
      } else {
296 302
        this.monthModalData.date = this.queryCondition.singleDateVal
297 303
      }
298
      this.monthModalData.userName = row.userName
299
      this.monthModalData.duty = row.duty
300
      this.monthModalData.days = row.gateDays
304
      this.monthModalData.userName = row.name
305
      this.monthModalData.duty = row.mainJobPositionId
306
      this.monthModalData.days = row.clockingDays
301 307
      this.monthModalData.EMPLOYEE_ID = row.EMPLOYEE_ID
308
      var lastDay = this.getLastDay(this.queryCondition.singleDateVal+'-01')
309
      debugger
302 310
      this.$test
303 311
        .post(services.areaInOutRecord.GET_ATTENDANCE_DETAILE, {
304 312
          data:{
305 313
            id:row.id+"",
306 314
            mark:'month',
307
            beginDay:this.queryCondition.singleDateVal,
308
            endDay:this.queryCondition.singleDateVal
315
            beginDay:this.queryCondition.singleDateVal + '-01',
316
            endDay:lastDay
309 317
          },
310 318
          pageNumber:0,
311 319
          pageSize:0
312 320
        })
313 321
        .then((res) => {
314 322
          // 请求成功处理...
315
          this.monthModalData.table.data = res.data
323
          var arr = []
324
          res.data.forEach(e => {
325
            if (e.goToWorkTime)
326
              arr.push(e)
327
          })
328
          this.monthModalData.table.data = arr
316 329
          // this.monthModalData.table.pager.total = res.data.total
317 330
        })
318 331
        .catch((res) => {
@ -333,6 +346,16 @@ export default {
333 346
      // )
334 347
335 348
    },
349
    getLastDay(d) {
350
      var now = Date.parse(d)
351
      var seperator1 = "-"
352
      var date=new Date(now)
353
      var new_month = date.getMonth()+1
354
      var new_year = date.getFullYear()
355
      var new_date = new Date(new_year,new_month,1)
356
      var currentdate = new_year + seperator1 + new_month + seperator1 +(new Date(new_date.getTime()-1000*60*60*24)).getDate()
357
      return currentdate
358
    },
336 359
    getTime(type) {
337 360
      var date = new Date()
338 361
      var year = date.getFullYear()