Преглед изворни кода

Merge remote-tracking branch 'origin/master'

yusm пре 1 година
родитељ
комит
9fa767b095
24 измењених фајлова са 509 додато и 233 уклоњено
  1. 27 11
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java
  2. 12 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/PlanController.java
  3. 19 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ReportController.java
  4. 7 2
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/PlanProcedureTotal.java
  5. 13 1
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/PlanSteelStampNumber.java
  6. 7 1
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/ProdProcedureTeam.java
  7. 7 1
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/Report.java
  8. 2 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/ReportMapper.java
  9. 6 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/PlanService.java
  10. 2 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/ReportService.java
  11. 63 20
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanProcedureTotalServiceImpl.java
  12. 28 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanServiceImpl.java
  13. 41 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  14. 2 1
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/PlanProcedureTotalMapper.xml
  15. 5 3
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/PlanSteelStampNumberMapper.xml
  16. 4 4
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ProdProcedureTeamMapper.xml
  17. 24 2
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ReportMapper.xml
  18. 4 3
      fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/login/index.vue
  19. 12 29
      fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/my/children/center.vue
  20. 19 0
      fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/component/planComponent.vue
  21. 176 133
      fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/planComponent.vue
  22. 1 1
      fhKeeper/formulahousekeeper/timesheet-workshop/src/views/statistic/index.vue
  23. 26 19
      fhKeeper/formulahousekeeper/timesheet-workshop/src/views/workReport/daily.vue
  24. 2 2
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue

+ 27 - 11
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -75,6 +75,8 @@ public class ReportController {
     @Resource
     private BusinessTripService businessTripService;
     @Resource
+    private ReportLogDetailMapper  reportLogDetailMapper;
+    @Resource
     private ProjectCurrentcostMapper projectCurrentcostMapper;
     @Resource
     private UserSalaryService userSalaryService;
@@ -714,18 +716,32 @@ public class ReportController {
                     if (id != null) {
                         List<Integer> editReportIds = Arrays.stream(id).collect(Collectors.toList());
                         denyCount = reportMapper.selectCount(new QueryWrapper<Report>().eq("state", 2).in("id", editReportIds));
-                    }
-                    if (denyCount == 0) {
-                        //不存在驳回的日报
-                        HttpRespMsg msg = new HttpRespMsg();
-                        //msg.setError("补填日报不可早于"+dateTimeFormatter.format(targetDate)+",请联系系统管理员代填。");
-                        if (!isLastMonthFail) {
-                            msg.setError(MessageUtils.message("profession.repairError",dateTimeFormatter.format(targetDate)));
-                        } else {
-                            msg.setError("不得晚于"+dateTimeFormatter.format(fillDay)+"后补填,请联系系统管理员代填。");
+                        if (denyCount == 0) {
+                            //检查最近一次审核是否是被驳回
+                            List<ReportLogDetail> reportLogDetails = reportLogDetailMapper.selectList(new QueryWrapper<ReportLogDetail>().select("report_id, GROUP_CONCAT(msg SEPARATOR '@') as msg").in("report_id", editReportIds).groupBy("report_id"));
+                            for (ReportLogDetail reportLogDetail : reportLogDetails) {
+                                String msg = reportLogDetail.getMsg();
+                                //msg为逗号隔开的字符串,取最后一个
+                                if (msg.contains("@")) {
+                                    String[] split = msg.split("@");
+                                    msg = split[split.length - 1];
+                                }
+                                if (msg.contains("驳回")) {
+                                    denyCount++;
+                                }
+                            }
+                            if (denyCount == 0) {
+                                //不存在驳回的日报
+                                HttpRespMsg msg = new HttpRespMsg();
+                                //msg.setError("补填日报不可早于"+dateTimeFormatter.format(targetDate)+",请联系系统管理员代填。");
+                                if (!isLastMonthFail) {
+                                    msg.setError(MessageUtils.message("profession.repairError",dateTimeFormatter.format(targetDate)));
+                                } else {
+                                    msg.setError("不得晚于"+dateTimeFormatter.format(fillDay)+"后补填,请联系系统管理员代填。");
+                                }
+                                return msg;
+                            }
                         }
-
-                        return msg;
                     }
                 }
             }

+ 12 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/PlanController.java

@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 /**
@@ -142,5 +143,16 @@ public class PlanController {
         }
         return httpRespMsg;
     }
+
+    @RequestMapping("/stopPlan")
+    @Transactional
+    public HttpRespMsg stopPlan(Integer id){
+        return planService.stopPlan(id);
+    }
+
+    @RequestMapping("/allPlanList")
+    public HttpRespMsg allPlanList(HttpServletRequest request){
+        return planService.allPlanList(request);
+    }
 }
 

+ 19 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ReportController.java

@@ -1568,5 +1568,24 @@ public class ReportController {
         return reportService.exportDpetStatisticsProgressList(deptId,userId,startDate,endDate);
     }
 
+    /**
+     * 导出报告
+     * date 日期 格式yyyy-mm-dd
+     */
+    @RequestMapping("/exportReport")
+    public HttpRespMsg exportReport(String startDate, String endDate, Integer planId,@RequestParam(defaultValue = "0") Integer stateKey,Integer departmentId) {
+        //startDate和endDate间隔不得超过1年
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        LocalDate start = LocalDate.parse(startDate, dateTimeFormatter);
+        LocalDate end = LocalDate.parse(endDate, dateTimeFormatter);
+        if (start.until(end, ChronoUnit.DAYS) > 365) {
+            HttpRespMsg httpRespMsg = new HttpRespMsg();
+            httpRespMsg.setError("导出日报时间间隔不得超过1年");
+            return httpRespMsg;
+        }
+
+        return reportService.exportReport(startDate, endDate, planId,stateKey,departmentId, request);
+    }
+
 }
 

+ 7 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/PlanProcedureTotal.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
 import java.util.List;
