Browse Source

任务分组工时

seyason 1 year ago
parent
commit
923942cd0e

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

@@ -1229,6 +1229,11 @@ public class ProjectController {
         return projectService.timeCostAndExpenseByProject(request,startDate,endDate,projectId);
         return projectService.timeCostAndExpenseByProject(request,startDate,endDate,projectId);
     }
     }
 
 
+    @RequestMapping("/getProjectFillTime")
+    public HttpRespMsg getProjectFillTime(HttpServletRequest request,Integer projectId){
+        return projectService.getProjectFillTime(request,projectId);
+    }
+
     /**
     /**
      * 获取最近填写的三个项目
      * 获取最近填写的三个项目
      * @param request
      * @param request

+ 52 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -83,6 +83,8 @@ public class ReportController {
     @Resource
     @Resource
     private TimeTypeMapper timeTypeMapper;
     private TimeTypeMapper timeTypeMapper;
     @Resource
     @Resource
+    private TaskGroupService taskGroupService;
+    @Resource
     private ReportMapper reportMapper;
     private ReportMapper reportMapper;
     @Resource
     @Resource
     private ProjectMapper projectMapper;
     private ProjectMapper projectMapper;
@@ -1151,6 +1153,8 @@ public class ReportController {
         //如果开启了项目人天
         //如果开启了项目人天
         String warningPercentProjects = "";
         String warningPercentProjects = "";
         String warningLackProjects = "";
         String warningLackProjects = "";
+        String warningGroupPercent = "";
+        String warningGroupLack = "";
         EstimateTimeSetting estimateTimeSetting = null;
         EstimateTimeSetting estimateTimeSetting = null;
         if(comTimeType.getProjectManDay()==1){
         if(comTimeType.getProjectManDay()==1){
             Collection<Integer> projectIds = reportList.stream().map(Report::getProjectId).distinct().collect(Collectors.toList());
             Collection<Integer> projectIds = reportList.stream().map(Report::getProjectId).distinct().collect(Collectors.toList());
@@ -1192,12 +1196,44 @@ public class ReportController {
                             if (hasReport.divide(multiply, 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).compareTo(new BigDecimal(100-estimateTimeSetting.getProjectWarningPercent()))>0) {
                             if (hasReport.divide(multiply, 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).compareTo(new BigDecimal(100-estimateTimeSetting.getProjectWarningPercent()))>0) {
                                 warningPercentProjects += first.get().getProjectName() + ",";
                                 warningPercentProjects += first.get().getProjectName() + ",";
                             }
                             }
+                            //检查分组工时
+                            Integer targetGpId = report.getGroupId();
+                            if (targetGpId != null) {
+                                double groupSum = 0;
+                                if(first.get().getManDayStartDate()!=null){
+                                    groupSum = needCheckReportList.stream().filter(npl -> npl.getGroupId().equals(targetGpId) &&(npl.getCreateDate().isAfter(first.get().getManDayStartDate())||npl.getCreateDate().isEqual(first.get().getManDayStartDate()))&& (npl.getState() == 0 || npl.getState() == 1)).mapToDouble(Report::getWorkingTime).sum();
+                                }else {
+                                    groupSum = needCheckReportList.stream().filter(npl -> npl.getGroupId().equals(targetGpId) && (npl.getState() == 0 || npl.getState() == 1)).mapToDouble(Report::getWorkingTime).sum();
+                                }
+                                System.out.println("groupSum:"+groupSum);
+                                nowReport = reportList.stream().filter(rl -> rl.getCreateDate().equals(report.getCreateDate()) && rl.getCreatorId().equals(report.getCreatorId()) && targetGpId.equals(rl.getGroupId())).mapToDouble(Report::getWorkingTime).sum();
+                                hasReport = new BigDecimal(groupSum).add(new BigDecimal(nowReport));
+                                TaskGroup tgp = taskGroupService.getById(targetGpId);
+                                //设置的数值大于0时检查是否超额
+                                if (tgp.getManDay() != null && tgp.getManDay() > 0) {
+                                    multiply = new BigDecimal(tgp.getManDay()).multiply(new BigDecimal(comTimeType.getAllday()));
+                                    System.out.println("hasReport:"+hasReport+" multiply:"+multiply);
+                                    if (hasReport.doubleValue() > multiply.doubleValue()) {
+                                        if (estimateTimeSetting.getGroupFronzeOnLack() == 1) {
+                                            httpRespMsg.setError("超过当前项目["+first.get().getProjectName()+"]分组["+tgp.getName()+"]预算工时,无法继续提交工时");
+                                            return httpRespMsg;
+                                        } else {
+                                            //仅提醒
+                                            warningGroupLack += (tgp.getTaskGroupCode() != null?tgp.getTaskGroupCode():"")+"-"+tgp.getName() + ",";
+                                        }
+                                    } else {
+                                        //检查是否超过预设的提醒百分比;设置的数值是剩余的百分比
+                                        if (hasReport.divide(multiply, 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).compareTo(new BigDecimal(100 - estimateTimeSetting.getGroupWarningPercent())) > 0) {
+                                            warningGroupPercent += (tgp.getTaskGroupCode() != null?tgp.getTaskGroupCode():"")+"-"+tgp.getName() + ",";
+                                        }
+                                    }
+                                }
+                            }
+
                         }
                         }
                     }
                     }
                 }
                 }
             }
             }
-
-
         }
         }
 
 
         //如果锁定工作时长上限的话,需要校验每日的合计工作时长
         //如果锁定工作时长上限的话,需要校验每日的合计工作时长
@@ -1562,6 +1598,20 @@ public class ReportController {
                 warningPercentProjects = warningPercentProjects.substring(0, warningPercentProjects.length() -1);
                 warningPercentProjects = warningPercentProjects.substring(0, warningPercentProjects.length() -1);
                 estimateWarningMsg += "提交成功,项目["+warningPercentProjects+"]预估工时剩余小于"+estimateTimeSetting.getProjectWarningPercent()+"%,请联系项目经理。";
                 estimateWarningMsg += "提交成功,项目["+warningPercentProjects+"]预估工时剩余小于"+estimateTimeSetting.getProjectWarningPercent()+"%,请联系项目经理。";
             }
             }
+            if (!StringUtils.isEmpty(warningGroupLack)) {
+                warningGroupLack = warningGroupLack.substring(0, warningGroupLack.length() -1);
+                if (estimateWarningMsg.length() > 0) {
+                    estimateWarningMsg += "<br/>";
+                }
+                estimateWarningMsg += "提交成功,项目分组["+warningGroupLack+"]预估工时不足,请联系项目经理。";
+            }
+            if (!StringUtils.isEmpty(warningGroupPercent)) {
+                warningGroupPercent = warningGroupPercent.substring(0, warningGroupPercent.length() -1);
+                if (estimateWarningMsg.length() > 0) {
+                    estimateWarningMsg += "<br/>";
+                }
+                estimateWarningMsg += "提交成功,项目分组["+warningGroupPercent+"]预估工时剩余小于"+estimateTimeSetting.getGroupWarningPercent()+"%,请联系项目经理。";
+            }
             if (!StringUtils.isEmpty(estimateWarningMsg)) {
             if (!StringUtils.isEmpty(estimateWarningMsg)) {
                 httpRespMsg.setMsg(estimateWarningMsg);
                 httpRespMsg.setMsg(estimateWarningMsg);
             }
             }

+ 38 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskGroupController.java

@@ -124,6 +124,43 @@ public class TaskGroupController {
         return msg;
         return msg;
     }
     }
 
 
+    @RequestMapping("saveManDay")
+    public HttpRespMsg saveManDay(String data) {
+        HttpRespMsg msg = new HttpRespMsg();
+        List<TaskGroup> groupList = JSON.parseArray(data, TaskGroup.class);
+        List<TaskGroup> addList = new ArrayList<>();
+        int totalManDay = 0;
+        for (TaskGroup taskGroup : groupList) {
+            TaskGroup item = new TaskGroup();
+            item.setId(taskGroup.getId());
+            if (taskGroup.getManDay() == null) {
+                item.setManDay(0);
+            } else {
+                item.setManDay(taskGroup.getManDay());
+                totalManDay += taskGroup.getManDay();
+            }
+            addList.add(item);
+        }
+        //校验,任务分组总预估工时不得超过项目预估工时
+        TaskGroup taskGroup = groupList.get(0);
+        Project project = projectMapper.selectById(taskGroup.getProjectId());
+        if (project.getManDay() == null || project.getManDay() == 0) {
+            msg.setError("请返回编辑项目,并设置项目预估工时");
+            return msg;
+        }
+        if (totalManDay > project.getManDay()) {
+            msg.setError("任务分组总预估工时不得超过项目预估工时");
+            return msg;
+        }
+        if (addList.size() > 0) {
+            taskGroupService.updateBatchById(addList);
+        }
+
+        msg.data = taskGroupService.list(new QueryWrapper<TaskGroup>().eq("project_id", groupList.get(0).getProjectId()));
+        return msg;
+    }
+
+
     @RequestMapping("/batchSaveTaskGroup")
     @RequestMapping("/batchSaveTaskGroup")
     public HttpRespMsg batchSaveTaskGroup(String projectIds,String taskGroupName){
     public HttpRespMsg batchSaveTaskGroup(String projectIds,String taskGroupName){
         HttpRespMsg msg=new HttpRespMsg();
         HttpRespMsg msg=new HttpRespMsg();
@@ -481,6 +518,7 @@ public class TaskGroupController {
         }
         }
         map.put("participators",participatorList);
         map.put("participators",participatorList);
         map.put("wbsCode",taskGroup.getWbsCode());
         map.put("wbsCode",taskGroup.getWbsCode());
+        map.put("manDay",taskGroup.getManDay());
         httpRespMsg.data=map;
         httpRespMsg.data=map;
         return httpRespMsg;
         return httpRespMsg;
     }
     }

+ 8 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TaskGroup.java

@@ -9,15 +9,13 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 import lombok.experimental.Accessors;
 
 
-import java.io.Serializable;
-
 /**
 /**
  * <p>
  * <p>
  * 
  * 
  * </p>
  * </p>
  *
  *
  * @author Seyason
  * @author Seyason
- * @since 2022-10-13
+ * @since 2023-11-21
  */
  */
 @Data
 @Data
 @EqualsAndHashCode(callSuper = false)
 @EqualsAndHashCode(callSuper = false)
