Showing
3 changed files
with
24 additions
and
3 deletions
@@ -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]) => { |
-
Please register or login to post a comment