jufubao-admin-library 1.1.62 → 1.1.63
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.
- package/library/viewModules/viewStat/router/productStat.js +1 -1
- package/library/viewModules/viewStat/router/supplierStat.js +1 -1
- package/library/viewModules/viewsAccounts/viewsAccounts/list.vue +45 -2
- package/library/viewModules/viewsCompany/router/mCompany.js +1 -1
- package/library/viewModules/viewsCycle/router/cycle.js +54 -0
- package/library/viewModules/viewsCycle/schemas/cycle.js +123 -0
- package/library/viewModules/viewsCycle/viewsCycle/create.vue +430 -0
- package/library/viewModules/viewsCycle/viewsCycle/list.vue +313 -0
- package/library/viewModules/viewsFinance/router/balance.js +1 -1
- package/library/viewModules/viewsFlashSale/router/flashsalem.js +1 -1
- package/library/viewModules/viewsFreightSet/router/freight_set.js +1 -1
- package/library/viewModules/viewsThird/router/third.js +1 -1
- package/package.json +2 -2
|
@@ -73,6 +73,7 @@ import XdDialog from "@/components/XdDialog.vue";
|
|
|
73
73
|
import {mapActions} from 'vuex'
|
|
74
74
|
import {createPwd} from "@/utils/xd.base";
|
|
75
75
|
import mAccounts from '@/constant/modules/mAccounts'
|
|
76
|
+
import { getOptions } from "@/utils/options"
|
|
76
77
|
|
|
77
78
|
export default {
|
|
78
79
|
name: "PartnerAccountList",
|
|
@@ -130,7 +131,8 @@ export default {
|
|
|
130
131
|
listValue: {},
|
|
131
132
|
listForm: [],
|
|
132
133
|
key: Date.now(),
|
|
133
|
-
pwdShow: 'password'
|
|
134
|
+
pwdShow: 'password',
|
|
135
|
+
subCompanyData:[],
|
|
134
136
|
}
|
|
135
137
|
},
|
|
136
138
|
|
|
@@ -159,6 +161,21 @@ export default {
|
|
|
159
161
|
}
|
|
160
162
|
|
|
161
163
|
})
|
|
164
|
+
// #ifdef saas-admin
|
|
165
|
+
getOptions({
|
|
166
|
+
server: 'saas-company',
|
|
167
|
+
fn: 'sub_company',
|
|
168
|
+
path: 'p1',
|
|
169
|
+
params:{
|
|
170
|
+
is_check_data_auth:'N'
|
|
171
|
+
}
|
|
172
|
+
}).then(res => {
|
|
173
|
+
this.subCompanyData = res.data.list
|
|
174
|
+
})
|
|
175
|
+
.catch(err=>{
|
|
176
|
+
|
|
177
|
+
})
|
|
178
|
+
// #endif
|
|
162
179
|
},
|
|
163
180
|
|
|
164
181
|
methods: {
|
|
@@ -196,6 +213,9 @@ export default {
|
|
|
196
213
|
password =form.password;
|
|
197
214
|
delete form.password;
|
|
198
215
|
}
|
|
216
|
+
if(form['sub_company_ids']){
|
|
217
|
+
form['sub_company_ids'] = JSON.stringify(form['sub_company_ids'])
|
|
218
|
+
}
|
|
199
219
|
let params = {
|
|
200
220
|
password: password,
|
|
201
221
|
user: {
|
|
@@ -336,6 +356,21 @@ export default {
|
|
|
336
356
|
],
|
|
337
357
|
},
|
|
338
358
|
// #endif
|
|
359
|
+
// #ifdef saas-admin
|
|
360
|
+
{
|
|
361
|
+
label: "数据权限:",
|
|
362
|
+
ele: "xd-select-list",
|
|
363
|
+
valueKey: "sub_company_ids",
|
|
364
|
+
value: params.sub_company_ids || [],
|
|
365
|
+
placeholder: "请选择数据权限",
|
|
366
|
+
list:this.subCompanyData,
|
|
367
|
+
multiple:true,
|
|
368
|
+
className: "input80",
|
|
369
|
+
rules: [
|
|
370
|
+
{ required: true, message: '请选择数据权限', trigger: 'blur' }
|
|
371
|
+
]
|
|
372
|
+
},
|
|
373
|
+
// #endif
|
|
339
374
|
{
|
|
340
375
|
label: '状态:',
|
|
341
376
|
ele: 'xd-radio-status',
|
|
@@ -376,6 +411,12 @@ export default {
|
|
|
376
411
|
|
|
377
412
|
handleTableClick ({ row, value, index, rowIndex }) {
|
|
378
413
|
this.user_id = row.user_id;
|
|
414
|
+
// #ifdef saas-admin
|
|
415
|
+
let copyRow = this.$xdHelper.cloneDeep(row)
|
|
416
|
+
if(row['sub_company_ids']){
|
|
417
|
+
copyRow['sub_company_ids'] = JSON.parse(row['sub_company_ids'])
|
|
418
|
+
}
|
|
419
|
+
// #endif
|
|
379
420
|
let info = {
|
|
380
421
|
user_id: row.user_id,
|
|
381
422
|
phone_number: row.phone_number,
|
|
@@ -386,7 +427,9 @@ export default {
|
|
|
386
427
|
company:[{label: row.company_name, value: row.company_id}],
|
|
387
428
|
is_show_saas: row.is_show_saas,
|
|
388
429
|
// #endif
|
|
389
|
-
|
|
430
|
+
// #ifdef saas-admin
|
|
431
|
+
sub_company_ids:copyRow.sub_company_ids||[]
|
|
432
|
+
// #endif
|
|
390
433
|
};
|
|
391
434
|
this.initForm(info);
|
|
392
435
|
this.dialog = true;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import Layout from '@/layout'
|
|
2
|
+
import roles from '@/constant/permissions' //引用权限值
|
|
3
|
+
const cycleRouter = {
|
|
4
|
+
path: '/cycle',
|
|
5
|
+
component: Layout,
|
|
6
|
+
sort: 94,
|
|
7
|
+
name: '开卡周期过滤',
|
|
8
|
+
alwaysShow: false,
|
|
9
|
+
|
|
10
|
+
meta: {
|
|
11
|
+
name: '开卡周期过滤',
|
|
12
|
+
icon: 'el-icon-s-release',
|
|
13
|
+
iconSize: 20,
|
|
14
|
+
roles: [roles.cycle.cycleList]
|
|
15
|
+
},
|
|
16
|
+
children: [
|
|
17
|
+
{
|
|
18
|
+
path: 'list',
|
|
19
|
+
name: 'cycleList',
|
|
20
|
+
component: () => import('@/viewsCycle/list'),
|
|
21
|
+
meta: {
|
|
22
|
+
title: '开卡周期过滤',
|
|
23
|
+
icon: 'el-icon-s-release',
|
|
24
|
+
roles: [roles.cycle.cycleList]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
path: 'add',
|
|
29
|
+
name: 'addCycle',
|
|
30
|
+
component: () => import('@/viewsCycle/create'),
|
|
31
|
+
hidden: true,
|
|
32
|
+
meta: {
|
|
33
|
+
title: '创建规则',
|
|
34
|
+
icon: 'el-icon-s-release',
|
|
35
|
+
activeMenu: '/cycle/list',
|
|
36
|
+
roles: [roles.cycle.cycleCreate]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
path: 'edit/:id',
|
|
41
|
+
name: 'editCycle',
|
|
42
|
+
component: () => import('@/viewsCycle/create'),
|
|
43
|
+
hidden: true,
|
|
44
|
+
meta: {
|
|
45
|
+
title: '编辑规则',
|
|
46
|
+
icon: 'el-icon-s-release',
|
|
47
|
+
activeMenu: '/cycle/list',
|
|
48
|
+
roles: [roles.cycle.cycleUpdate]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default cycleRouter
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
name: 'cycle',
|
|
5
|
+
title: '卡周期过滤',
|
|
6
|
+
vuex: true,
|
|
7
|
+
model: [
|
|
8
|
+
{
|
|
9
|
+
title: '卡周期过滤 - 列表',
|
|
10
|
+
mapFn: "cycleList",
|
|
11
|
+
path: '/product-partner/v1/:xsiteid/:xnamespace/card-cycle-filters',
|
|
12
|
+
isRule: false,
|
|
13
|
+
params: {
|
|
14
|
+
xsiteid: ['站点Id', 'String', '必填'],
|
|
15
|
+
xnamespace: ['命名空间', 'String', '必填'],
|
|
16
|
+
page_size: ['page_size', 'String', '必填'],
|
|
17
|
+
page_token: ['page_token', 'String', '必填'],
|
|
18
|
+
card_number: ['卡号', 'String', ''],
|
|
19
|
+
rule_name: ['规则名称', 'String', ''],
|
|
20
|
+
status: ['状态', 'String', ''],
|
|
21
|
+
},
|
|
22
|
+
disabled: true,
|
|
23
|
+
// #ifdef partner-movie
|
|
24
|
+
role: "ROLE_MOVIE_CYCLE_FILTER_LIST",
|
|
25
|
+
// #endif
|
|
26
|
+
// #ifdef partner-mall
|
|
27
|
+
role: "ROLE_MALL_CYCLE_FILTER_LIST"
|
|
28
|
+
// #endif
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: '卡周期过滤 - 详情',
|
|
32
|
+
mapFn: "cycleDetail",
|
|
33
|
+
path: '/product-partner/v1/:xsiteid/:xnamespace/card-cycle-filter/:id',
|
|
34
|
+
isRule: false,
|
|
35
|
+
params: {
|
|
36
|
+
xsiteid: ['站点Id', 'String', '必填'],
|
|
37
|
+
xnamespace: ['命名空间', 'String', '必填'],
|
|
38
|
+
id: ['id', 'String', '是']
|
|
39
|
+
},
|
|
40
|
+
disabled: true,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: "卡周期过滤 - 创建",
|
|
44
|
+
mapFn: "cycleCreate",
|
|
45
|
+
path: "/product-partner/v1/:xsiteid/:xnamespace/card-cycle-filter",
|
|
46
|
+
isRule: false,
|
|
47
|
+
data: {
|
|
48
|
+
xsiteid: ['站点Id', 'String', '必填'],
|
|
49
|
+
xnamespace: ['命名空间', 'String', '必填'],
|
|
50
|
+
item: {
|
|
51
|
+
rule_name: ['规则名称', 'String', '必填'],
|
|
52
|
+
comment: ['规则描述', 'String', '必填'],
|
|
53
|
+
status: ['状态', 'String', '必填'],
|
|
54
|
+
sort: ['权重', 'String', '必填'],
|
|
55
|
+
card_numbers: ['卡号', 'String', '必填'],
|
|
56
|
+
rule_data: ['规则', 'String', '必填']
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
disabled: true,
|
|
60
|
+
// #ifdef partner-movie
|
|
61
|
+
role: "ROLE_MOVIE_CYCLE_FILTER_ADD",
|
|
62
|
+
// #endif
|
|
63
|
+
// #ifdef partner-mall
|
|
64
|
+
role: "ROLE_MALL_CYCLE_FILTER_ADD"
|
|
65
|
+
// #endif
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
title: "卡周期过滤 - 修改",
|
|
69
|
+
mapFn: "cycleUpdate",
|
|
70
|
+
path: "/product-partner/v1/:xsiteid/:xnamespace/card-cycle-filter/:id",
|
|
71
|
+
isRule: false,
|
|
72
|
+
data: {
|
|
73
|
+
xsiteid: ['站点Id', 'String', '必填'],
|
|
74
|
+
xnamespace: ['命名空间', 'String', '必填'],
|
|
75
|
+
item: {
|
|
76
|
+
rule_name: ['规则名称', 'String', '必填'],
|
|
77
|
+
comment: ['规则描述', 'String', '必填'],
|
|
78
|
+
id: ['id', 'String', '必填'],
|
|
79
|
+
status: ['状态', 'String', '必填'],
|
|
80
|
+
sort: ['权重', 'String', '必填'],
|
|
81
|
+
card_numbers: ['卡号', 'String', '必填'],
|
|
82
|
+
rule_data: ['规则', 'String', '必填']
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
method: "PUT",
|
|
86
|
+
disabled: true,
|
|
87
|
+
// #ifdef partner-movie
|
|
88
|
+
role: "ROLE_MOVIE_CYCLE_FILTER_UPDATE",
|
|
89
|
+
// #endif
|
|
90
|
+
// #ifdef partner-mall
|
|
91
|
+
role: "ROLE_MALL_CYCLE_FILTER_UPDATE"
|
|
92
|
+
// #endif
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
title: '卡周期过滤 - 发布',
|
|
96
|
+
mapFn: "cyclePublish",
|
|
97
|
+
path: '/product-partner/v1/:xsiteid/:xnamespace/card-cycle-filter/publish',
|
|
98
|
+
isRule: false,
|
|
99
|
+
data: {
|
|
100
|
+
xsiteid: ['站点Id', 'String', '必填'],
|
|
101
|
+
xnamespace: ['命名空间', 'String', '必填'],
|
|
102
|
+
},
|
|
103
|
+
disabled: true,
|
|
104
|
+
// #ifdef partner-movie
|
|
105
|
+
role: "ROLE_MOVIE_CYCLE_FILTER_PUBLISH",
|
|
106
|
+
// #endif
|
|
107
|
+
// #ifdef partner-mall
|
|
108
|
+
role: "ROLE_MALL_CYCLE_FILTER_PUBLISH",
|
|
109
|
+
// #endif
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
title: '卡周期过滤 - 记录详情',
|
|
113
|
+
mapFn: "cycleLogDetail",
|
|
114
|
+
path: '/product-partner/v1/:xsiteid/:xnamespace/policy-history/:id',
|
|
115
|
+
isRule: false,
|
|
116
|
+
params: {
|
|
117
|
+
xsiteid: ['站点Id', 'String', '必填'],
|
|
118
|
+
xnamespace: ['命名空间', 'String', '必填'],
|
|
119
|
+
},
|
|
120
|
+
disabled: true,
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
}
|
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="app-container">
|
|
3
|
+
<el-card class="app-container__list">
|
|
4
|
+
<xd-base-dynamic-field
|
|
5
|
+
v-if="formList !== null"
|
|
6
|
+
ref="form"
|
|
7
|
+
v-model="formParams"
|
|
8
|
+
label-width="150px"
|
|
9
|
+
:list="formList"
|
|
10
|
+
:key="renderFormKey"
|
|
11
|
+
size="medium"
|
|
12
|
+
@success="handleSuccess"
|
|
13
|
+
@onApiSuccessUrl="handleApiSuccessUrl"
|
|
14
|
+
@onGetParamsAndHeader="handleGetParamsAndHeader"
|
|
15
|
+
>
|
|
16
|
+
<template slot-scope="scope" slot="custom">
|
|
17
|
+
<el-form ref="form" :model="customForm" label-width="80px">
|
|
18
|
+
<el-form-item
|
|
19
|
+
class="custom-form-item"
|
|
20
|
+
v-for="(item, index) in customForm"
|
|
21
|
+
:key="index"
|
|
22
|
+
>
|
|
23
|
+
<span style="margin-right: 10px">开卡后</span>
|
|
24
|
+
<el-input
|
|
25
|
+
style="width: 100px"
|
|
26
|
+
v-model="item.day"
|
|
27
|
+
placeholder="请填写"
|
|
28
|
+
></el-input>
|
|
29
|
+
<span style="margin-left: 10px">天后,根据</span>
|
|
30
|
+
<span style="color: red">进货价/售价</span>
|
|
31
|
+
<span style="margin-right: 10px">展示</span>
|
|
32
|
+
<el-input
|
|
33
|
+
style="width: 100px"
|
|
34
|
+
v-model="item.discount_ratio"
|
|
35
|
+
placeholder="请填写"
|
|
36
|
+
></el-input>
|
|
37
|
+
<span style="margin-left: 10px">折以内的商品</span>
|
|
38
|
+
<div style="margin-left: 10px" class="">
|
|
39
|
+
<el-link
|
|
40
|
+
:underline="false"
|
|
41
|
+
type="primary"
|
|
42
|
+
icon="el-icon-circle-plus"
|
|
43
|
+
style="font-size: 26px"
|
|
44
|
+
@click="addItem"
|
|
45
|
+
v-if="index === customForm.length - 1"
|
|
46
|
+
></el-link>
|
|
47
|
+
<el-link
|
|
48
|
+
:underline="false"
|
|
49
|
+
type="danger"
|
|
50
|
+
icon="el-icon-remove"
|
|
51
|
+
style="font-size: 26px"
|
|
52
|
+
@click="removeItem(index)"
|
|
53
|
+
v-if="customForm.length > 1"
|
|
54
|
+
></el-link>
|
|
55
|
+
</div>
|
|
56
|
+
</el-form-item>
|
|
57
|
+
</el-form>
|
|
58
|
+
</template>
|
|
59
|
+
</xd-base-dynamic-field>
|
|
60
|
+
<div style="padding-left: 150px">
|
|
61
|
+
<el-button @click="goBack" type="primary">返回</el-button>
|
|
62
|
+
<el-button v-if="!isView" @click="handleConfirm" type="primary"
|
|
63
|
+
>保存</el-button
|
|
64
|
+
>
|
|
65
|
+
</div>
|
|
66
|
+
</el-card>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
<script>
|
|
72
|
+
import XdBaseDynamicField from "@/components/XdBaseDynamicField";
|
|
73
|
+
import { getOptions } from "@/utils/options";
|
|
74
|
+
import { Loading } from "element-ui";
|
|
75
|
+
import checkPermission from "@/utils/permission";
|
|
76
|
+
import { mapActions, mapState } from "vuex";
|
|
77
|
+
|
|
78
|
+
export default {
|
|
79
|
+
name: "pontAdd",
|
|
80
|
+
components: {
|
|
81
|
+
XdBaseDynamicField,
|
|
82
|
+
},
|
|
83
|
+
watch: {},
|
|
84
|
+
data() {
|
|
85
|
+
return {
|
|
86
|
+
formList: null,
|
|
87
|
+
formParams: {},
|
|
88
|
+
id: null,
|
|
89
|
+
renderFormKey: Date.now(),
|
|
90
|
+
customForm: [
|
|
91
|
+
{
|
|
92
|
+
day: "",
|
|
93
|
+
discount_ratio: "",
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
type: "",
|
|
97
|
+
isView: false,
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
created() {
|
|
101
|
+
this.id = this.$route.params.id;
|
|
102
|
+
this.type = this.$route.query.editType;
|
|
103
|
+
this.isView = this.$route.query.isView;
|
|
104
|
+
|
|
105
|
+
if (this.id) {
|
|
106
|
+
let params = {
|
|
107
|
+
id: this.id,
|
|
108
|
+
type: this.type,
|
|
109
|
+
};
|
|
110
|
+
if (this.isView) {
|
|
111
|
+
this.cycleLogDetail(params)
|
|
112
|
+
.then((res) => {
|
|
113
|
+
console.log(res, "aaaaaa");
|
|
114
|
+
this.customForm = res.data.card_cycle_filter.rule_data;
|
|
115
|
+
this.customForm = this.customForm.map((item) => {
|
|
116
|
+
item.discount_ratio = item.discount_ratio / 100;
|
|
117
|
+
return item;
|
|
118
|
+
});
|
|
119
|
+
this.initFormList(res.data.card_cycle_filter);
|
|
120
|
+
})
|
|
121
|
+
.catch((err) => {
|
|
122
|
+
console.log(err, "err");
|
|
123
|
+
});
|
|
124
|
+
} else {
|
|
125
|
+
this.cycleDetail(params)
|
|
126
|
+
.then((res) => {
|
|
127
|
+
console.log(res, "aaaaaa");
|
|
128
|
+
this.customForm = res.data.rule_data;
|
|
129
|
+
this.customForm = this.customForm.map((item) => {
|
|
130
|
+
item.discount_ratio = item.discount_ratio / 100;
|
|
131
|
+
return item;
|
|
132
|
+
});
|
|
133
|
+
this.initFormList(res.data);
|
|
134
|
+
})
|
|
135
|
+
.catch((err) => {
|
|
136
|
+
console.log(err, "err");
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
} else {
|
|
140
|
+
this.initFormList({});
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
methods: {
|
|
145
|
+
...mapActions("cycle", [
|
|
146
|
+
"cycleCreate",
|
|
147
|
+
"cycleDetail",
|
|
148
|
+
"cycleUpdate",
|
|
149
|
+
"cycleLogDetail",
|
|
150
|
+
]),
|
|
151
|
+
initFormList(params, isWitch) {
|
|
152
|
+
console.log(params, "params");
|
|
153
|
+
let formList = [
|
|
154
|
+
{
|
|
155
|
+
ele: "title",
|
|
156
|
+
label: "基础信息",
|
|
157
|
+
size: "mini",
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
label: "规则名称:", //label
|
|
161
|
+
ele: "el-input", //package 名称
|
|
162
|
+
type: "text",
|
|
163
|
+
valueKey: "rule_name", //form[valueKey]
|
|
164
|
+
value: params.rule_name || "", //v-model
|
|
165
|
+
placeholder: "输入规则名称",
|
|
166
|
+
classNmae: "input40",
|
|
167
|
+
rules: [
|
|
168
|
+
{
|
|
169
|
+
required: true,
|
|
170
|
+
message: "请输入规则名称",
|
|
171
|
+
trigger: "blur",
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
label: "规则描述:", //label
|
|
177
|
+
ele: "el-input", //package 名称
|
|
178
|
+
type: "textarea",
|
|
179
|
+
valueKey: "comment", //form[valueKey]
|
|
180
|
+
value: params.comment || "", //v-model
|
|
181
|
+
placeholder: "输入规则描述",
|
|
182
|
+
classNmae: "input40",
|
|
183
|
+
rules: [
|
|
184
|
+
{
|
|
185
|
+
required: true,
|
|
186
|
+
message: "请输入规则描述",
|
|
187
|
+
trigger: "blur",
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
label: "权重值:", //label
|
|
193
|
+
ele: "el-input", //package 名称
|
|
194
|
+
type: "number",
|
|
195
|
+
valueKey: "sort", //form[valueKey]
|
|
196
|
+
value: params.sort || "", //v-model
|
|
197
|
+
placeholder: "输入权重值",
|
|
198
|
+
classNmae: "input40",
|
|
199
|
+
rules: [
|
|
200
|
+
{
|
|
201
|
+
required: this.id ? false : true,
|
|
202
|
+
message: "请输入权重值",
|
|
203
|
+
trigger: "blur",
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
label: "规则状态:", //label
|
|
209
|
+
ele: "xd-radio",
|
|
210
|
+
valueKey: "status", //form[valueKey]
|
|
211
|
+
value: params.status || "Y", //v-model
|
|
212
|
+
placeholder: "请选择规则状态",
|
|
213
|
+
list: [
|
|
214
|
+
{
|
|
215
|
+
label: "启用",
|
|
216
|
+
value: "Y",
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
label: "禁用",
|
|
220
|
+
value: "N",
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
rules: [
|
|
224
|
+
{
|
|
225
|
+
required: true,
|
|
226
|
+
message: "请选择规则状态",
|
|
227
|
+
trigger: ["blur", "change"],
|
|
228
|
+
},
|
|
229
|
+
],
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
ele: "title",
|
|
233
|
+
label: "号段配置",
|
|
234
|
+
size: "mini",
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
label: "涉及号段:", //label
|
|
238
|
+
tips: "注意:开始和结束卡号段必须填写,并且开始卡号必须小于结束开号.",
|
|
239
|
+
ele: "xd-range-group", //package 名称
|
|
240
|
+
keys: ["start_number", "end_number"], //返回数组字段名称
|
|
241
|
+
defaultValue: params.card_numbers,
|
|
242
|
+
valueKey: "card_numbers", //form[valueKey]
|
|
243
|
+
placeholder: ["开始卡号", "结束卡号"],
|
|
244
|
+
rules: [
|
|
245
|
+
{
|
|
246
|
+
required: true,
|
|
247
|
+
validator(rule, value, callback) {
|
|
248
|
+
let flag = true,
|
|
249
|
+
index = null,
|
|
250
|
+
message = "";
|
|
251
|
+
value.map((item, idx) => {
|
|
252
|
+
if (index === null) {
|
|
253
|
+
//检查卡号填写为空
|
|
254
|
+
Object.keys(item).map((k) => {
|
|
255
|
+
if (item[k] === null) {
|
|
256
|
+
index = idx;
|
|
257
|
+
flag = false;
|
|
258
|
+
message = "卡号输入不能为空!";
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
//检查开始卡号不能大于等于结束卡号
|
|
263
|
+
if (index === null) {
|
|
264
|
+
if (item["start_number"] >= item["end_number"]) {
|
|
265
|
+
index = idx;
|
|
266
|
+
flag = false;
|
|
267
|
+
message = "输入开始卡号不能大于等于结束卡号";
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
if (flag) callback();
|
|
274
|
+
else callback(`第【${index + 1}】条数据有误,错误:${message}`);
|
|
275
|
+
|
|
276
|
+
// let temp = false;
|
|
277
|
+
// if (!value['week_day'] || value['week_day'].length === 0) temp = true;
|
|
278
|
+
// if (!value['week_start'] || !value['week_end']) temp = true;
|
|
279
|
+
// if (temp) callback('请设置规则')
|
|
280
|
+
// else callback();
|
|
281
|
+
},
|
|
282
|
+
trigger: ["blur", "change"],
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
ele: "title",
|
|
288
|
+
label: "规则配置",
|
|
289
|
+
size: "mini",
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
label: "",
|
|
293
|
+
ele: "slot",
|
|
294
|
+
slot: "custom",
|
|
295
|
+
},
|
|
296
|
+
];
|
|
297
|
+
this.formList = formList.filter((i) => i);
|
|
298
|
+
this.renderFormKey = Date.now();
|
|
299
|
+
},
|
|
300
|
+
|
|
301
|
+
handleConfirm() {
|
|
302
|
+
console.log(this.formParams, "formParams");
|
|
303
|
+
if (!this.customForm.length) {
|
|
304
|
+
this.$message({
|
|
305
|
+
type: "error",
|
|
306
|
+
message: "请添加规则",
|
|
307
|
+
});
|
|
308
|
+
return;
|
|
309
|
+
} else {
|
|
310
|
+
if (this.hasDuplicate(this.customForm)) {
|
|
311
|
+
this.$message({
|
|
312
|
+
type: "error",
|
|
313
|
+
message: "天数不能重复",
|
|
314
|
+
});
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
const regex = /^[1-9]\d*$/;
|
|
318
|
+
const regex2 = /^\d+(?:\.\d+)?$/;
|
|
319
|
+
for (let index = 0; index < this.customForm.length; index++) {
|
|
320
|
+
if (!regex.test(this.customForm[index].day)) {
|
|
321
|
+
this.$message({
|
|
322
|
+
type: "error",
|
|
323
|
+
message: "请输入正整数",
|
|
324
|
+
});
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
if (!regex2.test(this.customForm[index].discount_ratio)) {
|
|
328
|
+
this.$message({
|
|
329
|
+
type: "error",
|
|
330
|
+
message: "请输入正数",
|
|
331
|
+
});
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
if (this.customForm[index].day > 999) {
|
|
335
|
+
this.$message({
|
|
336
|
+
type: "error",
|
|
337
|
+
message: "请输入小于999的数字",
|
|
338
|
+
});
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
if (!this.customForm[index].discount_ratio) {
|
|
342
|
+
this.$message({
|
|
343
|
+
type: "error",
|
|
344
|
+
message: "请输入折扣",
|
|
345
|
+
});
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
this.$refs.form.submit().then((res) => {
|
|
351
|
+
let data = {
|
|
352
|
+
item: this.formParams,
|
|
353
|
+
};
|
|
354
|
+
data.item.rule_data = this.$xdHelper
|
|
355
|
+
.cloneDeep(this.customForm)
|
|
356
|
+
.map((item) => {
|
|
357
|
+
item.discount_ratio = item.discount_ratio * 100;
|
|
358
|
+
return item;
|
|
359
|
+
});
|
|
360
|
+
let loading = Loading.service({});
|
|
361
|
+
if (this.id) {
|
|
362
|
+
data.id = this.id;
|
|
363
|
+
this.cycleUpdate(data)
|
|
364
|
+
.then((res) => {
|
|
365
|
+
this.$message({
|
|
366
|
+
type: "success",
|
|
367
|
+
message: "编辑成功",
|
|
368
|
+
});
|
|
369
|
+
loading.close();
|
|
370
|
+
this.$bus.$emit("delTags", this.$route, {}, "systemApplyList");
|
|
371
|
+
})
|
|
372
|
+
.catch((err) => {
|
|
373
|
+
loading.close();
|
|
374
|
+
console.log(err, "err");
|
|
375
|
+
});
|
|
376
|
+
} else {
|
|
377
|
+
this.cycleCreate(data)
|
|
378
|
+
.then((res) => {
|
|
379
|
+
this.$message({
|
|
380
|
+
type: "success",
|
|
381
|
+
message: "添加成功",
|
|
382
|
+
});
|
|
383
|
+
loading.close();
|
|
384
|
+
this.$bus.$emit("delTags", this.$route, {}, "systemApplyList");
|
|
385
|
+
})
|
|
386
|
+
.catch((err) => {
|
|
387
|
+
loading.close();
|
|
388
|
+
console.log(err, "err");
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
},
|
|
393
|
+
|
|
394
|
+
hasDuplicate(arr) {
|
|
395
|
+
for (var i = 0; i < arr.length; i++) {
|
|
396
|
+
for (var j = i + 1; j < arr.length; j++) {
|
|
397
|
+
if (Number(arr[i].day) === Number(arr[j].day)) {
|
|
398
|
+
return true;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
return false;
|
|
403
|
+
},
|
|
404
|
+
|
|
405
|
+
addItem() {
|
|
406
|
+
let temp;
|
|
407
|
+
temp = {
|
|
408
|
+
day: "",
|
|
409
|
+
discount_ratio: "",
|
|
410
|
+
};
|
|
411
|
+
this.customForm.push(temp);
|
|
412
|
+
},
|
|
413
|
+
|
|
414
|
+
removeItem(index) {
|
|
415
|
+
this.customForm.splice(index, 1);
|
|
416
|
+
},
|
|
417
|
+
|
|
418
|
+
goBack() {
|
|
419
|
+
this.$router.replace("/cycle/list");
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
};
|
|
423
|
+
</script>
|
|
424
|
+
|
|
425
|
+
<style scoped lang="scss">
|
|
426
|
+
.custom-form-item ::v-deep .el-form-item__content {
|
|
427
|
+
display: flex;
|
|
428
|
+
}
|
|
429
|
+
</style>
|
|
430
|
+
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="app-container">
|
|
3
|
+
<el-card class="app-container__search">
|
|
4
|
+
<xd-search
|
|
5
|
+
time-type
|
|
6
|
+
dateFilter
|
|
7
|
+
:picker-options="{}"
|
|
8
|
+
v-if="searchForm.length > 0"
|
|
9
|
+
v-model="searchParams"
|
|
10
|
+
:list="searchForm"
|
|
11
|
+
@onSearch="handleSearch"
|
|
12
|
+
>
|
|
13
|
+
</xd-search>
|
|
14
|
+
</el-card>
|
|
15
|
+
<el-card class="app-container__list">
|
|
16
|
+
<div class="app-container__list-pagination">
|
|
17
|
+
<div>
|
|
18
|
+
<el-button type="primary" v-if="isAdd" @click="toAdd">添加规则</el-button>
|
|
19
|
+
<el-button type="primary" v-if="isPublish" :disabled="!tables.length" @click="toPublish">发布</el-button>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="app-container__list-table">
|
|
23
|
+
<xd-table
|
|
24
|
+
is-border
|
|
25
|
+
:headers="headers"
|
|
26
|
+
:list="tables"
|
|
27
|
+
@onClick="handleBtnClick"
|
|
28
|
+
>
|
|
29
|
+
<template slot="card_numbers" slot-scope="scope">
|
|
30
|
+
<div v-for="(item, index) in scope.row.card_numbers" :key="index">
|
|
31
|
+
{{ item.start_number }}-{{ item.end_number }}
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
</xd-table>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="app-container__list-pagination">
|
|
37
|
+
<xd-pagination
|
|
38
|
+
:total="total"
|
|
39
|
+
:limit.sync="limit"
|
|
40
|
+
:page="pageSize"
|
|
41
|
+
:auto-scroll="false"
|
|
42
|
+
@onPagination="handlePagination"
|
|
43
|
+
></xd-pagination>
|
|
44
|
+
</div>
|
|
45
|
+
</el-card>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script>
|
|
50
|
+
import XdPagination from "@/components/XdPagination.vue";
|
|
51
|
+
import XdTable from "@/components/XdTable";
|
|
52
|
+
import XdSearch from "@/components/XdSearch";
|
|
53
|
+
import { mapActions, mapState } from "vuex";
|
|
54
|
+
import { getOptions } from "@/utils/options";
|
|
55
|
+
import checkPermission from "@/utils/permission"
|
|
56
|
+
import Role from "@/constant/modules/cycle"
|
|
57
|
+
|
|
58
|
+
export default {
|
|
59
|
+
name: "PageTasksList",
|
|
60
|
+
components: {
|
|
61
|
+
XdPagination, //翻译插件
|
|
62
|
+
XdTable,
|
|
63
|
+
XdSearch,
|
|
64
|
+
},
|
|
65
|
+
data() {
|
|
66
|
+
return {
|
|
67
|
+
Role,
|
|
68
|
+
//搜索
|
|
69
|
+
searchForm: [], //搜索区域模块表单
|
|
70
|
+
searchParams: {}, //搜索参数
|
|
71
|
+
|
|
72
|
+
//分页参数
|
|
73
|
+
pageSize: 1, //当前页面数量
|
|
74
|
+
limit: 20, //搜索参数
|
|
75
|
+
total: 0,
|
|
76
|
+
|
|
77
|
+
//列表对象
|
|
78
|
+
tables: [],
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
computed: {
|
|
82
|
+
headers() {
|
|
83
|
+
return [
|
|
84
|
+
{
|
|
85
|
+
type: "normal",
|
|
86
|
+
prop: "id",
|
|
87
|
+
align: "center",
|
|
88
|
+
width: 120,
|
|
89
|
+
label: "ID",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
type: "normal",
|
|
93
|
+
prop: "rule_name",
|
|
94
|
+
align: "center",
|
|
95
|
+
minWidth: 200,
|
|
96
|
+
label: "规则名称",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
type: "normal",
|
|
100
|
+
prop: "comment",
|
|
101
|
+
align: "center",
|
|
102
|
+
width: 200,
|
|
103
|
+
label: "规则描述",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: "normal",
|
|
107
|
+
prop: "card_numbers",
|
|
108
|
+
align: "center",
|
|
109
|
+
width: 180,
|
|
110
|
+
label: "生效号段",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: "normal",
|
|
114
|
+
prop: "sort",
|
|
115
|
+
align: "center",
|
|
116
|
+
width: 200,
|
|
117
|
+
label: "权重",
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
type: "status",
|
|
121
|
+
prop: "status",
|
|
122
|
+
align: "center",
|
|
123
|
+
width: 100,
|
|
124
|
+
label: "状态",
|
|
125
|
+
message: ["启用", "禁用"],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
type: "normal",
|
|
129
|
+
prop: "updated_time",
|
|
130
|
+
align: "center",
|
|
131
|
+
width: 190,
|
|
132
|
+
label: "修改时间",
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: "normal",
|
|
136
|
+
prop: "op_username",
|
|
137
|
+
align: "center",
|
|
138
|
+
width: 100,
|
|
139
|
+
label: "操作人",
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
type: "operate",
|
|
143
|
+
align: "center",
|
|
144
|
+
prop: "operate",
|
|
145
|
+
width: 130,
|
|
146
|
+
isCheckHide: true,
|
|
147
|
+
label: "操作",
|
|
148
|
+
values: [
|
|
149
|
+
checkPermission([Role.cycleUpdate]) &&{ ui: "text-button", name: "编辑", type: "text", event: "edit" },
|
|
150
|
+
{
|
|
151
|
+
ui: "text-button",
|
|
152
|
+
name: "修改记录",
|
|
153
|
+
type: "text",
|
|
154
|
+
event: "logs",
|
|
155
|
+
},
|
|
156
|
+
].filter(i=>i)
|
|
157
|
+
},
|
|
158
|
+
].filter(i=>i)
|
|
159
|
+
},
|
|
160
|
+
isAdd(){
|
|
161
|
+
return checkPermission([Role.cycleCreate])
|
|
162
|
+
},
|
|
163
|
+
isPublish() {
|
|
164
|
+
return checkPermission([Role.cyclePublish])
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
created() {
|
|
168
|
+
this.getList();
|
|
169
|
+
this.initSearchForm();
|
|
170
|
+
},
|
|
171
|
+
methods: {
|
|
172
|
+
...mapActions("cycle", ["cycleList", "cyclePublish"]),
|
|
173
|
+
/**
|
|
174
|
+
* @description 点击按钮操作
|
|
175
|
+
* @param value {Object} 按钮对象
|
|
176
|
+
* @param row {Object} 行对象
|
|
177
|
+
*/
|
|
178
|
+
handleBtnClick({ value, row }) {
|
|
179
|
+
if (value.event === "edit") {
|
|
180
|
+
this.$router.push({
|
|
181
|
+
path: `/cycle/edit/${row.id}`,
|
|
182
|
+
});
|
|
183
|
+
} else if(value.event === "logs") {
|
|
184
|
+
this.$router.push({
|
|
185
|
+
path: `/editLog/edit-log/${row.id}?type=CF`,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
onJfbTagForReload () {
|
|
191
|
+
this.getList()
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
toAdd() {
|
|
195
|
+
this.$router.push("/cycle/add");
|
|
196
|
+
},
|
|
197
|
+
|
|
198
|
+
toPublish() {
|
|
199
|
+
this.cyclePublish()
|
|
200
|
+
.then((res) => {
|
|
201
|
+
this.$message.success('发布成功')
|
|
202
|
+
loading.close();
|
|
203
|
+
})
|
|
204
|
+
.catch((err) => {
|
|
205
|
+
loading.close();
|
|
206
|
+
});
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* @description 获取数据列表
|
|
211
|
+
*/
|
|
212
|
+
getList() {
|
|
213
|
+
let params = {
|
|
214
|
+
page_token: this.pageSize,
|
|
215
|
+
page_size: this.limit,
|
|
216
|
+
...this.searchParams,
|
|
217
|
+
};
|
|
218
|
+
let loading = this.$loading({});
|
|
219
|
+
this.cycleList(params)
|
|
220
|
+
.then((res) => {
|
|
221
|
+
const { list, total_size } = res.data;
|
|
222
|
+
this.tables = list.map((item) => {
|
|
223
|
+
Object.assign(item, {
|
|
224
|
+
updated_time: getTimeFormat(item.updated_time),
|
|
225
|
+
});
|
|
226
|
+
return item;
|
|
227
|
+
});
|
|
228
|
+
this.total = total_size;
|
|
229
|
+
loading.close();
|
|
230
|
+
})
|
|
231
|
+
.catch((err) => {
|
|
232
|
+
loading.close();
|
|
233
|
+
});
|
|
234
|
+
},
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* @description 点击搜索进行搜索操作
|
|
238
|
+
* @param action 动作
|
|
239
|
+
* @param form 搜索请求参数
|
|
240
|
+
*/
|
|
241
|
+
handleSearch({ action, form }) {
|
|
242
|
+
this.page_token = 1;
|
|
243
|
+
this.getList();
|
|
244
|
+
},
|
|
245
|
+
/**
|
|
246
|
+
* @description 初始化搜索模块
|
|
247
|
+
*/
|
|
248
|
+
initSearchForm() {
|
|
249
|
+
this.searchForm = [
|
|
250
|
+
{
|
|
251
|
+
label: "卡号",
|
|
252
|
+
ele: "el-input",
|
|
253
|
+
valueKey: "card_number",
|
|
254
|
+
value: "",
|
|
255
|
+
placeholder: "请输入卡号",
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
label: "规则名称",
|
|
259
|
+
ele: "el-input",
|
|
260
|
+
valueKey: "rule_name",
|
|
261
|
+
value: "",
|
|
262
|
+
placeholder: "请输入规则名称",
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
label: "规则状态:",
|
|
266
|
+
ele: "xd-select-list",
|
|
267
|
+
valueKey: "status",
|
|
268
|
+
value: "",
|
|
269
|
+
placeholder: "请选择规则状态",
|
|
270
|
+
list: [
|
|
271
|
+
{
|
|
272
|
+
label: "启用",
|
|
273
|
+
value: "Y",
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
label: "禁用",
|
|
277
|
+
value: "N",
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
},
|
|
281
|
+
];
|
|
282
|
+
},
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* @description 翻页处理方法
|
|
286
|
+
* @param page {Number} 访问页面页码数
|
|
287
|
+
*/
|
|
288
|
+
handlePagination(page) {
|
|
289
|
+
this.pageSize = page;
|
|
290
|
+
this.getList();
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
};
|
|
294
|
+
</script>
|
|
295
|
+
|
|
296
|
+
<style scoped lang="less">
|
|
297
|
+
.xd-table {
|
|
298
|
+
.el-button {
|
|
299
|
+
margin: 0 auto;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.app-container__list-pagination-left {
|
|
304
|
+
display: flex;
|
|
305
|
+
justify-content: flex-start;
|
|
306
|
+
align-items: center;
|
|
307
|
+
font-size: 14px;
|
|
308
|
+
& > i {
|
|
309
|
+
margin-right: 5px;
|
|
310
|
+
font-size: 18px;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
</style>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jufubao-admin-library",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.63",
|
|
4
4
|
"description": "聚福宝福利后台管理系统公共模块",
|
|
5
5
|
"author": "goashiyong <gaoshiyong1272@vip.163.com>",
|
|
6
6
|
"scripts": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"element-ui": "2.13.2",
|
|
30
30
|
"gxd-file-preview": "1.2.1",
|
|
31
31
|
"gxd-helper": "2.0.21",
|
|
32
|
-
"gxd-vue-library": "1.1.
|
|
32
|
+
"gxd-vue-library": "1.1.133",
|
|
33
33
|
"js-base64": "^3.4.5",
|
|
34
34
|
"js-cookie": "2.2.0",
|
|
35
35
|
"md5": "^2.3.0",
|