修试审核弹框优化

This commit is contained in:
bb_pan 2025-09-03 21:53:21 +08:00
parent d618c4feaf
commit c2698de1f4
1 changed files with 74 additions and 54 deletions

View File

@ -183,15 +183,18 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<PopupConfirm ref="popupConfirm" :content="content" />
</template> </template>
<script setup> <script setup>
import { ref, computed } from 'vue' import { ref, computed } from 'vue'
import { getListTestExamineApply,outerAudit } from '@/services/repair/testExamine.js' import { getListTestExamineApply,outerAudit } from '@/services/repair/testExamine.js'
import PopupConfirm from '@/components/PopupConfirm'
import { onShow } from '@dcloudio/uni-app' import { onShow } from '@dcloudio/uni-app'
import { debounce } from 'lodash-es' import { debounce } from 'lodash-es'
const popupConfirm = ref(null)
const content = ref('')
const loading = ref(false) const loading = ref(false)
const total = ref(0) // const total = ref(0) //
const active = ref(1) // tap const active = ref(1) // tap
@ -206,7 +209,7 @@ const queryParams = ref({
endTime: dateArray.value[1] || '', // endTime: dateArray.value[1] || '', //
keyWord: '', // keyWord: '', //
pageNum: 1, pageNum: 1,
pageSize: 5, pageSize: 20,
taskType:5, taskType:5,
appTaskStatus:10, appTaskStatus:10,
}) })
@ -270,11 +273,9 @@ const submitAll = () => {
return return
} }
// //
uni.showModal({ content.value = '确定提交审核吗?'
title: '提示', popupConfirm.value.openPopup().then(async confirm => {
content: '确定提交审核吗?', if (!confirm.data) return
success: async (res) => {
if (res.confirm) {
const params = tableList.value.filter(item => item.checked).map(item => { const params = tableList.value.filter(item => item.checked).map(item => {
return { return {
status: '1', status: '1',
@ -284,9 +285,7 @@ const submitAll = () => {
console.log('🚀 ~ params ~ params:', params) console.log('🚀 ~ params ~ params:', params)
if (loading.value) return if (loading.value) return
loading.value = true loading.value = true
uni.showLoading({ uni.showLoading({ title: '操作中...', mask: true})
mask: true
})
try { try {
const res = await outerAudit(params) const res = await outerAudit(params)
if (res.code === 200) { if (res.code === 200) {
@ -296,21 +295,24 @@ const submitAll = () => {
}) })
onSearchBtn() onSearchBtn()
} }
loading.value = false
uni.hideLoading()
} catch (error) { } catch (error) {
console.log('🚀 ~ submitAll ~ error:', error) console.log('🚀 ~ submitAll ~ error:', error)
} finally {
loading.value = false loading.value = false
uni.hideLoading() uni.hideLoading()
} }
}
}
}) })
} }
// //
const onClick = async (e, item) => { const onClick = async (e, item) => {
console.log(item) console.log(item)
if (e.index === 0) { if (e.index === 0) {
content.value = '确定通过该数据吗?'
popupConfirm.value.openPopup().then(async (confirm) => {
console.log('🚀 ~ onClick ~ confirm:', confirm)
if (!confirm.data) return
try {
uni.showLoading({ title: '操作中...', mask: true })
// //
const res = await outerAudit([{ status: "1",taskId:item.taskId}]) const res = await outerAudit([{ status: "1",taskId:item.taskId}])
if (res.code === 200) { if (res.code === 200) {
@ -320,7 +322,19 @@ const onClick = async (e, item) => {
}) })
onSearchBtn() onSearchBtn()
} }
} catch (error) {
console.log('🚀 ~ onClick ~ error:', error)
} finally {
uni.hideLoading()
}
})
} else { } else {
content.value = '确定驳回该数据吗?'
popupConfirm.value.openPopup().then(async (confirm) => {
console.log('🚀 ~ onClick ~ confirm:', confirm)
if (!confirm.data) return
try {
uni.showLoading({ title: '操作中...', mask: true })
// //
const res = await outerAudit([{ status: "2",taskId:item.taskId}]) const res = await outerAudit([{ status: "2",taskId:item.taskId}])
if (res.code === 200) { if (res.code === 200) {
@ -330,6 +344,12 @@ const onClick = async (e, item) => {
}) })
onSearchBtn() onSearchBtn()
} }
} catch (error) {
console.log('🚀 ~ onClick ~ error:', error)
} finally {
uni.hideLoading()
}
})
} }
} }
@ -391,7 +411,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.pageSize += 5 queryParams.value.pageSize += 10
getTableList() getTableList()
} }
}, 500) }, 500)