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
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
| <template>
| <div v-loading="loading" class="base-page-wrapper order-detail">
| <el-bus-title title="订单信息" size="small"></el-bus-title>
| <el-bus-form
| ref="form"
| label-width="auto"
| :content="formContent"
| readonly
| class="readonly-form"
| ></el-bus-form>
| <template v-if="detail.memberCouponAmount || detail.memberDiscountType">
| <div class="base-page-wrapper__line"></div>
| <el-bus-title title="优惠信息" size="small" />
| <el-bus-form
| ref="discountForm"
| label-width="auto"
| :content="discountForm"
| readonly
| class="readonly-form"
| ></el-bus-form>
| </template>
| <div class="base-page-wrapper__line"></div>
| <el-bus-title title="商品信息" size="small">
| <template #right>
| <el-button
| v-if="detail.couldCheckRefund"
| type="primary"
| @click="checkRefund"
| >质检退款</el-button
| >
| </template>
| </el-bus-title>
| <el-table :data="goodsList">
| <el-table-column
| label="商品名称"
| prop="flowerName"
| min-width="150"
| fixed="left"
| ></el-table-column>
| <el-table-column
| label="商品分类"
| prop="flowerCategory"
| min-width="150"
| ></el-table-column>
| <el-table-column
| label="级别"
| prop="flowerLevelStr"
| min-width="100"
| ></el-table-column>
| <el-table-column
| label="颜色"
| prop="flowerColor"
| min-width="100"
| ></el-table-column>
| <el-table-column
| label="规格"
| prop="flowerUnit"
| min-width="100"
| ></el-table-column>
| <el-table-column
| label="数量"
| prop="num"
| min-width="100"
| ></el-table-column>
| <el-table-column
| label="会员单价(元)"
| prop="price"
| min-width="100"
| ></el-table-column>
| <el-table-column
| label="原价(元)"
| prop="originalPrice"
| min-width="100"
| ></el-table-column>
| <el-table-column
| label="券后总金额(元)"
| prop="realTotal"
| min-width="120"
| ></el-table-column>
| <el-table-column
| label="券后单价(元)"
| prop="realPrice"
| min-width="100"
| ></el-table-column>
| <el-table-column
| label="优惠总金额(元)"
| prop="couponAmountTotal"
| min-width="120"
| ></el-table-column>
| <el-table-column
| label="供应商"
| prop="supplierName"
| min-width="150"
| ></el-table-column>
| <el-table-column
| label="供应商电话"
| prop="supplierTel"
| min-width="150"
| ></el-table-column>
| <el-table-column
| label="集货站"
| prop="stationName"
| min-width="150"
| ></el-table-column>
| <el-table-column
| label="花材底价(元)"
| prop="supplierPrice"
| min-width="120"
| ></el-table-column>
| <el-table-column
| label="区间加价(元)"
| prop="markupOne"
| min-width="120"
| ></el-table-column>
| <el-table-column
| label="平台加价(元)"
| prop="markupTwo"
| min-width="120"
| ></el-table-column>
| <el-table-column
| label="合伙人加价(元)"
| prop="markupPartner"
| min-width="120"
| ></el-table-column>
| <el-table-column
| label="质检退款(元)"
| prop="deductAmount"
| min-width="120"
| ></el-table-column>
| <el-table-column
| label="补货扣款(元)"
| prop="replaceFee"
| min-width="120"
| ></el-table-column>
| <el-table-column
| label="降级扣款(元)"
| prop="checkFee"
| min-width="120"
| ></el-table-column>
| <el-table-column
| label="缺货扣款(元)"
| prop="lackFeeSupplier"
| min-width="120"
| ></el-table-column>
| <el-table-column label="质检审核" width="220" fixed="right">
| <template #default="{ row }">
| <el-button
| v-if="buttonShow(row.replaceNum, row.replaceStatus) === 1"
| type="text"
| @click="checkItem('replace', row, false)"
| >补货</el-button
| >
| <el-button
| v-if="buttonShow(row.replaceNum, row.replaceStatus) === 2"
| type="text"
| @click="checkItem('replace', row, true)"
| >补货详情</el-button
| >
| <el-button
| v-if="buttonShow(row.reduceNum, row.reduceStatus) === 1"
| type="text"
| @click="checkItem('reduce', row, false)"
| >降级</el-button
| >
| <el-button
| v-if="buttonShow(row.reduceNum, row.reduceStatus) === 2"
| type="text"
| @click="checkItem('reduce', row, true)"
| >降级详情</el-button
| >
| <el-button
| v-if="buttonShow(row.lackNum, row.lackStatus) === 1"
| type="text"
| @click="checkItem('lack', row, false)"
| >缺货</el-button
| >
| <el-button
| v-if="buttonShow(row.lackNum, row.lackStatus) === 2"
| type="text"
| @click="checkItem('lack', row, true)"
| >缺货详情</el-button
| >
| </template>
| </el-table-column>
| </el-table>
| <template v-if="detail.pointGoodsList && detail.pointGoodsList.length > 0">
| <div class="base-page-wrapper__line"></div>
| <el-bus-title title="积分兑换商品" size="small" />
| <el-table :data="detail.pointGoodsList">
| <el-table-column label="商品图片">
| <template #default="{ row }">
| <el-bus-image
| :src="row.cover"
| lazy
| style="width: 50px; height: 50px"
| />
| </template>
| </el-table-column>
| <el-table-column label="商品名称" prop="name"></el-table-column>
| <el-table-column label="兑换数量" prop="num"></el-table-column>
| </el-table>
| </template>
| <template v-if="afterSaleList && afterSaleList.length > 0">
| <div class="base-page-wrapper__line"></div>
| <el-bus-title title="售后信息" size="small" class="mt-20"></el-bus-title>
| <el-table :data="afterSaleList">
| <el-table-column
| label="商品名称"
| prop="flowerName"
| min-width="150"
| fixed="left"
| ></el-table-column>
| <el-table-column
| label="级别"
| prop="flowerLevelStr"
| min-width="120"
| ></el-table-column>
| <el-table-column
| label="颜色"
| prop="flowerColor"
| min-width="120"
| ></el-table-column>
| <el-table-column
| label="原因"
| prop="reason"
| min-width="200"
| ></el-table-column>
| <el-table-column
| label="售后时间"
| prop="createTime"
| min-width="180"
| ></el-table-column>
| <el-table-column
| label="处理时间"
| prop="auditTime"
| min-width="180"
| ></el-table-column>
| <el-table-column
| label="处理状态"
| prop="statusStr"
| min-width="120"
| ></el-table-column>
| <el-table-column
| label="实际退款"
| prop="totalFee"
| min-width="120"
| ></el-table-column>
| <el-table-column label="操作" width="120" fixed="right">
| <template #default="{ row }">
| <el-button type="text" @click="toDetail(row.id)"
| >查看详情</el-button
| >
| </template>
| </el-table-column>
| </el-table>
| </template>
| <div class="text-center mt-20">
| <el-button class="min-w-100" @click="goBack">返回</el-button>
| </div>
| <extra-dialog
| ref="replaceDialog"
| title="补货信息"
| confirm-text="通过"
| cancel-text="不通过"
| :confirm-button-attrs="{ type: 'success' }"
| :cancel-button-attrs="{ type: 'danger' }"
| :form="replaceForm"
| :dialog-attrs="dialogAttrs"
| :form-attrs="formAttrs"
| :at-confirm="onCheckAgree"
| :at-cancel="onCheckReject"
| ></extra-dialog>
| <extra-dialog
| ref="reduceDialog"
| title="降级信息"
| confirm-text="通过"
| cancel-text="不通过"
| :confirm-button-attrs="{ type: 'success' }"
| :cancel-button-attrs="{ type: 'danger' }"
| :form="reduceForm"
| :dialog-attrs="dialogAttrs"
| :form-attrs="formAttrs"
| :at-confirm="onCheckAgree"
| :at-cancel="onCheckReject"
| ></extra-dialog>
| <extra-dialog
| ref="lackDialog"
| title="缺货信息"
| confirm-text="通过"
| cancel-text="不通过"
| :confirm-button-attrs="{ type: 'success' }"
| :cancel-button-attrs="{ type: 'danger' }"
| :form="lackForm"
| :dialog-attrs="dialogAttrs"
| :form-attrs="formAttrs"
| :at-confirm="onCheckAgree"
| :at-cancel="onCheckReject"
| ></extra-dialog>
| <extra-dialog
| ref="refundDialog"
| title="质检退款"
| :form="refundForm"
| :dialog-attrs="{ ...dialogAttrs, width: '70%' }"
| :form-attrs="formAttrs"
| confirm-text="确定退款"
| :at-confirm="onRefundConfirm"
| >
| </extra-dialog>
| </div>
| </template>
|
| <script>
| import CheckAbnormalList from '@/components/order/check-abnormal-list.vue'
| const DialogCommonForm = [
| {
| label: '商品名称:',
| id: 'flowerName',
| type: 'input',
| readonly: true,
| },
| {
| label: '级别:',
| id: 'flowerLevelStr',
| type: 'input',
| readonly: true,
| },
| {
| label: '供应商:',
| id: 'supplierName',
| type: 'input',
| readonly: true,
| },
| {
| label: '供应商联系人:',
| id: 'supplierContact',
| type: 'input',
| readonly: true,
| },
| {
| label: '供应商联系电话:',
| id: 'supplierTel',
| type: 'input',
| readonly: true,
| },
| {
| label: '集货站:',
| id: 'stationName',
| type: 'input',
| readonly: true,
| },
| {
| label: '质检人:',
| id: 'createName',
| type: 'input',
| readonly: true,
| },
| {
| label: '备注:',
| id: 'remarks',
| type: 'input',
| span: 24,
| readonly: true,
| },
| {
| label: '提交时间:',
| id: 'checkTime',
| type: 'input',
| span: 24,
| readonly: true,
| },
| ]
| const dialogAuditForm = [
| {
| label: '审核结果:',
| id: 'auditStatusStr',
| type: 'input',
| hidden: (row) => !row.auditStatusStr,
| span: 24,
| readonly: true,
| },
| {
| label: '审核时间:',
| id: 'auditTime',
| type: 'input',
| hidden: (row) => !row.auditStatusStr,
| span: 24,
| readonly: true,
| },
| ]
| export default {
| data() {
| return {
| loading: false,
| detail: {},
| formContent: [
| {
| type: 'row',
| items: [
| { label: '订单号:', id: 'orderNo', type: 'input' },
| { label: '用户账号:', id: 'createName', type: 'input' },
| { label: '收货人:', id: 'customer', type: 'input' },
| { label: '收货人电话:', id: 'customerTel', type: 'input' },
| { label: '收货地址:', id: 'customerWholeAddress', type: 'input' },
| { label: '下单时间:', id: 'createTime', type: 'input' },
| { label: '支付时间:', id: 'paymentTime', type: 'input' },
| { label: '商品金额:', id: 'flowerAmountDesc', type: 'input' },
| { label: '打包费:', id: 'packingFee', type: 'input' },
| { label: '运费:', id: 'transportFee', type: 'input' },
| { label: '订单金额:', id: 'originalPrice', type: 'input' },
| { label: '实际支付金额:', id: 'totalAmountDesc', type: 'input' },
| { label: '订单状态:', id: 'statusBackendStr', type: 'input' },
| { label: '合伙人:', id: 'partnerName', type: 'input' },
| { label: '库区:', id: 'warehouseName', type: 'input' },
| { label: '库位:', id: 'warehouseLocationCode', type: 'input' },
| { label: '特殊需求:', id: 'specialNeedsStr', type: 'input' },
| {
| label: '备注:',
| id: 'remarks',
| type: 'input',
| el: { type: 'textarea' },
| span: 24,
| },
| ],
| },
| ],
| discountForm: [
| {
| type: 'row',
| items: [
| {
| label: '优惠券类型:',
| id: 'couponDiscountTypeName',
| type: 'input',
| hidden: (row) => !row.memberCouponAmount,
| },
| {
| label: '使用条件:',
| id: 'minOrderAmount',
| type: 'input',
| hidden: (row) => !row.memberCouponAmount,
| },
| {
| label: '优惠券名称:',
| id: 'memberCouponName',
| type: 'input',
| hidden: (row) => !row.memberCouponAmount,
| },
| {
| label: '优惠券金额:',
| id: 'memberCouponAmount',
| type: 'input',
| hidden: (row) => !row.memberCouponAmount,
| },
| {
| label: '会员等级:',
| id: 'memberName',
| type: 'input',
| hidden: (row) => !row.memberDiscountType,
| },
| {
| label: '会员折扣类型:',
| id: 'memberDiscountType',
| type: 'input',
| str: true,
| hidden: (row) => !row.memberDiscountType,
| },
| {
| label: '会员折扣:',
| id: 'memberDiscountRatio',
| type: 'input',
| unit: '%',
| hidden: (row) => row.memberDiscountType !== 'ratio',
| },
| {
| label: '会员优惠:',
| id: 'memberDiscountAmount',
| type: 'input',
| unit: '元/扎',
| hidden: (row) => row.memberDiscountType !== 'amount',
| },
| ],
| },
| ],
| goodsList: [],
| afterSaleList: [],
| dialogAttrs: {
| closeOnClickModal: false,
| },
| formAttrs: {
| labelWidth: 'auto',
| },
| replaceForm: [
| {
| type: 'row',
| span: 12,
| items: [
| ...DialogCommonForm,
| {
| label: '补货数量:',
| id: 'num',
| type: 'input',
| readonly: true,
| },
| ...dialogAuditForm,
| ],
| },
| ],
| reduceForm: [
| {
| type: 'row',
| span: 12,
| items: [
| ...DialogCommonForm,
| {
| label: '降级数量:',
| id: 'num',
| type: 'input',
| readonly: true,
| span: 8,
| },
| {
| label: '降级等级:',
| id: 'targetLevelStr',
| type: 'input',
| readonly: true,
| span: 8,
| },
| {
| label: '扣款金额:',
| id: 'deductAmount',
| type: 'input',
| readonly: true,
| span: 8,
| },
| {
| label: '图片:',
| id: 'pictureList',
| type: 'bus-upload',
| el: {
| listType: 'picture-card',
| },
| readonly: true,
| forceDisabled: true,
| span: 24,
| inputFormat: (row) => {
| if ('pictureList' in row) {
| return row.pictureList
| ? row.pictureList.map((item) => ({
| url: item,
| }))
| : []
| }
| },
| },
| ...dialogAuditForm,
| ],
| },
| ],
| lackForm: [
| {
| type: 'row',
| span: 12,
| items: [
| ...DialogCommonForm,
| {
| label: '缺货数量:',
| id: 'num',
| type: 'input',
| readonly: true,
| },
| ...dialogAuditForm,
| ],
| },
| ],
| refundForm: [
| {
| label: '退款总计(元):',
| id: 'deductAmount',
| type: 'input',
| readonly: true,
| },
| {
| label: '异常商品明细:',
| id: 'items',
| component: CheckAbnormalList,
| readonly: true,
| forceDisabled: true,
| },
| ],
| }
| },
| head() {
| return {
| title: '订单详情',
| }
| },
| mounted() {
| this.getDetail()
| this.getGoodsList()
| this.getAfterSaleList()
| },
| methods: {
| goBack() {
| this.$router.back()
| },
| async getDetail() {
| this.loading = true
| const { code, data } = await this.$elBusHttp.request(
| 'flower/api/order/list/view',
| { params: { id: this.$route.params.id } }
| )
| if (code === 0) {
| data.customerWholeAddress = `${data.customerProvince || ''}${
| data.customerCity || ''
| }${data.customerRegion || ''}${data.customerAddress || ''}`
| // 如果享受了会员优惠则显示具体会员优惠
| data.flowerAmountDesc = data.flowerAmount
| if (data.memberDiscountType) {
| if (data.memberDiscountType === 'ratio' && data.memberDiscountRatio) {
| data.flowerAmountDesc += `(其中享受会员折扣${data.memberDiscountRatio}%)`
| } else if (
| data.memberDiscountType === 'amount' &&
| data.memberDiscountAmount
| ) {
| data.flowerAmountDesc += `(其中享受会员优惠每扎减${data.memberDiscountAmount}元)`
| }
| }
| // 如果使用了优惠券则显示优惠券具体信息
| data.totalAmountDesc = data.totalAmount
| if (data.memberCouponAmount) {
| data.totalAmountDesc += `(其中使用了${data.memberCouponAmount}元优惠券)`
| }
| data.originalPrice = Number(
| (
| (data.flowerAmount || 0) +
| (data.packingFee || 0) +
| (data.transportFee || 0)
| ).toFixed(2)
| )
| this.detail = data
| this.$nextTick(() => {
| if (this.$refs.discountForm) {
| this.$refs.discountForm.updateForm(data)
| }
| })
| this.$refs.form.updateForm(data)
| }
| this.loading = false
| },
| async getGoodsList() {
| const { code, data } = await this.$elBusHttp.request(
| 'flower/api/order/item/list',
| { params: { id: this.$route.params.id } }
| )
| if (code === 0) {
| this.goodsList = data || []
| }
| },
| async getAfterSaleList() {
| const { code, data } = await this.$elBusHttp.request(
| 'flower/api/sales/list',
| { params: { orderId: this.$route.params.id, current: 1, size: 2000 } }
| )
| if (code === 0) {
| this.afterSaleList = data.records || []
| }
| },
| toDetail(id) {
| this.$router.push(`/order/after-sale/view/${id}`)
| },
| // 根据数量以及状态判断按钮显示
| buttonShow(num, status) {
| if (!this.$elBusUtil.isEmpty(num)) {
| return status ? 2 : 1
| }
| return null
| },
| // 获取补货详情
| async replaceDetail(orderItemId) {
| return await this.$elBusHttp.request(
| 'flower/api/order/list/check/info/replace',
| { params: { orderItemId } }
| )
| },
| // 获取缺货详情
| async lackDetail(orderItemId) {
| return await this.$elBusHttp.request(
| 'flower/api/order/list/check/info/lack',
| { params: { orderItemId } }
| )
| },
| // 获取降级详情
| async reduceDetail(orderItemId) {
| return await this.$elBusHttp.request(
| 'flower/api/order/list/check/info/reduce',
| { params: { orderItemId } }
| )
| },
| // 质检(缺货,补货,降级)审核操作
| async checkItem(type, row, readonly) {
| const { code, data } = await this[`${type}Detail`](row.id)
| if (code === 0) {
| this.$refs[`${type}Dialog`].show(
| {
| ...data,
| flowerName: row.flowerName,
| flowerLevelStr: row.flowerLevelStr,
| supplierName: row.supplierName,
| supplierContact: row.supplierContact,
| supplierTel: row.supplierTel,
| stationName: row.stationName,
| },
| readonly ? 'view' : 'edit'
| )
| }
| },
| // 质检审核通过
| async onCheckAgree(val) {
| const { code } = await this.$elBusHttp.request(
| 'flower/api/order/list/check/info/agree',
| { params: { id: val.id } }
| )
| if (code === 0) {
| this.$message.success('操作成功')
| this.getDetail()
| this.getGoodsList()
| } else {
| return false
| }
| },
| // 质检审核不通过
| async onCheckReject(val) {
| const { code } = await this.$elBusHttp.request(
| 'flower/api/order/list/check/info/reject',
| { params: { id: val.id } }
| )
| if (code === 0) {
| this.$message.success('操作成功')
| this.getDetail()
| this.getGoodsList()
| } else {
| return false
| }
| },
| // 质检退款确认弹窗展示明细
| async checkRefund() {
| const { code, data } = await this.$elBusHttp.request(
| 'flower/api/order/list/abnormal/details',
| { params: { id: this.$route.params.id } }
| )
| if (code === 0) {
| this.$refs.refundDialog.show(data)
| }
| },
| // 发起退款
| async onRefundConfirm() {
| const { code } = await this.$elBusHttp.request(
| 'flower/api/order/list/abnormal/process',
| { params: { id: this.$route.params.id } }
| )
| if (code === 0) {
| this.$message.success('操作成功')
| this.getDetail()
| } else {
| return false
| }
| },
| },
| }
| </script>
|
| <style lang="scss" scoped>
| .order-detail {
| border-radius: 0;
| .el-bus-title {
| margin-bottom: 10px;
| }
| }
| </style>
|
|