Browse Source

2022.8.2 任务分组报表调整

ggooalice 2 years ago
parent
commit
b54bec85d2

+ 49 - 49
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -347,23 +347,24 @@
             </el-table>
 
             <!-- 任务分组工时表 -->
-            <el-table v-if="ins == 12" border :data="groupWorktimeList" key="12"
-            highlight-current-row v-loading="listLoading" :height="tableHeight" 
-             style="width: 100%;" ref="table">
-                <el-table-column label="按任务分组统计" header-align="center">
-                  <el-table-column prop="leftgroupName" label="分组名称" min-width="100"></el-table-column>
-                  <el-table-column prop="leftworkingTime" label="工时(h)" min-width="50" align="right" header-align="center">
+            <el-table v-if="ins == 12" border :data="groupWorktimeList.left" key="12_2" highlight-current-row :height="tableHeight" v-loading="groupListLoading" style="width:33%;float:left;">
+              <el-table-column label="按任务分组统计" header-align="center">
+                  <el-table-column prop="groupName" label="分组名称" min-width="100"></el-table-column>
+                  <el-table-column prop="workingTime" label="工时(h)" min-width="50" align="right" header-align="center">
                     <template slot-scope="scope">
                       <span style="margin-right:20px">{{scope.row.leftworkingTime ? scope.row.leftworkingTime.toFixed(1) + '(h)' : ''}}</span>
                     </template>
                   </el-table-column>
                 </el-table-column>
-                <el-table-column width="2" class-name="dividingLine" label-class-name="dividingLine"></el-table-column>
+            </el-table>
+            <el-table v-if="ins == 12" border :data="groupWorktimeList.right" key="12"
+            highlight-current-row v-loading="listLoading" :height="tableHeight" 
+             style="width: 66%;float:right;" ref="table">
                 <el-table-column label="按项目统计" header-align="center">
-                  <el-table-column prop="rightprojectCode" label="项目编号" min-width="75"></el-table-column>
-                  <el-table-column prop="rightprojectName" label="项目名称" min-width="125"></el-table-column>
-                  <el-table-column prop="rightgroupName" label="分组名称" min-width="100"></el-table-column>
-                  <el-table-column prop="rightworkingTime" label="工时(h)" min-width="50" align="right" header-align="center">
+                  <el-table-column prop="projectCode" label="项目编号" min-width="75"></el-table-column>
+                  <el-table-column prop="projectName" label="项目名称" min-width="125"></el-table-column>
+                  <el-table-column prop="groupName" label="分组名称" min-width="100"></el-table-column>
+                  <el-table-column prop="workingTime" label="工时(h)" min-width="50" align="right" header-align="center">
                     <template slot-scope="scope">
                       <span style="margin-right:20px">{{scope.row.rightworkingTime ? scope.row.rightworkingTime.toFixed(1) + '(h)' : ''}}</span>
                     </template>
@@ -371,6 +372,7 @@
                 </el-table-column>
             </el-table>
             
+            
 
             <!-- 项目加班情况统计报表 -->
             <div v-if="ins == 6 || ins == 8">
@@ -517,11 +519,11 @@
         <el-col :span="24" class="toolbar" v-if="ins != 6">
           <el-pagination
                 v-if="ins == 12"
-                @size-change="handleSizeChange"
+                @size-change="groupSizeChange"
                 @current-change="groupPageChange"
                 :current-page="groupPage"
                 :page-sizes="[20 , 50 , 80 , 100]"
-                :page-size="size"
+                :page-size="groupSize"
                 layout="total, sizes, prev, pager, next"
                 :total="groupTotal"
                 style="float:left;"
@@ -741,8 +743,13 @@ export default {
       defaultActive: '1-1',
 
       personnelList: [], //'人员工时统计表'
-      groupWorktimeList: [], //任务分组工时表
+      groupWorktimeList: {
+        left: [],
+        right: []
+      }, //任务分组工时表
+      groupListLoading: false,
       groupPage: 1,
+      groupSize: 20,
       groupTotal: 0
     };
   },
