diff --git a/src/api/base/orderInfo.js b/src/api/base/orderInfo.js index 05c34dc..b7a08f8 100644 --- a/src/api/base/orderInfo.js +++ b/src/api/base/orderInfo.js @@ -52,3 +52,12 @@ export function delOrderInfo(objId) { method: 'delete' }) } + +// 新增工单信息 +export function replaceProductionLine(data) { + return request({ + url: '/sap/port/replaceProductionLine', + method: 'post', + data: data + }) +} diff --git a/src/views/base/orderInfo/index.vue b/src/views/base/orderInfo/index.vue index ae59612..62b658a 100644 --- a/src/views/base/orderInfo/index.vue +++ b/src/views/base/orderInfo/index.vue @@ -214,13 +214,14 @@ @click="handleReleasePlan(scope.row)" >下达计划 + 修改订单 + @click="ReplaceProductionLine(scope.row)" + v-if="scope.row.manualUpdateFlag === '0'" + >更换产线 @@ -317,6 +318,42 @@ 取 消 + + + + + + + + + + + + + + + + + + + + + + + 注:手动更换产线后,SAP将无法更新此订单。 + + + + + @@ -327,7 +364,7 @@ import { delOrderInfo, addOrderInfo, updateOrderInfo, - releaseOrderPlan + releaseOrderPlan, replaceProductionLine } from '@/api/base/orderInfo' import { findProductLineList } from '@//api/base/productLine' import { addSAPCalendar } from '@//api/production/calendarInfo' @@ -355,6 +392,7 @@ export default { title: '', // 是否显示弹出层 open: false, + replaceOpen: false, // 更新时间时间范围 daterangeEndTime: [], // 查询参数 @@ -366,6 +404,7 @@ export default { saleOrderLineNumber: null, materialCode: null, materialName: null, + manualUpdateFlag: null, matkl: null, orderAmount: null, completeAmount: null, @@ -376,6 +415,7 @@ export default { factoryCode: null, isFlag: null, isRelease: null, + replaceAmount: null, createdBy: null, createdTime: null, updatedBy: null, @@ -438,6 +478,7 @@ export default { // 取消按钮 cancel() { this.open = false + this.replaceOpen = false this.reset() }, // 表单重置 @@ -499,6 +540,22 @@ export default { this.title = '修改工单信息' }) }, + /** 修改按钮操作 */ + ReplaceProductionLine(row) { + this.reset() + this.form.objId = row.objId + this.form.orderCode = row.orderCode + this.form.materialName = row.materialName + this.form.orderAmount = row.orderAmount + if (row.workCenterCode === '3101') { + this.form.workCenterCode = '3103' + } + if (row.workCenterCode === '3103') { + this.form.workCenterCode = '3101' + } + this.replaceOpen = true + this.title = '手动更换订单产线' + }, /** 下达计划 */ handleReleasePlan(row) { if (row.isRelease === 0) { @@ -528,6 +585,22 @@ export default { this.getList() }) }, + /** 更换订单产线提交 */ + submitReplaceForm() { + if (this.form.objId == null) { + this.$modal.msgError('系统错误,请刷新页面重试!') + return + } + if (this.form.replaceAmount == null || this.form.replaceAmount > this.form.orderAmount) { + this.$modal.msgError('请输入更换产线的下达数量且不大于订单计划数量!') + return + } + replaceProductionLine(this.form).then(response => { + this.$modal.msgSuccess('更换产线成功') + this.replaceOpen = false + this.getList() + }) + }, /** 提交按钮 */ submitForm() { this.$refs['form'].validate(valid => {