修试审核弹框优化

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>
</scroll-view>
</view>
<PopupConfirm ref="popupConfirm" :content="content" />
</template>
<script setup>
import { ref, computed } from 'vue'
import { getListTestExamineApply,outerAudit } from '@/services/repair/testExamine.js'
import PopupConfirm from '@/components/PopupConfirm'
import { onShow } from '@dcloudio/uni-app'
import { debounce } from 'lodash-es'
const popupConfirm = ref(null)
const content = ref('')
const loading = ref(false)
const total = ref(0) //
const active = ref(1) // tap
@ -206,7 +209,7 @@ const queryParams = ref({
endTime: dateArray.value[1] || '', //
keyWord: '', //
pageNum: 1,
pageSize: 5,
pageSize: 20,
taskType:5,
appTaskStatus:10,
})
@ -270,40 +273,33 @@ const submitAll = () => {
return
}
//
uni.showModal({
title: '提示',
content: '确定提交审核吗?',
success: async (res) => {
if (res.confirm) {
const params = tableList.value.filter(item => item.checked).map(item => {
return {
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()
}
content.value = '确定提交审核吗?'
popupConfirm.value.openPopup().then(async confirm => {
if (!confirm.data) return
const params = tableList.value.filter(item => item.checked).map(item => {
return {
status: '1',
taskId: item.taskId,
}
})
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) => {
console.log(item)
if (e.index === 0) {
//
const res = await outerAudit([{ status: "1",taskId:item.taskId}])
if (res.code === 200) {
uni.showToast({
title: '通过成功!',
icon: 'none',
})
onSearchBtn()
}
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}])
if (res.code === 200) {
uni.showToast({
title: '通过成功!',
icon: 'none',
})
onSearchBtn()
}
} catch (error) {
console.log('🚀 ~ onClick ~ error:', error)
} finally {
uni.hideLoading()
}
})
} else {
//
const res = await outerAudit([{ status: "2",taskId:item.taskId}])
if (res.code === 200) {
uni.showToast({
title: '驳回成功!',
icon: 'none',
})
onSearchBtn()
}
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}])
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(() => {
console.log('触底事件')
if (total.value > tableList.value.length) {
queryParams.value.pageSize += 5
queryParams.value.pageSize += 10
getTableList()
}
}, 500)