update - 切换SAP订单工作中心,下发生产计划

master
yinq 8 months ago
parent 23a2f7249b
commit ab61368a36

@ -52,3 +52,12 @@ export function delOrderInfo(objId) {
method: 'delete'
})
}
// 新增工单信息
export function replaceProductionLine(data) {
return request({
url: '/sap/port/replaceProductionLine',
method: 'post',
data: data
})
}

@ -214,13 +214,14 @@
@click="handleReleasePlan(scope.row)"
>下达计划
</el-button>
<!-- v-hasPermi="['base:orderInfo:edit']"-->
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['base:orderInfo:edit']"
>修改订单
@click="ReplaceProductionLine(scope.row)"
v-if="scope.row.manualUpdateFlag === '0'"
>更换产线
</el-button>
<!-- <el-button-->
<!-- size="mini"-->
@ -317,6 +318,42 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :title="title" :visible.sync="replaceOpen" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="SAP计划编号" prop="orderCode">
<el-input v-model="form.orderCode" placeholder="请输入SAP计划编号" :disabled="true"/>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请输入物料名称" :disabled="true"/>
</el-form-item>
<el-form-item label="订单计划数量" prop="orderAmount">
<el-input v-model="form.orderAmount" placeholder="请输入订单计划数量" :disabled="true"/>
</el-form-item>
<el-form-item label="更换产线">
<el-select v-model="form.workCenterCode" placeholder="请选择产线" :disabled="true">
<el-option
v-for="item in productLineList"
:key="item.workCenterCode"
:label="item.workCenterName"
:value="item.workCenterCode"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="下达数量" prop="replaceAmount">
<el-input v-model="form.replaceAmount" placeholder="请输入完成数量"/>
</el-form-item>
<!-- 提示信息 -->
<div style="margin-top: 20px; color: red;">
手动更换产线后SAP将无法更新此订单
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitReplaceForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -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 => {

Loading…
Cancel
Save