Bladeren bron

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

ggooalice 2 jaren geleden
bovenliggende
commit
b0460e3529

+ 10 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java

@@ -1157,5 +1157,15 @@ public class ProjectController {
         return projectService.exportProjectGroupAndCategoryWorkTime(request,startDate,endDate,projectId);
     }
 
+    @RequestMapping("/getSubProjectTimeCost")
+    public HttpRespMsg getSubProjectTimeCost(HttpServletRequest request,String startDate,String endDate,Integer projectId,Integer pageIndex,Integer pageSize){
+        return projectService.getSubProjectTimeCost(request,startDate,endDate,projectId,pageIndex,pageSize);
+    }
+
+    @RequestMapping("/exportSubProjectTimeCost")
+    public HttpRespMsg exportSubProjectTimeCost(HttpServletRequest request,Integer projectId){
+        return projectService.exportSubProjectTimeCost(request,projectId);
+    }
+
 }
 

+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectMapper.java

@@ -140,4 +140,8 @@ public interface ProjectMapper extends BaseMapper<Project> {
     List<Map<String, Object>> getProjectGroupAndCategoryData(String startDate, String endDate, Integer projectId, Integer companyId, Integer start, Integer size, List<Integer> inchagerIds);
 
     long getProjectGroupAndCategoryCount(String startDate, String endDate, Integer projectId, Integer companyId, Integer start, Integer size, List<Integer> inchagerIds);
+
+    List<Map<String, Object>> getSubProjectTimeCost(Integer companyId, String startDate, String endDate, Integer projectId,Integer start,Integer size, List<Integer> inchagerIds);
+
+    long countWithSubProjectTimeCost(Integer companyId, String startDate, String endDate, Integer projectId, Integer start,Integer size, List<Integer> inchagerIds);
 }

+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectService.java

@@ -217,4 +217,8 @@ public interface ProjectService extends IService<Project> {
     HttpRespMsg projectGroupAndCategoryWorkTime(HttpServletRequest request, String startDate, String endDate, Integer projectId,Integer pageIndex,Integer pageSize);
 
     HttpRespMsg exportProjectGroupAndCategoryWorkTime(HttpServletRequest request, String startDate, String endDate, Integer projectId);
+
+    HttpRespMsg getSubProjectTimeCost(HttpServletRequest request, String startDate, String endDate, Integer projectId,Integer pageIndex,Integer pageSize);
+
+    HttpRespMsg exportSubProjectTimeCost(HttpServletRequest request, Integer projectId);
 }

+ 36 - 36
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java

@@ -1003,18 +1003,18 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                             }
                             Finance userFinance = first.get();
 
