Переглянути джерело

流程修改新增默认值范围

andy 3 роки тому
батько
коміт
4b4ec01f3c

+ 29 - 1
ruoyi-ui/src/views/ams/lineCall/index.vue

@@ -103,7 +103,7 @@
     <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="物料" prop="sku" v-if="form.skuTypeFlag !== 'Hidden'">
-          <el-select style="width: 100%" v-model="form.sku" placeholder="请选择物料" clearable size="small" @change="skuChange">
+          <el-select style="width: 100%" v-model="form.sku" placeholder="请选择物料" clearable size="small">
             <el-option
               v-for="dict in skuTypeCombo"
               :key="dict.sku"
@@ -283,8 +283,12 @@
           skuTypeFlag: 'Choice',
           qty: null,
           qtyFlag: 'Choice',
+          qtyMin: null,
+          qtyMax: null,
           weight: null,
           weightFlag: 'Choice',
+          weightMin: null,
+          weightMax: null,
           supplier: '',
           supplierFlag: 'Choice',
           locationFrom: null,
@@ -336,7 +340,13 @@
           this.locationToCombo = response.locationTo
           this.form.skuTypeFlag = response.skuTypeFlag
           this.form.qtyFlag = response.qtyFlag
+          this.form.qty = response.qty
+          this.form.qtyMin = response.qtyMin
+          this.form.qtyMax = response.qtyMax
           this.form.weightFlag = response.weightFlag
+          this.form.weight = response.weight
+          this.form.weightMin = response.weightMin
+          this.form.weightMax = response.weightMax
           this.form.supplierFlag = response.supplierFlag
           this.form.locationFromFlag = response.locationFromFlag
           this.form.locationToFlag = response.locationToFlag
@@ -356,10 +366,28 @@
             if (this.form.qtyFlag === 'Required' && this.form.qty === null) {
               this.$modal.msgError("数量必须输入");
               return
+            } else if (this.form.qtyMin != null || this.form.qtyMax != null){
+              if(this.form.qty < this.form.qtyMin) {
+                this.$modal.msgError("数量小于范围:" + this.form.qtyMin);
+                return
+              }
+              if(this.form.qty > this.form.qtyMax) {
+                this.$modal.msgError("数量大于范围:" + this.form.qtyMax);
+                return
+              }
             }
             if (this.form.weightFlag === 'Required' && this.form.weight === null) {
               this.$modal.msgError("重量必须输入");
               return
+            } else if (this.form.weightMin != null || this.form.weightMax != null) {
+              if(this.form.weight < this.form.weightMin) {
+                this.$modal.msgError("重量小于范围:" + this.form.weightMin);
+                return
+              }
+              if(this.form.weight > this.form.weightMax) {
+                this.$modal.msgError("重量大于范围:" + this.form.weightMax);
+                return
+              }
             }
             if (this.form.supplierFlag === 'Required' && this.form.supplier === null) {
               this.$modal.msgError("供应商必须输入");

+ 36 - 0
warewms-ams/src/main/java/com/ruoyi/ams/lineCall/domain/vo/LineCallVO.java

@@ -17,8 +17,12 @@ public class LineCallVO {
     private String skuTypeFlag;
     private Double qty;
     private String qtyFlag;
+    private Double qtyMax;
+    private Double qtyMin;
     private Double weight;
     private String weightFlag;
+    private Double weightMax;
+    private Double weightMin;
     private String supplier;
     private String supplierFlag;
     private List<BaseLocationInfo> locationFrom;
@@ -121,4 +125,36 @@ public class LineCallVO {
     public void setLocationToFlag(String locationToFlag) {
         this.locationToFlag = locationToFlag;
     }
+
+    public Double getQtyMax() {
+        return qtyMax;
+    }
+
+    public void setQtyMax(Double qtyMax) {
+        this.qtyMax = qtyMax;
+    }
+
+    public Double getQtyMin() {
+        return qtyMin;
+    }
+
+    public void setQtyMin(Double qtyMin) {
+        this.qtyMin = qtyMin;
+    }
+
+    public Double getWeightMax() {
+        return weightMax;
+    }
+
+    public void setWeightMax(Double weightMax) {
+        this.weightMax = weightMax;
+    }
+
+    public Double getWeightMin() {
+        return weightMin;
+    }
+
+    public void setWeightMin(Double weightMin) {
+        this.weightMin = weightMin;
+    }
 }

+ 22 - 0
warewms-ams/src/main/java/com/ruoyi/ams/lineCall/service/impl/LineCallServiceImpl.java

@@ -94,6 +94,28 @@ public class LineCallServiceImpl implements ILineCallService {
         if (flowConfigHeaderVO.getWeight() != null) {
             lineCallVO.setWeight(flowConfigHeaderVO.getWeight().doubleValue());
         }
+        if (!StringUtils.isEmpty(flowConfigHeaderVO.getWeightRange())) {
+            String[] arr = flowConfigHeaderVO.getWeightRange().split("-");
+            if (arr.length > 0) {
+                if (arr[0] != null) {
+                    lineCallVO.setWeightMin(Double.valueOf(arr[0]));
+                }
+                if (arr[arr.length - 1] != null) {
+                    lineCallVO.setWeightMax(Double.valueOf(arr[arr.length - 1]));
+                }
+            }
+        }
+        if (!StringUtils.isEmpty(flowConfigHeaderVO.getQtyRange())) {
+            String[] arr = flowConfigHeaderVO.getQtyRange().split("-");
+            if (arr.length > 0) {
+                if (arr[0] != null) {
+                    lineCallVO.setQtyMin(Double.valueOf(arr[0]));
+                }
+                if (arr[arr.length - 1] != null) {
+                    lineCallVO.setQtyMax(Double.valueOf(arr[arr.length - 1]));
+                }
+            }
+        }
         lineCallVO.setSkuList(skuList);
         lineCallVO.setLocationFrom(locationFromList);
         lineCallVO.setLocationFromFlag(flowConfigHeaderVO.getLocationFromFlag());