Преглед на файлове

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

Min преди 1 година
родител
ревизия
3b35f97587

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

@@ -1210,7 +1210,7 @@ public class ReportController {
                                 hasReport = new BigDecimal(groupSum).add(new BigDecimal(nowReport));
                                 TaskGroup tgp = taskGroupService.getById(targetGpId);
                                 //设置的数值大于0时检查是否超额
-                                if (tgp.getManDay() != null && tgp.getManDay() > 0) {
+                                if (tgp != null && tgp.getManDay() != null && tgp.getManDay() > 0) {
                                     multiply = new BigDecimal(tgp.getManDay()).multiply(new BigDecimal(comTimeType.getAllday()));
                                     System.out.println("hasReport:"+hasReport+" multiply:"+multiply);
                                     if (hasReport.doubleValue() > multiply.doubleValue()) {

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

@@ -166,7 +166,7 @@ public class PlanProcedureTotalServiceImpl extends ServiceImpl<PlanProcedureTota
             Stream<String> sorted = list.stream().distinct().sorted();
             List<String> collect = sorted.collect(Collectors.toList());
             //如果钢印号有其他人已经填过了,就不显示
-            List<Report> reportList = reportMapper.selectList(new QueryWrapper<Report>().select("id", "steel_num_array").eq("plan_id", planId));
+            List<Report> reportList = reportMapper.selectList(new QueryWrapper<Report>().select("id", "steel_num_array","create_date", "creator_id").eq("plan_id", planId));
             List<String> filledSteelNumList=new ArrayList<>();
 
             for (Report report : reportList) {
@@ -179,8 +179,17 @@ public class PlanProcedureTotalServiceImpl extends ServiceImpl<PlanProcedureTota
                     filledSteelNumList.addAll(Arrays.asList(split));
                 }
             }
-            List<String> collect1 = collect.stream().filter(item -> !filledSteelNumList.contains(item)).collect(Collectors.toList());
-            prodProcedureTeam.put("planSteelStampNumberList",collect1);
+//            List<String> collect1 = collect.stream().filter(item -> !filledSteelNumList.contains(item)).collect(Collectors.toList());
+            List<HashMap> steelMapList = new ArrayList<>();
+            for (String s : collect) {
+                HashMap map = new HashMap();
+                map.put("number", s);
+                if (filledSteelNumList.contains(s)) {
+                    map.put("disabled", true);
+                }
+                steelMapList.add(map);
+            }
+            prodProcedureTeam.put("planSteelStampNumberList",steelMapList);
             msg.setData(prodProcedureTeam);
         }
         return msg;

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

@@ -311,6 +311,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         for (ReportVO m : list) {
                             double t = m.getWorkingTime();
                             reportTime += t;
+                            System.out.println("t:"+t);
                             total = total.add(m.getCost());
                         }
 
@@ -320,7 +321,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         map.put("state", state);
                     }
                 }
