|
@@ -1,9 +1,9 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="home" v-loading="loading">
|
3
|
|
- <div class="tipsBox">管理员给你分配了{{ tableData&&tableData.length }}个客户还未添加,快去复制电话号码添加客户吧,管理员在微伴后台可查看添加状态哦~</div>
|
|
3
|
+ <div class="tipsBox">管理员给你分配了{{ customer_total ? customer_total : '-' }}个客户还未添加,快去复制电话号码添加客户吧,管理员在微伴后台可查看添加状态哦~</div>
|
4
|
4
|
<div class="operateArea">
|
5
|
5
|
<div>
|
6
|
|
- <el-select v-model="addStatus_val" placeholder="请选择添加状态" @change="statusChange">
|
|
6
|
+ <el-select v-model="addStatus_val" :popper-append-to-body="false" placeholder="请选择添加状态" @change="statusChange">
|
7
|
7
|
<el-option
|
8
|
8
|
v-for="item in addStatusArrs"
|
9
|
9
|
:key="item.value"
|
|
@@ -41,7 +41,7 @@
|
41
|
41
|
<span v-else-if="!item.add_status">-</span>
|
42
|
42
|
<span v-else>-</span>
|
43
|
43
|
</div>
|
44
|
|
- <div><span class="copy" @click="goAddCustomer(item)">复制</span></div>
|
|
44
|
+ <div><span class="copy" :class="item.add_status == 2?'c-b8733d':(item.add_status == 3?'c-999':'')" @click="goAddCustomer(item)">复制</span></div>
|
45
|
45
|
</div>
|
46
|
46
|
</div>
|
47
|
47
|
<p class="infinite-tips" v-if="load_loading">加载中...</p>
|
|
@@ -64,6 +64,7 @@ export default class HomeView extends Vue {
|
64
|
64
|
load_loading = false
|
65
|
65
|
noMore = false
|
66
|
66
|
loading=false
|
|
67
|
+ customer_total=0
|
67
|
68
|
disabled = this.load_loading || this.noMore
|
68
|
69
|
page=1
|
69
|
70
|
page_size=20
|
|
@@ -90,10 +91,10 @@ export default class HomeView extends Vue {
|
90
|
91
|
value: '2',
|
91
|
92
|
label: '待通过'
|
92
|
93
|
},
|
93
|
|
- // {
|
94
|
|
- // value: '3',
|
95
|
|
- // label: '已添加'
|
96
|
|
- // },
|
|
94
|
+ {
|
|
95
|
+ value: '3',
|
|
96
|
+ label: '已添加'
|
|
97
|
+ },
|
97
|
98
|
// {
|
98
|
99
|
// value: '4',
|
99
|
100
|
// label: '待分配'
|
|
@@ -159,13 +160,24 @@ export default class HomeView extends Vue {
|
159
|
160
|
}).then((res) => {
|
160
|
161
|
const resNew = res.data
|
161
|
162
|
this.authInfo = resNew.rst
|
162
|
|
- this.get_dataReporting(item)
|
|
163
|
+ if(item.add_status == 1){
|
|
164
|
+ this.get_dataReporting(item)
|
|
165
|
+ }
|
163
|
166
|
}).catch((err) => {
|
164
|
167
|
console.log(err)
|
165
|
168
|
})
|
166
|
169
|
}
|
167
|
170
|
|
168
|
171
|
async goAddCustomer (item) { // 复制
|
|
172
|
+ if(item.add_status == 3){
|
|
173
|
+ ElMessage({
|
|
174
|
+ showClose:true,
|
|
175
|
+ message: '本客户已添加!',
|
|
176
|
+ type: 'info',
|
|
177
|
+ duration:3000
|
|
178
|
+ })
|
|
179
|
+ return
|
|
180
|
+ }
|
169
|
181
|
this.loading = true
|
170
|
182
|
await this.getAuthInfo(item)
|
171
|
183
|
}
|
|
@@ -190,10 +202,11 @@ export default class HomeView extends Vue {
|
190
|
202
|
this.loading = false
|
191
|
203
|
const resNew = res.data
|
192
|
204
|
if(resNew&&resNew.errno==0){
|
193
|
|
- if (resNew.rst.data.length < 20) {
|
|
205
|
+ if (resNew.rst.data.list.length < 20) {
|
194
|
206
|
this.noMore = true
|
195
|
207
|
}
|
196
|
|
- this.tableData = [...this.tableData, ...resNew.rst.data]
|
|
208
|
+ this.customer_total = resNew.rst.data.customer_total
|
|
209
|
+ this.tableData = [...this.tableData, ...resNew.rst.data.list]
|
197
|
210
|
this.load_loading = false
|
198
|
211
|
}else{
|
199
|
212
|
ElMessage({
|
|
@@ -233,7 +246,7 @@ export default class HomeView extends Vue {
|
233
|
246
|
|
234
|
247
|
initQYConfig () { // 企业
|
235
|
248
|
const _this = this
|
236
|
|
- _this.wx.config({
|
|
249
|
+ wx.config({
|
237
|
250
|
beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
|
238
|
251
|
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
239
|
252
|
appId: this.authInfo.corpid, // 必填,企业微信的corpID
|
|
@@ -242,10 +255,10 @@ export default class HomeView extends Vue {
|
242
|
255
|
signature: this.authInfo.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法 企业签名
|
243
|
256
|
jsApiList: ['navigateToAddCustomer'] // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
|
244
|
257
|
})
|
245
|
|
- _this.wx.ready(function () {
|
|
258
|
+ wx.ready(function () {
|
246
|
259
|
_this.initYYConfig()
|
247
|
260
|
})
|
248
|
|
- _this.wx.error(function (res) {
|
|
261
|
+ wx.error(function (res) {
|
249
|
262
|
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
|
250
|
263
|
console.log(res, 'QYerror')
|
251
|
264
|
})
|
|
@@ -253,7 +266,7 @@ export default class HomeView extends Vue {
|
253
|
266
|
|
254
|
267
|
initYYConfig () { // 应用
|
255
|
268
|
const _this = this
|
256
|
|
- _this.wx.agentConfig({
|
|
269
|
+ wx.agentConfig({
|
257
|
270
|
corpid: this.authInfo.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
|
258
|
271
|
agentid: this.authInfo.agent_id, // 必填,企业微信的应用id (e.g. 1000247)
|
259
|
272
|
timestamp: this.authInfo.timestamp, // 必填,生成签名的时间戳
|
|
@@ -262,7 +275,7 @@ export default class HomeView extends Vue {
|
262
|
275
|
jsApiList: ['navigateToAddCustomer'], // 必填,传入需要使用的接口名称
|
263
|
276
|
success: function (res) {
|
264
|
277
|
// 回调
|
265
|
|
- _this.wx.invoke('navigateToAddCustomer', {}, function (res) {
|
|
278
|
+ wx.invoke('navigateToAddCustomer', {}, function (res) {
|
266
|
279
|
console.log(res, 'wx.invoke,navigateToAddCustomer')
|
267
|
280
|
})
|
268
|
281
|
_this.loading = false
|
|
@@ -284,6 +297,7 @@ export default class HomeView extends Vue {
|
284
|
297
|
.home {
|
285
|
298
|
padding: 8px;
|
286
|
299
|
|
|
300
|
+
|
287
|
301
|
.tipsBox {
|
288
|
302
|
padding: 10px;
|
289
|
303
|
font-size: 14px;
|
|
@@ -358,6 +372,15 @@ export default class HomeView extends Vue {
|
358
|
372
|
border: 1px solid #4d8feb;
|
359
|
373
|
border-radius: 4px;
|
360
|
374
|
cursor: pointer;
|
|
375
|
+ font-size: 13px;
|
|
376
|
+ }
|
|
377
|
+ .c-b8733d{
|
|
378
|
+ border: 1px solid #b8733d;
|
|
379
|
+ color: #b8733d;
|
|
380
|
+ }
|
|
381
|
+ .c-999{
|
|
382
|
+ border: 1px solid #999;
|
|
383
|
+ color: #999;
|
361
|
384
|
}
|
362
|
385
|
}
|
363
|
386
|
}
|