@@ -60,6 +58,13 @@ public class TaskGroup extends Model<TaskGroup> {
     @TableField(exist = false)
     @TableField(exist = false)
     private String inchargerName;
     private String inchargerName;
 
 
+    /**
+     * 预估工时:人天
+     */
+    @TableField("man_day")
+    private Integer manDay;
+
+
     @Override
     @Override
     protected Serializable pkVal() {
     protected Serializable pkVal() {
         return this.id;
         return this.id;

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

@@ -264,4 +264,6 @@ public interface ProjectService extends IService<Project> {
     HttpRespMsg syncProjectWithSap(String startDate,String endDate);
     HttpRespMsg syncProjectWithSap(String startDate,String endDate);
 
 
     HttpRespMsg getEffectiveLaborHourRate(String startDate, String endDate);
     HttpRespMsg getEffectiveLaborHourRate(String startDate, String endDate);
+
+    HttpRespMsg getProjectFillTime(HttpServletRequest request, Integer projectId);
 }
 }

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

@@ -11359,6 +11359,19 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         return msg;
         return msg;
     }
     }
 
 
+    @Override
+    public HttpRespMsg getProjectFillTime(HttpServletRequest request, Integer projectId) {
+        //待审核和已通过的总工时
+        Report report = reportMapper.selectOne(new QueryWrapper<Report>().select("sum(working_time) as working_time").eq("project_id", projectId).and(i->i.eq("state", 0).or().eq("state", 1)));
+        Report waiting = reportMapper.selectOne(new QueryWrapper<Report>().select("sum(working_time) as working_time").eq("project_id", projectId).eq("state", 0));
+        HashMap map = new HashMap();
+        map.put("total",report.getWorkingTime());
+        map.put("waiting",waiting.getWorkingTime());
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.setData(map);
+        return msg;
+    }
+
 
 
 //    public void setDeptIdList(Integer departmentId,List<Integer> deptIds){
 //    public void setDeptIdList(Integer departmentId,List<Integer> deptIds){
 //        LambdaQueryWrapper<Department> lqw = new LambdaQueryWrapper<>();
 //        LambdaQueryWrapper<Department> lqw = new LambdaQueryWrapper<>();

