Browse Source

查看本部门工时

seyason 2 years ago
parent
commit
b0396db39c

+ 5 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -231,7 +231,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 
                         List ids = deptList.stream().map(Department::getDepartmentId).collect(Collectors.toList());
                         nameList = reportMapper.getReportNameByDateAndDept(date,
-                                ids, null, null);
+                                ids, targetUid, null);
 
                         if (nameList.size() > 0) {
                             List<String> userIds = new ArrayList<>();
@@ -1496,7 +1496,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 if (!allMDeptList.stream().anyMatch(d->d.getDepartmentId().equals(ownerDept.getDepartmentId()))) {
                     allMDeptList.add(ownerDept);
                 }
+                if (manageDeptId == null || manageDeptId == 0) {
+                    manageDeptId = curUser.getDepartmentId();
+                }
             }
+
             if (allMDeptList.size() == 1) {
                 list = getSpecifiedDept(list, manageDeptId);
             } else {

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

@@ -28,6 +28,7 @@ const StringUtil = {
         reportsFillOut: false, // 代填日报 //
         reportsDeleteAll: false, // 删除全公司日报
         importReport: false, //导入工时lij
+        reportsDept: false, //查看本部门工时
 
         // 财务核算成本 
         financialCustom: false, // 自定义薪资项 // 
@@ -95,6 +96,7 @@ const StringUtil = {
         arr[i] == '导出人员' ? obj.structureExport = true : ''
         arr[i] == '导入人员' ? obj.structureImport = true : ''
         arr[i] == '查看全公司工时' ? obj.reportsCompany = true : ''
+        arr[i] == '查看本部门工时' ? obj.reportsDept = true : ''
         arr[i] == '查看相关人员工时' ? obj.reportsPersonnel = true : ''
         arr[i] == '代填日报' ? obj.reportsFillOut = true : ''
         arr[i] == '自定义薪资项' ? obj.financialCustom = true : ''

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

@@ -34,7 +34,7 @@
                 </div>
                 </div>
                 <div style="display:flex;">
-                <div v-if="permissions.reportsCompany || user.manageDeptId != 0" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
+                <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
                     <div style="width:205px;">
                         <el-select v-model="selectState" size="small" @change="stateChange" >
                         <el-option value="-1" label="全部状态" >全部状态</el-option>
@@ -77,7 +77,7 @@
                     <div class="report_title" >
                         
                         <span>工作日报 </span>
-                        <span v-if="permissions.reportsCompany||user.manageDeptId != 0">| {{depData != null ?depData.label:""}}
+                        <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept">| {{depData != null ?depData.label:""}}
                         <span v-if="targetUid == null">
                          - 已填写
                         <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{reportList.length}}</span></el-link>人,
@@ -3059,7 +3059,7 @@
             getDepartment() {
                 let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
                 var param = {date:this.date + day};
-                if (this.user.manageDeptId != 0 && !this.permissions.reportsCompany) {
+                if (this.user.manageDeptId != 0 && !this.permissions.reportsCompany && !this.permissions.reportsDept) {
                     param.manageDeptId = this.user.manageDeptId; 
                 }
                 this.http.post("/report/getMembList", param,