|
@@ -227,6 +227,7 @@ export default {
|
|
|
|
|
|
data () {
|
|
|
return {
|
|
|
+ status: 0,
|
|
|
dialogVisible: false,
|
|
|
fileVal: '',
|
|
|
tableHeader,
|
|
@@ -426,25 +427,25 @@ export default {
|
|
|
// temp[i]['expressNum_input'] = "";
|
|
|
temp[i].items = []
|
|
|
temp[i]['typeStr'] = TypeArr[temp[i]['type']]
|
|
|
- temp[i].orderItems =
|
|
|
- temp[i]['orderDetail'] ? temp[i]['orderDetail']['orderItems'] :
|
|
|
- temp[i]['responseVirtualOrder'] ? [{
|
|
|
- goodsName: temp[i]['responseVirtualOrder'].body,
|
|
|
- goodsCount: temp[i]['responseVirtualOrder'].orderCount,
|
|
|
- goodsPrice: temp[i]['responseVirtualOrder'].amount,
|
|
|
- abroad: temp[i]['responseVirtualOrder'].abroad
|
|
|
- }] :
|
|
|
- temp[i]['responseIncrementOrder'] ? [{
|
|
|
- goodsName: '会员权益',
|
|
|
- goodsCount: temp[i]['responseIncrementOrder'].count,
|
|
|
- goodsPrice: temp[i]['responseIncrementOrder'].amount,
|
|
|
- abroad: temp[i]['responseIncrementOrder'].abroad
|
|
|
- }] : ''
|
|
|
-
|
|
|
- temp[i]['orderSn'] =
|
|
|
- temp[i]['orderDetail'] ? temp[i]['orderDetail']['orderSn'] :
|
|
|
- temp[i]['responseIncrementOrder'] ? temp[i]['responseIncrementOrder']['orderSn'] :
|
|
|
- temp[i]['responseVirtualOrder'] ? temp[i]['responseVirtualOrder']['orderSn'] : ''
|
|
|
+ temp[i].orderItems =
|
|
|
+ temp[i]['orderDetail'] ? temp[i]['orderDetail']['orderItems']
|
|
|
+ : temp[i]['responseVirtualOrder'] ? [{
|
|
|
+ goodsName: temp[i]['responseVirtualOrder'].body,
|
|
|
+ goodsCount: temp[i]['responseVirtualOrder'].orderCount,
|
|
|
+ goodsPrice: temp[i]['responseVirtualOrder'].amount,
|
|
|
+ abroad: temp[i]['responseVirtualOrder'].abroad
|
|
|
+ }]
|
|
|
+ : temp[i]['responseIncrementOrder'] ? [{
|
|
|
+ goodsName: '会员权益',
|
|
|
+ goodsCount: temp[i]['responseIncrementOrder'].count,
|
|
|
+ goodsPrice: temp[i]['responseIncrementOrder'].amount,
|
|
|
+ abroad: temp[i]['responseIncrementOrder'].abroad
|
|
|
+ }] : ''
|
|
|
+
|
|
|
+ temp[i]['orderSn'] =
|
|
|
+ temp[i]['orderDetail'] ? temp[i]['orderDetail']['orderSn']
|
|
|
+ : temp[i]['responseIncrementOrder'] ? temp[i]['responseIncrementOrder']['orderSn']
|
|
|
+ : temp[i]['responseVirtualOrder'] ? temp[i]['responseVirtualOrder']['orderSn'] : ''
|
|
|
}
|
|
|
this.orders = temp
|
|
|
this.currentPage = page
|
|
@@ -452,14 +453,14 @@ export default {
|
|
|
},
|
|
|
_exportExcelForOrder () {
|
|
|
let date1, date2, userName, expressNum, orderNum
|
|
|
- this.date1 = this.searchDate ? this.searchDate[0] : null
|
|
|
- this.date2 = this.searchDate ? this.searchDate[1] : null
|
|
|
- date1 = this.date1 ? (this.date1 + ' 00:00:00') : null
|
|
|
- date2 = this.date2 ? (this.date2 + ' 23:59:59') : null
|
|
|
+ this.date1 = this.searchDate ? this.searchDate[0] : ''
|
|
|
+ this.date2 = this.searchDate ? this.searchDate[1] : ''
|
|
|
+ date1 = this.date1 ? (this.date1 + ' 00:00:00') : ''
|
|
|
+ date2 = this.date2 ? (this.date2 + ' 23:59:59') : ''
|
|
|
|
|
|
- this.userName = userName = this.searchPhone || null
|
|
|
- this.expressNum = expressNum = this.searchExpressNum || null
|
|
|
- this.orderNum = orderNum = this.searchOrderNumber || null
|
|
|
+ this.userName = userName = this.searchPhone || ''
|
|
|
+ this.expressNum = expressNum = this.searchExpressNum || ''
|
|
|
+ this.orderNum = orderNum = this.searchOrderNumber || ''
|
|
|
|
|
|
let data = {
|
|
|
'type': this.status,
|
|
@@ -478,13 +479,14 @@ export default {
|
|
|
}).then(async () => {
|
|
|
let exec = await this.$http({
|
|
|
methods: 'get',
|
|
|
- params: data,
|
|
|
- url: '/manager/order/export',
|
|
|
+ url: `/manager/order/export?type=${this.status}&startDate=${date1}&endDate=${date2}&orderSn=${orderNum}&phoneNum=${this.userName}&expressNum=${expressNum}`,
|
|
|
responseType: 'arraybuffer'
|
|
|
})
|
|
|
+
|
|
|
try {
|
|
|
let blob = new Blob([exec], {type: 'application/vnd.ms-excel'})
|
|
|
let url = URL.createObjectURL(blob)
|
|
|
+ console.log(url)
|
|
|
location.href = url
|
|
|
} catch (e) {
|
|
|
console.error(e)
|