+ 17 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -6952,6 +6952,23 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
             TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
             //获取日报详情
             //获取日报详情
             List<Report> reportList = reportMapper.selectList(new QueryWrapper<Report>().eq("creator_id", userId).between("create_date", startDate, endDate).orderByAsc("create_date"));
             List<Report> reportList = reportMapper.selectList(new QueryWrapper<Report>().eq("creator_id", userId).between("create_date", startDate, endDate).orderByAsc("create_date"));
+            //已填日报设置审核人姓名
+            if (reportList.size() > 0) {
+                List<String> collect = reportList.stream().map(Report::getProjectAuditorId).distinct().collect(Collectors.toList());
+                if (collect.size() > 0) {
+                    List<User> auditorUserList = userMapper.selectList(new QueryWrapper<User>().in("id", collect));
+                    reportList.forEach(r->{
+                        if (r.getProjectAuditorId() != null) {
+                            Optional<User> first = auditorUserList.stream().filter(au -> au.getId().equals(r.getProjectAuditorId())).findFirst();
+                            if (first.isPresent()) {
+                                r.setProjectAuditorName(first.get().getName());
+                            }
+                        }
+                    });
+                }
+            }
+
+
             List<Integer> collect = reportList.stream().map(Report::getProjectId).collect(Collectors.toList());
             List<Integer> collect = reportList.stream().map(Report::getProjectId).collect(Collectors.toList());
             //加载这段时间内已填报过的项目
             //加载这段时间内已填报过的项目
             List<Project> projectList = new ArrayList<>();
             List<Project> projectList = new ArrayList<>();

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TaskGroupMapper.xml

