leisure-core 0.4.8 → 0.4.9
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/le-promotions-activities/src/sub.vue +10 -2
- package/le-user/src/add.vue +85 -21
- package/le-user/src/main.vue +14 -3
- package/package.json +1 -1
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
<el-form-item label="活动标题" prop="title">
|
|
4
4
|
<el-input v-model="form.title"></el-input>
|
|
5
5
|
</el-form-item>
|
|
6
|
-
<el-form-item label="
|
|
7
|
-
<el-select v-model="form.ptype" placeholder="
|
|
6
|
+
<el-form-item label="适用公式" prop="ptype">
|
|
7
|
+
<el-select v-model="form.ptype" placeholder="请选择公式">
|
|
8
8
|
<el-option
|
|
9
9
|
v-for="item in pTypeOptions"
|
|
10
10
|
:label="item.name"
|
|
@@ -39,6 +39,12 @@
|
|
|
39
39
|
>
|
|
40
40
|
</el-date-picker>
|
|
41
41
|
</el-form-item>
|
|
42
|
+
<el-form-item label="活动类别">
|
|
43
|
+
<el-select v-model="form.category">
|
|
44
|
+
<el-option label="正常促销" :value="0" :key="0"></el-option>
|
|
45
|
+
<el-option label="秒杀" :value="1" :key="1"></el-option>
|
|
46
|
+
</el-select>
|
|
47
|
+
</el-form-item>
|
|
42
48
|
<el-form-item label="是否启用">
|
|
43
49
|
<el-select v-model="form.released">
|
|
44
50
|
<el-option label="是" value="1" key="1"></el-option>
|
|
@@ -82,6 +88,7 @@ export default {
|
|
|
82
88
|
id: "",
|
|
83
89
|
title: "",
|
|
84
90
|
ptype: "",
|
|
91
|
+
category: 0,
|
|
85
92
|
pname: "",
|
|
86
93
|
date_start: "",
|
|
87
94
|
date_end: "",
|
|
@@ -127,6 +134,7 @@ export default {
|
|
|
127
134
|
this.form.date_end = new Date(this.rowData.date_end * 1000);
|
|
128
135
|
this.form.is_used_coupon = "1";
|
|
129
136
|
this.form.is_used_integral = "1";
|
|
137
|
+
this.form.category = 1;
|
|
130
138
|
this.form.released = this.form.released.toString();
|
|
131
139
|
if (this.form.grang == 2) {
|
|
132
140
|
let products = this.form.grang_product;
|
package/le-user/src/add.vue
CHANGED
|
@@ -20,6 +20,26 @@
|
|
|
20
20
|
></el-option>
|
|
21
21
|
</el-select>
|
|
22
22
|
</el-form-item> -->
|
|
23
|
+
<el-form-item label="所属商家" v-if="this.$stype == 'multiple'">
|
|
24
|
+
<el-select
|
|
25
|
+
v-model="form.bid"
|
|
26
|
+
placeholder="请选择商家"
|
|
27
|
+
clearable
|
|
28
|
+
filterable
|
|
29
|
+
remote
|
|
30
|
+
reserve-keyword
|
|
31
|
+
:remote-method="getMallBusiness"
|
|
32
|
+
style="display: block; width: 100%"
|
|
33
|
+
>
|
|
34
|
+
<el-option
|
|
35
|
+
v-for="item in boptions"
|
|
36
|
+
:label="item.bname"
|
|
37
|
+
:value="item.id"
|
|
38
|
+
:key="item.id"
|
|
39
|
+
>
|
|
40
|
+
</el-option>
|
|
41
|
+
</el-select>
|
|
42
|
+
</el-form-item>
|
|
23
43
|
<el-form-item label="备注" prop="note">
|
|
24
44
|
<el-input v-model="form.note"></el-input>
|
|
25
45
|
</el-form-item>
|
|
@@ -31,9 +51,16 @@
|
|
|
31
51
|
</div>
|
|
32
52
|
</template>
|
|
33
53
|
<script>
|
|
34
|
-
import { add as userAdd } from "@/api/user";
|
|
54
|
+
import { add as userAdd, edit as userEdit } from "@/api/user";
|
|
55
|
+
import { list as blist } from "@/api/mall_business";
|
|
35
56
|
export default {
|
|
36
57
|
name: "le-user-add",
|
|
58
|
+
props: {
|
|
59
|
+
currentUser: {
|
|
60
|
+
type: Object,
|
|
61
|
+
default: () => {},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
37
64
|
data() {
|
|
38
65
|
return {
|
|
39
66
|
companys: [],
|
|
@@ -50,7 +77,9 @@ export default {
|
|
|
50
77
|
invite_code: "",
|
|
51
78
|
note: "",
|
|
52
79
|
password: "",
|
|
80
|
+
bid: "",
|
|
53
81
|
},
|
|
82
|
+
boptions: [],
|
|
54
83
|
rules: {
|
|
55
84
|
account: [
|
|
56
85
|
{ required: true, message: "请输入账号", trigger: "blur" },
|
|
@@ -80,31 +109,48 @@ export default {
|
|
|
80
109
|
},
|
|
81
110
|
};
|
|
82
111
|
},
|
|
112
|
+
watch: {
|
|
113
|
+
currentUser: {
|
|
114
|
+
handler(newValue) {
|
|
115
|
+
if (newValue && newValue.id && newValue.id.length > 0) {
|
|
116
|
+
this.form = newValue;
|
|
117
|
+
if (this.form.bid && this.form.bid.length > 0) {
|
|
118
|
+
if (!this.boptions || this.boptions.length <= 0) {
|
|
119
|
+
this.getMallBusiness();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
immediate: true,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
83
127
|
mounted() {},
|
|
84
128
|
methods: {
|
|
85
129
|
onSubmit() {
|
|
86
130
|
this.$refs["formUserAdd"].validate((valid) => {
|
|
87
131
|
if (valid) {
|
|
88
|
-
let param = {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
132
|
+
let param = {};
|
|
133
|
+
param = JSON.parse(JSON.stringify(this.form));
|
|
134
|
+
param.typeCode = this.userTypeDict[1].code;
|
|
135
|
+
param.typeName = this.userTypeDict[1].name;
|
|
136
|
+
param.forbid_login = Number(param.forbid_login);
|
|
137
|
+
param.is_place_order = Number(param.is_place_order);
|
|
138
|
+
if (param.id && param.id.length > 0) {
|
|
139
|
+
userEdit(param)
|
|
140
|
+
.then((response) => {
|
|
141
|
+
this.$message.success(response.data.info);
|
|
142
|
+
this.close();
|
|
143
|
+
})
|
|
144
|
+
.catch((err) => {});
|
|
145
|
+
} else {
|
|
146
|
+
param.openid = "openid";
|
|
147
|
+
userAdd(param)
|
|
148
|
+
.then((response) => {
|
|
149
|
+
this.$message.success(response.data.info);
|
|
150
|
+
this.close();
|
|
151
|
+
})
|
|
152
|
+
.catch((err) => {});
|
|
153
|
+
}
|
|
108
154
|
} else {
|
|
109
155
|
return false;
|
|
110
156
|
}
|
|
@@ -113,6 +159,24 @@ export default {
|
|
|
113
159
|
close() {
|
|
114
160
|
this.$emit("close");
|
|
115
161
|
},
|
|
162
|
+
getMallBusiness(query) {
|
|
163
|
+
let param = {};
|
|
164
|
+
param.pageNo = 1;
|
|
165
|
+
if (query) {
|
|
166
|
+
param.bname = query;
|
|
167
|
+
}
|
|
168
|
+
if (this.form.bid && this.form.bid.length > 0) {
|
|
169
|
+
param.id = this.form.bid;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
blist(param).then((res) => {
|
|
173
|
+
if (res.data.data) {
|
|
174
|
+
this.boptions = res.data.data.list;
|
|
175
|
+
} else {
|
|
176
|
+
this.boptions = [];
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
},
|
|
116
180
|
},
|
|
117
181
|
};
|
|
118
182
|
</script>
|
package/le-user/src/main.vue
CHANGED
|
@@ -168,7 +168,11 @@
|
|
|
168
168
|
:showDialog="showUserAdd"
|
|
169
169
|
@close="closeUserAdd"
|
|
170
170
|
>
|
|
171
|
-
<le-user-add
|
|
171
|
+
<le-user-add
|
|
172
|
+
:currentUser="currentUser"
|
|
173
|
+
v-if="showUserAdd"
|
|
174
|
+
@close="closeUserAdd"
|
|
175
|
+
></le-user-add>
|
|
172
176
|
</le-dialog-container>
|
|
173
177
|
</div>
|
|
174
178
|
</template>
|
|
@@ -180,7 +184,7 @@ import {
|
|
|
180
184
|
close,
|
|
181
185
|
userChangePwd,
|
|
182
186
|
} from "@/api/user";
|
|
183
|
-
import leMixins from "leisure-core/le-libs/mixins/main"
|
|
187
|
+
import leMixins from "leisure-core/le-libs/mixins/main"; //
|
|
184
188
|
import guid from "leisure-js/common/util";
|
|
185
189
|
import moment from "moment";
|
|
186
190
|
import LeUserSub from "./sub.vue";
|
|
@@ -234,7 +238,12 @@ export default {
|
|
|
234
238
|
this.currentUser = item;
|
|
235
239
|
this.currentUser.forbid_login = Boolean(item.forbid_login ?? 0);
|
|
236
240
|
this.currentUser.is_place_order = Boolean(item.is_place_order ?? 0);
|
|
237
|
-
|
|
241
|
+
|
|
242
|
+
if (item.managered && item.managered == 1) {
|
|
243
|
+
this.showUserAdd = true;
|
|
244
|
+
} else {
|
|
245
|
+
this.showEditUser = true;
|
|
246
|
+
}
|
|
238
247
|
},
|
|
239
248
|
resetPwd(row) {
|
|
240
249
|
//重置密码
|
|
@@ -267,9 +276,11 @@ export default {
|
|
|
267
276
|
this.currentUser = {};
|
|
268
277
|
},
|
|
269
278
|
addUser() {
|
|
279
|
+
this.currentUser = {};
|
|
270
280
|
this.showUserAdd = true;
|
|
271
281
|
},
|
|
272
282
|
closeUserAdd() {
|
|
283
|
+
this.currentUser = {};
|
|
273
284
|
this.showUserAdd = false;
|
|
274
285
|
},
|
|
275
286
|
// bindTypeText(item) {
|