Browse Source

前端改正sdy

zhongtianhaoyuan 4 years ago
parent
commit
6a5a42d914

+ 59 - 8
src/views/warehouse/warehouseManagementAdd.vue

@@ -331,20 +331,23 @@ export default {
     },
 
     submit() {
-      console.log(this.deptBudgetList)
-      if (!this.deptBudgetList.warehouseName) {
+       if(!this.deptBudgetList.warehouseName){
         this.$message({
-          message: '仓库名称不能为空',
+          message: '仓库名称不能为空',
           type: 'warning',
         })
         return
       }
-      if (
-        this.deptBudgetList.warehouseName.length < 2 ||
-        this.deptBudgetList.warehouseName.length > 20
-      ) {
+      if(this.deptBudgetList.warehouseName.length < 2 || this.deptBudgetList.warehouseName.length > 20){
         this.$message({
-          message: '仓库名称长度不符合要求,请控制在2-20字符之内',
+          message: '仓库名长度不符合要求!',
+          type: 'warning',
+        })
+        return
+      }
+       if(!this.deptBudgetList.personCharge){
+        this.$message({
+          message: '负责人不能为空!',
           type: 'warning',
         })
         return
@@ -359,6 +362,54 @@ export default {
         })
         return
       }
+       if(!this.selectedOptions){
+        this.$message({
+          message: '仓库所在地不能为空!',
+          type: 'warning',
+        })
+        return
+      }
+
+       if(!this.deptBudgetList.detailedAddress){
+        this.$message({
+          message: '详细地址不能为空!',
+          type: 'warning',
+        })
+        return
+      }
+       if(this.deptBudgetList.warehouseName.length < 2 || this.deptBudgetList.warehouseName.length > 20){
+        this.$message({
+          message: '详细地址长度不符合要求!',
+          type: 'warning',
+        })
+        return
+      }
+      
+      if(this.totalStorage <= 0){
+        this.$message({
+          message: '仓位储量不能为空!',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.deptBudgetList.warehouseName) {
+        this.$message({
+          message: '仓库名称不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.warehouseName.length < 2 ||
+        this.deptBudgetList.warehouseName.length > 20
+      ) {
+        this.$message({
+          message: '仓库名称长度不符合要求,请控制在2-20字符之内',
+          type: 'warning',
+        })
+        return
+      }
+      
       if (this.deptBudgetList.personPhone.length > 11) {
         this.$message({
           message: '手机号输入有误',

+ 4 - 0
src/views/warehouse/warehouseManagementDelivery.vue

@@ -616,6 +616,10 @@ export default {
         })
         return
       }
+     
+
+
+
        this.$confirm(`确定提交出库信息`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',

+ 15 - 2
src/views/warehouse/warehouseManagementEdit.vue

@@ -88,12 +88,13 @@
           </ws-form-item>
           <!--总储量(吨)-->
           <ws-form-item label="总储量(吨)" span="1" prop="totalStorage">
-            <ws-input
+            <!-- <ws-input
               v-model="deptBudgetList.totalStorage"
               placeholder="请输入总储量(吨)"
               maxlength="20"
               size="small"
-            />
+            /> -->
+            {{totalStorage}}
           </ws-form-item>
         </ws-info-table>
         <div v-for="(item, index) in deptBudgetList.warehousePositionInfoList">
@@ -254,7 +255,19 @@ export default {
     this.loaddata()
     this.showType = this.isShow
   },
+computed : {
+   totalStorage :function() {
+     var sum = 0
+     if(this.deptBudgetList.warehousePositionInfoList){
+       for(var i = 0;i < this.deptBudgetList.warehousePositionInfoList.length; i++ ){
 
+      sum += this.deptBudgetList.warehousePositionInfoList[i].maxStorage
+     }
+     }
+     
+     return sum
+    },
+},
   methods: {
     //返回按钮
     returnWarehouse() {

+ 11 - 10
src/views/warehouse/warehouseManagementList.vue

@@ -252,11 +252,16 @@ export default {
           positionId: item.binNumberId,
           warehouseName: item.warehouseName,
           binNumber: item.binNumber,
+          capacity: item.capacity,
         },
       })
     },
     //入库
     warehousing(item) {
+      var free = 0
+      for (var i = 0; i < item.warehouseNumViewList.length; i++) {
+        free += Number(item.warehouseNumViewList[i].storage)
+      }
       this.$router.push({
         path: 'warehouseManagementPut',
         query: {
@@ -264,6 +269,7 @@ export default {
           positionId: item.binNumberId,
           warehouseName: item.warehouseName,
           binNumber: item.binNumber,
+          capacity:item.capacity - free ,
         },
       })
     },
@@ -286,16 +292,13 @@ export default {
         //   this.pos = 0
         // } else {
         //不是第一项时,就根据标识去存储
-        console.log(data[index].warehouseNumViewList.length)
         if (data[index].warehouseNumViewList.length > 1) {
           // 查找到符合条件的数据时每次要把之前存储的数据+1
           this.spanArr[this.pos] = data[index].warehouseNumViewList.length
           this.spanArr.push(0)
         } else {
           // 没有符合的数据时,要记住当前的index
-
           this.spanArr.push(1)
-
           this.pos = index
         }
         // }
@@ -305,12 +308,11 @@ export default {
     nocomplete(row) {
       this.$router.push({
         path: 'warehouseManagementNoComplete',
-        query: { baseId: row.warehouseId,
-         positionId: row.binNumberId,
-         warehouseName: row.warehouseName,
-          binNumber : row.binNumber
-              
-
+        query: {
+          baseId: row.warehouseId,
+          positionId: row.binNumberId,
+          warehouseName: row.warehouseName,
+          binNumber: row.binNumber,
         },
       })
     },
@@ -465,7 +467,6 @@ export default {
       this.dialogViewSpareMoney = false
     },
     history(row) {
-      console.log(row)
       billoperatehis({ id: row.id })
         .toPromise()
         .then((response) => {

+ 0 - 2
src/views/warehouse/warehouseManagementNoComplete.vue

@@ -211,7 +211,6 @@ export default {
     returnWarehouse() {
       this.$router.push({ path: 'warehouseManagementList' })
     },
-
     //编辑
     edits(row) {
       if (row.inOutFlag == 2) {
@@ -222,7 +221,6 @@ export default {
             binNumber: row.binNumber,
             baseId: row.warehouseId,
             positionId: row.binNumberId,
-
           },
         })
       } else if(row.inOutFlag==1){

+ 16 - 0
src/views/warehouse/warehouseManagementPut.vue

@@ -478,6 +478,15 @@ export default {
         })
         return
       }
+
+      
+      if(this.deptBudgetList.netWeight > this.$route.query.capacity){
+        this.$message({
+          message: '入库量大于该仓库容量!',
+          type: 'warning',
+        })
+        return
+      }
       this.$confirm(`确定提交入库信息`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',
@@ -604,6 +613,13 @@ export default {
           type: 'warning',
         })
         return
+      }
+       if(this.deptBudgetList.netWeight > this.$route.query.capacity){
+        this.$message({
+          message: '入库量大于该仓库容量!',
+          type: 'warning',
+        })
+        return
       }
       this.$confirm(`暂存后可在待完成页面查看,确定暂存`, {
         cancelButtonText: '取消',