瀏覽代碼

调整任务报表的赛选条件,增加人员工时统计表,

Lijy 2 年之前
父節點
當前提交
93a3101996

+ 4 - 0
fhKeeper/formulahousekeeper/timesheet/src/permissions.js

@@ -58,6 +58,8 @@ const StringUtil = {
         reportAllTimely: false, // 全公司填报及时率 //
         reportAllTimely: false, // 全公司填报及时率 //
         reportTimely: false, // 负责部门填报及时率 //
         reportTimely: false, // 负责部门填报及时率 //
         reportAuditRate: false, // 查看日报待审核统计 // 
         reportAuditRate: false, // 查看日报待审核统计 // 
+        reportPersonnel: false, // 全公司工时统计 //
+        reportResponsible: false, // 负责部门工时统计 //
 
 
         // 请假模块
         // 请假模块
         leaveFil : false, // 请假填报 // 
         leaveFil : false, // 请假填报 // 
@@ -158,6 +160,8 @@ const StringUtil = {
         arr[i] == '项目报表' ? obj.reportProject = true : ''
         arr[i] == '项目报表' ? obj.reportProject = true : ''
         arr[i] == '批量填报' ? obj.reportBatch = true : ''
         arr[i] == '批量填报' ? obj.reportBatch = true : ''
         arr[i] == '项目阶段管理' ? obj.projectPhase = true : ''
         arr[i] == '项目阶段管理' ? obj.projectPhase = true : ''
+        arr[i] == '全公司工时统计' ? obj.reportPersonnel = true : ''
+        arr[i] == '负责部门工时统计' ? obj.reportResponsible = true : ''
     }
     }
 
 
     return obj
     return obj

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

@@ -31,6 +31,8 @@
 
 
                   <el-menu-item index="1-10" v-if="permissions.reportAllTimely || permissions.reportTimely"><p @click="ssl(9)">员工填报及时率</p></el-menu-item>
                   <el-menu-item index="1-10" v-if="permissions.reportAllTimely || permissions.reportTimely"><p @click="ssl(9)">员工填报及时率</p></el-menu-item>
                   <el-menu-item index="1-11" v-if="permissions.reportAuditRate"><p @click="ssl(10)">日报待审核统计</p></el-menu-item>
                   <el-menu-item index="1-11" v-if="permissions.reportAuditRate"><p @click="ssl(10)">日报待审核统计</p></el-menu-item>
+                  <el-menu-item index="1-12" v-if="permissions.reportPersonnel || permissions.reportResponsible"><p @click="ssl(11)">人员工时统计表</p></el-menu-item>
+                  <!-- <el-menu-item index="1-12"><p @click="ssl(11)">人员工时统计表</p></el-menu-item> -->
                 </el-submenu>
                 </el-submenu>
               </el-menu>
               </el-menu>
           </el-col>
           </el-col>
@@ -63,7 +65,7 @@
           </el-select>
           </el-select>
         </template>
         </template>
         <!-- 时间段筛选 -->
         <!-- 时间段筛选 -->
-          <template v-if="ins == 6 || ins == 8 || ins == 9 || ins == 10">
+          <template v-if="ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11">
             <span class="demonstration" style="color:#999;padding:0 10px">时间段</span>
             <span class="demonstration" style="color:#999;padding:0 10px">时间段</span>
             <el-date-picker v-model="rangeDatas" type="daterange" value-format="yyyy-MM-dd" placeholder="选择开始日期" @change="picks()" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width:300px" :clearable="false" size="small"> </el-date-picker>
             <el-date-picker v-model="rangeDatas" type="daterange" value-format="yyyy-MM-dd" placeholder="选择开始日期" @change="picks()" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width:300px" :clearable="false" size="small"> </el-date-picker>
           </template>
           </template>
@@ -74,7 +76,7 @@
           <el-option label="查看部门审核人" :value="0"></el-option>
           <el-option label="查看部门审核人" :value="0"></el-option>
         </el-select> -->
         </el-select> -->
         <!-- 项目筛选 -->
         <!-- 项目筛选 -->
-        <el-select v-if="ins != 4 && ins != 8 && ins != 9 && ins != 10" v-model="proJuctId" placeholder="请选择项目" clearable filterable size="small" @change="selcts()" style="margin-left:10px">
+        <el-select v-if="ins != 4 && ins != 8 && ins != 9 && ins != 10 && ins != 11" v-model="proJuctId" placeholder="请选择项目" clearable filterable size="small" @change="selcts()" style="margin-left:10px">
           <el-option v-for="(item) in proListOvertime" :key="item.id" :label="item.projectName + (item.projectCode ? item.projectCode : '')" :value="item.id">
           <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: left;color: #8492a6;">{{ item.projectCode }}</span>
             <span style="float: right;font-size: 13px;margin-left: 20px">{{ item.projectName }}</span>
             <span style="float: right;font-size: 13px;margin-left: 20px">{{ item.projectName }}</span>
