增加loading

This commit is contained in:
bb_pan 2025-07-29 10:05:52 +08:00
parent 2bb643a1e7
commit 08d9468270
27 changed files with 276 additions and 120 deletions

View File

@ -821,7 +821,12 @@
}
},
//
{
"path": "pages/materialsStation/authorizeSignature/authorizeSignature",
"style": {
"navigationStyle": "custom"
}
},
//
{
"path": "pages/materialsStation/materialClerkConfirms/materialClerkConfirms",

View File

@ -289,18 +289,25 @@ const onClick=(e,item,itemIndex)=> {
//
const getTableList = async (isTap = false) => {
console.log('queryParams.value查询参数', queryParams.value)
const res = await getBackList(queryParams.value)
console.log('res列表数据', res)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
if (res.data.rows.length == 0) {
tableList.value = []
try {
uni.showLoading({ title: '加载中',mask: true })
console.log('queryParams.value查询参数', queryParams.value)
const res = await getBackList(queryParams.value)
console.log('res列表数据', res)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
tableList.value.push(...res.data.rows)
if (res.data.rows.length == 0) {
tableList.value = []
} else {
tableList.value.push(...res.data.rows)
}
}
} catch (error) {
console.log('🚀 ~ getTableList ~ error:', error)
} finally {
uni.hideLoading()
}
}

View File

@ -99,6 +99,7 @@ onMounted(() => {
//
const getList = async () => {
try {
uni.showLoading({ title: '加载中', mask: true })
const params = {
startDate: queryForm.dateRange[0],
endDate: queryForm.dateRange[1],
@ -111,6 +112,8 @@ const getList = async () => {
listData.value = res.data
} catch (error) {
console.log('🚀 ~ getList ~ error', error)
} finally {
uni.hideLoading()
}
}

View File

@ -96,6 +96,7 @@ onMounted(() => {
//
const getList = async () => {
try {
uni.showLoading({ title: '加载中', mask: true })
const params = {
startTime: queryForm.dateRange[0],
endTime: queryForm.dateRange[1],
@ -108,6 +109,8 @@ const getList = async () => {
listData.value = res.data
} catch (error) {
console.log('🚀 ~ getList ~ error', error)
} finally {
uni.hideLoading()
}
}

View File

@ -123,6 +123,7 @@ const getTableList = () => {
console.log('🚀 ~ formRef.value.validate ~ valid:', valid)
if (!valid) {
try {
uni.showLoading({ title: '加载中', mask: true })
const params = {
unitId: queryForm.unitId,
projectId: queryForm.proId,
@ -137,6 +138,8 @@ const getTableList = () => {
} catch (error) {
console.log(error)
tableList.value = []
} finally {
uni.hideLoading()
}
}
})

View File

@ -95,6 +95,7 @@ onMounted(() => {
//
const getList = async () => {
try {
uni.showLoading({ title: '加载中', mask: true })
const params = {
startTime: queryForm.dateRange[0],
endTime: queryForm.dateRange[1],
@ -107,6 +108,8 @@ const getList = async () => {
listData.value = res.data
} catch (error) {
console.log('🚀 ~ getList ~ error', error)
} finally {
uni.hideLoading()
}
}

View File

@ -78,6 +78,7 @@ onMounted(() => {
//
const getList = async () => {
try {
uni.showLoading({ title: '加载中', mask: true })
const params = {
startDate: queryForm.dateRange[0],
endDate: queryForm.dateRange[1],
@ -89,6 +90,8 @@ const getList = async () => {
listData.value = res.data
} catch (error) {
console.log('🚀 ~ getList ~ error', error)
} finally {
uni.hideLoading()
}
}

View File

@ -114,6 +114,7 @@ const getList = async () => {
}
console.log('🚀 ~ getList ~ params:', params)
try {
uni.showLoading({ title: '加载中', mask: true })
const res = await getAuthorListApi(params)
console.log('🚀 ~ getList ~ res:', res)
tableList.value = res.data.rows
@ -122,6 +123,8 @@ const getList = async () => {
console.log('🚀 ~ getList ~ error:', error)
tableList.value = []
total.value = 0
} finally {
uni.hideLoading()
}
}

View File

@ -103,11 +103,14 @@ const getList = async () => {
queryParams.startTime = queryParams.range && queryParams.range[0]
queryParams.endTime = queryParams.range && queryParams.range[1]
try {
uni.showLoading({ title: '加载中', mask: true })
const res = await getCompleteOutTaskListApi(queryParams)
tableList.value = res.data.rows
total.value = res.data.total
} catch (error) {
console.log('🚀 ~ getList ~ error:', error)
} finally {
uni.hideLoading()
}
}
const handleDetails = (item) => {

View File

@ -105,6 +105,7 @@ const getList = async () => {
}
console.log('🚀 ~ getList ~ params:', params)
try {
uni.showLoading({ title: '加载中', mask: true })
const res = await getBackListAPI(params)
console.log('🚀 ~ getList ~ res:', res)
if (res.code == 200) {
@ -115,6 +116,8 @@ const getList = async () => {
console.log('🚀 ~ getList ~ error:', error)
tableList.value = []
total.value = 0
} finally {
uni.hideLoading()
}
}

View File

@ -105,6 +105,7 @@ const getList = async () => {
}
console.log('🚀 ~ getList ~ params:', params)
try {
uni.showLoading({ title: '加载中', mask: true })
const res = await getPickingOutboundListAPI(params)
console.log('🚀 ~ getList ~ res:', res)
if (res.code == 200) {
@ -115,6 +116,8 @@ const getList = async () => {
console.log('🚀 ~ getList ~ error:', error)
tableList.value = []
total.value = 0
} finally {
uni.hideLoading()
}
}

View File

@ -130,11 +130,14 @@ const getList = async () => {
status: queryParams.status,
}
try {
uni.showLoading({ title: '加载中', mask: true })
const res = await getTeamWarnDetailsListApi(params)
console.log('🚀 ~ getList ~ res:', res)
tableList.value = res.data
} catch (error) {
console.log('🚀 ~ getList ~ error:', error)
} finally {
uni.hideLoading()
}
}
</script>

View File

@ -141,6 +141,7 @@ const getList = async () => {
}
console.log('🚀 ~ getList ~ params:', params)
try {
uni.showLoading({ title: '加载中', mask: true })
const res = await getBackListAPI(params)
console.log('🚀 ~ getList ~ res:', res)
if (res.code == 200) {
@ -162,6 +163,8 @@ const getList = async () => {
console.log('🚀 ~ getList ~ error:', error)
tableList.value = []
total.value = 0
} finally {
uni.hideLoading()
}
}

View File

@ -147,6 +147,7 @@ const getList = async () => {
}
console.log('🚀 ~ getList ~ params:', params)
try {
uni.showLoading({ title: '加载中', mask: true })
const res = await getPickingOutboundListAPI(params)
console.log('🚀 ~ getList ~ res:', res)
if (res.code == 200) {
@ -177,6 +178,8 @@ const getList = async () => {
console.log('🚀 ~ getList ~ error:', error)
tableList.value = []
total.value = 0
} finally {
uni.hideLoading()
}
}

View File

@ -201,6 +201,7 @@ const getList = async () => {
}
console.log('🚀 ~ getList ~ params:', params)
try {
uni.showLoading({ title: '加载中', mask: true })
let res = null
if (isTeam.value) {
res = await getTeamUseNumList(params)
@ -241,6 +242,8 @@ const getList = async () => {
} catch (error) {
console.error('获取设备列表失败:', error)
equipmentCategories.value = []
} finally {
uni.hideLoading()
}
}

View File

@ -142,6 +142,10 @@ const queryParams = ref({
// }
const getTableList = async (isTap = false) => {
try {
uni.showLoading({
title: '加载中...',
mask: true
})
const { data: res } = await getPurchaseList(queryParams.value)
total.value = res.total
@ -158,6 +162,8 @@ const getTableList = async (isTap = false) => {
console.error('获取列表数据失败:', error)
if (isTap) tableList.value = []
throw error //
} finally {
uni.hideLoading()
}
}

View File

@ -115,18 +115,28 @@ const onChangeDate = (val) => {
//
const getTableList = async (isTap = false) => {
console.log('queryParams.value查询参数', queryParams.value)
const { data: res } = await getPurchaseBindListAPI(queryParams.value)
console.log('res列表数据', res)
total.value = res.total
if (isTap) {
tableList.value = res.rows
} else {
if (res.rows.length == 0) {
tableList.value = []
try {
uni.showLoading({
title: '加载中...',
mask: true
})
console.log('queryParams.value查询参数', queryParams.value)
const { data: res } = await getPurchaseBindListAPI(queryParams.value)
console.log('res列表数据', res)
total.value = res.total
if (isTap) {
tableList.value = res.rows
} else {
tableList.value.push(...res.rows)
if (res.rows.length == 0) {
tableList.value = []
} else {
tableList.value.push(...res.rows)
}
}
} catch (error) {
} finally {
uni.hideLoading()
}
}

View File

@ -261,6 +261,10 @@ const swipeOptions = ref([
//
const getTableList = async (isTap = false) => {
try {
uni.showLoading({
title: '加载中...',
mask: true
})
console.log('queryParams.value查询参数', queryParams.value)
const { data: res } = await getPurchaseList(queryParams.value)
console.log('res列表数据', res)
@ -287,6 +291,8 @@ const getTableList = async (isTap = false) => {
if (isTap) {
tableList.value = []
}
} finally {
uni.hideLoading()
}
}

View File

@ -176,24 +176,34 @@ const onChangeDate = (val) => {
//
const getTableList = async (isTap = false, isSearch = false) => {
if (isSearch) {
//
queryParams.value.pageNum = 1
tableList.value = []
}
console.log('queryParams.value查询参数', queryParams.value)
const res = await getPickingOutboundListAPI(queryParams.value)
console.log('res列表数据', res)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
if (res.data.rows.length == 0) {
try {
uni.showLoading({
title: '加载中...',
mask: true,
})
if (isSearch) {
//
queryParams.value.pageNum = 1
tableList.value = []
} else {
// tableList.value = res.data.rows
tableList.value = [...tableList.value, ...res.data.rows]
}
console.log('queryParams.value查询参数', queryParams.value)
const res = await getPickingOutboundListAPI(queryParams.value)
console.log('res列表数据', res)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
if (res.data.rows.length == 0) {
tableList.value = []
} else {
// tableList.value = res.data.rows
tableList.value = [...tableList.value, ...res.data.rows]
}
}
} catch (error) {
console.log('🚀 ~ getTableList ~ error:', error)
} finally {
uni.hideLoading()
}
}

View File

@ -234,29 +234,39 @@ const onChangeDate = (val) => {
//
const getTableList = async (isTap = false, isSearch = false) => {
if (isSearch) {
//
queryParams.value.pageNum = 1
tableList.value = []
}
console.log('queryParams.value查询参数', queryParams.value)
let res = null
if (opts.value) {
res = await getNoSignListAPI(queryParams.value)
} else {
res = await getPickingOutboundListAPI(queryParams.value)
}
console.log('res列表数据', res)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
if (res.data.rows.length == 0) {
try {
uni.showLoading({
title: '加载中...',
mask: true
})
if (isSearch) {
//
queryParams.value.pageNum = 1
tableList.value = []
} else {
// tableList.value = res.data.rows
tableList.value = [...tableList.value, ...res.data.rows]
}
console.log('queryParams.value查询参数', queryParams.value)
let res = null
if (opts.value) {
res = await getNoSignListAPI(queryParams.value)
} else {
res = await getPickingOutboundListAPI(queryParams.value)
}
console.log('res列表数据', res)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
if (res.data.rows.length == 0) {
tableList.value = []
} else {
// tableList.value = res.data.rows
tableList.value = [...tableList.value, ...res.data.rows]
}
}
} catch (error) {
console.log('🚀 ~ getTableList ~ error:', error)
} finally {
uni.hideLoading()
}
}

View File

@ -224,24 +224,34 @@ const onChangeDate = (val) => {
//
const getTableList = async (isTap = false,isSearch = false) => {
if (isSearch) {
//
queryParams.value.pageNum = 1;
tableList.value = [];
}
console.log('queryParams.value查询参数', queryParams.value)
const res = await getPickingReviewListAPI(queryParams.value)
console.log('res列表数据', res)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
if (res.data.rows.length == 0) {
tableList.value = []
} else {
// tableList.value = res.data.rows
tableList.value = [...tableList.value, ...res.data.rows]
try {
uni.showLoading({
title: '加载中...',
mask: true
})
if (isSearch) {
//
queryParams.value.pageNum = 1;
tableList.value = [];
}
console.log('queryParams.value查询参数', queryParams.value)
const res = await getPickingReviewListAPI(queryParams.value)
console.log('res列表数据', res)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
if (res.data.rows.length == 0) {
tableList.value = []
} else {
// tableList.value = res.data.rows
tableList.value = [...tableList.value, ...res.data.rows]
}
}
} catch (error) {
console.log('🚀 ~ getTableList ~ error:', error)
} finally {
uni.hideLoading()
}
}

View File

@ -194,17 +194,27 @@ const onSearchBtn = () => {
//
const getTableList = async (isTap = false) => {
console.log('queryParams.value查询参数', queryParams.value)
const res = await getLossAssessmentListAPI(queryParams.value)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
if (res.data.rows.length == 0) {
tableList.value = []
try {
uni.showLoading({
title: '加载中',
mask: true
})
console.log('queryParams.value查询参数', queryParams.value)
const res = await getLossAssessmentListAPI(queryParams.value)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
tableList.value.push(...res.data.rows)
if (res.data.rows.length == 0) {
tableList.value = []
} else {
tableList.value.push(...res.data.rows)
}
}
} catch (error) {
console.log('🚀 ~ getTableList ~ error:', error)
} finally {
uni.hideLoading()
}
}

View File

@ -208,12 +208,22 @@
}
const getTableList = async (isTap = false) => {
const res = await getList(queryParams.value)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
tableList.value.push(...res.data.rows)
try {
uni.showLoading({
title: '加载中...',
mask: true
})
const res = await getList(queryParams.value)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
tableList.value.push(...res.data.rows)
}
} catch (error) {
console.log('🚀 ~ getTableList ~ error:', error)
} finally {
uni.hideLoading()
}
}

View File

@ -192,17 +192,27 @@ const onSearchBtn = () => {
//
const getTableList = async (isTap = false) => {
console.log('queryParams.value查询参数', queryParams.value)
const res = await getRepairListAPI(queryParams.value)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
if (res.data.rows.length == 0) {
tableList.value = []
} else {
try {
uni.showLoading({
title: '加载中',
mask: true
})
console.log('queryParams.value查询参数', queryParams.value)
const res = await getRepairListAPI(queryParams.value)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
if (res.data.rows.length == 0) {
tableList.value = []
} else {
tableList.value = res.data.rows
}
}
} catch (error) {
console.log('🚀 ~ getTableList ~ error:', error)
} finally {
uni.hideLoading()
}
}

View File

@ -335,6 +335,10 @@ const getTableList = async (isTap = false) => {
? tableList.value.filter(item => item && item.checked).map(item => item.taskId)
: []
try {
uni.showLoading({
title: '加载中...',
mask: true
})
const res = await getListTestExamineApply(queryParams.value)
total.value = res?.data?.total || 0
tableList.value = Array.isArray(res?.data?.rows) ? res.data.rows : []
@ -348,6 +352,8 @@ const getTableList = async (isTap = false) => {
console.error('获取列表数据失败:', error)
total.value = 0
tableList.value = []
} finally {
uni.hideLoading()
}
}

View File

@ -217,16 +217,26 @@ const onSearchBtn = () => {
//
const getTableList = async (isTap = false) => {
// console.log('queryParams.value', queryParams.value)
const res = await getRepairedList(queryParams.value)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
if (res.data.rows.length == 0) {
tableList.value = []
try {
uni.showLoading({
title: '加载中...',
mask: true
})
const res = await getRepairedList(queryParams.value)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
tableList.value.push(...res.data.rows)
if (res.data.rows.length == 0) {
tableList.value = []
} else {
tableList.value.push(...res.data.rows)
}
}
} catch (error) {
console.log('🚀 ~ getTableList ~ error:', error)
} finally {
uni.hideLoading()
}
}

View File

@ -191,19 +191,26 @@ const onScrollTolower = debounce(() => {
}, 500)
//
const getTableList = async (isTap = false) => {
const res = await getRetainedEquipmentListApi(queryParams.value);
const newRows = res?.data?.rows || [];
total.value = res?.data?.total || 0;
try {
uni.showLoading({ title: '加载中', mask: true })
const res = await getRetainedEquipmentListApi(queryParams.value);
const newRows = res?.data?.rows || [];
total.value = res?.data?.total || 0;
if (isTap || queryParams.pageNum === 1) {
// tab
tableList.value = newRows;
} else {
// typeId
const existingIds = new Set(tableList.value.map(item => item.typeId));
const filteredRows = newRows.filter(item => !existingIds.has(item.typeId));
tableList.value.push(...filteredRows);
}
if (isTap || queryParams.pageNum === 1) {
// tab
tableList.value = newRows;
} else {
// typeId
const existingIds = new Set(tableList.value.map(item => item.typeId));
const filteredRows = newRows.filter(item => !existingIds.has(item.typeId));
tableList.value.push(...filteredRows);
}
} catch (error) {
console.log('🚀 ~ getTableList ~ error:', error)
} finally {
uni.hideLoading()
}
};
const getRetainedEquipmentList = async () => {