瀏覽代碼

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

QuYueTing 10 月之前
父節點
當前提交
479c45b0bc

+ 2 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/thread/detail/components/information.vue

@@ -209,6 +209,8 @@ function transferBusiness() {
             delete item.id
         })
         let newForm = {
+            clueId: information.value.id,
+            ...generateFormVal.value,
             ...res,
             expectedTransactionDate: res.expectedTransactionDate ? formatDateTime(new Date(res.expectedTransactionDate)) : '',
             businessItemProductList: productTableListData ? JSON.stringify(productTableListData) : []

+ 70 - 47
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessOpportunityController.java

@@ -6,8 +6,10 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.management.platform.entity.*;
 import com.management.platform.mapper.BusinessOpportunityMapper;
+import com.management.platform.mapper.ClueMapper;
 import com.management.platform.mapper.SysFormMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.*;
@@ -24,6 +26,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 /**
@@ -41,6 +44,8 @@ public class BusinessOpportunityController {
     private ExcelExportServiceImpl excelExportService;
     @Resource
     private SysFormMapper sysFormMapper;
+    @Resource
+    private ClueMapper clueMapper;
     @Autowired
     private WxCorpInfoService wxCorpInfoService;
     @Resource
@@ -95,61 +100,75 @@ public class BusinessOpportunityController {
         JSONArray configObJSONArray = configOb.getJSONArray("list");
         List<List<String>> dataList=new ArrayList<>();
         List<String> titleList=new ArrayList<>();
+        List<String> modelList=new ArrayList<>();
         for (int i = 0; i < configObJSONArray.size(); i++) {
             JSONObject item = configObJSONArray.getJSONObject(i);
-            titleList.add(item.getString("label"));
+            String type = item.getString("type");
+            if (type.equals("grid")){
+                JSONArray columns = item.getJSONArray("columns");
+                for (int j = 0; j < columns.size(); j++) {
+                    JSONObject columnsJSONObject = columns.getJSONObject(j);
+                    JSONArray listJsonArray = columnsJSONObject.getJSONArray("list");
+                    for (int k = 0; k < listJsonArray.size(); k++) {
+                        JSONObject listJsonArrayJSONObject = listJsonArray.getJSONObject(k);
+                        titleList.add(listJsonArrayJSONObject.getString("label"));
+                        modelList.add(listJsonArrayJSONObject.getString("model"));
+                    }
+                }
+            }
+            else {
+                titleList.add(item.getString("label"));
+                modelList.add(item.getString("model"));
+            }
         }
         dataList.add(titleList);
-        HttpRespMsg msg = list(bo, request);
-        Map<String, Object> msgData = (Map<String, Object>) msg.getData();
-        List<BusinessOpportunity> bos = (List<BusinessOpportunity>) msgData.get("data");
-        for (BusinessOpportunity bo1 : bos) {
+
+        HttpRespMsg respMsg = list(bo,request);
+        Map<String, Object> msgData = (Map<String, Object>) respMsg.getData();
+        List<BusinessOpportunity> list = (List<BusinessOpportunity>) msgData.get("data");
+
+        for (BusinessOpportunity data : list) {
             List<String> item=new ArrayList<>();
-            for (int i = 0; i < configObJSONArray.size(); i++) {
-                JSONObject target = configObJSONArray.getJSONObject(i);
-                if(target.getString("type").equals("grid")){
-                    JSONArray columns = target.getJSONArray("columns");
-                    for (int i1 = 0; i1 < columns.size(); i1++) {
-                        JSONObject columnsJSONObject = columns.getJSONObject(i1);
-                        JSONArray list = columnsJSONObject.getJSONArray("list");
-                        for (int i2 = 0; i2 < list.size(); i2++) {
-                            JSONObject object = list.getJSONObject(i2);
-                            String model = object.getString("model");
-                            String targetName = model.substring(0, 1).toUpperCase() + model.substring(1);
-                            Class<? extends BusinessOpportunity> aClass = bo1.getClass();
-                            String value = String.valueOf(aClass.getMethod("get" + targetName).invoke(bo1)==null?"":aClass.getMethod("get" + targetName).invoke(bo1));
-                            if(model.equals("inchargerId")){
-                                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                                    value = "$userName"+String.valueOf(aClass.getMethod("getInchargerName").invoke(bo1))+"$";
-                                }else {
-                                    value = String.valueOf(aClass.getMethod("getInchargerName").invoke(bo1));
-                                }
-                            }
-                            item.add(value);
-                        }
+            for (int i = 0; i < modelList.size(); i++) {
+
+                String model = modelList.get(i);
+                String targetName = model.substring(0, 1).toUpperCase() + model.substring(1);
+                Class<? extends BusinessOpportunity> aClass = data.getClass();
+                String value = "";
+
+                if(model.equals("inchargerId")){
+                    if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                        value = "$userName"+String.valueOf(aClass.getMethod("getInchargerName").invoke(data))+"$";
+                    }else {
+                        value = String.valueOf(aClass.getMethod("getInchargerName").invoke(data)).equals("null") ? "" :String.valueOf(aClass.getMethod("getInchargerName").invoke(data));
                     }
                 }else {
-                    String model = target.getString("model");
-                    String targetName = model.substring(0, 1).toUpperCase() + model.substring(1);
-                    Class<? extends BusinessOpportunity> aClass = bo1.getClass();
-                    Object o = aClass.getMethod("get" + targetName).invoke(bo1) == null ? "" : aClass.getMethod("get" + targetName).invoke(bo1);
-                    String value = String.valueOf(o);
-                    if(model.equals("inchargerId")){
-                        if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                            value = "$userName"+String.valueOf(aClass.getMethod("getInchargerName").invoke(bo1))+"$";
-                        }else {
-                            value = String.valueOf(aClass.getMethod("getInchargerName").invoke(bo1));
-                        }
-                    }
-                    if(model.equals("contactsId")){
-                        if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                            value = "$userName"+String.valueOf(aClass.getMethod("getContactsName").invoke(bo1))+"$";
-                        }else {
-                            value = String.valueOf(aClass.getMethod("getContactsName").invoke(bo1));
-                        }
-                    }
-                    item.add(value);
+                    value= String.valueOf(aClass.getMethod("get" + targetName).invoke(data)==null?"":aClass.getMethod("get" + targetName).invoke(data));
                 }
+
+                if(model.equals("contactsId")){
+                    value = String.valueOf(aClass.getMethod("getContactsName").invoke(data));
+                }
+                if(model.equals("customerId")){
+                    value = String.valueOf(aClass.getMethod("getCustomerName").invoke(data));
+                }
+                if(model.equals("expectedTransactionDate")){
+                    Date date = (Date) aClass.getMethod("getExpectedTransactionDate").invoke(data);
+                    // 如果日期不为空,格式化日期
+                    if (date != null) {
+                        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                        value = sdf.format(date);
+                    } else {
+                        value = "";
+                }                }
+                if(model.equals("stageId")){
+                    value = String.valueOf(aClass.getMethod("getStageValue").invoke(data));
+                }
+                if(model.equals("creatorId")){
+                    value = String.valueOf(aClass.getMethod("getCreatorName").invoke(data));
+                }
+
+                item.add(value);
             }
             dataList.add(item);
         }
@@ -217,6 +236,10 @@ public class BusinessOpportunityController {
         HttpRespMsg msg = new HttpRespMsg();
         if (bo.getId() == null){
             //新增
+            if (bo.getClueId()!= null ){
+
+                clueMapper.update(null, new UpdateWrapper<Clue>().eq("id",bo.getClueId()).set("is_bo",1));
+            }
             bo.setCompanyId(user.getCompanyId());
             bo.setCreatorId(user.getId());
             bo.setUserId(user.getId());

+ 48 - 53
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/CustomController.java

@@ -114,67 +114,62 @@ public class CustomController {
         JSONArray configObJSONArray = configOb.getJSONArray("list");
         List<List<String>> dataList=new ArrayList<>();
         List<String> titleList=new ArrayList<>();
+        List<String> modelList=new ArrayList<>();
         for (int i = 0; i < configObJSONArray.size(); i++) {
             JSONObject item = configObJSONArray.getJSONObject(i);
-            titleList.add(item.getString("label"));
+            String type = item.getString("type");
+            if (type.equals("grid")){
+                JSONArray columns = item.getJSONArray("columns");
+                for (int j = 0; j < columns.size(); j++) {
+                    JSONObject columnsJSONObject = columns.getJSONObject(j);
+                    JSONArray listJsonArray = columnsJSONObject.getJSONArray("list");
+                    for (int k = 0; k < listJsonArray.size(); k++) {
+                        JSONObject listJsonArrayJSONObject = listJsonArray.getJSONObject(k);
+                        titleList.add(listJsonArrayJSONObject.getString("label"));
+                        modelList.add(listJsonArrayJSONObject.getString("model"));
+                    }
+                }
+            }
+            else {
+                titleList.add(item.getString("label"));
+                modelList.add(item.getString("model"));
+            }
         }
         dataList.add(titleList);
-        HttpRespMsg msg = list(custom, request);
-        Map<String, Object> msgData = (Map<String, Object>) msg.getData();
-        List<Custom> bos = (List<Custom>) msgData.get("data");
-        for (Custom bo1 : bos) {
+
+        HttpRespMsg respMsg = list(custom,request);
+        Map<String, Object> msgData = (Map<String, Object>) respMsg.getData();
+        List<Custom> list = (List<Custom>) msgData.get("data");
+
+        for (Custom data : list) {
             List<String> item=new ArrayList<>();
-            for (int i = 0; i < configObJSONArray.size(); i++) {
-                JSONObject target = configObJSONArray.getJSONObject(i);
-                if(target.getString("type").equals("grid")){
-                    JSONArray columns = target.getJSONArray("columns");
-                    for (int i1 = 0; i1 < columns.size(); i1++) {
-                        JSONObject columnsJSONObject = columns.getJSONObject(i1);
-                        JSONArray list = columnsJSONObject.getJSONArray("list");
-                        for (int i2 = 0; i2 < list.size(); i2++) {
-                            JSONObject object = list.getJSONObject(i2);
-                            String model = object.getString("model");
-                            String targetName = model.substring(0, 1).toUpperCase() + model.substring(1);
-                            Class<? extends Custom> aClass = bo1.getClass();
-                            String value = String.valueOf(aClass.getMethod("get" + targetName).invoke(bo1)==null?"":aClass.getMethod("get" + targetName).invoke(bo1));
-                            if(model.equals("inchargerId")){
-                                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                                    value = "$userName"+String.valueOf(aClass.getMethod("getInchargerName").invoke(bo1))+"$";
-                                }else {
-                                    value = String.valueOf(aClass.getMethod("getInchargerName").invoke(bo1));
-                                }
-                            }
-                            if(model.equals("customSourceValue")){
-                                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                                    value = "$userName"+String.valueOf(aClass.getMethod("getCustomSourceValue").invoke(bo1))+"$";
-                                }else {
-                                    value = String.valueOf(aClass.getMethod("getCustomSourceValue").invoke(bo1)).equals("null") ?"" :String.valueOf(aClass.getMethod("getCustomSourceValue").invoke(bo1));
-                                }
-                            }
-                            item.add(value);
-                        }
+            for (int i = 0; i < modelList.size(); i++) {
+
+                String model = modelList.get(i);
+                String targetName = model.substring(0, 1).toUpperCase() + model.substring(1);
+                Class<? extends Custom> aClass = data.getClass();
+                String value = "";
+
+                if(model.equals("inchargerId")){
+                    if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                        value = "$userName"+String.valueOf(aClass.getMethod("getInchargerName").invoke(data))+"$";
+                    }else {
+                        value = String.valueOf(aClass.getMethod("getInchargerName").invoke(data)).equals("null") ? "" :String.valueOf(aClass.getMethod("getInchargerName").invoke(data));
                     }
                 }else {
-                    String model = target.getString("model");
-                    String targetName = model.substring(0, 1).toUpperCase() + model.substring(1);
-                    Class<? extends Custom> aClass = bo1.getClass();
-                    String value = String.valueOf(aClass.getMethod("get" + targetName).invoke(bo1)==null?"":aClass.getMethod("get" + targetName).invoke(bo1));
-                    if(model.equals("inchargerId")){
-                        if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                            value = "$userName"+String.valueOf(aClass.getMethod("getInchargerName").invoke(bo1))+"$";
-                        }else {
-                            value = String.valueOf(aClass.getMethod("getInchargerName").invoke(bo1));
-                        }
-                    }
-                    if(model.equals("contactsId")){
-                        if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                            value = "$userName"+String.valueOf(aClass.getMethod("getContactsName").invoke(bo1))+"$";
-                        }else {
-                            value = String.valueOf(aClass.getMethod("getContactsName").invoke(bo1));
-                        }
-                    }
-                    item.add(value);
+                    value= String.valueOf(aClass.getMethod("get" + targetName).invoke(data)==null?"":aClass.getMethod("get" + targetName).invoke(data));
+                }
+
+                if(model.equals("clueSourceId")){
+                    value = String.valueOf(aClass.getMethod("getClueSourceValue").invoke(data));
+                }
+                if(model.equals("customerLevelId")){
+                    value = String.valueOf(aClass.getMethod("getCustomerLevelValue").invoke(data));
+                }
+                if(model.equals("customerIndustryId")){
+                    value = String.valueOf(aClass.getMethod("getCustomerIndustryValue").invoke(data));
                 }
+                item.add(value);
             }
             dataList.add(item);
         }

+ 2 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/BusinessOpportunity.java

@@ -39,6 +39,8 @@ public class BusinessOpportunity extends Model<BusinessOpportunity> {
 
     @TableField(exist = false)
     private String productName;
+    @TableField(exist = false)
+    private Integer clueId;
 
     /**
      * 商机名称

+ 5 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Clue.java

@@ -34,7 +34,11 @@ public class Clue extends Model<Clue> {
      * 公司id
      */
     @TableField("company_id")
-    private Integer companyId;
+    private Integer companyId;/**
+     * 公司id
+     */
+    @TableField("is_bo")
+    private Integer isBo;
     //创建人
     @TableField("create_id")
     private String createId;

+ 6 - 6
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ClueMapper.xml

@@ -59,7 +59,7 @@
         from clue c
         left join sys_dict sd on c.customer_level_id = sd.id
         where
-            c.company_id = #{companyId} and is_delete = #{isDelete}
+            c.company_id = #{companyId} and is_delete = #{isDelete} and c.is_bo = 0
         <if test="inchargerId != null and inchargerId != ''  ">
            and c.incharger_id =#{inchargerId}
         </if>
@@ -130,7 +130,7 @@
         from clue c
         left join sys_dict sd on c.customer_level_id = sd.id
         where
-        c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
+        c.company_id = #{clue.companyId} and c.is_delete = #{clue.isDelete} and c.is_bo = 0
         and (c.incharger_id in
         (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
         or c.incharger_id is null)
@@ -204,7 +204,7 @@
         from clue c
         left join sys_dict sd on c.customer_level_id = sd.id
         where
-        c.company_id = #{clue.companyId} and c.is_delete = #{clue.isDelete}
+        c.company_id = #{clue.companyId} and c.is_delete = #{clue.isDelete} and c.is_bo = 0
         and (c.incharger_id = #{userId} or c.incharger_id is null)
         <if test="clue.inchargerId != null and clue.inchargerId != ''  ">
           and c.incharger_id =#{clue.inchargerId}
@@ -251,7 +251,7 @@
         select count(*)
         from clue c
         where
-        company_id = #{companyId} and is_delete = #{isDelete}
+        company_id = #{companyId} and is_delete = #{isDelete} and is_bo = 0
         <if test="inchargerId != null and inchargerId != ''  ">
             and incharger_id = #{inchargerId}
         </if>
@@ -282,7 +282,7 @@
         COUNT(c.id)
         from clue c
         where
-        c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
+        c.company_id = #{clue.companyId} and c.is_delete = #{clue.isDelete} and c.is_bo = 0
         and c.incharger_id in
         (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
         and c.incharger_id is null
@@ -316,7 +316,7 @@
             count(c.id)
         from clue c
         where
-        c.company_id = #{clue.companyId} and c.is_delete = #{clue.isDelete}
+        c.company_id = #{clue.companyId} and c.is_delete = #{clue.isDelete} and c.is_bo = 0
         and (c.incharger_id = #{userId} or c.incharger_id is null)
         <if test="clue.inchargerId != null and clue.inchargerId != ''  ">
             and c.incharger_id =#{clue.inchargerId}

+ 5 - 7
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml

@@ -1293,11 +1293,10 @@
     <select id="getReportListWithTransfer" resultType="java.util.Map">
         SELECT r.id AS reportId,u.`job_number` AS jobNumber,u.name AS userName,d.`department_name` AS deptName,
         p.`project_code` AS projectCode,p.`project_name` AS projectName,date_format(r.`create_date`,'%Y-%m-%d') AS createDate,r.`working_time` AS workingTime,
-        tg.`name` AS groupName,s.`stages_name` AS stageName FROM report r
+        tg.`name` AS groupName,r.`stage` AS stageName FROM report r
         LEFT JOIN `user` u ON r.`creator_id`=u.`id`
         LEFT JOIN project p ON r.`project_id`=p.`id`
-        LEFT JOIN task_group tg ON tg.`project_id`=r.`group_id`
-        LEFT JOIN stages s ON s.`project_id`=p.id AND s.`group_id`=tg.`id`
+        LEFT JOIN task_group tg ON tg.`id`=r.`group_id`
         LEFT JOIN department d ON d.`department_id`=u.`department_id`
         WHERE r.company_id=#{companyId}
         <if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
@@ -1305,7 +1304,7 @@
         </if>
         <if test="list!=null and list.size()>0">
             AND r.creator_id in
-            <foreach collection="list" separator="," open="(" close="" item="item">
+            <foreach collection="list" separator="," open="(" close=")" item="item">
                 #{item}
             </foreach>
         </if>
@@ -1322,8 +1321,7 @@
         SELECT r.id AS reportId FROM report r
         LEFT JOIN `user` u ON r.`creator_id`=u.`id`
         LEFT JOIN project p ON r.`project_id`=p.`id`
-        LEFT JOIN task_group tg ON tg.`project_id`=r.`group_id`
-        LEFT JOIN stages s ON s.`project_id`=p.id AND s.`group_id`=tg.`id`
+        LEFT JOIN task_group tg ON tg.`id`=r.`group_id`
         LEFT JOIN department d ON d.`department_id`=u.`department_id`
         WHERE r.company_id=#{companyId}
         <if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
@@ -1331,7 +1329,7 @@
         </if>
         <if test="list!=null and list.size()>0">
             AND r.creator_id in
-            <foreach collection="list" separator="," open="(" close="" item="item">
+            <foreach collection="list" separator="," open="(" close=")" item="item">
                 #{item}
             </foreach>
         </if>

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/index.html

@@ -2,6 +2,7 @@
 <html>
   <head>
     <meta charset="utf-8" />
+    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
     <!-- 尝试清除打包缓存 -->
     <!-- <meta http-equiv="pragram" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">

+ 5 - 0
fhKeeper/formulahousekeeper/timesheet/src/App.vue

@@ -94,4 +94,9 @@
         opacity: 0;
     }
 
+    .resetElEmtClass {
+        .el-dialog__body {
+            padding: 0 !important;
+        }
+    }
 </style>

+ 8 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json

@@ -2177,5 +2177,12 @@
   "qingJiaJiWeiTianBaoJiShi": "Leave calculation for timely reporting",
   "qingShuRuHeXiaoYuanYing": "Please enter the reason for verification",
   "wuXiaoJiaBan": "Invalid overtime",
-  "yiFaFangJIaBanGongShi": "Overtime pay has been paid"
+  "yiFaFangJIaBanGongShi": "Overtime pay has been paid",
+  "gongJiGongShi": "Total working hours",
+  "queRenZhuanYi": "Confirm transfer",
+  "tiaoShuJu": "Article data",
+  "yiXuanZe": "Selected",
+  "zhuanYIGongShi": "Transfer of working hours",
+  "zhuanYiChengGong": "Transfer successful",
+  "zhuanYiZhi": "Transfer to"
 }

+ 8 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json

@@ -2177,5 +2177,12 @@
   "jiaBanHeXiao": "加班核销",
   "qingShuRuHeXiaoYuanYing": "请输入核销原因",
   "yiFaFangJIaBanGongShi": "已发放加班工资",
-  "wuXiaoJiaBan": "无效加班"
+  "wuXiaoJiaBan": "无效加班",
+  "zhuanYIGongShi": "转移工时",
+  "yiXuanZe": "已选择",
+  "tiaoShuJu": "条数据",
+  "gongJiGongShi": "共计工时",
+  "zhuanYiZhi": "转移至",
+  "queRenZhuanYi": "确认转移",
+  "zhuanYiChengGong": "转移成功"
 }

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

@@ -150,6 +150,7 @@
                                     <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">{{ $t('tuiSongGongShi') }}</el-link>
                                     <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">{{ $t('gongShiTuiSongRiZhi') }}</el-link>
                                     <el-link type="primary" v-if="user.roleName == $t('role.superAdministrator') && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">{{ $t('riBaoShenHeXiuGai') }}</el-link>
+                                    <el-link type="primary" v-if="(user.roleName == $t('role.superAdministrator') || user.roleName == $t('role.systemAdministrator')) && user.companyId==936" :underline="false" @click="transferWorkingHoursVisable=true">{{ $t('zhuanYIGongShi') }}</el-link>
                                     <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
                                 </span>
                             </div>
@@ -2162,6 +2163,8 @@
             </div>
         </el-dialog>
         
+        <!-- 威派格定制 -->
+        <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
     </section>
 </template>
 
@@ -2179,6 +2182,9 @@
 
     // 重庆物奇定制组件
     import WeeklyCustomization from "./weeklyCustomization.vue"
+
+    // 威派格定制转移工时
+    import TransferWorkingHours from "./transferWorkingHours.vue"
     
     import { mapMutations } from 'vuex'
     let _that = this
@@ -2188,7 +2194,8 @@
             selectCat,
             vueCascader,
             WeeklyCustomization,
-            vueMultipleDept
+            vueMultipleDept,
+            TransferWorkingHours
         },
         data() {
             return {
@@ -2507,6 +2514,8 @@
                 isReminder:true,
                 reportLogCheckDialog:false,
                 deptIdForHasReport:[],
+
+                transferWorkingHoursVisable: false
             };
         },
         watch: {

+ 355 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/transferWorkingHours.vue

@@ -0,0 +1,355 @@
+<template>
+    <div class="resetElEmtClass">
+        <el-dialog :title="$t('zhuanYIGongShi')" :visible.sync="modelValue" width="90vw" :top="'8vh'" :before-close="handleClose">
+            <div class="transferWorkingHours">
+                <!-- 筛选条件 -->
+                <div class="transferWorkingHours-title">
+                    <el-form :inline="true" :model="filterCriteriaForm" class="demo-form-inline">
+                        <el-form-item :label="$t('ren-yuan')">
+                            <el-select v-model="filterCriteriaForm.userList" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable
+                                collapse-tags size="small" @change="filterSelect()" v-if="user.userNameNeedTranslate != 1">
+                                <el-option v-for="item in allUserList" :key="item.id" :label="item.name" :value="item.id">
+                                </el-option>
+                            </el-select>
+                            <selectCat :filterable="true" :size="'small'" v-if="user.userNameNeedTranslate == 1"
+                                :subject="allUserList" :clearable="true" :multiSelect="true" :distinction="'1'"
+                                :expandPersonnel="false" @selectCal="selectCal"></selectCat>
+                        </el-form-item>
+                        <el-form-item :label="$t('screening.workingDate')">
+                            <el-date-picker size="small" v-model="filterCriteriaForm.workDate" :editable="false"
+                                format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="true" @change="filterSelect()"
+                                :range-separator="$t('other.to')" type="daterange" :start-placeholder="$t('time.startDate')"
+                                :end-placeholder="$t('time.endDate')"></el-date-picker>
+                        </el-form-item>
+                        <el-form-item :label="$t('other.project')">
+                            <el-select v-model="filterCriteriaForm.projectId" clearable :placeholder="$t('defaultText.pleaseChoose')" size="small"
+                                @change="filterSelect()">
+                                <el-option v-for="item in allProjectList" :key="item.id" :label="item.projectName"
+                                    :value="item.id">
+                                    <span style="float: left">{{ item.projectName }}</span>
+                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.projectCode
+                                    }}</span>
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                    </el-form>
+                </div>
+                <!-- 表格 -->
+                <div>
+                    <el-table :data="tableData" ref="multipleTable" height="50vh" border v-loading="tableDataLoading"
+                        @selection-change="handleSelectionChange" style="width: 100%">
+                        <el-table-column align="center" type="selection" width="55"></el-table-column>
+                        <el-table-column align="center" prop="jobNumber" :label="$t('Worknumber')" width="180"></el-table-column>
+                        <el-table-column align="center" prop="userName" :label="$t('lable.name')" width="180">
+                            <template slot-scope="scope">
+                                <TranslationOpenDataText type='userName' :openid='scope.row.userName'>
+                                </TranslationOpenDataText>
+                            </template>
+                        </el-table-column>
+                        <el-table-column align="center" prop="deptName" :label="$t('subordinatedepartments')" width="180">
+                            <template slot-scope="scope">
+                                <TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'>
+                                </TranslationOpenDataText>
+                            </template>
+                        </el-table-column>
+                        <el-table-column align="center" prop="projectCode" :label="$t('Itemno')" width="240"></el-table-column>
+                        <el-table-column align="center" prop="projectName" :label="$t('headerTop.projectName')" width="240"></el-table-column>
+                        <el-table-column align="center" prop="createDate" :label="$t('screening.workingDate')" width="180"></el-table-column>
+                        <el-table-column align="center" prop="workingTime" :label="$t('screening.workTime')" width="100"></el-table-column>
+                        <el-table-column align="center" prop="groupName" :label="$t('other.taskGroup')" width="180"></el-table-column>
+                        <el-table-column align="center" prop="stageName" :label="$t('other.inputStage')" width="180"></el-table-column>
+                    </el-table>
+                </div>
+                <!-- 分页 -->
+                <div class="transferWorkingHours-paging">
+                    <div>{{ $t('yiXuanZe') }} {{ tableSelected.length }} {{ $t('tiaoShuJu') }},{{ $t('gongJiGongShi') }}:{{ totalWorkingHours }} {{ $t('time.hour') }}</div>
+                    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+                        :current-page="pagingForm.pageIndex" :page-sizes="[30, 50, 100, 150, 200, 300]"
+                        :page-size="pagingForm.pageSize" layout="prev, pager, next, sizes" :total="pagingTotal">
+                    </el-pagination>
+                </div>
+                <!-- 转移至 -->
+                <div slot="footer">
+                    <el-form :inline="true" :model="transform" class="demo-form-inline">
+                        <el-form-item :label="$t('zhuanYiZhi')">
+                            <el-select v-model="transform.projectId" clearable :placeholder="$t('defaultText.pleaseChoose')" size="small"
+                                :disabled="!tableSelected.length" @change="changeProject()">
+                                <el-option v-for="item in allProjectList" :key="item.id" :label="item.projectName"
+                                    :value="item.id">
+                                    <span style="float: left">{{ item.projectName }}</span>
+                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.projectCode
+                                    }}</span>
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item>
+                            <el-select v-model="transform.taskGroupingId" clearable :placeholder="$t('defaultText.pleaseSelectaTaskGroup')"
+                                :disabled="!transform.projectId" size="small" @change="changeTaskGroup()">
+                                <el-option v-for="item in taskGroupingList" :key="item.id" :label="item.name"
+                                    :value="item.id"></el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item>
+                            <el-select v-model="transform.stageId" clearable :placeholder="$t('pleaseselecttheprojectphase')"
+                                :disabled="!(transform.projectId && transform.taskGroupingId)" size="small">
+                                <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName"
+                                    :value="item.id">
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item>
+                            <el-button type="primary" :size="'small'" :loading="confirmTransformLoading"
+                                @click="confirmTransform()"
+                                :disabled="!(transform.projectId && transform.taskGroupingId && transform.stageId)">{{ $t('queRenZhuanYi') }}</el-button>
+                        </el-form-item>
+                    </el-form>
+                </div>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+import selectCat from "@/components/select.vue"
+export default {
+    name: '',
+    components: {
+        selectCat
+    },
+    props: {
+        modelValue: {
+            type: Boolean,
+            default: () => false
+        },
+        projectList: {
+            type: Array,
+            default: () => []
+        },
+        userList: {
+            type: Array,
+            default: () => []
+        }
+    },
+    data() {
+        return {
+            user: JSON.parse(sessionStorage.getItem("user")),
+            allProjectList: [],
+            allUserList: [],
+            taskGroupingList: [],
+            stageList: [],
+            transform: {
+                projectId: '',
+                taskGroupingId: '',
+                stageId: ''
+            },
+            filterCriteriaForm: {
+                userList: [],
+                workDate: [],
+                projectId: ''
+            },
+            pagingForm: {
+                pageIndex: 1,
+                pageSize: 100
+            },
+            pagingTotal: 0,
+            tableSelected: [],
+            tableData: [],
+            tableDataLoading: false,
+            confirmTransformLoading: false
+        }
+    },
+    computed: {
+        totalWorkingHours() {
+            return this.tableSelected.reduce((total, item) => {
+                let num = item.workingTime || 0
+                return total + Number(num)
+            }, 0)
+        }
+    },
+    watch: {
+        modelValue(val) {
+            if (val) {
+                this.emptyFilterData()
+                this.getTableList()
+            }
+            this.updateModelValue()
+        },
+        projectList(val) {
+            this.allProjectList = val
+        },
+        userList(val) {
+            this.allUserList = val
+        }
+    },
+    model: {
+        prop: 'modelValue',
+        event: 'getValue'
+    },
+    created() { },
+    mounted() { },
+    methods: {
+        async confirmTransform() {
+            const { projectId, taskGroupingId, stageId } = this.transform
+            const reportIds = this.tableSelected.map(item => item.reportId).join(',')
+            this.confirmTransformLoading = true
+            const { data, code } = await this.postData('/report/transferReport', {
+                reportIds, projectId, stageId,
+                groupId: taskGroupingId,
+            })
+
+            if (code == 'ok') {
+                this.$message({
+                    message: this.$t('zhuanYiChengGong'),
+                    type: "success"
+                });
+                this.pagingForm.pageIndex = 1
+                this.emptyBasicData()
+                this.getTableList()
+            }
+            this.confirmTransformLoading = false
+        },
+        async getTableList() {
+            const { userList, workDate, projectId } = this.filterCriteriaForm
+            this.tableDataLoading = true
+            const { data } = await this.postData('/report/getReportListWithTransfer ', {
+                startDate: workDate[0],
+                endDate: workDate[1],
+                userIds: userList.join(','),
+                projectId: projectId,
+                ...this.pagingForm
+            })
+            this.tableDataLoading = false
+            this.tableData = data.result
+            this.pagingTotal = data.count
+        },
+        async getTaskGroups() {
+            const { projectId } = this.transform
+            let { data } = await this.postData('/task-group/listMyJoinGroup', {
+                projectId,
+                isSubstitude: 1
+            })
+            this.taskGroupingList = data
+        },
+        async getGroupStages() {
+            const { taskGroupingId } = this.transform
+            let { data } = await this.postData('/stages/getProjectStagesByGroup', {
+                groupId: taskGroupingId
+            })
+            this.stageList = data
+        },
+        filterSelect() {
+            this.pagingForm.pageIndex = 1
+            this.getTableList()
+        },  
+        emptyBasicData() {
+            this.transform = {
+                projectId: '',
+                taskGroupingId: '',
+                stageId: ''
+            }
+            this.taskGroupingList = []
+            this.stageList = []
+        },
+        emptyFilterData() {
+            this.filterCriteriaForm = {
+                userList: [],
+                workDate: [],
+                projectId: ''
+            }
+        },
+        changeTaskGroup() {
+            const { taskGroupingId } = this.transform
+            if (taskGroupingId) {
+                this.getGroupStages()
+            } else {
+                this.transform = {
+                    ...this.transform,
+                    stageId: ''
+                }
+                this.stageList = []
+            }
+        },
+        changeProject() {
+            const { projectId } = this.transform
+            if (projectId) {
+                this.getTaskGroups()
+            } else {
+                this.transform = {
+                    projectId: '',
+                    taskGroupingId: '',
+                    stageId: ''
+                }
+                this.taskGroupingList = []
+                this.stageList = []
+            }
+        },
+        handleSelectionChange(row) {
+            this.tableSelected = row
+        },
+        handleSizeChange(size) {
+            this.pagingForm = {
+                pageIndex: 1,
+                pageSize: size
+            }
+            this.getTableList()
+        },
+        handleCurrentChange(page) {
+            this.pagingForm.pageIndex = page
+            this.getTableList()
+        },
+        updateModelValue() {
+            this.$emit('getValue', this.modelValue);
+            this.$emit('change', this.modelValue);
+        },
+        selectCal(obj) {
+            if (obj.distinction == 1) {
+                let userListId = obj.arrUserList
+                let arr = []
+                for (var i in userListId) {
+                    arr.push(userListId[i].id)
+                }
+                this.filterCriteriaForm.userList = arr
+                this.filterSelect()
+            }
+        },
+        // 封装 post 请求
+        postData(url, params) {
+            return new Promise((resolve, reject) => {
+                this.http.post(url, { ...params },
+                    res => {
+                        if (res.code == 'ok') {
+                            resolve(res)
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                            reject(error)
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                        reject(error)
+                    })
+            })
+        },
+    },
+}
+</script>
+<style scoped lang='scss'>
+.transferWorkingHours {
+    padding: 0 20px;
+
+    .transferWorkingHours-title {}
+
+    .transferWorkingHours-paging {
+        margin: 10px 0;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+    }
+}
+</style>