审批调整
This commit is contained in:
parent
2d2314c336
commit
dea3be0d4a
@ -145,12 +145,6 @@ export function getGwFlowByIdApi(id: string) {
|
|||||||
return get(`/api/gw/getGwFlowById?id=${id}`);
|
return get(`/api/gw/getGwFlowById?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 转办公文
|
|
||||||
*/
|
|
||||||
export function gwTransferApi(params: any) {
|
|
||||||
return post('/api/gw/transfer', params);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询某人的待办和已办公文
|
* 分页查询某人的待办和已办公文
|
||||||
@ -158,3 +152,47 @@ export function gwTransferApi(params: any) {
|
|||||||
export function findUserTodosApi(approveStatus: string, jsId: string, pageNum: number = 1, pageSize: number = 20) {
|
export function findUserTodosApi(approveStatus: string, jsId: string, pageNum: number = 1, pageSize: number = 20) {
|
||||||
return get('/api/gw/findUserTodos', { approveStatus, jsId, pageNum, pageSize });
|
return get('/api/gw/findUserTodos', { approveStatus, jsId, pageNum, pageSize });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===== 新增:统一的流程接口 =====
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公文申请
|
||||||
|
*/
|
||||||
|
export function gwSqApi(params: any) {
|
||||||
|
return post('/api/gw/sq', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公文审批
|
||||||
|
*/
|
||||||
|
export function gwSpApi(params: any) {
|
||||||
|
return post('/api/gw/sp', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公文转办
|
||||||
|
*/
|
||||||
|
export function gwTransferApi(params: any) {
|
||||||
|
return post('/api/gw/transfer', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公文终止
|
||||||
|
*/
|
||||||
|
export function gwStopApi(params: any) {
|
||||||
|
return post('/api/gw/stop', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公文重新提交
|
||||||
|
*/
|
||||||
|
export function gwCxtjApi(params: any) {
|
||||||
|
return post('/api/gw/cxtj', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公文协调
|
||||||
|
*/
|
||||||
|
export function gwXtApi(params: any) {
|
||||||
|
return post('/api/gw/xt', params);
|
||||||
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -119,6 +119,7 @@ import { onShow } from "@dcloudio/uni-app";
|
|||||||
import { navigateTo } from "@/utils/uniapp";
|
import { navigateTo } from "@/utils/uniapp";
|
||||||
import BasicSearch from "@/components/BasicSearch/Search.vue";
|
import BasicSearch from "@/components/BasicSearch/Search.vue";
|
||||||
import { gwFindPageApi, findUserTodosApi } from "@/api/routine/gw";
|
import { gwFindPageApi, findUserTodosApi } from "@/api/routine/gw";
|
||||||
|
import { gwSqApi, gwSpApi, gwTransferApi, gwStopApi, gwCxtjApi, gwXtApi } from "@/api/routine/gw";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { imagUrl } from "@/utils";
|
import { imagUrl } from "@/utils";
|
||||||
import { useUserStore } from "@/store/modules/user";
|
import { useUserStore } from "@/store/modules/user";
|
||||||
@ -148,6 +149,7 @@ interface GwListItem {
|
|||||||
fileFormat?: string;
|
fileFormat?: string;
|
||||||
files?: FileInfo[];
|
files?: FileInfo[];
|
||||||
spZbqd?: string; // 审批人ID(逗号分隔,从审批人表查询)
|
spZbqd?: string; // 审批人ID(逗号分隔,从审批人表查询)
|
||||||
|
spResult?: string; // 审批结果:A-待处理,B-同意,C-驳回,D-终止
|
||||||
tjrtime?: string; // 提交时间
|
tjrtime?: string; // 提交时间
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
@ -278,8 +280,8 @@ const loadUserTodos = async (approveStatus: string, jsId: string) => {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
uni.showLoading({ title: '加载中...' });
|
uni.showLoading({ title: '加载中...' });
|
||||||
|
|
||||||
// 只调用 findUserTodos 分页接口
|
// 调用 findUserTodos 分页接口,使用合理的分页大小
|
||||||
const response = await findUserTodosApi(approveStatus, jsId, 1, 1000); // 设置较大的pageSize以获取所有数据
|
const response = await findUserTodosApi(approveStatus, jsId, 1, 50); // 使用合理的分页大小
|
||||||
|
|
||||||
// 检查响应格式 - 根据实际返回的数据结构
|
// 检查响应格式 - 根据实际返回的数据结构
|
||||||
const result = (response as any).data || response;
|
const result = (response as any).data || response;
|
||||||
@ -374,27 +376,58 @@ const getStatusText = (status: string) => {
|
|||||||
return statusMap[status] || "未知";
|
return statusMap[status] || "未知";
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取按钮文本
|
// 获取按钮文本 - 参考教师请假的逻辑
|
||||||
const getButtonText = (item: GwListItem) => {
|
const getButtonText = (item: GwListItem) => {
|
||||||
const currentTeacherId = getCurrentTeacherId();
|
const currentTeacherId = getCurrentTeacherId();
|
||||||
const { gwStatus, spZbqd } = item;
|
const { gwStatus, spZbqd, spResult } = item;
|
||||||
|
|
||||||
// 如果当前教师ID在spZbqd中,且状态为B(提交),则显示"审批"
|
// 如果是待办状态且当前用户是审批人,显示"审批"
|
||||||
if (currentTeacherId && spZbqd && gwStatus === 'B') {
|
if (currentTeacherId && spZbqd && gwStatus === 'B' && activeTab.value === 'pending') {
|
||||||
const approverIds = spZbqd.split(',').map(id => id.trim());
|
const approverIds = spZbqd.split(',').map(id => id.trim());
|
||||||
if (approverIds.includes(currentTeacherId)) {
|
if (approverIds.includes(currentTeacherId)) {
|
||||||
return '审批';
|
return '审批';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果是已办状态,根据审批结果显示不同按钮
|
||||||
|
if (activeTab.value === 'approved') {
|
||||||
|
if (spResult === 'B') {
|
||||||
|
return '已同意';
|
||||||
|
} else if (spResult === 'C') {
|
||||||
|
return '已驳回';
|
||||||
|
} else if (spResult === 'D') {
|
||||||
|
return '已终止';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 其他情况显示"详情"
|
// 其他情况显示"详情"
|
||||||
return '详情';
|
return '详情';
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取按钮样式类
|
// 获取按钮样式类 - 参考教师请假的样式
|
||||||
const getButtonClass = (item: GwListItem) => {
|
const getButtonClass = (item: GwListItem) => {
|
||||||
const buttonText = getButtonText(item);
|
const buttonText = getButtonText(item);
|
||||||
return buttonText === '审批' ? 'action-button-approve' : 'action-button-detail';
|
const currentTeacherId = getCurrentTeacherId();
|
||||||
|
const { gwStatus, spZbqd, spResult } = item;
|
||||||
|
|
||||||
|
// 审批按钮样式
|
||||||
|
if (buttonText === '审批') {
|
||||||
|
return 'action-button-approve';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 已办状态按钮样式
|
||||||
|
if (activeTab.value === 'approved') {
|
||||||
|
if (spResult === 'B') {
|
||||||
|
return 'action-button-approved'; // 已同意
|
||||||
|
} else if (spResult === 'C') {
|
||||||
|
return 'action-button-rejected'; // 已驳回
|
||||||
|
} else if (spResult === 'D') {
|
||||||
|
return 'action-button-stopped'; // 已终止
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 默认详情按钮样式
|
||||||
|
return 'action-button-detail';
|
||||||
};
|
};
|
||||||
|
|
||||||
// 紧急程度相关函数已删除
|
// 紧急程度相关函数已删除
|
||||||
@ -877,7 +910,10 @@ onUnmounted(() => {
|
|||||||
|
|
||||||
// 按钮样式,与状态标签大小相同
|
// 按钮样式,与状态标签大小相同
|
||||||
.action-button-approve,
|
.action-button-approve,
|
||||||
.action-button-detail {
|
.action-button-detail,
|
||||||
|
.action-button-approved,
|
||||||
|
.action-button-rejected,
|
||||||
|
.action-button-stopped {
|
||||||
padding: 4px 8px !important;
|
padding: 4px 8px !important;
|
||||||
border-radius: 12px !important;
|
border-radius: 12px !important;
|
||||||
font-size: 12px !important;
|
font-size: 12px !important;
|
||||||
@ -901,6 +937,24 @@ onUnmounted(() => {
|
|||||||
border: none !important;
|
border: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.action-button-approved {
|
||||||
|
background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%) !important;
|
||||||
|
color: white !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-button-rejected {
|
||||||
|
background: linear-gradient(135deg, #ef5350 0%, #e53935 100%) !important;
|
||||||
|
color: white !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-button-stopped {
|
||||||
|
background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%) !important;
|
||||||
|
color: white !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
// 响应式优化
|
// 响应式优化
|
||||||
@media (max-width: 375px) {
|
@media (max-width: 375px) {
|
||||||
.query-component {
|
.query-component {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user