Jelajahi Sumber

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

Min 1 tahun lalu
induk
melakukan
553c6e482d

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

@@ -103,12 +103,18 @@
           <el-option label="查看部门审核人" :value="0"></el-option>
         </el-select> -->
         <!-- 项目筛选 -->
-        <el-select v-if="ins != 4 && ins != 8 && ins != 9 && ins != 19 && ins != 10 && ins != 11 && ins != 14 && ins != 15 && ins != 17 && ins != 20 && ins != 21 && ins != 22" v-model="proJuctId" :placeholder="$t('defaultText.pleaseSelectSnItem')" clearable filterable size="small" @change="selcts()" style="margin-left:10px">
+        <el-select v-if="ins != 4 && ins != 8 && ins != 9 && ins != 19 && ins != 10 && ins != 11 && ins != 14 && ins != 15 && ins != 17 && ins != 20 && ins != 21 && ins != 22" v-model="proJuctId" :placeholder="$t('defaultText.pleaseSelectSnItem')" clearable filterable size="small" @change="projectChange()" style="margin-left:10px">
           <el-option v-for="(item) in proListOvertime" :key="item.id" :label="item.projectName + (item.projectCode ? item.projectCode : '')" :value="item.id">
             <span style="float: left;color: #8492a6;">{{ item.projectCode }}</span>
             <span style="float: right;font-size: 13px;margin-left: 20px">{{ item.projectName }}</span>
           </el-option>
         </el-select>
+
+        <!-- 任务分组 -->
+        <el-select v-if="ins == 1 && user.companyId == '3092'" v-model="projectGroupId" :placeholder="'请选择任务分组'" clearable filterable size="small" @change="getList(true)" style="margin-left:10px">
+          <el-option v-for="(item) in projectTaskgroupList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+        </el-select>
+
         <el-select v-if="ins==12 && user.companyId==936" v-model="projectCategorySubId" :placeholder="'请选择自主项目类别'" clearable filterable size="small" @change="selcts()" style="margin-left:10px">
           <el-option v-for="(item) in projectCategorySubList" :key="item.value" :label="item.label" :value="item.value"></el-option>
         </el-select>
@@ -278,6 +284,18 @@
                         {{scope.row.end_date}}
                     </template>
                 </el-table-column>
+                <span v-if="user.companyId == '3092'">
+                  <el-table-column prop="group_plan_hours" :label="'分组预估工时(h)'"  width="150">
+                      <template slot-scope="scope">
+                          {{scope.row.group_plan_hours}}
+                      </template>
+                  </el-table-column>
+                  <el-table-column prop="group_real_hours" :label="'分组实际工时(h)'"  width="150">
+                      <template slot-scope="scope">
+                          {{scope.row.group_real_hours}}
+                      </template>
+                  </el-table-column>
+                </span>
             </el-table>
 
             <!--项目成本报表 -->
@@ -1320,8 +1338,10 @@ export default {
       list1:[],
       listArr1:[],
       listArr2:[],
+      listArr3:[],
       listPosition1:0,
       listPosition2:0,
+      listPosition3:0,
       windowHeight: document.documentElement.clientHeight,
       windowWidth: document.documentElement.clientWidth,
 
@@ -1467,6 +1487,9 @@ export default {
       projectSortId: '', // 项目分类选中的id
       projectSortName: '', // 项目分类选中的Name
       projectSortList: [], // 项目分类
+
+      projectTaskgroupList: [], // 选择项目的任务分组
+      projectGroupId: '', // 选择项目的任务分组id
     };
   },
   computed: {},
@@ -1587,6 +1610,7 @@ export default {
       })
     },
     objectSpanMethod({ row, column, rowIndex, columnIndex }){
+      const { companyId } = this.user
       if(columnIndex == 0){
         const _row = this.listArr1[rowIndex]
         const _col = _row > 0 ? 1 : 0
@@ -1603,6 +1627,14 @@ export default {
           colspan: _col
         }
       }
+      if(columnIndex == 2 && companyId == '3092') {
+        const _row = this.listArr3[rowIndex]
+        const _col = _row > 0 ? 1 : 0
+        return {
+          rowspan: _row,
+          colspan: _col
+        }
+      }
     },
 
     getCustomName(){
@@ -2517,6 +2549,7 @@ export default {
     },
     getProjectTask() {
       this.listLoading = true;
+      const { companyId } = this.user
       let ginseng = {
         pageIndex: this.page,
         pageSize: this.size,
@@ -2525,9 +2558,13 @@ export default {
       if(this.taskTypeId != 'null' && this.taskTypeId != null && this.taskTypeId != '') {
         ginseng.taskType = this.taskTypeId
       }
+      if(companyId == '3092') {
+        ginseng.groupId = this.projectGroupId
+      }
       this.http.post('/project/getProjectTask', ginseng,
         res => {
             if (res.code == "ok") {
+              const { companyId } = this.user
               for(var i in res.data.records) {
                 if(i > 0 && (res.data.records[i].project_code == res.data.records[i - 1].project_code)) {
                   res.data.records[i].customCode = '——'
@@ -2548,10 +2585,15 @@ export default {
                 this.list1 = res.data.records;
                 this.listArr1 = []
                 this.listArr2 = []
+                this.listArr3 = []
                 this.listPosition1 = 0
                 this.listPosition2 = 0
+                this.listPosition3 = 0
                 this.rowspan(this.listArr1,this.listPosition1,'project_code')
                 this.rowspan(this.listArr2,this.listPosition2,'project_name')
+                if(companyId == 3092) {
+                  this.rowspan(this.listArr3,this.listPosition3,'groupId')
+                }
                 this.total = res.data.total;
                 this.listLoading = false; 
             } else {
@@ -3127,6 +3169,15 @@ export default {
         _this.gettime = [time1 , time2];
         return  _this.gettime
     },
+    projectChange() {
+      const { companyId } = this.user
+      if(this.ins == 1 && companyId == '3092') {
+        this.projectTaskgroupList == []
+        this.projectGroupId = ''
+        this.getProjectTaskgroupList()
+      }
+      this.selcts()
+    },
     selcts(e) {
       this.page = 1
       if(this.ins == 12){
@@ -3393,7 +3444,14 @@ export default {
       this.projectSortList = dataList
       this.projectSortId = dataList[0].id
       this.projectSortName = dataList[0].name
-    }
+    },
+    // 获取任务分组
+    async getProjectTaskgroupList() {
+      let { data } = await this.postData('/task-group/list', {
+        projectId: this.proJuctId
+      })
+      this.projectTaskgroupList = data
+    },
   },
 };
 </script>