@@ -10,11 +10,12 @@
         <result column="name" property="name" />
         <result column="name" property="name" />
         <result column="incharger_id" property="inchargerId" />
         <result column="incharger_id" property="inchargerId" />
         <result column="wbs_code" property="wbsCode" />
         <result column="wbs_code" property="wbsCode" />
+        <result column="man_day" property="manDay" />
     </resultMap>
     </resultMap>
 
 
     <!-- 通用查询结果列 -->
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
     <sql id="Base_Column_List">
-        id, project_id, task_group_code, name, incharger_id, wbs_code
+        id, project_id, task_group_code, name, incharger_id, wbs_code, man_day
     </sql>
     </sql>
 
 
 </mapper>
 </mapper>

+ 27 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/project/info.vue

@@ -100,6 +100,12 @@
                             <el-col :span="18" ><span>{{project.projectSeparate.bu}}</span></el-col>
                             <el-col :span="18" ><span>{{project.projectSeparate.bu}}</span></el-col>
                         </el-row>
                         </el-row>
                     </div>
                     </div>
+                    <div v-if="user.timeType.projectManDay">
+                        <el-row :gutter="10" >
+                            <el-col :span="5" ><span class="gray_label">实际/预估工时:</span></el-col><el-col :span="7" ></el-col>
+                            <el-col :span="18" ><b :style="fillTimeData.total>project.manDay*user.timeType.allday?'color:red;':''">{{fillTimeData.total}}</b>/<b>{{project.manDay*user.timeType.allday}}</b>&nbsp;小时</el-col>
+                        </el-row>
+                    </div>
                     <!-- <div v-if="user.companyId == '428'">
                     <!-- <div v-if="user.companyId == '428'">
                         <el-row :gutter="10" >
                         <el-row :gutter="10" >
                             <el-col :span="5" ><span class="gray_label">{{ $t('projectgroup') }}:</span></el-col><el-col :span="7" ></el-col>
                             <el-col :span="5" ><span class="gray_label">{{ $t('projectgroup') }}:</span></el-col><el-col :span="7" ></el-col>
