|
|
|
@ -34,7 +34,7 @@ |
|
|
|
|
return { |
|
|
|
|
serviceList: [], |
|
|
|
|
pageNum: 1, |
|
|
|
|
pagesize: 15, |
|
|
|
|
pageSize: 15, |
|
|
|
|
isLoadMore: false, //是否加载中 |
|
|
|
|
userInfo: app.globalData.userInfo, //用户信息 |
|
|
|
|
typeId: '', //类型 |
|
|
|
@ -43,15 +43,11 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onReachBottom() { //上拉触底函数 |
|
|
|
|
if (!this.isLoadMore) { //此处判断,上锁,防止重复请求 |
|
|
|
|
this.isLoadMore = true |
|
|
|
|
this.pageNum += 1 |
|
|
|
|
if (this.typeId == 2) { |
|
|
|
|
this.getStoreQrCodeList(); |
|
|
|
|
} else { |
|
|
|
|
this.getSalesmanQrCodeList(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad(options) { |
|
|
|
|
this.typeId = options.type; |
|
|
|
@ -68,7 +64,6 @@ |
|
|
|
|
methods: { |
|
|
|
|
toSearch() { |
|
|
|
|
this.pageNum = 1; |
|
|
|
|
this.pageSize = 10; |
|
|
|
|
this.isLoadMore = false; |
|
|
|
|
this.serviceList = []; |
|
|
|
|
if (this.typeId == 2) { |
|
|
|
@ -79,59 +74,75 @@ |
|
|
|
|
}, |
|
|
|
|
//门店查询设备列表 |
|
|
|
|
getStoreQrCodeList() { |
|
|
|
|
if (this.isLoadMore) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中...' |
|
|
|
|
}) |
|
|
|
|
let params = { |
|
|
|
|
pageNum: this.pageNum, |
|
|
|
|
pageSize: this.pagesize, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
serialNumber: this.scanNo, |
|
|
|
|
storeId: this.storeId |
|
|
|
|
} |
|
|
|
|
getStoreQrCodeList(params).then(res => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
if (res.return_code == '000000' && res.return_data.list) { |
|
|
|
|
this.isLoadMore = res.return_data.list.length == this.pageSize ? false : true; |
|
|
|
|
this.serviceList = this.serviceList.concat(res.return_data.list); |
|
|
|
|
if (res.return_data.total == (this.pageNum * this.pageSize)) { |
|
|
|
|
if (res.return_data.total == this.serviceList.length) { |
|
|
|
|
this.isLoadMore = true; |
|
|
|
|
}else{ |
|
|
|
|
this.isLoadMore = false; |
|
|
|
|
} |
|
|
|
|
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum; |
|
|
|
|
this.pageNum = this.pageNum + 1; |
|
|
|
|
} else { |
|
|
|
|
this.serviceList = []; |
|
|
|
|
this.isLoadMore = true |
|
|
|
|
this.isLoadMore = true; |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.return_msg, |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//业务员查询设备列表 |
|
|
|
|
getSalesmanQrCodeList() { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中...' |
|
|
|
|
}) |
|
|
|
|
if (this.isLoadMore) { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
let pagenum = this.pageNum; |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中...' |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
let datas = { |
|
|
|
|
salesmanId: this.userInfo.salesman.id, |
|
|
|
|
isAssignStore: false, |
|
|
|
|
serialNumber: this.scanNo, |
|
|
|
|
pageNum: pagenum, |
|
|
|
|
pageSize: this.pagesize, |
|
|
|
|
pageNum: this.pageNum, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
} |
|
|
|
|
getSalesmanQrCodeList(datas).then(res => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
if (res.return_code == '000000' && res.return_data.list) { |
|
|
|
|
this.isLoadMore = res.return_data.list.length == this.pageSize ? false : true; |
|
|
|
|
this.serviceList = this.serviceList.concat(res.return_data.list); |
|
|
|
|
if (res.return_data.total == (this.pageNum * this.pageSize)) { |
|
|
|
|
if (res.return_data.total == this.serviceList.length) { |
|
|
|
|
this.isLoadMore = true; |
|
|
|
|
}else{ |
|
|
|
|
this.isLoadMore = false; |
|
|
|
|
} |
|
|
|
|
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum; |
|
|
|
|
this.pageNum = this.pageNum + 1; |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
this.serviceList = []; |
|
|
|
|
this.isLoadMore = true |
|
|
|
|
this.isLoadMore = true; |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.return_msg, |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|