机具库存查询-优化

This commit is contained in:
bb_pan 2025-07-23 11:25:46 +08:00
parent f73db43be1
commit 828f45aa60
26 changed files with 50 additions and 49 deletions

View File

@ -307,7 +307,7 @@ const getTableList = async (isTap = false) => {
// //
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
if (total.value > tableList.value.length) { if (total.value > tableList.value.length) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList() getTableList()
} }
}) })

View File

@ -129,7 +129,7 @@
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
if (total.value > tableList.value.length) { if (total.value > tableList.value.length) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList() getTableList()
} }
}, 500) }, 500)

View File

@ -159,7 +159,7 @@
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
if (total.value > tableList.value.length) { if (total.value > tableList.value.length) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList() getTableList()
} }
}, 500) }, 500)

View File

@ -175,7 +175,7 @@ const onScrollTolower = debounce(() => {
console.log('触底事件') console.log('触底事件')
// //
if (tableList.value.length < total.value) { if (tableList.value.length < total.value) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList(false) getTableList(false)
} }
}, 500) }, 500)

View File

@ -145,7 +145,7 @@ onShow(() => {
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
console.log('触底事件') console.log('触底事件')
if (total.value > tableList.value.length) { if (total.value > tableList.value.length) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList() getTableList()
} }
}, 500) }, 500)

View File

@ -295,7 +295,7 @@ const onScrollTolower = debounce(() => {
console.log("下一页") console.log("下一页")
// //
if (tableList.value.length < total.value) { if (tableList.value.length < total.value) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList(false) getTableList(false)
} }
}, 500) }, 500)

View File

@ -227,7 +227,7 @@ const onScrollTolower = debounce(() => {
console.log('下一页') console.log('下一页')
// //
if (tableList.value.length < total.value) { if (tableList.value.length < total.value) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList(false) getTableList(false)
} }
}, 500) }, 500)

View File

@ -133,7 +133,7 @@ const onScrollTolower = debounce(() => {
console.log('触底事件') console.log('触底事件')
// //
if (tableList.value.length < total.value) { if (tableList.value.length < total.value) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList(false) getTableList(false)
} }
}, 500) }, 500)

View File

@ -137,7 +137,7 @@ const onScrollTolower = debounce(() => {
console.log('触底事件') console.log('触底事件')
// //
if (tableList.value.length < total.value) { if (tableList.value.length < total.value) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList(false) getTableList(false)
} }
}, 500) }, 500)

View File

@ -226,7 +226,7 @@ const onCodeSearch = () => {
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
// console.log('--') // console.log('--')
if (total.value > codeDeviceList.value.length) { if (total.value > codeDeviceList.value.length) {
queryCodeParams.value.pageNum++ queryCodeParams.value.pageSize += 5
getCodeDeviceListData() getCodeDeviceListData()
} }
}, 500) }, 500)

View File

@ -212,7 +212,7 @@ onShow(() => {
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
console.log('触底事件') console.log('触底事件')
if (total.value > tableList.value.length) { if (total.value > tableList.value.length) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList() getTableList()
} }
}, 500) }, 500)

View File

@ -159,7 +159,7 @@ const onCodeSearch = () => {
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
// console.log('--') // console.log('--')
if (total.value > codeDeviceList.value.length) { if (total.value > codeDeviceList.value.length) {
queryCodeParams.value.pageNum++ queryCodeParams.value.pageSize += 5
getCodeDeviceListData() getCodeDeviceListData()
} }
}, 500) }, 500)

View File

@ -204,7 +204,7 @@ onShow(() => {
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
console.log('触底事件') console.log('触底事件')
if (total.value > tableList.value.length) { if (total.value > tableList.value.length) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList() getTableList()
} }
}, 500) }, 500)

View File

@ -379,7 +379,7 @@ const handleReview = (action) => {
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
// console.log('--') // console.log('--')
if (total.value > codeDeviceList.value.length) { if (total.value > codeDeviceList.value.length) {
queryCodeParams.value.pageNum++ queryCodeParams.value.pageSize += 5
getCodeDeviceListData() getCodeDeviceListData()
} }
}, 500) }, 500)

View File

@ -264,7 +264,7 @@ onShow(() => {
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
console.log('触底事件') console.log('触底事件')
if (total.value > tableList.value.length) { if (total.value > tableList.value.length) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList() getTableList()
} }
}, 500) }, 500)

View File

@ -223,7 +223,7 @@ onShow(() => {
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
console.log('触底事件') console.log('触底事件')
if (total.value > tableList.value.length) { if (total.value > tableList.value.length) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList() getTableList()
} }
}, 500) }, 500)

View File

@ -212,7 +212,7 @@
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
if (total.value > tableList.value.length) { if (total.value > tableList.value.length) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList() getTableList()
} }
}, 500) }, 500)

View File

@ -225,7 +225,7 @@
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
if (total.value > tableList.value.length) { if (total.value > tableList.value.length) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList() getTableList()
} }
}, 500) }, 500)

View File

