From 84da67582c81262742e44cc5bfcdc9cc364411f5 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Mon, 11 Dec 2023 17:54:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=89=B9=E5=8F=91=E4=BB=B7?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/product/addProduct/index.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/views/product/addProduct/index.vue b/src/views/product/addProduct/index.vue index 76aafe5..4d086df 100644 --- a/src/views/product/addProduct/index.vue +++ b/src/views/product/addProduct/index.vue @@ -1237,6 +1237,7 @@ import ueditorFrom from '@/components/ueditorFrom' import VueUeditorWrap from 'vue-ueditor-wrap' import Sortable from 'sortablejs' +import { Message } from 'element-ui'; import { shippingListApi, templateLsitApi, @@ -2384,6 +2385,16 @@ export default { this.formValidate.attrValue = this.OneattrValue; this.formValidate.attr = []; } + let priceObj = { + price: false, + procure_price: false + } + this.formValidate.attrValue.forEach(e => { + if (!e.price || e.price == 0) priceObj.price = true; + if (!e.procure_price || e.procure_price == 0) priceObj.procure_price = true; + }) + if (priceObj.price) return Message.error('零售价不能为小于等于0');; + if (priceObj.procure_price) return Message.error('批发价不能为小于等于0'); this.$refs[name].validate(valid => { if (valid) { this.validateAttr();