Commit 1c6022fc authored by Gakki's avatar Gakki

主项目日期跳转

parent d9959f68
......@@ -428,6 +428,10 @@ export default {
})
},
created() {
let _this = this
window.clickDate=_this.clickDate
},
computed: {
validRange(){ //限制日历只展示当前月的日期
let year = this.$moment(new Date()).format('YYYY')
......@@ -453,7 +457,6 @@ export default {
methods: {
//日历组件
myCanlendar(){
let dateArr = [...this.$moment(new Date()).format('YYYY-MM-DD').split('-')]
// console.log('获取当前日期:'dateArr)
......@@ -493,8 +496,7 @@ export default {
}
tab+= '<td style="border-radius:20%;text-align:center;border:4px solid #fff;background:'+color+'">'+i+'</td>'
tab+= '<td onclick=clickDate('+ i +') style="border-radius:20%;text-align:center;border:4px solid #fff; cursor: pointer; background:'+color+'">'+i+'</td>'
if((i-(8-firstDay))%7==0){
tab+='</tr><tr>'
}
......@@ -515,6 +517,25 @@ export default {
tab += '</tr>'
this.$refs.calendar.innerHTML = tab
},
clickDate(i) {
let date = ''
let month= ''
if(i > 10) {
date = i.toString()
} else {
date = '0' + i
}
month = new Date().getMonth() < 10 ? '0' + (new Date().getMonth()+1) + '-' + date : (new Date().getMonth()+1) + '-' + date
let finalDate = (new Date().getFullYear() + '-' + month)
this.$router.push({
'path': '/documents/fiveSearch/managerSelfCheckList',
query: {
month: finalDate + ',' + finalDate
// month: time+'-'+parseInt(item.name) > 10 ? parseInt(item.name): '0' + parseInt(item.name)
}
})
},
/**
* 获取dashboard数据
*/
......@@ -801,13 +822,13 @@ export default {
break
}
let parseDateInfo = (parseInt(item.name) > 10 ? time+'-' + parseInt(item.name) + '-01,' + time+'-' + parseInt(item.name) + '-31': time+'-' + '0' + parseInt(item.name) + '-01,' + time+'-' + '0' + parseInt(item.name) + '-31')
// this.$router.push({
// 'path': '/documents/fiveSearch/managerSelfCheckList',
// query: {
// month: parseDateInfo
// // month: time+'-'+parseInt(item.name) > 10 ? parseInt(item.name): '0' + parseInt(item.name)
// }
// })
this.$router.push({
'path': '/documents/fiveSearch/managerSelfCheckList',
query: {
month: parseDateInfo
// month: time+'-'+parseInt(item.name) > 10 ? parseInt(item.name): '0' + parseInt(item.name)
}
})
},
/**
* 获取房办月查统计
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment