소스 검색

前端bug解决 sdy

zhongtianhaoyuan 4 년 전
부모
커밋
3c75a20589

+ 3 - 4
src/views/warehouse/warehouseManagementDelete.vue

@@ -36,11 +36,11 @@
         </el-table-column>
         <el-table-column prop="warehouseName" label="仓库名称">
         </el-table-column>
-        <el-table-column prop="warehouseLocation" label="仓库所在地">
+        <el-table-column prop="warehouseCity" label="仓库所在地">
         </el-table-column>
-        <el-table-column prop="nowStorage" label="应余库存(吨)">
+        <el-table-column prop="residual" label="应余库存(吨)">
         </el-table-column>
-        <el-table-column prop="personCharge;" label="负责人"> </el-table-column>
+        <el-table-column prop="personCharge" label="负责人"> </el-table-column>
 
         <el-table-column prop="address" label="操作" width="200">
           <template slot-scope="scope">
@@ -67,7 +67,6 @@
 </template>
 <script>
 import {
-  getList,
   delectlist,
   deletewarehouse,
   hide,

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

@@ -446,6 +446,197 @@ export default {
           type: 'warning',
         })
         return
+      }
+       //自检员
+      if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
+        if (
+          this.deptBudgetList.warehouseInOutDetail.qualityInspector.length <
+            2 ||
+          this.deptBudgetList.warehouseInOutDetail.qualityInspector.length > 10
+        ) {
+          this.$message({
+            message: '质检员姓名长度错误!',
+            type: 'warning',
+          })
+          return
+        }
+      }
+      if (this.deptBudgetList.warehouseInOutDetail.waterContent) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.waterContent)) {
+          this.$message({
+            message: '水分(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.waterContent < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.waterContent > 40 ||
+          (String(
+            this.deptBudgetList.warehouseInOutDetail.waterContent
+          ).indexOf('.') != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.waterContent)
+              .length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.waterContent
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '水分(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+
+      //杂质
+      if (this.deptBudgetList.warehouseInOutDetail.impurity) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.impurity)) {
+          this.$message({
+            message: '杂质(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.impurity < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.impurity > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.impurity).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.impurity).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.impurity
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '杂质(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+       //霉变
+      if (this.deptBudgetList.warehouseInOutDetail.mildewGrain) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.mildewGrain)) {
+          this.$message({
+            message: '霉变粒(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.mildewGrain < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.mildewGrain > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.mildewGrain
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '霉变粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+
+       //热损伤
+      if (this.deptBudgetList.warehouseInOutDetail.jiaorenli) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.jiaorenli)) {
+          this.$message({
+            message: '热损伤(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.jiaorenli < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.jiaorenli > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.jiaorenli
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '热损伤(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+
+        //不完整粒(%)
+      if (this.deptBudgetList.warehouseInOutDetail.imperfectGrain) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)) {
+          this.$message({
+            message: '不完整粒(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.imperfectGrain < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.imperfectGrain > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.imperfectGrain
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '不完整粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+      //容重
+       if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.bulkDensity)) {
+          this.$message({
+            message: '容重(克/升)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.bulkDensity < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.bulkDensity > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.bulkDensity
+              ).indexOf('.') +
+                1) >
+              0)
+        ) {
+          this.$message({
+            message: '容重(克/升)输入错误! 取值范围1-40之间且是整数',
+            type: 'warning',
+          })
+          return
+        }
       }
       this.$confirm(`暂存后可在待完成页面查看,确定暂存`, {
         cancelButtonText: '取消',
@@ -615,6 +806,197 @@ export default {
           type: 'warning',
         })
         return
+      }
+       //自检员
+      if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
+        if (
+          this.deptBudgetList.warehouseInOutDetail.qualityInspector.length <
+            2 ||
+          this.deptBudgetList.warehouseInOutDetail.qualityInspector.length > 10
+        ) {
+          this.$message({
+            message: '质检员姓名长度错误!',
+            type: 'warning',
+          })
+          return
+        }
+      }
+      if (this.deptBudgetList.warehouseInOutDetail.waterContent) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.waterContent)) {
+          this.$message({
+            message: '水分(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.waterContent < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.waterContent > 40 ||
+          (String(
+            this.deptBudgetList.warehouseInOutDetail.waterContent
+          ).indexOf('.') != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.waterContent)
+              .length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.waterContent
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '水分(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+
+      //杂质
+      if (this.deptBudgetList.warehouseInOutDetail.impurity) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.impurity)) {
+          this.$message({
+            message: '杂质(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.impurity < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.impurity > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.impurity).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.impurity).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.impurity
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '杂质(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+       //霉变
+      if (this.deptBudgetList.warehouseInOutDetail.mildewGrain) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.mildewGrain)) {
+          this.$message({
+            message: '霉变粒(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.mildewGrain < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.mildewGrain > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.mildewGrain
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '霉变粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+
+       //热损伤
+      if (this.deptBudgetList.warehouseInOutDetail.jiaorenli) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.jiaorenli)) {
+          this.$message({
+            message: '热损伤(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.jiaorenli < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.jiaorenli > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.jiaorenli
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '热损伤(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+
+        //不完整粒(%)
+      if (this.deptBudgetList.warehouseInOutDetail.imperfectGrain) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)) {
+          this.$message({
+            message: '不完整粒(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.imperfectGrain < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.imperfectGrain > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.imperfectGrain
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '不完整粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+      //容重
+       if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.bulkDensity)) {
+          this.$message({
+            message: '容重(克/升)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.bulkDensity < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.bulkDensity > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.bulkDensity
+              ).indexOf('.') +
+                1) >
+              0)
+        ) {
+          this.$message({
+            message: '容重(克/升)输入错误! 取值范围1-40之间且是整数',
+            type: 'warning',
+          })
+          return
+        }
       }
        this.$confirm(`确定提交出库信息`, {
         cancelButtonText: '取消',

+ 96 - 72
src/views/warehouse/warehouseManagementIoss.vue

@@ -130,17 +130,13 @@
   </div>
 </template>
 <script>
-import {
-  goodsname,
-  ioss,
-  submitioss,
-} from '@/model/warehouse/index'
+import { goodsname, ioss, submitioss } from '@/model/warehouse/index'
 
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
-import { mapActions, mapGetters, mapState } from 'vuex'
+import { mapActions, mapGetters, mapState } from 'vuex'
 // import { dayjs, fmoney, EventBus } from 'base-core-lib'
-import { dayjs} from 'base-core-lib'
+import { dayjs } from 'base-core-lib'
 export default {
   name: 'viewSpareMoney',
   components: {
@@ -179,23 +175,23 @@ export default {
       // 提交类型
       submitType: true,
       selectpackingMethod: {},
-      goodnameList:[],
+      goodnameList: [],
       size: 10,
-      
+
       compId: sessionStorage.getItem('ws-pf_compId'),
       deptCircularPage: {},
       packtypeList: {},
-      deptBudgetList1:[],
+      deptBudgetList1: [],
       date: {
         year: dayjs().format('YYYY'),
         month: dayjs().format('MM'),
       },
       contractList: [],
-      deptBudgetList:{
-        physicalInventory:0
+      deptBudgetList: {
+        physicalInventory: 0,
       },
       historyList: [],
-       rules: {
+      rules: {
         netWeight: [
           {
             required: true,
@@ -213,39 +209,49 @@ export default {
       accessoryTFs: false,
     }
   },
-   computed:{
+  computed: {
     ...mapGetters([
       'userInfo',
-      'isFullScren',
-      'tagWel',
-      'tagList',
-      'isCollapse',
-      'tag',
-      'logsLen',
-      'logsFlag',
-      'language',
-    ]),
-    ioss1 :function() {
-     return (this.deptBudgetList.cumulativeStockIn-this.deptBudgetList.cumulativeStockOut)-this.deptBudgetList.physicalInventory
+      'isFullScren',
+      'tagWel',
+      'tagList',
+      'isCollapse',
+      'tag',
+      'logsLen',
+      'logsFlag',
+      'language',
+    ]),
+    ioss1: function () {
+      return (
+        this.deptBudgetList.cumulativeStockIn -
+        this.deptBudgetList.cumulativeStockOut -
+        this.deptBudgetList.physicalInventory
+      )
     },
-    surplusInventory1: function(){
-      return this.deptBudgetList.cumulativeStockIn-this.deptBudgetList.cumulativeStockOut
+    surplusInventory1: function () {
+      return (
+        this.deptBudgetList.cumulativeStockIn -
+        this.deptBudgetList.cumulativeStockOut
+      )
     },
-    inventoryRatio1 : function(){
-      var loss=(this.deptBudgetList.cumulativeStockIn-this.deptBudgetList.cumulativeStockOut)-this.deptBudgetList.physicalInventory
-      var defect=this.deptBudgetList.cumulativeStockIn-this.deptBudgetList.physicalInventory
-      if((loss/defect)==1){
-        var num=0
-      }else{
+    inventoryRatio1: function () {
+      var loss =
+        this.deptBudgetList.cumulativeStockIn -
+        this.deptBudgetList.cumulativeStockOut -
+        this.deptBudgetList.physicalInventory
+      var defect =
+        this.deptBudgetList.cumulativeStockIn -
+        this.deptBudgetList.physicalInventory
+      if (loss / defect == 1) {
+        var num = 0
+      } else {
         // .占比=损耗量÷(累计入库-实际库存)
-        num = Math.floor((loss/defect)*1000000)/1000
+        num = Math.floor((loss / defect) * 1000000) / 1000
       }
-     
-     return num;
-    },
-      
 
-   },
+      return num
+    },
+  },
   activated() {
     //cg.viewBudget
     //cg.viewSpareMoney
@@ -253,15 +259,15 @@ export default {
     this.loaddata()
     this.showType = this.isShow
   },
-   mounted() {
+  mounted() {
     this.deptBudgetList.baseId = this.$route.query.baseId
     this.deptBudgetList.positionId = this.$route.query.positionId
     this.deptBudgetList.warehouseName = this.$route.query.warehouseName
     this.deptBudgetList.binNumber = this.$route.query.binNumber
     this.deptBudgetList1.warehouseName = this.$route.query.warehouseName
     this.deptBudgetList1.binNumber = this.$route.query.binNumber
-   this.deptBudgetList1.baseId=this.$route.query.baseId
-    this.deptBudgetList1.positionId=this.$route.query.positionId
+    this.deptBudgetList1.baseId = this.$route.query.baseId
+    this.deptBudgetList1.positionId = this.$route.query.positionId
     // this.deptBudgetList.inventoryRatio=((deptBudgetList.cumulativeStockIn-deptBudgetList.cumulativeStockOut)-deptBudgetList.physicalInventory)/(deptBudgetList.cumulativeStockIn-deptBudgetList.physicalInventory)*100
     // this.deptBudgetList.ioss=(deptBudgetList.cumulativeStockIn-deptBudgetList.cumulativeStockOut)-deptBudgetList.physicalInventory
     // this.deptBudgetList1.goodsNameKey=this.deptBudgetList.goodsNameKey
@@ -273,26 +279,46 @@ export default {
       this.$router.push({ path: 'warehouseManagementList' })
     },
     //提交按钮
-    submit(){
-       this.$refs.deptBudgetList.validate((valid) => {
+    submit() {
+      this.$refs.deptBudgetList.validate((valid) => {
         if (valid) {
-          this.deptBudgetList.surplusInventory=this.deptBudgetList.cumulativeStockIn-this.deptBudgetList.cumulativeStockOut
-          this.deptBudgetList.loss=(this.deptBudgetList.cumulativeStockIn-this.deptBudgetList.cumulativeStockOut)-this.deptBudgetList.physicalInventory
-         this.deptBudgetList.inventoryRatio=((this.deptBudgetList.cumulativeStockIn-this.deptBudgetList.cumulativeStockOut)-this.deptBudgetList.physicalInventory)/(this.deptBudgetList.cumulativeStockIn-this.deptBudgetList.physicalInventory)
-         this.deptBudgetList.baseId=this.deptBudgetList1.baseId
-          this.deptBudgetList.positionId=this.deptBudgetList1.positionId
-          this.deptBudgetList.binNumber=this.deptBudgetList1.binNumber
-          this.deptBudgetList.warehouseName=this.deptBudgetList1.warehouseName
-          this.deptBudgetList.qualityInspector= this.userInfo.showRoleName
-       for (var i = 0; i < this.goodnameList.length; i++) {
-        if (this.goodnameList[i].goodsName == this.deptBudgetList.goodsName) {
-          this.deptBudgetList.goodsNameKey = this.goodnameList[i].goodsNameKey
-        }
-      }
-         this.deptBudgetList.compId = this.compId
+          this.deptBudgetList.surplusInventory =
+            this.deptBudgetList.cumulativeStockIn -
+            this.deptBudgetList.cumulativeStockOut
+          this.deptBudgetList.loss =
+            this.deptBudgetList.cumulativeStockIn -
+            this.deptBudgetList.cumulativeStockOut -
+            this.deptBudgetList.physicalInventory
+          this.deptBudgetList.inventoryRatio =
+            (this.deptBudgetList.cumulativeStockIn -
+              this.deptBudgetList.cumulativeStockOut -
+              this.deptBudgetList.physicalInventory) /
+            (this.deptBudgetList.cumulativeStockIn -
+              this.deptBudgetList.physicalInventory)
+          this.deptBudgetList.baseId = this.deptBudgetList1.baseId
+          this.deptBudgetList.positionId = this.deptBudgetList1.positionId
+          this.deptBudgetList.binNumber = this.deptBudgetList1.binNumber
+          this.deptBudgetList.warehouseName = this.deptBudgetList1.warehouseName
+          this.deptBudgetList.qualityInspector = this.userInfo.showRoleName
+          for (var i = 0; i < this.goodnameList.length; i++) {
+            if (
+              this.goodnameList[i].goodsName == this.deptBudgetList.goodsName
+            ) {
+              this.deptBudgetList.goodsNameKey = this.goodnameList[
+                i
+              ].goodsNameKey
+            }
+          }
+          this.deptBudgetList.compId = this.compId
           this.deptBudgetList.contractType = 1
-          console.log(this.deptBudgetList)
-         submitioss(this.deptBudgetList)
+          if (this.deptBudgetList.cumulativeStockOut < 0) {
+            this.$message({
+              message: '出库量为0,不能盘损!',
+              type: 'warning',
+            })
+            return
+          }
+          submitioss(this.deptBudgetList)
             .toPromise()
             .then((response) => {
               this.$message.success('提交成功')
@@ -339,26 +365,24 @@ export default {
       console.log(`当前页: ${val}`)
       this.getList()
     },
-    changeioss(e){
-        for (var i = 0; i < this.goodnameList.length; i++) {
+    changeioss(e) {
+      for (var i = 0; i < this.goodnameList.length; i++) {
         if (this.goodnameList[i].goodsName == e) {
           this.deptBudgetList.goodsNameKey = this.goodnameList[i].goodsNameKey
         }
-      }  
+      }
       this.ioss()
     },
-     ioss(){
-      ioss(
-        this.deptBudgetList
-      )
+    ioss() {
+      ioss(this.deptBudgetList)
         .toPromise()
         .then((response) => {
-         this.deptBudgetList=response     
+          this.deptBudgetList = response
         })
     },
-     loaddata() {
+    loaddata() {
       // 货名
-      goodsname({positionId : this.$route.query.positionId})
+      goodsname({ positionId: this.$route.query.positionId })
         .toPromise()
         .then((response) => {
           this.goodnameList = response
@@ -370,8 +394,8 @@ export default {
           this.searchType = this.taskTypeList[i].type
         }
       }
-    },  
-   
+    },
+
     // deletecontract(){},
     //删除
     approve() {},

+ 12 - 1
src/views/warehouse/warehouseManagementLook.vue

@@ -74,7 +74,7 @@
           </ws-form-item>
           <!--总储量(吨)-->
           <ws-form-item label="总储量(吨)" span="1" prop="totalStorage">
-            {{ deptBudgetList.totalStorage }}
+            {{ totalStorage }}
           </ws-form-item>
         </ws-info-table>
 
@@ -214,6 +214,17 @@ 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 += Number(this.deptBudgetList.warehousePositionInfoList[i].maxStorage)
+     }
+     }    
+     return sum
+    },
+},
   methods: {
     //返回按钮
     returnWarehouse() {

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

@@ -168,7 +168,6 @@ export default {
       improved: [],
       row: [],
       deptBudgetList1: [],
-
       // 提交类型
       submitType: true,
       selectpackingMethod: {},
@@ -198,7 +197,6 @@ export default {
     // this.getVesselData();
     this.deptBudgetList1.warehouseName = this.$route.query.warehouseName
     this.binNumber = this.$route.params.binNumber
-
     //接参
     this.getList(this.$route.query.baseId, this.$route.query.positionId)
     this.showType = this.isShow

+ 431 - 47
src/views/warehouse/warehouseManagementPut.vue

@@ -26,12 +26,12 @@
       <div class="basicInformation">
         <h2>
           <img
-          style="position: relative; top: 2px"
-          width="19"
-          height="19"
-          src="../../../public/img/cangku.png"
-          alt=""
-        />
+            style="position: relative; top: 2px"
+            width="19"
+            height="19"
+            src="../../../public/img/cangku.png"
+            alt=""
+          />
           {{ deptBudgetList.warehouseName }}库
           <span class="position"> {{ deptBudgetList.binNumber }}仓位 </span>
         </h2>
@@ -186,7 +186,7 @@
           <ws-input
             v-model="deptBudgetList.warehouseInOutDetail.qualityInspector"
             placeholder="请输入质检员姓名"
-            maxlength="120"
+            maxlength="10"
             size="small"
           />
         </ws-form-item>
@@ -199,7 +199,7 @@
             <ws-input
               v-model="deptBudgetList.warehouseInOutDetail.waterContent"
               placeholder="请输入水分占比"
-              maxlength="120"
+              maxlength="40"
               size="small"
             />
           </ws-form-item>
@@ -208,7 +208,7 @@
             <ws-input
               v-model="deptBudgetList.warehouseInOutDetail.impurity"
               placeholder="请输入杂质占比"
-              maxlength="120"
+              maxlength="40"
               size="small"
             />
           </ws-form-item>
@@ -217,7 +217,7 @@
             <ws-input
               v-model="deptBudgetList.warehouseInOutDetail.bulkDensity"
               placeholder="请输入容重"
-              maxlength="120"
+              maxlength="40"
               size="small"
             />
           </ws-form-item>
@@ -226,7 +226,7 @@
             <ws-input
               v-model="deptBudgetList.warehouseInOutDetail.mildewGrain"
               placeholder="请输入霉变粒占比"
-              maxlength="120"
+              maxlength="40"
               size="small"
             />
           </ws-form-item>
@@ -235,7 +235,7 @@
             <ws-input
               v-model="deptBudgetList.warehouseInOutDetail.jiaorenli"
               placeholder="请输入热损伤占比"
-              maxlength="120"
+              maxlength="40"
               size="small"
             />
           </ws-form-item>
@@ -244,7 +244,7 @@
             <ws-input
               v-model="deptBudgetList.warehouseInOutDetail.imperfectGrain"
               placeholder="请输入不完整粒占比"
-              maxlength="120"
+              maxlength="40"
               size="small"
             />
           </ws-form-item>
@@ -388,8 +388,8 @@ export default {
         })
         return
       }
-      if(!this.deptBudgetList.grossWeight){
-         this.$message({
+      if (!this.deptBudgetList.grossWeight) {
+        this.$message({
           message: '毛重不能为空',
           type: 'warning',
         })
@@ -409,8 +409,8 @@ export default {
         })
         return
       }
-       if(!this.deptBudgetList.tare){
-         this.$message({
+      if (!this.deptBudgetList.tare) {
+        this.$message({
           message: '皮重不能为空',
           type: 'warning',
         })
@@ -430,8 +430,8 @@ export default {
         })
         return
       }
-       if(!this.deptBudgetList.agent){
-         this.$message({
+      if (!this.deptBudgetList.agent) {
+        this.$message({
           message: '经办人不能为空',
           type: 'warning',
         })
@@ -447,8 +447,8 @@ export default {
         })
         return
       }
-       if(!this.deptBudgetList.carNo){
-         this.$message({
+      if (!this.deptBudgetList.carNo) {
+        this.$message({
           message: '车牌号不能为空',
           type: 'warning',
         })
@@ -461,8 +461,8 @@ export default {
         })
         return
       }
-       if(!this.deptBudgetList.contractNo){
-         this.$message({
+      if (!this.deptBudgetList.contractNo) {
+        this.$message({
           message: '合同编号不能为空',
           type: 'warning',
         })
@@ -479,15 +479,206 @@ export default {
         return
       }
 
-      
-      if(this.deptBudgetList.netWeight > this.$route.query.capacity){
+      if (this.deptBudgetList.netWeight > this.$route.query.capacity) {
         this.$message({
           message: '入库量大于该仓库容量!',
           type: 'warning',
         })
         return
       }
-      this.$confirm(`确定提交入库信息`, {
+       //自检员
+      if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
+        if (
+          this.deptBudgetList.warehouseInOutDetail.qualityInspector.length <
+            2 ||
+          this.deptBudgetList.warehouseInOutDetail.qualityInspector.length > 10
+        ) {
+          this.$message({
+            message: '质检员姓名长度错误!',
+            type: 'warning',
+          })
+          return
+        }
+      }
+      if (this.deptBudgetList.warehouseInOutDetail.waterContent) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.waterContent)) {
+          this.$message({
+            message: '水分(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.waterContent < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.waterContent > 40 ||
+          (String(
+            this.deptBudgetList.warehouseInOutDetail.waterContent
+          ).indexOf('.') != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.waterContent)
+              .length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.waterContent
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '水分(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+
+      //杂质
+      if (this.deptBudgetList.warehouseInOutDetail.impurity) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.impurity)) {
+          this.$message({
+            message: '杂质(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.impurity < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.impurity > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.impurity).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.impurity).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.impurity
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '杂质(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+       //霉变
+      if (this.deptBudgetList.warehouseInOutDetail.mildewGrain) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.mildewGrain)) {
+          this.$message({
+            message: '霉变粒(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.mildewGrain < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.mildewGrain > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.mildewGrain
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '霉变粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+
+       //热损伤
+      if (this.deptBudgetList.warehouseInOutDetail.jiaorenli) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.jiaorenli)) {
+          this.$message({
+            message: '热损伤(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.jiaorenli < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.jiaorenli > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.jiaorenli
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '热损伤(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+
+        //不完整粒(%)
+      if (this.deptBudgetList.warehouseInOutDetail.imperfectGrain) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)) {
+          this.$message({
+            message: '不完整粒(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.imperfectGrain < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.imperfectGrain > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.imperfectGrain
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '不完整粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+      //容重
+       if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.bulkDensity)) {
+          this.$message({
+            message: '容重(克/升)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.bulkDensity < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.bulkDensity > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.bulkDensity
+              ).indexOf('.') +
+                1) >
+              0)
+        ) {
+          this.$message({
+            message: '容重(克/升)输入错误! 取值范围1-40之间且是整数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+
+        this.$confirm(`确定提交入库信息`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',
         type: 'warning',
@@ -515,17 +706,19 @@ export default {
         .catch(() => {
           return false
         })
+    
+      
     },
     temporaryStorage() {
-       if (!this.deptBudgetList.goodsName) {
+      if (!this.deptBudgetList.goodsName) {
         this.$message({
           message: '货名不能为空',
           type: 'warning',
         })
         return
       }
-      if(!this.deptBudgetList.grossWeight){
-         this.$message({
+      if (!this.deptBudgetList.grossWeight) {
+        this.$message({
           message: '毛重不能为空',
           type: 'warning',
         })
@@ -545,8 +738,8 @@ export default {
         })
         return
       }
-       if(!this.deptBudgetList.tare){
-         this.$message({
+      if (!this.deptBudgetList.tare) {
+        this.$message({
           message: '皮重不能为空',
           type: 'warning',
         })
@@ -566,8 +759,8 @@ export default {
         })
         return
       }
-       if(!this.deptBudgetList.agent){
-         this.$message({
+      if (!this.deptBudgetList.agent) {
+        this.$message({
           message: '经办人不能为空',
           type: 'warning',
         })
@@ -583,8 +776,8 @@ export default {
         })
         return
       }
-       if(!this.deptBudgetList.carNo){
-         this.$message({
+      if (!this.deptBudgetList.carNo) {
+        this.$message({
           message: '车牌号不能为空',
           type: 'warning',
         })
@@ -597,8 +790,8 @@ export default {
         })
         return
       }
-       if(!this.deptBudgetList.contractNo){
-         this.$message({
+      if (!this.deptBudgetList.contractNo) {
+        this.$message({
           message: '合同编号不能为空',
           type: 'warning',
         })
@@ -614,13 +807,204 @@ export default {
         })
         return
       }
-       if(this.deptBudgetList.netWeight > this.$route.query.capacity){
+      if (this.deptBudgetList.netWeight > this.$route.query.capacity) {
         this.$message({
           message: '入库量大于该仓库容量!',
           type: 'warning',
         })
         return
       }
+      //自检员
+      if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
+        if (
+          this.deptBudgetList.warehouseInOutDetail.qualityInspector.length <
+            2 ||
+          this.deptBudgetList.warehouseInOutDetail.qualityInspector.length > 10
+        ) {
+          this.$message({
+            message: '质检员姓名长度错误!',
+            type: 'warning',
+          })
+          return
+        }
+      }
+      if (this.deptBudgetList.warehouseInOutDetail.waterContent) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.waterContent)) {
+          this.$message({
+            message: '水分(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.waterContent < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.waterContent > 40 ||
+          (String(
+            this.deptBudgetList.warehouseInOutDetail.waterContent
+          ).indexOf('.') != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.waterContent)
+              .length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.waterContent
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '水分(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+
+      //杂质
+      if (this.deptBudgetList.warehouseInOutDetail.impurity) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.impurity)) {
+          this.$message({
+            message: '杂质(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.impurity < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.impurity > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.impurity).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.impurity).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.impurity
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '杂质(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+       //霉变
+      if (this.deptBudgetList.warehouseInOutDetail.mildewGrain) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.mildewGrain)) {
+          this.$message({
+            message: '霉变粒(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.mildewGrain < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.mildewGrain > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.mildewGrain
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '霉变粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+
+       //热损伤
+      if (this.deptBudgetList.warehouseInOutDetail.jiaorenli) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.jiaorenli)) {
+          this.$message({
+            message: '热损伤(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.jiaorenli < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.jiaorenli > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.jiaorenli
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '热损伤(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+
+        //不完整粒(%)
+      if (this.deptBudgetList.warehouseInOutDetail.imperfectGrain) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)) {
+          this.$message({
+            message: '不完整粒(%)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.imperfectGrain < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.imperfectGrain > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.imperfectGrain
+              ).indexOf('.') +
+                1) >
+              2)
+        ) {
+          this.$message({
+            message: '不完整粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
+            type: 'warning',
+          })
+          return
+        }
+      }
+      //容重
+       if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
+        if (isNaN(this.deptBudgetList.warehouseInOutDetail.bulkDensity)) {
+          this.$message({
+            message: '容重(克/升)非数字!',
+            type: 'warning',
+          })
+          return
+        }
+        if (
+          this.deptBudgetList.warehouseInOutDetail.bulkDensity < 1 ||
+          this.deptBudgetList.warehouseInOutDetail.bulkDensity > 40 ||
+          (String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).length -
+              (String(
+                this.deptBudgetList.warehouseInOutDetail.bulkDensity
+              ).indexOf('.') +
+                1) >
+              0)
+        ) {
+          this.$message({
+            message: '容重(克/升)输入错误! 取值范围1-40之间且是整数',
+            type: 'warning',
+          })
+          return
+        }
+      }
       this.$confirm(`暂存后可在待完成页面查看,确定暂存`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',
@@ -839,14 +1223,14 @@ export default {
 }
 //仓位
 
-.position{
-background: #AFB5CB;
-border-radius: 2px;
-font-size: 12px;
-color: #FFFFFF;
-line-height: 20px;
-display: inline-grid;
-padding: 2px 4px;
+.position {
+  background: #afb5cb;
+  border-radius: 2px;
+  font-size: 12px;
+  color: #ffffff;
+  line-height: 20px;
+  display: inline-grid;
+  padding: 2px 4px;
 }
 // .position {
 //   width: 52px;
@@ -902,7 +1286,7 @@ padding: 2px 4px;
   background-color: #f6f7fc;
 }
 
-/deep/.neifor .el-input--small .el-input__inner{
+/deep/.neifor .el-input--small .el-input__inner {
   width: 100%;
 }
 </style>

+ 1 - 1
vue.config.js

@@ -144,7 +144,7 @@ module.exports = {
         // target: 'http://standard-dev.winsea.com/', //目标地址
         // target: 'http://localhost:8090/',
         // target: 'http://192.168.1.121:8090/',
-        target: 'http://192.168.1.124:8090/',
+        target: 'http://192.168.1.119:8090/',
         // target: 'http://192.168.1.119:8090/',
         // target: 'http://192.168.24.5:8098',//目标地址
         // target: 'http://product-server.winsea.com/',