leisure-core 0.4.7 → 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.
@@ -97,6 +97,7 @@
97
97
  :editType="editType"
98
98
  :rowData="rowData"
99
99
  @list="list"
100
+ :dtype="dtype"
100
101
  v-if="showDetails"
101
102
  >
102
103
  <template v-slot:default="data">
@@ -114,6 +115,12 @@ import LePromotionsActivitiesSub from "./sub.vue";
114
115
  export default {
115
116
  name: "le-promotions-activities",
116
117
  components: { LePromotionsActivitiesSub },
118
+ props: {
119
+ dtype: {
120
+ type: String,
121
+ default: "date",
122
+ },
123
+ },
117
124
  data() {
118
125
  return {
119
126
  tableHeight: 200,
@@ -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="活动类型" prop="ptype">
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"
@@ -25,7 +25,7 @@
25
25
  <el-date-picker
26
26
  value-format="timestamp"
27
27
  v-model="form.date_start"
28
- type="date"
28
+ :type="dtype"
29
29
  placeholder="开始日期"
30
30
  >
31
31
  </el-date-picker>
@@ -34,11 +34,17 @@
34
34
  <el-date-picker
35
35
  value-format="timestamp"
36
36
  v-model="form.date_end"
37
- type="date"
37
+ :type="dtype"
38
38
  placeholder="结束日期"
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>
@@ -71,6 +77,10 @@ export default {
71
77
  type: Object,
72
78
  default: () => {},
73
79
  },
80
+ dtype: {
81
+ type: String,
82
+ default: "date",
83
+ },
74
84
  },
75
85
  data() {
76
86
  return {
@@ -78,6 +88,7 @@ export default {
78
88
  id: "",
79
89
  title: "",
80
90
  ptype: "",
91
+ category: 0,
81
92
  pname: "",
82
93
  date_start: "",
83
94
  date_end: "",
@@ -123,6 +134,7 @@ export default {
123
134
  this.form.date_end = new Date(this.rowData.date_end * 1000);
124
135
  this.form.is_used_coupon = "1";
125
136
  this.form.is_used_integral = "1";
137
+ this.form.category = 1;
126
138
  this.form.released = this.form.released.toString();
127
139
  if (this.form.grang == 2) {
128
140
  let products = this.form.grang_product;
@@ -7,7 +7,7 @@
7
7
  remote
8
8
  reserve-keyword
9
9
  placeholder="请输入用户关键字"
10
- :remote-method="getUserBack"
10
+ :remote-method="getUserBackByComment"
11
11
  :loading="loading"
12
12
  @change="onChange"
13
13
  >
@@ -29,6 +29,12 @@ export default {
29
29
  type: Number,
30
30
  default: 999,
31
31
  },
32
+ initUserIds: {
33
+ type: Array,
34
+ default: () => {
35
+ return [];
36
+ },
37
+ },
32
38
  },
33
39
  data() {
34
40
  return {
@@ -39,13 +45,24 @@ export default {
39
45
  },
40
46
  watch: {},
41
47
  mounted() {
42
- this.value = this.initArea;
48
+ this.value = this.initUserIds;
49
+ if (this.value.length > 0) {
50
+ this.getUserBackByUid();
51
+ }
43
52
  },
44
53
  methods: {
45
- getUserBack(comment) {
46
- this.userList = [];
54
+ getUserBackByComment(comment) {
47
55
  let param = {};
48
56
  param.comment = comment;
57
+ this.getUserBack(param);
58
+ },
59
+ getUserBackByUid() {
60
+ let param = {};
61
+ param.id = this.value[0];
62
+ this.getUserBack(param);
63
+ },
64
+ getUserBack(param) {
65
+ this.userList = [];
49
66
  if (param) {
50
67
  this.loading = true;
51
68
  listBack(param)
@@ -63,7 +80,7 @@ export default {
63
80
  }
64
81
  },
65
82
  onChange(value) {
66
- console.log(value);
83
+ this.$emit("onChange", value);
67
84
  },
68
85
  },
69
86
  };
@@ -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
- id: this.form.id,
90
- account: this.form.account,
91
- nick: this.form.nick,
92
- cid: this.form.cid,
93
- logo_url: this.form.logo_url,
94
- cardNo: this.form.cardNo,
95
- type: this.form.type,
96
- note: this.form.note,
97
- password: this.form.password,
98
- typeCode: this.userTypeDict[1].code,
99
- typeName: this.userTypeDict[1].name,
100
- openid: "openid",
101
- };
102
- userAdd(param)
103
- .then((response) => {
104
- this.$message.success(response.data.info);
105
- this.close();
106
- })
107
- .catch((err) => {});
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>
@@ -168,7 +168,11 @@
168
168
  :showDialog="showUserAdd"
169
169
  @close="closeUserAdd"
170
170
  >
171
- <le-user-add v-if="showUserAdd" @close="closeUserAdd"></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
- this.showEditUser = true;
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leisure-core",
3
- "version": "0.4.7",
3
+ "version": "0.4.9",
4
4
  "description": "leisure-core是leisure-ui-core的简称,是京心数据基于vue2.0开发的一套后台系统框架与js库,包含登录,首页框架等",
5
5
  "private": false,
6
6
  "author": "北方乐逍遥(zcx7878)",