|
|
|
@ -23,14 +23,14 @@ |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import calendar from '@/components/dark-calendar/dark-calendar.vue'; |
|
|
|
|
import {getPatrollingTaskData} from '@/api/word/electronicPatrol.js'; |
|
|
|
|
import {getPatrollingTaskData,getDateWithData} from '@/api/word/electronicPatrol.js'; |
|
|
|
|
import {formatDate} from '@/pages/work/util/date.js' |
|
|
|
|
export default { |
|
|
|
|
components: { calendar }, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
//有任务的日期 |
|
|
|
|
signeddates: ['2023-6-13', '2023-6-3', '2023-6-23'], |
|
|
|
|
signeddates: [], |
|
|
|
|
jobList: [], |
|
|
|
|
nowTime: '', |
|
|
|
|
patrolDate: '' |
|
|
|
@ -38,18 +38,22 @@ export default { |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.getDateWithData(); |
|
|
|
|
//this.getList(); |
|
|
|
|
let now = new Date(); |
|
|
|
|
this.nowTime = now.getHours() + ':' + now.getMinutes() |
|
|
|
|
this.patrolDate = formatDate(now) |
|
|
|
|
this.getPatrollingTaskData() |
|
|
|
|
this.nowTime = now.getHours() + ':' + now.getMinutes(); |
|
|
|
|
this.patrolDate = formatDate(now); |
|
|
|
|
this.getPatrollingTaskData(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
//打卡 |
|
|
|
|
signIn(val){ |
|
|
|
|
console.log(val) |
|
|
|
|
|
|
|
|
|
if(val.statusDesign == '巡更打卡'){ |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url:'taskDetails?id='+val.id+'&patrolDate='+this.patrolDate |
|
|
|
@ -139,6 +143,33 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getDateWithData(){ |
|
|
|
|
let this_ = this |
|
|
|
|
var date=new Date; |
|
|
|
|
var year=date.getFullYear(); |
|
|
|
|
var month=date.getMonth()+1; |
|
|
|
|
month =(month<10 ? "0"+month:month); |
|
|
|
|
var mydate = (year.toString()+'-'+month.toString()); |
|
|
|
|
getDateWithData(mydate).then(res =>{ |
|
|
|
|
if(res.code == 200){ |
|
|
|
|
// this.signeddates = res.data |
|
|
|
|
let dateData = []; |
|
|
|
|
res.data.forEach(item =>{ |
|
|
|
|
let year = item.substring(0,4) |
|
|
|
|
let month = item.substring(6,7) |
|
|
|
|
let day = item.substring(8,item.length) |
|
|
|
|
let time = year+'-'+month+'-'+day |
|
|
|
|
dateData.push(time) |
|
|
|
|
}) |
|
|
|
|
this.$nextTick(()=>{ |
|
|
|
|
this_.signeddates = dateData |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.$forceUpdate() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|