|
@@ -122,7 +122,7 @@
|
|
},
|
|
},
|
|
//下拉刷新
|
|
//下拉刷新
|
|
onPullDownRefresh() {
|
|
onPullDownRefresh() {
|
|
- this.pageSize = 1
|
|
|
|
|
|
+ this.currentPage = 1
|
|
this.isLoadMore = false
|
|
this.isLoadMore = false
|
|
this.loadStatus = 'loading'
|
|
this.loadStatus = 'loading'
|
|
this.loadData()
|
|
this.loadData()
|
|
@@ -130,7 +130,7 @@
|
|
onReachBottom() { //上拉触底函数
|
|
onReachBottom() { //上拉触底函数
|
|
if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
|
|
if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
|
|
this.isLoadMore = true
|
|
this.isLoadMore = true
|
|
- this.pages += 1
|
|
|
|
|
|
+ this.currentPage += 1
|
|
this.getIndexBuyData()
|
|
this.getIndexBuyData()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -148,6 +148,7 @@
|
|
},
|
|
},
|
|
tabcarchange(status) {
|
|
tabcarchange(status) {
|
|
this.TabCur = status
|
|
this.TabCur = status
|
|
|
|
+ this.currentPage = 1
|
|
this.pageSize = 10
|
|
this.pageSize = 10
|
|
this.loadData()
|
|
this.loadData()
|
|
},
|
|
},
|
|
@@ -163,15 +164,15 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
locationChange(e) {
|
|
locationChange(e) {
|
|
-
|
|
|
|
|
|
+ this.location = e.detail.value
|
|
this.receivePrivate = e.detail.value
|
|
this.receivePrivate = e.detail.value
|
|
- this.pageSize = 1
|
|
|
|
|
|
+ this.currentPage = 1
|
|
this.loadData()
|
|
this.loadData()
|
|
},
|
|
},
|
|
tabSelect(e) {
|
|
tabSelect(e) {
|
|
this.TabCur = e.currentTarget.dataset.id;
|
|
this.TabCur = e.currentTarget.dataset.id;
|
|
this.category = this.TabCur
|
|
this.category = this.TabCur
|
|
- this.pageSize = 1
|
|
|
|
|
|
+ this.currentPage = 1
|
|
this.loadData()
|
|
this.loadData()
|
|
},
|
|
},
|
|
fabu() {
|
|
fabu() {
|
|
@@ -206,12 +207,13 @@
|
|
showFlag: 1,
|
|
showFlag: 1,
|
|
currentPage: this.currentPage,
|
|
currentPage: this.currentPage,
|
|
searchKeyWord: this.searchKeyWord,
|
|
searchKeyWord: this.searchKeyWord,
|
|
- receivePrivate: this.receivePrivate
|
|
|
|
|
|
+ receivePrivate: this.receivePrivate =="0" ? '':this.locationType[this.receivePrivate]
|
|
}).then(res => {
|
|
}).then(res => {
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
this.buyInfo = res.data.data.records
|
|
this.buyInfo = res.data.data.records
|
|
})
|
|
})
|
|
.catch(res => {
|
|
.catch(res => {
|
|
|
|
+ uni.hideLoading()
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: res.errmsg,
|
|
title: res.errmsg,
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -287,39 +289,46 @@
|
|
},
|
|
},
|
|
getIndexBuyData() {
|
|
getIndexBuyData() {
|
|
const that = this
|
|
const that = this
|
|
- var pages = that.pages
|
|
|
|
- var limit = that.limit
|
|
|
|
-
|
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
title: '正在加载',
|
|
title: '正在加载',
|
|
mask: true
|
|
mask: true
|
|
})
|
|
})
|
|
- that.$api.request('buy', 'getBuyListInfo', {
|
|
|
|
- page: pages,
|
|
|
|
- limit: limit
|
|
|
|
- }, failres => {
|
|
|
|
- that.$api.msg(failres.errmsg)
|
|
|
|
- that.isLoadMore = false
|
|
|
|
- that.loadStatus = 'nomore'
|
|
|
|
- if (that.pages > 1) {
|
|
|
|
- that.pages -= 1
|
|
|
|
- }
|
|
|
|
- uni.hideLoading()
|
|
|
|
- }).then(res => {
|
|
|
|
- let data = res.data
|
|
|
|
- //采购信息
|
|
|
|
- if (data.length > 0) {
|
|
|
|
- that.buyInfo = that.buyInfo.concat(data)
|
|
|
|
- that.isLoadMore = false
|
|
|
|
- } else {
|
|
|
|
- if (that.pages > 1) {
|
|
|
|
- that.pages -= 1
|
|
|
|
|
|
+ var param1 = ''
|
|
|
|
+ if (that.TabCur == 0) {
|
|
|
|
+ param1 = '/procurementPlanInfo/selectProcurementPlanInfo'
|
|
|
|
+ } else {
|
|
|
|
+ param1 = '/salePlanInfo/selectSalePlanInfo'
|
|
|
|
+ }
|
|
|
|
+ this.$api.doRequest('get', param1, {
|
|
|
|
+ pageSize: this.pageSize,
|
|
|
|
+ showFlag: 1,
|
|
|
|
+ currentPage: this.currentPage,
|
|
|
|
+ searchKeyWord: this.searchKeyWord,
|
|
|
|
+ receivePrivate: this.receivePrivate
|
|
|
|
+ }).then(res => {
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ // this.buyInfo = res.data.records
|
|
|
|
+ let data = res.data.data.records
|
|
|
|
+ //采购信息
|
|
|
|
+ if (data.length > 0) {
|
|
|
|
+ that.buyInfo = that.buyInfo.concat(data)
|
|
|
|
+ that.isLoadMore = false
|
|
|
|
+ } else {
|
|
|
|
+ if (that.currentPage > 1) {
|
|
|
|
+ that.currentPage -= 1
|
|
|
|
+ }
|
|
|
|
+ that.isLoadMore = true
|
|
|
|
+ that.loadStatus = 'nomore'
|
|
}
|
|
}
|
|
- that.isLoadMore = true
|
|
|
|
- that.loadStatus = 'nomore'
|
|
|
|
- }
|
|
|
|
- uni.hideLoading()
|
|
|
|
- })
|
|
|
|
|
|
+ })
|
|
|
|
+ .catch(res => {
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.errmsg,
|
|
|
|
+ icon: 'none',
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -367,6 +376,7 @@
|
|
|
|
|
|
.search-form {
|
|
.search-form {
|
|
background: #F5F6F9;
|
|
background: #F5F6F9;
|
|
|
|
+ padding-left: 20rpx;
|
|
}
|
|
}
|
|
|
|
|
|
.title-tip {
|
|
.title-tip {
|