|
@@ -65,8 +65,7 @@
|
65
|
65
|
<div class="flex-item">
|
66
|
66
|
<div>
|
67
|
67
|
<span>卡券货值总额:</span>
|
68
|
|
- <span>¥1000</span>
|
69
|
|
- <span>万</span>
|
|
68
|
+ <span>¥{{couponTotalCount}}</span>
|
70
|
69
|
</div>
|
71
|
70
|
</div>
|
72
|
71
|
<a @click="toSalesHistory">销售记录</a>
|
|
@@ -77,19 +76,19 @@
|
77
|
76
|
<li :hidden="navActive !== 3" class="customer-card">
|
78
|
77
|
<div class="list-box">
|
79
|
78
|
<div class="search-bar flex-h">
|
80
|
|
- <span>共15位客户</span>
|
81
|
|
- <van-checkbox v-model="checked">
|
82
|
|
- 我推荐的客户(8人)
|
|
79
|
+ <span>共{{this.data[3].list.length}}位客户</span>
|
|
80
|
+ <van-checkbox v-model="postCustomerData.isrecommend">
|
|
81
|
+ 我推荐的客户({{myRecommendUserList.length}}人)
|
83
|
82
|
<img
|
84
|
83
|
slot="icon"
|
85
|
84
|
slot-scope="props"
|
86
|
|
- :src="props.checked ? icon.active : icon.normal"
|
|
85
|
+ :src="postCustomerData.isrecommend ? icon.active : icon.normal"
|
87
|
86
|
style="width:.2rem;height:.2rem;bottom: .02rem;position: relative;"
|
88
|
87
|
>
|
89
|
88
|
</van-checkbox>
|
90
|
89
|
<i class="iconfont icon-sousuo search-icon" @click="searchMask"></i>
|
91
|
90
|
</div>
|
92
|
|
- <customerCard v-for="(item,index) in data[3].list" :key="index" :data='item' @remark='remark' @history='history' @record='record'></customerCard>
|
|
91
|
+ <customerCard v-for="(item,index) in postCustomerData.isrecommend ? myRecommendUserList : data[3].list" :key="index" :data='item' @record='record'></customerCard>
|
93
|
92
|
</div>
|
94
|
93
|
</li>
|
95
|
94
|
<!-- </ul>
|
|
@@ -132,7 +131,6 @@ import { mapState, createNamespacedHelpers } from 'vuex'
|
132
|
131
|
const { mapActions: actions } = createNamespacedHelpers('app')
|
133
|
132
|
const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
|
134
|
133
|
const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
|
135
|
|
-const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('myCustomer')
|
136
|
134
|
const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('myCard')
|
137
|
135
|
const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
|
138
|
136
|
|
|
@@ -140,14 +138,22 @@ export default {
|
140
|
138
|
name: '',
|
141
|
139
|
data () {
|
142
|
140
|
return {
|
|
141
|
+ myRecommendUserList: [],
|
|
142
|
+ forbidList: [],
|
|
143
|
+ postCustomerData: {
|
|
144
|
+ page: 1,
|
|
145
|
+ pagesize: 10000,
|
|
146
|
+ isrecommend: false,
|
|
147
|
+ },
|
|
148
|
+ couponTotalCount: 0,
|
143
|
149
|
cardTotalCount: 0,
|
144
|
150
|
postCouponData: {
|
145
|
151
|
page: 1,
|
146
|
|
- pageSize: 10
|
|
152
|
+ pageSize: 10000
|
147
|
153
|
},
|
148
|
154
|
postCardData: {
|
149
|
155
|
page: 1,
|
150
|
|
- pageSize: 10
|
|
156
|
+ pageSize: 10000
|
151
|
157
|
},
|
152
|
158
|
pullUpLoad: true,
|
153
|
159
|
pullUpLoadThreshold: 40,
|
|
@@ -160,7 +166,6 @@ export default {
|
160
|
166
|
active,
|
161
|
167
|
normal,
|
162
|
168
|
navActive: 0,
|
163
|
|
- checked: true,
|
164
|
169
|
showDialog: false,
|
165
|
170
|
message: '',
|
166
|
171
|
cutNavList: [{
|
|
@@ -245,9 +250,6 @@ export default {
|
245
|
250
|
...mapCaseState({
|
246
|
251
|
caseTotal: x => x.caseTotal,
|
247
|
252
|
}),
|
248
|
|
- ...mapCustomerState({
|
249
|
|
- customerList: x => x.customerList
|
250
|
|
- }),
|
251
|
253
|
...mapCardState({
|
252
|
254
|
cardList: x => x.cardList
|
253
|
255
|
})
|
|
@@ -262,36 +264,64 @@ export default {
|
262
|
264
|
created () {
|
263
|
265
|
if (this.userInfo.customer.MapUser !== '') {
|
264
|
266
|
this.getForbidInfo().then((res) => {
|
265
|
|
- console.log(JSON.stringify(res))
|
266
|
|
- })
|
267
|
|
- this.getMyCouponList({
|
268
|
|
- ...this.postCouponData
|
269
|
|
- }).then((res) => {
|
270
|
|
- console.log(JSON.stringify(res))
|
271
|
|
- })
|
272
|
|
- this.getMyCardList({
|
273
|
|
- ...this.postCardData
|
274
|
|
- }).then((res) => {
|
275
|
|
- console.log(JSON.stringify(res))
|
276
|
|
- res.list = res.list || []
|
277
|
|
- for (var n = 0; n < res.list.length; n++) {
|
278
|
|
- this.data[1].list.push({
|
279
|
|
- invalid: this.returnInvalid(res.list[n]),
|
280
|
|
- price: res.list[n].Price,
|
281
|
|
- title: res.list[n].CardName,
|
282
|
|
- desc: res.list[n].Share.CardUseRule,
|
283
|
|
- startDate: this.toolClass.dateFormat(res.list[n].StartDate),
|
284
|
|
- endDate: this.toolClass.dateFormat(res.list[n].EndDate),
|
285
|
|
- totalCount: res.list[n].TotalCount,
|
286
|
|
- SentCount: res.list[n].SentCount,
|
287
|
|
- usedCount: res.list[n].UsedCount,
|
288
|
|
- })
|
289
|
|
- }
|
290
|
|
- var count = 0
|
291
|
|
- for (var n = 0; n < this.data[1].list.length; n++) {
|
292
|
|
- count += this.data[1].list[n].price * this.data[1].list[n].totalCount - 0
|
293
|
|
- }
|
294
|
|
- this.cardTotalCount = count.toFixed(2)
|
|
267
|
+ this.forbidList = res || []
|
|
268
|
+ this.getCustomerList({
|
|
269
|
+ ...this.postCustomerData
|
|
270
|
+ }).then((res) => {
|
|
271
|
+ // console.log(JSON.stringify(res))
|
|
272
|
+ for (var n = 0; n < res.length; n++) {
|
|
273
|
+ if (res[n].RecommendId === this.userInfo.customer.MapUser) {
|
|
274
|
+ this.myRecommendUserList.push(res[n])
|
|
275
|
+ }
|
|
276
|
+ this.data[3].list.push(res[n])
|
|
277
|
+ }
|
|
278
|
+ })
|
|
279
|
+ this.getMyCouponList({
|
|
280
|
+ ...this.postCouponData
|
|
281
|
+ }).then((res) => {
|
|
282
|
+ res.list = res.list || []
|
|
283
|
+ for (var n = 0; n < res.list.length; n++) {
|
|
284
|
+ this.data[2].list.push({
|
|
285
|
+ invalid: this.returnInvalid(res.list[n], 'coupon'),
|
|
286
|
+ price: res.list[n].Price,
|
|
287
|
+ title: res.list[n].CouponName,
|
|
288
|
+ desc: res.list[n].Share.UseRule,
|
|
289
|
+ startDate: this.toolClass.dateFormat(res.list[n].StartDate),
|
|
290
|
+ endDate: this.toolClass.dateFormat(res.list[n].EndDate),
|
|
291
|
+ totalCount: res.list[n].TotalCount,
|
|
292
|
+ SentCount: res.list[n].SentCount,
|
|
293
|
+ usedCount: res.list[n].UsedCount,
|
|
294
|
+ })
|
|
295
|
+ }
|
|
296
|
+ var count = 0
|
|
297
|
+ for (var n = 0; n < this.data[2].list.length; n++) {
|
|
298
|
+ count += this.data[2].list[n].price * this.data[2].list[n].totalCount - 0
|
|
299
|
+ }
|
|
300
|
+ this.couponTotalCount = count.toFixed(2)
|
|
301
|
+ })
|
|
302
|
+ this.getMyCardList({
|
|
303
|
+ ...this.postCardData
|
|
304
|
+ }).then((res) => {
|
|
305
|
+ res.list = res.list || []
|
|
306
|
+ for (var n = 0; n < res.list.length; n++) {
|
|
307
|
+ this.data[1].list.push({
|
|
308
|
+ invalid: this.returnInvalid(res.list[n], 'card'),
|
|
309
|
+ price: res.list[n].Price,
|
|
310
|
+ title: res.list[n].CardName,
|
|
311
|
+ desc: res.list[n].Share.CardUseRule,
|
|
312
|
+ startDate: this.toolClass.dateFormat(res.list[n].StartDate),
|
|
313
|
+ endDate: this.toolClass.dateFormat(res.list[n].EndDate),
|
|
314
|
+ totalCount: res.list[n].TotalCount,
|
|
315
|
+ SentCount: res.list[n].SentCount,
|
|
316
|
+ usedCount: res.list[n].UsedCount,
|
|
317
|
+ })
|
|
318
|
+ }
|
|
319
|
+ var count = 0
|
|
320
|
+ for (var n = 0; n < this.data[1].list.length; n++) {
|
|
321
|
+ count += this.data[1].list[n].price * this.data[1].list[n].totalCount - 0
|
|
322
|
+ }
|
|
323
|
+ this.cardTotalCount = count.toFixed(2)
|
|
324
|
+ })
|
295
|
325
|
})
|
296
|
326
|
}
|
297
|
327
|
this.getCaseList().then((res) => {
|
|
@@ -303,9 +333,6 @@ export default {
|
303
|
333
|
this.getCaseTotal({
|
304
|
334
|
caseid: this.topCaseInfoData.CaseId
|
305
|
335
|
})
|
306
|
|
- this.getCustomerList().then(() => {
|
307
|
|
-
|
308
|
|
- })
|
309
|
336
|
})
|
310
|
337
|
},
|
311
|
338
|
methods: {
|
|
@@ -313,6 +340,7 @@ export default {
|
313
|
340
|
'getMyCardList',
|
314
|
341
|
'getMyCouponList',
|
315
|
342
|
'getForbidInfo',
|
|
343
|
+ 'getCustomerList',
|
316
|
344
|
]),
|
317
|
345
|
...actions([
|
318
|
346
|
'getCaseList',
|
|
@@ -323,13 +351,19 @@ export default {
|
323
|
351
|
...mapCaseActions([
|
324
|
352
|
'getCaseTotal',
|
325
|
353
|
]),
|
326
|
|
- ...mapCustomerActions(['getCustomerList']),
|
327
|
354
|
...mapCardActions(['getCardList']),
|
328
|
|
- returnInvalid (item) {
|
|
355
|
+ returnInvalid (item, type) {
|
|
356
|
+ for (var n = 0; n < this.forbidList.length; n++) {
|
|
357
|
+ if (this.forbidList[n].UserId === this.userInfo.customer.CustomerId && this.forbidList[n].ForbidType === type) {
|
|
358
|
+ return true
|
|
359
|
+ }
|
|
360
|
+ }
|
|
361
|
+ if (item.TotalCount - 0 === item.SentCount - 0 + item.UsedCount - 0 || new Date(item.EndDate).getTime() < Date.now()) {
|
|
362
|
+ return true
|
|
363
|
+ }
|
329
|
364
|
return false
|
330
|
365
|
},
|
331
|
366
|
toSalesHistory () {
|
332
|
|
- //console.log(this.getUrl('salesRecord'))
|
333
|
367
|
window.location.href = this.getUrl('salesRecord')
|
334
|
368
|
},
|
335
|
369
|
getUrl (val) {
|
|
@@ -359,33 +393,23 @@ export default {
|
359
|
393
|
this.data[this.navActive].page = 0
|
360
|
394
|
}
|
361
|
395
|
if (this.data[this.navActive].hasMore) {
|
362
|
|
- // this.getgymCardList({ page: this.data[this.active].page, pageSize: this.data[this.active].pageSize }).then((res) => {
|
363
|
|
- // this.data[this.active].list = this.data[this.active].list.concat(this.gymCardList)
|
364
|
|
- // this.data[this.active].page++
|
365
|
|
- // if (this.gymCardList.length < this.data[this.active].pageSize) {
|
366
|
|
- // this.data[this.active].hasMore = false
|
367
|
|
- // }
|
368
|
|
- // if (this.data[this.active].list.length <= 0) {
|
369
|
|
- // this.data[this.active].hasPic = true
|
370
|
|
- // }
|
371
|
|
- // })
|
372
|
396
|
}
|
373
|
397
|
}
|
374
|
398
|
},
|
375
|
399
|
share (item) {
|
376
|
|
- console.log(item)
|
|
400
|
+ // console.log(item)
|
377
|
401
|
},
|
378
|
402
|
remark (item) {
|
379
|
|
- console.log(item)
|
|
403
|
+ // console.log(item)
|
380
|
404
|
this.showDialog = true
|
381
|
405
|
},
|
382
|
406
|
history (item) {
|
383
|
|
- console.log(item)
|
|
407
|
+ // console.log(item)
|
384
|
408
|
window.location.href = this.getUrl('history')
|
385
|
409
|
},
|
386
|
410
|
record (item) {
|
387
|
|
- console.log(item)
|
388
|
|
- window.location.href = this.getUrl('getRecord')
|
|
411
|
+ // console.log(item)
|
|
412
|
+ window.location.href = this.getUrl('getRecord') + '?' + item
|
389
|
413
|
},
|
390
|
414
|
searchMask () {
|
391
|
415
|
window.location.href = this.getUrl('customerSearch')
|