|
|
|
@ -59,19 +59,21 @@ |
|
|
|
status: 'loadmore', |
|
|
|
range:[] |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow(){ |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
onLoad(option) { |
|
|
|
console.log(option) |
|
|
|
this.inStorageStatus = option.inStorageStatus || '' |
|
|
|
this.type = uni.getStorageSync('type') |
|
|
|
this.type = uni.getStorageSync('type') |
|
|
|
console.log(this.inStorageStatus) |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
onReachBottom() { |
|
|
|
if (this.pageNum >= this.pages) return; |
|
|
|
this.status = 'loading'; |
|
|
|
this.pageNum += 1; |
|
|
|
this.getList(); |
|
|
|
if(this.inStorageStatus != 0){ |
|
|
|
if (this.pageNum >= this.pages) return; |
|
|
|
this.status = 'loading'; |
|
|
|
this.pageNum += 1; |
|
|
|
this.getList(); |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
searchList() { |
|
|
|
@ -80,35 +82,44 @@ |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
getList() { |
|
|
|
var url,data |
|
|
|
var url,data; |
|
|
|
console.log(this.inStorageStatus == 0) |
|
|
|
if(this.inStorageStatus == 0){ |
|
|
|
url = "/app/purchase/list"; |
|
|
|
data = { |
|
|
|
this.tui.request("/app/purchase/list", "POST", { |
|
|
|
inStorageStatus: this.inStorageStatus |
|
|
|
} |
|
|
|
}, false, false).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.pages = res.result.pages |
|
|
|
if (this.pages == 1) { |
|
|
|
this.list = res.result.records |
|
|
|
} else { |
|
|
|
this.list = [...this.list, ...res.result.records] |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
url = "/app/purchase/getPurchaseList"; |
|
|
|
data = { |
|
|
|
this.tui.request("/app/purchase/getPurchaseList", "POST", { |
|
|
|
inStorageStatus: this.inStorageStatus, |
|
|
|
supplierName: this.supplierName, |
|
|
|
startDate: this.range[0], |
|
|
|
endDate: this.range[1], |
|
|
|
pageNum:this.pageNum, |
|
|
|
pageSize:10, |
|
|
|
} |
|
|
|
} |
|
|
|
this.tui.request(url, "POST", data, false, false).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.pages = res.result.pages |
|
|
|
if (this.pages == 1) { |
|
|
|
this.list = res.result.records |
|
|
|
}, false, false).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.pages = res.result.pages |
|
|
|
if (this.pages == 1) { |
|
|
|
this.list = res.result |
|
|
|
} else { |
|
|
|
this.list = [...this.list, ...res.result] |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.list = [...this.list, ...res.result.records] |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
returnPrice(item) { |
|
|
|
uni.navigateTo({ |
|
|
|
|