Browse Source

修复日报填报Bug, 把domain.projectItem换回为projectId

seyason 2 years ago
parent
commit
e39e891431
1 changed files with 23 additions and 16 deletions
  1. 23 16
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

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

@@ -1,5 +1,5 @@
 <template>
-    <section v-loading="zhoLoading">
+    <section >
         <!--列表-->
         <div>
             <el-card class="box-card daily" shadow="never">
@@ -322,11 +322,11 @@
                     
                     <el-form-item :label="user.companyId==781?'工作任务':'投入项目'" :prop="'domains.' + index + '.projectId'"
                         :rules="{ required: true, message: user.companyId==781?'请选择工作任务':'请选择投入项目', trigger: ['change','blur'] }">
-                        <el-select v-model="domain.projectItem" :placeholder="user.companyId==781?'请选择工作任务':'请选择项目'" style="width:200px;" clearable="true"  filterable="true" value-key="id"
+                        <el-select v-model="domain.projectId" :placeholder="user.companyId==781?'请选择工作任务':'请选择项目'" style="width:200px;" clearable="true"  filterable="true" value-key="id"
                         @change="selectProject(domain, index)"
                         :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
                             <!-- <el-option v-for="item in projectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName" :value="item.id"></el-option> -->
-                            <el-option v-for="item in fillProjectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item">
+                            <el-option v-for="item in fillProjectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
                                 <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
                                 <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
                             </el-option>
@@ -430,10 +430,10 @@
                     <div v-if="reportTimeType.multiWorktime==1">
                         <el-form-item label="投入项目" :prop="'domains.' + index + '.projectId'"
                             :rules="{ required: true, message: '请选择投入项目', trigger: ['change','blur'] }">
-                            <el-select v-model="domain.projectItem" placeholder="请选择项目" style="width:200px;" clearable="true"  filterable="true" value-key="id"
+                            <el-select v-model="domain.projectId" placeholder="请选择项目" style="width:200px;" clearable="true"  filterable="true" value-key="id"
                             @change="selectProject(domain, index)"
                             :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
-                                <el-option v-for="item in fillProjectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item">
+                                <el-option v-for="item in fillProjectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
                                     <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
                                     <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
                                 </el-option>
@@ -699,7 +699,7 @@
                             <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
                     </el-select>
                 </div>
-                <div class="zhoFel" v-if="zhoBao.auditUserList != null && zhoBao.auditUserList.length > 0">
+                <div class="zhoFel" >
                     <p>审核人</p>
                     <el-select v-model="zhoBao.projectAuditorId" placeholder="请选择" clearable="true" style="width: 355px">
                         <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
@@ -2606,10 +2606,11 @@
             },
             //项目选中了, 加载子项目
             selectProject(domain, index) {
-                if(domain.projectItem){
-                    domain.projectId = domain.projectItem.id
-                    domain.projectName = domain.projectItem.projectName
+                if(!domain.projectId){
+                    return;
                 }
+                console.log('projectId===',domain.projectId);
+                domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
                 this.http.post('/sub-project/list',{
                     projectId: domain.projectId
                 },
@@ -2690,7 +2691,12 @@
                 res => {
                     if (res.code == "ok") {
                         domainItem.auditUserList = res.data;
-                        if (res.data.length==1) {
+                        if (res.data.length==0) {
+                            this.$message({
+                                message: '日报审核人尚未设置,请联系该项目管理人员',
+                                type: "error"
+                            });
+                        } else if (res.data.length==1) {
                             domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
                             domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
                         }
@@ -3930,7 +3936,7 @@
                 this.zhoRqi = [stat, end]
                 console.log('date',currentDate,this.zhoRqi);
                 this.zhoRqis()
-                this.jiazai()
+                // this.jiazai()
             },
             // 获取上周
             handleGetPrevWeek() {
@@ -3962,7 +3968,7 @@
                 var end = this.dateChange(-2, ends)
                 this.zhoRqi = [stat, end]
                 this.zhoRqis()
-                this.jiazai()
+                // this.jiazai()
             },
             // 获取下周
             handleGetNextvWeek() {
@@ -3998,7 +4004,7 @@
                 var end = this.dateChange(-2, ends)
                 this.zhoRqi = [stat, end]
                 this.zhoRqis()
-                this.jiazai()
+                // this.jiazai()
             },
             // 新增日期
             newDates() {
@@ -4073,7 +4079,7 @@
             // 按周填报
             fillInReportss() {
                 window.addEventListener('scroll', this.handleScroll, true)
-                this.jiazai()
+                // this.jiazai()
                 this.diasZho = true
                 this.getCurrentWeek()
                 // 项目数量判断 <=5
@@ -4472,10 +4478,11 @@
                     }
                     
                     // 自定义维度
-
+                    this.submitingReport = true;
                     this.http.uploadFile( this.port.report.editPort, formData,
                         res => {
                             // this.listLoading = false;
+                            this.submitingReport = false;
                             if (res.code == "ok") {
                                 this.$message({
                                     message: "填报成功",
@@ -4498,7 +4505,7 @@
                             }
                         },
                         error => {
-                            this.listLoading = false;
+                            this.submitingReport = false;
                             this.$message({
                                 message: error,
                                 type: "error"