修试审核弹框优化

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,40 +273,33 @@ const submitAll = () => {
return return
} }
// //
uni.showModal({ content.value = '确定提交审核吗?'
title: '提示', popupConfirm.value.openPopup().then(async confirm => {
content: '确定提交审核吗?', if (!confirm.data) return
success: async (res) => { const params = tableList.value.filter(item => item.checked).map(item => {
if (res.confirm) { return {
const params = tableList.value.filter(item => item.checked).map(item => { status: '1',
return { taskId: item.taskId,
status: '1',
taskId: item.taskId,
}
})
console.log('🚀 ~ params ~ params:', params)
if (loading.value) return
loading.value = true
uni.showLoading({
mask: true
})
try {
const res = await outerAudit(params)
if (res.code === 200) {
uni.showToast({
title: '操作成功!',
icon: 'none',
})
onSearchBtn()
}
loading.value = false
uni.hideLoading()
} catch (error) {
console.log('🚀 ~ submitAll ~ error:', error)
loading.value = false
uni.hideLoading()
}
} }
})
console.log('🚀 ~ params ~ params:', params)
if (loading.value) return
loading.value = true
uni.showLoading({ title: '操作中...', mask: true})
try {
const res = await outerAudit(params)
if (res.code === 200) {
uni.showToast({
title: '操作成功!',
icon: 'none',
})
onSearchBtn()
}
} catch (error) {
console.log('🚀 ~ submitAll ~ error:', error)
} finally {
loading.value = false
uni.hideLoading()
} }
}) })
} }
@ -311,25 +307,49 @@ const submitAll = () => {
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 = '确定通过该数据吗?'
const res = await outerAudit([{ status: "1",taskId:item.taskId}]) popupConfirm.value.openPopup().then(async (confirm) => {
if (res.code === 200) { console.log('🚀 ~ onClick ~ confirm:', confirm)
uni.showToast({ if (!confirm.data) return
title: '通过成功!', try {
icon: 'none', uni.showLoading({ title: '操作中...', mask: true })
}) //
onSearchBtn() const res = await outerAudit([{ status: "1",taskId:item.taskId}])
} if (res.code === 200) {
uni.showToast({
title: '通过成功!',
icon: 'none',
})
onSearchBtn()
}
} catch (error) {
console.log('🚀 ~ onClick ~ error:', error)
} finally {
uni.hideLoading()
}
})
} else { } else {
// content.value = '确定驳回该数据吗?'
const res = await outerAudit([{ status: "2",taskId:item.taskId}]) popupConfirm.value.openPopup().then(async (confirm) => {
if (res.code === 200) { console.log('🚀 ~ onClick ~ confirm:', confirm)
uni.showToast({ if (!confirm.data) return
title: '驳回成功!', try {
icon: 'none', uni.showLoading({ title: '操作中...', mask: true })
}) //
onSearchBtn() const res = await outerAudit([{ status: "2",taskId:item.taskId}])
} if (res.code === 200) {
uni.showToast({
title: '驳回成功!',
icon: 'none',
})
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)