change - 生产工单:生产派工删除页面逻辑

master
yinq 9 months ago
parent 9159849178
commit 3f838eba5b

@ -72,7 +72,9 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
@Override
public int updateMesProductOrder(MesProductOrder mesProductOrder) {
//销售订单修改工单:校验是否超出销售数量
if (mesProductOrder.getSaleOrderFlag().equals("1") && StringUtils.isNotNull(mesProductOrder.getSaleOrderId())) {
if (StringUtils.isNotEmpty(mesProductOrder.getSaleOrderFlag())
&& mesProductOrder.getSaleOrderFlag().equals("1")
&& StringUtils.isNotNull(mesProductOrder.getSaleOrderId())) {
checkSalesQuantity(mesProductOrder);
}
mesProductOrder.setUpdateTime(DateUtils.getNowDate());

@ -190,7 +190,7 @@
</template>
<script>
import {getProductOrder} from "@//api/mes/productOrder";
import {getProductOrder, updateProductOrder} from "@//api/mes/productOrder";
import {
delProductplan,
getDispatchCode, getDispatchDrawingList,
@ -354,6 +354,7 @@ export default {
this.close();
});
},
/** 删除按钮操作 */
handleDeleteMesProductPlan() {
let productPlan = this.checkedMesProductPlanList[0];
@ -368,13 +369,40 @@ export default {
});
} else {
//
const mesProductPlanDetailList = this.mesProductPlanList;
this.mesProductPlanList = mesProductPlanDetailList.filter(function (item) {
return productPlan.dispatchCode !== item.dispatchCode
});
const delList = this.mesProductPlanList;
let dispatchSum = 0;
try {
const planIds = delList.filter(function (item) {
return productPlan.dispatchCode === item.dispatchCode
}).map(item => {
if (item.planStatus !== '1') {
throw Error("只能删除未派工状态的生产派工单!");
}
if (item.processId === productPlan.processId) {
dispatchSum = dispatchSum + item.planAmount;
}
return item.planId;
});
dispatchSum = this.form.dispatchAmount - dispatchSum;
delProductplan(planIds).then(res =>{
//
updateProductOrder({
productOrderId: this.form.productOrderId,
dispatchAmount: dispatchSum
})
getProductOrder(this.form.productOrderId).then(res => {
this.form = res.data;
});
});
const mesProductPlanDetailList = this.mesProductPlanList;
this.mesProductPlanList = mesProductPlanDetailList.filter(function (item) {
return productPlan.dispatchCode !== item.dispatchCode
});
this.$modal.msgSuccess("删除成功");
} catch (e) {
this.$modal.msgError(e);
}
}
// delProductplan(planIds);
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},

Loading…
Cancel
Save