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