-                            BigDecimal cost = userFinance.getTotalCost().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 4, BigDecimal.ROUND_HALF_UP);
-                            BigDecimal salary = userFinance.getMonthCost().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 4, BigDecimal.ROUND_HALF_UP);
-                            BigDecimal bonus = userFinance.getBonus().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 4, BigDecimal.ROUND_HALF_UP);
-                            BigDecimal allowance = userFinance.getAllowance().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 4, BigDecimal.ROUND_HALF_UP);
-                            BigDecimal old = userFinance.getInsuranceOld().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 4, BigDecimal.ROUND_HALF_UP);
-                            BigDecimal medical = userFinance.getInsuranceMedical().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 4, BigDecimal.ROUND_HALF_UP);
-                            BigDecimal loseJob = userFinance.getInsuranceLosejob().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 4, BigDecimal.ROUND_HALF_UP);
-                            BigDecimal injury = userFinance.getInsuranceInjury().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 4, BigDecimal.ROUND_HALF_UP);
-                            BigDecimal house = userFinance.getHouseFund().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 4, BigDecimal.ROUND_HALF_UP);
-                            BigDecimal field1 = userFinance.getCustomField1() == null? new BigDecimal(0):userFinance.getCustomField1().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 4, BigDecimal.ROUND_HALF_UP);
-                            BigDecimal field2 = userFinance.getCustomField2() == null? new BigDecimal(0):userFinance.getCustomField2().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 4, BigDecimal.ROUND_HALF_UP);
-                            BigDecimal field3 = userFinance.getCustomField3() == null? new BigDecimal(0):userFinance.getCustomField3().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 4, BigDecimal.ROUND_HALF_UP);
+                            BigDecimal cost = userFinance.getTotalCost().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
+                            BigDecimal salary = userFinance.getMonthCost().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
+                            BigDecimal bonus = userFinance.getBonus().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
+                            BigDecimal allowance = userFinance.getAllowance().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
+                            BigDecimal old = userFinance.getInsuranceOld().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
+                            BigDecimal medical = userFinance.getInsuranceMedical().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
+                            BigDecimal loseJob = userFinance.getInsuranceLosejob().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
+                            BigDecimal injury = userFinance.getInsuranceInjury().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
+                            BigDecimal house = userFinance.getHouseFund().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
+                            BigDecimal field1 = userFinance.getCustomField1() == null? new BigDecimal(0):userFinance.getCustomField1().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
+                            BigDecimal field2 = userFinance.getCustomField2() == null? new BigDecimal(0):userFinance.getCustomField2().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
+                            BigDecimal field3 = userFinance.getCustomField3() == null? new BigDecimal(0):userFinance.getCustomField3().multiply(new BigDecimal(workingTime)).divide(userTime.get(creatorId).workingTime, 6, BigDecimal.ROUND_HALF_UP);
                             if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
                                 membRowData.add("$userName="+(us.getCorpwxUserid()==null?"":us.getCorpwxUserid())+"$");
                             }else {
@@ -1040,25 +1040,25 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                                 }
                             }
                             membRowData.add(workingTime+"");
