修试审核弹框优化
This commit is contained in:
parent
d618c4feaf
commit
c2698de1f4
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue