|
@@ -98,7 +98,12 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="可采购数量" width="100">
|
|
|
<template #default="{ row }">
|
|
|
- {{ Number(Math.round(row.quantity - row.purchasedQuantity - row.frozenQuantity)) }}
|
|
|
+ <span v-if="!route.query.processType">
|
|
|
+ {{ Number(Math.round(row.quantity - row.purchasedQuantity - row.frozenQuantity)) }}
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ {{ Number(Math.round(row.quantity - row.purchasedQuantity - row.frozenQuantity + row.thisTimeQuantity)) }}
|
|
|
+ </span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="采购数量" width="120">
|
|
@@ -475,17 +480,37 @@ const handleSubmit = async (flag) => {
|
|
|
if (!(formData.data.purchaseBomList && formData.data.purchaseBomList.length > 0)) {
|
|
|
ElMessage("请添加采购清单");
|
|
|
return false;
|
|
|
- } else if (!judgeStatus()) {
|
|
|
- for (let i = 0; i < formData.data.purchaseBomList.length; i++) {
|
|
|
- if (
|
|
|
- Number(
|
|
|
- Math.round(
|
|
|
- formData.data.purchaseBomList[i].quantity - formData.data.purchaseBomList[i].purchasedQuantity - formData.data.purchaseBomList[i].frozenQuantity
|
|
|
- )
|
|
|
- ) < formData.data.purchaseBomList[i].purchaseQuantity
|
|
|
- ) {
|
|
|
- ElMessage("采购数量不能大于可采购数量");
|
|
|
- return false;
|
|
|
+ } else {
|
|
|
+ if (!route.query.processType) {
|
|
|
+ for (let i = 0; i < formData.data.purchaseBomList.length; i++) {
|
|
|
+ if (
|
|
|
+ Number(
|
|
|
+ Math.round(
|
|
|
+ formData.data.purchaseBomList[i].quantity -
|
|
|
+ formData.data.purchaseBomList[i].purchasedQuantity -
|
|
|
+ formData.data.purchaseBomList[i].frozenQuantity
|
|
|
+ )
|
|
|
+ ) < formData.data.purchaseBomList[i].purchaseQuantity
|
|
|
+ ) {
|
|
|
+ ElMessage("采购数量不能大于可采购数量");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (let i = 0; i < formData.data.purchaseBomList.length; i++) {
|
|
|
+ if (
|
|
|
+ Number(
|
|
|
+ Math.round(
|
|
|
+ formData.data.purchaseBomList[i].quantity -
|
|
|
+ formData.data.purchaseBomList[i].purchasedQuantity -
|
|
|
+ formData.data.purchaseBomList[i].frozenQuantity +
|
|
|
+ formData.data.purchaseBomList[i].thisTimeQuantity
|
|
|
+ )
|
|
|
+ ) < formData.data.purchaseBomList[i].purchaseQuantity
|
|
|
+ ) {
|
|
|
+ ElMessage("采购数量不能大于可采购数量");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -517,6 +542,7 @@ watch(
|
|
|
proxy.post("/applyBuy/detail", { id: formData.data.applyBuyId }).then((res) => {
|
|
|
if (formData.data.purchaseBomList && formData.data.purchaseBomList.length > 0 && res.applyBuyBomList && res.applyBuyBomList.length > 0) {
|
|
|
for (let i = 0; i < formData.data.purchaseBomList.length; i++) {
|
|
|
+ formData.data.purchaseBomList[i].thisTimeQuantity = proxy.deepClone(formData.data.purchaseBomList[i].purchaseQuantity);
|
|
|
for (let j = 0; j < res.applyBuyBomList.length; j++) {
|
|
|
if (formData.data.purchaseBomList[i].applyBuyBomId === res.applyBuyBomList[j].id) {
|
|
|
formData.data.purchaseBomList[i].quantity = res.applyBuyBomList[j].quantity;
|