修复:供应商 - 商品编辑信息提交后出现错误提示,但是信息编辑成功的问题

This commit is contained in:
wuhui_zzw 2024-06-07 10:15:41 +08:00
parent 27476d2875
commit d14ed78653
1 changed files with 10 additions and 13 deletions

View File

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