|
@@ -58,16 +58,21 @@ export default {
|
|
|
orderInfo: state => state.order.orderDetail
|
|
|
})
|
|
|
},
|
|
|
- created() {
|
|
|
- this.getOrderDetailFn()
|
|
|
+ watch: {
|
|
|
+ orderCode: {
|
|
|
+ immediate: true,
|
|
|
+ handler(val) {
|
|
|
+ this.getOrderDetailFn(val)
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions('order', ['getOrderDetail']),
|
|
|
- getOrderDetailFn() {
|
|
|
- if (!this.orderCode) {
|
|
|
+ getOrderDetailFn(id = this.orderCode) {
|
|
|
+ if (!id) {
|
|
|
return
|
|
|
}
|
|
|
- this.getOrderDetail({ id: this.orderCode }).then(res => {
|
|
|
+ this.getOrderDetail({ id }).then(res => {
|
|
|
this.orderDetail = res || {}
|
|
|
})
|
|
|
.finally(() => {
|