Selaa lähdekoodia

定制开发:昱众按照工作职责方式填报

seyason 1 vuosi sitten
vanhempi
commit
e8b8322e84

+ 34 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -322,7 +322,10 @@ public class ReportController {
                                   String[] customText,
                                   Integer[] basecostId, //成本基线项的id
                                   String[] auditorSettingArray,
-                                  String[] picStr //图片的文件名,不含后缀的,多个用@分隔,如:["3UlRmLbTnqLPM0-xjja2dS2VAg5OFERPUZz0HRqjb8BXLq8ewaFH6NmlFm1pnVza0"@"338EniZDtXtKGSnavdgvebGGyRgoieGv2aobIq6k5jboa_DsZNIvLmzHjW69kDG6x"]
+                                  String[] picStr, //图片的文件名,不含后缀的,多个用@分隔,如:["3UlRmLbTnqLPM0-xjja2dS2VAg5OFERPUZz0HRqjb8BXLq8ewaFH6NmlFm1pnVza0"@"338EniZDtXtKGSnavdgvebGGyRgoieGv2aobIq6k5jboa_DsZNIvLmzHjW69kDG6x"]
+                                  Integer[] extraField1,
+                                  Integer[] extraField2,
+                                  Integer[] extraField3
                                     ) {
         List<Report> reportList = new ArrayList<>();
         String token = request.getHeader("Token");
@@ -418,6 +421,24 @@ public class ReportController {
                 basecostId[i] = 0;
             }
         }
