Authored by htoooth

fix

... ... @@ -133,7 +133,7 @@ export default {
from: {
type: String,
default() {
return 'offsale';
return 'product.offsale';
}
}
},
... ... @@ -167,6 +167,8 @@ export default {
};
},
created() {
this.from = this.$route.query.from || 'product.offsale';
service.getProduct(this.$route.params.id).then((result) => {
_.update(result, 'goodsSeason', (s) => `${s}`);
if (!_.has(result, 'materialList')) {
... ... @@ -501,12 +503,7 @@ export default {
desc: '该商品保存成功!'
});
if (this.from === 'offsale') {
this.goOffSale();
} else {
this.goOnlineSale();
}
this.go(this.from);
} else {
this.$Notice.error({
title: '保存错误',
... ... @@ -516,11 +513,8 @@ export default {
}
});
},
goOffSale() {
this.$router.push({ name: 'product.offsale' });
},
goOnlineSale() {
this.$router.push({ name: 'product.online' });
go(from) {
this.$router.push({ name: from });
},
submit() {
this.validate()
... ...
... ... @@ -296,7 +296,9 @@
name: 'product.edit',
params: {
id: skn,
from: 'offsale'
},
query: {
from: 'product.offsale'
}
});
},
... ...
... ... @@ -272,8 +272,10 @@
this.$router.push({
name: 'product.edit',
params: {
id: skn,
from: 'onsale'
id: skn
},
query: {
from: 'product.onsale'
}
});
},
... ...