orderSupplement.vue
26 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
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
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
<!-- 订单列表 - 订单补录 -->
<template>
<div>
<!-- class="order-detail" -->
<d2-container>
<!-- <div class="offline-account"> -->
<div class="header"
slot="header"
style="padding: 10px 20px;">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:search-select-obj="searchSelectObj"
:form-data="showFormData" />
<div class="up-btns">
<el-button @click="handleSearch"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
<el-button size="small"
@click="handleRecord">
返回
</el-button>
</div>
</div>
<!-- </d2-container>
<d2-container> -->
<div class="d2-container-content">
<d2-table-header :left-span="13">
<span slot="left"
class="leftSpan">共<span
class="count-txt">{{ countObj.totalCount }}</span>条交易记录,总金额<span
class="count-txt">{{ countObj.totalAmount }}</span>元,已补录<span class="count-txt">{{ countObj.inputtedCount
}}</span>条,未补录<span
class="count-txt">{{ countObj.waitInputCount }}</span>条,未关联<span
class="count-txt">{{
countObj.notAssociatedCount }}</span>条,无需补录<span class="count-txt">{{ countObj.needNoSupplementCount
}}</span>条,待确认补录<span
class="count-txt">{{ countObj.waitConfirmInputCount }}</span>条。</span>
<!-- <el-button type="primary" @click="batchRecord">
批量确认补录
</el-button> -->
<!-- <el-button type="primary" @click="batchUpdateYqMerchant"> -->
<!-- 批量修改所属园区店 -->
<!-- 批量修改所属服务对接
</el-button>
<el-button type="primary" @click="batchMarkAsNoUse">
批量标记为无需补录
</el-button>
<el-button type="primary" @click="handleExport">
导出
</el-button> -->
<auth-button :show-btn-ids="['9040201', '9040202', '9040203', '9040205']"
category="Button" />
</d2-table-header>
<!-- :beforeSearchFn="beforeSearchFn" -->
<d2-table ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
:selectable-fn="selectableFn">
<template slot="auth-button"
slot-scope="scope">
<!-- 已分帐无可操作内容 -->
<div v-if="scope.scope.inputStatus !== '6'">
<!-- <el-button type="text" v-if="scope.scope.inputStatus == '1'" @click="orderDetail(scope.scope)">
订单详情
</el-button> -->
<auth-button v-if="scope.scope.inputStatus == '1'"
:show-btn-ids="['9040204']"
:data="scope.scope" />
<!-- <el-button type="text"
v-if="scope.scope.inputStatus == '0'"
@click="relatActivityOrder(scope.scope)">
关联活动订单
</el-button>
<el-button type="text"
v-if="scope.scope.inputStatus == '4'"
@click="record(scope.scope)">
确认补录
</el-button>
<el-button type="text"
v-if="scope.scope.inputStatus == '4'"
@click="cancelRelat(scope.scope)">
取消关联
</el-button> -->
<!-- <el-button type="text"
v-if="scope.scope.inputStatus == '5'"
@click="chooseRule(scope.scope)">
发起分账
</el-button>
<el-button type="text"
v-if="scope.scope.manualFlag == '1'"
@click="ruleHistory(scope.scope)">
分账记录
</el-button> -->
</div>
<!-- 仅预支付状态显示 -->
<!-- <span v-if="scope.scope.tailOrderStatus == '3'">
<el-button type="text" size="mini" style="margin-left: 10px" @click="record(scope.scope)">
确认补录
</el-button>
<el-button type="text" size="mini" style="margin-left: 10px" @click="cancelRelat(scope.scope)">
取消关联
</el-button>
</span> -->
</template>
</d2-table>
</div>
</d2-container>
<!-- 批量修改所属园区店 -->
<update-yqMerchant-dialog :merchant-visible="merchantDialogVisible"
:id-list="ids"
v-if="merchantDialogVisible"
@dialogClose="dialogClose" />
<!-- 关联活动订单 -->
<relat-activity-order-dialog :relat-activity-visible="relatActivityVisible"
:order-id="orderId"
v-if="relatActivityVisible"
@dialogClose="relatDialogClose" />
<!-- 选择分账规则 -->
<choose-rule-dialog :rule-visible="ruleVisible"
:record-info="recordInfo"
v-if="ruleVisible"
@dialogClose="ruleDialogClose" />
<!-- 选择分账规则 -->
<rule-info-dialog :rule-info-visible="ruleInfoVisible"
:record-info="recordInfo"
v-if="ruleInfoVisible"
@dialogClose="ruleInfoDialogClose" />
<!-- 发起退款 -->
<new-sign-refund-dialog :sign-refund-visible="signRefundVisible"
:order-list="infoList"
:order-type="2"
v-if="signRefundVisible"
@dialogClose="refundDialogClose" />
</div>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { getServiceStore, getParkStore } from '@api/editCustomer'
import { payTypeList } from '@/common/constants.js'
import { listShop4sByRef } from '@api/merchant'
import { waitinputorderCount, waitinputorderPage, getList, markAsNoUse, batchUpdateToNotInput, batchUpdateConfirmInput } from '@api/order'
import updateYqMerchantDialog from './updateYqMerchantDialog'
import relatActivityOrderDialog from './relatActivityOrderDialog'
import chooseRuleDialog from './chooseRuleDialog'
import ruleInfoDialog from './ruleInfoDialog'
import newSignRefundDialog from './components/newSignRefundDialog'
const clonePayTypeList = deepClone(payTypeList)
clonePayTypeList.splice(1, 1)
export default {
name: 'OrderSupplement',
components: {
updateYqMerchantDialog,
relatActivityOrderDialog,
chooseRuleDialog,
ruleInfoDialog,
newSignRefundDialog
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
countObj: {},
searchForm: {
inputtedOrderCode: '',
tradeNo: '',
inputStatus: '',
yqMerchantId: '',
posTrmNo: '',
payType: '',
shopMerchantId: ''
},
searchFormSearch: {},
searchSelectObj: {
orderOrTrade: {
attr: 'inputtedOrderCode',
value: ''
}
},
showFormData: [{
label: '订单时间',
name: 'payDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
}, {
type: 'selectInput',
selectName: 'orderOrTrade',
isClear: true,
selectOption: [{
label: '主订单编号',
name: 'inputtedOrderCode'
}, {
label: '交易参考号',
name: 'tradeNo'
}, {
label: '支付订单号',
name: 'outTradeNo'
}],
handleSelectChange: (value) => {
this.searchSelectObj.orderOrTrade.value = ''
}
}, {
label: '通知状态',
name: 'notifyStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'notifyStatusList'
}, {
label: '状态',
name: 'inputStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'inputStatusList'
}, {
label: '服务对接',
// label: '园区店',
name: 'yqMerchantId',
type: 'select',
isHide: !this.$store.state.d2admin.user.info.beSuper,
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'parkServiceList',
changeAttr: (value, targetItem) => {
if (value) {
// 获取流量方
this.getServiceStore(value)
} else {
// this.baseData.storeIdList = []
this.getAllServiceStore()
}
this.searchForm.shopMerchantId = ''
this.getOptionsList()
}
}, {
label: '流量来源',
name: 'shopMerchantId',
type: 'select',
noDataText: '请先选择服务对接',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'storeIdList'
// changeAttr: (value, targetItem) => {
// if (value) {
// // // 获取二级流量方
// this.getDiversionMerchantRef(value)
// } else {
// this.baseData.subShopMerchantList = []
// }
// this.searchForm.subShopMerchantId = ''
// this.getOptionsList()
// }
}, {
label: '终端编码',
name: 'posTrmNo',
type: 'input',
maxlength: '20',
isClear: true
}, {
label: '收款来源',
name: 'payType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'payTypeList'
}],
getListApi: waitinputorderPage,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
mutiSelectUniqueKey: 'id',
mutiSelectName: 'orderSupplement',
tableOption: { width: '200px' },
tableColumns: [{
label: '交易参考号',
prop: 'tradeNo',
width: '160px'
}, {
label: '支付订单号',
prop: 'outTradeNo',
width: '250px'
}, {
label: '支付金额',
prop: 'totalFee',
formatter: (cellValue) => {
return cellValue.totalFee ? '¥' + cellValue.totalFee / 100 : ''
}
}, {
label: '支付时间',
prop: 'accountDate',
width: '150px',
formatter: (cellValue) => {
return cellValue.accountDate ? Util.dateFormate(cellValue.accountDate, 'YYYY-MM-DD HH:mm:ss') : ''
}
}, {
label: '收款来源',
prop: 'payType',
width: '100px',
formatter: (cellValue) => {
return this.baseData.payTypeList.find(item => item.confId === cellValue.payType?.toString())?.confLabel
}
}, {
label: '终端编码',
prop: 'posTrmNo'
}, {
label: '服务对接',
// label: '园区店',
prop: 'yqMerchantName',
width: '200px'
},
{
label: '商户号',
// label: '园区店商户号',
prop: 'yqMerchantId',
width: '120px'
}, {
label: '流量方',
prop: 'shopMerchantName',
width: '200px'
},
{
label: '流量方商户号',
prop: 'shopMerchantId',
width: '120px'
},
{
label: '通知状态',
prop: 'notifyStatus',
formatter: (cellValue) => {
return this.baseData.notifyStatusList.find(item => item.confId === cellValue.notifyStatus?.toString())?.confLabel
}
},
{
label: '状态',
prop: 'inputStatus',
formatter: (cellValue) => {
return this.baseData.inputStatusList.find(item => item.confId === cellValue.inputStatus?.toString())?.confLabel
}
},
{
label: '主订单编号',
prop: 'inputtedOrderCode',
width: '160px'
}
]
},
baseData: {
notifyStatusList: [
{
confId: '1',
confLabel: '已通知'
},
{
confId: '0',
confLabel: '未通知'
}
],
inputStatusList: [
{
confId: '1',
confLabel: '已补录'
},
{
confId: '0',
confLabel: '未补录'
},
{
confId: '2',
confLabel: '未关联'
},
{
confId: '3',
confLabel: '无需补录'
},
{
confId: '4',
confLabel: '待确认补录'
},
{
confId: '5',
confLabel: '未分账'
},
{
confId: '6',
confLabel: '已分帐'
},
{
confId: '7',
confLabel: '退款中'
},
{
confId: '8',
confLabel: '已退款'
}
],
payTypeList: clonePayTypeList,
storeIdList: [],
parkServiceList: []
},
merchantDialogVisible: false,
ids: [],
relatActivityVisible: false,
orderId: null,
ruleVisible: false,
recordInfo: null,
ruleInfoVisible: false,
signRefundVisible: false,
infoList: []
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
this.getAllServiceStore()
this.userInfo.beSuper && getParkStore({}).then(res => {
res.forEach(item => {
item.merchantId = item.merchantNo
})
this.baseData.parkServiceList = res
this.getOptionsList()
})
this.getCount()
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
...mapActions('d2admin/user', ['actionSetDownloadList']),
getAllServiceStore() {
listShop4sByRef({
// scene: 1
}).then(res => {
console.log('this.getAllServiceStore()', res)
this.baseData.storeIdList = res || []
this.getOptionsList()
})
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm)
if (this.searchFormSearch.payDate) {
this.searchFormSearch.accountStartDate = Util.dateFormate(this.searchFormSearch.payDate[0], 'YYYY-MM-DD HH:mm:ss')
this.searchFormSearch.accountEndDate = Util.dateFormate(this.searchFormSearch.payDate[1], 'YYYY-MM-DD') + ' 23:59:59'
delete this.searchFormSearch.payDate
}
var orderOrTrade = this.getSelectInputParams()
this.searchFormSearch = Object.assign(this.searchFormSearch, orderOrTrade)
resolve()
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
console.log('this.baseData[item.optionsName]', item.optionsName)
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
getSelectInputParams() {
const list = Object.keys(this.searchSelectObj)
var params = {}
list.forEach(i => {
const item = this.searchSelectObj[i]
item.value && (params[item.attr] = item.value)
})
return params
},
getCount() {
var params = this.searchFormSearch
waitinputorderCount(params).then(res => {
this.countObj = res
})
},
handleSearch() {
this.$refs.recordTable.refreshTable()
this.getCount()
},
handleReset() {
this.searchForm = {
inputtedOrderCode: '',
tradeNo: '',
inputStatus: '',
yqMerchantId: '',
posTrmNo: '',
payType: '',
shopMerchantId: ''
}
this.searchSelectObj = {
orderOrTrade: {
attr: 'inputtedOrderCode',
value: ''
}
}
this.baseData.storeIdList = []
this.$refs.recordTable.refreshTable()
this.getAllServiceStore()
this.getCount()
},
handleRecord() {
// this.close({ tagName: '/orderList' })
this.$router.push({ name: 'orderList' })
// this.close({ tagName: '/orderSupplement' })
},
handleExport() {
var params = this.searchFormSearch
// waitinputorderExport(params).then(res => {
// this.$open(res)
// })
params.method = 'dj.api.smartcarlife.waitinputorder.export.async'
// asyncExportExcel({ exportParam: JSON.stringify(params) }).then(res => {
const list = [
...this.dowloadList,
{
name: '订单补录列表',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
// })
},
orderDetail(row) {
if (row.sceneType && row.sceneType == 1) {
getList({ orderCode: row.inputtedOrderCode, sceneType: row.sceneType }).then(res => {
this.$router.push({
name: 'orderDetail',
query: {
detail: JSON.stringify(res.list[0]),
from: 'orderSupplement'
}
})
})
}
if (row.sceneType && row.sceneType == 3) {
row.subOrderProfitAllocations = {}
this.$router.push({
name: 'financeDetail',
params: {
rowInfo: row,
from: 'orderSupplement'
}
})
}
},
selectableFn(row, index) {
var isSelect = true
if (row.inputStatus == '1' || row.inputStatus == '7' || row.inputStatus == '8') { // 已补录流水/退款中/已退款不可勾选
isSelect = false
}
return isSelect
},
batchUpdateYqMerchant() {
var selectedData = []
console.log(this.$refs.recordTable.mutiSelectArr.orderSupplement)
if (this.$refs.recordTable.mutiSelectArr.orderSupplement) {
selectedData = this.$refs.recordTable.mutiSelectArr.orderSupplement
}
if (!selectedData?.length) {
this.$message({
message: "请选择需要修改的记录",
type: "warning",
showClose: true
})
return false
}
const flag = selectedData.some((item) => {
return item.inputStatus == '6' // “已分账”不可进行该操作
})
if (flag) {
this.$message({
message: "已分账状态流水不支持操作",
type: "warning",
showClose: true
})
return false
}
this.ids = selectedData.map((item) => {
return item.id
})
this.merchantDialogVisible = !this.merchantDialogVisible
},
dialogClose(flag) {
this.merchantDialogVisible = !this.merchantDialogVisible
if (flag) {
this.$refs.recordTable.refreshTable()
}
},
batchMarkAsNoUse() {
var selectedData = []
console.log(this.$refs.recordTable.mutiSelectArr.orderSupplement)
if (this.$refs.recordTable.mutiSelectArr.orderSupplement) {
selectedData = this.$refs.recordTable.mutiSelectArr.orderSupplement
}
if (!selectedData?.length) {
this.$message({
message: "请选择需要标记的记录",
type: "warning",
showClose: true
})
return false
}
const flag = selectedData.some((item) => {
return item.inputStatus == '6' // “已分账”不可进行该操作
})
if (flag) {
this.$message({
message: "已分账状态流水不支持操作",
type: "warning",
showClose: true
})
return false
}
var idList = selectedData.map((item) => {
return item.id
})
this.$confirm('标记为无需补录后,对应的流水不再需要进行补单操作,且不可恢复,是否确定修改?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
markAsNoUse({ idList: idList }).then(res => {
this.notice.okTips()
this.$refs.recordTable.refreshTable()
})
}).catch(err => {
console.log(err)
})
},
// 确认补录
record(row) {
var selectedData = []
selectedData.push(row)
this.record_commit(selectedData)
},
// 批量确认补录
batchRecord() {
var selectedData = []
if (this.$refs.recordTable.mutiSelectArr.orderSupplement) {
selectedData = this.$refs.recordTable.mutiSelectArr.orderSupplement
}
this.record_commit(selectedData)
},
record_commit(selectedData) {
if (!selectedData?.length) {
this.$message({
message: "请选择需要确认补录的记录",
type: "warning",
showClose: true
})
return false
}
const flag = selectedData.some((item) => {
return item.inputStatus != '4'
})
if (flag) {
this.$message({
message: "请选择状态为待确认补录的订单",
type: "warning",
showClose: true
})
return false
}
var idList = selectedData.map((item) => {
return item.id
})
this.$confirm('确认补录后,系统会自动对该订单执行分账,且不可撤回,是否确认补录?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
batchUpdateConfirmInput({ idList: idList }).then(res => {
this.notice.okTips()
this.$refs.recordTable.refreshTable()
})
}).catch(err => {
console.log(err)
})
},
// 关联活动订单
relatActivityOrder(row) {
this.orderId = row.id
this.relatActivityVisible = true
},
relatDialogClose(flag) {
this.relatActivityVisible = !this.relatActivityVisible
if (flag) {
this.$refs.recordTable.refreshTable()
}
},
// 取消关联
cancelRelat(row) {
this.$confirm('取消关联后,若订单已核销,系统会自动进行线下对账计算;若订单未核销,可继续关联其他流水;是否确认取消关联?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const idList = [row.id]
batchUpdateToNotInput({ idList: idList }).then(res => {
this.notice.okTips()
this.$refs.recordTable.refreshTable()
})
}).catch(err => {
console.log(err)
})
},
// 选择对账规则
chooseRule(row) {
this.recordInfo = row
this.ruleVisible = true
},
ruleDialogClose(flag) {
this.ruleVisible = !this.ruleVisible
if (flag) {
this.$refs.recordTable.refreshTable()
}
},
// 分账记录
ruleHistory(row) {
this.recordInfo = row
this.ruleInfoVisible = true
},
ruleInfoDialogClose(flag) {
this.ruleInfoVisible = !this.ruleInfoVisible
if (flag) {
this.$refs.recordTable.refreshTable()
}
},
getServiceStore(merchantId) {
getServiceStore({
yqMerchantId: merchantId
}).then(res => {
this.baseData.storeIdList = res || []
this.getOptionsList()
})
},
// 批量发起退款
batchRefund() {
var selectedData = []
if (this.$refs.recordTable.mutiSelectArr.orderSupplement) {
selectedData = this.$refs.recordTable.mutiSelectArr.orderSupplement
}
this.batchRefund_commit(selectedData)
},
batchRefund_commit(selectedData) {
if (!selectedData?.length) {
this.$message({
message: "请选择需要发起退款的记录",
type: "warning",
showClose: true
})
return false
}
const flag = selectedData.some((item) => {
return item.inputStatus != '0' && item.inputStatus != '2' && item.inputStatus != '3' && item.inputStatus != '6' // 仅流水状态=“未关联”“未补录”“无需补录”“已分账”可进行该操作
})
if (flag) {
this.$message({
message: "请勾选未进行过补单的流水",
type: "warning",
showClose: true
})
return false
}
var list = selectedData.map((item) => {
item.orderCode = item.tradeNo
item.price = item.totalFee ? item.totalFee / 100 : ''
return item
})
this.infoList = list
this.signRefundVisible = !this.signRefundVisible
},
refundDialogClose(flag) {
this.signRefundVisible = !this.signRefundVisible
if (flag) {
this.$refs.recordTable.refreshTable()
}
}
}
}
</script>
<style scoped>
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.leftSpan {
display: inline-block;
box-sizing: border-box;
margin-right: 10px;
}
</style>