Authored by htoooth

fix

@@ -129,6 +129,14 @@ import api from 'product-create/api'; @@ -129,6 +129,14 @@ import api from 'product-create/api';
129 import serial from 'product-create/serialize'; 129 import serial from 'product-create/serialize';
130 130
131 export default { 131 export default {
  132 + props: {
  133 + from: {
  134 + type: String,
  135 + default() {
  136 + return 'offsale';
  137 + }
  138 + }
  139 + },
132 data() { 140 data() {
133 return { 141 return {
134 showLoading: true, 142 showLoading: true,
@@ -493,7 +501,12 @@ export default { @@ -493,7 +501,12 @@ export default {
493 desc: '该商品保存成功!' 501 desc: '该商品保存成功!'
494 }); 502 });
495 503
496 - this.$router.push({ name: 'product.offsale' }); 504 + if (this.from === 'offsale') {
  505 + this.goOffSale();
  506 + } else {
  507 + this.goOnlineSale();
  508 + }
  509 +
497 } else { 510 } else {
498 this.$Notice.error({ 511 this.$Notice.error({
499 title: '保存错误', 512 title: '保存错误',
@@ -503,6 +516,12 @@ export default { @@ -503,6 +516,12 @@ export default {
503 } 516 }
504 }); 517 });
505 }, 518 },
  519 + goOffSale() {
  520 + this.$router.push({ name: 'product.offsale' });
  521 + },
  522 + goOnlineSale() {
  523 + this.$router.push({ name: 'product.online' });
  524 + },
506 submit() { 525 submit() {
507 this.validate() 526 this.validate()
508 .then(([r1, r2]) => { 527 .then(([r1, r2]) => {
@@ -295,7 +295,8 @@ @@ -295,7 +295,8 @@
295 this.$router.push({ 295 this.$router.push({
296 name: 'product.edit', 296 name: 'product.edit',
297 params: { 297 params: {
298 - id: skn 298 + id: skn,
  299 + from: 'offsale'
299 } 300 }
300 }); 301 });
301 }, 302 },
@@ -272,7 +272,8 @@ @@ -272,7 +272,8 @@
272 this.$router.push({ 272 this.$router.push({
273 name: 'product.edit', 273 name: 'product.edit',
274 params: { 274 params: {
275 - id: skn 275 + id: skn,
  276 + from: 'onsale'
276 } 277 }
277 }); 278 });
278 }, 279 },