@@ -778,6 +784,7 @@
                 addFormVisible:false,
                 addFormVisible:false,
                 userDetail:{},
                 userDetail:{},
                 userDetailVisible: false,
                 userDetailVisible: false,
+                fillTimeData:{total:0, waiting: 0},
                 importanceList:[{id:1,label:this.$t('zheng-chang')},{id:2,label:this.$t('jin-ji')},{id:3,label:this.$t('zhong-yao')},{id:4,label:this.$t('zhong-yao-qie-jin-ji')}],
                 importanceList:[{id:1,label:this.$t('zheng-chang')},{id:2,label:this.$t('jin-ji')},{id:3,label:this.$t('zhong-yao')},{id:4,label:this.$t('zhong-yao-qie-jin-ji')}],
                 //1-一般,2-紧急,3-重要,4-重要且紧急
                 //1-一般,2-紧急,3-重要,4-重要且紧急
                 levelTxt:[this.$t('all'),this.$t('zheng-chang'),this.$t('jin-ji'),this.$t('zhong-yao'),this.$t('zhong-yao-qie-jin-ji')],
                 levelTxt:[this.$t('all'),this.$t('zheng-chang'),this.$t('jin-ji'),this.$t('zhong-yao'),this.$t('zhong-yao-qie-jin-ji')],
@@ -2043,6 +2050,25 @@
                     });
                     });
                 })
                 })
             },
             },