+        if (extraField1 == null) {
+            extraField1 = new Integer[projectId.length];
+            for(int i=0;i<extraField1.length; i++) {
+                extraField1[i] = null;
+            }
+        }
+        if (extraField2 == null) {
+            extraField2 = new Integer[projectId.length];
+            for(int i=0;i<extraField2.length; i++) {
+                extraField2[i] = null;
+            }
+        }
+        if (extraField3 == null) {
+            extraField3 = new Integer[projectId.length];
+            for(int i=0;i<extraField3.length; i++) {
+                extraField3[i] = null;
+            }
+        }
         if (company.getPackageProject() == 1) {
             //检查是否设置了预算的工时预警
             ProjectBasecostSetting alarmSetting = projectBasecostSettingMapper.selectOne(new QueryWrapper<ProjectBasecostSetting>()
@@ -721,6 +742,9 @@ public class ReportController {
                             report.setTaskFinish(taskFinish[i]);
                             report.setCustomText(customText[i]);
                             report.setBasecostId(basecostId[i]);
+                            report.setExtraField1(extraField1[i]);
+                            report.setExtraField2(extraField2[i]);
+                            report.setExtraField3(extraField3[i]);
                             //如果是员工自由选择审批流程的方式,需要处理一下
                             if (comTimeType.getReportAuditType() == 3) {
                                 report.setAuditorSetting(auditorSettingList.get(i));
@@ -783,6 +807,9 @@ public class ReportController {
                                 report.setTaskFinish(taskFinish[i]);
                                 report.setCustomText(customText[i]);
                                 report.setBasecostId(basecostId[i]);
+                                report.setExtraField1(extraField1[i]);
+                                report.setExtraField2(extraField2[i]);
+                                report.setExtraField3(extraField3[i]);
                                 //如果是员工自由选择审批流程的方式,需要处理一下
                                 if (comTimeType.getReportAuditType() == 3) {
                                     report.setAuditorSetting(auditorSettingList.get(i));
@@ -847,6 +874,9 @@ public class ReportController {
                         report.setTaskFinish(taskFinish[i]);
                         report.setCustomText(customText[i]);
                         report.setBasecostId(basecostId[i]);
+                        report.setExtraField1(extraField1[i]);
+                        report.setExtraField2(extraField2[i]);
+                        report.setExtraField3(extraField3[i]);
                         //如果是员工自由选择审批流程的方式,需要处理一下
                         if (comTimeType.getReportAuditType() == 3) {
                             report.setAuditorSetting(auditorSettingList.get(i));
@@ -916,6 +946,9 @@ public class ReportController {
                             report.setTaskFinish(taskFinish[i]);
                             report.setCustomText(customText[i]);
                             report.setBasecostId(basecostId[i]);
+                            report.setExtraField1(extraField1[i]);
+                            report.setExtraField2(extraField2[i]);
+                            report.setExtraField3(extraField3[i]);
                             //如果是员工自由选择审批流程的方式,需要处理一下
                             if (comTimeType.getReportAuditType() == 3) {
                                 report.setAuditorSetting(auditorSettingList.get(i));

+ 28 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Report.java

@@ -20,7 +20,7 @@ import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * <p>
- * 
+ *
  * </p>
  *
  * @author Seyason
@@ -370,6 +370,33 @@ public class Report extends Model<Report> {
     private Integer batchId;
 
 
+    /**
+     * 昱众-角色类型:0-PM,1-CRC
+     */
+    @TableField("extra_field1")
+    private Integer extraField1;
+
+    /**
+     * 昱众-工作职责
+     */
+    @TableField("extra_field2")
+    private Integer extraField2;
+
+    /**
+     * 昱众-工作内容
+     */
+    @TableField("extra_field3")
+    private Integer extraField3;
+
+    @TableField(exist = false)
+    private List<ProFunWorkContext> workContentList;
+
+    @TableField(exist = false)
+    private Integer extraField2Name;
+
+    @TableField(exist = false)
+    private Integer extraField3Name;
+
     @Override
     protected Serializable pkVal() {
         return this.id;

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

@@ -2,6 +2,7 @@ package com.management.platform.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.management.platform.entity.Project;
+import com.management.platform.entity.TaskGroup;
 import com.management.platform.entity.vo.CustomerProject;
 import com.management.platform.entity.vo.ProjectWithStage;
 import com.management.platform.entity.vo.StageCost;
@@ -121,13 +122,15 @@ public interface ProjectMapper extends BaseMapper<Project> {
 
     List<Map<String, Object>> getCostByGroup(String startDate, String endDate, Integer projectId);
 
-    List<Map<String, Object>> selectWithGroup(Integer companyId, String startDate, String endDate, Integer startIndex, Integer endIndex, Integer projectId, List<Integer> inchagerIds, Integer groupId);
+    List<Map<String, Object>> selectWithGroup(Integer companyId, String startDate, String endDate, Integer startIndex, Integer endIndex, Integer projectId, List<Integer> inchagerIds, Integer groupId, List<Integer> taskGroupIds);
 
-    long selectCountWithGroup(Integer companyId, String startDate, String endDate, Integer startIndex, Integer endIndex, Integer projectId, List<Integer> inchagerIds, Integer groupId);
+    long selectCountWithGroup(Integer companyId, String startDate, String endDate, Integer startIndex, Integer endIndex, Integer projectId, List<Integer> inchagerIds, Integer groupId, List<Integer> taskGroupIds);
 
-    List<Map<String, Object>> selectWithGroupProject(Integer companyId, String startDate, String endDate,  Integer startIndex, Integer endIndex, Integer projectId,String projectCategorySub, List<Integer> inchagerIds, Integer groupId);
+    List<Map<String, Object>> selectWithGroupProject(Integer companyId, String startDate, String endDate, Integer startIndex, Integer endIndex,
+                                                     Integer projectId, String projectCategorySub, List<Integer> inchagerIds, Integer groupId, List<Integer> taskGroupIds);
 
-    long selectCountWithGroupProject(Integer companyId, String startDate, String endDate, Integer startIndex, Integer endIndex, Integer projectId,String projectCategorySub,List<Integer> inchagerIds, Integer groupId);
+    long selectCountWithGroupProject(Integer companyId, String startDate, String endDate, Integer startIndex, Integer endIndex, Integer projectId,
+                                     String projectCategorySub,List<Integer> inchagerIds, Integer groupId, List<Integer> taskGroupIds);
 
     List<Map<String, Object>> getCostByUserCustom(String startDate, String endDate, Integer companyId, List<Integer> deptIds, Integer customId, String subCustomName,String fieldName);
 

+ 14 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -8251,6 +8251,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<SysRichFunction> functionInchargeList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责项目任务分组工时");
         //判断查看权限
         List<Integer> inchagerIds=null;
+        List<Integer> groupIds = null;
         if(functionAllList.size()==0){
             inchagerIds=new ArrayList<>();
             if(functionInchargeList.size()>0){
@@ -8261,6 +8262,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 } else {
                     inchagerIds.add(-1);
                 }
+                //看看有没有负责的任务分组
+                List<TaskGroup> groupInchargerList = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().eq("incharger_id", user.getId()));
+                groupIds = groupInchargerList.stream().map(gi -> gi.getId()).collect(Collectors.toList());
             }else {
                 inchagerIds.add(-1);
             }
@@ -8270,11 +8274,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         if(pageIndex!=null&&pageSize!=null){
             Integer startIndex = (pageIndex-1)*pageSize;
             Integer endIndex = pageSize*pageIndex;
-            record = projectMapper.selectWithGroup(companyId,startDate,endDate, startIndex, endIndex, projectId,inchagerIds,groupId);
+            record = projectMapper.selectWithGroup(companyId,startDate,endDate, startIndex, endIndex, projectId,inchagerIds,groupId,groupIds);
         }else {
-            record=projectMapper.selectWithGroup(companyId,startDate,endDate, null, null, projectId,inchagerIds,groupId);
+            record=projectMapper.selectWithGroup(companyId,startDate,endDate, null, null, projectId,inchagerIds,groupId,groupIds);
         }
-        total =projectMapper.selectCountWithGroup(companyId,startDate,endDate, null, null, projectId,inchagerIds,groupId);
+        total =projectMapper.selectCountWithGroup(companyId,startDate,endDate, null, null, projectId,inchagerIds,groupId,groupIds);
         HashMap<String, Object> map = new HashMap<>();
         map.put("records", record);
         map.put("total", total);
@@ -8293,6 +8297,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<SysRichFunction> functionInchargeList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责项目任务分组工时");
         //判断查看权限
         List<Integer> inchagerIds=null;
+        List<Integer> groupIds = null;
         if(functionAllList.size()==0){
             inchagerIds=new ArrayList<>();
             if(functionInchargeList.size()>0){
@@ -8303,6 +8308,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 } else {
                     inchagerIds.add(-1);
                 }
+                //看看有没有负责的任务分组
+                List<TaskGroup> groupInchargerList = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().eq("incharger_id", user.getId()));
+                groupIds = groupInchargerList.stream().map(gi -> gi.getId()).collect(Collectors.toList());
             }else {
                 inchagerIds.add(-1);
             }
@@ -8325,11 +8333,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         if(pageIndex!=null&&pageSize!=null){
             Integer startIndex = (pageIndex-1)*pageSize;
             Integer endIndex = pageSize*pageIndex;
-            record = projectMapper.selectWithGroupProject(companyId,startDate,endDate, startIndex, endIndex, projectId,projectCategorySub,inchagerIds,groupId);
+            record = projectMapper.selectWithGroupProject(companyId,startDate,endDate, startIndex, endIndex, projectId,projectCategorySub,inchagerIds,groupId, groupIds);
         }else {
-            record=projectMapper.selectWithGroupProject(companyId,startDate,endDate, null, null, projectId,projectCategorySub,inchagerIds,groupId);
+            record=projectMapper.selectWithGroupProject(companyId,startDate,endDate, null, null, projectId,projectCategorySub,inchagerIds,groupId, groupIds);
         }
-        total =projectMapper.selectCountWithGroupProject(companyId,startDate,endDate, null, null, projectId,projectCategorySub,inchagerIds,groupId);
+        total =projectMapper.selectCountWithGroupProject(companyId,startDate,endDate, null, null, projectId,projectCategorySub,inchagerIds,groupId, groupIds);
         HashMap<String, Object> map = new HashMap<>();
         map.put("records", record);
         map.put("total", total);

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

@@ -43,6 +43,7 @@ import javax.annotation.Resource;
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
 import javax.servlet.http.HttpServletRequest;
+import javax.swing.text.html.Option;
 import java.io.*;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -98,6 +99,10 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     @Resource
     private DepartmentService departmentService;
     @Resource
+    private ProjectFunctionalDivisionMapper projectFunctionalDivisionMapper;
+    @Resource
+    private ProFunWorkContextMapper proFunWorkContextMapper;
+    @Resource
     private ReportLogDetailMapper reportLogDetailMapper;
     @Resource
     private ReportBatchMapper reportBatchMapper;
@@ -524,6 +529,28 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     }
                 }
             }
+            //针对昱众,设置职能分工显示
+            if (user.getCompanyId() == 3385) {
+                List<ProjectFunctionalDivision> allDivList = projectFunctionalDivisionMapper.selectList(new QueryWrapper<ProjectFunctionalDivision>().eq("company_id", user.getCompanyId()));
+                List<ProFunWorkContext> allWorkContextList = proFunWorkContextMapper.selectList(new QueryWrapper<>());
+                for (Map map : nameList) {
+                    List<Map<String, Object>> reportList = (List<Map<String, Object>>)map.get("data");
+                    for (Map<String, Object> report : reportList) {
+                        Integer extraField2 = (Integer)report.get("extraField2");
+                        Optional<ProjectFunctionalDivision> first = allDivList.stream().filter(d->d.getId().equals(extraField2)).findFirst();
+                        if (first.isPresent()) {
+                            ProjectFunctionalDivision divItem = first.get();
+                            report.put("extraField2Name", divItem.getJobRespon());
+                        }
+                        Integer extraField3 = (Integer)report.get("extraField3");
+                        Optional<ProFunWorkContext> first2 = allWorkContextList.stream().filter(d->d.getId().equals(extraField3)).findFirst();
+                        if (first2.isPresent()) {
+                            ProFunWorkContext workItem = first2.get();
+                            report.put("extraField3Name", workItem.getWorkContext());
+                        }
+                    }
+                }
+            }
             httpRespMsg.data = nameList;
         } catch (NullPointerException e) {
             e.printStackTrace();
@@ -573,6 +600,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             List<ReportExtraDegree> degreeList = reportExtraDegreeMapper.selectList(new QueryWrapper<ReportExtraDegree>().eq("company_id", companyId));
             List<TaskGroup> taskGroups = integerList.size() > 0?taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().in("project_id", integerList)):new ArrayList<>();
             List<Stages> stagesList = integerList.size() > 0?stagesMapper.selectList(new QueryWrapper<Stages>().in("project_id", integerList)) : new ArrayList<>();
+
             //获取当前项目的子项目列表,任务分组,任务列表,项目相关维度列表
             reports.forEach(r->{
                 r.setSubProjectList(subProjectList.stream().filter(s->s.getProjectId().equals(r.getProjectId())).collect(Collectors.toList()));
@@ -717,7 +745,12 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         r.setCcUserid(auditorItem);
                     }
                 }
-
+                //昱众要返回工作内容下拉选项
+                if (companyId == 3385) {
+                    HttpRespMsg funWorkContextList = projectService.getFunWorkContextList(r.getExtraField2());
+                    List<ProFunWorkContext> workContentList = ((List<ProFunWorkContext>)funWorkContextList.data);
+                    r.setWorkContentList(workContentList);
+                }
             });
             resultMap.put("report", reports);
             TimeType timeType = timeTypeMapper.selectById(companyId);
@@ -1371,6 +1404,28 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     }
                 }
             }
+            //针对昱众,设置职能分工显示
+            if (companyId == 3385) {
+                List<ProjectFunctionalDivision> allDivList = projectFunctionalDivisionMapper.selectList(new QueryWrapper<ProjectFunctionalDivision>().eq("company_id", companyId));
+                List<ProFunWorkContext> allWorkContextList = proFunWorkContextMapper.selectList(new QueryWrapper<>());
+                for (Map map : nameList) {
+                    List<Map<String, Object>> reportList = (List<Map<String, Object>>)map.get("data");
+                    for (Map<String, Object> report : reportList) {
+                        Integer extraField2 = (Integer)report.get("extraField2");
+                        Optional<ProjectFunctionalDivision> first = allDivList.stream().filter(d->d.getId().equals(extraField2)).findFirst();
+                        if (first.isPresent()) {
+                            ProjectFunctionalDivision divItem = first.get();
+                            report.put("extraField2Name", divItem.getJobRespon());
+                        }
+                        Integer extraField3 = (Integer)report.get("extraField3");
+                        Optional<ProFunWorkContext> first2 = allWorkContextList.stream().filter(d->d.getId().equals(extraField3)).findFirst();
+                        if (first2.isPresent()) {
+                            ProFunWorkContext workItem = first2.get();
+                            report.put("extraField3Name", workItem.getWorkContext());
+                        }
+                    }
+                }
+            }
             DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
             //设置每人每日考勤打卡时长
             if (timeType.getShowCorpwxCardtime() == 1) {

+ 38 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -132,7 +132,7 @@
         ORDER BY is_public DESC, id DESC
     </select>
     <select id="getOnlyJoinProjects" resultType="java.util.Map">
-        SELECT id, project_code AS projectCode, project_name AS projectName, status, task_gp_incharge as taskGpIncharge, project_desc as projectDesc
+        SELECT id, project_code AS projectCode, project_name AS projectName, status, task_gp_incharge as taskGpIncharge, project_desc as projectDesc, is_public as isPublic
         FROM project
         WHERE status = 1 and (id IN (
             SELECT project_id
@@ -1202,10 +1202,18 @@
             and c.id=#{projectId}
         </if>
         <if test="inchagerIds!=null and inchagerIds.size()>0">
-            and c.id in
+            and (c.id in
             <foreach collection="inchagerIds" open="(" separator="," close=")" item="item">
                 #{item}
             </foreach>
+            <!--或者按分组负责人的匹配-->
+            <if test="taskGroupIds!=null and taskGroupIds.size() > 0">
+                or a.group_id in
+                <foreach collection="taskGroupIds" close=")" item="item" open="(" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            )
         </if>
         <if test="groupId!=null">
             and a.group_id=#{groupId}
@@ -1230,10 +1238,18 @@
             and c.id=#{projectId}
         </if>
         <if test="inchagerIds!=null and inchagerIds.size()>0">
-            and c.id in
+            and (c.id in
             <foreach collection="inchagerIds" open="(" separator="," close=")" item="item">
                 #{item}
             </foreach>
+            <!--或者按分组负责人的匹配-->
+            <if test="taskGroupIds!=null and taskGroupIds.size() > 0">
+                or a.group_id in
+                <foreach collection="taskGroupIds" close=")" item="item" open="(" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            )
         </if>
         <if test="groupId!=null">
             and a.group_id=#{groupId}
@@ -1264,11 +1280,20 @@
             and ps.project_category_sub=#{projectCategorySub}
         </if>
         <if test="inchagerIds!=null and inchagerIds.size()>0">
-            and c.id in
+            and (c.id in
             <foreach collection="inchagerIds" open="(" separator="," close=")" item="item">
                 #{item}
             </foreach>
+            <!--或者按分组负责人的匹配-->
+            <if test="taskGroupIds!=null and taskGroupIds.size() > 0">
+                or a.group_id in
+                <foreach collection="taskGroupIds" close=")" item="item" open="(" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            )
         </if>
+
         <if test="groupId!=null">
             and a.group_id=#{groupId}
         </if>
@@ -1299,10 +1324,18 @@
             and ps.project_category_sub=#{projectCategorySub}
         </if>
         <if test="inchagerIds!=null and inchagerIds.size()>0">
-            and c.id in
+            and (c.id in
             <foreach collection="inchagerIds" open="(" separator="," close=")" item="item">
                 #{item}
             </foreach>
+            <!--或者按分组负责人的匹配-->
+            <if test="taskGroupIds!=null and taskGroupIds.size() > 0">
+                or a.group_id in
+                <foreach collection="taskGroupIds" close=")" item="item" open="(" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            )
         </if>
         <if test="groupId!=null">
             and a.group_id=#{groupId}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 22 - 40
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml


+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -92,7 +92,7 @@
                             <el-dropdown-item v-if="user.timeType.syncFanwei==1">
                                 <el-link type="primary" :underline="false" @click="syncProjectForFanWei()">{{'同步项目信息'}}</el-link>
                             </el-dropdown-item>
-                            <el-dropdown-item v-if="permissions.projectClassification">
+                            <el-dropdown-item v-if="user.companyId==3385 && permissions.projectClassification">
                                 <el-link type="primary" :underline="false" @click="functionalDivisionDig=true,getFunctionalList()">{{'职能分工设置'}}</el-link>
                             </el-dropdown-item>
                         </el-dropdown-menu>

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

@@ -134,10 +134,10 @@
                                 </span>
                                 <span style="float:right;">
                                     <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
-                                    <el-link v-if="reportTimeType.type != 0" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
+                                    <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
                                     <el-link type="primary" v-if="permissions.reportsFillOut" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
                                     <el-link type="primary" v-if="permissions.reportBatch" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
-                                    <el-link type="primary" v-if="permissions.importReport || user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
+                                    <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
                                     <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
                                     <!--部门负责人给个导出工时的功能 -->
                                     <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
@@ -258,6 +258,10 @@
                                                         <el-button v-if="user.id == item1.id && (item2.state == 0 || item2.state == -1)" type="normal" :loading="logining" size="small" @click="cancel(item1)">{{$t('btn.withdraw')}}</el-button>
                                                     </span>
                                                     </p>
+                                                    <p v-if="user.companyId == yuzhongCompId">
+                                                        <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
+                                                    <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
+                                                    <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
                                                     <!--任务分组和阶段 -->
                                                     <p v-if="item2.groupId != 0">{{$t('other.taskGroup')}}:{{item2.groupName}} <span v-if="item2.stage != null && item2.stage != '-'" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span></p>
                                                     <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
@@ -448,16 +452,29 @@
                                     </el-option>
                                 </el-option-group>
                             </el-select>
-                            <template v-if="user.timeType.mainProjectState != 1">
-                            <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
-                                style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
-
-                            <!--子项目 -->
-                            <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
-                                v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
-                            :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
-                                <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
-                            </el-select>
+                            <!--昱众不显示子项目-->
+                            <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId">
+                            <span style="margin-left:45px;">
+                               {{$t('lable.subproject')}}</span>
+                                <!--子项目 -->
+                                <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
+                                    v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
+                                :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
+                                    <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                                </el-select>
+                            </template>
+                            <template v-if="user.companyId == yuzhongCompId">
+                                <span style="margin-left:45px;">角色选择</span>
+                                <!--角色选择 -->
+                                <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
+                                :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
+                                    <el-option
+                                        v-for="item in roleList"
+                                        :key="item.value"
+                                        :label="item.label"
+                                        :value="item.value">
+                                    </el-option>
+                                </el-select>
                             </template>
                             
                             <el-link v-if="(index >= 1 || workForm.domains.length > 1)&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:15%;"
@@ -483,14 +500,29 @@
                             :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
                                 <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
                             </el-select>
-                            <!-- 项目的阶段 -->
-                            <span v-if="domain.stages != null && domain.stages.length> 0" >{{$t('other.inputStage')}}</span>
-                            <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;" 
-                            clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
-                            @change="changeStages(domain, index)"
-                            :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
-                                <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
-                            </el-select>
+                            <template v-if="user.companyId == yuzhongCompId">
+                                <span style="margin-left:45px;">工作职责</span>
+                                <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
+                                :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
+                                    <el-option
+                                        v-for="item in domain.filteredRespList"
+                                        :key="item.id"
+                                        :label="item.jobRespon"
+                                        :value="item.id">
+                                    </el-option>
+                                </el-select>
+                            </template>
+                            <template v-else><!-- 项目的阶段 -->
+                                <span v-if="domain.stages != null && domain.stages.length> 0" >{{$t('other.inputStage')}}</span>
+                                <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;" 
+                                clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
+                                @change="changeStages(domain, index)"
+                                :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
+                                    <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
+                                </el-select>
+
+                            </template>
+
                         </el-form-item>
                         <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
                             <el-form-item :label="user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')" v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
@@ -506,6 +538,17 @@
 
                             </el-form-item>
                         </div>
+                        <el-form-item label="工作内容" v-if="user.companyId == yuzhongCompId">
+                            <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择"
+                            :disabled="(workForm.domains[index].state>=2?false:true)" >
+                                <el-option
+                                    v-for="item in domain.workContentList"
+                                    :key="item.id"
+                                    :label="item.workContext"
+                                    :value="item.id">
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
                         <!-- 111111 -->
                         <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
                             <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
@@ -1850,6 +1893,9 @@
         },
         data() {
             return {
+                roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
+                jobResponseList:[],
+                yuzhongCompId: 3385,
                 mingyiName : '成都明夷电子科技有限公司',
                 // mingyiName : '明夷',
                 modItemDataId: null,
@@ -2195,6 +2241,9 @@
                     that.dataLoading = that.$store.state.dataLoading
                 }, 1000)
             }
+            if (this.user.companyId == this.yuzhongCompId) {
+                this.getJobResponList();
+            }
         },
         methods: {
             ...mapMutations(['upDataLoading']),
@@ -2215,6 +2264,60 @@
                         d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
                     });
                 }
