|
|
|
@ -2,7 +2,8 @@
|
|
|
|
|
<div>
|
|
|
|
|
<el-card>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
|
|
<el-divider content-position="left"><span style="font-weight: bold; font-size: larger;">工单信息</span></el-divider>
|
|
|
|
|
<el-divider content-position="left"><span style="font-weight: bold; font-size: larger;">工单信息</span>
|
|
|
|
|
</el-divider>
|
|
|
|
|
<el-row :gutter="10">
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="工单号:">{{ form.orderCode }}</el-form-item>
|
|
|
|
@ -19,7 +20,8 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-divider content-position="left"><span style="font-weight: bold; font-size: larger;">派工信息</span></el-divider>
|
|
|
|
|
<el-divider content-position="left"><span style="font-weight: bold; font-size: larger;">派工信息</span>
|
|
|
|
|
</el-divider>
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
@ -56,9 +58,14 @@
|
|
|
|
|
<el-input v-model="scope.row.stationName" :disabled="true"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="center" label="派工数量" prop="planAmount" width="100">
|
|
|
|
|
<el-table-column align="center" label="派工数量" prop="dispatchAmount" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.planAmount" :disabled="scope.row.oldRowFlag"/>
|
|
|
|
|
<el-input v-model="scope.row.dispatchAmount" :disabled="scope.row.oldRowFlag"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="center" label="计划数量" prop="planAmount" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.planAmount" :disabled="scope.row.oldRowFlag || scope.row.processId!==PROCESS_ID.BENDING_PROCESS_ID"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="center" label="派工标准工时" prop="productionTime" width="100">
|
|
|
|
@ -359,6 +366,9 @@ export default {
|
|
|
|
|
headers: {
|
|
|
|
|
Authorization: "Bearer " + getToken(),
|
|
|
|
|
},
|
|
|
|
|
PROCESS_ID: {
|
|
|
|
|
BENDING_PROCESS_ID: 42
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
@ -392,8 +402,8 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
// 校验派工数量(已派工数量 + 派工数量 <= 计划数量)
|
|
|
|
|
// 按照processId分组,所有分组的planAmount之和是否相等,相等后输出planAmount之和的值
|
|
|
|
|
const sumList = dataList.reduce((result, {processId, planAmount}) => {
|
|
|
|
|
const numericAmount = parseInt(planAmount, 10);
|
|
|
|
|
const sumList = dataList.reduce((result, {processId, dispatchAmount}) => {
|
|
|
|
|
const numericAmount = parseInt(dispatchAmount, 10);
|
|
|
|
|
if (!this.isPositiveInteger(numericAmount)) {
|
|
|
|
|
this.$modal.msgError("派工数量须为大于等于0的正整数!");
|
|
|
|
|
return;
|
|
|
|
@ -454,7 +464,7 @@ export default {
|
|
|
|
|
return item.planId;
|
|
|
|
|
});
|
|
|
|
|
dispatchSum = this.form.dispatchAmount - dispatchSum;
|
|
|
|
|
delProductplan(planIds).then(res =>{
|
|
|
|
|
delProductplan(planIds).then(res => {
|
|
|
|
|
// 更新生产工单
|
|
|
|
|
updateProductOrder({
|
|
|
|
|
productOrderId: this.form.productOrderId,
|
|
|
|
@ -554,9 +564,9 @@ export default {
|
|
|
|
|
obj.planStatus = '1';
|
|
|
|
|
// multiStationFlag:一个工序对应工位个数
|
|
|
|
|
if (e.multiStationFlag > 1) {
|
|
|
|
|
obj.planAmount = 0;
|
|
|
|
|
obj.dispatchAmount = 0;//代表productplan的派工数量,obj.planAmount代表实际工位上要工作的数量(默认planamount=dispatchamount,像折弯工序可能两个不相同)this.form.planAmount是order计划生产的数量,this.form.dispatchAmount是order中已派工的数量
|
|
|
|
|
} else {
|
|
|
|
|
obj.planAmount = this.form.planAmount - this.form.dispatchAmount;
|
|
|
|
|
obj.dispatchAmount = this.form.planAmount - this.form.dispatchAmount;
|
|
|
|
|
}
|
|
|
|
|
obj.materialId = this.form.materialId;
|
|
|
|
|
obj.materialBomId = this.form.materialBomId;
|
|
|
|
@ -566,7 +576,7 @@ export default {
|
|
|
|
|
// 上一工序ID
|
|
|
|
|
if (lastProcessId == null) {
|
|
|
|
|
obj.lastProcessId = 0;
|
|
|
|
|
} else if(lastProcessId === obj.processId){
|
|
|
|
|
} else if (lastProcessId === obj.processId) {
|
|
|
|
|
obj.lastProcessId = this.mesProductPlanList[index - 1].lastProcessId;
|
|
|
|
|
} else {
|
|
|
|
|
obj.lastProcessId = lastProcessId;
|
|
|
|
|