+            
+            getProjectFillTime() {
+                this.http.post('/project/getProjectFillTime', {projectId: this.curProjectId},
+                res => {
+                    if (res.code == "ok") {
+                        this.fillTimeData = res.data
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                })
+            },
             // 处理数据
             // 处理数据
             chulishuju(data) {
             chulishuju(data) {
                 let arrLists = JSON.parse(JSON.stringify(this.projectCustomList))
                 let arrLists = JSON.parse(JSON.stringify(this.projectCustomList))
@@ -2220,6 +2246,7 @@
             if(this.user.companyId == '936') {
             if(this.user.companyId == '936') {
                 this.getKeyNodes()
                 this.getKeyNodes()
             }
             }
+            this.getProjectFillTime();
 
 
             const usersJson = JSON.parse(sessionStorage.getItem("user"))
             const usersJson = JSON.parse(sessionStorage.getItem("user"))
             if(usersJson.companyId == '936') {
             if(usersJson.companyId == '936') {

+ 52 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -57,6 +57,9 @@
                                         <el-dropdown-item divided @click.native="renameGroup(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement || isManageDept)">
                                         <el-dropdown-item divided @click.native="renameGroup(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement || isManageDept)">
                                             <i class="el-icon-edit"></i>
                                             <i class="el-icon-edit"></i>
                                             {{ $t('changegroups') }}</el-dropdown-item>
                                             {{ $t('changegroups') }}</el-dropdown-item>
+                                        <el-dropdown-item divided @click.native="setManDay(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement || isManageDept)">
+                                            <i class="el-icon-time"></i>
+                                            预估工时</el-dropdown-item>
                                         <el-dropdown-item divided @click.native="addToTemplate(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement || isManageDept)">
                                         <el-dropdown-item divided @click.native="addToTemplate(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement || isManageDept)">
                                             <i class="el-icon-plus"></i>
                                             <i class="el-icon-plus"></i>
                                             {{ $t('settemplate') }}</el-dropdown-item>
                                             {{ $t('settemplate') }}</el-dropdown-item>
@@ -71,7 +74,6 @@
                                         <el-dropdown-item divided @click.native="deleteGroup(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement || isManageDept)">
                                         <el-dropdown-item divided @click.native="deleteGroup(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement || isManageDept)">
                                             <i class="el-icon-delete"></i>
                                             <i class="el-icon-delete"></i>
                                             {{ $t('deletethegroup') }} </el-dropdown-item>
                                             {{ $t('deletethegroup') }} </el-dropdown-item>
-                                            <!-- 设置参与人 0000 -->
                                         <el-dropdown-item divided @click.native="getGroupDetails(item)">
                                         <el-dropdown-item divided @click.native="getGroupDetails(item)">
                                             <i class="el-icon-tickets"></i>
                                             <i class="el-icon-tickets"></i>
                                             {{ $t('groupdetails') }} </el-dropdown-item>
                                             {{ $t('groupdetails') }} </el-dropdown-item>
@@ -93,7 +95,7 @@
                     <!-- 分组详情 -->
                     <!-- 分组详情 -->
                     <el-dialog :title="groupDetailTil" :visible.sync="groupDetailsShow" width="500px" :before-close="handleClose">
                     <el-dialog :title="groupDetailTil" :visible.sync="groupDetailsShow" width="500px" :before-close="handleClose">
                         <div>
                         <div>
-                            <el-form label-width="80px">
+                            <el-form label-width="90px">
                                 <el-form-item :label="$t('head') + ':'">
                                 <el-form-item :label="$t('head') + ':'">
                                     <span v-if="user.userNameNeedTranslate != '1'">{{groupDetailData.incharger}}</span>
                                     <span v-if="user.userNameNeedTranslate != '1'">{{groupDetailData.incharger}}</span>
                                     <span v-if="user.userNameNeedTranslate == '1'">
                                     <span v-if="user.userNameNeedTranslate == '1'">
@@ -111,9 +113,12 @@
                                         <span v-if="index < groupDetailData.participators.length - 1">、</span>
                                         <span v-if="index < groupDetailData.participators.length - 1">、</span>
                                     </span>
                                     </span>
                                 </el-form-item>
                                 </el-form-item>
-                                <el-form-item label="wbsCode" v-if="user.companyId == 936">
+                                <el-form-item label="wbsCode" v-if="user.companyId == 936">
                                     <span>{{groupDetailData.wbsCode}}</span>
                                     <span>{{groupDetailData.wbsCode}}</span>
                                 </el-form-item>
                                 </el-form-item>
+                                <el-form-item label="预估工时:" v-if="user.timeType.projectManDay">
+                                    <span>{{groupDetailData.manDay}}人天 ({{ (groupDetailData.manDay==null?0:groupDetailData.manDay)*user.timeType.allday }}小时)</span>
+                                </el-form-item>
                             </el-form>
                             </el-form>
                         </div>
                         </div>
                         <span slot="footer" class="dialog-footer">
                         <span slot="footer" class="dialog-footer">
@@ -1133,6 +1138,22 @@
                 <el-button type="primary" @click="addGroup('form2')" style="width:100%;" >{{ $t('save') }}</el-button>
                 <el-button type="primary" @click="addGroup('form2')" style="width:100%;" >{{ $t('save') }}</el-button>
             </div>
             </div>
         </el-dialog>
         </el-dialog>
+        
+        <el-dialog title="设置分组预估工时" v-if="modGroupManDayDialog" :visible.sync="modGroupManDayDialog" :close-on-click-modal="false" customClass="customWidth" width="450px">
+            <el-table :data="groupList" size="small" :key="Math.random()" :height="'400px'" show-summary="true">
+                <el-table-column prop="name" label="分组名称">
+                </el-table-column>
+                <el-table-column prop="manDay" width="200" label="预估工时" >
+                    <template slot-scope="scope">
+                        <el-input v-model="scope.row.manDay" type="number"  :placeholder="$t('peaseenterthe')" maxlength="10" :max="99999" style="width:120px;"></el-input>&nbsp;人天
+                    </template>
+                </el-table-column>
+            </el-table>
+            <p style="text-align:center;">当前项目预估工时为:{{ currentProject.manDay == null? 0:currentProject.manDay }}人天</p>
+            <div slot="footer" class="dialog-footer">
+                <el-button type="primary" @click="setManDayData()" style="width:100%;" >{{ $t('save') }}</el-button>
+            </div>
+        </el-dialog>
         <el-dialog :title="$t('addtemplate')" v-if="addToTmpDialog" :visible.sync="addToTmpDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
         <el-dialog :title="$t('addtemplate')" v-if="addToTmpDialog" :visible.sync="addToTmpDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
             <el-form ref="formTmp" :model="templateForm" :rules="rules" style="margin-top:10px;">
             <el-form ref="formTmp" :model="templateForm" :rules="rules" style="margin-top:10px;">
                     <el-form-item prop="name">
                     <el-form-item prop="name">
@@ -1257,6 +1278,7 @@
         
         
         data() {
         data() {
             return {
             return {
+                modGroupManDayDialog: false,
                 isManageDept: false,
                 isManageDept: false,
                 componentFlg: false,
                 componentFlg: false,
                 mileageCup: false,
                 mileageCup: false,
@@ -1336,6 +1358,9 @@
                 rules: {
                 rules: {
                     name: [{ required: true, message: this.$t('pleaseenteragroupname'), trigger: "blur" }],
                     name: [{ required: true, message: this.$t('pleaseenteragroupname'), trigger: "blur" }],
                 },
                 },
+                rulesManDay: {
+                    manDay: [{ required: true, message: '请输入预估工时', trigger: "blur" }],
+                },
                 rules2: {
                 rules2: {
                     stagesName: [{ required: true, message: this.$t('pleaseenteratasklistname'), trigger: "blur" }],
                     stagesName: [{ required: true, message: this.$t('pleaseenteratasklistname'), trigger: "blur" }],
                 },
                 },
@@ -3038,6 +3063,10 @@
                 this.groupForm = JSON.parse(JSON.stringify(item));
                 this.groupForm = JSON.parse(JSON.stringify(item));
                 this.setInchargerDialog = true;
                 this.setInchargerDialog = true;
             },
             },
+            setManDay(item) {
+                this.groupForm = JSON.parse(JSON.stringify(item));
+                this.modGroupManDayDialog = true;
+            },
             renameGroup(item) {
             renameGroup(item) {
                 this.groupForm = JSON.parse(JSON.stringify(item));
                 this.groupForm = JSON.parse(JSON.stringify(item));
                 this.modGroupDialog = true;
                 this.modGroupDialog = true;
@@ -3181,7 +3210,26 @@
                     });
                     });
                 });
                 });
             },
             },
