OfficeSystem/api/verify.js

76 lines
1.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import {convertArrayParamsToQuery} from "@/api/utils";
// 审批相关 API
/**
* 获取审核列表
* @param {Object} params 请求参数
* @returns {Promise} 返回审核列表
*/
export const getVerifyList = (params = {}) => {
// 使用通用函数处理数组参数
const { params: processedParams, queryString } = convertArrayParamsToQuery(params);
// 构建请求 URL去掉查询字符串开头的 &
const url = queryString
? `/bst/verify/list?${queryString}`
: '/bst/verify/list';
return uni.$uv.http.get(url, {
params: {
pageNum: 1,
pageSize: 20,
orderByColumn: 'createTime',
isAsc: 'descending',
bstType: 'UPDATE_TASK',
...processedParams
},
custom: {
auth: true
}
});
};
/**
* 获取审核详情
* @param {string|number} id 审核ID
* @returns {Promise} 返回审核详情
*/
export const getVerifyDetail = (id) => {
return uni.$uv.http.get(`/bst/verify/${id}`, {
custom: {
auth: true
}
});
};
/**
* 审核通过
* @param {string|number} id 审核ID
* @param {string} remark 审核备注(可选)
* @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
}, {
custom: {
auth: true
}
});
};