+            },
+            //更新工作内容列表  
+            updateJobContent(domainItem) {
+                var that = this;
+                this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
+                        if (res.code == "ok") {
+                            // domainItem.workContentList = res.data;
+                            that.$set(domainItem, 'extraField3', null);
+                            that.$set(domainItem, 'workContentList', res.data);
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                        }
+                    );
+            },
+            updateResponse(domainItem) {
+                var that = this;
+                var selectPid = domainItem.projectId;
+                domainItem.extraField2 = null;
+                domainItem.extraField3 = null;
+                if (selectPid && domainItem.extraField1) {
+                    //是否非项目
+                    var isPublic = this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
+                    console.log('==========','isPublic=='+isPublic);
+                    var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
+                    domainItem.filteredRespList = filteredRespList;
+                }
+                
+            },
+            getJobResponList() {
+                this.http.post('/project/getFunctionalDivisionList',{},res => {
+                        if (res.code == "ok") {
+                            this.jobResponseList = res.data;
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                        }
+                    );
             },  
             openModImportTime(row) {
                 this.showModImportTimeDialog = true;
@@ -2399,6 +2502,8 @@
                             label: '全部项目',
                             peojectList: this.fillProjectList
                         }
+                        //最近项目如果在fillProjectList中不存在,需要移除
+                        topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
                         this.integrationProjectList = [topObj, botomObj]
                         console.log(this.integrationProjectList, '整合')
                     }else {
@@ -4018,6 +4123,10 @@
                     console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
                     domain.workingTime = (this.reportTimeType.allday * domain.progress/100);
                 }
