宁夏新购详情页面新增分页

This commit is contained in:
FrancisHu 2024-07-31 15:51:28 +08:00
parent 4479ab95f8
commit 3803a53b2e
4 changed files with 49 additions and 34 deletions

View File

@ -283,7 +283,7 @@ const newInStore = {
}, },
async fetchNewBuyDetail (data = {} , header = {}){ async fetchNewBuyDetail (data = {} , header = {}){
return await Http.get( return await Http.get(
HttpConfig.basePath, HttpConfig.materialPath,
HttpConfig.serviceUrl.newInStore.fetchNewBuyDetail, HttpConfig.serviceUrl.newInStore.fetchNewBuyDetail,
data, data,
header header

View File

@ -94,7 +94,7 @@ class HttpConfig {
}, },
newInStore: { newInStore: {
fetchNewInStoreList: '/purchaseCheckInfo/putInList', // 获取新购入库列表 fetchNewInStoreList: '/purchaseCheckInfo/putInList', // 获取新购入库列表
fetchNewBuyDetail: '/purchaseInput/putinDetails', // 获取新购入库详情 fetchNewBuyDetail: '/purchaseMacode/putinDetails', // 获取新购入库详情
subNewBuy: '/purchaseInput/manageStatus', // 新购明细提交审核 subNewBuy: '/purchaseInput/manageStatus', // 新购明细提交审核
}, },
fix: { fix: {

View File

@ -104,6 +104,9 @@
export default { export default {
data() { data() {
return { return {
pageNum: 1,
pageSize: 10,
pageTotal: 0,
showLoading: false, showLoading: false,
taskId: '', taskId: '',
allChecked: false, allChecked: false,
@ -304,35 +307,33 @@
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}) })
}
}, },
onLoad(params) { fetchNewList () {
let that = this let that = this
console.log(params.taskId);
that.taskId = params.taskId
// //
that.$api.newInStore.fetchNewBuyDetail({ that.$api.newInStore.fetchNewBuyDetail({
taskId: params.taskId pageNum: that.pageNum,
pageSize: that.pageSize,
taskId: that.taskId
}).then(res => { }).then(res => {
console.log(res); console.log(res);
if (res.data.code == 200) { if (res.data.code == 200) {
for (let i = 0; i < res.data.data.length; i++) { that.pageTotal = res.data.total
if (res.data.data[i].status == '0') { res.data.rows.forEach(item => {
res.data.data[i].checked = false if (item.status == '0') item.checked = false
} switch (item.status) {
switch (res.data.data[i].status) {
case '1': case '1':
res.data.data[i].CNstatus = '已入库' item.CNstatus = '已入库'
break; break;
case '2': case '2':
res.data.data[i].CNstatus = '入库驳回' item.CNstatus = '入库驳回'
break; break;
case '0': case '0':
res.data.data[i].CNstatus = '待审核' item.CNstatus = '待审核'
break; break;
} }
} })
that.list = res.data.data that.list = [...that.list, ...res.data.rows]
} else { } else {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
@ -343,6 +344,19 @@
console.log(err); console.log(err);
}) })
} }
},
onLoad(params) {
let that = this
console.log(params.taskId);
that.taskId = params.taskId
that.list = []
that.fetchNewList()
},
onReachBottom() {
if (this.list.length >= this.pageTotal) return;
this.pageNum++
this.fetchNewList()
}
} }
</script> </script>

View File

@ -249,6 +249,7 @@
}, },
onShow() { onShow() {
let that = this let that = this
that.fetchMaterialList = []
that.getNewList() that.getNewList()
}, },
onReachBottom() { onReachBottom() {