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