+                //加载昱众的工作职责
+                if (this.user.companyId == this.yuzhongCompId) {
+                   this.updateResponse(domain);
+                }
             },
 
             //获取项目审核人
@@ -5175,6 +5284,12 @@
                             for(var i in list.report) {
                                 var flg = null
                                 list.report[i].isOvertime == 1 ? flg = true : flg = false
+                                var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
+                                var filteredRespList = null
+                                if (targetP.length > 0) {
+                                    var isPublic = targetP[0].isPublic;
+                                    filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
+                                }
                                 arr.push({
                                     id: list.report[i].id,
                                     projectId: list.report[i].projectId,
@@ -5209,13 +5324,16 @@
                                     overtimeHours: list.report[i].overtimeHours,
                                     customText: list.report[i].customText,
                                     basecostId: list.report[i].basecostId,
-
-                                        auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
-                                        auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
-                                        auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
-                                        ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
-
-                                    canEdit: list.report[i].state >= 2 ? true : false
+                                    auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
+                                    auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
+                                    auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
+                                    ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
+                                    canEdit: list.report[i].state >= 2 ? true : false,
+                                    extraField1: list.report[i].extraField1,
+                                    extraField2: list.report[i].extraField2,
+                                    extraField3: list.report[i].extraField3,
+                                    workContentList: list.report[i].workContentList,
+                                    filteredRespList: filteredRespList
                                 })
                                 if (list.report[i].state >= 2) {
                                     this.canEdit = true;
@@ -5263,12 +5381,10 @@
                                     multiWorktime: this.reportTimeType.multiWorktime,
                                     worktimeList:[{}],
                                     canEdit: true,
-
-                                        auditorFirst: '',
-                                        auditorSec: '',
-                                        auditorThird: '',
-                                        ccUserid: ''
-                                    
+                                    auditorFirst: '',
+                                    auditorSec: '',
+                                    auditorThird: '',
+                                    ccUserid: ''
                                 }],
                                 userId:null,
                                 userNames:null,
