liangjin
2021-04-01 b3d69d1ed5d25ec57cf50e742100a5e4f61b2301
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
 
<template>
    <div class="overdue">
        <div class="top" :style="{background:$store.state.defaultBgColor}">
            <van-nav-bar title="风控订单" left-text="返回" left-arrow @click-left="onClickLeft" style="line-height: 43px;" class="navBar">
                <i class="iconfont iconzuojiantou" slot="left" style="font-size: 25px;"></i>
                <span slot="right"  @click="isShow = true;">筛选</span>
            </van-nav-bar>
            <div class="tabBar">
                <div class="tabBar_item" @click="changeOrderType(1)">
                    <p>投诉订单</p>
                    <p class="line" v-show="orderTypeNum == 1"></p>
                </div>
                <div class="tabBar_item" @click="changeOrderType(2)">
                    <p>风险订单</p>
                    <p class="line" v-show="orderTypeNum == 2"></p>
                </div>
            </div>
        </div>
        <div class="type">
            <div class="type_item" v-show="orderTypeNum == 1">
                <p class="type_num">{{unHandleNum}}笔</p>
                <p class="complaint">投诉中</p>
            </div>
            <div class="type_item" v-show="orderTypeNum == 1" >
                <p class="type_num">{{handleNum}}笔</p>
                <p class="deal">已处理</p>
            </div>
            <div class="type_item" v-show="orderTypeNum != 1">
                <p class="type_num">{{unHandleNum + handleNum}}笔</p>
                <p>风险订单</p>
            </div>
        </div>
        <!-- 订单列表-->
        <div class="list">
            <van-list v-model="loading" :finished="finished" finished-text="没有更多了"  @load="onLoad" :immediate-check="false" offset="10" class="loadMore">
                <div class="list_item" v-for="(item, index) in list" :key="index" @click="go(item)">
                    <div class="list_item_left">
                        <p class="leftTop">{{item.userName}} <span>{{item.userMblNo}}</span></p>
                        <p>订单状态:{{item.orderStatus}}</p>
                        <p>订单号:{{item.orderId}}</p>
                        <p>办单日期:{{item.creTime | dealCreTime}}</p>
                        <p v-show="orderTypeNum == 1">投诉日期:{{item.noticeTime | dealNoticeTime}}</p>
                        <p v-show="orderTypeNum != 1">风险识别日期:{{item.noticeTime | dealNoticeTime}}</p>
                    </div>
                    <div class="list_item_right">
                        <div class="list_item_right_top" v-if="orderTypeNum == 1">
                            <p class="typeText" :class="item.status == 1 ? 'activetypeText' : ''" v-if="orderTypeNum == 1">{{item.status | dealStatus}}</p>
                            <p class="typebtn" v-if="orderTypeNum == 1">({{item.type}})</p>
                        </div>
                        <p class="typeTextFx" v-show="orderTypeNum != 1">{{item.type}}风险</p>
                        <p class="btn" :style="{background:$store.state.defaultBgColor}" @click.stop="dealOrderStatus(item.orderId)" v-if="orderTypeNum == 1 && item.status == 0">已处理</p>
                        <p class="btn" :style="{background:$store.state.defaultBgColor}" @click.stop="haveRead(item.orderId)" v-if="orderTypeNum != 1 && item.status == 0">已读</p>
                    </div>
                </div>
            </van-list>
        </div>
        <v-button-circle icon='icondaochu' title='导出' @click="exportFile"></v-button-circle>
        <!-- 筛选弹出层-->
        <v-filter v-model="isShow" 
        :belongArr="belongArr" 
        :periodsArr="periodsArr" 
        :riskLevelArr="riskLevelArr" 
        :riskTypeArr="riskTypeArr" 
        customTitle="分期本金" 
        :hasSearch="true" 
        @search="(v)=>search(v,true)">
        </v-filter>
        <!-- 无订单展示-->
        <div class="overdue-pic" v-if="noOrder">
            <div class="overdue-pic-img">
                <img src="../../../assets/imgs/yqpic.png" alt="暂无逾期">
            </div>
            <p class="overdue-pic-text">您目前无风控订单,请继续保持~</p>
        </div>
    </div>
