Browse Source

订单转台修改

master
LIONCITYS\lioncity 4 years ago
parent
commit
45f27f9bce
  1. 6
      src/api/yxStoreOrder.js
  2. 51
      src/views/shop/order/detail.vue
  3. 68
      src/views/shop/order/detail1.vue

6
src/api/yxStoreOrder.js

@ -77,3 +77,9 @@ export function getOrderDetail(id) {
})
}
export function getNowOrderStatus(id) {
return request({
url: '/api/getNowOrderStatus/' + id,
method: 'get'
})
}

51
src/views/shop/order/detail.vue

@ -1,13 +1,19 @@
<template>
<div class="app-container">
<div>
<el-steps :active="formatStepStatus(order._status)" finish-status="success" align-center>
<el-step title="提交订单" :description="formatTime(order.createTime)"></el-step>
<el-step title="支付订单" :description="formatTime(order.payTime)"></el-step>
<el-step title="平台发货" :description="formatTime(order.deliveryTime)"></el-step>
<el-step title="确认收货" :description="formatTime(order.receiveTime)"></el-step>
<el-step title="完成评价" :description="formatTime(order.commentTime)"></el-step>
<el-steps v-if="order.refundStatus===0" :active="orderStatus.size" align-center process-status="process" finish-status="success">
<el-step title="用户下单" :description="orderStatus.cacheKeyCreateOrder"></el-step>
<el-step title="待发货" :description="orderStatus.paySuccess"></el-step>
<el-step title="待收货" :description="orderStatus.deliveryGoods"></el-step>
<el-step title="待评价" :description="orderStatus.userTakeDelivery"></el-step>
<el-step title="完成" :description="orderStatus.checkOrderOver"></el-step>
</el-steps>
<el-steps v-else :active="order.refundStatus+1" align-center process-status="process" finish-status="success">
<el-step title="用户下单" :description="orderStatus.cacheKeyCreateOrder"></el-step>
<el-step title="用户申请退款" :description="orderStatus.applyRefund"></el-step>
<el-step title="退款申请通过" :description="orderStatus.refundOrderSuccess"></el-step>
</el-steps>
</div>
<el-card shadow="never" style="margin-top: 15px">
<div class="operate-container">
@ -373,7 +379,8 @@
</div>
</template>
<script>
import { express, getOrderDetail } from '@/api/yxStoreOrder'
import { express, getOrderDetail,
getNowOrderStatus} from '@/api/yxStoreOrder'
import {formatTimeTwo} from '@/utils/index';
import eForm from './form'
import eRefund from './refund'
@ -394,6 +401,7 @@ import eRemark from './remark'
components: {eForm, eRefund, editOrder, eRemark},
data() {
return {
orderStatus:null,
isAdd: false,
id: null,
order: {
@ -765,6 +773,7 @@ import eRemark from './remark'
init(){
let that = this;
let id = that.$route.params.id || 0;
this.getNowOrderStatus();
getOrderDetail(id).then(response => {
this.order = response;
this.userDTO = this.order.userDTO;
@ -784,13 +793,19 @@ import eRemark from './remark'
},
formatStepStatus(value) {
//todo 1- 2- 3-退 4- 5- 6- 7-退
if (value === 2) {
if (value === 1) {
//
return 2;
} else if (value === 4) {
return 1;
} else if (value === 2) {
//
return 3;
} else if (value === 6) {
} else if (value === 3) {
//
return 4;
} else if (value === 4) {
//
return 5;
} else if (value === 5) {
//
return 4;
}else {
@ -949,7 +964,19 @@ import eRemark from './remark'
showLogisticsDialog(){
this.express();
}
}, //
getNowOrderStatus() {
let id = this.$route.params.id || 0;
getNowOrderStatus(id)
.then(res => {
this.orderStatus = res;
})
.catch(err => {
console.log(err.response.data.message);
});
},
}
}
</script>

68
src/views/shop/order/detail1.vue

@ -1,5 +1,27 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '订单详情'" width="700px">
<el-card>
<div slot="header">
<span>进度信息</span>
</div>
<el-steps
v-if="form.refundStatus===0"
:active="orderStatus.size"
align-center
process-status="process"
finish-status="success"
>
<el-step title="用户下单" :description="orderStatus.cacheKeyCreateOrder"></el-step>
<el-step title="待核销" :description="orderStatus.paySuccess"></el-step>
<el-step title="待评价" :description="orderStatus.orderVerific"></el-step>
<el-step title="已完成" :description="orderStatus.checkOrderOver"></el-step>
</el-steps>
<el-steps v-else :active="form.refundStatus+1" align-center process-status="process" finish-status="success">
<el-step title="用户下单" :description="orderStatus.cacheKeyCreateOrder"></el-step>
<el-step title="用户申请退款" :description="orderStatus.applyRefund"></el-step>
<el-step title="退款申请通过" :description="orderStatus.refundOrderSuccess"></el-step>
</el-steps>
</el-card>
<el-card>
<div slot="header">
<span>收货信息</span>
@ -65,8 +87,9 @@
</template>
<script>
import { add, edit, express } from '@/api/yxStoreOrder'
import { parseTime } from '@/utils/index'
import { add, edit, express,
getNowOrderStatus } from '@/api/yxStoreOrder'
import {formatTimeTwo, parseTime} from '@/utils/index'
export default {
props: {
isAdd: {
@ -76,6 +99,7 @@ export default {
},
data() {
return {
orderStatus:null,
loading: false, dialog: false, expressInfo: [],
form: {
id: '',
@ -138,6 +162,11 @@ export default {
}
}
},
watch: {
'form': function(val) {
this.getNowOrderStatus();
}
},
methods: {
parseTime,
cancel() {
@ -196,6 +225,28 @@ export default {
this.loading = false
console.log(err.response.data.message)
})
}, formatTime(time) {
if (time == null || time === '') {
return '';
}
let date = new Date(time);
return formatTimeTwo(date, 'yyyy-MM-dd hh:mm:ss')
},
formatStepStatus(value) {
//todo 1- 2- 3-退 4- 5- 6- 7-退
if (value === 2) {
//
return 2;
} else if (value === 4) {
//
return 3;
} else if (value === 6) {
//
return 4;
}else {
//
return 1;
}
},
resetForm() {
this.dialog = false
@ -253,7 +304,18 @@ export default {
isRemind: '',
isSystemDel: ''
}
}
},
getNowOrderStatus() {
let id = this.form.id || 0;
getNowOrderStatus(id)
.then(res => {
this.orderStatus = res;
})
.catch(err => {
console.log(err.response.data.message);
});
},
}
}
</script>

Loading…
Cancel
Save