-
+            setManDayData() {
+                this.http.post('/task-group/saveManDay',{data:JSON.stringify(this.groupList)},
+                        res => {
+                            if (res.code == "ok") {
+                                this.modGroupManDayDialog = false;
+                                this.groupList = res.data;
+                            } else {
+                                this.$message({
+                                message: res.msg,
+                                type: "error"
+                                });
+                            }
+                        },
+                        error => {
+                            this.$message({
+                                message: error,
+                                type: "error"
+                            });
+                        });
+            },
             // 重新定义了 addGroup 方法
             // 重新定义了 addGroup 方法
              addGroup(formName) {
              addGroup(formName) {
                 // return
                 // return

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

@@ -7213,13 +7213,16 @@
                             if (res.code == "ok") {
                             if (res.code == "ok") {
                                 if(res.msg!=null){
                                 if(res.msg!=null){
                                     this.$message({
                                     this.$message({
-                                    message: res.msg,
-                                    type: "success"
+                                        dangerouslyUseHTMLString: true,
+                                        message: res.msg,
+                                        type: "warning",
+                                        showClose: true,
+                                        duration: 0
                                     });
                                     });
                                 }else{
                                 }else{
                                     this.$message({
                                     this.$message({
-                                    message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
-                                    type: "success"
+                                        message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
+                                        type: "success"
                                     });
                                     });
                                 }
                                 }
                                 this.dialogVisible = false;
                                 this.dialogVisible = false;