新增:日历

master
masong 2 years ago
parent 679a39c393
commit 5a1b485cdd
  1. 8
      api/word/electronicPatrol.js
  2. 43
      subPackWork/electronicPatrol/electronicPatrol.vue
  3. 1
      subPackWork/electronicPatrol/taskDetails.vue

@ -42,4 +42,12 @@ export function getPatrollingTrajectory(query){
method: 'get',
params: query
})
}
// 月度存在打卡时间
export function getDateWithData(date){
return request({
url: '/electronicPatrol/getDateWithData/'+date,
method: 'get'
})
}

@ -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()
}
})
}
}
};

@ -135,6 +135,7 @@ export default {
title:"打卡成功",
icon: null
})
this.getPatrollingTaskDetail();
}
})

Loading…
Cancel
Save