|
@@ -6,16 +6,20 @@
|
|
|
<div>
|
|
|
<van-field readonly clickable name="datetimePicker" :value="form.createDate" label="时间选择" placeholder="点击选择时间"
|
|
|
@click="showPicker = true" :rules="rules.createDate" />
|
|
|
- <van-cell v-if="user.timeType.syncDingding == 1 || user.timeType.syncCorpwxTime == 1">
|
|
|
+ <van-cell >
|
|
|
<template #default>
|
|
|
<div class="attendanceRecord">
|
|
|
- <span>考勤打卡:</span>
|
|
|
- <span v-if="!report.time">暂无考勤记录</span>
|
|
|
- <span v-else>{{report.time.startTime}}-{{report.time.endTime}}, {{report.time.workHours}}小时</span>
|
|
|
+ <template v-if="user.timeType.syncDingding == 1 || user.timeType.syncCorpwxTime == 1">
|
|
|
+ <span>考勤打卡:</span>
|
|
|
+ <span v-if="!report.time">暂无考勤记录</span>
|
|
|
+ <span v-else>{{report.time.startTime}}-{{report.time.endTime}}, {{report.time.workHours}}h</span>
|
|
|
+ </template>
|
|
|
+ <span style="margin-left:20px">总填报时长:</span>
|
|
|
+ <span>{{totalReportHours}}h</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #right-icon>
|
|
|
- <van-button icon="replay" native-type="button" type="default" size="mini" style="height:0.6rem;padding:0 0.16667rem;" :loading="cardRefLoading" loading-size="0.26667rem" @click.stop.native="cardtimeRefresh(form.createDate)" v-if="user.timeType.syncCorpwxTime==1 && (form.createDate == today || !report.time || report.time.workHours == 0)"></van-button>
|
|
|
+ <van-button icon="replay" native-type="button" type="default" size="mini" style="height:0.6rem;padding:0 0.16667rem;" :loading="cardRefLoading" loading-size="0.26667rem" @click.stop.native="cardtimeRefresh(form.createDate)" v-if="user.timeType.syncCorpwxTime==1 && (form.createDate == today || !report.time || report.time.workHours == 0) && (user.timeType.syncDingding == 1 || user.timeType.syncCorpwxTime == 1)"></van-button>
|
|
|
</template>
|
|
|
</van-cell>
|
|
|
<!-- <div v-if="report.time" class="attendanceRecord">
|
|
@@ -311,7 +315,7 @@
|
|
|
<div class="overTimeClas" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
|
|
|
<van-checkbox :disabled="!item.canEdit" v-model="item.isOvertime" style="width: 4.3rem;">含加班</van-checkbox>
|
|
|
<van-field v-model="item.overtimeHours" type="number" :disabled="!item.canEdit || item.isOvertime==null||item.isOvertime==0 || !item.isOvertime"
|
|
|
- placeholder="请输入加班时长" style="width: 5rem"></van-field>
|
|
|
+ placeholder="请输入加班时长" style="width: 5.2rem"></van-field>
|
|
|
<span :class="item.canEdit ? 'overListTime' : 'overListTime hoveOver'">小时</span>
|
|
|
</div>
|
|
|
<van-tag style="position:absolute;right:10px;" v-if="isCorpWX&&item.canEdit" type="primary" size="large" @click="takePhoto(index)">拍照上传</van-tag>
|
|
@@ -487,8 +491,21 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
|
created() {
|
|
|
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ totalReportHours(){
|
|
|
+ let domains = this.form.domains
|
|
|
+ let hours = 0
|
|
|
+ for(let i in domains){
|
|
|
+ if(domains[i].projectId){
|
|
|
+ hours += parseFloat(domains[i].workingTime)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return hours.toFixed(1)
|
|
|
+ },
|
|
|
+ },
|
|
|
|
|
|
methods: {
|
|
|
+
|
|
|
cardtimeRefresh(workdate){ // 考勤记录刷新
|
|
|
if (!workdate) return;
|
|
|
this.cardRefLoading = true;
|
|
@@ -876,6 +893,9 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
|
return options;
|
|
|
},
|
|
|
choseTimePick(value, index) {
|
|
|
+ if(!value){
|
|
|
+ return
|
|
|
+ }
|
|
|
//选中时间
|
|
|
if (this.reportTimeType.type == 0) {
|
|
|
this.form.domains[this.clickTimeIndex].timeType = value.value;
|
|
@@ -1088,7 +1108,7 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
|
isOvertime: flg,
|
|
|
progress: list[i].progress,
|
|
|
taskList: list[i].taskList,
|
|
|
- taskId: list[i].taskId,
|
|
|
+ taskId: list[i].taskId ? list[i].taskId : null,
|
|
|
taskName:tname,
|
|
|
professionProgress:list[i].professionProgressList,
|
|
|
pics: list[i].pics,
|
|
@@ -1201,8 +1221,10 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
|
},
|
|
|
|
|
|
choseAuditor(value, index) {
|
|
|
- this.form.domains[this.clickIndex].projectAuditorId = value.auditorId;
|
|
|
- this.form.domains[this.clickIndex].projectAuditorName = value.auditorName;
|
|
|
+ if(value){
|
|
|
+ this.form.domains[this.clickIndex].projectAuditorId = value.auditorId;
|
|
|
+ this.form.domains[this.clickIndex].projectAuditorName = value.auditorName;
|
|
|
+ }
|
|
|
this.form.domains[this.clickIndex].showPickerAuditor = false;
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
@@ -1273,8 +1295,10 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
choseTask(value, index) {
|
|
|
- this.form.domains[this.clickIndex].taskId = value.taskId;
|
|
|
- this.form.domains[this.clickIndex].taskName = value.taskName;
|
|
|
+ if(value){
|
|
|
+ this.form.domains[this.clickIndex].taskId = value.taskId;
|
|
|
+ this.form.domains[this.clickIndex].taskName = value.taskName;
|
|
|
+ }
|
|
|
this.form.domains[this.clickIndex].showPickerTask = false;
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
@@ -1290,13 +1314,18 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
|
},
|
|
|
|
|
|
choseSubProject(value, index) {
|
|
|
- this.form.domains[this.clickIndex].subProjectId = value.id;
|
|
|
- this.form.domains[this.clickIndex].subProjectName = value.name;
|
|
|
+ if(value){
|
|
|
+ this.form.domains[this.clickIndex].subProjectId = value.id;
|
|
|
+ this.form.domains[this.clickIndex].subProjectName = value.name;
|
|
|
+ }
|
|
|
this.form.domains[this.clickIndex].showPickerSubProject = false;
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
|
|
|
choseTaskGroup(value, index) {
|
|
|
+ if(!value){
|
|
|
+ return
|
|
|
+ }
|
|
|
this.form.domains[this.clickIndex].groupId = value.id;
|
|
|
this.form.domains[this.clickIndex].groupName = value.name;
|
|
|
this.form.domains[this.clickIndex].showPickerTaskGroup = false;
|
|
@@ -1323,14 +1352,19 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
|
}
|
|
|
},
|
|
|
choseStage(value, index) {
|
|
|
- this.form.domains[this.clickIndex].stage = value.stagesName;
|
|
|
+ if (value) {
|
|
|
+ this.form.domains[this.clickIndex].stage = value.stagesName;
|
|
|
+ }
|
|
|
+
|
|
|
this.form.domains[this.clickIndex].showPickerStage = false;
|
|
|
this.$forceUpdate();
|
|
|
|
|
|
},
|
|
|
choseCostId(value,index){
|
|
|
- this.form.domains[this.clickIndex].basecostId = value.id;
|
|
|
- this.form.domains[this.clickIndex].basecostName = value.name;
|
|
|
+ if(value){
|
|
|
+ this.form.domains[this.clickIndex].basecostId = value.id;
|
|
|
+ this.form.domains[this.clickIndex].basecostName = value.name;
|
|
|
+ }
|
|
|
this.form.domains[this.clickIndex].showPickerCostId = false;
|
|
|
this.$forceUpdate();
|
|
|
},
|