accountRules.vue
18.7 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
<template>
<div v-if="accountLevel == 4 || isAdmin" class="rule-container">
<div v-if="nodata == 1&&updateTime" class="top_wrapper">
<div v-if="updateTime" class="tip_line">
<img class="icon" src="../../assets/notice.png" />
<span class="h10_title">尊敬的客户,您的分账规则于 #{{ updateTime }}#已经变更,新的规则将于 #{{ effectTime }} 00:00# 生效,修改人:{{ settleRultData.updatedBy }}。</span>
</div>
<div v-if="updateTime" class="drive_line"></div>
<div class="content_wrap">
<div class="time_widget">
<span class="h11_title">生效时间:{{ updateTime ? effectTime : effectStartDate }}</span>
<div v-if="updateTime" class="time_status">待生效</div>
<div v-else class="time_status">已生效</div>
</div>
<rule-table :division="divisionRuleData" :settle="settleRultData" :bankData="bankInfo"></rule-table>
</div>
</div>
<div v-if="nodata == 1" class="list_wrapper">
<div class="find_wrap">
<div class="date_wrap">
<el-date-picker :picker-options="pickerOptions" style="width: 160px" size="mini" v-model="startDate" type="date" placeholder="年/月/日"></el-date-picker>
</div>
<div style="width: 10px; height: 1px"></div>
<div class="date_wrap customdate">
<el-date-picker :picker-options="pickerOptions" style="width: 160px" size="mini" v-model="endDate" type="date" placeholder="年/月/日"></el-date-picker>
</div>
<el-button class="custombtn" size="mini" type="primary" @click="toFindNote">查询</el-button>
<span class="tip_text" @click="computeShow = true">查看分润计算说明</span>
</div>
<div v-if="noList == 1" class="timeLine_wrap">
<el-timeline>
<template v-for="(item, index) in noteList">
<el-timeline-item :key="index" placement="top">
<div slot="dot" class="dot_line">
<div class="icon"></div>
<span class="text">生效时间:{{ item.effectStartDate }}-{{ item.effectEndDate || '至今' }}</span>
<div class="btn">{{item.effectEndDate?'已生效':'生效中'}}</div>
<span v-if="index" class="tip_text" @click="showTable(item.show, index)">{{ item.show ? '收缩详情' : '点击查看详情' }}</span>
</div>
<div v-if="item.show" class="table_con">
<rule-table :bankData="item.bankInfo" :division="item.divisionRule" :settle="item.settleRule"></rule-table>
</div>
</el-timeline-item>
</template>
</el-timeline>
<div v-if="noteList.length > 10" class="showMoreBtn h7_title flex_cc">
<span>查看更多</span>
<img class="icon" src="../../assets/down_icon.png" />
</div>
</div>
<div v-if="noList == 0" class="no_data h19_title">暂无数据</div>
</div>
<div v-if="nodata == 0 && noList == 0" class="nodata_widget">
<div :style="[{ height: nodataHeight + 'px' }]" class="wrapper">
<img src="../../assets/nodata_icon.png" />
<span class="nodata_tip_1">您暂未开通精品升级服务</span>
<span class="nodata_tip_2">合作开通后,您方可在此页查看精品升级业务合作模式的分账规则,保障合作透明。</span>
</div>
<div :style="[{ height: stepHeight + 'px' }]" class="step_wrap">
<span class="nodata_tip_3">精品合作升级流程</span>
<div class="step flex_scb">
<div class="stepIcon flex_cc">1</div>
<div class="stepLine"></div>
<div class="stepIcon flex_cc">2</div>
<div class="stepLine"></div>
<div class="stepIcon flex_cc">3</div>
</div>
<div class="step_content flex_scb">
<span class="h13_title">联系嘀加精品业务经理,开通此业务</span>
<span class="h13_title">确定合作细则,销售专员转发精品礼券</span>
<span class="h13_title">车主完成精品升级,您获得分账收益</span>
</div>
</div>
</div>
<qrCode phone="138 2651 0577" :codeUrl="code" :bottom="182" v-if="nodata == 0 && noList == 0"></qrCode>
<GLDialog title="分润计算说明" :visible.sync="computeShow" mode="mid" :hasFooter="false" :before-close="handleClose">
<div class="dialogContent">
<div class="wrap">
<div class="line_tip">
<div class="h7_title spac">财务配置:</div>
<div class="tip_box">
<span>4s店太阳膜按毛利的30%分润,4s店其他全部按30%分润;服务商太阳膜按70%分润,其他全部按70%分润,</span>
<p class="h16_title">太阳膜的商品成本为2元。</p>
</div>
</div>
<div class="line_tip">
<div class="h7_title spac">分账配置:</div>
<div class="tip_box">
<span>开启线上分账</span>
<div class="points_tip">
<span class="point"></span>
<span class="h17_title">嘀加智慧云分配:平台方分账金额,服务商分账金额,额外成本,市场费</span>
</div>
<div class="points_tip">
<span class="point"></span>
<span class="h17_title">导流方分配:导流方分账金额,产品成本</span>
</div>
</div>
</div>
</div>
<div class="wrap2">
<div class="icon_title">
<img class="icon" src="../../assets/scrm_changjin_icon.png" />
<span class="h18_title spac">场景搭配</span>
</div>
<div class="content1">
<p class="h17_title">场景1:车主购买太阳膜支付10元</p>
<p class="h17_title">POS机手续费¥0.04;实收¥9.96;分账金额¥9.94(支付金额统一按照0.6%扣除手续费)</p>
<p class="h17_title">导流方分润=¥2.38</p>
<p class="h17_title">服务商分润=¥3.89</p>
<p class="h17_title">平台方分润为=¥1.67</p>
</div>
<div class="content1 flex_scb">
<img class="arrow_icon" src="../../assets/scrm_arrow_icon.png" />
<div class="con_box">
<p class="title1">假设分账设置:</p>
<p class="title2">导流方分:商品成本+导流方分润</p>
<p class="title2">嘀加智慧云分:平台方分润+服务商分润</p>
</div>
<div class="con_box">
<p class="title1">实际分账:</p>
<p class="title2">导流方=¥4.38</p>
<p class="title2">嘀加智慧云=¥5.58</p>
</div>
</div>
</div>
</div>
</GLDialog>
</div>
</template>
<script>
import { converterApi } from '../../api/modules/converter'
import { getRulesData, getRulesListData } from '../../api/modules/rules'
import ruleTable from './ruleTable.vue'
import utils from '../../util/util'
import qrCode from '../../components/qr-code/index.vue'
export default {
name: '',
components: {
'rule-table': ruleTable,
qrCode
},
data() {
return {
code:'https://img01.glsx.com.cn/weapp/resource/saas/scrm/lixs.png',
startDate: '',
endDate: '',
settleRultData: '',
updateTime: null,
effectTime: null,
updatedBy: '',
divisionRuleData: null,
noteList: [],
bankInfo: null,
pageSize: 10,
currentPage: 1,
computeShow: false,
accountLevel: 1,
nodata: 2,
noList: 2,
nodataHeight: 460,
stepHeight: 288,
pickerOptions:{},
effectStartDate:'',
isAdmin:false
}
},
created(){
// this.pickerOptions = this.setDateLimit()
},
mounted() {
const { session } = this.$globalState
let merchantId = session.merchantId
this.merchantId = merchantId
this.accountLevel = session.accountLevel
this.isAdmin = session.admin
if (session.accountLevel == 4 || session.admin) {
this.getRulesDataList(merchantId)
this.getRuleNote(merchantId)
}
let clientHeight = document.documentElement.clientHeight
this.nodataHeight = clientHeight * 0.49
this.stepHeight = clientHeight - clientHeight * 0.5 - 133
},
methods: {
// 设置日期组件时间范围
setDateLimit() {
let openInfo = JSON.parse(localStorage.getItem('openInfo'))
let startdate = utils.dateFormat(openInfo.openDate)
let obj = {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date(startdate).getTime()
}
}
return obj
},
// 获取分账规则
getRulesDataList(merchantId) {
let method = getRulesData()
let para = {
//44209532
routerMethod: method,
merchantId
}
converterApi(para).then(res => {
this.bankInfo = res.bankInfo
if (!res.bankInfo && !res.divisionRule1 && !res.divisionRule2 && !res.settleRule1 && !res.settleRule2) {
this.nodata = 0
return
}
this.nodata = 1
// 广播时间比较:
if (res.divisionRule2) {
this.divisionRuleData = res.divisionRule2
} else {
this.divisionRuleData = res.divisionRule1
}
if (res.settleRule2) {
this.settleRultData = res.settleRule2
} else {
this.settleRultData = res.settleRule1
}
this.updatedBy = this.settleRultData.updatedBy
this.settleRultData.updatedDate = utils.dateFormat(this.settleRultData.updatedDate)
if (res.divisionRule2 || res.settleRule2) {
let update = res.divisionRule2.updatedDate
this.updateTime = utils.dateFormat(update, 'YYYY-MM-DD HH:mm')
// let update = updatedDateTemp1 > updatedDateTemp2 ? updatedDateTemp1 : updatedDateTemp2
let temp = new Date(update).getTime() + 24 * 60 * 60 * 1000
this.effectTime = utils.dateFormat(temp)
}
this.divisionRuleData = this.handleMoneyShow(this.divisionRuleData)
this.effectStartDate = this.settleRultData.updatedDate
if(res.effectRecord){
this.effectStartDate = utils.dateFormat(res.effectRecord.effectStartDate)
}
})
},
// 处理分账金额显示
handleMoneyShow(division) {
if (!division) {
return division
}
let newArr = []
if (division.shopProfitDivisionFlag == 3) {
newArr.push('导流方分账金额')
}
if (division.partnerProfitDivisionFlag == 3) {
newArr.push('服务商分账金额')
}
if (division.goodsCostDivisionFlag == 3) {
newArr.push('产品金额')
}
if (division.extraCostDivisionFlag == 3) {
newArr.push('额外成本')
}
if (division.installCostDivisionFlag == 3) {
newArr.push('安装费用')
}
if (division.marketingCostDivisionFlag == 3) {
newArr.push('营销费用(包含奖惩)')
}
let str = newArr.join(',')
division.inCludeStr = str
if(!newArr.length){
division.inCludeStr = '无'
}
return division
},
// 获取分账记录
getRuleNote(merchantId) {
let method = getRulesListData()
let para = {
routerMethod: method,
currentPage: this.currentPage,
pageSize: this.pageSize,
merchantId
}
if (this.startDate) {
para.beginDateStr = utils.dateFormat(this.startDate, 'YYYY-MM-DD 00:00:00')
}
if (this.endDate) {
para.endDateStr = utils.dateFormat(this.endDate, 'YYYY-MM-DD 23:59:59')
}
converterApi(para).then(res => {
if (res.list.length) {
this.noteList = res.list.map(item => {
item.show = false
item.effectStartDate = item.effectStartDate ? utils.dateFormat(item.effectStartDate) : ''
item.effectEndDate = item.effectEndDate ? utils.dateFormat(item.effectEndDate) : ''
item.divisionRule = this.handleMoneyShow(item.divisionRule)
return item
})
this.noteList[0].show = true
this.noList = 1
} else {
this.noteList = []
this.noList = 0
}
})
},
// 展示分账记录表格
showTable(item, index) {
this.noteList[index].show = !item
},
// 查询
toFindNote() {
this.getRuleNote(this.merchantId)
},
// 关闭弹框
handleClose() {
this.computeShow = false
}
}
}
</script>
<style lang="scss" scoped>
// .rule-container{
// margin-top: 17px;
// }
.top_wrapper {
width: 100%;
// min-height: 520px;
background: #ffffff;
// box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
// margin-top: 17px;
// padding-bottom: 15px;
.tip_line {
box-sizing: border-box;
padding: 22px 20px 25px 20px;
display: flex;
align-items: center;
.icon {
width: 18px;
height: 18px;
margin-right: 6px;
}
}
.drive_line {
margin: 0 23px 0 36px;
height: 1px;
background: #e8e8ea;
}
.content_wrap {
box-sizing: border-box;
padding: 0px 19px 0 36px;
.time_widget {
box-sizing: border-box;
padding: 15px 0 10px 0;
display: flex;
align-items: center;
.time_status {
width: 48px;
height: 18px;
background: #eaeaea;
border-radius: 2px;
text-align: center;
line-height: 18px;
font-size: 10px;
font-weight: 400;
color: #5850ff;
margin-left: 10px;
}
}
}
}
.list_wrapper {
// margin-top: 26px;
background: #ffffff;
// box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
box-sizing: border-box;
padding: 20px 19px 17px 20px;
.find_wrap {
display: flex;
align-items: center;
.date_wrap {
width: 160px;
}
.tip_text {
margin-left: 20px;
font-size: 14px;
font-weight: 500;
color: #5850ff;
cursor: pointer;
z-index: 120;
position: relative;
}
// .date_wrap /deep/ .el-input--mini .el-input__inner{
// border-radius: 0;
// }
.customdate /deep/ .el-input--mini .el-input__inner{
// border-right: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.custombtn{
border-bottom-left-radius: 0;
border-top-left-radius: 0;
border: 2px solid #5850ff;
border-left: none;
// border-radius: 0;
}
}
.timeLine_wrap {
margin-top: 19px;
position: relative;
.dot_line {
display: flex;
align-items: center;
box-sizing: border-box;
padding-left: 1.48px;
.icon {
width: 7px;
height: 7px;
background: #bebde5;
border-radius: 50%;
}
.text {
font-size: 14px;
font-weight: 500;
color: #000000;
margin-left: 9px;
margin-right: 10px;
}
.btn {
width: 48px;
height: 18px;
background: #5850ff;
border-radius: 2px;
text-align: center;
line-height: 18px;
font-size: 10px;
font-weight: 400;
color: #ffffff;
}
}
.table_con {
margin-top: 30px;
}
.tip_text {
font-size: 14px;
font-weight: 500;
color: #5850ff;
margin-left: 10px;
cursor: pointer;
z-index: 88;
position: relative;
}
.showMoreBtn {
position: absolute;
left: 50%;
bottom: 58px;
transform: translate(-50%, 0);
width: 105px;
height: 30px;
background: #e8e8ea;
border-radius: 2px;
cursor: pointer;
> img {
margin-left: 5px;
width: 10px;
height: 9px;
}
}
}
}
.dialogTitle {
font-size: 20px;
font-weight: 500;
color: #333333;
}
.dialogContent {
.wrap {
background: #f6f6f7;
box-sizing: border-box;
padding: 17px 0 7px 15px;
}
.line_tip {
display: flex;
margin-bottom: 10px;
.tip_box {
font-size: 12px;
font-weight: 400;
color: #333333;
line-height: 20px;
.points_tip {
display: flex;
align-items: center;
.point {
width: 6px;
height: 6px;
background: #5850ff;
border-radius: 50%;
margin-right: 5px;
}
}
}
.spac {
font-weight: bold;
line-height: 20px;
}
}
.wrap2 {
margin-top: 20px;
.icon_title {
display: flex;
align-items: center;
}
.icon {
width: 20px;
height: 20px;
margin-right: 5px;
}
.spac {
font-weight: bold;
}
.content1 {
margin-top: 10px;
box-sizing: border-box;
padding: 0px 25px;
position: relative;
> p {
line-height: 20px;
}
.con_box {
width: calc(50% - 5.5px);
height: 82px;
border: 1px solid #ededed;
box-sizing: border-box;
padding: 15px 20px;
> p {
margin-bottom: 5px;
}
.title1 {
font-size: 12px;
font-weight: 600;
color: #333333;
line-height: 17px;
}
.title2 {
font-size: 12px;
font-weight: 400;
color: #666666;
line-height: 17px;
}
}
.arrow_icon {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 14px;
height: 14px;
}
}
}
}
.no_data {
text-align: center;
padding: 20px 0;
}
.nodata_widget {
.wrapper {
width: 100%;
background: #ffffff;
// box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
.nodata_tip_1 {
font-size: 18px;
font-weight: 500;
color: #3a3a3a;
margin-top: 48px;
}
.nodata_tip_2 {
font-size: 14px;
font-weight: 400;
color: #3a3a3a;
margin-top: 9px;
}
}
.step_wrap {
width: 100%;
background: #ffffff;
// box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
margin-top: 10px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.nodata_tip_3 {
font-size: 16px;
font-weight: 500;
color: #000000;
margin-bottom: 40px;
}
.step,
.step_content {
width: 100%;
box-sizing: border-box;
padding: 0 50px;
}
.step {
padding: 0 146px;
}
.step_content {
margin-top: 22px;
}
.stepLine {
width: 42%;
height: 1px;
background: #5850ff;
}
.stepIcon {
width: 32px;
height: 32px;
background: #5850ff;
font-size: 14px;
font-weight: 400;
color: #ffffff;
border-radius: 50%;
}
}
}
</style>