|
|
@@ -337,12 +337,13 @@ export default {
|
|
|
let filteredResults = this.formData.taskPhotoRecognitionResult.filter(
|
|
|
(val) => val.skuProductCode == row.skuProductCode,
|
|
|
);
|
|
|
- if (row.identifyTheNumberOfCards != null && row.identifyTheNumberOfCards !== '') {
|
|
|
- const original = Number(filteredResults[0]?.identifyTheNumberOfCards || '0');
|
|
|
- const current = Number(row.identifyTheNumberOfCards);
|
|
|
+ if (row.rawIdentifyNum != null && row.rawIdentifyNum !== '') {
|
|
|
+ const original = Number(filteredResults[0]?.rawIdentifyNum || '0'); //原始值
|
|
|
+ const activeOriginal = Number(filteredResults[0]?.identifyTheNumberOfCards || '0'); //上一次修改后的值
|
|
|
+ const current = Number(row.identifyTheNumberOfCards); //当前输入的值
|
|
|
if (current < original) {
|
|
|
this.$toast('排面数不能小于原始值');
|
|
|
- row.identifyTheNumberOfCards = String(original);
|
|
|
+ row.identifyTheNumberOfCards = String(activeOriginal);
|
|
|
const existingIndex = this.editCountArr.findIndex(
|
|
|
(item) => item.skuProductCode === row.skuProductCode,
|
|
|
);
|
|
|
@@ -350,8 +351,15 @@ export default {
|
|
|
this.editCountArr.splice(existingIndex, 1);
|
|
|
}
|
|
|
} else {
|
|
|
- const editCount = current - original;
|
|
|
- if (editCount > 0) {
|
|
|
+ const editCount = current - activeOriginal; //本次修改的值
|
|
|
+ if (editCount === 0) {
|
|
|
+ const existingIndex = this.editCountArr.findIndex(
|
|
|
+ (item) => item.skuProductCode === row.skuProductCode,
|
|
|
+ );
|
|
|
+ if (existingIndex >= 0) {
|
|
|
+ this.editCountArr.splice(existingIndex, 1);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
const existingIndex = this.editCountArr.findIndex(
|
|
|
(item) => item.skuProductCode === row.skuProductCode,
|
|
|
);
|
|
|
@@ -365,13 +373,6 @@ export default {
|
|
|
editCount,
|
|
|
});
|
|
|
}
|
|
|
- } else if (editCount === 0) {
|
|
|
- const existingIndex = this.editCountArr.findIndex(
|
|
|
- (item) => item.skuProductCode === row.skuProductCode,
|
|
|
- );
|
|
|
- if (existingIndex >= 0) {
|
|
|
- this.editCountArr.splice(existingIndex, 1);
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
} else {
|