@@ -6669,6 +6785,37 @@
                             }
                         }
 
+                        //昱众需要检查新增的角色,工作职责,工作内容是否填写
+                        if (this.user.companyId == this.yuzhongCompId) {
+                            for(var p in this.workForm.domains) {
+                                var oneProItem = this.workForm.domains[p]
+                                if (!oneProItem.extraField1) {
+                                    //没有选择子项目
+                                    this.$message({
+                                        message: '角色必填,请检查',
+                                        type: "error"
+                                    });
+                                    return
+                                }
+                                if (!oneProItem.extraField2) {
+                                    //没有选择子项目
+                                    this.$message({
+                                        message: '工作职责必填,请检查',
+                                        type: "error"
+                                    });
+                                    return
+                                }
+                                if (!oneProItem.extraField3) {
+                                    //没有选择子项目
+                                    this.$message({
+                                        message: '工作内容必填,请检查',
+                                        type: "error"
+                                    });
+                                    return
+                                }
+                            }
+                        }
+
                         // return
                         //代填的情况,检查人员是否已经选择
                         if (this.isSubstitude) {
@@ -6680,6 +6827,7 @@
                                 return;
                             }
                         }
+                        
                         //检查时间,全天和上下午不能同时存在
                         if (this.reportTimeType.type == 0) {
                             var alldayNum = 0;
@@ -7019,6 +7167,11 @@
                                 }
                                 
                             }
