From 8a825a48ff4c342cee62d379d6875694044ce3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Thu, 3 Nov 2022 00:05:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E5=95=86=E5=93=81=E7=9A=84=E6=9C=80?= =?UTF-8?q?=E4=BD=8E=E5=92=8C=E6=9C=80=E9=AB=98=E5=AE=89=E5=85=A8=E5=BA=93?= =?UTF-8?q?=E5=AD=98=E8=BF=9B=E8=A1=8C=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/material/modules/MaterialModal.vue | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/jshERP-web/src/views/material/modules/MaterialModal.vue b/jshERP-web/src/views/material/modules/MaterialModal.vue index 120a7330..26536d67 100644 --- a/jshERP-web/src/views/material/modules/MaterialModal.vue +++ b/jshERP-web/src/views/material/modules/MaterialModal.vue @@ -354,16 +354,16 @@ title: '多属性', key: 'sku', width: '20%', type: FormTypes.input, defaultValue: '', readonly:true, placeholder: '点击生成条码赋值' }, { - title: '采购价', key: 'purchaseDecimal', width: '9%', type: FormTypes.input, defaultValue: '', placeholder: '请输入${title}' + title: '采购价', key: 'purchaseDecimal', width: '9%', type: FormTypes.inputNumber, defaultValue: '', placeholder: '请输入${title}' }, { - title: '零售价', key: 'commodityDecimal', width: '9%', type: FormTypes.input, defaultValue: '', placeholder: '请输入${title}' + title: '零售价', key: 'commodityDecimal', width: '9%', type: FormTypes.inputNumber, defaultValue: '', placeholder: '请输入${title}' }, { - title: '销售价', key: 'wholesaleDecimal', width: '9%', type: FormTypes.input, defaultValue: '', placeholder: '请输入${title}' + title: '销售价', key: 'wholesaleDecimal', width: '9%', type: FormTypes.inputNumber, defaultValue: '', placeholder: '请输入${title}' }, { - title: '最低售价', key: 'lowDecimal', width: '9%', type: FormTypes.input, defaultValue: '', placeholder: '请输入${title}' + title: '最低售价', key: 'lowDecimal', width: '9%', type: FormTypes.inputNumber, defaultValue: '', placeholder: '请输入${title}' } ] }, @@ -375,13 +375,13 @@ title: '仓库', key: 'name', width: '15%', type: FormTypes.normal }, { - title: '期初库存数量', key: 'initStock', width: '15%', type: FormTypes.input, defaultValue: '', placeholder: '请输入${title}' + title: '期初库存数量', key: 'initStock', width: '15%', type: FormTypes.inputNumber, defaultValue: '', placeholder: '请输入${title}' }, { - title: '最低安全库存数量', key: 'lowSafeStock', width: '15%', type: FormTypes.input, defaultValue: '', placeholder: '请输入${title}' + title: '最低安全库存数量', key: 'lowSafeStock', width: '15%', type: FormTypes.inputNumber, defaultValue: '', placeholder: '请输入${title}' }, { - title: '最高安全库存数量', key: 'highSafeStock', width: '15%', type: FormTypes.input, defaultValue: '', placeholder: '请输入${title}' + title: '最高安全库存数量', key: 'highSafeStock', width: '15%', type: FormTypes.inputNumber, defaultValue: '', placeholder: '请输入${title}' } ] }, @@ -644,6 +644,17 @@ } } } + //对最低和最高安全库存进行校验 + for (let i = 0; i < formData.stock.length; i++) { + let depotStockObj = formData.stock[i] + if(depotStockObj.lowSafeStock && depotStockObj.highSafeStock) { + if(depotStockObj.lowSafeStock-0 > depotStockObj.highSafeStock-0) { + this.$message.warning('抱歉,' + depotStockObj.name + '的最低安全库存大于最高安全库存!') + return + } + } + } + //图片校验 if(this.fileList && this.fileList.length > 0) { formData.imgName = this.fileList let fileArr = this.fileList.split(',')