| | |
| | | terminationQuantity:'生产终止数量', |
| | | terminationMsg:'请输入正确的可修改数量', |
| | | maxCompleted:'最大已完工数量', |
| | | updateProcessMsg:'保存失败!请检查变更工序是否报工', |
| | | termination:'终止', |
| | | }, |
| | | reportingWorks:{ |
| | | page:{ |
| | |
| | | const saveCraft = () => { |
| | | //rowIndex.value.process = craftObj.newCraft.join('->') |
| | | let orderProcess= craftObj.newCraft.join('->') |
| | | request.post(`/processCard/updateProcess/${rowIndex.value.process_id}/${rowIndex.value.technology_number}/${rowIndex.value.order_id}/${orderProcess}`, craftObj).then((res) => { |
| | | request.post(`/processCard/updateProcess/${rowIndex.value.process_id}/${rowIndex.value.order_number}/${rowIndex.value.technology_number}/${rowIndex.value.order_id}/${orderProcess}`, craftObj).then((res) => { |
| | | if (res.code == 200 && res.data === true) { |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | router.push({ |
| | |
| | | }) |
| | | } else { |
| | | |
| | | ElMessage.warning('保存失败,检查是否报工') |
| | | ElMessage.warning(t('processCard.updateProcessMsg')) |
| | | |
| | | } |
| | | }) |
| | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="updateCraft(row)" link type="primary" size="small">{{$t('craft.updateCraft')}}</el-button> |
| | | <el-button @click="updateTermination(row)" link type="primary" size="small">终止</el-button> |
| | | <el-button @click="updateTermination(row)" link type="primary" size="small">{{$t('processCard.termination')}}</el-button> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | |
| | | } |
| | | |
| | | @ApiOperation("修改工艺流程") |
| | | @PostMapping("/updateProcess/{processId}/{technologyNumber}/{orderId}/{process}") |
| | | @PostMapping("/updateProcess/{processId}/{orderNumber}/{technologyNumber}/{orderId}/{process}") |
| | | public Result updateProcess( |
| | | @PathVariable String processId, |
| | | @PathVariable String orderNumber, |
| | | @PathVariable String technologyNumber, |
| | | @PathVariable String orderId, |
| | | @PathVariable String process, |
| | | @RequestBody Map<String, Object> object |
| | | ) { |
| | | |
| | | return Result.seccess(flowCardService.updateProcessSv(processId,technologyNumber,orderId,process,object)); |
| | | return Result.seccess(flowCardService.updateProcessSv(processId,orderNumber,technologyNumber,orderId,process,object)); |
| | | } |
| | | |
| | | @ApiOperation("工程打印标签次数修改") |
| | |
| | | import com.example.erp.dto.pp.FlowCardDTO; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.OrderProcessDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | |
| | | Integer selectCompletedMp(String processId, Integer orderNumber, String interceptProcess); |
| | | |
| | | String getProcessOk(String processId, String technologyNumber); |
| | | String getProcessOk(String processId,String orderNumber, String technologyNumber); |
| | | |
| | | List<OrderProcessDetail> getProcessDetail(String processId,String orderNumber, String technologyNumber, String process); |
| | | |
| | | Boolean updateOrderProcessDetail(String processId, String orderNumber, Integer technologyNumber, |
| | | int reportingWorkNumCount, int reportingWorkNum, int brokenNum, String process); |
| | | } |
| | |
| | | return map; |
| | | } |
| | | |
| | | public Boolean updateProcessSv(String processId, String technologyNumber, String orderId, String Orderprocess, Map<String, Object> object) { |
| | | public Boolean updateProcessSv(String processId,String orderNumber, String technologyNumber, String orderId, String Orderprocess, Map<String, Object> object) { |
| | | //获取已报工工艺流程 |
| | | String processOk = flowCardMapper.getProcessOk(processId,technologyNumber); |
| | | //判断该流程卡是否报工 |
| | | Integer count = flowCardMapper.reportingWorkCount(processId); |
| | | if (count == 0) { |
| | | String processOk = flowCardMapper.getProcessOk(processId,orderNumber,technologyNumber); |
| | | List<String> okList = Arrays.asList(processOk.split("->")); |
| | | List<String> orderList = Arrays.asList(Orderprocess.split("->")); |
| | | |
| | | // 判断 processOk 的每个工序是否都包含在 orderProcess 中 |
| | | for (String p : okList) { |
| | | if (!orderList.contains(p)) { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | List<OrderProcessDetail> resultList = new ArrayList<>(); |
| | | |
| | | for (String process : okList) { |
| | | List<OrderProcessDetail> details = |
| | | flowCardMapper.getProcessDetail(processId,orderNumber, technologyNumber, process); |
| | | |
| | | if (details != null && !details.isEmpty()) { |
| | | resultList.addAll(details); |
| | | } |
| | | } |
| | | |
| | | //删除小片工艺表对应的数据 |
| | | flowCardMapper.deleteProcessMp(processId, technologyNumber); |
| | | //重新插入修改好工艺流程卡的数据 |
| | |
| | | } |
| | | } |
| | | } |
| | | //将原来已报工的数据更新 |
| | | if (resultList != null && !resultList.isEmpty()) { |
| | | for (OrderProcessDetail d : resultList) { |
| | | flowCardMapper.updateOrderProcessDetail(d.getProcessId(),d.getOrderNumber(),d.getTechnologyNumber(), |
| | | d.getReportingWorkNumCount(),d.getReportingWorkNum(),d.getBrokenNum(),d.getProcess()); |
| | | |
| | | } |
| | | } |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | GROUP_CONCAT(process ORDER BY id SEPARATOR '->') AS processes |
| | | FROM sd.order_process_detail |
| | | WHERE process_id = #{processId} |
| | | AND order_number = #{orderNumber} |
| | | AND technology_number = #{technologyNumber} |
| | | AND reporting_work_num_count > 0; |
| | | </select> |
| | | |
| | | <select id="getProcessDetail"> |
| | | SELECT * |
| | | FROM sd.order_process_detail |
| | | WHERE process_id = #{processId} |
| | | AND order_number = #{orderNumber} |
| | | AND technology_number = #{technologyNumber} |
| | | AND reporting_work_num_count > 0 |
| | | AND process = #{process} |
| | | </select> |
| | | |
| | | <update id="updateOrderProcessDetail"> |
| | | UPDATE sd.order_process_detail |
| | | set reporting_work_num_count = #{reportingWorkNumCount}, |
| | | reporting_work_num = #{reportingWorkNum}, |
| | | broken_num = #{brokenNum} |
| | | where process_id = #{processId} and order_number = #{orderNumber} and |
| | | technology_number = #{technologyNumber} and process = #{process} |
| | | </update> |
| | | </mapper> |