diff --git a/src/router/ebiz/attendance.js b/src/router/ebiz/attendance.js index c47eb678b..cf67b15e1 100644 --- a/src/router/ebiz/attendance.js +++ b/src/router/ebiz/attendance.js @@ -13,7 +13,7 @@ export default [ } }, { - path: '/attendance/Monthly/:obj', + path: '/attendance/Monthly', name: 'Monthly', component: monthly, meta: { diff --git a/src/views/ebiz/attendance/Attendance.vue b/src/views/ebiz/attendance/Attendance.vue index af056d1d4..0ac5361f3 100644 --- a/src/views/ebiz/attendance/Attendance.vue +++ b/src/views/ebiz/attendance/Attendance.vue @@ -121,13 +121,14 @@ export default { }, month(obj) { + localStorage.obj = JSON.stringify(this.obj) this.$jump({ flag: 'h5', extra: { - url: location.origin + `/#/attendance/Monthly/${JSON.stringify(obj)}` + url: location.origin + `/#/attendance/Monthly` }, routerInfo: { - path: `/attendance/Monthly/${JSON.stringify(obj)}` + path: `/attendance/Monthly` } }) }, diff --git a/src/views/ebiz/attendance/Monthly.vue b/src/views/ebiz/attendance/Monthly.vue index f3519f151..b43c9d1b6 100644 --- a/src/views/ebiz/attendance/Monthly.vue +++ b/src/views/ebiz/attendance/Monthly.vue @@ -20,7 +20,7 @@ @touchend="touchend" > - -
+
今日休息
@@ -82,17 +82,20 @@ export default { disable:true, name:'', rest:[], - flag:'', + flagGo:'', + flagOff:'', text:'', + text1:'', goWorkTime:'', offWorkTime:'', } }, created(){ - this.date1=new Date(JSON.parse(this.$route.params.obj).time) - this.time=JSON.parse(this.$route.params.obj).time - this.name=JSON.parse(this.$route.params.obj).name + console.log(JSON.parse(window.localStorage.getItem('obj')).time) + this.date1=new Date(JSON.parse(window.localStorage.getItem('obj')).time) + this.time=JSON.parse(window.localStorage.getItem('obj')).time + this.name=JSON.parse(window.localStorage.getItem('obj')).name this.getMonthDetail1(); this.time=utils.formatDate(this.currentDate, 'yyyy-MM-dd') }, @@ -116,19 +119,23 @@ export default { this.workTimeOff=res.content.workTimeoff, this.count=res.content.count, this.amount=res.content.amount, - this.flag=res.content.flag, + this.flagGo=res.content.flagGo, + this.flagOff=res.content.flagOff, this.goWorkTime=res.content.goWorkTime, this.offWorkTime=res.content.offWorkTime - if(this.flag=='0'){ + if(this.flagGo=='0'|| this.flagOff=='0'){ this.goWorkTime=this.goWorkTime.split(' ')[1] this.offWorkTime=this.offWorkTime.split(' ')[1] this.text='正常' - }else if(this.flag=='1'){ - this.text='缺勤' - }else if(this.flag=='2'){ - this.text='迟到' - }else if(this.flag=='3'){ - this.text='早退' + } + if(this.flagGo=='1'){ + this.text1='缺勤' + } + if(this.flagGo=='2'){ + this.text1='迟到' + } + if(this.flagOff=='3'){ + this.text1='早退' } } }) @@ -147,19 +154,23 @@ export default { this.workTimeOff=res.content.workTimeoff, this.count=res.content.count, this.amount=res.content.amount, - this.flag=res.content.flag, + this.flagGo=res.content.flagGo, + this.flagOff=res.content.flagOff, this.goWorkTime=res.content.goWorkTime, this.offWorkTime=res.content.offWorkTime - if(this.flag=='0'){ - this.goWorkTime=this.goWorkTime.split(' ')[1] + if(this.flagGo=='0'|| this.flagOff=='0'){ + this.goWorkTime=this.goWorkTime.split(' ')[1] this.offWorkTime=this.offWorkTime.split(' ')[1] this.text='正常' - }else if(this.flag=='1'){ - this.text='缺勤' - }else if(this.flag=='2'){ - this.text='迟到' - }else if(this.flag=='3'){ - this.text='早退' + } + if(this.flagGo=='1'){ + this.text1='缺勤' + } + if(this.flagGo=='2'){ + this.text1='迟到' + } + if(this.flagOff=='3'){ + this.text1='早退' } } }) @@ -182,7 +193,7 @@ export default { let workTime=res.content.rest[i].split(' ') let workTime1=workTime[0] if(Date.parse(workTime1)