@@ -82,13 +84,19 @@
         </el-select>
         </el-select>
           
           
           <!-- 部门筛选 -->
           <!-- 部门筛选 -->
-          <el-cascader v-if="(ins == 9 && permissions.reportAllTimely) || (ins == 8 && permissions.reportAllTimeDivide) || (ins == 6 && permissions.reportAllOvertime)" v-model="departmentIdArray" :options="departmentList" placeholder="请选择部门"
+          <el-cascader v-if="(ins == 9 && (permissions.reportAllTimely || permissions.reportTimely)) || (ins == 8 && (permissions.reportAllTimeDivide || permissions.reportTimeDivide)) || (ins == 6 && (permissions.reportAllOvertime || permissions.reportOvertime)) || (ins == 11 && (permissions.reportPersonnel || permissions.reportResponsible))" v-model="departmentIdArray" :options="departmentList" placeholder="请选择部门"
             :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
             :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
             @change="selcts(9)" size="small" style="margin-left:10px"
             @change="selcts(9)" size="small" style="margin-left:10px"
           ></el-cascader>
           ></el-cascader>
 
 
+          <!-- 任务筛选 -->
+          <el-select v-if="ins == 1" v-model="taskTypeId" placeholder="请选择类型" clearable filterable size="small" @change="selcts()" style="margin-left:10px">
+            <el-option v-for="(item) in taskTypeObj" :key="item.id" :label="item.value" :value="item.id">
+            </el-option>
+          </el-select>
+
           <!-- 人员筛选 -->
           <!-- 人员筛选 -->
-          <el-select v-if="ins == 6 || ins == 8 || ins == 9 || ins == 10" v-model="userId" placeholder="请选择人员" @change="selcts()" clearable filterable size="small" style="margin-left:10px;width:150px">
+          <el-select v-if="ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11" v-model="userId" placeholder="请选择人员" @change="selcts()" clearable filterable size="small" style="margin-left:10px;width:150px">
             <el-option v-for="(item, index) in selUserList" :key="index" :label="item.name" :value="item.id"></el-option>
             <el-option v-for="(item, index) in selUserList" :key="index" :label="item.name" :value="item.id"></el-option>
           </el-select>
           </el-select>
       </div>
       </div>
@@ -456,6 +464,27 @@
                 <el-table-column prop="departmentName" label="所属部门" min-width="200" align="center"></el-table-column>
                 <el-table-column prop="departmentName" label="所属部门" min-width="200" align="center"></el-table-column>
                 <el-table-column prop="num" label="待审核条数" min-width="200" align="center"></el-table-column>
                 <el-table-column prop="num" label="待审核条数" min-width="200" align="center"></el-table-column>
             </el-table>
             </el-table>
+
+            <!-- 人员工时统计表 -->
+            <el-table v-if="ins == 11" key="11" border :data="personnelList" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
+                <el-table-column prop="name" label="姓名" min-width="200" align="center"></el-table-column>
+                <el-table-column prop="departmentName" label="部门" min-width="200" align="center"></el-table-column>
+                <el-table-column prop="planHours" label="计划工时" min-width="200" align="center">
+                  <template slot-scope="scope">
+                    <div v-if="scope.row.planHours">
+                      {{scope.row.planHours}}h
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="workingTime" label="实际工时" min-width="200" align="center">
+                  <template slot-scope="scope">
+                    <div v-if="scope.row.workingTime">
+                      {{scope.row.workingTime}}h
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="proportion" label="实际占比" min-width="200" align="center"></el-table-column>
+            </el-table>
             
             
 
 
         <!--工具条-->
         <!--工具条-->
@@ -609,6 +638,8 @@ export default {
       title:'',
       title:'',
       childrenList:[],
       childrenList:[],
       taskTypeTxt:["任务", "里程碑", "风险"],
       taskTypeTxt:["任务", "里程碑", "风险"],
+      taskTypeObj: [{id: '0',value: '任务'},{id: '1',value: '里程碑'},{id: '2',value: '风险'}],
+      taskTypeId: null,
       taskStatusTxt:["进行中","已完成","已撤销"],
       taskStatusTxt:["进行中","已完成","已撤销"],
       statusTxt:["-","进行中","已完成","已撤销"],
       statusTxt:["-","进行中","已完成","已撤销"],
       importanceList:[{id:1,label:'正常'},{id:2,label:'紧急'},{id:3,label:'重要'},{id:4,label:'重要且紧急'}],
       importanceList:[{id:1,label:'正常'},{id:2,label:'紧急'},{id:3,label:'重要'},{id:4,label:'重要且紧急'}],
@@ -670,7 +701,9 @@ export default {
       departmentOrProject: 1,
       departmentOrProject: 1,
 
 
       allWrong: true,
       allWrong: true,
-      defaultActive: '1-1'
+      defaultActive: '1-1',
+
+      personnelList: [], //'人员工时统计表'
     };
     };
   },
   },
   computed: {},
   computed: {},