+                            if (this.user.companyId == this.yuzhongCompId) {
+                                formData.append('extraField1', this.workForm.domains[i].extraField1);
+                                formData.append('extraField2', this.workForm.domains[i].extraField2);
+                                formData.append('extraField3', this.workForm.domains[i].extraField3);
+                            }
                         }
                         this.submitingReport = true;
                         this.http.uploadFile( this.port.report.editPort, formData,

+ 6 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list.vue

@@ -126,6 +126,10 @@
                                         </el-tooltip>
                                         </span> 
                                 </p>
+                                <p v-if="user.companyId == yuzhongCompId">
+                                                        <span>角色:{{item.extraField1? roleList.filter(r=>r.value == item.extraField1)[0].label:''}}</span>
+                                                    <span style="margin-left:10px;">工作职责:{{ item.extraField2? item.extraField2Name:''}}</span>
+                                                    <span style="margin-left:10px;">工作内容:{{ item.extraField3? item.extraField3Name:''}}</span></p>
                                 <p v-if="item.taskId != null">{{$t('other.task')}}:{{item.taskName}}</p>
                                 <p v-if="item.groupId">
                                     <span>{{$t('other.taskGroup')}}:{{item.groupName}}</span>
@@ -437,6 +441,8 @@
         },
         data() {
             return {
+                yuzhongCompId: 3385,
+                roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
                 batchDenyLoading: false,
                 batchDenyDialog: false,
                 batchDenyData: {ids:'',reason:''},

+ 178 - 20
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -55,17 +55,22 @@
                     <!-- <div>请选择投入项目</div> -->
                     <van-field  readonly  name="projectId" clickable :value="item.projectName" :label="user.companyId==781?'工作任务':'投入项目'" :placeholder="user.companyId==781?'请选择工作任务':'请选择项目'" @click="clickPicker(index, item)"
                     :rules="[{ required: true, message: user.companyId==781?'请选择任务':'请选择项目' }]" />
-
-                   
-
-                    <van-field  readonly  name="subProjectId" v-if="item.subProjectList != null && item.subProjectList.length > 0 && user.timeType.mainProjectState != 1" clickable 
+                    <!--昱众不显示子项目-->
+                    <van-field  readonly  name="subProjectId" v-if="user.companyId != yuzhongCompId && item.subProjectList != null && item.subProjectList.length > 0 && user.timeType.mainProjectState != 1" clickable 
                         :value="item.subProjectName" label="子项目" placeholder="请选择子项目" 
                     @click="clickPickSubProject(index, item)" />
-
                     <van-popup v-model="item.showPickerSubProject" position="bottom">
                         <van-picker show-toolbar :columns="item.subProjectList" value-key="name" @confirm="choseSubProject" 
                             @cancel="item.showPickerSubProject = false;$forceUpdate();" />
                     </van-popup>
+                    <van-field  readonly  name="extraField1" v-if="user.companyId == yuzhongCompId" clickable 
+                        :value="item.extraField1Name" label="角色选择" placeholder="请选择担任的角色" 
+                    @click="clickPickProjectRole(index, item)" />
+                    <van-popup v-model="item.showPickerRole" position="bottom">
+                        <van-picker show-toolbar :columns="roleList" value-key="label" @confirm="choseRole" 
+                            @cancel="item.showPickerRole = false;$forceUpdate();" />
+                    </van-popup>
+
                     <!--任务分组 -->
                     <van-field  readonly  name="groupId" v-if="user.company.packageProject == 1 && item.taskGroups != null && item.taskGroups.length > 0" clickable 
                         :value="item.groupName" label="任务分组" placeholder="请选择任务分组" 
@@ -74,8 +79,24 @@
                         <van-picker show-toolbar :columns="item.taskGroups" value-key="name" @confirm="choseTaskGroup" 
                             @cancel="item.showPickerTaskGroup = false;$forceUpdate();" />
                     </van-popup>
+                    <!--工作职责-->
+                    <van-field  readonly  name="extraField2" v-if="user.companyId == yuzhongCompId" clickable 
+                        :value="item.extraField2Name" label="工作职责" placeholder="请选择工作职责" 
+                    @click="clickPickRespon(index, item)" />
+                    <van-popup v-model="item.showPickerRespon" position="bottom">
+                        <van-picker show-toolbar :columns="item.filteredRespList" value-key="jobRespon" @confirm="onResponseChosen" 
+                            @cancel="item.showPickerRespon = false;$forceUpdate();" />
+                    </van-popup>
+                    <!--工作内容-->
+                    <van-field  readonly  name="extraField3" v-if="user.companyId == yuzhongCompId" clickable 
+                        :value="item.extraField3Name" label="工作内容" placeholder="请选择工作内容" 
+                    @click="clickPickWorkContent(index, item)" />
+                    <van-popup v-model="item.showPickerWorkContent" position="bottom">
+                        <van-picker show-toolbar :columns="item.workContentList" value-key="workContext" @confirm="choseWorkContent" 
+                            @cancel="item.showPickerWorkContent = false;$forceUpdate();" />
+                    </van-popup>
                     <!--任务阶段 -->
-                    <van-field  readonly  name="stage" v-if="user.company.packageProject==1&&item.stages != null && item.stages.length > 0" clickable 
+                    <van-field  readonly  name="stage" v-if="user.companyId != yuzhongCompId && user.company.packageProject==1&&item.stages != null && item.stages.length > 0" clickable 
                         :value="item.stage" label="投入阶段" placeholder="请选择投入阶段" 
                     @click="clickPickStage(index, item)" />
                     <van-popup v-model="item.showPickerStage" position="bottom">
@@ -431,6 +452,9 @@ import timetoolVue from '../timetool/timetool.vue';
     export default {
         data() {
             return {
+                roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
+                jobResponseList:[],
+                yuzhongCompId: 3385,
                 dailyIndex: 0,
 
                 integrationProjectList: [],
@@ -570,11 +594,95 @@ import timetoolVue from '../timetool/timetool.vue';
         },
 
         methods: {
+
+            //选中角色
+            choseRole(value, index) {
+                if(value){
+                    this.form.domains[this.clickIndex].extraField1 = value.value;
+                    this.form.domains[this.clickIndex].extraField1Name = value.label;
+                }
+                this.form.domains[this.clickIndex].showPickerRole = false;
+                this.updateResponse(this.form.domains[this.clickIndex]);
+                this.$forceUpdate();
+            },
+            choseWorkContent(value, index) {
+                if(value){
+                    this.form.domains[this.clickIndex].extraField3 = value.id;
+                    this.form.domains[this.clickIndex].extraField3Name = value.workContext;
+                }
+                this.form.domains[this.clickIndex].showPickerWorkContent = false;
+                this.$forceUpdate();
+            },
+            onResponseChosen(value, index) {
+                if(value){
+                    this.form.domains[this.clickIndex].extraField2 = value.id;
+                    this.form.domains[this.clickIndex].extraField2Name = value.jobRespon;
+                    this.form.domains[this.clickIndex].extraField3 = null;
+                    this.form.domains[this.clickIndex].extraField3Name = null;
+                }
+                this.form.domains[this.clickIndex].showPickerRespon = false;
+                this.updateJobContent(this.form.domains[this.clickIndex]);
+            },
+            clickPickWorkContent(i, item) {
+                if (!item.canEdit) return;
+                this.clickIndex = i;
+                item.showPickerWorkContent = true;
+                this.$forceUpdate();
+            },
+            clickPickRespon(i, item) {
+                if (!item.canEdit) return;
+                this.clickIndex = i;
+                item.showPickerRespon = true;
+                this.$forceUpdate();
+            },
+            
+            //更新工作内容列表  
+            updateJobContent(domainItem) {
+                var that = this;
+                this.$axios.post('/project/getFunWorkContextList',{id:domainItem.extraField2})
+                .then(res => {
+                    if(res.code == 'ok'){
+                        that.$set(domainItem, 'extraField3', null);
+                        that.$set(domainItem, 'workContentList', res.data);
+                    }
+                }).catch(err => {})
+            },
+            updateResponse(domainItem) {
+                console.log(111);
+                var that = this;
+                var selectPid = domainItem.projectId;
+                domainItem.extraField2 = null;
+                domainItem.extraField3 = null;
+                domainItem.extraField2Name = null;
+                domainItem.extraField3Name = null;
+                if (selectPid && domainItem.extraField1) {
+                    //是否非项目
+                    var isPublic = this.projectss.filter(p=>p.id == selectPid)[0].isPublic;
+                    console.log('==========','isPublic=='+isPublic);
+                    var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
+                    domainItem.filteredRespList = filteredRespList;
+                }
+                
+            },
+            getJobResponList() {
+                this.$axios.post('/project/getFunctionalDivisionList',{})
+                .then(res => {
+                    if(res.code == 'ok'){
+                        this.jobResponseList = res.data;
+                    }
+                }).catch(err => {})
+            },  
+
             getRecentlyProject() {
                 this.$axios.post('/project/nearProject',{})
                 .then(res => {
                     if(res.code == 'ok'){
-                        this.integrationProjectList = res.data
+                        this.integrationProjectList = res.data;
+                        //去掉全部项目中没有的
+                        this.setTimeout(()=>{
+                            this.integrationProjectList = this.integrationProjectList.filter(near=>this.getProjectAuditorList.find(pItem=>pItem.id==near.id)!= null);
+                        }, 1000);
+                        
                     }
                 }).catch(err => {this.$toast.clear();this.cardRefLoading = false;})
             },
@@ -820,6 +928,10 @@ import timetoolVue from '../timetool/timetool.vue';
                         that.selectDegreeId(item, index, that.form.domains[that.clickIndex])
                     }, 500)
                 }
+                //加载昱众的工作职责
+                if (this.user.companyId == this.yuzhongCompId) {
+                   this.updateResponse(domainItem);
+                }
             },
             //获取项目下的任务分组
             getTaskGroups(domainItem, index) {
@@ -1335,6 +1447,19 @@ import timetoolVue from '../timetool/timetool.vue';
                                         }
                                     }
                                 }
