diff --git a/src/App.vue b/src/App.vue index e6600fb..dc21618 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,7 +11,7 @@ data() { return { query: {}, - version: '1.2.10' + version: '1.2.11' } }, created() { diff --git a/src/api/shopOrder/shopOrder.js b/src/api/shopOrder/shopOrder.js index d9515f3..9ca9806 100644 --- a/src/api/shopOrder/shopOrder.js +++ b/src/api/shopOrder/shopOrder.js @@ -47,3 +47,11 @@ export const getShopOrderSapSOBOM = data => createAPI(`/shopOrder/getShopOrderSa //取消shopOrder export const cancelShopOrderBun = data => createAPI(`/shopOrder/cancelShopOrderBun`,'post',data) +//关闭订单 +export const closeShopOrder = data => createAPI('/shopOrder/closeShopOrder', 'post', data) + +//打开工单 +export const openShopOrder = data => createAPI('/shopOrder/openShopOrder', 'post', data) + + + diff --git a/src/views/modules/shopOrder/shopOrder/shopOrder.vue b/src/views/modules/shopOrder/shopOrder/shopOrder.vue index 3299eb9..af96b16 100644 --- a/src/views/modules/shopOrder/shopOrder/shopOrder.vue +++ b/src/views/modules/shopOrder/shopOrder/shopOrder.vue @@ -39,6 +39,10 @@ {{ '取消' }} + {{ '关闭' }} + + {{ '打开' }} + @@ -478,7 +482,9 @@ import { getShopOrderDetail, getOrderInfo, getShopOrderSapSOBOM, - cancelShopOrderBun, + cancelShopOrderBun,//取消订单 + closeShopOrder,//关闭订单 + openShopOrder,//打开订单 } from "@/api/shopOrder/shopOrder.js" import Chooselist from '@/views/modules/common/Chooselist' @@ -569,7 +575,8 @@ export default { receiveStatus: '', techInfo: '', remark: '', - repairSOFlag: '' + repairSOFlag: '', + checkFlag: '',/*关单是否校验数量*/ }, updateData: { needDate: '', @@ -1893,6 +1900,82 @@ export default { //判断是否成功 if(data.code == 200){ this.$message.success(data.msg); + //刷新工单的信息 + this.tableHanddle(this.modelData); + }else{ + this.$message.error(data.msg); + } + }) + }, + + //提示是否关闭订单 + warnCloseOrderConfirm(){ + if (!this.modelData.orderNo) { + return this.$message.warning('请先选择订单') + } + //提示信息 + this.$confirm('确实要关闭该生产订单吗?', '提示', { + confirmButtonText: '确认', + celButtonText: '取消', + type: 'warning' + }).then(() => { + //执行重新打开sfdcRolls记录的操作 + this.closeShopOrderBun(true); + }); + }, + + /*执行取消工单的操作*/ + closeShopOrderBun(checkFlag){ + this.modelData.checkFlag = checkFlag; + //组合数据 + closeShopOrder(this.modelData).then(({data}) => { + //判断是否成功 + if(data.code == 200){ + this.$message.success(data.msg); + //刷新工单的信息 + this.tableHanddle(this.modelData); + }else if (data.code == 201){ + this.$confirm(data.msg, '提示', { + confirmButtonText: '确认', + celButtonText: '取消', + type: 'warning' + }).then(() => { + //执行重新打开sfdcRolls记录的操作 + this.closeShopOrderBun(false); + }); + }else{ + this.$message.error(data.msg); + } + }) + }, + + + //提示是否打开订单 + warnOpenOrderConfirm() { + //判断是否存在订单 + if (!this.modelData.orderNo) { + return this.$message.warning('请先选择订单') + } + // + this.$confirm('确实要重新打开该生产订单吗?', '提示', { + confirmButtonText: '确认', + celButtonText: '取消', + type: 'warning' + }).then(() => { + //执行重新打开 + this.openShopOrderBun(); + }); + }, + + /*执行重新打开工单的操作*/ + openShopOrderBun(){ + //组合数据 + openShopOrder(this.modelData).then(({data}) => { + //判断是否成功 + if(data.code == 200){ + this.$message.success(data.msg); + //刷新工单的信息 + this.tableHanddle(this.modelData); }else{ this.$message.error(data.msg); }