@@ -966,7 +973,12 @@ export default {
             //分页
             handleCurrentChange(val) {
                 this.page = val;
-                this.getList();
+                if(this.ins == 12){
+                  this.groupWorktimeList.right = []
+                  this.getGroupWorktimeList()
+                }else{
+                  this.getList();
+                }
             },
 
             handleSizeChange(val) {
@@ -974,13 +986,21 @@ export default {
                 this.page = 1
                 if(this.ins == 12){
                   this.groupPage = 1
-
+                  this.groupWorktimeList.right = []
+                  this.getGroupWorktimeList()
+                }else{
+                  this.getList();
                 }
-                this.getList();
-                
+            },
+            groupSizeChange(val){
+              this.groupSize = val
+              this.groupPage = 1
+              this.groupWorktimeList.left = []
+              this.getGroupWorktimeAll()
             },
             groupPageChange(val){
                 this.groupPage = val;
+                this.groupWorktimeList.left = []
                 this.getGroupWorktimeAll()
             },
             getList() {
@@ -1011,17 +1031,8 @@ export default {
                 } else if(this.ins == 11) {
                     this.getPersonnelList()
                 }else if(this.ins == 12){
-                  this.groupWorktimeList = []
-                  for(let i=0; i<this.size; i++){
-                    this.groupWorktimeList.push({
-                      leftgroupName:null,
-                      leftworkingTime:null,
-                      rightgroupName:null,
-                      rightworkingTime:null,
-                      rightprojectCode:null,
-                      rightprojectName:null
-                    })
-                  }
+                  this.groupWorktimeList.left = []
+                  this.groupWorktimeList.right = []
                     this.getGroupWorktimeList()
                     this.getGroupWorktimeAll()
                 }
@@ -1140,7 +1151,6 @@ export default {
       this.reportTimelyList = []
       this.auditRateList = []
       this.departmentIdArray = []
-      this.groupWorktimeList = []
       this.userId = null
       this.selUserList = this.userList
       this.getList();
@@ -1514,13 +1524,8 @@ export default {
           this.listLoading = false
           if(res.code == 'ok'){
             this.total = res.data.total
-            let list = res.data.records
-            for(let i=0; i<this.size; i++){
-              this.groupWorktimeList[i].rightgroupName = list[i] ? list[i].groupName : null
-              this.groupWorktimeList[i].rightworkingTime = list[i] ? list[i].workingTime : null
-              this.groupWorktimeList[i].rightprojectCode = list[i] ? list[i].projectCode : null
-              this.groupWorktimeList[i].rightprojectName = list[i] ? list[i].projectName : null
-            }
+            this.groupWorktimeList.right = res.data.records
+            
           }else {
             this.$message({
               message: res.msg,
@@ -1542,15 +1547,14 @@ export default {
         pageIndex: this.groupPage,
         pageSize: this.size
       }
+      this.groupListLoading = true
       this.http.post('/project/getTimeCostByGroup',parameter,
         res => {
+          this.groupListLoading = false
           if(res.code == 'ok'){
-            let list = res.data.records
               this.groupTotal = res.data.total
-              for(let i=0; i<this.size; i++){
-                this.groupWorktimeList[i].leftgroupName = list[i] ? list[i].groupName : null
-                this.groupWorktimeList[i].leftworkingTime = list[i] ? list[i].workingTime : null
-              }
+              this.groupWorktimeList.left = res.data.records
+              
           }else {
             this.$message({
               message: res.msg,
@@ -1558,6 +1562,7 @@ export default {
             })
           }
         },err => {
+          this.groupListLoading = false
           this.$message({
             message: err,
             type: 'error'
@@ -1734,8 +1739,7 @@ export default {
       }
       if(this.ins == 12){
         this.proJuctId = ''
-        this.getGroupWorktimeList()
-        this.getGroupWorktimeAll()
+        this.getList()
       }
     },
     // 日期
@@ -1751,6 +1755,7 @@ export default {
     },
     selcts(e) {
       if(this.ins == 12){
+        this.groupWorktimeList.right = []
         this.getGroupWorktimeList()
       }else{
       if(e == 9){
@@ -1806,11 +1811,6 @@ export default {
   },
 };
 </script>
-<style>
-.dividingLine{
-  background-color: #999 !important;
-}
-</style>
 <style scoped>
 .headConCon {
   position: fixed;

+ 4 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -3212,19 +3212,17 @@ a {
 
                         // 判断公司id是否等于 936
                         if(this.user.companyId == '936') {
-                             formData.append("contractCode", this.addForm.contractCode);
+                             formData.append("contractCode", this.addForm.contractCode ? this.addForm.contractCode : '');
                              formData.append("warrantyStartDate", this.addForm.warrantyStartDate ? this.addForm.warrantyStartDate : '');
                              formData.append("warrantyEndDate", this.addForm.warrantyEndDate ? this.addForm.warrantyEndDate : '');
-                             formData.append("projectCategorySub", this.addForm.projectCategorySub);
-                             formData.append("region", this.addForm.region);
-                             formData.append("bu", this.addForm.bu);
+                             formData.append("projectCategorySub", this.addForm.projectCategorySub ? this.addForm.projectCategorySub : '');
+                             formData.append("region", this.addForm.region ? this.addForm.region : '');
+                             formData.append("bu", this.addForm.bu ? this.addForm.bu : '');
                         }
 
                         // formData.append("associateDegreeNames", listName)
                         // console.log("addform",this.addForm);
                         // return
-                        
-                        console.log(this.addForm,'can can need');
                         this.http.uploadFile(this.port.project.add,formData,
                         res => {
                             this.addLoading = false;

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

@@ -3551,10 +3551,10 @@
                 this.listLoading = true;
                 let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
                 let param = {date: this.date + day};
-                if (this.deptId != null) {
+                if (this.deptId) {
                     param.deptId = this.deptId;
                 }
-                if (this.targetUid != null) {
+                if (this.targetUid) {
                     param.userId = this.targetUid;
                 }
                 this.http.post( this.port.report.list, param,