@@ -725,14 +758,15 @@ export default {
       if(this.permissions.reportProject) {this.ssl(0);this.defaultActive = '1-1';return} else
       if(this.permissions.reportProject) {this.ssl(0);this.defaultActive = '1-1';return} else
       if(this.permissions.reportTask) {this.ssl(1);this.defaultActive = '1-2';return} else
       if(this.permissions.reportTask) {this.ssl(1);this.defaultActive = '1-2';return} else
       if(this.permissions.reportCostOf) {this.ssl(2);this.defaultActive = '1-3';return} else
       if(this.permissions.reportCostOf) {this.ssl(2);this.defaultActive = '1-3';return} else
-      if(this.permissions.reportTimeDivide) {this.ssl(8);this.defaultActive = '1-9';return} else
+      if(this.permissions.reportTimeDivide || this.permissions.reportAllTimeDivide) {this.ssl(8);this.defaultActive = '1-9';return} else
       if(this.permissions.reportCostWarning) {this.ssl(7);this.defaultActive = '1-4';return} else
       if(this.permissions.reportCostWarning) {this.ssl(7);this.defaultActive = '1-4';return} else
       if(this.permissions.reportBalance) {this.ssl(3);this.defaultActive = '1-5';return} else
       if(this.permissions.reportBalance) {this.ssl(3);this.defaultActive = '1-5';return} else
       if(this.permissions.reportProfits) {this.ssl(4);this.defaultActive = '1-6';return} else
       if(this.permissions.reportProfits) {this.ssl(4);this.defaultActive = '1-6';return} else
       if(this.permissions.reportPhase) {this.ssl(5);this.defaultActive = '1-7';return} else
       if(this.permissions.reportPhase) {this.ssl(5);this.defaultActive = '1-7';return} else
-      if(this.permissions.reportOvertime) {this.ssl(6);this.defaultActive = '1-8';return} else
-      if(this.permissions.reportTimely) {this.ssl(9);this.defaultActive = '1-10';return} else
-      if(this.permissions.reportAuditRate) {this.ssl(10);this.defaultActive = '1-11';return} else {this.allWrong = false}
+      if(this.permissions.reportOvertime || this.permissions.reportAllOvertime) {this.ssl(6);this.defaultActive = '1-8';return} else
+      if(this.permissions.reportTimely || this.permissions.reportAllTimely) {this.ssl(9);this.defaultActive = '1-10';return} else
+      if(this.permissions.reportAuditRate) {this.ssl(10);this.defaultActive = '1-11';return} else 
+      if(this.permissions.reportPersonnel || this.permissions.reportResponsible) {this.ssl(11);this.defaultActive = '1-12';return}{this.allWrong = false}
     },
     },
     rowspan(spanArr,position,spanName){
     rowspan(spanArr,position,spanName){
       this.list1.forEach((item,index) => {
       this.list1.forEach((item,index) => {
@@ -934,6 +968,8 @@ export default {
                     this.getReportTimelyList()
                     this.getReportTimelyList()
                 } else if (this.ins == 10) {
                 } else if (this.ins == 10) {
                     this.getAuditRateList()
                     this.getAuditRateList()
+                } else if(this.ins == 11) {
+                    this.getPersonnelList()
                 }
                 }
             },
             },
       exportExcel() {
       exportExcel() {
@@ -986,6 +1022,17 @@ export default {
           if(this.userId){
           if(this.userId){
             sl.userId = this.userId
             sl.userId = this.userId
           }
           }
+        } else if(this.ins == 11){
+          fName = "人员工时统计.xls"
+          url += "/exportUserWorkingTimeStatic"
+          sl.startDate = this.rangeDatas[0]
+          sl.endDate = this.rangeDatas[1]
+          if(this.userId){
+            sl.userId = this.userId
+          }
+          if(this.departmentIdArray.length != 0){
+            sl.departmentId = this.departmentIdArray[this.departmentIdArray.length - 1]
+          }
         }
         }
           this.http.post(url, sl,
           this.http.post(url, sl,
             res => {
             res => {
@@ -1035,6 +1082,41 @@ export default {
       this.selUserList = this.userList
       this.selUserList = this.userList
       this.getList();
       this.getList();
     },
     },
+    // 获取人员工时统计表
+    getPersonnelList() {
+      let parameter = {
+        startDate: this.rangeDatas[0],
+        endDate: this.rangeDatas[1],
+        pageIndex: this.page,
+        pageSize: this.size
+      }
+      if(this.userId){
+        parameter.userId = this.userId
+      }
+      if(this.departmentIdArray.length != 0){
+        parameter.departmentId = this.departmentIdArray[this.departmentIdArray.length - 1]
+      }
+      this.listLoading = true;
+      this.http.post('/project/getUserWorkingTimeStatic', parameter,
+        res => {
+            if (res.code == "ok") {
+                this.personnelList = res.data.result;
+                this.total = res.data.total;
+                this.listLoading = false; 
+            } else {
+                this.$message({
+                message: res.msg,
+                type: "error"
+                });
+            }
+        },
+        error => {
+            this.$message({
+                message: error,
+                type: "error"
+            });
+        });
+    },
     getCustomerProjectInAndOut() {
     getCustomerProjectInAndOut() {
       this.listLoading = true;
       this.listLoading = true;
       this.http.post('/project/getCustomerProjectInAndOut', {
       this.http.post('/project/getCustomerProjectInAndOut', {
@@ -1150,11 +1232,16 @@ export default {
     },
     },
     getProjectTask() {
     getProjectTask() {
       this.listLoading = true;
       this.listLoading = true;
-      this.http.post('/project/getProjectTask', {
-                    pageIndex: this.page,
-                    pageSize: this.size,
-                    projectId: this.proJuctId
-                    },
+      let ginseng = {
+        pageIndex: this.page,
+        pageSize: this.size,
+        projectId: this.proJuctId
+      }
+      console.log(this.taskTypeId)
+      if(this.taskTypeId != 'null' && this.taskTypeId != null && this.taskTypeId != '') {
+        ginseng.taskType = this.taskTypeId
+      }
+      this.http.post('/project/getProjectTask', ginseng,
         res => {
         res => {
             if (res.code == "ok") {
             if (res.code == "ok") {
               for(var i in res.data.records) {
               for(var i in res.data.records) {
@@ -1511,6 +1598,9 @@ export default {
       if(this.ins == 10){
       if(this.ins == 10){
         this.getAuditRateList()
         this.getAuditRateList()
       }
       }
+      if(this.ins == 11){
+        this.getPersonnelList()
+      }
     },
     },
     // 日期
     // 日期
     getCurrentRangeTime() {
     getCurrentRangeTime() {

+ 11 - 5
fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue

@@ -29,10 +29,13 @@
                 <el-form-item >
                 <el-form-item >
                     <div style="margin-left: 8px">
                     <div style="margin-left: 8px">
                     <!-- <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入项目名称关键字" clearable="true"> -->
                     <!-- <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入项目名称关键字" clearable="true"> -->
-                        <el-select v-model="typeField" style="width:120px;"  slot="prepend" placeholder="请选择">
-                            <el-option label="任务" value="0" @click.native="hiddens()"></el-option>
+                        <el-select v-model="typeField" style="width:120px;"  slot="prepend" placeholder="请选择" clearable @change="hiddens()">
+                            <!-- <el-option label="任务" value="0" @click.native="hiddens()"></el-option>
                             <el-option label="里程碑" value="1" @click.native="hiddens()"></el-option>
                             <el-option label="里程碑" value="1" @click.native="hiddens()"></el-option>
-                            <el-option label="风险" value="2" @click.native="hiddens()"></el-option>
+                            <el-option label="风险" value="2" @click.native="hiddens()"></el-option> -->
+                            <el-option label="任务" value="0"></el-option>
+                            <el-option label="里程碑" value="1"></el-option>
+                            <el-option label="风险" value="2"></el-option>
                         </el-select>
                         </el-select>
                         <!-- <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button> -->
                         <!-- <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button> -->
                     <!-- </el-input> -->
                     <!-- </el-input> -->
@@ -673,7 +676,7 @@ import { error } from 'dingtalk-jsapi';
         },
         },
         data() {
         data() {
             return {
             return {
-                typeField: '0',
+                typeField: null,
                 searchField: '0',
                 searchField: '0',
                 keyword:null,
                 keyword:null,
                 user: JSON.parse(sessionStorage.getItem("user")),
                 user: JSON.parse(sessionStorage.getItem("user")),
@@ -970,7 +973,10 @@ import { error } from 'dingtalk-jsapi';
                     viewId: this.idx,
                     viewId: this.idx,
                     pageIndex: this.page,
                     pageIndex: this.page,
                     pageSize: this.size,
                     pageSize: this.size,
-                    type: this.typeField
+                    // type: this.typeField
+                }
+                if(this.typeField != 'null' && this.typeField != null && this.typeField != '') {
+                    parameter.type = this.typeField
                 }
                 }
                 if(this.dateSelect.length != 0){
                 if(this.dateSelect.length != 0){
                     parameter.dateType = this.dateType
                     parameter.dateType = this.dateType