detail.vue
12.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
<template>
<div class="detail-container">
<div class="wrapper flex_sca">
<div class="label_text">订单编号:{{ detailInfo.orderCode }}</div>
<div class="label_text">下单时间: {{ detailInfo.time }}</div>
<div class="label_text">海威订单号: {{ thirdOrderCode }}</div>
</div>
<div class="line"></div>
<div class="wrapper flex_ss">
<template v-for="(item, index) in detailInfoObj">
<div :key="index" class="box_wrap">
<div class="title">{{item.title}}</div>
<div class="box_pannel">
<div v-for="(i,ind) in item.list" :key="ind" class="row flex_sc" :class="[index==2&&ind?'max':'']">
<div class="tip flex_cc">{{i.label}}</div>
<div v-if="i.format" class="tipval flex_sc"> {{ i.format(detailInfo) }}</div>
<div v-else class="tipval flex_sc">{{ detailInfo[i.key] || '' }}</div>
</div>
</div>
</div>
</template>
</div>
<div class="line"></div>
<div class="tableWrap">
<GLTable v-if="tableData.length" :tableParams="tableParams" :tableData="tableData" :hasNum="false" :hasPage="false">
<div class="flex_sc" slot="imgText" slot-scope="scope">
<img class="imgicon" :src="scope.scope.goodsImage">
<div class="">
<div class="title">{{scope.scope.brandName}}</div>
<div class="tip" v-if="scope.scope.appearance">{{scope.scope.productName}}{{scope.scope.denomination}}</div>
<div class="tip" v-else>{{scope.scope.productName}}{{scope.scope.productName}}</div>
</div>
</div>
</GLTable>
</div>
<div class="totalWrap flex_scb">
<span class="label">合计</span>
<div v-if="detailInfo.orderPrices" class="wrap">
<div class="label tip">
<div class="left">商品总价:</div>
<div class="right"> ¥{{ detailInfo.orderPrices }}</div>
</div>
<div style="margin:8px 0" class="label tip">
<div class="left">优惠:</div>
<div class="right">¥0.00</div>
</div>
<div class="label tip">
<div class="left">实收金额:</div>
<div class="right">¥{{ detailInfo.orderPrices }}</div>
</div>
</div>
</div>
<!-- <div class="box topBox">
<div class="grid">
<div class="grid-item">订单编号:{{ detailInfo.orderCode }}</div>
<div class="grid-item">下单时间: {{ detailInfo.time }}</div>
<div class="grid-item">海威订单号: {{ thirdOrderCode }}</div>
</div>
</div>
<div class="box">
<div class="grayRow"></div>
<div class="grid">
<template v-for="(item, index) in detailInfoObj">
<div class="grid-item top-grid-item" :key="index">
<div class="sub-title">{{ item.title }}</div>
<template v-for="(i, ind) in item.list">
<div class="item" :key="ind">
<div class="label">{{ i.label }}:</div>
<div class="value">
<template v-if="i.format">
{{ i.format(detailInfo) }}
</template>
<template v-else>
{{ detailInfo[i.key] || '' }}
</template>
</div>
</div>
</template>
<template v-if="item.btn">
</template>
</div>
</template>
</div>
<div class="tableWrap">
<GLTable v-if="tableData.length" :tableParams="tableParams" :tableData="tableData" :hasNum="false" :hasPage="false">
<div slot="imgText" slot-scope="scope">
<img class="goods-img" :src="scope.scope.goodsImage">
<div class="goods-info">{{scope.scope.brandName}}</div>
<div class="goods-info" v-if="scope.scope.appearance">{{scope.scope.productName}}{{scope.scope.denomination}}</div>
<div class="goods-info" v-else>{{scope.scope.productName}}{{scope.scope.productName}}</div>
</div>
</GLTable>
</div>
<div class="price-box">
<div class="price-item">
<div class="label">商品总价:</div>
<div class="value">¥{{ detailInfo.orderPrices }}</div>
</div>
<div class="price-item">
<div class="label">优惠:</div>
<div class="value">¥0.00</div>
</div>
<div class="price-item">
<div class="label">实收金额:</div>
<div class="value money">¥{{ detailInfo.orderPrices }}</div>
</div>
</div>
</div> -->
</div>
</template>
<script type='text/ecmascript-6'>
import Vue from 'vue'
import { orderMixin } from '@/mixins'
export default {
name: '',
mixins: [orderMixin],
data() {
return {
thirdOrderCode: '',
params: {},
eventBus: new Vue(),
detailInfo: {},
detailInfoObj: [
{
title: '支付信息',
list: [
{
label: '付款状态',
key: 'payStatus'
},
{
label: '付款金额',
format(cell) {
return `${cell.orderPrices || ''}${cell.orderPrices?'元':''}`
}
},
{
label: '付款方式',
key: 'payType'
},
{
label: '付款时间',
key: 'time'
}
]
},
{
title: '用户信息',
list: [
{
label: '用户名称',
key: 'accountName'
},
{
label: '用户手机号',
key: 'mobile'
}
],
btn: true
},
{
title: '门店',
list: [
{
label: '关联门店',
key: 'merchantName'
},
{
label: '门店地址',
key: 'merchantAddress'
}
]
}
],
tableData: [],
tableParams: {
tableColumns: [
{
label: '商品信息',
prop:'appearance',
addHtml:'imgText'
// minWidth: '300',
// formatter: cell => {
// let str = cell.appearance == 2 ? `<div>${cell.productName}${cell.denomination}</div>` : `<div>${cell.productName}</div>`
// return `<div class="goods">
// <div class="goods-img">
// <img src="${cell.goodsImage}" >
// </div>
// <div class="goods-info">
// <div>${cell.brandName}</div>
// ${str}
// </div>
// </div>`
// }
},
{
label: '充值账号',
prop: 'rechargeNumber'
},
{
label: '商品形态',
prop: 'appearanceDesc'
},
{
label: '单价/元',
prop: 'orderPrices',
align:'right'
},
{
label: '数量',
formatter: () => {
return 1
}
},
{
label: '小计/元',
prop: 'orderPrices',
align:'right'
},
{
label: '订单状态',
formatter: cell => {
return cell.appearance == 1 ? this.statusEnum[cell.orderStatus] : this.qb_statusEnum[cell.orderStatus]
}
}
]
}
}
},
mounted() {
this.params = { orderCode: this.$route.query.orderCode }
this.thirdOrderCode = this.$route.query.thirdOrderCode
this.getDetail(this.params)
},
methods: {
getDetail(params) {
const loading = this.$loading({
lock: true,
text: 'Loading...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)',
customClass:'loadingClass'
})
this.$apis.orderApi.getOrderDetail(params).then(({ code, data }) => {
loading.close()
if (code == 0) {
data.payStatus = '已付款'
data.payType = '微信支付'
data.time = data.orderDate ? new Date(data.orderDate).format('yyyy-MM-dd hh:mm:ss') : ''
this.detailInfo = data
this.tableData = [data]
// 1 卡券,2直充 如果是卡卷列表不显示充值账号一栏
if(data.appearance == 1){
this.tableParams.tableColumns.splice(1,1)
}
}
})
},
openRefund() {
this.$apis.orderApi.openRefund(this.params).then(({ code, message }) => {
if (code == 0) {
this.$message({
showClose: true,
message: '开启成功',
type: 'success'
})
this.getDetail(this.params)
} else {
this.$message({
showClose: true,
message,
type: 'error'
})
}
})
}
}
}
</script>
<style src="@a/css/tao.css"></style>
<style lang="scss" scoped>
.detail-container{
height: 90vh;
padding: 0 20px;
background: #fff;
.wrapper{
padding: 32px 0;
}
.flex_sca{
display: flex;
align-items: center;
justify-content: space-around;
}
.flex_ss{
display: flex;
}
.label_text{
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
}
.line{
height: 1px;
background: #e5e5e5;
}
.box_wrap{
margin-right: 38px;
.title{
font-size: 16px;
font-weight: 500;
color: #333333;
line-height: 20px;
margin-bottom: 8px;
}
.box_pannel{
.row{
height: 36px;
}
.tip{
width: 118px;
height: 100%;
background: #F4F6FC;
border: 1px solid #E5E5E5;
font-size: 14px;
font-weight: 400;
color: #333333;
}
.tipval{
width: 238px;
height: 100%;
background: #FFFFFF;
border: 1px solid #E5E5E5;
border-left: none;
font-size: 14px;
font-weight: 400;
color: #333333;
padding:0 12px;
}
.max{
height: 108px;
}
}
}
.tableWrap {
margin-top: 32px;
.imgicon{
width: 36px;
height: 36px;
margin-right: 8px;
}
.title{
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 18px;
}
.tip{
font-size: 10px;
font-weight: 400;
color: #999999;
}
}
.totalWrap{
min-height: 108px;
padding: 0 16px;
background: #F9F9F9;
.label{
font-size: 14px;
font-weight: 400;
color: #666666;
}
.tip{
display: flex;
.left{
width: 90px;
text-align: right;
}
}
}
}
// .price-box {
// margin-top: 16px;
// // margin-right: 52px;
// float: right;
// }
// .price-item {
// width: 200px;
// font-size: 14px;
// font-weight: 400;
// color: #333333;
// display: flex;
// align-items: center;
// justify-content: space-between;
// margin-bottom: 14px;
// .label {
// width: 80px;
// text-align: right;
// }
// .money {
// color: #eb4e4e;
// }
// }
// .goods {
// display: flex;
// }
// .goods-img {
// width: 100px !important;
// height: 100px !important;
// margin-right: 10px;
// }
// .goods-info {
// width: calc(100% - 110px);
// }
// .layout {
// background-color: #fff;
// .topBox {
// padding-top: 32px !important;
// }
// .box {
// position: relative;
// padding-top: 20px;
// padding-left: 52px;
// box-shadow: none;
// .top-grid-item {
// .item {
// font-size: 14px;
// font-weight: 400;
// color: #333333;
// margin-left: -30px;
// .label {
// // width: 71px;
// text-align: right;
// }
// }
// }
// .grid-item {
// .item,
// .grid-btn {
// font-size: 14px;
// font-weight: 400;
// color: #333333;
// }
// }
// .backBtn {
// position: absolute;
// right: 20px;
// top: 20px;
// }
// .grayRow {
// position: absolute;
// top: 18px;
// left: 0;
// width: 100%;
// background-color: #f4f6fc;
// z-index: 0;
// height: 54px;
// }
// .sub-title {
// position: relative;
// z-index: 1;
// margin-bottom: 40px !important;
// font-size: 14px;
// font-weight: 500;
// color: #333333;
// }
// }
// }
</style>