审核处理和返回审核列表页面刷新
This commit is contained in:
parent
2a7419131e
commit
c42fb56b2c
|
|
@ -44,30 +44,17 @@ export const getVerifyDetail = (id) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核通过
|
* 审核处理(统一接口)
|
||||||
* @param {string|number} id 审核ID
|
* @param {string|number} id 审核ID
|
||||||
* @param {string} remark 审核备注(可选)
|
* @param {string|number} status 审核状态:1-通过,2-驳回
|
||||||
|
* @param {string} msg 审核意见(可选)
|
||||||
* @returns {Promise} 返回接口响应
|
* @returns {Promise} 返回接口响应
|
||||||
*/
|
*/
|
||||||
export const approveVerify = (id, remark = '') => {
|
export const handleVerify = (id, status, msg = '') => {
|
||||||
return uni.$uv.http.put(`/bst/verify/${id}/approve`, {
|
return uni.$uv.http.put('/bst/verify/handle', {
|
||||||
remark: remark
|
id: id.toString(),
|
||||||
}, {
|
status: status.toString(),
|
||||||
custom: {
|
msg: msg
|
||||||
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
|
|
||||||
}, {
|
}, {
|
||||||
custom: {
|
custom: {
|
||||||
auth: true
|
auth: true
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from 'vue'
|
import { ref, computed, onMounted } from 'vue'
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
import { getVerifyDetail, approveVerify, rejectVerify } from '@/api/verify'
|
import { getVerifyDetail, handleVerify } from '@/api/verify'
|
||||||
import { getDictLabel } from '@/utils/dict'
|
import { getDictLabel } from '@/utils/dict'
|
||||||
|
|
||||||
// 页面参数
|
// 页面参数
|
||||||
|
|
@ -277,7 +277,7 @@ const handleApprove = async () => {
|
||||||
title: '处理中...'
|
title: '处理中...'
|
||||||
})
|
})
|
||||||
|
|
||||||
await approveVerify(verifyId.value, commentText.value)
|
await handleVerify(verifyId.value, '1', commentText.value)
|
||||||
|
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
@ -288,6 +288,9 @@ const handleApprove = async () => {
|
||||||
// 刷新详情数据
|
// 刷新详情数据
|
||||||
await loadVerifyDetail(verifyId.value)
|
await loadVerifyDetail(verifyId.value)
|
||||||
|
|
||||||
|
// 发送刷新列表事件
|
||||||
|
uni.$emit('verifyListRefresh')
|
||||||
|
|
||||||
// 延迟返回上一页
|
// 延迟返回上一页
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
|
|
@ -323,7 +326,7 @@ const handleReject = async () => {
|
||||||
title: '处理中...'
|
title: '处理中...'
|
||||||
})
|
})
|
||||||
|
|
||||||
await rejectVerify(verifyId.value, commentText.value)
|
await handleVerify(verifyId.value, '2', commentText.value)
|
||||||
|
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
@ -334,6 +337,9 @@ const handleReject = async () => {
|
||||||
// 刷新详情数据
|
// 刷新详情数据
|
||||||
await loadVerifyDetail(verifyId.value)
|
await loadVerifyDetail(verifyId.value)
|
||||||
|
|
||||||
|
// 发送刷新列表事件
|
||||||
|
uni.$emit('verifyListRefresh')
|
||||||
|
|
||||||
// 延迟返回上一页
|
// 延迟返回上一页
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from 'vue';
|
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||||
import { getVerifyList } from '@/api';
|
import { getVerifyList } from '@/api';
|
||||||
import { usePagination } from '@/composables';
|
import { usePagination } from '@/composables';
|
||||||
import { onReachBottom } from '@dcloudio/uni-app'
|
import { onReachBottom } from '@dcloudio/uni-app'
|
||||||
|
|
@ -384,6 +384,14 @@ onMounted(() => {
|
||||||
filterStatus.value = options.status;
|
filterStatus.value = options.status;
|
||||||
}
|
}
|
||||||
getList(true);
|
getList(true);
|
||||||
|
|
||||||
|
// 监听审核列表刷新事件
|
||||||
|
uni.$on('verifyListRefresh', refreshList);
|
||||||
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
// 取消监听审核列表刷新事件
|
||||||
|
uni.$off('verifyListRefresh', refreshList);
|
||||||
});
|
});
|
||||||
|
|
||||||
onReachBottom(()=>{
|
onReachBottom(()=>{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user