| | |
| | | await request.get(`/basicData/orderBasicData`).then((res) => { |
| | | if(res.code==200){ |
| | | titleSelectJson.value=deepClone(res.data) |
| | | console.log(res.data) |
| | | if(val===0){ |
| | | //其他金额 |
| | | otherMoney.value = titleSelectJson.value.orderOtherMoney[0] |
| | |
| | | import {computed, onMounted, reactive, ref} from "vue" |
| | | import request from "@/utils/request" |
| | | import deepClone from "@/utils/deepClone" |
| | | import {ElMessage} from "element-plus" |
| | | import {ElMessage, ElMessageBox} from "element-plus" |
| | | import { VXETable} from "vxe-table" |
| | | import useUserInfoStore from '@/stores/userInfo' |
| | | import companyInfo from "@/stores/sd/companyInfo" |
| | |
| | | { code: 'sheet4', name: t('order.sheet4') }, |
| | | { code: 'sheet3', name: t('order.sheet3') }, |
| | | { code: 'sheet5', name: t('order.sheet5')}, |
| | | |
| | | ] |
| | | }, |
| | | { |
| | | prefixIcon: 'vxe-icon-print', |
| | | name: '一键退回', |
| | | children: [ |
| | | // { code: 'sheet1', name: '横版-普通' }, |
| | | { code: 'back1', name: t('searchOrder.createOrder') }, |
| | | { code: 'back2', name: t('order.technology') }, |
| | | { code: 'back3', name: t('basicData.review') }, |
| | | { code: 'back4', name: t('searchOrder.production')}, |
| | | |
| | | ] |
| | | }, |
| | |
| | | } |
| | | break |
| | | } |
| | | case 'back1': { |
| | | backProcess(1) |
| | | break |
| | | } |
| | | case 'back2': { |
| | | backProcess(2) |
| | | break |
| | | } |
| | | case 'back3': { |
| | | backProcess(3) |
| | | break |
| | | } |
| | | case 'back4': { |
| | | backProcess(4) |
| | | break |
| | | } |
| | | |
| | | case 'copy': { |
| | | if(rowClickIndex.value===null){ |
| | |
| | | selectOrderList() |
| | | } |
| | | } |
| | | const backProcess = (status) => { |
| | | if(rowClickIndex.value===null){ |
| | | ElMessage.warning(t('searchOrder.msgList.checkOrder')) |
| | | return |
| | | } |
| | | |
| | | ElMessageBox.confirm( |
| | | '确定一键退回相应流程?', |
| | | 'Warning', |
| | | { |
| | | confirmButtonText: t('basicData.confirmButtonText'), |
| | | cancelButtonText: t('basicData.cancelButtonText'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | request.post(`/order/processBack/${rowClickIndex.value.orderId}/${status}`).then((res) => { |
| | | if(res.code==='200'){ |
| | | ElMessage.success(t('product.msg.operateSuccess')+'!') |
| | | selectOrderList() |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | |
| | | const getOrderList = () => { |
| | | //加载请求 |
| | |
| | | //查询报工表内是否存在对应流程卡的数据 |
| | | Integer reportingWorkCount(String processId); |
| | | |
| | | Integer reportingWorkCountByOrderId(String orderId); |
| | | |
| | | //插入Flow_card表 |
| | | Boolean addFlowCardMp(String processId, Integer orderNumber, Integer landingSequence, Integer quantity, String productionId, String userName, Integer layer); |
| | | |
| | |
| | | Integer updateProjectProcessPrintCount(String projectNo); |
| | | |
| | | Integer selectProjectProcessPrintCount(String projectNo); |
| | | |
| | | int flowCardToOptimizeCount(String orderId); |
| | | } |
| | |
| | | Order selectOrderId(String orderId); |
| | | |
| | | List<Map<String,String>> selectDifferentSize(String orderId); |
| | | |
| | | //查询订单入库状态 |
| | | Integer searchOrderWarehousing( String orderId); |
| | | } |
| | |
| | | package com.example.erp.service.sd; |
| | | |
| | | import cn.dev33.satoken.stp.StpUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | |
| | | } |
| | | |
| | | public Object processBack(String orderId,Integer status) { |
| | | //判断是否转优化 |
| | | if(flowCardMapper.flowCardToOptimizeCount(orderId)>0){ |
| | | return "false1"; |
| | | } |
| | | //判断是否有报工 |
| | | if(flowCardMapper.reportingWorkCountByOrderId(orderId)>0){ |
| | | return "false2"; |
| | | } |
| | | //判断是否有库存 |
| | | if(orderMapper.searchOrderWarehousing(orderId)>0){ |
| | | return "false3"; |
| | | } |
| | | //退回到生产加工单 |
| | | if(status<5){ |
| | | //更新小片明细表分架状态 |
| | | flowCardMapper.updateDeleteState(orderId,"all"); |
| | |
| | | flowCardMapper.deleteflowCardSortByOrderId(orderId); |
| | | flowCardMapper.updateProcessingCard(orderId, 0); |
| | | } |
| | | //退回到订单审核后 |
| | | if(status<4){ |
| | | workOrderMapper.deleteOrderWorkMp(orderId, null); |
| | | workOrderMapper.updateWorkType(orderId, 0); |
| | | } |
| | | //退回到工艺审核后 |
| | | if(status<3){ |
| | | orderMapper.backReviewOrderById(orderId); |
| | | } |
| | | |
| | | //退回到下单后 |
| | | if(status<2){ |
| | | orderMapper.reviewProcessById(orderId,0); |
| | | } |
| | | |
| | | return null; |
| | | //日志传入 |
| | | Log log = new Log(); |
| | | log.setOperator((String) StpUtil.getLoginId()); |
| | | log.setOperatorId((String) StpUtil.getLoginId()); |
| | | log.setContent(String.valueOf(status)); |
| | | log.setFunction("updateOrderMoney金额重置:"+orderId); |
| | | return true; |
| | | } |
| | | } |
| | |
| | | from reporting_work as rw |
| | | where rw.process_id = #{processId} and reviewed_state>=0 |
| | | </select> |
| | | <!-- 查询报工表内是否有对应流程卡--> |
| | | <select id="reportingWorkCountByOrderId"> |
| | | select COUNT(rw.process_id) |
| | | from pp.reporting_work as rw |
| | | where rw.order_id = #{orderId} and reviewed_state>=0 |
| | | </select> |
| | | |
| | | <!-- 插入Flow_card表--> |
| | | <insert id="addFlowCardMp"> |
| | | insert into flow_card (order_id, |
| | |
| | | select processPrintNum from optimize_project where project_no=#{projectNo} |
| | | </select> |
| | | |
| | | |
| | | <select id="flowCardToOptimizeCount"> |
| | | select count(*) from pp.flow_card where order_id = #{orderId} and engineering_occupancy=1 |
| | | </select> |
| | | </mapper> |
| | |
| | | having count(a.order_number) > 1 |
| | | </select> |
| | | |
| | | <select id="searchOrderWarehousing"> |
| | | select warehousing from `order` |
| | | where order_id = #{orderId} |
| | | </select> |
| | | </mapper> |