审核处理和返回审核列表页面刷新

This commit is contained in:
WindowBird 2025-11-14 14:44:01 +08:00
parent 2a7419131e
commit c42fb56b2c
3 changed files with 26 additions and 25 deletions

View File

@ -44,30 +44,17 @@ export const getVerifyDetail = (id) => {
};
/**
* 审核通过
* 审核处理统一接口
* @param {string|number} id 审核ID
* @param {string} remark 审核备注可选
* @param {string|number} status 审核状态1-通过2-驳回
* @param {string} msg 审核意见可选
* @returns {Promise} 返回接口响应
*/
export const approveVerify = (id, remark = '') => {
return uni.$uv.http.put(`/bst/verify/${id}/approve`, {
remark: remark
}, {
custom: {
auth: true
}
});
};
/**
* 审核驳回
* @param {string|number} id 审核ID
* @param {string} remark 审核备注可选
* @returns {Promise} 返回接口响应
*/
export const rejectVerify = (id, remark = '') => {
return uni.$uv.http.put(`/bst/verify/${id}/reject`, {
remark: remark
export const handleVerify = (id, status, msg = '') => {
return uni.$uv.http.put('/bst/verify/handle', {
id: id.toString(),
status: status.toString(),
msg: msg
}, {
custom: {
auth: true

View File

@ -147,7 +147,7 @@
<script setup>
import { ref, computed, onMounted } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { getVerifyDetail, approveVerify, rejectVerify } from '@/api/verify'
import { getVerifyDetail, handleVerify } from '@/api/verify'
import { getDictLabel } from '@/utils/dict'
//
@ -277,7 +277,7 @@ const handleApprove = async () => {
title: '处理中...'
})
await approveVerify(verifyId.value, commentText.value)
await handleVerify(verifyId.value, '1', commentText.value)
uni.hideLoading()
uni.showToast({
@ -288,6 +288,9 @@ const handleApprove = async () => {
//
await loadVerifyDetail(verifyId.value)
//
uni.$emit('verifyListRefresh')
//
setTimeout(() => {
uni.navigateBack()
@ -323,7 +326,7 @@ const handleReject = async () => {
title: '处理中...'
})
await rejectVerify(verifyId.value, commentText.value)
await handleVerify(verifyId.value, '2', commentText.value)
uni.hideLoading()
uni.showToast({
@ -334,6 +337,9 @@ const handleReject = async () => {
//
await loadVerifyDetail(verifyId.value)
//
uni.$emit('verifyListRefresh')
//
setTimeout(() => {
uni.navigateBack()

View File

@ -182,7 +182,7 @@
</template>
<script setup>
import { ref, computed, onMounted } from 'vue';
import { ref, computed, onMounted, onUnmounted } from 'vue';
import { getVerifyList } from '@/api';
import { usePagination } from '@/composables';
import { onReachBottom } from '@dcloudio/uni-app'
@ -384,6 +384,14 @@ onMounted(() => {
filterStatus.value = options.status;
}
getList(true);
//
uni.$on('verifyListRefresh', refreshList);
});
onUnmounted(() => {
//
uni.$off('verifyListRefresh', refreshList);
});
onReachBottom(()=>{