From 773efe87ca5e77da66ec9588e4958c6dffe428a6 Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Tue, 23 Apr 2024 18:01:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E7=AE=A1=E7=90=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/product/addGood/addGood.vue | 53 +- pages/product/addGoodDetail/addGoodDetail.vue | 256 ++- pages/product/addGoodDetail/goodsPrice.vue | 92 +- pages/product/list/index - 副本.vue | 1367 +++++++++++++++++ pages/product/list/index.vue | 309 +++- pages/product/updateStock/updateStock.vue | 52 +- utils/util.js | 1 - 7 files changed, 1935 insertions(+), 195 deletions(-) create mode 100644 pages/product/list/index - 副本.vue diff --git a/pages/product/addGood/addGood.vue b/pages/product/addGood/addGood.vue index 5dbee42..ded1b87 100644 --- a/pages/product/addGood/addGood.vue +++ b/pages/product/addGood/addGood.vue @@ -12,7 +12,7 @@ - + 上传时应注重真实性、清晰度 @@ -68,14 +68,16 @@ + placeholder="请输入零售价" type='number' v-model="formData.attrValue[0].price" + slot='right'> + placeholder="请输入批发价格" type='number' v-model="formData.attrValue[0].wholesale_price" + slot='right'> - @@ -194,20 +196,29 @@ "imageList": [ ], + attr: [{ + detail: [], + value: "" + }, ], "attrValue": [{ + detail: { + 规格名: 'attr[index]value', + }, "price": "", "unit_name": "", "wholesale_unit_name": "", "wholesale_price": '', "cost": "", "stock": "", + sku: '', "ot_price": "", "procure_price": "", "bar_code": "", "weight": "", - "volume": "", "extension_one": "", "extension_two": "", + uuid: "", + volume: "", "is_use": 0, }], "cate_name": "", @@ -218,10 +229,7 @@ ], "mer_cate_name": "", "spec_type": "0", - attr: [{ - detail: [], - value: "" - }, ], + "specifica": "", "delivery_way": [ @@ -263,12 +271,13 @@ maxLength: 30, showSex: false, rules: { - title: { - type: 'string', - required: true, - message: '请选择', - trigger: ['blur', 'change'] - } + "formData.imageList": [{ + validator: (rule, value, callback) => { + return this.formData.imageList.length >= 2 + }, + message: '请至少上传2张图片', + trigger: ['change', 'blur'], + }] }, }; @@ -418,7 +427,7 @@ }); }, - async submit() { + handAdd() { let data = uni.$u.deepClone(this.formData) data.image = data.imageList[0] data.slider_image = data.imageList.splice(0, 1) @@ -432,17 +441,25 @@ uni.$emit('importAttrValueOK', this.setFormData.import_id); uni.navigateBack(); } else uni.redirectTo({ - url: `/pages/product/goodsOnSale/index?mer_id=${this.mer_id}&type=6` + url: `/pages/product/list/index?mer_id=${this.mer_id}&type=6` }) }).catch(() => { uni.redirectTo({ - url: `/pages/nongKe/gather/select_warehouse?mer_id=${this.mer_id}&stype=2` + url: `/pages/product/list/index?mer_id=${this.mer_id}&type=2` }) }) }) .catch(rej => { // Toast(rej); }); + }, + async submit() { + this.$refs.formData.validate().then(res => { + this.handAdd() + }).catch(errors => { + uni.$u.toast(errors[0].message) + }) + } }, onLoad(option) { diff --git a/pages/product/addGoodDetail/addGoodDetail.vue b/pages/product/addGoodDetail/addGoodDetail.vue index 13c1809..efaba34 100644 --- a/pages/product/addGoodDetail/addGoodDetail.vue +++ b/pages/product/addGoodDetail/addGoodDetail.vue @@ -1,19 +1,21 @@