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

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,44 +307,55 @@
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}) })
},
fetchNewList () {
let that = this
//
that.$api.newInStore.fetchNewBuyDetail({
pageNum: that.pageNum,
pageSize: that.pageSize,
taskId: that.taskId
}).then(res => {
console.log(res);
if (res.data.code == 200) {
that.pageTotal = res.data.total
res.data.rows.forEach(item => {
if (item.status == '0') item.checked = false
switch (item.status) {
case '1':
item.CNstatus = '已入库'
break;
case '2':
item.CNstatus = '入库驳回'
break;
case '0':
item.CNstatus = '待审核'
break;
}
})
that.list = [...that.list, ...res.data.rows]
} else {
uni.showToast({
icon: 'none',
title: res.data.msg
})
}
}).catch(err => {
console.log(err);
})
} }
}, },
onLoad(params) { onLoad(params) {
let that = this let that = this
console.log(params.taskId); console.log(params.taskId);
that.taskId = params.taskId that.taskId = params.taskId
// that.list = []
that.$api.newInStore.fetchNewBuyDetail({ that.fetchNewList()
taskId: params.taskId },
}).then(res => { onReachBottom() {
console.log(res); if (this.list.length >= this.pageTotal) return;
if (res.data.code == 200) { this.pageNum++
for (let i = 0; i < res.data.data.length; i++) { this.fetchNewList()
if (res.data.data[i].status == '0') {
res.data.data[i].checked = false
}
switch (res.data.data[i].status) {
case '1':
res.data.data[i].CNstatus = '已入库'
break;
case '2':
res.data.data[i].CNstatus = '入库驳回'
break;
case '0':
res.data.data[i].CNstatus = '待审核'
break;
}
}
that.list = res.data.data
} else {
uni.showToast({
icon: 'none',
title: res.data.msg
})
}
}).catch(err => {
console.log(err);
})
} }
} }
</script> </script>

View File

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