新增批发价限制

This commit is contained in:
weipengfei 2023-12-11 17:54:02 +08:00
parent 4e708d345c
commit 84da67582c

View File

@ -1237,6 +1237,7 @@
import ueditorFrom from '@/components/ueditorFrom' import ueditorFrom from '@/components/ueditorFrom'
import VueUeditorWrap from 'vue-ueditor-wrap' import VueUeditorWrap from 'vue-ueditor-wrap'
import Sortable from 'sortablejs' import Sortable from 'sortablejs'
import { Message } from 'element-ui';
import { import {
shippingListApi, shippingListApi,
templateLsitApi, templateLsitApi,
@ -2384,6 +2385,16 @@ export default {
this.formValidate.attrValue = this.OneattrValue; this.formValidate.attrValue = this.OneattrValue;
this.formValidate.attr = []; 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 => { this.$refs[name].validate(valid => {
if (valid) { if (valid) {
this.validateAttr(); this.validateAttr();