</template>
<script>
import { XHeader } from 'vux';
import {dateFormat} from 'vux';
export default {
    name: 'message',
    components: {
        XHeader
    },
    data() {
        return {
            orderTypeNum: 1, //控制订单类型切换
            list: [],// 订单列表
            isShow: false, //控制筛选弹出层
            belongArr: [], // 所属代理、渠道、商户、门店
            periodsArr: [],// 期数
            riskLevelArr: [],// 风险级别
            riskTypeArr: [],// 风险种类
            loading: false, // 上拉加载状态
            finished: false,// 上拉加载无更多数据
            id: '', // 上拉加载时最后一条数据orderId
            unHandleNum: '', // 未处理订单
            handleNum: '',// 已处理订单
            obj: '',
            noOrder: false
        }
    },
    computed: {
    },
    created() {
        this.init()
        this.getList()
        this.loading = true
    },
    filters: {
        dealStatus(val) {
            return val == 0 ? '投诉中' : '已处理'
        },
        dealCreTime(val) {
            return dateFormat(val)
        },
        dealNoticeTime(val) {
            return dateFormat(val)
        }
    },
    methods: {
        // 筛选条件数据初始化
        init() {
            this.$api.riskInit().then(res => {
                this.periodsArr = res.body.insTermVoList
                this.belongArr = res.body.orgBaseInfVoList
                this.riskLevelArr = res.body.riskTypeList
                this.riskTypeArr = res.body.typeList
            })
        },
        // 获取风控订单列表
        getList(type, obj) {
            let data = {
                chanList: [],
                endAmt: '',
                startDay: "",
                endDay: "",
                insTerm: '',
                merList: [],
                mgrList: [],
                orderId: this.id || '', // 如果有最后一条数据orderId,执行为上拉加载,如不存在该字段为空。
                orderType: type || 1,
                queryStr: "",
                riskType: '',
                startAmt: '',
                storeList: [],
                type: ""
            }
            // 筛选条件下data对象值变化
            if (this.obj) {
                data.chanList = this.obj.chanList
                data.merList = this.obj.merList
                data.mgrList = this.obj.mgrList
                data.storeList = this.obj.storeList
                data.startDay = this.obj.startDay
                data.endDay = this.obj.endDay
                data.insTerm = this.obj.insTerm
                data.startAmt = this.obj.startAmt
                data.endAmt = this.obj.endAmt
                data.queryStr = this.obj.queryStr
                data.riskType = this.obj.riskLevelArrCode
                data.type = this.obj.riskTypeArrCode
            }
            this.$api.riskList(data).then(res => {
                this.unHandleNum = res.body.unHandleNum
                this.handleNum = res.body.handleNum
                if (this.id) {
                    this.list = [...this.list, ...res.body.items]
                    this.loading = false
                    if (!res.body.items.length) {
                        this.finished = true
                        this.id = ''
                    }
                } else {
                    this.list = res.body.items
                    if (!res.body.items.length) {
                        this.loading = false
                        this.noOrder = true
                    }
                }
                this.loading = false
            })
        },
        // 返回上一级
        onClickLeft() {
            this.$router.go(-1)
        },
        // 切换风控订单类型
        changeOrderType(num) {
            this.finished = false
            this.id = ''
            if (num == 1) {
                this.orderTypeNum = 1
                this.getList(1)
            } else {
                this.orderTypeNum = 2
                this.getList(2)
            }
            
        },
        // 上拉加载获取最后一条数据id再查询
        onLoad() {
            this.id = this.list[this.list.length - 1].orderId
            this.getList(this.orderTypeNum)
        },
        // 处理投诉订单
        dealOrderStatus(id) {
            this.$api.riskHandle({orderId: id}).then(res => {
                this.getList(this.orderTypeNum)
                this.$notify({type: 'success', message: '处理成功'})
                this.finished = false
            })   
        },
        // 已读风险订单
        haveRead(id) {
            this.$api.riskHandle({orderId: id}).then(res => {
                this.getList(this.orderTypeNum)
                this.$notify({type: 'success', message: '处理成功'})
                this.finished = false
            })
        },
        // 筛选
        search(v,isClear){
            this.obj = v
            this.getList(this.orderTypeNum)
            this.isShow = false
        },
        // 导出订单列表
        exportFile() {
            if (!this.list.length) {
                this.$notify('暂无数据导出')
                return
            }
            this.$api.riskExport({orderType: this.orderTypeNum}).then((res) => {
                this.$notify({type: 'success', message: '导出成功'})
            }).catch((err) => {})
        },
        // 根据不同的typeId进入详情页
        go(item) {
            let path = ''
            if (item.prodId == '30000003') {// 用户贴息
                path = `product/hb-detail?id=${item.orderId}`
            } else if (item.prodId == '30000009') { // 商品消费
                path = `product/hb-detail?id=${item.orderId}`
            } else if (item.prodId == '30000010') { // 商户贴息
                path = `product/shtx-detail?id=${item.orderId}`
            } else if (item.prodId == '30000012') { // 运营商消费花呗分期
                path = `product/xyg-hb-detail?id=${item.orderId}`
            } else if (item.prodId == '30000008') { // 商户收款
                path = `product/dmf-detail?id=${item.orderId}`
            }
            this.$router.push(path)
        }
    }
}
</script>
<style lang="less" scoped>
.overdue{
    background: #F5F5F7;
    width: 100vw;
    height: 100vh;
    font-family: PingFang SC;
    .top {
        width: 100vw;
        height: 124px;
        background: linear-gradient(180deg, #9072EB, #6F61D7);
        /deep/ .van-nav-bar {
            color: #fff;
            background:rgba(255,0,0,0);
            border: none;
        }
        /deep/ .van-nav-bar__title {
            color: #fff;
        }
        /deep/ .van-hairline--bottom::after {
            border-bottom-width: 0;
        }
        .tabBar {
            width: 100vw;
            height: 36px;
            display: flex;
            justify-content: space-around;
            .tabBar_item {
                height: 15px;
                font-size: 15px;
                font-weight: bold;
                color: #FFFFFF;
                .line {
                    width: 32px;
                    height: 2px;
                    display: block;
                    background: #FFFFFF;
                    border-radius: 1px;
                    margin: 0 auto;
                    margin-top: 10px;
                }
            }
        }
    }
    .type {
        width: 95%;
        height: 72px;
        background: #FFFFFF;
        box-shadow: 0px 3px 8px 0px rgba(217, 208, 231, 0.3);
        border-radius: 3px;
        margin: 0 auto;
        margin-top: -30px;
        display: flex;
        justify-content: space-around;
        align-items: center;
        .type_item {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            color: #999;
            .type_num {
                font-size: 18px;
                color: #333333;
                font-weight: bold;
                margin-bottom: 8px;
            }
            .complaint {
                font-size: 14px;
                color: #FF7A7A;
            }
            .deal {               
                font-size: 14px;
                color: #71CD9F;
            }
        }
    }
    .list {
        width: 100%;
        margin-top: 20px;
        .loadMore {
            width: 100%;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-content: center;
            align-items: center;
        }
        .list_item {
            width: 95%;
            height: 121px;
            margin-right: calc(100% - 100vw);
            background: #FFFFFF;
            box-shadow: 0px 0px 7px 0px rgba(217, 208, 231, 0.28);
            border-radius: 3px;
            margin-bottom: 10px;
            padding: 16px 16px 12px 19px;
            box-sizing: border-box;
            display: flex;
            flex-shrink: 0;
            .list_item_left {
                width: 75%;
                height: 12px;
                font-size: 12px;
                font-weight: 500;
                color: #999999;
                display: flex;
                flex-direction: column;
                .leftTop {
                    font-size: 14px;
                    font-weight: 500;
                    color: #333333;
                     margin-top: 0px;
                    span {
                        margin-left: 13px;
                    }
                }
                p {
                    margin-top: 6px;
                }
            }
            .list_item_right {
                width: 25%;
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                align-items: center;
                .list_item_right_top {
                    // width: 100%;
                    .typeText {
                        height: 16px;
                        font-size: 16px;
                        font-family: PingFang SC;
                        font-weight: bold;
                        color: #FF7A7A;
                        text-align: center;
                    }
                }
                .typeTextFx {
                    height: 16px;
                    font-size: 16px;
                    font-family: PingFang SC;
                    font-weight: bold;
                    color: #FF7A7A;
                    text-align: center;
                }
                .activetypeText {
                    color: #71CD9F;
                }
                .typebtn {                 
                    font-size: 12px;
                    font-family: PingFang SC;
                    color: #999999;
                    margin-top: 5px;
                    text-align: center;
                }
                .btn {
                    width: 77px;
                    height: 28px;
                    background: linear-gradient(90deg, #8F6AFF, #9459EC);
                    box-shadow: 0px 4px 7px 0px rgba(99, 19, 232, 0.25);
                    border-radius: 14px;              
                    font-size: 14px;
                    font-weight: 500;
                    color: #FFFFFF;
                    text-align: center;
                    line-height: 28px;
                }
            }
        }
    }
    .overdue-pic{
        margin-top: 117px;
        text-align: center;
        &-img{
            width: 100%;
            img{
                width: 164px;
                height: 112px;
                display: inline-block;
            }
        }
        &-text{
            font-size: 14px;
            color: #333333;
            margin-top: 24px;
        }
    }
}
</style>