-                            membRowData.add(salary.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
-                            membRowData.add(bonus.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
-                            membRowData.add(allowance.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
-                            membRowData.add(old.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
-                            membRowData.add(medical.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
-                            membRowData.add(loseJob.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
-                            membRowData.add(injury.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
-                            membRowData.add(house.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
+                            membRowData.add(salary.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
+                            membRowData.add(bonus.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
+                            membRowData.add(allowance.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
+                            membRowData.add(old.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
+                            membRowData.add(medical.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
+                            membRowData.add(loseJob.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
+                            membRowData.add(injury.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
+                            membRowData.add(house.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
                             //自定义字段
                             if (cusColList.size() > 0) {
-                                membRowData.add(field1.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
+                                membRowData.add(field1.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
                             }
                             if (cusColList.size() > 1) {
-                                membRowData.add(field2.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
+                                membRowData.add(field2.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
                             }
                             if (cusColList.size() > 2) {
-                                membRowData.add(field3.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
+                                membRowData.add(field3.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
                             }
-                            membRowData.add(cost.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
+                            membRowData.add(cost.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
                             allList.add(membRowData);
                         }
                     }
@@ -1118,25 +1118,25 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                                         }
                                     }
                                     membRowData.add(workingTime+"");
-                                    membRowData.add(salary.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
-                                    membRowData.add(bonus.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
-                                    membRowData.add(allowance.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
-                                    membRowData.add(old.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
-                                    membRowData.add(medical.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
-                                    membRowData.add(loseJob.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
-                                    membRowData.add(injury.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
-                                    membRowData.add(house.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
+                                    membRowData.add(salary.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
+                                    membRowData.add(bonus.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
+                                    membRowData.add(allowance.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
+                                    membRowData.add(old.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
+                                    membRowData.add(medical.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
+                                    membRowData.add(loseJob.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
+                                    membRowData.add(injury.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
+                                    membRowData.add(house.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
                                     //自定义字段
                                     if (cusColList.size() > 0) {
-                                        membRowData.add(field1.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
+                                        membRowData.add(field1.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
                                     }
                                     if (cusColList.size() > 1) {
-                                        membRowData.add(field2.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
+                                        membRowData.add(field2.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
                                     }
                                     if (cusColList.size() > 2) {
-                                        membRowData.add(field3.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
+                                        membRowData.add(field3.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
                                     }
-                                    membRowData.add(cost.setScale(3, BigDecimal.ROUND_HALF_UP).toPlainString());
+                                    membRowData.add(cost.setScale(6, BigDecimal.ROUND_HALF_UP).toPlainString());
                                     allList.add(membRowData);
                                 }
                             }

+ 81 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -8945,6 +8945,87 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         return msg;
     }
 
+    @Override
+    public HttpRespMsg getSubProjectTimeCost(HttpServletRequest request, String startDate, String endDate, Integer projectId,Integer pageIndex,Integer pageSize) {
+        HttpRespMsg msg=new HttpRespMsg();
+        Integer start = (pageIndex-1)*pageSize;
+        Integer size = pageSize*pageIndex;
+        User user = userMapper.selectById(request.getHeader("token"));
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", user.getCompanyId()));
+        List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全部子项目工时成本");
+        List<SysRichFunction> functionInchargeList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责项目子项目工时成本");
+        //判断查看权限
+        List<Integer> inchagerIds=null;
+        if(functionAllList.size()==0){
+            inchagerIds=new ArrayList<>();
+            if(functionInchargeList.size()>0){
+                List<Project> list = projectList.stream().filter(pl -> (pl.getInchargerId()==null?0:pl.getInchargerId()).equals(user.getId())).collect(Collectors.toList());
+                if(list!=null){
+                    List<Integer> collect = list.stream().map(li -> li.getId()).collect(Collectors.toList());
+                    inchagerIds.addAll(collect);
+                }
+            }else {
+                inchagerIds.add(-1);
+            }
+        }
+        List<Map<String,Object>> list=projectMapper.getSubProjectTimeCost(companyId,startDate,endDate,projectId,start,size,inchagerIds);
+        long total=projectMapper.countWithSubProjectTimeCost(companyId,startDate,endDate,projectId,null,null,inchagerIds);
+        Map<String,Object> map=new HashMap<>();
+        map.put("record",list);
+        map.put("total",total);
+        msg.data=map;
+        return msg;
+    }
+
+    @Override
+    public HttpRespMsg exportSubProjectTimeCost(HttpServletRequest request, Integer projectId) {
+        HttpRespMsg msg=new HttpRespMsg();
+        User user = userMapper.selectById(request.getHeader("token"));
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", user.getCompanyId()));
+        List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全部子项目工时成本");
+        List<SysRichFunction> functionInchargeList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责项目子项目工时成本");
+        //判断查看权限
+        List<Integer> inchagerIds=null;
+        if(functionAllList.size()==0){
+            inchagerIds=new ArrayList<>();
+            if(functionInchargeList.size()>0){
+                List<Project> list = projectList.stream().filter(pl -> (pl.getInchargerId()==null?0:pl.getInchargerId()).equals(user.getId())).collect(Collectors.toList());
+                if(list!=null){
+                    List<Integer> collect = list.stream().map(li -> li.getId()).collect(Collectors.toList());
+                    inchagerIds.addAll(collect);
+                }
+            }else {
+                inchagerIds.add(-1);
+            }
+        }
+        List<Map<String,Object>> list=projectMapper.getSubProjectTimeCost(companyId,null,null,projectId,null,null,inchagerIds);
+        List<List<String>> dataList=new ArrayList<>();
+        List<String> titleList=new ArrayList<>();
+        titleList.add("项目编号");
+        titleList.add("项目名称");
+        titleList.add("子项目编号");
+        titleList.add("子项目名称");
+        titleList.add("子项目工时");
+        titleList.add("子项目成本");
+        dataList.add(titleList);
+        for (Map<String, Object> map : list) {
+            List<String> item=new ArrayList<>();
+            item.add(String.valueOf(map.get("projectCode")==null?"":map.get("projectCode")));
+            item.add(String.valueOf(map.get("projectName")==null?"":map.get("projectName")));
+            item.add(String.valueOf(map.get("subProjectCode")==null?"":map.get("subProjectCode")));
+            item.add(String.valueOf(map.get("subProjectName")==null?"":map.get("subProjectName")));
+            item.add(String.valueOf(map.get("cost")==null?"0":map.get("cost"))+"(元)");
+            item.add(String.valueOf(map.get("workingTime")==null?"0":map.get("workingTime"))+"(小时)");
+            dataList.add(item);
+        }
+        String fileName = "子项目工时成本表"+System.currentTimeMillis();
+        String resp = ExcelUtil.exportGeneralExcelByTitleAndList(fileName, dataList, path);
+        msg.data=resp;
+        return msg;
+    }
+
     private List<GanttDataItem> getUserGanttDataItemList(GanttDataItem userGantt, List<GanttDataItem> itemList) {
         if(itemList==null){
             itemList=new ArrayList<>();

+ 49 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -175,6 +175,55 @@
         ORDER BY a.id ASC
     </select>
 
+    <!--获取查询者所在公司每个子项目的工时成本-->
+    <select id="getSubProjectTimeCost" resultType="java.util.Map">
+        select b.project_code as projectCode,b.project_name as projectName,a.code as subProjectCode,a.name as subProjectName,SUM(c.cost) as cost,SUM(c.working_time) as workingTime
+        from sub_project a
+        left join project b on b.id=a.project_id
+        left join report c on c.sub_project_id=a.id
+        where a.company_id=#{companyId}
+        <if test="startDate != null and endDate != null">
+            and c.create_date between #{startDate} and #{endDate}
+        </if>
+        <if test="projectId!=null">
+            and a.project_id=#{projectId}
+        </if>
+        <if test="inchagerIds!=null and inchagerIds.size()>0">
+            and b.id in
+            <foreach collection="inchagerIds" open="(" close=")" separator="," item="item">
+                #{item}
+            </foreach>
+        </if>
+        group by b.id,a.id
+        <if test="start!=null and size!=null">
+            limit #{start},#{size}
+        </if>
+    </select>
+
+    <select id="countWithSubProjectTimeCost" resultType="java.lang.Long">
+        select count(1) from(select b.project_code as projectCode,b.project_name as projectName,a.code as subProjectCode,a.name as subProjectName,SUM(c.cost) as cost,SUM(c.working_time) as workingTime
+        from sub_project a
+        left join project b on b.id=a.project_id
+        left join report c on c.sub_project_id=a.id
+        where a.company_id=#{companyId}
+        <if test="startDate != null and endDate != null">
+            and c.create_date between #{startDate} and #{endDate}
+        </if>
+        <if test="projectId!=null">
+            and a.project_id=#{projectId}
+        </if>
+        <if test="inchagerIds!=null and inchagerIds.size()>0">
+            and b.id in
+            <foreach collection="inchagerIds" open="(" close=")" separator="," item="item">
+                #{item}
+            </foreach>
+        </if>
+        group by b.id,a.id
+        <if test="start!=null and size!=null">
+            limit #{start},#{size}
+        </if>) as total
+    </select>
+
 
 
     <!--获取查询者所在公司每个项目的工时成本-->

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

@@ -86,6 +86,8 @@ const StringUtil = {
         reportResponsibleDepartmentParticipation: false, // 负责部门参与项目情况表 //
         reportPhaseHours: false, // 全部分组阶段工时 // 
         reportStageWorkingTime: false, // 负责项目分组阶段工时 //
+        reportAllManhourCost: false, // 全部子项目工时成本 //
+        reportResponsibleManhourCost: false, // 负责项目子项目工时成本 //
 
         // 请假模块
         leaveFil : false, // 请假填报 // 
@@ -220,7 +222,8 @@ const StringUtil = {
         arr[i] == '导入合同' ? obj.contractImport = true : ''
         arr[i] == '合同类型管理' ? obj.contractType = true : ''
         arr[i] == '审核合同' ? obj.contractAudit = true : ''
-
+        arr[i] == '全部子项目工时成本' ? obj.reportAllManhourCost = true : ''
+        arr[i] == '负责项目子项目工时成本' ? obj.reportResponsibleManhourCost = true : ''
     }
     return obj
   }

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

@@ -37,6 +37,7 @@
                   <el-menu-item index="1-15" v-if="permissions.reportMonthlyPersonnel || permissions.reportResponsiblePersonnel" @click="ssl(14)"><p>{{ $t('ren-yuan-yue-du-gong-shi-biao') }}</p></el-menu-item>
                   <el-menu-item index="1-16" v-if="permissions.reportAllDepartmentParticipation || permissions.reportResponsibleDepartmentParticipation" @click="ssl(15)"><p>{{ $t('bumenchanyuqingkuang') }}</p></el-menu-item>
                   <el-menu-item index="1-17" v-if="permissions.reportPhaseHours || permissions.reportStageWorkingTime" @click="ssl(16)"><p>{{ $t('xiang-mu-ge-fen-zu-yu-jie-duan-gong-shi-biao') }}</p></el-menu-item>
+                  <el-menu-item index="1-18" v-if="permissions.reportAllManhourCost || permissions.reportResponsibleManhourCost" @click="ssl(17)"><p>子项目工时成本表</p></el-menu-item>
                   <!-- <el-menu-item index="1-12"><p @click="ssl(11)">人员工时统计表</p></el-menu-item> -->
                 </el-submenu>
               </el-menu>
@@ -70,7 +71,7 @@
           </el-select>
         </template>
         <!-- 时间段筛选 -->
-          <template v-if="ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11 || ins == 12 || ins == 5 || ins == 16">
+          <template v-if="ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11 || ins == 12 || ins == 5 || ins == 16 || ins == 17">
             <span>
               <span class="demonstration" style="color:#999;padding:0 10px">
                 {{ ins == 15 ? $t('xiang-mu-chuang-jian-shi-jian-duan') : $t('message.period') }}
@@ -85,7 +86,7 @@
           <el-option label="查看部门审核人" :value="0"></el-option>
         </el-select> -->
         <!-- 项目筛选 -->
-        <el-select v-if="ins != 4 && ins != 8 && ins != 9 && ins != 10 && ins != 11 && ins != 14 && ins != 15" 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 != 10 && ins != 11 && ins != 14 && ins != 15 && ins != 17" v-model="proJuctId" :placeholder="$t('defaultText.pleaseSelectSnItem')" 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">
             <span style="float: left;color: #8492a6;">{{ item.projectCode }}</span>
             <span style="float: right;font-size: 13px;margin-left: 20px">{{ item.projectName }}</span>
@@ -799,6 +800,16 @@
                 </el-table-column>
             </el-table>
 
+            <!-- 子项目工时成本表 -->
+            <el-table v-if="ins == 17"  key="17" border :data="subprojectArr" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
+                <el-table-column align="center" prop="projectCode" label="父项目编号" min-width="150"></el-table-column>
+                <el-table-column align="center" prop="projectName" label="父项目名称" min-width="150"></el-table-column>
+                <el-table-column align="center" prop="subProjectCode" label="子项目编号" min-width="150"></el-table-column>
+                <el-table-column align="center" prop="subProjectName" label="子项目名称" min-width="150"></el-table-column>
+                <el-table-column align="center" prop="workingTime" label="子项目工时" min-width="150"></el-table-column>
+                <el-table-column align="center" prop="cost" label="子项目成本" min-width="150"></el-table-column>
+            </el-table>
+
         <!--工具条-->
         <el-col :span="24" class="toolbar" v-if="ins != 6">
           <el-pagination
@@ -1066,13 +1077,13 @@ export default {
       this.$t('pojectbalancesheetincomestatement'),this.$t('customerprojectprofitstatement'),this.$t('projectphasetimesheet'),
       this.$t('statisticsofovertimework'),this.$t('timecostearlywarningtable'),this.$t('personneltimeallocationtable'),
       this.$t('statisticsofstafffillingintimerate'),this.$t('dailyreporttobereviewedstatistics'),this.$t('statisticsofpersonnelhours'),this.$t('taskgrouptimesheet'),this.$t('projectcostbaselinetable'),
-      this.$t('ren-yuan-yue-du-gong-shi-biao'), this.$t('bumenchanyuqingkuang'), this.$t('ge-fen-zu-yu-jie-duan-gong-shi-biao')],
+      this.$t('ren-yuan-yue-du-gong-shi-biao'), this.$t('bumenchanyuqingkuang'), this.$t('ge-fen-zu-yu-jie-duan-gong-shi-biao'), '子项目工时成本表'],
 
       shuzArr: [this.$t('projectreport'),this.$t('projectTaskReport'),this.$t('projectcoststatement'),
       this.$t('projectbalancesheet'),this.$t('customerprojectincomestatement'),this.$t('projectphasetimesheet'),
       this.$t('statisticsofovertimework'),this.$t('timecostearlywarningtable'),this.$t('personneltimeallocationtable'),
       this.$t('employeereporttimelinessrate'),this.$t('dailyreporttobereviewedstatistics'),this.$t('statisticsofpersonnelhours'),this.$t('taskgrouptimesheet'),this.$t('projectcostbaselinetable'),
-      this.$t('ren-yuan-yue-du-gong-shi-biao'), this.$t('bumenchanyuqingkuang'), this.$t('ge-fen-zu-yu-jie-duan-gong-shi-biao')],
+      this.$t('ren-yuan-yue-du-gong-shi-biao'), this.$t('bumenchanyuqingkuang'), this.$t('ge-fen-zu-yu-jie-duan-gong-shi-biao'), '子项目工时成本表'],
 
       ins: 10000,
       user: JSON.parse(sessionStorage.user),
@@ -1134,7 +1145,9 @@ export default {
       },
       exportLoading: false,
       groupingItemsArr: [],
-      groupingItemsArrTitle: []
+      groupingItemsArrTitle: [],
+
+      subprojectArr: []
     };
   },
   computed: {},
@@ -1223,6 +1236,7 @@ export default {
       if(this.permissions.reportMonthlyPersonnel || this.permissions.reportResponsiblePersonnel) {this.ssl(14);this.defaultActive = '1-15';return}
       if(this.permissions.reportAllDepartmentParticipation || this.permissions.reportResponsibleDepartmentParticipation) {this.ssl(15);this.defaultActive = '1-16';return}
       if(this.permissions.reportPhaseHours || this.permissions.reportStageWorkingTime) {this.ssl(16);this.defaultActive = '1-17';return}
+      if(this.permissions.reportAllManhourCost || this.permissions.reportResponsibleManhourCost) {this.ssl(17);this.defaultActive = '1-18';return}
       {this.allWrong = false}
     },
     rowspan(spanArr,position,spanName){
@@ -1464,8 +1478,10 @@ export default {
                   this.getDepartmentsInvolved()
                 } else if(this.ins == 16) {
                   this.groupingItems()
+                } else if(this.ins == 17) {
+                  this.getAubprojectArr()
                 }
-                if(this.ins != 16) {
+                if(this.ins != 16 && this.ins != 17) {
                   this.getUserList()
                 }
             },
@@ -1580,6 +1596,11 @@ export default {
           sl.startDate = this.rangeDatas[0]
           sl.endDate = this.rangeDatas[1]
           sl.projectId = this.proJuctId
+        } else if(this.ins == 17) {
+          fName = '子项目工时成本表' + '.xls'
+          url += "/exportSubProjectTimeCost"
+          sl.startDate = this.rangeDatas[0]
+          sl.endDate = this.rangeDatas[1]
         }
           this.http.post(url, sl,
             res => {
@@ -1882,6 +1903,37 @@ export default {
             });
         });
     },
+    // 子项目工时成本表
+    getAubprojectArr() {
+      // this.total = 0
+      this.listLoading = true
+      this.http.post('/project/getSubProjectTimeCost', {
+         startDate: this.rangeDatas[0],
+         endDate: this.rangeDatas[1],
+         projectId: this.proJuctId,
+         pageIndex: this.page,
+         pageSize: this.size,
+      },
+        res => {
+            this.listLoading = false
+            if (res.code == "ok") {
+                this.subprojectArr = res.data.record
+                this.total = res.data.total
+            } else {
+                this.listLoading = false
+                this.$message({
+                  message: res.msg,
+                  type: "error"
+                });
+            }
+        },
+        error => {
+            this.$message({
+                message: error,
+                type: "error"
+            });
+        });
+    },
     overTime() {
       this.listLoading = true;
       var obj = {
@@ -2442,6 +2494,9 @@ export default {
       if(this.ins == 5) {
         this.getProjectStages()
       }
+      if(this.ins == 17) {
+        this.getAubprojectArr()
+      }
     },
     // 日期
     getCurrentRangeTime() {

+ 3 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue

@@ -645,7 +645,8 @@ import { error } from 'dingtalk-jsapi';
                 showImportResult:false,
                 widthHtval: document.body.clientWidth - 230,
                 deleteSelList: [],
-                chosenProjectsChecked: false
+                chosenProjectsChecked: false,
+                exportDataProcessing: false,
             };
         },
         methods: {
@@ -1319,7 +1320,7 @@ import { error } from 'dingtalk-jsapi';
                     }
                 },
                 error => {
-                    this.listLoading = false;
+                    this.exportDataProcessing = false;
                     this.$message({
                         message: error,
                         type: "error"

+ 62 - 9
fhKeeper/formulahousekeeper/timesheet_h5/src/views/task/editask.vue

@@ -1,5 +1,5 @@
 <template>
-    <div>
+    <div class="editaskBox">
         <van-nav-bar :title="title" left-text="返回" @click-left="back" fixed left-arrow />
         <div class="content">
             <van-form>
@@ -70,12 +70,13 @@
                     <van-icon v-if="index != 0 && canEdit" class="delete_executor" name="delete-o" @click.stop="deleteExecutor(index)" />
                 </div>
                 <van-popup v-model="executor.show" position="bottom" v-if="canEdit">
-                    <van-search v-model="executor.searchText" placeholder="输入员工姓名搜索" @search="onSearch" v-if="user.userNameNeedTranslate != '1'"></van-search>
+                    <van-search v-model="executor.searchText" placeholder="输入员工姓名搜索" @input="onSearch"></van-search>
                     <div style="minHeight:300px;">
                         <van-radio-group v-model="executor.item">
                             <van-radio v-for="uitem in executor.searchList" :key="uitem.id" :name="uitem" style="padding:10px">
                                 <span v-if="user.userNameNeedTranslate != 1">{{uitem.name}}</span>
                                 <span v-else><ww-open-data type='userName' :openid='uitem.name'></ww-open-data></span>
+                                <span class="xinmingghao">{{uitem.jobNumber}}</span>
                             </van-radio>
                         </van-radio-group>
                     <van-button style="width:100%;position: -webkit-sticky;position: sticky;bottom: 0;" @click="searchExecutor()">确定</van-button>
@@ -101,7 +102,7 @@
             </van-form>
             <div class="form_btn" style="position:fixed; bottom:0px;width:100%;">
                 <div style="padding-bottom:10px;">
-                    <van-button square block type="info" @click="submitTask" native-type="submit" style="width:100%;float:left;" :disabled="!canEdit">
+                    <van-button square block type="info" loading-text="保存中..." @click="submitTask" native-type="submit" :loading="submitTaskBtn" style="width:100%;float:left;" :disabled="!canEdit">
                         <div v-if="canEdit">保存</div>
                         <div v-else>暂无权限编辑</div>
                     </van-button>
@@ -125,6 +126,7 @@ export default {
             minDate: new Date(2020,0,1),
             maxDate: new Date(2025,11,31),
             canEdit: true,
+            onSearchTime: null,
             taskform:{      // 表单
                 taskType: 0,
                 name: '',
@@ -142,6 +144,9 @@ export default {
             startDateShow: false,
             endDateShow: false,
             finishDateShow: false,
+
+            submitTaskBtn: false,
+
             taskLevel:{
                 show: false,
                 list: ['一般','重要','紧急']
@@ -172,6 +177,7 @@ export default {
                 startDate: null,
                 endDate: null,
                 finishDate: null,
+                taskDesc: '',
                 taskLevel: 0,
                 executorList: [{executorName: '',executorId: '',planHours: this.user.timeType.allday}]
             }
@@ -228,11 +234,39 @@ export default {
             this.$forceUpdate();
         },
         onSearch(val) {
-            console.log(val);
-            this.executor.searchList = [];
-            this.executor.list.forEach(u=>{if (u.name.startsWith(val)) {
-                this.executor.searchList.push(u);
-            }})
+            if(this.user.userNameNeedTranslate != 1) {
+                this.executor.searchList = [];
+                this.executor.list.forEach(u=>{if (u.name.startsWith(val)) {
+                    this.executor.searchList.push(u);
+                }})
+            } else {
+                if (this.onSearchTime != null) {
+                    clearTimeout(this.onSearchTime)
+                }
+                var that = this
+                this.onSearchTime = setTimeout(() => {
+                    that.getOnSearch(val)
+                }, 500)
+            }
+        },
+        getOnSearch(val) {
+            this.$axios.post("/user/getEmployeeList", {
+                departmentId: -1,
+                pageIndex: 1,
+                pageSize: 200,
+                keyword: val,
+                status: 1,
+                roleId: '',
+                cursor: '',
+                onlyDirect: 0,
+            })
+            .then(res => {
+                if(res.code == "ok") {
+                    this.executor.searchList = res.data.records
+                } else {
+                    this.$toast.fail('搜索失败');
+                }
+            }).catch(err=> {this.$toast.clear();console.log(err)});
         },
         searchExecutor(){
             this.taskform.executorList[this.executor.index].executorId = this.executor.item.id
@@ -272,15 +306,18 @@ export default {
             delete this.taskform.subTaskList;
             delete this.taskform.refTaskList;
             delete this.taskform.progress;
+            this.submitTaskBtn = true
+            // return
             this.$axios.post("/task/save", this.taskform)
             .then(res => {
+                this.submitTaskBtn = false
                 if(res.code == "ok") {
                     this.$toast.success('保存成功');
                     this.back()
                 } else {
                     this.$toast.fail('保存失败');
                 }
-            }).catch(err=> {this.$toast.clear();console.log(err)});
+            }).catch(err=> {this.$toast.clear();console.log(err);this.submitTaskBtn = false});
 
         },
         htmleditor(e) {
@@ -296,6 +333,9 @@ export default {
                     this.taskform.createDate = null;
                     this.taskform.indate = null;
                     let projectManagement = false
+                    if(!this.taskform.taskDesc){
+                        this.taskform.taskDesc = ''
+                    }
                     if(this.taskform.startDate){
                         this.currentDate1 = new Date(this.taskform.startDate)
                     }
@@ -370,4 +410,17 @@ export default {
         color: #c03131;
     }
 }
+.xinmingghao {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    width: 200px;
+    display: inline-block;
+    float: right;
+}
+</style>
+<style>
+    .editaskBox .van-radio__label {
+        width: 100%;
+        display: inline-block;
+    }
 </style>