|
|
@@ -39,14 +39,16 @@
|
|
|
@refresh="localOutputDetailsRefresh"
|
|
|
>
|
|
|
<template v-slot:reportQuantity="{ row }">
|
|
|
- <el-input-number
|
|
|
- size="small"
|
|
|
- v-model.number="row.reportQuantity"
|
|
|
- controls-position="right"
|
|
|
- :min="0"
|
|
|
- :max="reportQuantitymax(row)"
|
|
|
- @change="reportQuantityChange(row)"
|
|
|
- ></el-input-number>
|
|
|
+ <div>
|
|
|
+ <el-input-number
|
|
|
+ size="small"
|
|
|
+ v-model.number="row.reportQuantity"
|
|
|
+ controls-position="right"
|
|
|
+ :min="0"
|
|
|
+ :max="reportQuantitymax(row)"
|
|
|
+ @change="reportQuantityChange(row)"
|
|
|
+ ></el-input-number>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<template v-slot:qualifiedQuantity="{ row }">
|
|
|
<el-input-number
|
|
|
@@ -154,10 +156,10 @@
|
|
|
type: [String, Number],
|
|
|
required: false
|
|
|
},
|
|
|
- // recordId 是否保存过数据
|
|
|
- recordId: {
|
|
|
- type: [String, Number],
|
|
|
- default: ''
|
|
|
+ // 执行状态
|
|
|
+ executeStatus: {
|
|
|
+ type: [Number],
|
|
|
+ required: false
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -305,7 +307,7 @@
|
|
|
if (this.outputType == 1) {
|
|
|
// 取值产出清单
|
|
|
const outputItem = this.localOutputDetails.find(
|
|
|
- (item) => item.categoryId === row.categoryId
|
|
|
+ (item) => item.categoryCode === row.categoryCode
|
|
|
);
|
|
|
return (
|
|
|
(outputItem ? outputItem.reportQuantity : 0) +
|
|
|
@@ -318,7 +320,7 @@
|
|
|
return '0' + (row.unit || '');
|
|
|
}
|
|
|
const materialItem = this.materialQuotaInfo.materialQuota.find(
|
|
|
- (item) => item.id === row.categoryId
|
|
|
+ (item) => item.categoryCode === row.categoryCode
|
|
|
);
|
|
|
if (!materialItem) {
|
|
|
return '0' + (row.unit || '');
|
|
|
@@ -344,57 +346,59 @@
|
|
|
formatter: (row) => {
|
|
|
if (this.outputType == 1) {
|
|
|
const outputItem = this.localOutputDetails.find(
|
|
|
- (item) => item.categoryId === row.categoryId
|
|
|
+ (item) => item.categoryCode == row.categoryCode
|
|
|
);
|
|
|
if (!outputItem) {
|
|
|
- return '0' + (row.unit || '');
|
|
|
+ return row.sumReportQuantity + (row.unit || '');
|
|
|
}
|
|
|
- if (this.recordId) {
|
|
|
- let count =
|
|
|
- outputItem.sumReportQuantity +
|
|
|
- outputItem.reportQuantity -
|
|
|
- outputItem.reportQuantityCopy;
|
|
|
- return count + (row.unit || '');
|
|
|
+ let count = 0;
|
|
|
+ if (this.executeStatus === 2) {
|
|
|
+ // 已执行,处理重新一键报工时,sumReportQuantity包含了当前报工数量
|
|
|
+ count =
|
|
|
+ row.sumReportQuantity -
|
|
|
+ (outputItem.reportQuantityCopy - outputItem.reportQuantity);
|
|
|
} else {
|
|
|
- let count =
|
|
|
- outputItem.sumReportQuantity + outputItem.reportQuantity;
|
|
|
- return count + (row.unit || '');
|
|
|
+ count = row.sumReportQuantity + outputItem.reportQuantity;
|
|
|
}
|
|
|
+
|
|
|
+ return count + (row.unit || '');
|
|
|
} else {
|
|
|
- // 产出为在制品 或 BOM标准产出
|
|
|
- // 查询基数
|
|
|
+ // 产出为在制品 或 BOM标准产出 累计消耗数量
|
|
|
if (!this.materialQuotaInfo) {
|
|
|
- return '0' + (row.unit || '');
|
|
|
+ return row.sumReportQuantity + (row.unit || '');
|
|
|
}
|
|
|
const materialItem = this.materialQuotaInfo.materialQuota.find(
|
|
|
- (item) => item.id === row.categoryId
|
|
|
+ (item) => item.categoryCode === row.categoryCode
|
|
|
);
|
|
|
if (!materialItem) {
|
|
|
- return '0' + (row.unit || '');
|
|
|
+ return row.sumReportQuantity + (row.unit || '');
|
|
|
}
|
|
|
- // 需要的物料数量比例
|
|
|
- let count =
|
|
|
- materialItem.count / this.materialQuotaInfo.baseCount;
|
|
|
- // 产出清单的报工数量 当次报工+累计报工
|
|
|
const outputItem = this.localOutputDetails[0];
|
|
|
if (!outputItem) {
|
|
|
- return '0' + (row.unit || '');
|
|
|
+ return row.sumReportQuantity + (row.unit || '');
|
|
|
}
|
|
|
- if (this.recordId) {
|
|
|
- // 累计消耗
|
|
|
- let needQuantity =
|
|
|
- (outputItem.sumReportQuantity +
|
|
|
- outputItem.reportQuantity -
|
|
|
- outputItem.reportQuantityCopy) *
|
|
|
- count;
|
|
|
- return needQuantity + (row.unit || '');
|
|
|
+ // 单位产出所需物料比例
|
|
|
+ const proportion =
|
|
|
+ materialItem.count / this.materialQuotaInfo.baseCount;
|
|
|
+
|
|
|
+ let cumulativeOutputQuantity = 0;
|
|
|
+
|
|
|
+ if (this.executeStatus === 2) {
|
|
|
+ // 已执行,处理重新一键报工时,sumReportQuantity包含了当前报工数量
|
|
|
+ cumulativeOutputQuantity =
|
|
|
+ outputItem.sumReportQuantity -
|
|
|
+ (outputItem.reportQuantityCopy - outputItem.reportQuantity);
|
|
|
} else {
|
|
|
- // 累计消耗
|
|
|
- let needQuantity =
|
|
|
- (outputItem.sumReportQuantity + outputItem.reportQuantity) *
|
|
|
- count;
|
|
|
- return needQuantity + (row.unit || '');
|
|
|
+ cumulativeOutputQuantity =
|
|
|
+ outputItem.sumReportQuantity + outputItem.reportQuantity;
|
|
|
}
|
|
|
+ const needQuantity = cumulativeOutputQuantity * proportion;
|
|
|
+
|
|
|
+ // 已消耗数量转换
|
|
|
+ // const sumReportQuantity = row.sumReportQuantity * proportion;
|
|
|
+ const sumReportQuantity = row.sumReportQuantity;
|
|
|
+
|
|
|
+ return needQuantity + sumReportQuantity + (row.unit || '');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -529,6 +533,7 @@
|
|
|
ruleId: this.ruleId,
|
|
|
produceTaskId: this.produceTaskId
|
|
|
},
|
|
|
+ // ...this.localPickDetails, ...this.preOutputDetails
|
|
|
[]
|
|
|
);
|
|
|
},
|
|
|
@@ -538,34 +543,39 @@
|
|
|
|
|
|
data.forEach((newItem) => {
|
|
|
const index = this.localPickDetails.findIndex(
|
|
|
- (item) =>
|
|
|
- item.categoryCode === newItem.categoryCode &&
|
|
|
- item.produceTaskInstanceId === newItem.produceTaskInstanceId
|
|
|
+ (item) => item.categoryCode === newItem.categoryCode
|
|
|
);
|
|
|
if (index !== -1) {
|
|
|
// 存在则替换数量
|
|
|
this.localPickDetails[index].quantity = newItem.quantity;
|
|
|
} else {
|
|
|
const sumItem = this.sumOutputDetails.find(
|
|
|
- (i) => i.categoryId === i.categoryId
|
|
|
+ (item) => item.categoryCode === newItem.categoryCode
|
|
|
);
|
|
|
|
|
|
- let reportQuantity = newItem.reportQuantity || 0;
|
|
|
+ let sumQualifiedQuantity = 0;
|
|
|
+ let sumNoQualifiedQuantity = 0;
|
|
|
+ let sumReportQuantity = 0;
|
|
|
|
|
|
if (sumItem) {
|
|
|
- reportQuantity = sumItem.reportQuantity;
|
|
|
+ sumQualifiedQuantity = sumItem.sumQualifiedQuantity;
|
|
|
+ sumNoQualifiedQuantity = sumItem.sumNoQualifiedQuantity;
|
|
|
+ sumReportQuantity = sumItem.sumReportQuantity;
|
|
|
}
|
|
|
|
|
|
// 不存在则添加
|
|
|
this.localPickDetails.push({
|
|
|
...newItem,
|
|
|
- reportQuantity,
|
|
|
+ reportQuantity: 0,
|
|
|
ruleId: this.ruleId,
|
|
|
bomCategoryId: this.bomCategoryId,
|
|
|
produceTaskId: this.produceTaskId,
|
|
|
produceTaskInstanceId: this.produceTaskInstanceId,
|
|
|
produceTaskName: this.produceTaskName,
|
|
|
- workOrderId: this.workOrderId
|
|
|
+ workOrderId: this.workOrderId,
|
|
|
+ sumQualifiedQuantity,
|
|
|
+ sumNoQualifiedQuantity,
|
|
|
+ sumReportQuantity
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
@@ -574,16 +584,22 @@
|
|
|
},
|
|
|
setMaterialQuotaInfo() {
|
|
|
console.log('this.materialQuotaInfo', this.materialQuotaInfo);
|
|
|
+
|
|
|
if (this.materialQuotaInfo && this.materialQuotaInfo.standardOutput) {
|
|
|
const sumItem = this.sumOutputDetails.find(
|
|
|
(i) =>
|
|
|
- i.categoryId === this.materialQuotaInfo.standardOutput.categoryId
|
|
|
+ i.categoryCode ===
|
|
|
+ this.materialQuotaInfo.standardOutput.categoryCode
|
|
|
);
|
|
|
|
|
|
- let reportQuantity = 0;
|
|
|
+ let sumQualifiedQuantity = 0;
|
|
|
+ let sumNoQualifiedQuantity = 0;
|
|
|
+ let sumReportQuantity = 0;
|
|
|
|
|
|
if (sumItem) {
|
|
|
- reportQuantity = sumItem.reportQuantity;
|
|
|
+ sumQualifiedQuantity = sumItem.sumQualifiedQuantity;
|
|
|
+ sumNoQualifiedQuantity = sumItem.sumNoQualifiedQuantity;
|
|
|
+ sumReportQuantity = sumItem.sumReportQuantity;
|
|
|
}
|
|
|
|
|
|
// 赋值产出
|
|
|
@@ -591,13 +607,14 @@
|
|
|
{
|
|
|
...this.materialQuotaInfo.standardOutput,
|
|
|
id: null,
|
|
|
- reportQuantity,
|
|
|
+ reportQuantity: 0,
|
|
|
+ reportQuantityCopy: 0,
|
|
|
qualifiedQuantity: 0,
|
|
|
noQualifiedQuantity: 0,
|
|
|
msg: '',
|
|
|
- sumReportQuantity: 0,
|
|
|
- sumQualifiedQuantity: 0,
|
|
|
- sumNoQualifiedQuantity: 0,
|
|
|
+ sumReportQuantity,
|
|
|
+ sumQualifiedQuantity,
|
|
|
+ sumNoQualifiedQuantity,
|
|
|
ruleId: this.ruleId,
|
|
|
outputType: this.outputType,
|
|
|
produceTaskId: this.produceTaskId,
|
|
|
@@ -607,6 +624,8 @@
|
|
|
}
|
|
|
];
|
|
|
this.$emit('update:outputDetails', this.localOutputDetails);
|
|
|
+ } else {
|
|
|
+ this.$message.warning('未配置BOM标准产出信息');
|
|
|
}
|
|
|
},
|
|
|
// 获取bom的产出清单
|
|
|
@@ -617,6 +636,10 @@
|
|
|
this.produceTaskId
|
|
|
);
|
|
|
console.log('this.materialQuotaInfo', data);
|
|
|
+ if (JSON.stringify(data) === '{}') {
|
|
|
+ this.materialQuotaInfo = null;
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.materialQuotaInfo = data;
|
|
|
}
|
|
|
},
|
|
|
@@ -634,23 +657,36 @@
|
|
|
if (row.selected) {
|
|
|
// 判断是否存在
|
|
|
const index = this.localOutputDetails.findIndex(
|
|
|
- (item) =>
|
|
|
- item.categoryId === row.categoryId &&
|
|
|
- item.produceTaskInstanceId === row.produceTaskInstanceId
|
|
|
+ (item) => item.categoryId === row.categoryId
|
|
|
);
|
|
|
|
|
|
if (index === -1) {
|
|
|
+ const sumItem = this.sumOutputDetails.find(
|
|
|
+ (i) => i.categoryCode === row.categoryCode
|
|
|
+ );
|
|
|
+
|
|
|
+ let sumQualifiedQuantity = 0;
|
|
|
+ let sumNoQualifiedQuantity = 0;
|
|
|
+ let sumReportQuantity = 0;
|
|
|
+
|
|
|
+ if (sumItem) {
|
|
|
+ sumQualifiedQuantity = sumItem.sumQualifiedQuantity;
|
|
|
+ sumNoQualifiedQuantity = sumItem.sumNoQualifiedQuantity;
|
|
|
+ sumReportQuantity = sumItem.sumReportQuantity;
|
|
|
+ }
|
|
|
+
|
|
|
// 不存在则添加
|
|
|
this.localOutputDetails.push({
|
|
|
...row,
|
|
|
id: null,
|
|
|
reportQuantity: 0,
|
|
|
+ reportQuantityCopy: 0,
|
|
|
qualifiedQuantity: 0,
|
|
|
noQualifiedQuantity: 0,
|
|
|
msg: '',
|
|
|
- sumReportQuantity: 0,
|
|
|
- sumQualifiedQuantity: 0,
|
|
|
- sumNoQualifiedQuantity: 0,
|
|
|
+ sumReportQuantity,
|
|
|
+ sumQualifiedQuantity,
|
|
|
+ sumNoQualifiedQuantity,
|
|
|
ruleId: this.ruleId,
|
|
|
outputType: this.outputType,
|
|
|
bomCategoryId: this.bomCategoryId,
|
|
|
@@ -676,26 +712,31 @@
|
|
|
const data = await getCategoryAndLevelByCategoryId(this.categoryId);
|
|
|
if (data) {
|
|
|
const sumItem = this.sumOutputDetails.find(
|
|
|
- (i) => i.categoryId == data.categoryId
|
|
|
+ (i) => i.categoryCode == data.categoryCode
|
|
|
);
|
|
|
|
|
|
- let reportQuantity = 0;
|
|
|
+ let sumQualifiedQuantity = 0;
|
|
|
+ let sumNoQualifiedQuantity = 0;
|
|
|
+ let sumReportQuantity = 0;
|
|
|
|
|
|
if (sumItem) {
|
|
|
- reportQuantity = sumItem.reportQuantity;
|
|
|
+ sumQualifiedQuantity = sumItem.sumQualifiedQuantity;
|
|
|
+ sumNoQualifiedQuantity = sumItem.sumNoQualifiedQuantity;
|
|
|
+ sumReportQuantity = sumItem.sumReportQuantity;
|
|
|
}
|
|
|
|
|
|
this.localOutputDetails = [
|
|
|
{
|
|
|
...data,
|
|
|
id: null,
|
|
|
- reportQuantity,
|
|
|
+ reportQuantity: 0,
|
|
|
+ reportQuantityCopy: 0,
|
|
|
qualifiedQuantity: 0,
|
|
|
noQualifiedQuantity: 0,
|
|
|
msg: '',
|
|
|
- sumReportQuantity: 0,
|
|
|
- sumQualifiedQuantity: 0,
|
|
|
- sumNoQualifiedQuantity: 0,
|
|
|
+ sumReportQuantity,
|
|
|
+ sumQualifiedQuantity,
|
|
|
+ sumNoQualifiedQuantity,
|
|
|
ruleId: this.ruleId,
|
|
|
outputType: this.outputType,
|
|
|
produceTaskId: this.produceTaskId,
|
|
|
@@ -714,18 +755,64 @@
|
|
|
// 计算报工数量最大值
|
|
|
reportQuantitymax(row) {
|
|
|
if (this.outputType == 1) {
|
|
|
- // 物料本身 不能超过已报工数量减领料数量
|
|
|
- return row.quantity - row.sumReportQuantity;
|
|
|
- }
|
|
|
- if (row.outputType == 2) {
|
|
|
- // 在物料中查询对应的物料
|
|
|
- const pickitem = this.preOutputDetails.find(
|
|
|
- (pick) => pick.categoryId == row.categoryId
|
|
|
+ // 查询物料本身
|
|
|
+ const pickItem = this.localPickDetails.find(
|
|
|
+ (item) => item.categoryCode === row.categoryCode
|
|
|
);
|
|
|
- if (pickitem) {
|
|
|
- return pickitem.qualifiedQuantity;
|
|
|
+ // 物料本身 不能超过已报工数量减领料数量
|
|
|
+
|
|
|
+ // 已执行,处理重新一键报工时,sumReportQuantity包含了当前报工数量
|
|
|
+ if (this.executeStatus === 2) {
|
|
|
+ return (
|
|
|
+ pickItem.quantity -
|
|
|
+ (pickItem.sumReportQuantity - row.reportQuantityCopy)
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return pickItem.quantity - pickItem.sumReportQuantity;
|
|
|
}
|
|
|
}
|
|
|
+ if (row.outputType == 2 || row.outputType == 3) {
|
|
|
+ // 基于物料配额限制最大可报工数量(兼容已缓存/已保存一次的编辑场景,并区分已执行状态)
|
|
|
+ if (!this.materialQuotaInfo) return Infinity;
|
|
|
+ const quota = this.materialQuotaInfo.materialQuota || [];
|
|
|
+ if (!quota.length) return Infinity;
|
|
|
+
|
|
|
+ const isExecuted = this.executeStatus === 2;
|
|
|
+
|
|
|
+ const { baseCount } = this.materialQuotaInfo;
|
|
|
+ if (!baseCount) return Infinity;
|
|
|
+
|
|
|
+ // 计算每个物料的最大可报工数量
|
|
|
+ const maxQuantities = quota.map((item) => {
|
|
|
+ const pickItem = this.localPickDetails.find(
|
|
|
+ (p) => p.categoryCode === item.categoryCode
|
|
|
+ );
|
|
|
+ if (!pickItem) {
|
|
|
+ return Infinity;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 单位产出所需物料比例
|
|
|
+ const proportion = item.count / baseCount;
|
|
|
+
|
|
|
+ // 已执行,处理重新一键报工时,sumReportQuantity包含了当前报工数量
|
|
|
+ let consumedQuantity = isExecuted
|
|
|
+ ? row.sumReportQuantity - row.reportQuantityCopy
|
|
|
+ : row.sumReportQuantity;
|
|
|
+
|
|
|
+ // 已执行的比例换算,换算为需要多少物料数量
|
|
|
+ const consumedProportion = consumedQuantity * proportion;
|
|
|
+
|
|
|
+ // 最大可报工数量
|
|
|
+ const maxQuantity =
|
|
|
+ (pickItem.quantity - consumedProportion) / proportion;
|
|
|
+
|
|
|
+ // 向下取整
|
|
|
+ return Math.floor(maxQuantity);
|
|
|
+ });
|
|
|
+
|
|
|
+ // 返回最小的那个物料的最大可报工数量
|
|
|
+ return Math.min(...maxQuantities);
|
|
|
+ }
|
|
|
return Infinity;
|
|
|
},
|
|
|
// 判断生成产出清单的物料数量是合格
|
|
|
@@ -753,19 +840,24 @@
|
|
|
}
|
|
|
|
|
|
if (this.outputType == 1) {
|
|
|
- if (this.localPickDetails.length == 0) {
|
|
|
+ if (
|
|
|
+ this.localPickDetails.length == 0 &&
|
|
|
+ this.preOutputDetails.length == 0
|
|
|
+ ) {
|
|
|
this.$message.warning(`物料清单不能为空`);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
for (const item of this.localOutputDetails) {
|
|
|
const pickitem = this.localPickDetails.find(
|
|
|
- (pick) =>
|
|
|
- pick.categoryId == item.categoryId &&
|
|
|
- pick.produceTaskInstanceId == item.produceTaskInstanceId
|
|
|
+ (pick) => pick.categoryCode == item.categoryCode
|
|
|
+ );
|
|
|
+
|
|
|
+ const prePickitem = this.preOutputDetails.find(
|
|
|
+ (pick) => pick.categoryCode == item.categoryCode
|
|
|
);
|
|
|
|
|
|
- if (pickitem == null) {
|
|
|
+ if (pickitem == null && prePickitem == null) {
|
|
|
this.$message.warning(
|
|
|
`所需物料【${item.categoryName}】未在物料清单中找到`
|
|
|
);
|
|
|
@@ -781,97 +873,6 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (this.outputType == 2) {
|
|
|
- let val = true;
|
|
|
-
|
|
|
- if (!this.materialQuotaInfo) {
|
|
|
- await this.getMaterialQuotaInfo();
|
|
|
- }
|
|
|
-
|
|
|
- // 没有配置产出清单 、没有原材料 不检查
|
|
|
- if (!this.materialQuotaInfo || this.localPickDetails.length == 0) {
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- this.materialQuotaInfo.materialQuota.forEach((i) => {
|
|
|
- // 避免重复提示
|
|
|
- if (!val) {
|
|
|
- return;
|
|
|
- }
|
|
|
- // 需要的物料数量比例
|
|
|
- let count = i.count / this.materialQuotaInfo.baseCount;
|
|
|
-
|
|
|
- // 产出清单的报工数量 当次报工+累计报工
|
|
|
- const outputItem = this.localOutputDetails[0];
|
|
|
-
|
|
|
- // 产出物料数量
|
|
|
- const outputQuantity =
|
|
|
- outputItem.reportQuantity + outputItem.sumReportQuantity;
|
|
|
- const needQuantity = outputQuantity * count;
|
|
|
-
|
|
|
- // 查询物料清单 是否满足数量
|
|
|
- const pickitem = this.localPickDetails.find(
|
|
|
- (pick) => pick.categoryId == i.id
|
|
|
- );
|
|
|
- // 查询preOutputDetails 上一道工序产出物
|
|
|
- const preOutputItem = this.preOutputDetails.find(
|
|
|
- (pre) => pre.categoryId == i.id
|
|
|
- );
|
|
|
-
|
|
|
- // 所需物料是 物料或者是上一道工序产出物
|
|
|
- if (pickitem == null && preOutputItem == null) {
|
|
|
- this.$message.warning(
|
|
|
- `所需物料【${i.categoryName}】未在物料清单中找到`
|
|
|
- );
|
|
|
- val = false;
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- // 物料对象存在
|
|
|
- if (pickitem) {
|
|
|
- if (needQuantity > pickitem.quantity) {
|
|
|
- this.$message.warning(
|
|
|
- `物料【${pickitem.categoryName}】领料数量不足,需${needQuantity}${pickitem.unit},当前仅有${pickitem.quantity}${pickitem.unit}`
|
|
|
- );
|
|
|
- val = false;
|
|
|
- return false;
|
|
|
- }
|
|
|
- // 判断累计报工数量是否足够
|
|
|
- let pickitemSumReportQuantity =
|
|
|
- pickitem.sumReportQuantity + pickitem.reportQuantity;
|
|
|
- if (needQuantity > pickitemSumReportQuantity) {
|
|
|
- this.$message.warning(
|
|
|
- `物料【${pickitem.categoryName}】累计报工数量不足,需${needQuantity}${pickitem.unit},当前仅有${pickitemSumReportQuantity}${pickitem.unit}`
|
|
|
- );
|
|
|
- val = false;
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- // 上一道工序产出物存在
|
|
|
- // if (preOutputItem) {
|
|
|
- // if (needQuantity > preOutputItem.quantity) {
|
|
|
- // this.$message.warning(
|
|
|
- // `物料【${preOutputItem.categoryName}】领料数量不足,需${needQuantity}${preOutputItem.unit},当前仅有${preOutputItem.quantity}${preOutputItem.unit}`
|
|
|
- // );
|
|
|
- // val = false;
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // // 判断累计报工数量是否足够
|
|
|
- // let preOutputItemSumReportQuantity =
|
|
|
- // preOutputItem.sumReportQuantity + preOutputItem.reportQuantity;
|
|
|
- // if (needQuantity > preOutputItemSumReportQuantity) {
|
|
|
- // this.$message.warning(
|
|
|
- // `物料【${preOutputItem.categoryName}】累计报工数量不足,需${needQuantity}${preOutputItem.unit},当前仅有${preOutputItemSumReportQuantity}${preOutputItem.unit}`
|
|
|
- // );
|
|
|
- // val = false;
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // }
|
|
|
- });
|
|
|
-
|
|
|
- return val;
|
|
|
- }
|
|
|
-
|
|
|
return true;
|
|
|
},
|
|
|
// 当次报工修改
|