-import java.util.Map;
 
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -18,7 +17,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2023-07-29
+ * @since 2023-11-20
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -54,6 +53,12 @@ public class PlanProcedureTotal extends Model<PlanProcedureTotal> {
     @TableField("total_working_hours")
     private Double totalWorkingHours;
 
+    /**
+     * 总件数
+     */
+    @TableField("total_num")
+    private Integer totalNum;
+
     @TableField(exist = false)
     private ProdProcedure prodProcedure;
 

+ 13 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/PlanSteelStampNumber.java

@@ -13,7 +13,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2023-08-28
+ * @since 2023-11-20
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -40,6 +40,18 @@ public class PlanSteelStampNumber extends Model<PlanSteelStampNumber> {
     @TableField("steel_stamp_number_end")
     private String steelStampNumberEnd;
 
+    /**
+     * 钢印号规则起始位置
+     */
+    @TableField("rule_index_start")
+    private Integer ruleIndexStart;
+
+    /**
+     * 钢印号规则起始位置
+     */
+    @TableField("rule_index_end")
+    private Integer ruleIndexEnd;
+
 
     @Override
     protected Serializable pkVal() {

+ 7 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/ProdProcedureTeam.java

@@ -20,7 +20,7 @@ import org.springframework.format.annotation.DateTimeFormat;
  * </p>
  *
  * @author Seyason
- * @since 2023-08-31
+ * @since 2023-11-20
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -102,6 +102,12 @@ public class ProdProcedureTeam extends Model<ProdProcedureTeam> {
     @TableField("steel_num_array")
     private String steelNumArray;
 
+    /**
+     * 完成件数;支持小数
+     */
+    @TableField("finish_num")
+    private Double finishNum;
+
 
     @Override
     protected Serializable pkVal() {

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

@@ -21,7 +21,7 @@ import org.springframework.format.annotation.DateTimeFormat;
  * </p>
  *
  * @author Seyason
- * @since 2023-08-31
+ * @since 2023-11-20
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -134,6 +134,12 @@ public class Report extends Model<Report> {
     @TableField("steel_num_array")
     private String steelNumArray;
 
+    /**
+     * 完成件数;支持小数
+     */
+    @TableField("finish_num")
+    private Double finishNum;
+
 
     @Override
     protected Serializable pkVal() {

+ 2 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/ReportMapper.java

@@ -201,4 +201,6 @@ public interface ReportMapper extends BaseMapper<Report> {
     List<Map<String, Object>> getDpetStatisticsProgressList(Integer companyId, String deptId, String foremanId, String userId, String startDate, String endDate, Integer pageStart, Integer pageSize);
 
     Integer getDpetStatisticsProgressCount(Integer companyId, String deptId, String foremanId, String userId, String startDate, String endDate);
+
+    List<Map<String,Object>> getReportList(String startDate, String endDate, Integer planId, Integer stateKey, Integer departmentId, Integer companyId);
 }

+ 6 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/PlanService.java

@@ -7,6 +7,8 @@ import com.management.platform.entity.ProdProcedureTeam;
 import com.management.platform.util.HttpRespMsg;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletRequest;
+
 /**
  * <p>
  *  服务类
@@ -48,4 +50,8 @@ public interface PlanService extends IService<Plan> {
     HttpRespMsg cancellationReceiveBatch(String ids);
 
     HttpRespMsg getNowMouthProdProgress();
+
+    HttpRespMsg stopPlan(Integer id);
+
+    HttpRespMsg allPlanList(HttpServletRequest request);
 }

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

@@ -138,4 +138,6 @@ public interface ReportService extends IService<Report> {
     HttpRespMsg getDpetStatisticsProgressList(String deptId, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize);
 
     HttpRespMsg exportDpetStatisticsProgressList(String deptId, String userId, String startDate, String endDate);
+
+    HttpRespMsg exportReport(String startDate, String endDate, Integer planId, Integer stateKey, Integer departmentId, HttpServletRequest request);
 }

+ 63 - 20
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanProcedureTotalServiceImpl.java

@@ -6,6 +6,7 @@ import com.management.platform.mapper.*;
 import com.management.platform.service.PlanProcedureTotalService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.util.HttpRespMsg;
+import org.apache.logging.log4j.util.Chars;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
@@ -106,30 +107,47 @@ public class PlanProcedureTotalServiceImpl extends ServiceImpl<PlanProcedureTota
             if(planSteelStampNumber.getSteelStampNumberEnd().equals(planSteelStampNumber.getSteelStampNumberStart())){
                 list.add(planSteelStampNumber.getSteelStampNumberStart());
             }else {
-                //获取公有部分
-                char[] chars = planSteelStampNumber.getSteelStampNumberStart().toCharArray();
-                char[] chars2 = planSteelStampNumber.getSteelStampNumberEnd().toCharArray();
-                int indexFor=0;
-                for (int i = 0; i < chars.length; i++) {
-                    if(chars[i]!=chars2[i]){
-                        indexFor+=i;
-                        break;
-                    }
-                }
-                String allHasString=planSteelStampNumber.getSteelStampNumberStart().substring(0,indexFor);
-                String start=planSteelStampNumber.getSteelStampNumberStart().substring(indexFor);
-                String end=planSteelStampNumber.getSteelStampNumberEnd().substring(indexFor);
-                //判断是否都是纯数字
-                if(!start.matches("\\d+")||!end.matches("\\d+")){
-                    list.add(planSteelStampNumber.getSteelStampNumberStart());
-                    list.add(planSteelStampNumber.getSteelStampNumberEnd());
-                }else {
+                if(planSteelStampNumber.getRuleIndexStart()!=null&&planSteelStampNumber.getRuleIndexEnd()!=null){
+                    Integer startIndex = Integer.valueOf(planSteelStampNumber.getRuleIndexStart());
+                    Integer endIndex = Integer.valueOf(planSteelStampNumber.getRuleIndexEnd());
+                    int count = endIndex - startIndex;
+                    String start=planSteelStampNumber.getSteelStampNumberStart().substring(startIndex-1,endIndex);
+                    String end=planSteelStampNumber.getSteelStampNumberEnd().substring(startIndex-1,endIndex);
+                    String subOne = planSteelStampNumber.getSteelStampNumberStart().substring(0, startIndex-1);
+                    String subTwo = planSteelStampNumber.getSteelStampNumberStart().substring(endIndex);
+                    //判断是否都是纯数字
                     int index=Integer.valueOf(start);
                     while (Integer.valueOf(end)>index){
-                        list.add(allHasString+String.valueOf(index));
+                        list.add(subOne+String.format("%0"+(count+1)+"d",index)+subTwo);
                         index++;
                     }
-                    list.add(allHasString+end);
+                    list.add(subOne+String.valueOf(index)+subTwo);
+                }else {
+                    //获取公有部分
+                    char[] chars = planSteelStampNumber.getSteelStampNumberStart().toCharArray();
+                    char[] chars2 = planSteelStampNumber.getSteelStampNumberEnd().toCharArray();
+                    int indexFor=0;
+                    for (int i = 0; i < chars.length; i++) {
+                        if(chars[i]!=chars2[i]){
+                            indexFor+=i;
+                            break;
+                        }
+                    }
+                    String allHasString=planSteelStampNumber.getSteelStampNumberStart().substring(0,indexFor);
+                    String start=planSteelStampNumber.getSteelStampNumberStart().substring(indexFor);
+                    String end=planSteelStampNumber.getSteelStampNumberEnd().substring(indexFor);
+                    //判断是否都是纯数字
+                    if(!start.matches("\\d+")||!end.matches("\\d+")){
+                        list.add(planSteelStampNumber.getSteelStampNumberStart());
+                        list.add(planSteelStampNumber.getSteelStampNumberEnd());
+                    }else {
+                        int index=Integer.valueOf(start);
+                        while (Integer.valueOf(end)>index){
+                            list.add(allHasString+String.valueOf(index));
+                            index++;
+                        }
+                        list.add(allHasString+end);
+                    }
                 }
             }
         }
@@ -141,4 +159,29 @@ public class PlanProcedureTotalServiceImpl extends ServiceImpl<PlanProcedureTota
         }
         return msg;
     }
+
+    public static void main(String[] args) {
+        PlanSteelStampNumber planSteelStampNumber=new PlanSteelStampNumber();
+        planSteelStampNumber.setSteelStampNumberStart("3941");
+        planSteelStampNumber.setSteelStampNumberEnd("4592");
+        planSteelStampNumber.setRuleIndexStart(1);
+        planSteelStampNumber.setRuleIndexEnd(4);
+        //根据起始位置判断位数
+        List<String> list=new ArrayList<>();
+        Integer startIndex = Integer.valueOf(planSteelStampNumber.getRuleIndexStart());
+        Integer endIndex = Integer.valueOf(planSteelStampNumber.getRuleIndexEnd());
+        int count = endIndex - startIndex;
+        String start=planSteelStampNumber.getSteelStampNumberStart().substring(startIndex-1,endIndex);
+        String end=planSteelStampNumber.getSteelStampNumberEnd().substring(startIndex-1,endIndex);
+        String subOne = planSteelStampNumber.getSteelStampNumberStart().substring(0, startIndex-1);
+        String subTwo = planSteelStampNumber.getSteelStampNumberStart().substring(endIndex);
+        //判断是否都是纯数字
+        int index=Integer.valueOf(start);
+        while (Integer.valueOf(end)>index){
+            list.add(subOne+String.format("%0"+(count+1)+"d",index)+subTwo);
+            index++;
+        }
+        list.add(subOne+String.valueOf(index)+subTwo);
+        System.out.println(list);
+    }
 }

+ 28 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanServiceImpl.java

@@ -111,6 +111,7 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
         NumberFormat format = NumberFormat.getPercentInstance();
         format.setMinimumFractionDigits(2);
         queryWrapper.eq(Plan::getCompanyId,companyId);
+        queryWrapper.ne(Plan::getStatus,2);
         if(planType!=2){
             queryWrapper.eq(Plan::getPlanType,0);
         }else {
@@ -348,6 +349,8 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
             for (Map map : mapList) {
                 PlanSteelStampNumber p=new PlanSteelStampNumber();
                 p.setPlanId(plan.getId());
+                p.setRuleIndexStart(Integer.valueOf(String.valueOf(map.get("ruleIndexStart"))));
+                p.setRuleIndexEnd(Integer.valueOf(String.valueOf(map.get("ruleIndexEnd"))));
                 if(StringUtils.isEmpty(map.get("steelStampNumberStart"))&&StringUtils.isEmpty(map.get("steelStampNumberEnd"))){
                     continue;
                 }
@@ -1255,4 +1258,29 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
 
         return msg;
     }
+
+    @Override
+    public HttpRespMsg stopPlan(Integer id) {
+        HttpRespMsg httpRespMsg=new HttpRespMsg();
+        Plan plan = getById(id);
+        plan.setStatus(2);
+        List<PlanProcedureTotal> planProcedureTotals = planProcedureTotalService.list(new LambdaQueryWrapper<PlanProcedureTotal>().eq(PlanProcedureTotal::getPlanId, id));
+        List<Integer> ids = planProcedureTotals.stream().map(PlanProcedureTotal::getId).collect(Collectors.toList());
+        ids.add(-1);
+        List<ProdProcedureTeam> list = prodProcedureTeamService.list(new LambdaQueryWrapper<ProdProcedureTeam>().in(ProdProcedureTeam::getPlanProcedureId, ids));
+        prodProcedureTeamService.removeByIds(list.stream().map(ProdProcedureTeam::getId).collect(Collectors.toList()));
+        if(!updateById(plan)){
+            httpRespMsg.setError("验证失败");
+        }
+        return httpRespMsg;
+    }
+
+    @Override
+    public HttpRespMsg allPlanList(HttpServletRequest request) {
+        HttpRespMsg msg=new HttpRespMsg();
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        List<Plan> plans = planMapper.selectList(new LambdaQueryWrapper<Plan>().eq(Plan::getCompanyId, companyId));
+        msg.setData(plans);
+        return msg;
+    }
 }

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

@@ -1,6 +1,7 @@
 package com.management.platform.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -4685,4 +4686,44 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         msg.setData(resp);
         return msg;
     }
+
+    @Override
+    public HttpRespMsg exportReport(String startDate, String endDate, Integer planId, Integer stateKey, Integer departmentId, HttpServletRequest request) {
+        HttpRespMsg msg=new HttpRespMsg();
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        List<Department> departmentList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, companyId));
+        List<Map<String,Object>> reportList=reportMapper.getReportList(startDate,endDate,planId,stateKey,departmentId,companyId);
+        List<List<String>> dataList=new ArrayList<>();
+        String[] title={"员工","工号","所属部门","排除工单号/任务变更通知号","钢印号","工作时长","产品名称","工序名称","进度","质检类型","质检人","工作日期","填报日期"};
+        List<String> titleList=Arrays.asList(title);
+        dataList.add(titleList);
+        for (Map<String, Object> map : reportList) {
+            List<String> item=new ArrayList<>();
+            item.add(String.valueOf(map.get("userName")));
+            item.add(String.valueOf(map.get("jobNumber")));
+            String departmentName = convertDepartmentIdToCascade(Integer.valueOf(String.valueOf(map.get("departmentId"))), departmentList);
+            item.add(departmentName);
+            Integer planType = Integer.valueOf(String.valueOf(map.get("planType")));
+            if(planType==0){
+                item.add(map.get("productSchedulingNum")==null?"":String.valueOf(map.get("productSchedulingNum")));
+            }else {
+                item.add(map.get("taskChangeNoticeNum")==null?"":String.valueOf(map.get("taskChangeNoticeNum")));
+            }
+            item.add(map.get("steelNumArray")==null?"":String.valueOf(map.get("steelNumArray")));
+            item.add(String.valueOf(map.get("workingTime")));
+            item.add(String.valueOf(map.get("productName")));
+            item.add(String.valueOf(map.get("procedureName")));
+            item.add(String.valueOf(map.get("progress"))+"%");
+            item.add(String.valueOf(map.get("checkType")));
+            item.add(map.get("checkerName")==null?"":String.valueOf(map.get("checkerName")));
+            item.add(String.valueOf(map.get("createDate")));
+            item.add(String.valueOf(map.get("reportTime")));
+            dataList.add(item);
+        }
+        Company company = companyMapper.selectById(companyId);
+        String fileName=("日报统计导出_")+company.getCompanyName()+System.currentTimeMillis();
+        String resp = ExcelUtil.exportGeneralExcelByTitleAndList(fileName, dataList, path);
+        msg.setData(resp);
+        return msg;
+    }
 }

+ 2 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/PlanProcedureTotalMapper.xml

@@ -9,11 +9,12 @@
         <result column="prod_procedure_id" property="prodProcedureId" />
         <result column="total_wages" property="totalWages" />
         <result column="total_working_hours" property="totalWorkingHours" />
+        <result column="total_num" property="totalNum" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, plan_id, prod_procedure_id, total_wages, total_working_hours
+        id, plan_id, prod_procedure_id, total_wages, total_working_hours, total_num
     </sql>
 
 </mapper>

+ 5 - 3
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/PlanSteelStampNumberMapper.xml

@@ -5,13 +5,15 @@
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.management.platform.entity.PlanSteelStampNumber">
         <result column="plan_id" property="planId" />
-        <result column="steelStampNumberStart" property="steelStampNumberStart" />
-        <result column="steelStampNumberEnd" property="steelStampNumberEnd" />
+        <result column="steel_stamp_number_start" property="steelStampNumberStart" />
+        <result column="steel_stamp_number_end" property="steelStampNumberEnd" />
+        <result column="rule_index_start" property="ruleIndexStart" />
+        <result column="rule_index_end" property="ruleIndexEnd" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        plan_id, steelStampNumberStart, steelStampNumberEnd
+        plan_id, steel_stamp_number_start, steel_stamp_number_end, rule_index_start, rule_index_end
     </sql>
 
 </mapper>

+ 4 - 4
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ProdProcedureTeamMapper.xml

@@ -17,16 +17,17 @@
         <result column="status" property="status" />
         <result column="is_change" property="isChange" />
         <result column="steel_num_array" property="steelNumArray" />
+        <result column="finish_num" property="finishNum" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, company_id, user_id, work_time, job_of_money, progress, checker_id, checker_name, update_time, plan_procedure_id, status, is_change, steel_num_array
+        id, company_id, user_id, work_time, job_of_money, progress, checker_id, checker_name, update_time, plan_procedure_id, status, is_change, steel_num_array, finish_num
     </sql>
 
     <select id="getReportForWorkList" resultType="java.util.HashMap" >
         SELECT a.*, plan_procedure_total.plan_id, plan_procedure_total.prod_procedure_id, date_format(plan.`start_date`,'%Y-%m-%d') as start_date, date_format(plan.`end_date`,'%Y-%m-%d') as end_date, plan.`plan_type`,
-         plan.`product_scheduling_num`,plan.task_type_name,plan.task_name,plan.task_change_notice_num,
+        plan.`product_scheduling_num`,plan.task_type_name,plan.task_name,plan.task_change_notice_num,
         product.`name` AS product_name,prod_procedure.name AS procedure_name, prod_procedure.check_type, plan.check_type as plan_check_type,plan.vehicle_num_start,plan.vehicle_num_end
         FROM prod_procedure_team a
         left join plan_procedure_total on plan_procedure_total.id = a.plan_procedure_id
@@ -42,7 +43,7 @@
 
     <select id="getFillProcedureDetail" resultType="java.util.HashMap" >
         SELECT a.*, plan_procedure_total.plan_id, plan_procedure_total.prod_procedure_id, date_format(plan.`start_date`,'%Y-%m-%d') as start_date, date_format(plan.`end_date`,'%Y-%m-%d') as end_date, plan.`plan_type`,
-        plan.`product_scheduling_num`,plan.task_type_name,plan.task_name,plan.task_change_notice_num,
+               plan.`product_scheduling_num`,plan.task_type_name,plan.task_name,plan.task_change_notice_num,
                product.`name` AS product_name,prod_procedure.name AS procedure_name, if(plan.plan_type=0,prod_procedure.check_type, plan.check_type) as check_type, plan.station_id
         FROM prod_procedure_team a
                  left join plan_procedure_total on plan_procedure_total.id = a.plan_procedure_id
@@ -51,5 +52,4 @@
                  LEFT JOIN prod_procedure ON prod_procedure.id = plan_procedure_total.prod_procedure_id
         where a.id = #{id}
     </select>
-
 </mapper>

+ 24 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ReportMapper.xml

@@ -20,6 +20,8 @@
         <result column="checker_id" property="checkerId" />
         <result column="user_procedure_team_id" property="userProcedureTeamId" />
         <result column="steel_num_array" property="steelNumArray" />
+        <result column="steel_num_array" property="steelNumArray" />
+        <result column="finish_num" property="finishNum" />
     </resultMap>
     <resultMap id="FullMap" type="com.management.platform.entity.vo.ReportVO" extends="BaseResultMap">
         <result column="creatorName" property="creatorName" />
@@ -29,7 +31,7 @@
     </resultMap>
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, creator_id, create_date, working_time, create_time, cost, dept_id, company_id, plan_id, progress, product_id, prod_procedure_id, check_type, checker_id, user_procedure_team_id, steel_num_array
+        id, creator_id, create_date, working_time, create_time, cost, dept_id, company_id, plan_id, progress, product_id, prod_procedure_id, check_type, checker_id, user_procedure_team_id, steel_num_array, finish_num
     </sql>
     <select id="getReportFillStatus" resultType="java.util.Map">
         SELECT DATE_FORMAT(create_date,'%Y-%m-%d') as createDate FROM report
@@ -261,7 +263,6 @@
                 and r.create_date between #{startDate} and #{endDate}
             </if>
             <if test="steelNum!=null and steelNum!=''">
-            and r.steel_num_array is not null and
             JSON_CONTAINS(r.steel_num_array,CONCAT('"',#{steelNum},'"'))
             </if>
         </where>
@@ -435,5 +436,26 @@
         group by b.station_id
         ) as total
     </select>
+    <select id="getReportList" resultType="java.util.Map">
+        select p.plan_type as planType,u.name as userName,u.job_number as jobNumber,d.department_id as departmentId,p.product_scheduling_num as productSchedulingNum,
+        p.task_change_notice_num as taskChangeNoticeNum,r.steel_num_array as steelNumArray,r.working_time as workingTime,p.product_name as productName,
+        pp.name as procedureName,r.progress as progress,(CASE r.check_type WHEN 0 THEN '自检' WHEN 1 THEN '互检' ELSE '专检' END ) as checkType ,uu.name as checkerName,
+        date_format(r.create_date,'%Y-%m-%d') as createDate,date_format(r.create_time,'%Y-%m-%d %T') as reportTime  from report r
+        left join plan p on p.id=r.plan_id
+        left join department d on d.department_id=p.station_id
+        left join user u on r.creator_id=u.id
+        left join prod_procedure pp on pp.id=r.prod_procedure_id
+        left join user uu on uu.id=r.checker_id
+        where r.company_id=#{companyId}
+        <if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
+            and r.create_date between  #{startDate} and #{endDate}
+        </if>
+        <if test="departmentId!=null">
+            and p.station_id=#{departmentId}
+        </if>
+        <if test="planId!=null">
+            and r.plan_id=#{planId}
+        </if>
+    </select>
 
 </mapper>

+ 4 - 3
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/login/index.vue

@@ -26,7 +26,7 @@
                 defaultHeight: '0',  //默认屏幕高度
                 nowHeight:  '0',  //实时屏幕高度
                 form: {
-                    username: "屈跃庭",
+                    username: "",
                     password: "",
                 },
                 rules: {
@@ -50,9 +50,9 @@
                         this.$store.commit("updateLogin", true);
                         localStorage.userInfo = JSON.stringify(user);
                         
-                        this.$router.push("/index").catch(err => { console.log(err, '错误1')});
+                        this.$router.push({path:"/index", query: {date: new Date().getTime()}}).catch(err => { console.log(err, '错误1')});
                         //强制刷新,避免index页面中的mounted不执行
-                        window.location.reload();
+                        // window.location.reload();
                     } else {
                         this.$toast.clear();
                         // this.$router.push('/expire')
@@ -189,6 +189,7 @@
             }
         },
         mounted() {
+            // alert('这是login页面==='+new Date().getTime());
             var ua = navigator.userAgent.toLowerCase();
             if (ua.indexOf("wxwork") > 0) {
                 this.isCorpWX = true;

+ 12 - 29
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/my/children/center.vue

@@ -21,7 +21,7 @@
                 <div style="height: 20px;background: #f4f4f4"></div>
                 
                 <van-cell title="公司" :title-style="'flex: 0.5;'" :value="userInfo.companyName"></van-cell>
-                <van-cell title="有效日期" :title-style="'flex: 0.5;'" :value="expirationDate"></van-cell> 
+                <van-cell title="有效日期" :title-style="'flex: 0.5;'" :value="userInfo.company.expirationDate"></van-cell> 
 
                 <div style="height: 20px;background: #f4f4f4"></div>
             </div>
@@ -31,10 +31,12 @@
                     <span v-if="(isCorpWX && userInfo.corpwxUserid != null) || (isWX && userInfo.wxOpenid != null)" style="color:#7CCD7C;">已绑定</span>
                 </template>
             </van-cell> -->
-            <van-button class="logout" @click="logout" block round type="danger" v-if="userInfo.roleName=='超级管理员' || userInfo.roleName=='系统管理员'">退出登录</van-button>
+            <van-button class="logout" @click="logout" block round type="danger" v-if="isFromManager || userInfo.roleName=='超级管理员' || userInfo.roleName=='系统管理员'">退出登录</van-button>
+
+            <p v-if="isFromManager" style="padding:10px;color:#666666;text-align:center;font-size:14px;">*当前为管理员代填模式*</p>
         </main>
 
-        <Footer page="my" />
+        <!-- <Footer page="my" /> -->
     </div>
 </template>
 
@@ -52,19 +54,24 @@
 
         data() {
             return {
+                isFromManager: localStorage.isFromManager?true:false,
                 userInfo: JSON.parse(localStorage.userInfo),
                 isCorpWX:false,
                 isWX:false,
-                expirationDate: '', // 有效日期
                 version: '', // 版本
                 show: false,
-                
                 wxManager: false,
             }
         },
 
         methods: {
             logout() {
+                if(localStorage.userInfo) {
+                    if (this.userInfo.roleName=='超级管理员' || this.userInfo.roleName=='系统管理员') {
+                        localStorage.isFromManager = 1;
+                    }
+                }
+
                 this.$store.commit("updateLogin", false);
                 localStorage.removeItem("userInfo");
                 this.$router.push({path:"/login", query: {loginAny: true}});
@@ -88,19 +95,6 @@
                 var weixinUrl="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appId+"&redirect_uri="+encodeURI(url)+"&response_type=code&scope=snsapi_base&state=0#wechat_redirect";
                 window.location.href = weixinUrl;
             },
-            // 判断是否有添加员工的权限
-            getWxManager() {
-                this.$axios.post("/user/isManager", {})
-                .then(res => {
-                    if(res.code == "ok") {
-                        let bur = res.data + ''
-                        this.wxManager = bur == 'true'
-                    } else {
-                        this.$toast.clear();
-                        this.$toast.fail(res.msg);
-                    }
-                }).catch(err=> {this.$toast.clear();});
-            }
         },
         create() {
         },
@@ -112,17 +106,6 @@
                 this.isWX = true;
             }
             
-            // 拼接有效日期 和 版本
-            if(localStorage.userInfo) {
-                // 日期
-                let userss = JSON.parse(localStorage.userInfo)
-                userss.company.expirationDate[2] >= 10 ? userss.company.expirationDate[2] : userss.company.expirationDate[1] = '0' + userss.company.expirationDate[2]
-                userss.company.expirationDate[1] >= 10 ? userss.company.expirationDate[1] : userss.company.expirationDate[1] = '0' + userss.company.expirationDate[1]
-                this.expirationDate = userss.company.expirationDate[0] + '-' + userss.company.expirationDate[1] + '-' + userss.company.expirationDate[2]
-                console.log(this.version)
-            }
-
-            this.getWxManager()
         }
     };
 </script>

+ 19 - 0
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/component/planComponent.vue

@@ -44,6 +44,9 @@
                   <span class="text" @click="hidePlan(item.id,item.hideState)">
                     {{ jisuanDate(item.startDate)>30 ? '隐藏' : ''}}
                   </span>
+                  <span class="text" @click="stopPlan(item.id,item.hideState)">
+                    {{ item.progress==null||item.progress==0 ? '中止计划' : ''}}
+                  </span>
                   <van-button type="info" size="small" @click="toDistribution(item)">派工单</van-button>
                 </div>
               </div>
@@ -138,6 +141,22 @@ export default {
             this.$toast.fail(res.msg);
           }
         }).catch(err => { this.$toast.clear(); })
+    },
+    stopPlan(id,state){
+      this.$axios.post(
+          "/plan/stopPlan",
+            {
+              id:id,
+            },
+        ).then(res => {
+          if (res.code == "ok") {
+             this.$toast.success('中止成功');
+             this.$emit('planClick','')
+          } else {
+            this.$toast.clear();
+            this.$toast.fail(res.msg);
+          }
+        }).catch(err => { this.$toast.clear(); })
     }
   },
 };

+ 176 - 133
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/planComponent.vue

@@ -9,8 +9,9 @@
         <div class="OutSide_center">
           <div class="block">
             <span class="demonstration">查询{{ titleLeftText }}{{ titleText }}</span>
-            <el-date-picker v-model="planDate" type="date" value-format="yyyy-MM-dd" :clearable="false" @change="getTableData(hasChooseDept)"
-              placeholder="选择日期" size="small" :picker-options="planType == 1 ? toMPickerOptions : todayPickerOptions">
+            <el-date-picker v-model="planDate" type="date" value-format="yyyy-MM-dd" :clearable="false"
+              @change="getTableData(hasChooseDept)" placeholder="选择日期" size="small"
+              :picker-options="planType == 1 ? toMPickerOptions : todayPickerOptions">
             </el-date-picker>
           </div>
           <div class="OutSide" style="padding-bottom: 0;">
@@ -24,7 +25,7 @@
           <el-link type="primary" :underline="false" @click="addPlan()">{{
             `新增${titleText}`
           }}</el-link>
-          <el-link type="primary" :underline="false" @click="importDataDialog=true">{{ "导入" }}</el-link>
+          <el-link type="primary" :underline="false" @click="importDataDialog = true">{{ "导入" }}</el-link>
           <el-link type="primary" :underline="false" @click="exportData()"
             :download="this.planType == 0 ? '今日计划' : this.planType == 1 ? '明日计划' : this.planType == 2 ? '插单计划' : '' + '.xlsx'">{{
               "导出"
@@ -45,7 +46,7 @@
           <el-button type="primary" size="mini" @click="(deptSetDialog = true), getPlanDeptSet()">部门设置</el-button>
         </div>
       </div>
-      
+
 
       <!-- 各部分数据列表 -->
       <el-table :data="tableData" style="width: 100%;" height="0" v-loading="tableDataLoading"
@@ -70,7 +71,7 @@
         <el-table-column prop="foremanName" label="工长" width="180">
           <template slot-scope="scope">
             <div @click="getFormenDetail(scope.row)" class="colorText">
-              {{ scope.row.foremanName}}
+              {{ scope.row.foremanName }}
             </div>
           </template>
         </el-table-column>
@@ -78,10 +79,11 @@
         </el-table-column>
         <el-table-column prop="endDate" label="完工时间" width="180">
         </el-table-column>
-        <el-table-column label="操作" :fixed="'right'" >
+        <el-table-column label="操作" :fixed="'right'">
           <template slot-scope="scope">
             <div @click="editPlan(scope.row)" class="colorText">编辑</div>
-            <div v-if="jisuanDate(scope.row.startDate)>30" @click="hidePlan(scope.row.id,scope.row.hideState)" class="colorText">{{scope.row.hideState==0?'隐藏':'取消隐藏'}}</div>
+            <div v-if="jisuanDate(scope.row.startDate) > 30" @click="hidePlan(scope.row.id, scope.row.hideState)"
+              class="colorText">{{ scope.row.hideState == 0 ? '隐藏' : '取消隐藏' }}</div>
           </template>
         </el-table-column>
       </el-table>
@@ -95,7 +97,7 @@
     </div>
 
     <!-- 新增今日计划 -->
-    <el-dialog :title="titleName" :visible.sync="editPlanDiaLog" width="800px" top="190px" :before-close="handleClose">
+    <el-dialog :title="titleName" :visible.sync="editPlanDiaLog" width="800px" top="7.5vh" :before-close="handleClose">
       <div class="planDialog">
         <el-form ref="todayPlanForm" :rules="todayPlanFormrules" :model="todayPlanForm" label-width="120px">
           <el-form-item label="排产工单号" style="width: 100%" prop="productSchedulingNum">
@@ -110,23 +112,35 @@
           <el-form-item label="项目代码" style="width: 100%" prop="projectCode">
             <el-input v-model="todayPlanForm.projectCode" maxlength="50" readonly></el-input>
           </el-form-item>
-          <el-form-item label="钢印号" v-for="(item,index) in todayPlanForm.steelStampNumberList" :key="index" style="width: 100%" prop="steelStampNumberStart">
-            <el-input class="w45" v-model="item.steelStampNumberStart" maxlength="20"></el-input>
-            {{ "-" }}
-            <el-input class="w45" v-model="item.steelStampNumberEnd" maxlength="20"></el-input>
-            <i class="el-icon-delete" style="color:red" @click="deleteInput(index)"></i>
-          </el-form-item>
+
+          <div v-for="(item, index) in todayPlanForm.steelStampNumberList" style="width: 100%;margin-bottom: 10px;">
+            <el-form-item label="钢印号" :key="index" style="width: 100%" prop="steelStampNumberStart">
+              <el-input class="w45" v-model="item.steelStampNumberStart" maxlength="20"></el-input>
+              {{ "-" }}
+              <el-input class="w45" v-model="item.steelStampNumberEnd" maxlength="20"></el-input>
+            </el-form-item>
+
+            <el-form-item label="编码起始位置" :key="index" style="width: 100%" prop="steelStampNumberStart">
+              <el-input-number v-model="item.ruleIndexStart" :min="1" :controls="false" step-strictly
+                :step="1"></el-input-number>
+              {{ "-" }}
+              <el-input-number v-model="item.ruleIndexEnd" :min="item.ruleIndexStart" :controls="false" step-strictly
+                :step="1"></el-input-number>
+            </el-form-item>
+
+            <i class="el-icon-delete" style="color:red; float: right;" @click="deleteInput(index)" v-if="index != 0"></i>
+          </div>
           <i class="el-icon-circle-plus" style="color:#409EFF" @click="addInput"></i>
-          <el-form-item label="计划总工价" v-if="this.titleName==='编辑今日计划'"  prop="planTotalWages">
+          <el-form-item label="计划总工价" v-if="this.titleName === '编辑今日计划'" prop="planTotalWages">
             <el-input v-model="todayPlanForm.planTotalWages" type="number"></el-input>
           </el-form-item>
           <!-- <el-form-item label="进度"  :style="this.titleName==='编辑今日计划'?'':'width: 100%'" prop="progress">
             <el-input v-model="todayPlanForm.progress" maxlength="20"></el-input>
           </el-form-item> -->
           <el-form-item label="车辆序号" style="width: 100%" prop="steelStampNumberStart">
-          <el-input-number class="w45" v-model="todayPlanForm.vehicleNumStart" maxlength="20"></el-input-number>
-          {{ "-" }}
-          <el-input-number class="w45" v-model="todayPlanForm.vehicleNumEnd" maxlength="20"></el-input-number>
+            <el-input-number class="w45" v-model="todayPlanForm.vehicleNumStart" maxlength="20"></el-input-number>
+            {{ "-" }}
+            <el-input-number class="w45" v-model="todayPlanForm.vehicleNumEnd" maxlength="20"></el-input-number>
           </el-form-item>
           <el-form-item label="数量" prop="num">
             <el-input v-model="todayPlanForm.num" maxlength="10" type="number"></el-input>
@@ -169,7 +183,7 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="
-//          (editPlanDiaLog = false), $refs['todayPlanForm'].resetFields()
+          //          (editPlanDiaLog = false), $refs['todayPlanForm'].resetFields()
           (editPlanDiaLog = false)
           ">取 消</el-button>
         <el-button type="primary" @click="addPlanData('todayPlanForm')">确 定</el-button>
@@ -201,13 +215,13 @@
     <!-- 工长弹框 -->
     <el-dialog title="工长信息" :visible.sync="foremanDetailDialog" width="30%" :before-close="handleClose">
       <div>
-        <span>姓名:{{this.foremanDetail.name}}</span>
+        <span>姓名:{{ this.foremanDetail.name }}</span>
       </div>
       <div>
-        <span>工种:{{this.foremanDetail.workType}}</span>
+        <span>工种:{{ this.foremanDetail.workType }}</span>
       </div>
       <div>
-        <span>工号:{{this.foremanDetail.jobNumber}}</span>
+        <span>工号:{{ this.foremanDetail.jobNumber }}</span>
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="foremanDetailDialog = false">关闭</el-button>
@@ -215,15 +229,18 @@
     </el-dialog>
 
     <!--导入计划 -->
-    <el-dialog :title="this.titleText+'导入'" :visible.sync="importDataDialog"  width="500px">
-        <p>1. 下载
-        <el-link type="primary" style="margin-left:5px;" :underline="false" :href="'./upload/'+this.titleText+'导入模板.xlsx'" :download="this.titleText+'导入模板.xlsx'">{{this.titleText+'导入模板.xlsx'}}</el-link>
-        </p>
-        <p style="display: flex;justify-content: center;">
-            <el-upload ref="upload"  action="#" :limit="1" :http-request="importData" :show-file-list="false">
-              <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
-            </el-upload>
-        </p>
+    <el-dialog :title="this.titleText + '导入'" :visible.sync="importDataDialog" width="500px">
+      <p>1. 下载
+        <el-link type="primary" style="margin-left:5px;" :underline="false"
+          :href="'./upload/' + this.titleText + '导入模板.xlsx'" :download="this.titleText + '导入模板.xlsx'">{{ this.titleText +
+            '导入模板.xlsx' }}</el-link>
+      </p>
+      <p style="display: flex;justify-content: center;">
+        <el-upload ref="upload" action="#" :limit="1" :http-request="importData" :show-file-list="false">
+          <el-button type="primary" :underline="false" :loading="importingData">{{ $t("other.startImporting")
+          }}</el-button>
+        </el-upload>
+      </p>
     </el-dialog>
   </div>
 </template>
@@ -258,8 +275,8 @@ export default {
           return v.getTime() < Date.now();
         }
       },
-      importDataDialog:false,
-      importingData:false,
+      importDataDialog: false,
+      importingData: false,
       steelStampNumber: "",
       planDate: this.todayDate,
       deptSetDialog: false,
@@ -276,8 +293,8 @@ export default {
         projectCode: "",
         // steelStampNumberStart: "",
         // steelStampNumberEnd: "",
-        vehicleNumStart:"",
-        vehicleNumEnd:"",
+        vehicleNumStart: "",
+        vehicleNumEnd: "",
         num: "",
         mainProcess: "",
         progress: "",
@@ -288,18 +305,20 @@ export default {
         endDate: "",
         describtion: "",
         versionNumber: "",
-        planTotalWages:0,
-        steelStampNumberList:[
-        {
-          id:null,
-          steelStampNumberStart:'',
-          steelStampNumberEnd:''
-        }
+        planTotalWages: 0,
+        steelStampNumberList: [
+          {
+            id: null,
+            steelStampNumberStart: '',
+            steelStampNumberEnd: '',
+            ruleIndexStart: '',
+            ruleIndexEnd: '',
+          }
         ],
       },
       user: JSON.parse(sessionStorage.getItem("user")),
-      foremanDetailDialog:false,
-      foremanDetail:{},
+      foremanDetailDialog: false,
+      foremanDetail: {},
       todayTabIndex: 0,
       tableDataLoading: false,
       tableData: [],
@@ -343,33 +362,35 @@ export default {
       this.getProductList();
   },
   methods: {
-    addInput(){
-      console.log('===========',this.todayPlanForm.steelStampNumberList)
-      console.log('===========',this.todayPlanForm)
-      if(this.todayPlanForm.steelStampNumberList.length>=9){
+    addInput() {
+      console.log('===========', this.todayPlanForm.steelStampNumberList)
+      console.log('===========', this.todayPlanForm)
+      if (this.todayPlanForm.steelStampNumberList.length >= 9) {
         this.$message({
-              message: '超过最大条数(9)',
-              type: "error",
-            });
+          message: '超过最大条数(9)',
+          type: "error",
+        });
         return
       }
       this.todayPlanForm.steelStampNumberList.push({
-        id:null,
-        steelStampNumberStart:'',
-        steelStampNumberEnd:'',
+        id: null,
+        steelStampNumberStart: '',
+        steelStampNumberEnd: '',
+        ruleIndexStart: '',
+        ruleIndexEnd: '',
       });   // 在数组中添加一个空对象
     },
-    deleteInput(index){
-      this.todayPlanForm.steelStampNumberList.splice(index,1)
+    deleteInput(index) {
+      this.todayPlanForm.steelStampNumberList.splice(index, 1)
     },
-    getFormenDetail(item){
-      this.foremanDetailDialog=true;
+    getFormenDetail(item) {
+      this.foremanDetailDialog = true;
       this.http.post(
         "/user/getUserInfo",
-        {userId:item.foremanId},
+        { userId: item.foremanId },
         (res) => {
           if (res.code == "ok") {
-            this.foremanDetail=res.data
+            this.foremanDetail = res.data
           } else {
             this.$message({
               message: res.msg,
@@ -386,7 +407,7 @@ export default {
       );
     },
     setProductCode() {
-      let arrList = this.productList.filter(item => item.id == this.todayPlanForm.productId) 
+      let arrList = this.productList.filter(item => item.id == this.todayPlanForm.productId)
       console.log('====>', arrList)
       this.todayPlanForm.projectCode = arrList[0].code
     },
@@ -617,7 +638,7 @@ export default {
       this.getTableData(this.hasChooseDept);
     },
     addPlan() {
-      console.log('===========',this.todayPlanForm)
+      console.log('===========', this.todayPlanForm)
       this.titleName = `新增${this.titleText}`;
       this.initTodayPlanForm()
       this.editPlanDiaLog = true;
@@ -644,56 +665,56 @@ export default {
         endDate: "",
         describtion: "",
         versionNumber: "",
-        steelStampNumberList:[
-        {
-          id:null,
-          steelStampNumberStart:'',
-          steelStampNumberEnd:''
-        }
+        steelStampNumberList: [
+          {
+            id: null,
+            steelStampNumberStart: '',
+            steelStampNumberEnd: ''
+          }
         ],
       }
     },
     addPlanData(formName) {
       console.log(this.todayPlanForm);
-      if(!this.todayPlanForm.steelStampNumberList){
-        for(item in this.todayPlanForm.steelStampNumberList){
-          if(!item.steelStampNumberStart){
-            if(item.steelStampNumberEnd){
-                this.$message({
-                    message:"钢印号区间填写不完整",
-                    type: "error",
-                });
-                return  
-          }
-      }
-      if(!item.steelStampNumberEnd){
-          if(item.steelStampNumberStart){
+      if (!this.todayPlanForm.steelStampNumberList) {
+        for (item in this.todayPlanForm.steelStampNumberList) {
+          if (!item.steelStampNumberStart) {
+            if (item.steelStampNumberEnd) {
               this.$message({
-                  message:"钢印号区间填写不完整",
-                  type: "error",
+                message: "钢印号区间填写不完整",
+                type: "error",
               });
               return
+            }
           }
-      }
-        }
-      }
-      if(!this.todayPlanForm.vehicleNumStart){
-          if(this.todayPlanForm.vehicleNumStart){
-              this.$message({
-                  message:"车辆序号区间填写不完整",
-                  type: "error",
-              });
-              return  
-          }
-      }
-      if(!this.todayPlanForm.vehicleNumEnd){
-          if(this.todayPlanForm.vehicleNumEnd){
+          if (!item.steelStampNumberEnd) {
+            if (item.steelStampNumberStart) {
               this.$message({
-                  message:"车辆序号区间填写不完整",
-                  type: "error",
+                message: "钢印号区间填写不完整",
+                type: "error",
               });
               return
+            }
           }
+        }
+      }
+      if (!this.todayPlanForm.vehicleNumStart) {
+        if (this.todayPlanForm.vehicleNumStart) {
+          this.$message({
+            message: "车辆序号区间填写不完整",
+            type: "error",
+          });
+          return
+        }
+      }
+      if (!this.todayPlanForm.vehicleNumEnd) {
+        if (this.todayPlanForm.vehicleNumEnd) {
+          this.$message({
+            message: "车辆序号区间填写不完整",
+            type: "error",
+          });
+          return
+        }
       }
       // if(this.todayPlanForm.endDate<this.todayPlanForm.startDate){
       //   this.$message({
@@ -702,6 +723,21 @@ export default {
       //         });
       //         return
       // }
+
+      // 判断校验规则
+
+      const { steelStampNumberList } = this.todayPlanForm;
+
+      for (const [i, { steelStampNumberStart, steelStampNumberEnd, ruleIndexEnd, ruleIndexStart }] of steelStampNumberList.entries()) {
+        if (steelStampNumberStart && steelStampNumberEnd && (!ruleIndexEnd || !ruleIndexStart)) {
+          this.$message({
+            message: `第${i}条钢印号校验规则填写不完整`,
+            type: "error",
+          });
+          return;
+        }
+      }
+
       this.$refs[formName].validate((valid) => {
         if (valid) {
           console.log(this.todayPlanForm, "传给后端的值");
@@ -709,7 +745,7 @@ export default {
             this.todayPlanForm.stationId[
             this.todayPlanForm.stationId.length - 1
             ];
-          let steelStampNumberListArr= this.todayPlanForm.steelStampNumberList  
+          let steelStampNumberListArr = this.todayPlanForm.steelStampNumberList
           this.$delete(this.todayPlanForm, 'product')
           this.$delete(this.todayPlanForm, 'planProcedureTotals')
           this.$delete(this.todayPlanForm, 'steelStampNumberList')
@@ -719,7 +755,7 @@ export default {
               ...this.todayPlanForm,
               stationId,
               planType: this.planType,
-              steelStampNumber:JSON.stringify(steelStampNumberListArr)
+              steelStampNumber: JSON.stringify(steelStampNumberListArr)
             },
             (res) => {
               if (res.code == "ok") {
@@ -750,6 +786,12 @@ export default {
         }
       });
     },
+    // 输入长度
+    inputLength(str) {
+      const strNum = str.length;
+      const lng = '9'.repeat(strNum);
+      return +lng;
+    },
     editPlan(item) {
       (this.titleName = `编辑${this.titleText}`), (this.editPlanDiaLog = true);
       this.todayPlanForm = item;
@@ -929,7 +971,7 @@ export default {
         }
       );
     },
-    jisuanDate(startDate){
+    jisuanDate(startDate) {
       let date1 = new Date(startDate);
       let date2 = new Date();
       date1 = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate());
@@ -939,51 +981,51 @@ export default {
       return diffDate;
     },
     //隐藏计划
-    hidePlan(id,state){
-      this.$alert(state==0?'隐藏计划在移动端将无法展示':'取消隐藏计划将在移动端将展示',state==0?'是否隐藏计划':'是否取消隐藏计划', {
-          confirmButtonText: '确定',
-          callback: action => {
-            this.http.post(
-              "/plan/hidePlan",
-              {
-                id:id,
-                state:state==0?1:0
-              },
-              (res) => {
-                if (res.code == "ok") {
-                  this.$message({
-                    message: '隐藏成功',
-                    type: "success",
-                  });
-                } else {
-                  this.$message({
-                    message: res.msg,
-                    type: "error",
-                  });
-                }
-                this.getTableData()
-              },
-              (error) => {
+    hidePlan(id, state) {
+      this.$alert(state == 0 ? '隐藏计划在移动端将无法展示' : '取消隐藏计划将在移动端将展示', state == 0 ? '是否隐藏计划' : '是否取消隐藏计划', {
+        confirmButtonText: '确定',
+        callback: action => {
+          this.http.post(
+            "/plan/hidePlan",
+            {
+              id: id,
+              state: state == 0 ? 1 : 0
+            },
+            (res) => {
+              if (res.code == "ok") {
+                this.$message({
+                  message: '隐藏成功',
+                  type: "success",
+                });
+              } else {
                 this.$message({
-                  message: error,
+                  message: res.msg,
                   type: "error",
                 });
               }
-            );
-          }
+              this.getTableData()
+            },
+            (error) => {
+              this.$message({
+                message: error,
+                type: "error",
+              });
+            }
+          );
+        }
       });
     }
   },
 };
 </script>
 <style scoped lang='scss'>
-
 .today-tab-btn {
   width: 100%;
   display: flex;
   align-items: center;
   margin-bottom: 10px;
 }
+
 .colorText {
   color: #02a7f0;
   cursor: pointer;
@@ -1084,7 +1126,7 @@ export default {
     div {
       font-size: 16px;
       margin-left: 15px;
-      min-width: fit-content;      
+      min-width: fit-content;
       cursor: pointer;
     }
 
@@ -1100,7 +1142,8 @@ export default {
 
   // 新增样式
   .planDialog {
-    max-height: 42vh;
+    // max-height: 42vh;
+    max-height: 62vh;
     overflow-y: auto;
     scrollbar-width: none;
     /* Firefox */

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/statistic/index.vue

@@ -1405,7 +1405,7 @@ export default {
 }
 // 新增样式
 .planDialog {
-    max-height: 42vh;
+    max-height: 62vh;
     overflow-y: auto;
     scrollbar-width: none;
     /* Firefox */

+ 26 - 19
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/workReport/daily.vue

@@ -116,7 +116,7 @@
                                     <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</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.reportSettings" style="margin-right:10px;" :underline="false" @click="fillInReport(-1,2)">补报设置</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" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
                                     <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showWorkTime" >查看报工记录</el-link>
                                     <!--部门负责人给个导出工时的功能 -->
                                     <!-- <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link> -->
@@ -658,12 +658,12 @@
         <!--导出报表条件选择 -->
         <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
             <el-form ref="form3" :model="exportParam" >
-                <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
-                    <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')"  clearable filterable style="width:350px;">
-                        <el-option v-for="item in projectList"  :key="item.id" :label="item.projectName" :value="item.id"></el-option>
+                <!-- <el-form-item prop="projectId" :label="'导出计划'">
+                    <el-select v-model="exportParam.projectId" :placeholder="'全部计划'"  clearable filterable style="width:350px;">
+                        <el-option v-for="item in allPlanList"  :key="item.id" :label="item.productName" :value="item.id"></el-option>
                     </el-select>
-                </el-form-item>
-                <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
+                </el-form-item> -->
+                <el-form-item prop="departmentId" :label="'选择工位'" v-if="permissions.reportsCompany">
 
                     <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="exportParam.departmentId" :placeholder="$t('other.allDepartments')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
 
@@ -681,13 +681,13 @@
                         :end-placeholder="$t('time.endDate')"
                     ></el-date-picker>
                 </el-form-item>
-                <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
+                <!-- <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
                     <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
                         <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
                         <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
                         <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
                     </el-select>
-                </el-form-item>
+                </el-form-item> -->
             </el-form>
             <div slot="footer" class="dialog-footer">
                 <el-button type="primary" @click="exportReport" style="width:100%;" :loading="listLoading">{{$t('export.export')}}</el-button>
@@ -1645,6 +1645,8 @@
                 integrationProjectList: [],
 
                 totalReportHours: 0, // 合计的工时
+
+                allPlanList: [], // 所有计划
             };
         },
         watch: {
@@ -1694,6 +1696,7 @@
             // this.getTimeType();
             this.getDepartment();
             this.scrollFunction()
+            this.getAllPlanList()
             // this.userssHu();
             if(this.user.timeType.reportAuditType == 3){
                 this.getAllUsersList()
@@ -1714,6 +1717,14 @@
         },
         methods: {
             ...mapMutations(['upDataLoading']),
+            // 获取所有计划
+            getAllPlanList() {
+                this.http.post('/plan/allPlanList', {}, res => {
+                    if(res.code == 'ok') {
+                        this.allPlanList = res.data
+                    }
+                })
+            },
             openModImportTime(row) {
                 this.showModImportTimeDialog = true;
                 this.modItemDataId = row.id;
@@ -4259,18 +4270,14 @@
             exportReport() {
                 this.listLoading = true;
                 var param = {};
-                if (this.exportParam.dateRange != null) {
-                    param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
-                }
-                if (this.exportParam.projectId != null) {
-                    param.projectId = this.exportParam.projectId;
-                }
-                if (this.exportParam.departmentId != null) {
-                    param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
+                const { dateRange, departmentId } = this.exportParam
+                param.startDate = dateRange[0]
+                param.endDate = dateRange[1]
+                console.log(departmentId)
+                if(departmentId && departmentId.length > 0) {
+                    param.departmentId = departmentId[departmentId.length - 1]
                 }
-                param.stateKey = this.stateKey
-                // param.departmentId = this.user.departmentId
-                this.http.post( this.port.report.export, param,
+                this.http.post('/report/exportReport', param,
                 res => {
                     this.listLoading = false;
                     if (res.code == "ok") {

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

@@ -188,9 +188,9 @@
                         if(this.user.companyId != '1071') { // 针对物奇公司去掉填写日报
                             this.routers.push({name: '填写日报',url: '/edit',icon: 'edit'})
                             //物奇临时去掉按周填报
-                            this.routers.push({name: '按周填报',url: '/weekEdit',icon: 'records'})
+                            // this.routers.push({name: '按周填报',url: '/weekEdit',icon: 'records'})
                         }
-                        // this.routers.push({name: '按周填报',url: '/weekEdit',icon: 'records'})                        }
+                        this.routers.push({name: '按周填报',url: '/weekEdit',icon: 'records'})
                     }
                     if(list[i].name == '待办任务') {
                         this.routers.push({