@ -217,7 +217,7 @@ onShow(() => {
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
console.log('触底事件') console.log('触底事件')
if (total.value > tableList.value.length) { if (total.value > tableList.value.length) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList() getTableList()
} }
}, 500) }, 500)

View File

@ -245,7 +245,7 @@ onShow(() => {
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
console.log('触底事件') console.log('触底事件')
if (total.value > tableList.value.length) { if (total.value > tableList.value.length) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList() getTableList()
} }
}, 500) }, 500)

View File

@ -257,7 +257,7 @@ const getTableList = async (isTap = false) => {
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
// //
if (tableList.value.length < total.value) { if (tableList.value.length < total.value) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList(false) getTableList(false)
} }
}, 500) }, 500)

View File

@ -260,7 +260,7 @@ const getTableList = async (isTap = false) => {
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
// //
if (tableList.value.length < total.value) { if (tableList.value.length < total.value) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList(false) getTableList(false)
} }
}, 500) }, 500)

View File

@ -225,7 +225,7 @@ const getTableList = async (isTap = false) => {
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
// //
if (tableList.value.length < total.value) { if (tableList.value.length < total.value) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList(false) getTableList(false)
} }
}, 500) }, 500)

View File

@ -237,7 +237,7 @@ const getTableList = async (isTap = false) => {
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
// //
if (tableList.value.length < total.value) { if (tableList.value.length < total.value) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList(false) getTableList(false)
} }
}, 500) }, 500)

View File

@ -2,16 +2,16 @@
<!-- 退料任务 --> <!-- 退料任务 -->
<view class="accept page-common"> <view class="accept page-common">
<uni-row :gutter="24" class="search-form"> <uni-row :gutter="24" class="search-form">
<uni-col :span="16"> <uni-col :span="18">
<view> <view>
<uni-easyinput placeholder="请输入内容"/> <uni-easyinput v-model="queryParams.keyWord" placeholder="请输入内容"/>
</view> </view>
</uni-col> </uni-col>
<uni-col :span="4"> <uni-col :span="6">
<view class="search" @click="">查询</view> <view class="search" @click="getTableList">查询</view>
</uni-col> </uni-col>
</uni-row> </uni-row>
<uni-row :gutter="24" class="search-form"> <!-- <uni-row :gutter="24" class="search-form">
<uni-col :span="5"> <uni-col :span="5">
<view style="font-size: 24rpx;">物资类型</view> <view style="font-size: 24rpx;">物资类型</view>
</uni-col> </uni-col>
@ -44,7 +44,7 @@
</view> </view>
</scroll-view> </scroll-view>
</uni-col> </uni-col>
</uni-row> </uni-row> -->
<view style="width:100%;"> <view style="width:100%;">
<uni-table border stripe emptyText=""> <uni-table border stripe emptyText="">
<uni-tr> <uni-tr>
@ -185,26 +185,27 @@ const queryParams = ref({
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
console.log('触底事件') console.log('触底事件')
if (total.value > tableList.value.length) { if (total.value > tableList.value.length) {
queryParams.value.pageNum++ queryParams.value.pageSize += 10
getTableList() getTableList()
} }
}, 500) }, 500)
// //
const getTableList = async (isTap = false) => { const getTableList = async (isTap = false) => {
// console.log('queryParams.value', queryParams.value) const res = await getRetainedEquipmentListApi(queryParams.value);
const res = await getRetainedEquipmentListApi(queryParams.value) const newRows = res?.data?.rows || [];
console.log(res) total.value = res?.data?.total || 0;
total.value = res.data.total
if (isTap) { if (isTap || queryParams.pageNum === 1) {
tableList.value = res.data.rows // tab
tableList.value = newRows;
} else { } else {
if (res.data.rows.length == 0) { // typeId
tableList.value = [] const existingIds = new Set(tableList.value.map(item => item.typeId));
} else { const filteredRows = newRows.filter(item => !existingIds.has(item.typeId));
tableList.value.push(...res.data.rows) tableList.value.push(...filteredRows);
} }
} };
}
const getRetainedEquipmentList = async () => { const getRetainedEquipmentList = async () => {
const res = await getRetainedEquipmentListApi({isApp:1}) const res = await getRetainedEquipmentListApi({isApp:1})
console.log(res) console.log(res)
@ -264,10 +265,10 @@ onLoad(() => {
// //
.search { .search {
height: 80rpx; height: 60rpx;
background: linear-gradient(135deg, #4b8eff 0%, #3784fb 100%); background: linear-gradient(135deg, #4b8eff 0%, #3784fb 100%);
text-align: center; text-align: center;
line-height: 80rpx; line-height: 60rpx;
color: #fff; color: #fff;
border-radius: 12rpx; border-radius: 12rpx;
font-size: 28rpx; font-size: 28rpx;

View File

@ -4,7 +4,7 @@ import { http } from '@/utils/http'
export const getRetainedEquipmentListApi = (data) => { export const getRetainedEquipmentListApi = (data) => {
return http({ return http({
method: 'GET', method: 'GET',
url: '/material/complex_query/getRetainedEquipmentList', url: '/material/complex_query/getPersonNum',
data, data,
}) })
} }