|
@@ -1237,9 +1237,15 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
validateSampleCount(sampleCount) {
|
|
validateSampleCount(sampleCount) {
|
|
|
- const invalidItem = this.selectedList.find(
|
|
|
|
|
- (item) => item.measureQuantity < sampleCount
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ const chooseNumber = this.selectedList.reduce((acc, pro) => {
|
|
|
|
|
+ return pro.measureQuantity ? acc + Number(pro.measureQuantity) : acc;
|
|
|
|
|
+ }, 0);
|
|
|
|
|
+
|
|
|
|
|
+ const invalidItem = chooseNumber < sampleCount;
|
|
|
|
|
+ // console.log(this.selectedList, 'this.selectedList');
|
|
|
|
|
+ // const invalidItem = this.selectedList.find(
|
|
|
|
|
+ // (item) => item.measureQuantity < sampleCount
|
|
|
|
|
+ // );
|
|
|
if (invalidItem) {
|
|
if (invalidItem) {
|
|
|
this.$message.info('所选的条目计量数量小于取样计量数量');
|
|
this.$message.info('所选的条目计量数量小于取样计量数量');
|
|
|
return false;
|
|
return false;
|