From d14ed78653db90e635503b44c3ac7b215a4d9bb1 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Fri, 7 Jun 2024 10:15:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=20-=20=E5=95=86=E5=93=81=E7=BC=96=E8=BE=91=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=8F=90=E4=BA=A4=E5=90=8E=E5=87=BA=E7=8E=B0=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=8F=90=E7=A4=BA=EF=BC=8C=E4=BD=86=E6=98=AF=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=BC=96=E8=BE=91=E6=88=90=E5=8A=9F=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/product/addProduct/index.vue | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/views/product/addProduct/index.vue b/src/views/product/addProduct/index.vue index 7442dcb..d66b73d 100644 --- a/src/views/product/addProduct/index.vue +++ b/src/views/product/addProduct/index.vue @@ -1888,10 +1888,7 @@ export default { window.history.back() }, handleCloseCoupon(tag) { - this.formValidate.couponData.splice( - this.formValidate.couponData.indexOf(tag), - 1 - ) + this.formValidate.couponData.splice(this.formValidate.couponData.indexOf(tag), 1) this.formValidate.give_coupon_ids = [] this.formValidate.couponData.map(item => { this.formValidate.give_coupon_ids.push(item.coupon_id) @@ -2289,9 +2286,7 @@ export default { zh_uploadFile_change(evfile) { const that = this that.progress = 10 - const suffix = evfile.target.files[0].name.substr( - evfile.target.files[0].name.indexOf('.') - ) + const suffix = evfile.target.files[0].name.substr(evfile.target.files[0].name.indexOf('.')) if (suffix !== '.mp4') { return that.$message.error('只能上传MP4文件') } @@ -2847,22 +2842,23 @@ export default { this.fullscreenLoading = true; this.loading = true; let disCreate = this.$route.params.id && !this.$route.query.type; - disCreate - ? productUpdateApi(this.$route.params.id, this.formValidate) + if(disCreate){ + productUpdateApi(this.$route.params.id, this.formValidate) .then(async res => { this.fullscreenLoading = false; this.$message.success(res.message); this.$router.push({path: this.roterPre + "/product/list"}); - this.$refs[name].resetFields(); - this.formValidate.slider_image = []; - this.loading = false; + // this.$refs[name].resetFields(); + // this.formValidate.slider_image = []; + // this.loading = false; }) .catch(res => { this.fullscreenLoading = false; this.loading = false; this.$message.error(res.message); }) - : productCreateApi(this.formValidate) + }else{ + productCreateApi(this.formValidate) .then(async res => { this.fullscreenLoading = false; this.$message.success(res.message); @@ -2874,6 +2870,7 @@ export default { this.loading = false; this.$message.error(res.message); }); + } } else { if (!this.formValidate.store_name.trim()) { return this.$message.warning("基本信息-商品名称不能为空");