+                                var targetP = this.project.filter(p=>p.id == list[i].projectId);
+                                var filteredRespList = [];
+                                if (targetP.length > 0 && list[i].extraField1) {
+                                    list[i].extraField1Name = this.roleList.find(r=>r.value==list[i].extraField1).label;
+                                    var isPublic = targetP[0].isPublic;
+                                    filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list[i].extraField1)[0].label);
+                                    if (list[i].extraField2) {
+                                        list[i].extraField2Name = filteredRespList.find(f=>f.id = list[i].extraField2).jobRespon;
+                                    }
+                                    if (list[i].extraField3) {
+                                        list[i].extraField3Name = list[i].workContentList.find(w=>w.id = list[i].extraField3).workContext;
+                                    }
+                                }
                                 array.push({
                                     id: list[i].id,
                                     projectId: list[i].projectId,
@@ -1382,6 +1507,14 @@ import timetoolVue from '../timetool/timetool.vue';
                                     auditorSec: list[i].auditorSec ? list[i].auditorSec : {name:'',id:''},
                                     auditorThird: list[i].auditorThird ? list[i].auditorThird : {name:'',id:''},
                                     ccUserid: list[i].ccUserid ? list[i].ccUserid : {name:'',id:''},
+                                    extraField1: list[i].extraField1,
+                                    extraField1Name: list[i].extraField1Name,
+                                    extraField2: list[i].extraField2,
+                                    extraField2Name: list[i].extraField2Name,
+                                    extraField3: list[i].extraField3,
+                                    extraField3Name: list[i].extraField3Name,
+                                    workContentList: list[i].workContentList,
+                                    filteredRespList: filteredRespList
                                 })
                                 if (list[i].state >= 2) {
                                     this.canEdit = true;
@@ -1476,6 +1609,14 @@ import timetoolVue from '../timetool/timetool.vue';
                 this.$forceUpdate();
             },
 
+            //点击选择角色
+            clickPickProjectRole(i, item) {
+                if (!item.canEdit) return;
+                this.clickIndex = i;
+                item.showPickerRole = true;
+                this.$forceUpdate();
+            },
+
             //点击选择子项目
             clickPickSubProject(i, item) {
                 if (!item.canEdit) return;
@@ -1489,6 +1630,7 @@ import timetoolVue from '../timetool/timetool.vue';
                 item.showPickerCostId = true;
                 this.$forceUpdate();
             },
+            
             clickPickTaskGroup(i, item) {
                 if (!item.canEdit) return;
                 this.clickIndex = i;
@@ -1505,21 +1647,8 @@ import timetoolVue from '../timetool/timetool.vue';
             // 选择项目
             clickPicker(i, item) {
                 if (!item.canEdit) return;
-                // this.clickIndex = i;
-                // this.showPickerProject = true;
-                // console.log(i, item, this.form)
                 this.clickIndex = i
                 this.showPickerUserddp = true
-                // console.log(item);
-                // this.dimension()
-                // this.$router.push({
-                //     path: '/search',
-                //     query: {
-                //         // from: JSON.stringify(this.form)
-                //         from: this.form,
-                //         idx: i
-                //     }
-                // });
             },
             clickPickers(i,item) {
                 // console.log('wudulist',item.wuduList);
@@ -1568,6 +1697,8 @@ import timetoolVue from '../timetool/timetool.vue';
                 this.$forceUpdate();}
                 this.form.domains[this.clickIndex].showPickDegree = false;
             },
