stepFour.vue
5.02 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
<!-- 4 - 开启分账 -->
<template>
<div class="open-division">
<p class="edit-sub-title">
开启分账<span class="title-tips">开启线上自动分账,分账金额会根据分账规则自动转入分账方的对公账户。</span>
</p>
<el-form
ref="divisionRuleRef"
:model="form"
:rules="rules"
label-suffix=":"
label-width="180px">
<el-form-item
label=""
prop="autoFlag">
<span
class="tips-block"
slot="label">
<span class="tips-label">线上自动分账</span>
<el-tooltip
popper-class="tooltip-class"
effect="dark"
content="产生交易后会自动打款给商户,开启及关闭操作第二天生效。"
placement="top">
<span class="tips-icon" />
</el-tooltip>:
</span>
<el-radio-group v-model="form.autoFlag">
<el-switch
v-model="form.autoFlag"
active-value="Y"
inactive-value="N" />
</el-radio-group>
</el-form-item>
<el-form-item
label="结算时间方式"
prop="settleTimeType">
<span
class="tips-block"
slot="label">
<span class="tips-label">分账周期</span>
<el-tooltip
popper-class="tooltip-class"
effect="dark"
content="用户支付的款项可按T+1或指定日自动打款给商户。"
placement="top">
<span class="tips-icon" />
</el-tooltip>:
</span>
<el-radio-group
v-model="form.settleTimeType"
:disabled="form.autoFlag === 'N'">
<div
class="block_item"
style="margin-bottom: 20px;">
<el-radio :label="1">
分账周期 T+
<el-input-number
v-model="settleTimeObj.first"
controls-position="right"
size="small"
:min="0"
:max="30"
:disabled="form.settleTimeType === 2 || form.autoFlag === 'N'" />
日
<span v-show="form.settleTimeType === 1">(分账后第2天到分账方对公账户)</span>
</el-radio>
</div>
<div class="block_item">
<el-radio :label="2">
固定日期分账:每月
<el-input-number
v-model="settleTimeObj.second"
controls-position="right"
size="small"
:min="1"
:max="31"
:disabled="form.settleTimeType === 1 || form.autoFlag === 'N'" />
日
<span v-show="form.settleTimeType === 2">(上个月整月的分账金额于次月{{ +settleTimeObj.second + 1 }}日分账到分账方对公账户)</span>
</el-radio>
</div>
</el-radio-group>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { updateDivisionRuleApi } from '@api/merchant'
export default {
name: 'StepFour',
data() {
return {
form: {
autoFlag: 'N',
settleTimeType: 1
},
rules: {},
// 结算周期
settleTimeObj: {
first: '1',
second: '1'
}
}
},
props: {
stepStat: {
type: Number,
default: 1
},
merchantInfo: {
type: Object,
default: () => { }
},
// 短信
smsForm: {
type: Object,
default: () => {}
}
},
watch: {
stepStat(val) {
if (val === 4) {
this.getInfo()
}
}
},
mounted() {
// subProgress:41
},
methods: {
getInfo() {
if (this.merchantInfo.divisionRule) {
Object.assign(this.form, this.merchantInfo.divisionRule)
this.settleTimeObj[this.form.settleTimeType === 1 ? 'first' : 'second'] = this.form.settleTime
}
},
handleConfirm() {
this.$refs.divisionRuleRef.validate(valid => {
if (valid) {
var params = {
...this.form,
smsCode: this.smsForm.smsCode,
merchantId: this.merchantInfo.merchantId,
// channelType: this.merchantInfo.channelType,
settleTime: this.settleTimeObj[this.form.settleTimeType === 1 ? 'first' : 'second'],
channelType: this.merchantInfo.divisionRule.channelType,
shopProfitDivisionFlag: this.merchantInfo.divisionRule.shopProfitDivisionFlag,
partnerProfitDivisionFlag: this.merchantInfo.divisionRule.partnerProfitDivisionFlag,
goodsCostDivisionFlag: this.merchantInfo.divisionRule.goodsCostDivisionFlag,
extraCostDivisionFlag: this.merchantInfo.divisionRule.extraCostDivisionFlag,
incentiveCostDivisionFlag: this.merchantInfo.divisionRule.incentiveCostDivisionFlag
}
// console.log(params)
updateDivisionRuleApi(params).then(res => {
this.notice.okTips()
this.$emit('handleNextStep', 4)
})
}
})
}
}
}
</script>
<style scoped>
</style>