定损、维修列表标记位置回滚

This commit is contained in:
hayu 2026-01-22 10:50:05 +08:00
parent d94835f6c5
commit fcc4e79283
4 changed files with 276 additions and 226 deletions

View File

@ -161,6 +161,9 @@ const onClick = async (e, item) => {
//
console.log('驳回')
console.log(item)
//
uni.setStorageSync('fromDetailOperation', true)
const parm = {
ids:item.ids
}
@ -176,10 +179,15 @@ const onClick = async (e, item) => {
}
const search = () => {
console.log('🚀 ~ search ~ keyWord:', keyWord.value)
//
uni.setStorageSync('fromDetailOperation', true)
getRepairDetailsData()
}
const submit = async () => {
//
uni.setStorageSync('fromDetailOperation', true)
//
const res = await repairSubmitAPI([{taskId: taskId.value}])
if (res.code === 200) {
@ -237,6 +245,9 @@ const onQualified = async () => {
})
return
}
//
uni.setStorageSync('fromDetailOperation', true)
//
uni.showModal({
title: '提示',
@ -275,6 +286,9 @@ const onQualified = async () => {
//
const onRepairItem = (item) => {
console.log(item)
//
uni.setStorageSync('fromDetailOperation', false)
let codingUrl = ''
if (item.manageType === 0) {//
// if(item.status==0){
@ -298,8 +312,8 @@ const onRepairItem = (item) => {
})
}
}
}
onShow(() => {
getRepairDetailsData()
})

View File

@ -143,6 +143,8 @@ const showCustomModal = ref(false)
const currentItem = ref(null)
const modalTitle = ref('提示')
const modalContent = ref('是否确认进行定损?')
//
const shouldRestoreScroll = ref(true)
//
const queryParams = ref({
startTime: dateArray.value[0] || '',
@ -185,6 +187,8 @@ const onClick = async (e, item) => {
title: '提交成功!',
icon: 'none',
})
shouldRestoreScroll.value = false
uni.setStorageSync('fromDetailOperation', true)
queryParams.value.pageNum = 1
tableList.value = []
getTableList(true)
@ -204,6 +208,8 @@ const onClick = async (e, item) => {
title: '驳回成功!',
icon: 'none',
})
shouldRestoreScroll.value = false
uni.setStorageSync('fromDetailOperation', true)
queryParams.value.pageNum = 1
tableList.value = []
getTableList(true)
@ -220,6 +226,8 @@ const onChangeDate = (val) => {
//
const onSearchBtn = () => {
shouldRestoreScroll.value = false
uni.setStorageSync('fromDetailOperation', true)
queryParams.value.pageNum = 1
tableList.value = []
getTableList(true)
@ -234,10 +242,7 @@ const getTableList = async (isTap = false) => {
})
console.log('queryParams.value查询参数', queryParams.value)
const res = await getLossAssessmentListAPI(queryParams.value)
setTimeout(() => {
scrollTop.value = uni.getStorageSync('scrollTop') || 0
console.log('🚀 ~ scrollTop.value:', scrollTop.value)
}, 400)
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
@ -272,6 +277,29 @@ const getTableList = async (isTap = false) => {
// })
onShow(() => {
//
const fromDetailOperation = uni.getStorageSync('fromDetailOperation')
if (shouldRestoreScroll.value && !fromDetailOperation) {
//
setTimeout(() => {
const cachedScrollTop = uni.getStorageSync('scrollTop')
if (cachedScrollTop) {
scrollTop.value = cachedScrollTop
//
setTimeout(() => {
scrollTop.value = cachedScrollTop + 0.1
}, 50)
}
}, 100)
}
//
uni.removeStorageSync('fromDetailOperation')
//
shouldRestoreScroll.value = true
//
tableList.value = []
total.value = 0
getTableList(true)
@ -298,6 +326,8 @@ const onScrollTolower = debounce(() => {
// tap
const changeTab = (index) => {
active.value = index
shouldRestoreScroll.value = false
uni.setStorageSync('fromDetailOperation', true)
uni.setStorageSync('scrollTop', 0)
uni.setStorageSync('activeTab', index)
uni.removeStorageSync('queryParams')
@ -316,6 +346,11 @@ const changeTab = (index) => {
const handleItem = (item) => {
console.log(item)
currentItem.value = item
//
shouldRestoreScroll.value = true
uni.setStorageSync('fromDetailOperation', false)
if(item.repairStatusCode == "0") {
// 使
showCustomModal.value = true
@ -333,49 +368,15 @@ const handleItem = (item) => {
} else {
uni.navigateTo({ url: `/pages/repair/equipAssessment/view?taskId=${item.taskId}` })
}
// if(item.repairStatusCode=="0"){
// //
// uni.showModal({
// title: '',
// content: '',
// confirmText: '',
// cancelText: '',
// success: async (res) => {
// if (res.confirm) {
// //
// uni.navigateTo({ url: `/pages/repair/equipAssessment/details?taskId=${item.taskId}` })
// } else if (res.cancel) {
// //
// const res = await updateRepairStatusAPI({taskId: item.taskId})
// if(res.code==200){
// uni.showToast({
// title: '',
// icon: 'none',
// })
// setTimeout(() => {
// queryParams.value.pageNum = 1
// tableList.value = []
// getTableList(true)
// }, 1000)
//
// }
// }
// }
// })
// // uni.navigateTo({ url: `/pages/repair/equipAssessment/details?taskId=${item.taskId}` })
// }else{
// uni.navigateTo({ url: `/pages/repair/equipAssessment/view?taskId=${item.taskId}` })
// }
}
//
const handleConfirm = () => {
if (countdown.value > 0) return
showCustomModal.value = false
//
shouldRestoreScroll.value = true
uni.setStorageSync('fromDetailOperation', false)
uni.navigateTo({ url: `/pages/repair/equipAssessment/details?taskId=${currentItem.value.taskId}` })
}
@ -383,6 +384,10 @@ const handleConfirm = () => {
const handleCancel = async () => {
if (countdown.value > 0) return
showCustomModal.value = false
//
shouldRestoreScroll.value = false
uni.setStorageSync('fromDetailOperation', true)
const res = await updateRepairStatusAPI({taskId: currentItem.value.taskId})
if(res.code == 200) {
uni.showToast({

View File

@ -106,6 +106,8 @@ const taskId = ref('')
const keyWord = ref('')
const search = () => {
console.log('🚀 ~ search ~ keyWord:', keyWord.value)
//
uni.setStorageSync('fromDetailOperation', true)
getRepairDetailsData()
}
//
@ -166,6 +168,10 @@ const onQualified = async () => {
})
return
}
//
uni.setStorageSync('fromDetailOperation', true)
//
const ids = []
detailsList.value.forEach((e) => {
@ -177,6 +183,7 @@ const onQualified = async () => {
}
}
})
console.log(ids)
const res = await auditRepairPass(ids)
if (res.code === 200) {
@ -229,6 +236,10 @@ const handleSubmit = async () => {
if (isSubmit.value) return
isSubmit.value = true
uni.showLoading({ title: '提交中...', mask: true })
//
uni.setStorageSync('fromDetailOperation', true)
//
const res = await repairSubmitAPI([{ taskId: taskId.value }])
if (res.code === 200) {

View File

@ -146,6 +146,7 @@ const queryParams = ref({
pageSize: 20,
})
const scrollTop = ref(0) //
const shouldRestoreScroll = ref(true)
//
const options = ref([
@ -249,8 +250,24 @@ const getTableList = async (isTap = false) => {
onShow(() => {
tableList.value = []
total.value = 0
//
const cachedScrollTop = uni.getStorageSync('scrollTop')
const cachedQueryParams = uni.getStorageSync('queryParams')
const cachedActiveTab = uni.getStorageSync('activeTab')
// /
if (shouldRestoreScroll.value && cachedScrollTop) {
scrollTop.value = cachedScrollTop
// DOM
setTimeout(() => {
scrollTop.value = cachedScrollTop
}, 100)
}
//
shouldRestoreScroll.value = true
//
getTableList(true)
})
@ -260,6 +277,7 @@ const onScroll = (e) => {
timer = setTimeout(() => {
uni.setStorageSync('scrollTop', e.detail.scrollTop)
uni.setStorageSync('queryParams', JSON.stringify(queryParams.value))
uni.setStorageSync('activeTab', activeTab.value)
}, 500)
}
@ -292,12 +310,14 @@ const changeTab = (index) => {
//
const handleItem = (item) => {
console.log(item)
shouldRestoreScroll.value = true
uni.setStorageSync('fromDetailOperation', false)
if(item.repairStatusCode=="0" || item.repairStatusCode=="4" || item.repairStatusCode=="3"){
uni.navigateTo({ url: `/pages/repair/repairManage/details?taskId=${item.taskId}` })
}else{
uni.navigateTo({ url: `/pages/repair/repairManage/view?taskId=${item.taskId}` })
}
}
//