增加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", "path": "pages/materialsStation/materialClerkConfirms/materialClerkConfirms",

View File

@ -289,18 +289,25 @@ const onClick=(e,item,itemIndex)=> {
// //
const getTableList = async (isTap = false) => { const getTableList = async (isTap = false) => {
console.log('queryParams.value查询参数', queryParams.value) try {
const res = await getBackList(queryParams.value) uni.showLoading({ title: '加载中',mask: true })
console.log('res列表数据', res) console.log('queryParams.value查询参数', queryParams.value)
total.value = res.data.total const res = await getBackList(queryParams.value)
if (isTap) { console.log('res列表数据', res)
tableList.value = res.data.rows total.value = res.data.total
} else { if (isTap) {
if (res.data.rows.length == 0) { tableList.value = res.data.rows
tableList.value = []
} else { } 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 () => { const getList = async () => {
try { try {
uni.showLoading({ title: '加载中', mask: true })
const params = { const params = {
startDate: queryForm.dateRange[0], startDate: queryForm.dateRange[0],
endDate: queryForm.dateRange[1], endDate: queryForm.dateRange[1],
@ -111,6 +112,8 @@ const getList = async () => {
listData.value = res.data listData.value = res.data
} catch (error) { } catch (error) {
console.log('🚀 ~ getList ~ error', error) console.log('🚀 ~ getList ~ error', error)
} finally {
uni.hideLoading()
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -176,24 +176,34 @@ const onChangeDate = (val) => {
// //
const getTableList = async (isTap = false, isSearch = false) => { const getTableList = async (isTap = false, isSearch = false) => {
if (isSearch) { try {
// uni.showLoading({
queryParams.value.pageNum = 1 title: '加载中...',
tableList.value = [] mask: true,
} })
console.log('queryParams.value查询参数', queryParams.value) if (isSearch) {
const res = await getPickingOutboundListAPI(queryParams.value) //
console.log('res列表数据', res) queryParams.value.pageNum = 1
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
if (res.data.rows.length == 0) {
tableList.value = [] 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) => { const getTableList = async (isTap = false, isSearch = false) => {
if (isSearch) { try {
// uni.showLoading({
queryParams.value.pageNum = 1 title: '加载中...',
tableList.value = [] mask: true
} })
console.log('queryParams.value查询参数', queryParams.value) if (isSearch) {
let res = null //
if (opts.value) { queryParams.value.pageNum = 1
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 = [] 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) => { const getTableList = async (isTap = false,isSearch = false) => {
if (isSearch) { try {
// uni.showLoading({
queryParams.value.pageNum = 1; title: '加载中...',
tableList.value = []; mask: true
} })
console.log('queryParams.value查询参数', queryParams.value) if (isSearch) {
const res = await getPickingReviewListAPI(queryParams.value) //
console.log('res列表数据', res) queryParams.value.pageNum = 1;
total.value = res.data.total tableList.value = [];
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]
} }
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) => { const getTableList = async (isTap = false) => {
console.log('queryParams.value查询参数', queryParams.value) try {
const res = await getLossAssessmentListAPI(queryParams.value) uni.showLoading({
total.value = res.data.total title: '加载中',
if (isTap) { mask: true
tableList.value = res.data.rows })
} else { console.log('queryParams.value查询参数', queryParams.value)
if (res.data.rows.length == 0) { const res = await getLossAssessmentListAPI(queryParams.value)
tableList.value = [] total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else { } 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 getTableList = async (isTap = false) => {
const res = await getList(queryParams.value) try {
total.value = res.data.total uni.showLoading({
if (isTap) { title: '加载中...',
tableList.value = res.data.rows mask: true
} else { })
tableList.value.push(...res.data.rows) 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) => { const getTableList = async (isTap = false) => {
console.log('queryParams.value查询参数', queryParams.value) try {
const res = await getRepairListAPI(queryParams.value) uni.showLoading({
total.value = res.data.total title: '加载中',
if (isTap) { mask: true
tableList.value = res.data.rows })
} else { console.log('queryParams.value查询参数', queryParams.value)
if (res.data.rows.length == 0) { const res = await getRepairListAPI(queryParams.value)
tableList.value = [] total.value = res.data.total
} else { if (isTap) {
tableList.value = res.data.rows 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) ? tableList.value.filter(item => item && item.checked).map(item => item.taskId)
: [] : []
try { try {
uni.showLoading({
title: '加载中...',
mask: true
})
const res = await getListTestExamineApply(queryParams.value) const res = await getListTestExamineApply(queryParams.value)
total.value = res?.data?.total || 0 total.value = res?.data?.total || 0
tableList.value = Array.isArray(res?.data?.rows) ? res.data.rows : [] tableList.value = Array.isArray(res?.data?.rows) ? res.data.rows : []
@ -348,6 +352,8 @@ const getTableList = async (isTap = false) => {
console.error('获取列表数据失败:', error) console.error('获取列表数据失败:', error)
total.value = 0 total.value = 0
tableList.value = [] tableList.value = []
} finally {
uni.hideLoading()
} }
} }

View File

@ -217,16 +217,26 @@ const onSearchBtn = () => {
// //
const getTableList = async (isTap = false) => { const getTableList = async (isTap = false) => {
// console.log('queryParams.value', queryParams.value) // console.log('queryParams.value', queryParams.value)
const res = await getRepairedList(queryParams.value) try {
total.value = res.data.total uni.showLoading({
if (isTap) { title: '加载中...',
tableList.value = res.data.rows mask: true
} else { })
if (res.data.rows.length == 0) { const res = await getRepairedList(queryParams.value)
tableList.value = [] total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else { } 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) }, 500)
// //
const getTableList = async (isTap = false) => { const getTableList = async (isTap = false) => {
const res = await getRetainedEquipmentListApi(queryParams.value); try {
const newRows = res?.data?.rows || []; uni.showLoading({ title: '加载中', mask: true })
total.value = res?.data?.total || 0; const res = await getRetainedEquipmentListApi(queryParams.value);
const newRows = res?.data?.rows || [];
if (isTap || queryParams.pageNum === 1) { total.value = res?.data?.total || 0;
// tab
tableList.value = newRows; if (isTap || queryParams.pageNum === 1) {
} else { // tab
// typeId tableList.value = newRows;
const existingIds = new Set(tableList.value.map(item => item.typeId)); } else {
const filteredRows = newRows.filter(item => !existingIds.has(item.typeId)); // typeId
tableList.value.push(...filteredRows); 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 () => { const getRetainedEquipmentList = async () => {