소스 검색

feat(batchSemiProductJobBom): 修改减损逻辑,调整提示信息并增加处理类型

xieyong 1 개월 전
부모
커밋
f6396ae2ca
1개의 변경된 파일과 11개의 추가작업 그리고 7개의 파일을 삭제
  1. 11 7
      src/views/produce/components/jobBooking/components/batchSemiProductJobBom.vue

+ 11 - 7
src/views/produce/components/jobBooking/components/batchSemiProductJobBom.vue

@@ -2072,8 +2072,8 @@
 
       async getReduceLossParam() {
         if (this.reduceLossForm.quantity) {
-          if (Number(this.reduceLossData.feedQuantity) == 0) {
-            this.$message.warning('减损数不能为0');
+          if (Number(this.reduceLossData.feedQuantity) <= 0) {
+            this.$message.warning('增加数不能小于0');
             return;
           }
 
@@ -2081,7 +2081,7 @@
             Number(this.reduceLossData.feedQuantity) <
             Number(this.reduceLossForm.quantity)
           ) {
-            this.$message.warning('减损数不能大于数量');
+            this.$message.warning('增加数不能大于数量');
             return;
           }
 
@@ -2100,20 +2100,24 @@
             });
 
             if (dataList.length != 0) {
-              this.refreshReduceLossData(dataList);
+              this.refreshReduceLossData(dataList,'add');
             }
           });
         }
         this.reduceLossVisible = false;
       },
 
-      refreshReduceLossData(list) {
+      refreshReduceLossData(list,type) {
         const number = this.sub(
           Number(this.list[this.reduceLossIndex].feedQuantity),
           Number(this.reduceLossForm.quantity)
         );
-        this.list[this.reduceLossIndex].extInfo.sourceQuantity = number;
-        this.list[this.reduceLossIndex].feedQuantity = number;
+        
+        if(!type) {
+          this.list[this.reduceLossIndex].extInfo.sourceQuantity = number;
+          this.list[this.reduceLossIndex].feedQuantity = number;
+        }
+        
         this.list[this.reduceLossIndex].extInfo.newWeight =
           (Number(this.list[this.reduceLossIndex].extInfo.newWeight) * 100000) /
             100000 -