+            
+            
 
             choseSubProject(value, index) {
                 if(value){
@@ -1838,6 +1969,25 @@ import timetoolVue from '../timetool/timetool.vue';
                             }
                         }
                     }
+                    //昱众需要检查新增的角色,工作职责,工作内容是否填写
+                    if (this.user.companyId == this.yuzhongCompId) {
+                        for(var p in this.form.domains) {
+                            var oneProItem = this.form.domains[p]
+                            if (!oneProItem.extraField1) {
+                                this.$toast('角色必填,请检查')
+                                return
+                            }
+                            if (!oneProItem.extraField2) {
+                                this.$toast('工作职责必填,请检查')
+                                return
+                            }
+                            if (!oneProItem.extraField3) {
+                                this.$toast('工作内容必填,请检查')
+                                return
+                            }
+                        }
+                    }
+
                     // return
                     const toast = this.$toast.loading({
                         forbidClick: true,
@@ -2105,6 +2255,11 @@ import timetoolVue from '../timetool/timetool.vue';
                             }
                             
                         }
+                        if (this.user.companyId == this.yuzhongCompId) {
+                            formData.append('extraField1', this.form.domains[i].extraField1);
+                            formData.append('extraField2', this.form.domains[i].extraField2);
+                            formData.append('extraField3', this.form.domains[i].extraField3);
+                        }
                     }
                     if(!this.flgLg) {
                         return
@@ -2243,6 +2398,9 @@ import timetoolVue from '../timetool/timetool.vue';
             if(this.user.timeType.lockWorktime){
                 this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
             }
+            if (this.user.companyId == this.yuzhongCompId) {
+                this.getJobResponList();
+            }
 
             // if(localStorage.getItem("formVal")) {
             //     var obj = localStorage.getItem("formVal")

+ 7 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue

@@ -31,6 +31,7 @@
     export default {
         data() {
             return {
+                yuzhongCompId: 3385,
                 isCorpWX:false,
                 isWX:false,
                 user: null,
@@ -98,7 +99,7 @@
                     // 第一次登陆显示
                     this.previewPicture()
                 }
-            } 
+            }
         },
         components: {
             Footer
@@ -343,6 +344,11 @@
                         this.getMessage();
                         this.redirectIfNess();
                         this.$forceUpdate()
+                        if (this.user.companyId == this.yuzhongCompId) {
+                            //去掉按周填报
+                            this.routers = this.routers.filter(r=>r.name != '按周填报');
+                        } 
+
                         // this.bindIfNessary();
                     } 
                 }).catch(err=> {

+ 7 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/index.vue

@@ -125,9 +125,12 @@
 
                         </div>
                         <div class="project_title" v-if="item1.projectCode != null" >项目编号:{{item1.projectCode}}</div>
-                        <div class="project_title" v-if="item1.subProjectName != null" >子项目:{{item1.subProjectName}}</div>
+                        <div class="project_title" v-if="item1.subProjectName != null && user.companyId != yuzhongCompId" >子项目:{{item1.subProjectName}}</div>
+                        <div class="project_title" v-if="user.companyId == yuzhongCompId" >角色:{{item1.extraField1?roleList.find(r=>r.value==item1.extraField1).label:''}}</div>
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.groupName != null" >任务分组:{{item1.groupName}}</div>
-                        <div class="project_title" v-if="user.company.packageProject==1&&item1.stage != '-'" >投入阶段:{{item1.stage}}</div>
+                        <div class="project_title" v-if="user.companyId == yuzhongCompId" >工作职责:{{item1.extraField2?item1.extraField2Name:''}}</div>
+                        <div class="project_title" v-if="user.companyId == yuzhongCompId" >工作内容:{{item1.extraField3?item1.extraField3Name:''}}</div>
+                        <div class="project_title" v-if="user.company.packageProject==1&&item1.stage != '-' && user.companyId != yuzhongCompId" >投入阶段:{{item1.stage}}</div>
                         <!--自定义维度 -->
                         <div class="project_title" v-if="user.timeType.customDegreeActive == 1" >{{user.timeType.customDegreeName}}:{{item1.degreeName}}</div>
                         <div class="project_title" v-if="user.timeType.customDataActive == 1" >{{user.timeType.customDataName}}:{{item1.customData}}</div>
@@ -203,6 +206,8 @@
     export default {
         data() {
             return {
+                yuzhongCompId: 3385,
+                roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
                 isAllChecked: false,
                 fullDayTxt:['全天','上午','下午'],
                 denyForm:{reason:null},

+ 6 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/view/index.vue

@@ -69,9 +69,12 @@
                         <div style="color:red;" v-if="item1.state == 2 && item1.rejectReason != null">原因:{{
                             item1.rejectReason }}
                         </div>
-                        <div class="project_title" v-if="item1.subProjectName != null">子项目:{{ item1.subProjectName }}</div>
+                        <div class="project_title" v-if="item1.subProjectName != null && user.companyId != yuzhongCompId">子项目:{{ item1.subProjectName }}</div>
+                        <div class="project_title" v-if="user.companyId == yuzhongCompId" >角色:{{item1.extraField1?roleList.find(r=>r.value==item1.extraField1).label:''}}</div>
                         <div class="project_title" v-if="user.company.packageProject == 1 && item1.groupName != null">
                             任务分组:{{ item1.groupName }}</div>
+                        <div class="project_title" v-if="user.companyId == yuzhongCompId" >工作职责:{{item1.extraField2?item1.extraField2Name:''}}</div>
+                        <div class="project_title" v-if="user.companyId == yuzhongCompId" >工作内容:{{item1.extraField3?item1.extraField3Name:''}}</div>
                         <div class="project_title" v-if="user.company.packageProject == 1 && item1.stage != '-'">
                             投入阶段:{{ item1.stage }}</div>
                         <!--自定义维度 -->
@@ -150,6 +153,8 @@
 export default {
     data() {
         return {
+            yuzhongCompId: 3385,
+            roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
             tmpPics: [],
             imgShow: false,
             hasWaiting: false,