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("基本信息-商品名称不能为空");