From 8a5f47f56987fbdd0a72e8be3fa56ef335235e0b Mon Sep 17 00:00:00 2001 From: z Date: Fri, 16 Jan 2026 11:06:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E6=96=99=E6=8A=A5=E5=B7=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/pgmaster/PgMasterController.java | 24 +++- .../vo/ProcessDesignPageReqVO.java | 2 + .../taskinreport/TaskInReportController.java | 4 +- .../taskdispatch/TaskDispatchDetailDO.java | 2 + .../processdesign/ProcessDesignMapper.java | 15 +++ .../TaskDispatchDetailMapper.java | 1 + .../taskdispatch/TaskDispatchServiceImpl.java | 11 +- .../taskinreport/TaskInReportService.java | 4 +- .../taskinreport/TaskInReportServiceImpl.java | 6 +- mes-ui/mes-ui-admin-vue3/.env.pro | 6 +- .../src/views/heli/processdesign/overview.vue | 16 +++ .../views/heli/taskdispatch/detailDialog.vue | 8 +- .../pages/pgMaster/components/dataItem.vue | 7 +- .../productionInReport-detail.vue | 113 ++++++++---------- .../mini-app/src/services/productionReport.ts | 7 ++ 15 files changed, 147 insertions(+), 79 deletions(-) diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/pgmaster/PgMasterController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/pgmaster/PgMasterController.java index 3c4f534e..b4e7371d 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/pgmaster/PgMasterController.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/pgmaster/PgMasterController.java @@ -1,6 +1,7 @@ package com.chanko.yunxi.mes.module.heli.controller.admin.pgmaster; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.chanko.yunxi.mes.module.heli.controller.admin.plansub.vo.PlanSubRespVO; @@ -9,10 +10,12 @@ import com.chanko.yunxi.mes.module.heli.controller.admin.zjpgmaster.vo.ZjPgMaste import com.chanko.yunxi.mes.module.heli.dal.dataobject.bgmasterline.BgMasterLineDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.pgmaster.PgMasterLineDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.procedure.ProcedureDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO; import com.chanko.yunxi.mes.module.heli.dal.mysql.bgmasterline.BgMasterLineMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.procedure.ProcedureMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomDetailMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchDetailMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchMapper; @@ -31,6 +34,7 @@ import javax.servlet.http.*; import java.util.*; import java.io.IOException; import java.util.stream.Collectors; +import java.util.stream.Stream; import com.chanko.yunxi.mes.framework.common.pojo.PageParam; import com.chanko.yunxi.mes.framework.common.pojo.PageResult; @@ -68,6 +72,8 @@ public class PgMasterController { @Resource private BgMasterLineMapper bgMasterLineMapper; + @Resource + private ProcedureMapper procedureMapper; @GetMapping("/getBomMx") @@ -170,7 +176,7 @@ public class PgMasterController { wrapper.eq(TaskDispatchDetailDO::getCheckYn,0); List detailDOS = taskDispatchDetailMapper.selectList(wrapper); if (ObjectUtil.isEmpty(detailDOS)){ - return error(400,"该零件没有需要检验工序"); + return error(400,"该零件所有工序都没有过程检"); }else { LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); wrapper1.eq(TaskDispatchDetailDO::getDispatchId, taskDispatchDO.getId()); @@ -179,8 +185,22 @@ public class PgMasterController { List list = taskDispatchDetailMapper.selectList(wrapper1); if (ObjectUtil.isNotEmpty( list)){ if (list.size()==detailDOS.size()){ - return error(400,"该零件已全部检验完成"); + return error(400,"零件已全部检验完成"); }else{ + List collect1 = detailDOS.stream().filter(item -> item.getProcedureStatus() != 2).collect(Collectors.toList()); + List collect = collect1.stream().map(TaskDispatchDetailDO::getProcedureId).collect(Collectors.toList()); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.in(ProcedureDO::getId, collect); + List procedureDOS = procedureMapper.selectList(lambdaQueryWrapper); + // 转换为 Map + Map procedureNameMap = procedureDOS.stream() + .collect(Collectors.toMap( + ProcedureDO::getId, + ProcedureDO::getName, + (existing, replacement) -> existing + )); + List collect2 = collect1.stream().filter(item -> item.getReportProcess() == 1).collect(Collectors.toList()); + List collect3 = collect1.stream().filter(item -> item.getReportProcess() != 1).collect(Collectors.toList()); return error(400,"该零件没有报工完成,请联系报工人员!"); } }else{ diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/processdesign/vo/ProcessDesignPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/processdesign/vo/ProcessDesignPageReqVO.java index d05e4209..bfb256ee 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/processdesign/vo/ProcessDesignPageReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/processdesign/vo/ProcessDesignPageReqVO.java @@ -111,4 +111,6 @@ public class ProcessDesignPageReqVO extends PageParam { private Integer isOverProcess; @Schema(description = "状态") private Integer isOverPro; + @Schema(description = "设计日期") + private String designDate; } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskinreport/TaskInReportController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskinreport/TaskInReportController.java index 5f6f7dc5..7bf01efb 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskinreport/TaskInReportController.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskinreport/TaskInReportController.java @@ -109,8 +109,8 @@ public class TaskInReportController { @PostMapping("/add") @Operation(summary = "小程序下料报工") @PreAuthorize("@ss.hasPermission('heli:task-in-report:create')") - public CommonResult addTaskInReport(@Valid @RequestBody TaskInReportSaveReqVO createReqVO) { - return success(taskInReportService.addTaskInReport(createReqVO)); + public CommonResult addTaskInReport(@Valid @RequestBody TaskInReportSaveReqVO createReqVO) { + return taskInReportService.addTaskInReport(createReqVO); } } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskdispatch/TaskDispatchDetailDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskdispatch/TaskDispatchDetailDO.java index 18c9092f..34165755 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskdispatch/TaskDispatchDetailDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskdispatch/TaskDispatchDetailDO.java @@ -314,4 +314,6 @@ public class TaskDispatchDetailDO extends BaseDO { private BigDecimal reportPrice; @TableField(exist = false) private BigDecimal price; + @TableField(exist = false) + private Long compositionId; } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/processdesign/ProcessDesignMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/processdesign/ProcessDesignMapper.java index 033b8ea7..95ad4424 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/processdesign/ProcessDesignMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/processdesign/ProcessDesignMapper.java @@ -21,6 +21,7 @@ import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.springframework.util.StringUtils; +import java.time.LocalDateTime; import java.util.Date; import java.util.List; @@ -295,6 +296,20 @@ public interface ProcessDesignMapper extends BaseMapperX { .or() .apply("u6.nickname like concat('%', {0}, '%') and t.process_design_type = {1}", reqVO.getOwnerName(), ProcessDesignTypeEnum.CASTING_DRAWING.name()); } + if ( ObjectUtil.isNotEmpty(reqVO.getDesignDate())) { + String designDate = reqVO.getDesignDate(); + query.and(q -> { + q.apply("(t.process_design_type = {0} AND (a.craft_start_date >= {1} or a.craft_end_date >= {2}))", ProcessDesignTypeEnum.BLUEPRINT_FOUNDRY_TECHNOLOGY.name(), designDate, designDate) + .or() + .apply("(t.process_design_type = {0} AND( b.start_blank_date >= {1} or b.blank_date >= {2}))", ProcessDesignTypeEnum.BLUEPRINT_WORKBLANK.name(), designDate, designDate) + .or() + .apply("(t.process_design_type = {0} AND (b.start_two_dim_Date >= {1} or b.two_dim_date >= {2}))", ProcessDesignTypeEnum.BLUEPRINT_2D.name(), designDate, designDate) + .or() + .apply("(t.process_design_type = {0} AND (b.start_three_dim_date >= {1} or b.three_dim_date >= {2}))", ProcessDesignTypeEnum.BLUEPRINT_3D.name(), designDate, designDate) + .or() + .apply("(t.process_design_type = {0} AND (a.cast_start_date >= {1} or a.cast_end_date >= {2}))", ProcessDesignTypeEnum.CASTING_DRAWING.name(), designDate, designDate); + }); + } return selectPage(reqVO, query); } default PageResult getExportExcel(ProcessDesignPageReqVO reqVO){ diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/taskdispatch/TaskDispatchDetailMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/taskdispatch/TaskDispatchDetailMapper.java index a54b7e80..8c6515a6 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/taskdispatch/TaskDispatchDetailMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/taskdispatch/TaskDispatchDetailMapper.java @@ -1022,6 +1022,7 @@ public interface TaskDispatchDetailMapper extends BaseMapperX wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(PgMasterLineDO::getDispatchDetailId, taskDispatchDetailDO.getId()); + wrapper.last("limit 1"); + PgMasterLineDO pgMasterLineDO = pgMasterLineMapper.selectOne(wrapper); + if (taskDispatchDO.getDispatchType().equals("PRODUCTION") && taskDispatchDetailDO.getTestYn().equals("N")&&taskDispatchDetailDO.getCheckYn()==0&&ObjectUtil.isEmpty(pgMasterLineDO)){ pgMasterService.insertPgList(planDO.getId(),planDO.getProjectId(),taskDispatchDO.getBomDetailId(),taskDispatchDetailDO); } // if (taskDispatchDO.getDispatchType().equals("PRODUCTION") && isBomDetailProductionOver){ diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskinreport/TaskInReportService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskinreport/TaskInReportService.java index b2dd5617..d1493e6e 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskinreport/TaskInReportService.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskinreport/TaskInReportService.java @@ -2,6 +2,8 @@ package com.chanko.yunxi.mes.module.heli.service.taskinreport; import java.util.*; import javax.validation.*; + +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; import com.chanko.yunxi.mes.module.heli.controller.admin.taskinreport.vo.*; import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskinreport.TaskInReportDO; import com.chanko.yunxi.mes.framework.common.pojo.PageResult; @@ -61,5 +63,5 @@ public interface TaskInReportService { List getList(TaskInReportPageReqVO pageReqVO); - Long addTaskInReport(TaskInReportSaveReqVO createReqVO); + CommonResult addTaskInReport(TaskInReportSaveReqVO createReqVO); } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskinreport/TaskInReportServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskinreport/TaskInReportServiceImpl.java index a1d111f2..49c821cf 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskinreport/TaskInReportServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskinreport/TaskInReportServiceImpl.java @@ -3,6 +3,7 @@ package com.chanko.yunxi.mes.module.heli.service.taskinreport; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.formal.FormalDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO; @@ -132,7 +133,10 @@ public class TaskInReportServiceImpl implements TaskInReportService { } @Override - public Long addTaskInReport(TaskInReportSaveReqVO createReqVO) { + public CommonResult addTaskInReport(TaskInReportSaveReqVO createReqVO) { + TaskDispatchDetailDO taskDispatchDetailDO = taskDispatchDetailMapper.selectById(createReqVO.getDispatchDetailId()); + if (ObjectUtil.isEmpty(taskDispatchDetailDO)) return CommonResult.error(400,"该派工单不存在,请退出刷新界面!"); + if (2==taskDispatchDetailDO.getInReportProcess()) return CommonResult.error(400,"该派工单已报工完成,请刷新界面!"); TaskInReportDO taskInReport = BeanUtils.toBean(createReqVO, TaskInReportDO.class); taskInReport.setOwner(getLoginUser().getId()); taskInReport.setReportTime(LocalDateTime.now()); diff --git a/mes-ui/mes-ui-admin-vue3/.env.pro b/mes-ui/mes-ui-admin-vue3/.env.pro index 392a4f0b..a213430b 100644 --- a/mes-ui/mes-ui-admin-vue3/.env.pro +++ b/mes-ui/mes-ui-admin-vue3/.env.pro @@ -4,14 +4,14 @@ NODE_ENV=production VITE_DEV=false # 请求路径https://nxhs.cjyx.cc/admin-api http://192.168.1.87:8080 https://star.hz-hl.com -VITE_BASE_URL='https://nxhs.cjyx.cc' +VITE_BASE_URL='http://192.168.1.87:8080' # 上传路径 http://218.75.46.166:8080 -VITE_UPLOAD_URL='https://nxhs.cjyx.cc/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://192.168.1.87:8080/admin-api/infra/file/upload' # 上传路径 -VITE_UPLOAD_BATCH_URL='https://nxhs.cjyx.cc/admin-api/infra/file/uploadBatch' +VITE_UPLOAD_BATCH_URL='http://192.168.1.87:8080/admin-api/infra/file/uploadBatch' # 接口前缀 VITE_API_BASEPATH= diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/processdesign/overview.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/processdesign/overview.vue index 40a444d9..8e731bca 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/processdesign/overview.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/processdesign/overview.vue @@ -12,6 +12,15 @@ :inline="true" label-width="110px" > + + + { // return {} // 未开始保持透明背景 // } // } +const setDefaultDate = () => { + queryParams.designDate = dayjs().startOf('day').format('YYYY-MM-DD') + +} /** 初始化 **/ onMounted(() => { + setDefaultDate() getList() }) diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/taskdispatch/detailDialog.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/taskdispatch/detailDialog.vue index e3c3b23a..658e1c2f 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/taskdispatch/detailDialog.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/taskdispatch/detailDialog.vue @@ -267,7 +267,7 @@ class="!w-260px" v-model="formData.requiredCompletedDate" type="date" value-form @@ -482,7 +482,7 @@ v-model="row.deviceModel" 删除 @@ -1318,7 +1318,7 @@ const resetForm = () => { } const subFormLoading = ref(false) // 子表单的加载中 -const flag = ref(false) // 是否下料报工 +const statusFlag = ref(false) // 是否下料报工 const subFormRules = reactive({ procedureName: [{ required: true, @@ -1399,7 +1399,7 @@ const queryData = async (id?: number) => { checkList.value.push(items.name) disabledLabels.value.push(items.name) if ((items.name=='下料1'||items.name=='下料2')&&item.inReportProcess!=0&& !item.isOutsourcing){ - item.flag=true + item.statusFlag=true } } }) diff --git a/mes-ui/mini-app/src/pages/pgMaster/components/dataItem.vue b/mes-ui/mini-app/src/pages/pgMaster/components/dataItem.vue index 8146fd5c..1a6024d9 100644 --- a/mes-ui/mini-app/src/pages/pgMaster/components/dataItem.vue +++ b/mes-ui/mini-app/src/pages/pgMaster/components/dataItem.vue @@ -93,7 +93,7 @@ const getListData = async () => { // 数组追加 dataList.value.push(...data.list) // 分页条件 - if (queryParams.pageNo < data.total) { + if (queryParams.pageNo < data.pageNo) { // 页码累加 queryParams.pageNo++ isFinish.value = false @@ -102,9 +102,7 @@ const getListData = async () => { // 分页已结束 isFinish.value = true } - if (data.msg){ - isFinish.value = false - } + } catch (e){ // if(e.data.data==null && e.data.msg){ 2025/11/17 处理成功才调用 // //等待三秒再次打开扫码窗口 @@ -113,6 +111,7 @@ const getListData = async () => { // }, delay.value * 1000); // } } finally { + isFinish.value = true isLoading.value = false queryParams.type=0 } diff --git a/mes-ui/mini-app/src/pages/productionInReport/productionInReport-detail.vue b/mes-ui/mini-app/src/pages/productionInReport/productionInReport-detail.vue index 1588b0ed..c2e09fa1 100644 --- a/mes-ui/mini-app/src/pages/productionInReport/productionInReport-detail.vue +++ b/mes-ui/mini-app/src/pages/productionInReport/productionInReport-detail.vue @@ -8,7 +8,7 @@ getTaskDetailAPI, postOperateAPI, getListWxAPI, - getXLTaskDetailAPI, getTaskInRepotPageAPI, verificationAPI, handleOkAPI, productionCompletedAPI + getXLTaskDetailAPI, getTaskInRepotPageAPI, verificationAPI, handleOkAPI, productionCompletedAPI, getCompositionAPI } from '@/services/productionReport' const popup = ref() const userStore = useLoginStore() @@ -19,12 +19,10 @@ text: item.label })) - const userId = userStore.userInfo.userId - const isShowStart = ref(false) const isCancel = ref(true) - const isShowEnd = ref(false) + const length = ref() const widht = ref() @@ -37,7 +35,6 @@ let isLoading = ref(false) const historyList = ref([]) - const formObj = ref({}) // 历史明细 const getData = async () => { // 发送请求 @@ -58,7 +55,7 @@ // 详情 const getDetailData = async (id) => { // 发送请求 - // isLoading.value = true + isLoading.value = true const params = { id, } @@ -72,11 +69,6 @@ onLoad(async (options : any) => { await getDetailData(options.id) await getData() - const obj = historyList.value[0] - // 最新的报工是否完成 - if (obj && obj?.workTime == null && obj.endTime) { - popupShow.value = true - } }) // 生产完成 @@ -108,54 +100,58 @@ } // 提交报工 const handleOk = async () => { - if (length.value==null||length.value==''){ + if (length.value==null||length.value=='' ||length.value<=0){ uni.showToast({ icon: 'none', duration: 3000, - title: '请输入长度', + title: '长(直径)不能为空,请确认', }) return } - if (widht.value==null||widht.value==''){ + + if (hight.value==null||hight.value=='' ||hight.value<=0){ uni.showToast({ icon: 'none', duration: 3000, - title: '请输入宽度', + title: '高度不能为空,请确认!', }) return } - if (hight.value==null||hight.value==''){ + if (weight.value==null||weight.value=='' ||weight.value<=0 ){ uni.showToast({ icon: 'none', duration: 3000, - title: '请输入高度', + title: '重量不能为空,请确认!', }) return } - if (weight.value==null||weight.value==''){ + if (reportPrice.value==null||reportPrice.value=='' || reportPrice.value<=0){ uni.showToast({ icon: 'none', duration: 3000, - title: '请输入重量', + title: '总价不能为空,请确认!', }) return } - if (reportPrice.value==null||reportPrice.value==''){ - uni.showToast({ - icon: 'none', - duration: 3000, - title: '请输入总价', - }) - return - } - if (matType.value==null||matType.value==''){ - uni.showToast({ - icon: 'none', - duration: 3000, - title: '请选择物料类型', - }) - return + // if (matType.value==null||matType.value==''){ + // uni.showToast({ + // icon: 'none', + // duration: 3000, + // title: '请选择物料类型', + // }) + // return + // } + if (matType.value=='1'||matType.value=='3'){ + if (widht.value==null||widht.value==''){ + uni.showToast({ + icon: 'none', + duration: 3000, + title: '物料类型是块料或方料,宽度不能为空,请确认! ', + }) + return + } } + const params = { dispatchDetailId: detailInfo.value?.id, length: length.value, @@ -177,17 +173,6 @@ matType.value = '1' await getDetailData(detailInfo.value.id) await getData() - } - const handleStart = async () => { - const params = { - id: detailInfo.value.id, - } - const data = await postOperateAPI(params) - // const pages = getCurrentPages(); // 获取当前页面栈 - // const currentPage = pages[pages.length - 1]; // 当前页面 - // const url = `/${currentPage.route}?${Object.entries(currentPage.options).map(([key, val]) => `${key}=${val}`).join('&')}`; - // uni.reLaunch({ url }); // 重新加载当前页面 - } const popupShow = ref(false) const cancel = () => { @@ -208,9 +193,11 @@ }); } const handleLengthChange =async (val) => { - console.log(val) if (val){ length.value = parseFloat(val).toFixed(2) + var newPrice = await getCompositionAPI(detailInfo.value.compositionId); + console.log(newPrice) + console.log(newPrice.price) if (matType.value == '1' || matType.value == '3') { if (widht.value > 0 && hight.value > 0) { var rawResult = length.value * widht.value * hight.value * detailInfo.value.density / 1000000; @@ -218,7 +205,7 @@ var price = weight.value * detailInfo.value.price; reportPrice.value = price.toFixed(2) } - } else { + } else if (matType.value=='2'){ if (hight.value > 0) { const radius = length.value / 2; const radiusSquared = radius * radius; @@ -256,7 +243,7 @@ var price = weight.value * detailInfo.value.price; reportPrice.value= price.toFixed(2) } - }else { + }else if (matType.value=='2') { if (length.value>0){ const radius = length.value / 2; const radiusSquared = radius * radius; @@ -280,9 +267,14 @@ } } const onClear= async (type)=>{ + if (type=='weight'){ + reportPrice.value=parseFloat("0").toFixed(2) + } else{ + weight.value=parseFloat("0").toFixed(2) + reportPrice.value=parseFloat("0").toFixed(2) + } uni.hideKeyboard() - weight.value=0.00 - reportPrice.value= 0.00 + } // 新增 const handleAdd = async () => { @@ -294,7 +286,6 @@ popup.value?.open() } const handleClose =async ()=>{ - // uni.hideKeyboard() // 如果有键盘,先隐藏键盘 length.value = '' widht.value = '' hight.value = '' @@ -375,41 +366,41 @@ 报工日期: - {{ item.reportTimeStr }} + {{ item.reportTimeStr }} 报工人: - {{ item.ownerName }} + {{ item.ownerName }} 物料类型: - {{ item.matType }} + {{ item.matType }} 长(直径): - {{ item.length }} mm + {{ item.length }} mm 宽度: - {{ item.widht }} mm + {{ item.widht }} mm 高度: - {{ item.hight }} mm + {{ item.hight }} mm 重量: - {{ item.weight }} Kg + {{ item.weight }} Kg 总价: - {{ item.reportPrice }} 元 + {{ item.reportPrice }} @@ -442,7 +433,7 @@ *物料类型: - @@ -479,7 +470,7 @@ - 确定 + 保存 diff --git a/mes-ui/mini-app/src/services/productionReport.ts b/mes-ui/mini-app/src/services/productionReport.ts index 129e6147..85dc0181 100644 --- a/mes-ui/mini-app/src/services/productionReport.ts +++ b/mes-ui/mini-app/src/services/productionReport.ts @@ -118,3 +118,10 @@ export const productionCompletedAPI = (data: Object) => { data, }) } +// 派工任务详情 +export const getCompositionAPI = (id: number) => { + return http({ + method: 'GET', + url: `/heli/composition/get/?id=${id}`, + }) +}