diff --git a/api/common.js b/api/common.js
index 2fd07fd..3dba50b 100644
--- a/api/common.js
+++ b/api/common.js
@@ -30,19 +30,35 @@ export const getRegionTree = () => {
* 获取数据字典列表
* @param {Object} params 请求参数(可选)
* @param {string} params.dictType 字典类型(可选,用于筛选特定类型的字典)
+ * @param {number} params.pageNum 页码(可选,默认1)
+ * @param {number} params.pageSize 每页大小(可选,默认200)
* @returns {Promise} 返回字典数据列表
*/
export const getDictDataList = (params = {}) => {
- const queryParams = []
- if (params.dictType) {
- queryParams.push(`dictType=${encodeURIComponent(params.dictType)}`)
- }
- const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : ''
-
- return uni.$uv.http.get(`/system/dict/data/list${queryString}`, {
+ // 设置默认参数
+ const defaultParams = {
+ pageNum: 1,
+ pageSize: 200
+ };
+
+ // 合并参数
+ const requestParams = { ...defaultParams, ...params };
+
+ // 构建查询字符串
+ const searchParams = new URLSearchParams();
+
+ Object.entries(requestParams).forEach(([key, value]) => {
+ if (value !== undefined && value !== null && value !== '') {
+ searchParams.append(key, value.toString());
+ }
+ });
+
+ const queryString = searchParams.toString();
+ const url = `/system/dict/data/list${queryString ? `?${queryString}` : ''}`;
+
+ return uni.$uv.http.get(url, {
custom: {
auth: true
}
});
};
-
diff --git a/api/verify.js b/api/verify.js
index 7dfb94b..a4fe883 100644
--- a/api/verify.js
+++ b/api/verify.js
@@ -1,5 +1,11 @@
import {convertArrayParamsToQuery} from "@/api/utils";
// 审批相关 API
+
+/**
+ * 获取审核列表
+ * @param {Object} params 请求参数
+ * @returns {Promise} 返回审核列表
+ */
export const getVerifyList = (params = {}) => {
// 使用通用函数处理数组参数
const { params: processedParams, queryString } = convertArrayParamsToQuery(params);
@@ -22,4 +28,49 @@ export const getVerifyList = (params = {}) => {
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
+ }
+ });
};
\ No newline at end of file
diff --git a/pages.json b/pages.json
index 7e0b90f..370cb89 100644
--- a/pages.json
+++ b/pages.json
@@ -21,6 +21,13 @@
"navigationBarTitleText": "审批管理"
}
},
+ {
+ "path": "pages/verify/detail/index",
+ "style": {
+ "navigationBarTitleText": "审核详情",
+ "navigationStyle": "custom"
+ }
+ },
{
"path": "pages/login/index",
"style": {
diff --git a/pages/verify/detail/index.vue b/pages/verify/detail/index.vue
new file mode 100644
index 0000000..762433d
--- /dev/null
+++ b/pages/verify/detail/index.vue
@@ -0,0 +1,513 @@
+
+
+
+
+
+ ‹
+ 详情
+ ×
+
+
+
+
+
+
+
+
+
+ 所属项目
+ {{ detailData.projectName || '--' }}
+
+
+ 任务类型
+
+
+
+
+
+ 优先级
+
+
+
+
+
+ 任务状态
+
+
+
+
+
+ 审核状态
+
+
+
+
+
+ 创建人
+ {{ detailData.task?.createName || '--' }}
+
+
+ 创建时间
+ {{ detailData.createTime || '--' }}
+
+
+ 截止时间
+ {{ detailData.task.expireTime }}
+
+
+ 结束时间
+ {{ detailData.task.passTime }}
+
+
+ 审核人
+ {{ detailData.userName }}
+
+
+ 审核时间
+ {{ detailData.verifyTime }}
+
+
+
+
+
+ 任务描述
+ {{ detailData.task.description }}
+
+
+
+
+ 备注
+ {{ detailData.createRemark }}
+
+
+
+
+ 改动值
+
+ 字段
+ {{ changeData.field || '--' }}
+
+
+ 值
+ {{ changeData.value || '--' }}
+
+
+
+
+
+ 评论
+
+
+
+
+
+
+
+ 加载中...
+
+
+
+
+
+ 通过
+
+
+ 驳回
+
+
+
+
+
+
+
+
+
diff --git a/pages/verify/list/index.vue b/pages/verify/list/index.vue
index df67089..c6d23f7 100644
--- a/pages/verify/list/index.vue
+++ b/pages/verify/list/index.vue
@@ -359,12 +359,17 @@ const refreshList = () => {
};
const goHandle = (item) => {
- // 预留处理入口
- uni.showToast({ title: '去处理', icon: 'none' });
+ // 跳转到审核详情页进行处理
+ uni.navigateTo({
+ url: `/pages/verify/detail/index?id=${item.id}`
+ })
};
const goDetail = (item) => {
- // 可跳转到任务详情或审批详情
+ // 跳转到审核详情页
+ uni.navigateTo({
+ url: `/pages/verify/detail/index?id=${item.id}`
+ })
};
onMounted(() => {
diff --git a/store/dict.js b/store/dict.js
index 224782e..aa5c9ee 100644
--- a/store/dict.js
+++ b/store/dict.js
@@ -88,6 +88,8 @@ export const useDictStore = defineStore('dict', {
// 如果响应直接是数组,使用 response
// 如果响应有 rows 字段,使用 response.rows
const dictList = Array.isArray(response) ? response : (response.rows || [])
+
+ console.log('dictList',dictList)
// 过滤掉 status 不为 '0' 的字典项(停用的字典)
const activeDictList = dictList.filter(item => item.status === '0' || item.status === 0)
diff --git a/utils/dict.js b/utils/dict.js
index a407c7f..653812d 100644
--- a/utils/dict.js
+++ b/utils/dict.js
@@ -53,8 +53,10 @@ export const getDictLabels = (dictType, dictValues) => {
* @param {boolean} forceRefresh 是否强制刷新
* @returns {Promise}
*/
-export const initDictData = async (forceRefresh = false) => {
+export const initDictData = async (forceRefresh = true) => {
const dictStore = useDictStore()
+
+ console.log('initDictData',dictStore)
// 先从缓存初始化
dictStore.initFromCache()
// 然后加载最新数据