ggooalice 2 years ago
parent
commit
101c22dcc0

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -175,8 +175,8 @@
                                         <el-timeline>
                                             <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
                                                 <el-card shadow="never">
-                                                    <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b><span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
-                                                    
+                                                    <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
+                                                    <!-- <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span> -->
                                                     <span v-if="user.company.packageEngineering == 0">
                                                     <span style="margin-left:15px;color:#DAA520;"  v-if="item2.state == 0">[ 
                                                         <span v-if="item2.isDeptAudit==0">

+ 50 - 16
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

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

+ 30 - 13
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -465,7 +465,6 @@
                 
             },
             onSearch(val){
-                console.log(val);
                 this.auditor.searchList = [];
                 this.auditor.list.forEach(u=>{if (u.name.startsWith(val)) {
                     this.auditor.searchList.push(u);
@@ -496,8 +495,10 @@
                 this.$forceUpdate();
             },
             choseCostId(value,index){
-                this.currentForm.domains[this.clickIndex].basecostId = value.id;
-                this.currentForm.domains[this.clickIndex].basecostName = value.name;
+                if(value){
+                    this.currentForm.domains[this.clickIndex].basecostId = value.id;
+                    this.currentForm.domains[this.clickIndex].basecostName = value.name;
+                }
                 this.currentForm.domains[this.clickIndex].showPickerCostId = false;
                 this.$forceUpdate();
             },
@@ -1007,6 +1008,9 @@
                 return options;
             },
             choseTimePick(value, index) {
+                if(!value){
+                    return
+                }
                 //选中时间
                 if (this.reportTimeType.type == 0) {
                     this.currentForm.domains[this.clickTimeIndex].timeType = value.value;
@@ -1193,7 +1197,7 @@
                                     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,
@@ -1276,8 +1280,10 @@
             },
 
             choseAuditor(value, index) {
-                this.currentForm.domains[this.clickIndex].projectAuditorId = value.auditorId;
-                this.currentForm.domains[this.clickIndex].projectAuditorName = value.auditorName;
+                if(value){
+                    this.currentForm.domains[this.clickIndex].projectAuditorId = value.auditorId;
+                    this.currentForm.domains[this.clickIndex].projectAuditorName = value.auditorName;
+                }
                 this.currentForm.domains[this.clickIndex].showPickerAuditor = false;
                 this.$forceUpdate();
             },
@@ -1337,28 +1343,37 @@
                 this.$forceUpdate();
             },
             choseTask(value, index) {
-                this.currentForm.domains[this.clickIndex].taskId = value.taskId;
-                this.currentForm.domains[this.clickIndex].taskName = value.taskName;
+                if(value){
+                    this.currentForm.domains[this.clickIndex].taskId = value.taskId;
+                    this.currentForm.domains[this.clickIndex].taskName = value.taskName;
+                }
                 this.currentForm.domains[this.clickIndex].showPickerTask = false;
                 this.$forceUpdate();
             },
 
             choseProjects(value, index) {
                 // console.log(value)
-                this.currentForm.domains[this.clickIndex].weiduName = value.name;
-                this.currentForm.domains[this.clickIndex].degreeId = value.id;
+                if(value){
+                    this.currentForm.domains[this.clickIndex].weiduName = value.name;
+                    this.currentForm.domains[this.clickIndex].degreeId = value.id;
+                }
                 this.currentForm.domains[this.clickIndex].showPickDegree = false;
                 this.$forceUpdate();
             },
 
             choseSubProject(value, index) {
-                this.currentForm.domains[this.clickIndex].subProjectId = value.id;
-                this.currentForm.domains[this.clickIndex].subProjectName = value.name;
+                if(value){
+                    this.currentForm.domains[this.clickIndex].subProjectId = value.id;
+                    this.currentForm.domains[this.clickIndex].subProjectName = value.name;
+                }
                 this.currentForm.domains[this.clickIndex].showPickerSubProject = false;
                 this.$forceUpdate();
             },
 
             choseTaskGroup(value, index) {
+                if(!value){
+                    return
+                }
                 this.currentForm.domains[this.clickIndex].groupId = value.id;
                 this.currentForm.domains[this.clickIndex].groupName = value.name;
                 this.currentForm.domains[this.clickIndex].showPickerTaskGroup = false;
@@ -1385,7 +1400,9 @@
                 }
             },
             choseStage(value, index) {
-                this.currentForm.domains[this.clickIndex].stage = value.stagesName;
+                if(value){
+                    this.currentForm.domains[this.clickIndex].stage = value.stagesName;
+                }
                 this.currentForm.domains[this.clickIndex].showPickerStage = false;
                 this.$forceUpdate();
 

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/project/edit.vue

@@ -315,7 +315,7 @@ export default {
                         if(res.code == "ok") {
                             this.$toast.clear();
                             this.$toast.success('删除成功');
-                            this.back();
+                            this.$router.push('/project');
                         } else if(res.code == 'reconfirm'){
                             this.$toast.clear();
                             this.forceDelete(res.msg)

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/test/list.vue

@@ -836,7 +836,7 @@
                                     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,