فهرست منبع

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

# Conflicts:
#	fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ReportMapper.xml
seyason 1 سال پیش
والد
کامیت
f917143848

+ 6 - 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;
 
 /**
@@ -148,5 +149,10 @@ public class PlanController {
     public HttpRespMsg stopPlan(Integer id){
         return planService.stopPlan(id);
     }
+
+    @RequestMapping("/allPlanList")
+    public HttpRespMsg allPlanList(HttpServletRequest request){
+        return planService.allPlanList(request);
+    }
 }
 

+ 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);
 }

+ 4 - 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>
  *  服务类
@@ -50,4 +52,6 @@ public interface PlanService extends IService<Plan> {
     HttpRespMsg getNowMouthProdProgress();
 
     HttpRespMsg stopPlan(Integer id);
+
+    HttpRespMsg allPlanList(HttpServletRequest request);
 }

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

@@ -162,10 +162,10 @@ public class PlanProcedureTotalServiceImpl extends ServiceImpl<PlanProcedureTota
 
     public static void main(String[] args) {
         PlanSteelStampNumber planSteelStampNumber=new PlanSteelStampNumber();
-        planSteelStampNumber.setSteelStampNumberStart("LEW00021098-0001");
-        planSteelStampNumber.setSteelStampNumberEnd("LEW00021111-0001");
-        planSteelStampNumber.setRuleIndexStart(9);
-        planSteelStampNumber.setRuleIndexEnd(11);
+        planSteelStampNumber.setSteelStampNumberStart("3941");
+        planSteelStampNumber.setSteelStampNumberEnd("4592");
+        planSteelStampNumber.setRuleIndexStart(1);
+        planSteelStampNumber.setRuleIndexEnd(4);
         //根据起始位置判断位数
         List<String> list=new ArrayList<>();
         Integer startIndex = Integer.valueOf(planSteelStampNumber.getRuleIndexStart());

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

@@ -1274,4 +1274,13 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
         }
         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;
+    }
 }

+ 37 - 1
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;
@@ -4688,6 +4689,41 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 
     @Override
     public HttpRespMsg exportReport(String startDate, String endDate, Integer planId, Integer stateKey, Integer departmentId, HttpServletRequest request) {
-        return null;
+        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;
     }
 }

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

@@ -20,6 +20,7 @@
         <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">
@@ -262,8 +263,7 @@
                 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},'"'))
+            JSON_CONTAINS(r.steel_num_array,CONCAT('"',#{steelNum},'"'))
             </if>
         </where>
         order by r.create_date desc
@@ -436,4 +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>

+ 173 - 131
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>
@@ -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;
     }
 

+ 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({