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
<template>
<div class="order">
<el-form ref="searchFrom" :model="searchFrom" label-width="100px" inline size="small">
<el-form-item label="用户ID">
<el-input v-model="searchFrom.user_id" style="width: 80px"></el-input>
</el-form-item>
<el-form-item label="用户昵称">
<el-input v-model="searchFrom.nickname" style="width: 110px"></el-input>
</el-form-item>
<el-form-item label="收件人手机号">
<el-input v-model="searchFrom.receive_mobile" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="商品名称">
<el-select v-model="searchFrom.goods_id" filterable placeholder="请选择" style="width: 150px" @change="getOrderList" clearable>
<el-option
v-for="(data,index) in goodList"
:key="index"
:label="data | filterGoods"
:value="data.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="来源" class="test">
<el-input v-model="searchFrom.invite_type " :placeholder="inviteSearchPlaceholder" style="width: 150px">
<template slot="prepend">CC -</template>
</el-input>
</el-form-item>
<el-form-item label="推广人ID">
<el-input v-model="searchFrom.invite_id" :placeholder="inviteSearchPlaceholder" style="width: 80px"></el-input>
</el-form-item>
<!-- <el-form-item label="团ID">
<el-input v-model="searchFrom.order_group_id" ></el-input>
</el-form-item> -->
<el-form-item label="购买方式">
<el-select v-model="searchFrom.buy_type" placeholder="请选择" @change="getOrderList" clearable style="width: 100px">
<el-option
v-for="item in buyTypeOption"
:key="item.id"
:label="item.value"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="支付类型">
<el-select v-model="searchFrom.order_type" placeholder="请选择" @change="getOrderList" clearable style="width: 120px">
<el-option
v-for="item in buyWay"
:key="item.id"
:label="item.value"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="订单状态">
<el-select multiple v-model="searchFrom.status" placeholder="请选择" @change="getOrderList" clearable>
<el-option
v-for="item in orderStatusOption"
:key="item.id"
:label="item.value"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否入课">
<el-select v-model="searchFrom.wait_into_course" placeholder="请选择" @change="getOrderList" clearable style="width: 120px">
<el-option
label="已入课"
value="0">
</el-option>
<el-option
label="未入课"
value="1">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="交易订单号">
<el-input v-model="searchFrom.out_trade_no"></el-input>
</el-form-item>
<el-form-item label="购买时间">
<el-date-picker
v-model="searchFrom.payTime"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="{shortcuts:[today,yesterday,last7Day,last30Day]}"
:default-time="['00:00:00','23:59:59']"
@change="getOrderList">
</el-date-picker>
</el-form-item>
<el-form-item >
<el-button type="primary" plain @click="getOrderList">搜索</el-button>
<el-button type="primary" plain @click="exportTable" v-if="$store.state.export">导出</el-button>
</el-form-item>
<el-form-item style="float:right">
<el-button type="success" plain @click="add" v-if="!$store.state.readonly">新增订单</el-button>
</el-form-item>
</el-form>
<el-table
size="small"
:data="tableData"
@expand-change="changeRow"
style="width: 100%" fixed >
<el-table-column
prop="out_trade_no"
label="订单号"
>
</el-table-column>
<el-table-column
label="购买人"
className="f-c"
width="150">
<template slot-scope="scope">
<img class="avatar" :src="scope.row.user_avatar"/> {{scope.row.user_nickname}}<br>(ID:{{scope.row.user_id}})<br>手机:{{scope.row.user_mobile}}
</template>
</el-table-column>
<el-table-column
prop="periods_title"
label="期数标题">
</el-table-column>
<el-table-column
prop="goods_name"
label="商品名称">
</el-table-column>
<el-table-column
width="250"
prop="invite_id"
className="f-c"
label="推广人">
<template slot-scope="scope">
<div @click="showSource(scope.row)" v-if="scope.row.invite_earnings > 0 && scope.row.invite_id !== 0" style="width:100%;display: flex;color: #409eff;cursor: pointer">
<img :src="scope.row.invite_avatar" class="avatar"/>
类型:{{scope.row.invite_type}} ({{scope.row.invite_name}})
<br>
收益:{{scope.row.invite_earnings / 100}}
<br>
用户ID:{{scope.row.invite_id}}
<br>
昵称:{{scope.row.invite_nickname}}
<br>
手机:{{scope.row.invite_mobile}}
</div>
<div v-if="scope.row.invite_earnings === 0 && scope.row.invite_id !== 0" style="display: flex;">
<img :src="scope.row.invite_avatar" class="avatar"/>
类型:{{scope.row.invite_type}} ({{scope.row.invite_name}})
<br>
收益:{{scope.row.invite_earnings / 100}}
<br>
用户ID:{{scope.row.invite_id}}
<br>
昵称:{{scope.row.invite_nickname}}
<br>
手机:{{scope.row.invite_mobile}}
</div>
<div v-if="scope.row.invite_id === 0">
无
</div>
</template>
</el-table-column>
<el-table-column
label="优惠活动">
<template slot-scope="scope">
<span v-if="scope.row.order_coupon_id === 0">
无
</span>
<el-button type="text" v-if="scope.row.order_coupon_id !== 0" @click="showCoupon(scope.row)">
优惠券
</el-button>
</template>
</el-table-column>
<el-table-column
label="付款状态"
width="80">
<template slot-scope="scope">
<el-button type="text" v-if="scope.row.status === 5 || scope.row.status === 3" @click="showRef(scope.row)">{{scope.row.status|status}}</el-button>
<div v-if="scope.row.status !== 5 && scope.row.status !== 3">{{scope.row.status|status}}</div>
</template>
</el-table-column>
<el-table-column
label="实付金额"
width="80">
<template slot-scope="scope">
{{scope.row.money|moneytFilter}}
</template>
</el-table-column>
<el-table-column
label="支付类型"
width="80">
<template slot-scope="scope">
{{scope.row.order_type | buyTypeWay}}
</template>
</el-table-column>
<el-table-column
label="收货地址">
<template slot-scope="scope">
<div v-if="scope.row.user_address_id && scope.row.address_info">
{{scope.row.address_info.receive_name}}<br>
{{scope.row.address_info.receive_mobile}}<br>
{{scope.row.address_info.province_name}}{{scope.row.address_info.city}}{{scope.row.address_info.area}}{{scope.row.address_info.address}}
</div>
</template>
</el-table-column>
<el-table-column
prop="pay_at"
label="购买时间" sortable>
</el-table-column>
<el-table-column
prop="created_at"
label="下单时间" sortable>
</el-table-column>
<el-table-column
prop="desc"
label="备注">
</el-table-column>
<el-table-column
width="50"
label="操作"
v-if="!$store.state.readonly" fixed="right"
>
<template slot-scope="scope">
<el-popover
placement="top"
width="400">
<div style="text-align: center">
<!--v-if="(scope.row.status == 1 || scope.row.status == 4|| scope.row.status == 5) && $store.state.orderRefund"-->
<el-button
@click="onRefund(scope.row.id, scope.row.money)"
type="warning"
v-if="(scope.row.status == 1 || scope.row.status == 4 || scope.row.status == 5 ) && $store.state.orderRefund && scope.row.order_type != 3 "
plain
size="mini">
退款
</el-button>
<el-button
@click="editComment(scope.row.id, scope.row.desc)"
type="info"
plain
size="mini">
编辑备注
</el-button>
<el-button
v-if="scope.row.user_address_id"
@click="editAddress(scope.row)"
plain
type="info"
size="mini">
编辑收货地址
</el-button>
<el-button
@click="updateTeacher(scope.row)"
type="warning"
plain
size="mini">
编辑推广人
</el-button>
</div>
<el-button slot="reference" size="mini" type="text" >操作</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<address-dialog :dialogObj="dialogObj" @reflash="onUpdateAddress"></address-dialog>
<order-dialog :newdialogObj="newdialogObj" @reflash="getOrderList"></order-dialog>
<refund-dialog :dialogObj="refundDialogObj" @reflash="onAfterRefund" @changeShow="changeShow"></refund-dialog>
<detail-dialog :dialogObj="dialogDetailObj" @changeShow="changeDetailShow"/>
<source-dialog :dialogObj="sourceDialog"/>
<refund-detail :dialogObj="refundDetail"/>
<coupon-dialog :dialogObj="couponDetail"/>
<el-dialog
title="修改推广人"
center
append-to-body
:visible.sync="promoterDialog.show"
width="600">
<el-form ref="form" label-width="120px">
<el-form-item label="老师">
<el-select
v-model="promoterDialog.teacher_id"
filterable
remote
clearable
placeholder="请输入名称"
:remote-method="remoteMethod"
:loading="loading">
<el-option
v-for="item in teacherList"
:key="item.id"
:label="item.name"
:value="item.user_id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="promoterDialog.show = false">取 消</el-button>
<el-button type="primary" @click="saveTeacher">确 定</el-button>
</span>
</el-dialog>
<page :nowPage="nowPage" :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/>
</div>
</template>
<script>
import {getOrderListApi,editOrderDescApi,getGoodsListApi,getRefundListApi,exportExcelApi,getTeacherListApi,updateOrderTeacherApi,setOrderApi} from "../../service/api";
import page from '../framework/page'
import addressDialog from './dialog'
import orderDialog from './newDialog'
import sourceDialog from './sourceDialog'
import refundDialog from './refundDialog'
import couponDialog from './couponDialog'
import detailDialog from './detail'
import refundDetail from './refundDetail'
import AddressArray from '../framework/address-picker/addr'
import {INVITETYPE,ORDERSTATUS,BUYTYPE,BUYTYPEOPTION,ORDERSTATUSOPTION,INVITETYPEOPTION,GOODSTYPE,BUYWay,BUYTYPEWAY} from "../../util/wordbook";
import CommonJs from '../../util/common';
export default {
name: 'index',
data(){
return {
nowPage: 1,
total: 0,
sourceDialog:{
show:false,
out_trade_no:''
},
today:{
text:'今天',
onClick:()=>{
this.searchFrom.payTime = [this.formatTime(new Date())+' 00:00:00',this.formatTime(new Date())+' 23:59:59'];
}
},
yesterday:{
text:'昨天',
onClick:()=>{
let preDate = this.formatTime(new Date(new Date().getTime() - 24*60*60*1000));
this.searchFrom.payTime = [preDate+' 00:00:00',preDate+' 23:59:59'];
}
},
last30Day:{
text:'过去30天',
onClick:()=>{
let preDate = this.formatTime(new Date(new Date().getTime() - 30*24*60*60*1000));
this.searchFrom.payTime = [preDate+' 00:00:00',this.formatTime(new Date())+' 23:59:59'];
}
},
last7Day:{
text:'过去7天',
onClick:()=>{
let preDate = this.formatTime(new Date(new Date().getTime() - 7*24*60*60*1000));
this.searchFrom.payTime = [preDate+' 00:00:00',this.formatTime(new Date())+' 23:59:59'];
}
},
couponDetail:{
show:false,
order_coupon_id:''
},
refundDetail:{
show:false,
out_trade_no:''
},
limit: 10,
searchFrom: {
nickname: '',
wait_into_course:'',
user_id: '',
invite_type: '',
invite_id: '',
buy_type: '',
order_type: '',
status: [1,4,5],
goods_id: '',
out_trade_no: '',
payTime: [],
order_group_id:"",
},
tableData: [],
dialogObj: {
show: false
},
newdialogObj: {
show: false
},
refundDialogObj: {
show: false,
id: '',
money: 0
},
dialogDetailObj: {
show: false,
detail: {}
},
goodList: [],
inviteTypeOption: INVITETYPEOPTION,
orderStatusOption: ORDERSTATUSOPTION,
buyTypeOption: BUYTYPEOPTION,
buyWay:BUYWay,
inviteSearchPlaceholder: '',
rules:{
value:[
{ required: true, message: '请输入备注', trigger: 'change' }
]
},
promoterDialog: {
show: false,
nowPage: 1,
total: 0,
limit: 100,
teacher_id: ''
},
teacherList: [],
loading: false
}
},
methods: {
formatTime(date){
let year = date.getFullYear();
let Month = date.getMonth()+1;
if(Month < 10){
Month = `0${Month}`
}
let Day = date.getDate();
if(Day<10)Day = `0${Day}`;
return `${year}-${Month}-${Day}`;
},
showRef(data){
this.refundDetail.show = true;
this.refundDetail.out_trade_no = data.out_trade_no;
},
showCoupon(data){
this.couponDetail.show = true;
this.couponDetail.order_coupon_id = data.order_coupon_id;
},
showSource(data){
this.sourceDialog.show = true;
this.sourceDialog.out_trade_no = data.out_trade_no;
},
changeRow(data,b){
if(b.indexOf(data)>-1){
getRefundListApi({out_trade_no:data.out_trade_no}).then(res=>{
data.refundList = res.list
})
}
},
exportTable(){
let json = {};
if (this.searchFrom.nickname) {
json.nickname = this.searchFrom.nickname
}
if (this.searchFrom.user_id) {
json.user_id = this.searchFrom.user_id
}
if (this.searchFrom.invite_type) {
json.invite_type = this.searchFrom.invite_type
}
if (this.searchFrom.invite_id) {
json.invite_id = this.searchFrom.invite_id
}
if (this.searchFrom.order_group_id) {
json.order_group_id = this.searchFrom.order_group_id
}
if (this.searchFrom.buy_type) {
json.buy_type = this.searchFrom.buy_type
}
if (this.searchFrom.order_type) {
json.order_type = this.searchFrom.order_type
}
if (this.searchFrom.status) {
json.status = this.searchFrom.status.toString()
}
if (this.searchFrom.goods_id) {
json.goods_id = this.searchFrom.goods_id
}
if (this.searchFrom.out_trade_no) {
json.out_trade_no = this.searchFrom.out_trade_no
}
if (this.searchFrom.receive_mobile) {
json.receive_mobile = this.searchFrom.receive_mobile
}
if(this.searchFrom.payTime && this.searchFrom.payTime.length > 0){
json.pay_start_at = this.searchFrom.payTime[0]
json.pay_end_at = this.searchFrom.payTime[1]
}
if (this.searchFrom.wait_into_course) {
json.wait_into_course = this.searchFrom.wait_into_course
}
json.course_type=0//月课
exportExcelApi('/api/admin/order/export',json,'月课订单列表')
},
getGoodsOption(){
let json = {
page: 1,
limit: 100,
course_type:0,
};
getGoodsListApi(json).then(res=>{
this.goodList = res.list;
})
},
onInviteTypeChange(val){
if (val === 0) {
this.inviteSearchPlaceholder = '用户ID'
} else if (val === 1) {
this.inviteSearchPlaceholder = '老师ID'
} else if (val === 2) {
this.inviteSearchPlaceholder = '推广人ID'
}
this.getOrderList();
},
detail(row){
let _detail = row;
this.dialogDetailObj = {
show: true,
detail: _detail
}
},
editComment(id, desc) {
this.$prompt('', '编辑备注', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType:'textarea',
inputValue: desc || ''
}).then(({ value }) => {
this.$confirm('确定保存?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(()=>{
editOrderDescApi(id,'order',{desc: value}).then(res=>{
this.$message({
type: 'success',
message: '编辑备注成功'
});
this.getOrderList();
});
});
})
},
onPageChange(val){
this.nowPage = val
this.getOrderList()
},
onSizeChange(val){
this.limit = val;
this.nowPage = 1;
this.getOrderList()
},
getOrderList(){
let json = {
limit: this.limit,
page: this.nowPage
};
if (this.searchFrom.nickname) {
json.nickname = this.searchFrom.nickname
}
if (this.searchFrom.user_id) {
json.user_id = this.searchFrom.user_id
}
if (this.searchFrom.invite_type) {
json.invite_type = this.searchFrom.invite_type
}
if (this.searchFrom.invite_id) {
json.invite_id = this.searchFrom.invite_id
}
if (this.searchFrom.order_group_id) {
json.order_group_id = this.searchFrom.order_group_id
}
if (this.searchFrom.buy_type) {
json.buy_type = this.searchFrom.buy_type
}
if (this.searchFrom.order_type) {
json.order_type = this.searchFrom.order_type
}
if (this.searchFrom.status) {
json.status = this.searchFrom.status.toString()
}
if (this.searchFrom.goods_id) {
json.goods_id = this.searchFrom.goods_id
}
if (this.searchFrom.out_trade_no) {
json.out_trade_no = this.searchFrom.out_trade_no
}
if (this.searchFrom.receive_mobile) {
json.receive_mobile = this.searchFrom.receive_mobile
}
if(this.searchFrom.payTime && this.searchFrom.payTime.length > 0){
json.pay_start_at = this.searchFrom.payTime[0]
json.pay_end_at = this.searchFrom.payTime[1]
}
if (this.searchFrom.wait_into_course) {
json.wait_into_course = this.searchFrom.wait_into_course
}
json.course_type=0 //月课
getOrderListApi(json).then((res)=>{
res.list.forEach(i=>{
i.refundList=[]
});
this.tableData = res.list;
this.total = res.total
})
},
changeDetailShow(data){
this.dialogDetailObj.show=data
},
changeShow(data){
this.refundDialogObj.show=data
},
onRefund(id, money){
this.refundDialogObj.id= id;
this.refundDialogObj.money= money;
this.refundDialogObj.show = true;
},
onAfterRefund(){
this.refundDialogObj.show = false;
this.getOrderList()
},
onUpdateAddress(){
this.dialogObj.show = false;
this.getOrderList();
},
editAddress(row){
if( !row.address_info || !row.address_info.province_name ){
this.dialogObj.province = ''
this.dialogObj.city = ''
this.dialogObj.district = ''
} else {
let provinceObj = AddressArray.filter((item) => {
return item.label === row.address_info.province_name
})
if(provinceObj && provinceObj.length > 0){
this.dialogObj.province = row.address_info.province_id ? row.address_info.province_id : provinceObj[0].value
if(!row.address_info.city){
this.dialogObj.city = ''
} else {
let cityObj = provinceObj[0].children.filter((city) => {
return city.label === row.address_info.city
})
this.dialogObj.city = row.address_info.city_id ? row.address_info.city_id : cityObj[0].value
if(!row.address_info.area){
this.dialogObj.district = ''
}else {
let districtObj = cityObj[0].children.filter((district) => {
return district.label === row.address_info.area
});
this.dialogObj.district = row.address_info.area_id ? row.address_info.area_id : districtObj[0].value
}
}
} else {
this.dialogObj.province = '';
this.dialogObj.district = '';
this.dialogObj.city = ''
}
}
this.dialogObj.detail = row.address_info ? row.address_info.address : '';
this.dialogObj.receive_mobile = row.address_info ? row.address_info.receive_mobile : '';
this.dialogObj.receive_name = row.address_info ? row.address_info.receive_name : '';
this.dialogObj.province_name = row.address_info ? row.address_info.province_name : '';
this.dialogObj.city_name = row.address_info ? row.address_info.city : '';
this.dialogObj.district_name = row.address_info ? row.address_info.area : '';
this.dialogObj.id = row.id;
this.dialogObj.show=true;
},
getTeacherList(name){
this.loading = true
let json = {
limit: this.promoterDialog.limit,
page: this.promoterDialog.nowPage
};
if(name) {
json.name = name
}
getTeacherListApi(json).then(res=>{
this.teacherList = res.list
this.loading = false
});
},
handleCurrentTeacherChange(val){
console.log('handleCurrentTeacherChange', val)
},
updateTeacher(val){
this.promoterDialog.show = true;
this.promoterDialog.id = val.id;
this.promoterDialog.teacher_id = val.invite_id;
this.getTeacherList()
},
remoteMethod(query) {
if (query !== '') {
this.getTeacherList(query);
} else {
this.getTeacherList();
}
},
saveTeacher(){
this.$confirm('此操作将修改推广人?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log('this.promoterDialog.teacher_id', this.promoterDialog)
updateOrderTeacherApi(this.promoterDialog.id,this.promoterDialog.teacher_id).then(res=>{
this.promoterDialog.id='';
this.promoterDialog.teacher_id = '';
this.promoterDialog.show = false;
this.$message({
type: 'success',
message: '修改成功!'
});
this.getOrderList();
});
});
},
add(){
this.newdialogObj.show=true;
},
},
components: {
addressDialog,
orderDialog,
refundDialog,
detailDialog,
refundDetail,
sourceDialog,
couponDialog,
page
},
mounted(){
if (this.$route.query.code) {
this.searchFrom.invite_type = this.$route.query.code
}
this.getOrderList();
this.getGoodsOption();
},
watch:{
"newdialogObj.show":function(val){
if(!val){
this.getOrderList();
}
}
},
filters:{
payMentFilter(val){
return val=='1'?'已付款':'未付款'
},
courseTypeFilter(val){
return val.type=='1'?`正式课(${val.duration}个月)`:`试听课(${val.duration}天)`
},
inviteType(value){
return INVITETYPE[value]
},
status(value){
return ORDERSTATUS[value]
},
buyType(value){
return BUYTYPE[value]
},
moneytFilter(val){
return val = val / 100 + '元'
},
filterGoods(val){
return '[' +val.id + ']' + '[' + GOODSTYPE[val.goods_type] + ']' + '[' +val.current_price / 100 + '元]' + val.name
},
buyTypeWay(value){
return BUYTYPEWAY[value]
},
}
}
</script>
<style scoped>
.avatar{
width: 50px;
min-width: 50px;
height: 50px;
margin-right: 5px;
border-radius: 50%;
}
.order {
padding: 20px 0;
}
</style>
<style>
.f-c > .cell {
display: flex !important;
flex-flow: row;
justify-content: flex-start;
align-items: center;
}
</style>