jufubao-admin-library 1.1.153 → 1.1.155
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -125,5 +125,28 @@ module.exports = {
|
|
|
125
125
|
disabled: true,
|
|
126
126
|
"role": "FINANCE-PARTNER.WALLET_GET_CHANNEL_AMOUNT"
|
|
127
127
|
},
|
|
128
|
+
{
|
|
129
|
+
title: "余额通知频次获取详情",
|
|
130
|
+
mapFn: "notifyConfigGet",
|
|
131
|
+
path: '/finance-partner/v1/wallet/notify-config/get',
|
|
132
|
+
isRule: false,
|
|
133
|
+
params: {
|
|
134
|
+
|
|
135
|
+
},
|
|
136
|
+
disabled: true,
|
|
137
|
+
"role": ""
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
title: "余额通知频次设置",
|
|
141
|
+
mapFn: "notifyConfigSet",
|
|
142
|
+
path: '/finance-partner/v1/wallet/notify-config/set',
|
|
143
|
+
isRule: false,
|
|
144
|
+
data: {
|
|
145
|
+
config_result:["config_result", "object", "必填"],
|
|
146
|
+
},
|
|
147
|
+
disabled: true,
|
|
148
|
+
"role": "FINANCE-PARTNER.WALLET_GET_TIME_SET"
|
|
149
|
+
},
|
|
150
|
+
|
|
128
151
|
]
|
|
129
152
|
}
|
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
</xd-search>
|
|
13
13
|
</el-card> -->
|
|
14
14
|
<el-card class="app-container__list">
|
|
15
|
+
<div class="app-container__list-pagination">
|
|
16
|
+
<div></div>
|
|
17
|
+
<div class="app-container__list-custom">
|
|
18
|
+
<el-button type="primary" size="small" @click="handleSet" v-if="isSet">余额通知频次设置</el-button>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
15
21
|
<div class="app-container__list-table">
|
|
16
22
|
<xd-table
|
|
17
23
|
:headers="headers"
|
|
@@ -30,6 +36,65 @@
|
|
|
30
36
|
></xd-pagination>
|
|
31
37
|
</div>
|
|
32
38
|
</el-card>
|
|
39
|
+
<xd-dialog
|
|
40
|
+
v-if="showDialog"
|
|
41
|
+
title=""
|
|
42
|
+
:show.sync="showDialog"
|
|
43
|
+
width="500px"
|
|
44
|
+
>
|
|
45
|
+
<xd-base-dynamic-field
|
|
46
|
+
:key="randomKey"
|
|
47
|
+
v-if="setFormList !== null"
|
|
48
|
+
ref="setForm"
|
|
49
|
+
v-model="setFormParams"
|
|
50
|
+
:list="setFormList"
|
|
51
|
+
size="medium"
|
|
52
|
+
@success="handleSuccess"
|
|
53
|
+
@onApiSuccessUrl="handleApiSuccessUrl"
|
|
54
|
+
@onGetParamsAndHeader="handlePrivateGetParamsAndHeader"
|
|
55
|
+
>
|
|
56
|
+
<template slot="set" slot-scope="scope">
|
|
57
|
+
<el-form
|
|
58
|
+
:label-width="scope.width"
|
|
59
|
+
:model="customForm"
|
|
60
|
+
:rules="customRules"
|
|
61
|
+
ref="customForm"
|
|
62
|
+
@submit.native.prevent
|
|
63
|
+
>
|
|
64
|
+
<el-form-item prop="frequency_type" label="通知频次:" required>
|
|
65
|
+
<el-select v-model="customForm.frequency_type" placeholder="请选择" style="margin-bottom: 5px;">
|
|
66
|
+
<el-option
|
|
67
|
+
v-for="item in optionsData['frequency_type_list']"
|
|
68
|
+
:key="item.value"
|
|
69
|
+
:label="item.label"
|
|
70
|
+
:value="item.value">
|
|
71
|
+
</el-option>
|
|
72
|
+
</el-select>
|
|
73
|
+
<el-select multiple v-if="customForm.frequency_type&&customForm.frequency_type==='week'" v-model="customForm.frequency_val" style="margin-bottom: 5px;" placeholder="请选择">
|
|
74
|
+
<el-option
|
|
75
|
+
v-for="item in weekData"
|
|
76
|
+
:key="item.value"
|
|
77
|
+
:label="item.label"
|
|
78
|
+
:value="item.value">
|
|
79
|
+
</el-option>
|
|
80
|
+
</el-select>
|
|
81
|
+
<el-select multiple v-model="customForm.frequency_time_val" style="margin-bottom: 5px;" placeholder="请选择">
|
|
82
|
+
<el-option
|
|
83
|
+
v-for="item in frequencyTimeData"
|
|
84
|
+
:key="item.value"
|
|
85
|
+
:label="item.label"
|
|
86
|
+
:value="item.value">
|
|
87
|
+
</el-option>
|
|
88
|
+
</el-select>
|
|
89
|
+
</el-form-item>
|
|
90
|
+
</el-form>
|
|
91
|
+
</template>
|
|
92
|
+
</xd-base-dynamic-field>
|
|
93
|
+
<div slot="btn">
|
|
94
|
+
<el-button type="default" @click="showDialog=false">取消</el-button>
|
|
95
|
+
<el-button type="primary" @click="handleConfirm">确定</el-button>
|
|
96
|
+
</div>
|
|
97
|
+
</xd-dialog>
|
|
33
98
|
</div>
|
|
34
99
|
</template>
|
|
35
100
|
|
|
@@ -42,14 +107,19 @@ import { mapActions } from "vuex"
|
|
|
42
107
|
import { getOptions } from "@/utils/options"
|
|
43
108
|
import { baseJsDateToTime } from "@/utils/xd.base.js"
|
|
44
109
|
import checkPermission from "@/utils/permission"
|
|
110
|
+
import permissions from "@/constant/permissions"
|
|
45
111
|
import roleTRecord from "@/constant/modules/tradeRecord.js"
|
|
112
|
+
import XdDialog from "@/components/XdDialog";
|
|
113
|
+
import XdBaseDynamicField from "@/components/XdBaseDynamicField"
|
|
46
114
|
|
|
47
115
|
export default {
|
|
48
116
|
name: "PageFinanceIndex",
|
|
49
117
|
components: {
|
|
50
118
|
XdPagination, //翻译插件
|
|
51
119
|
XdSearch, //搜查插件
|
|
52
|
-
XdTable
|
|
120
|
+
XdTable,
|
|
121
|
+
XdDialog,
|
|
122
|
+
XdBaseDynamicField,
|
|
53
123
|
},
|
|
54
124
|
data() {
|
|
55
125
|
return {
|
|
@@ -65,9 +135,69 @@ export default {
|
|
|
65
135
|
|
|
66
136
|
//列表对象
|
|
67
137
|
tables: [],
|
|
138
|
+
//设置参数
|
|
139
|
+
showDialog:false,
|
|
140
|
+
randomKey:'randomKey',
|
|
141
|
+
setFormList:[],
|
|
142
|
+
setFormParams:null,
|
|
143
|
+
|
|
144
|
+
optionsData:[],
|
|
145
|
+
frequencyTimeData:[
|
|
146
|
+
{label:'00:00',value:'00:00'},{label:'01:00',value:'01:00'},{label:'02:00',value:'02:00'},{label:'03:00',value:'03:00'},{label:'04:00',value:'04:00'},{label:'05:00',value:'05:00'},{label:'06:00',value:'06:00'},{label:'07:00',value:'07:00'},{label:'08:00',value:'08:00'},
|
|
147
|
+
{label:'09:00',value:'09:00'},{label:'10:00',value:'10:00'},{label:'11:00',value:'11:00'},{label:'12:00',value:'12:00'},{label:'13:00',value:'13:00'},{label:'14:00',value:'14:00'},{label:'15:00',value:'15:00'},{label:'16:00',value:'16:00'},
|
|
148
|
+
{label:'17:00',value:'17:00'},{label:'18:00',value:'18:00'},{label:'19:00',value:'19:00'},{label:'20:00',value:'20:00'},{label:'21:00',value:'21:00'},{label:'22:00',value:'22:00'},{label:'23:00',value:'23:00'}
|
|
149
|
+
],
|
|
150
|
+
customForm:{
|
|
151
|
+
frequency_type:'',
|
|
152
|
+
frequency_val:[],
|
|
153
|
+
frequency_time_val:[],
|
|
154
|
+
},
|
|
155
|
+
customRules:{},
|
|
156
|
+
weekData:[],
|
|
68
157
|
}
|
|
69
158
|
},
|
|
159
|
+
watch:{
|
|
160
|
+
showDialog:{
|
|
161
|
+
handler(n,o){
|
|
162
|
+
if(!n){
|
|
163
|
+
this.customForm = {
|
|
164
|
+
frequency_type:'',
|
|
165
|
+
frequency_val:[],
|
|
166
|
+
frequency_time_val:[],
|
|
167
|
+
}
|
|
168
|
+
this.setFormParams = null;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
'setFormParams.notify_mode':{
|
|
173
|
+
handler(n,o){
|
|
174
|
+
console.log(n,o,'pppp')
|
|
175
|
+
if(n&&n!==o){
|
|
176
|
+
this.initFormList(this.setFormParams);
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
deep:true,
|
|
180
|
+
immediate:true,
|
|
181
|
+
},
|
|
182
|
+
'customForm.frequency_val':{
|
|
183
|
+
handler(n,o){
|
|
184
|
+
if(n&&JSON.stringify(n)!==JSON.stringify(o)){
|
|
185
|
+
this.customForm.frequency_val.sort()
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
'customForm.frequency_time_val':{
|
|
190
|
+
handler(n,o){
|
|
191
|
+
if(n&&JSON.stringify(n)!==JSON.stringify(o)){
|
|
192
|
+
this.customForm.frequency_time_val.sort()
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
},
|
|
70
197
|
computed: {
|
|
198
|
+
isSet(){
|
|
199
|
+
return checkPermission([permissions.wallet.notifyConfigSet])
|
|
200
|
+
},
|
|
71
201
|
headers(){
|
|
72
202
|
return [
|
|
73
203
|
{ "type": "normal", "prop": "partner_id", "align": "center", "label": "ID" },
|
|
@@ -85,10 +215,18 @@ export default {
|
|
|
85
215
|
},
|
|
86
216
|
created() {
|
|
87
217
|
// this.initSearchForm();
|
|
218
|
+
getOptions({
|
|
219
|
+
server: 'finance-partner',
|
|
220
|
+
fn: 'wallet/notify-config',
|
|
221
|
+
path: 'p1',
|
|
222
|
+
}).then(res => {
|
|
223
|
+
this.optionsData = res.data;
|
|
224
|
+
this.weekData = res.data['frequency_val_week_list'];
|
|
225
|
+
})
|
|
88
226
|
this.getList();
|
|
89
227
|
},
|
|
90
228
|
methods: {
|
|
91
|
-
...mapActions("wallet", ["listHomeWallet"]),
|
|
229
|
+
...mapActions("wallet", ["listHomeWallet","notifyConfigGet","notifyConfigSet"]),
|
|
92
230
|
//相除
|
|
93
231
|
divide(price) {
|
|
94
232
|
return this.$xdHelper.divisionFloatNumber(price, 100);
|
|
@@ -181,6 +319,111 @@ export default {
|
|
|
181
319
|
this.page_token = page;
|
|
182
320
|
this.getList();
|
|
183
321
|
}, //todo
|
|
322
|
+
initFormList(params){
|
|
323
|
+
console.log("params", params);
|
|
324
|
+
let formList = [
|
|
325
|
+
{
|
|
326
|
+
label: '通知设置:', //label
|
|
327
|
+
ele: 'xd-radio', //package 名称
|
|
328
|
+
valueKey: 'notify_mode', //form[valueKey]
|
|
329
|
+
value: params.notify_mode || 'default', //v-model
|
|
330
|
+
list: this.optionsData['notify_mode_list'],
|
|
331
|
+
rules: [
|
|
332
|
+
{ required: true, message: `请选择通知设置`, trigger: 'change' },
|
|
333
|
+
]
|
|
334
|
+
},
|
|
335
|
+
params.notify_mode==='default'&&{
|
|
336
|
+
label: '通知频次:',
|
|
337
|
+
ele:'el-html',
|
|
338
|
+
value:this.optionsData['default_time_tip']
|
|
339
|
+
},
|
|
340
|
+
params.notify_mode==='custom'&&{
|
|
341
|
+
label: '通知频次:',
|
|
342
|
+
ele:'slot',
|
|
343
|
+
slot:'set'
|
|
344
|
+
},
|
|
345
|
+
].filter(i=>i)
|
|
346
|
+
this.setFormList = formList;
|
|
347
|
+
this.randomKey = Date.now();
|
|
348
|
+
},
|
|
349
|
+
handleSet(){
|
|
350
|
+
this.notifyConfigGet({})
|
|
351
|
+
.then(res=>{
|
|
352
|
+
if(res.data.config_result.frequency_val){
|
|
353
|
+
res.data.config_result.frequency_val = JSON.parse(res.data.config_result.frequency_val);
|
|
354
|
+
}
|
|
355
|
+
if(res.data.config_result.frequency_time_val){
|
|
356
|
+
res.data.config_result.frequency_time_val = JSON.parse(res.data.config_result.frequency_time_val);
|
|
357
|
+
}
|
|
358
|
+
this.customForm = {
|
|
359
|
+
frequency_type:res.data.config_result['frequency_type']||'',
|
|
360
|
+
frequency_val:res.data.config_result['frequency_val']||[],
|
|
361
|
+
frequency_time_val:res.data.config_result['frequency_time_val']||[],
|
|
362
|
+
};
|
|
363
|
+
let params = {
|
|
364
|
+
...res.data.config_result,
|
|
365
|
+
}
|
|
366
|
+
this.initFormList(params);
|
|
367
|
+
this.showDialog = true;
|
|
368
|
+
})
|
|
369
|
+
|
|
370
|
+
},
|
|
371
|
+
handleConfirm(){
|
|
372
|
+
this.$refs.setForm.submit().then(() => {
|
|
373
|
+
console.log(this.setFormParams,'ppp');
|
|
374
|
+
if(this.setFormParams.notify_mode==='custom'){
|
|
375
|
+
if(!this.customForm.frequency_type){
|
|
376
|
+
this.$message({
|
|
377
|
+
type: 'error',
|
|
378
|
+
message: '通知频次不能为空',
|
|
379
|
+
});
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
if(this.customForm.frequency_type==='day'){
|
|
383
|
+
if(!this.customForm.frequency_type||this.customForm.frequency_time_val.length===0){
|
|
384
|
+
this.$message({
|
|
385
|
+
type: 'error',
|
|
386
|
+
message: '请填写完整通知频次信息'
|
|
387
|
+
});
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
}else if(this.customForm.frequency_type==='week'){
|
|
391
|
+
if(!this.customForm.frequency_type||this.customForm.frequency_val.length===0||this.customForm.frequency_time_val.length===0){
|
|
392
|
+
this.$message({
|
|
393
|
+
type: 'error',
|
|
394
|
+
message: '请填写完整通知频次信息'
|
|
395
|
+
});
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
let copySetFormParams = this.$xdHelper.cloneDeep(this.setFormParams);
|
|
401
|
+
let copyCustomForm = this.$xdHelper.cloneDeep(this.customForm);
|
|
402
|
+
if(copySetFormParams.notify_mode==='default'){
|
|
403
|
+
delete copyCustomForm['frequency_type'];
|
|
404
|
+
delete copyCustomForm['frequency_val'];
|
|
405
|
+
delete copyCustomForm['frequency_time_val'];
|
|
406
|
+
}
|
|
407
|
+
if(copyCustomForm.frequency_type==='day'){
|
|
408
|
+
copyCustomForm.frequency_val = []
|
|
409
|
+
}
|
|
410
|
+
if(copyCustomForm.frequency_time_val){
|
|
411
|
+
copyCustomForm.frequency_time_val = JSON.stringify(this.customForm.frequency_time_val);
|
|
412
|
+
}
|
|
413
|
+
if(copyCustomForm.frequency_val){
|
|
414
|
+
copyCustomForm.frequency_val = JSON.stringify(this.customForm.frequency_val);
|
|
415
|
+
}
|
|
416
|
+
console.log('copySetFormParams',this.customForm, copySetFormParams)
|
|
417
|
+
this.notifyConfigSet({config_result:{...copySetFormParams,...copyCustomForm}}).then(res => {
|
|
418
|
+
this.$message({
|
|
419
|
+
type: 'success',
|
|
420
|
+
message: '设置成功'
|
|
421
|
+
});
|
|
422
|
+
this.showDialog = false;
|
|
423
|
+
}).catch(res => {});
|
|
424
|
+
}).catch(err => {});
|
|
425
|
+
|
|
426
|
+
},
|
|
184
427
|
}
|
|
185
428
|
}
|
|
186
429
|
</script>
|