-
                 List<Integer> allVisibleDeptIdList = getAllVisibleDeptIdList(user, null);
                 //需要看可见部门(部门主要负责人和其他负责人以及查看本部门工时权限)所有人员的日报
                 if (allVisibleDeptIdList.size() > 0) {
@@ -348,15 +348,17 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                             //再根据人分别获取当天的报告
                             List<ReportVO> rList = new ArrayList<ReportVO>();
                             BigDecimal total = new BigDecimal(0);
+                            double reportTime = 0;
                             for (ReportVO report : reportList) {
                                 if (report.getCreatorId().equals((String)memb.get("id"))) {
                                     rList.add(report);
+                                    reportTime += report.getWorkingTime();
                                     total = total.add(report.getCost());
                                 }
                             }
                             memb.put("data", rList);
                             memb.put("cost", total);
-                            double reportTime = 0;
+
                             if (rList.size() > 0) {
                                 int state = 1;
                                 memb.put("state", state);
@@ -399,15 +401,12 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     for (Map<String, Object> map : nameList) {
                         //再根据人分别获取当天的报告
                         List<ReportVO> list = new ArrayList<ReportVO>();
-//                        BigDecimal total = new BigDecimal(0);
                         for (ReportVO report : reportList) {
                             if (report.getCreatorId().equals((String)map.get("id"))) {
                                 list.add(report);
-//                                total = total.add(report.getCost());
                             }
                         }
                         map.put("data", list);
-//                        map.put("cost", total);
                         double reportTime = reportList.stream().filter(r->r.getCreatorId().equals((String)map.get("id"))).mapToDouble(ReportVO::getWorkingTime).sum();
                         if (list.size() > 0) {
                             int state = 1;
@@ -418,8 +417,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     }
                 }
             }
-
-
             httpRespMsg.data = nameList;
         } catch (NullPointerException e) {
             e.printStackTrace();

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

@@ -42,7 +42,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,plan.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

+ 15 - 4
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/workView/fillReport.vue

@@ -2,7 +2,7 @@
   <div class="distribution">
     <van-nav-bar title="报工" left-text="返回" @click-left="back" fixed left-arrow />
     <div class="distribution_header">
-      <div>{{ reportForm.product_name }}</div>
+      <div>{{ reportForm.product_name }}<span style="float:right;color:#20a0ff;">{{reportDate  }}</span> </div>
       <div>{{ reportForm.plan_type == 0 ? reportForm.product_scheduling_num : reportForm.task_change_notice_num }}</div>
       <div>{{ reportForm.start_date }}至{{ reportForm.end_date }}</div>
     </div>
@@ -16,8 +16,8 @@
             <template>
               <div style="float:right;" v-if="reportForm.planSteelStampNumberList&&reportForm.planSteelStampNumberList.length>0">
                 <van-checkbox-group v-model="reportForm.checkedSteelNum" direction="horizontal">
-                  <van-checkbox style="padding:5px;" :name="item" @click="onCheckChange"
-                    v-for="(item, index) in reportForm.planSteelStampNumberList" :key="index">{{ item }}</van-checkbox>
+                  <van-checkbox style="padding:5px;" :name="item.number" @click="onCheckChange" :disabled="item.disabled" 
+                    v-for="(item, index) in reportForm.planSteelStampNumberList" :key="index">{{ item.number }}</van-checkbox>
                 </van-checkbox-group>
               </div>
               <div v-else>无</div>
@@ -25,7 +25,7 @@
           </van-cell>
           <van-cell title="当日完成件数">
             <template>
-              <van-stepper v-model="reportForm.finishNum" step="0.1" :min="0" :max="1000" />
+              <van-stepper v-model="reportForm.finishNum" step="0.1" :min="0" :max="reportForm.num" @change="onFinishNumChange"/>
             </template>
           </van-cell>
           <van-cell title="完成全部工作" >
@@ -77,6 +77,7 @@ export default {
   },
   data() {
     return {
+      reportDate: null,
       checkerOptionList: [],
       checkerShow: false,
       user: JSON.parse(localStorage.userInfo),
@@ -93,9 +94,16 @@ export default {
   watch: {},
   created() { },
   mounted() {
+    this.reportDate = this.$route.query.date;
     this.getMyPlanProcedureList();
   },
   methods: {
+    onFinishNumChange() {
+      //件数发生改变时,检测如果和计划总件数一样,则算完成
+      if (this.reportForm.finishNum == this.reportForm.num) {
+          this.$set(this.reportForm, 'isFinish',true);
+      } 
+    },
     back() {
       this.$router.go(-1);
     },
@@ -171,6 +179,9 @@ export default {
       if(reportBoolean == 'true') {
         params.createDate = date
       }
+      if (this.reportDate) {
+        params.createDate = this.reportDate;
+      }
       this.$axios.post("/plan-procedure-total/getFillProcedureDetail", params)
         .then(res => {
           if (res.code == "ok") {

+ 102 - 59
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/workView/workView.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="distribution">
     <van-nav-bar :title="reportBoolean ? '查看报工' : '报工'" left-text="返回" @click-left="back" fixed left-arrow />
-    <div class="distribution_con contentRoll">
+    <div class="distribution_con contentRoll flex-column">
       <!-- 报工 -->
       <div v-if="!reportBoolean">
         <van-field v-model="vehicleNum" type="digit" label="车辆序号" @blur="getMyPlanProcedureList()" />
@@ -20,65 +20,75 @@
       </div>
       <!-- 内容 -->
       <van-empty v-if="myPlanProcedureList.length == 0">暂无待报工任务</van-empty>
-      <div v-for="(prod, prodIndex) in myPlanProcedureList" :key="prodIndex">
-        <div class="distribution_header">
-          <div class="textDis">
-            <span>{{ prod.plan_type == 0 ? prod.product_name : prod.task_name }}</span>
-            <span v-if="reportBoolean">{{ prod.userName }}</span>
+      <div class="flex1 myPlanProcedureListClass">
+        <div v-for="(prod, prodIndex) in myPlanProcedureList" :key="prodIndex" class="flex1 myPlanProcedureListClass">
+          <!-- 报工 -->
+          <div class="distribution_header" v-if="!reportBoolean">
+            <div class="textDis">
+              <span>{{ prod.plan_type == 0 ? prod.product_name : prod.task_name }}</span>
+            </div>
+            <div v-if="prod.plan_type == 0">{{ prod.product_scheduling_num }}</div>
+            <div>{{ dateBack(prod.start_date) }}-{{ dateBack(prod.end_date) }}</div>
+            <div v-if="prod.vehicle_num_start && prod.vehicle_num_end">{{ prod.vehicle_num_start }}-{{ prod.vehicle_num_end
+            }}</div>
           </div>
-          <div v-if="prod.plan_type == 0">{{ prod.product_scheduling_num }}</div>
-          <!-- <div>{{ prod.start_date.replace(/-/g, '') }}-{{ (!prod.end_date || prod.end_date == 'null') ? "" : prod.end_date.replace(/-/g, '') }}</div> -->
-          <div>{{ dateBack(prod.start_date) }}-{{ dateBack(prod.end_date) }}</div>
-          <div v-if="prod.vehicle_num_start && prod.vehicle_num_end">{{ prod.vehicle_num_start }}-{{ prod.vehicle_num_end
-          }}</div>
-        </div>
-        <div class="distribution_box" v-for="item, index in prod.procedureList" :key="index" @click="reportItem(item, prod)">
-          <!-- 状态 -->
-          <div class="statusLeft" :style="`background: ${statusColor[item.status]}`" v-if="item.status"></div>
-          <div>
-            <van-row>
-              <van-col span="19">{{ prod.plan_type == 0 ? item.procedure_name : prod.task_change_notice_num }}</van-col>
-              <van-col span="5" style="text-align:right;"><span style="color:goldenrod;font-size:16px;">{{ item.work_time
-              }}</span> <span style="font-size:12px;">分钟</span></van-col>
-            </van-row>
-            <div style="margin-top:10px;text-align: center;">
-              <van-row gutter="20">
-                <!-- <van-col span="8">
-                  <div class="valueCls">
-                    {{ item.progress }}%
-                  </div>
-                  <div class="labelCls">
-                    进度
-                  </div>
-                </van-col> -->
-                <van-col span="8">
-                  <div class="valueCls" v-if="reportBoolean">
-                    {{ (item.finishNum && item.finishNum) ? item.finishNum : 0 }}
-                  </div>
-                  <div class="valueCls" v-if="!reportBoolean">
-                    {{ item.num ? item.num : 0 }}
-                  </div>
-                  <div class="labelCls">
-                    件数
-                  </div>
-                </van-col>
-                <van-col span="8">
-                  <div class="valueCls">
-                    {{ checkTypeTxt[prod.plan_type == 0 ? item.check_type : item.plan_check_type] }}
-                  </div>
-                  <div class="labelCls">
-                    质检方式
-                  </div>
-                </van-col>
-                <van-col span="8">
-                  <div class="valueCls">
-                    {{ item.checker_name ? item.checker_name : '待设置' }}
-                  </div>
-                  <div class="labelCls">
-                    质检人
-                  </div>
-                </van-col>
+          <!-- 查看报工 -->
+          <div v-if="reportBoolean" class="marginRePor">
+            <div>总时长:<span>{{ +prod.reportTime + 0 }}</span> <i>分钟</i></div>
+            <div>{{ prod.userName }}</div>
+          </div>
+
+          <!-- 列表内容 -->
+          <div class="distribution_box" v-for="item, index in prod.procedureList" :key="index" @click="reportItem(item, prod)">
+            <!-- 状态 -->
+            <div class="statusLeft" :style="`background: ${statusColor[item.status]}`" v-if="item.status"></div>
+            <div v-if="reportBoolean" class="marginBtnPro">{{ item.productName }}</div>
+            <div v-if="reportBoolean" class="marginBtnPro">{{ item.productSchedulingNum }}</div>
+            <div>
+              <van-row>
+                <van-col span="19">{{ prod.plan_type == 0 ? item.procedure_name : prod.task_change_notice_num }}</van-col>
+                <van-col span="5" style="text-align:right;"><span style="color:goldenrod;font-size:16px;">{{ item.work_time
+                }}</span> <span style="font-size:12px;">分钟</span></van-col>
               </van-row>
+              <div style="margin-top:10px;text-align: center;">
+                <van-row gutter="20">
+                  <!-- <van-col span="8">
+                    <div class="valueCls">
+                      {{ item.progress }}%
+                    </div>
+                    <div class="labelCls">
+                      进度
+                    </div>
+                  </van-col> -->
+                  <van-col span="8">
+                    <div class="valueCls" v-if="reportBoolean">
+                      {{ (item.finishNum && item.finishNum) ? item.finishNum : 0 }}
+                    </div>
+                    <div class="valueCls" v-if="!reportBoolean">
+                      {{ item.num ? item.num : 0 }}
+                    </div>
+                    <div class="labelCls">
+                      件数
+                    </div>
+                  </van-col>
+                  <van-col span="8">
+                    <div class="valueCls">
+                      {{ checkTypeTxt[prod.plan_type == 0 ? item.check_type : item.plan_check_type] }}
+                    </div>
+                    <div class="labelCls">
+                      质检方式
+                    </div>
+                  </van-col>
+                  <van-col span="8">
+                    <div class="valueCls">
+                      {{ item.checker_name ? item.checker_name : '待设置' }}
+                    </div>
+                    <div class="labelCls">
+                      质检人
+                    </div>
+                  </van-col>
+                </van-row>
+              </div>
             </div>
           </div>
         </div>
@@ -252,11 +262,14 @@ export default {
             id: item.id,
             userProcedureTeamId: item.userProcedureTeamId,
             status: item.status,
-            createDate: item.createDate
+            createDate: item.createDate,
+            productSchedulingNum: item.productSchedulingNum,
+            productName: item.productName
           })
         }
         obj.procedureList = arr
         obj.userName = data[j].name
+        obj.reportTime = data[j].reportTime
         newList.push(obj)
       }
       return newList
@@ -313,6 +326,10 @@ export default {
     },
     // 数组日期回显
     dateBack(date) {
+      let type = typeof date
+      if(type == 'string') {
+        return date
+      }
       if (date && date.length > 0) {
         return date.join('-')
       }
@@ -326,6 +343,32 @@ export default {
 * {
   box-sizing: border-box;
 }
+.flex-column {
+  display: flex;
+  flex-direction: column;
+}
+.flex1 {
+  flex: 1;
+}
+.myPlanProcedureListClass {
+  overflow: auto;
+  margin-top: 10px;
+}
+.marginRePor {
+  margin: 12px 0;
+  display: flex;
+  justify-content: space-between;
+  span {
+    color: goldenrod;
+  }
+  i {
+    font-size: 12px;
+    font-style: normal;
+  }
+}
+.marginBtnPro {
+  margin-bottom: 10px;
+}
 .statusLeft {
   position: absolute;
   width: 10px;