审批调整

This commit is contained in:
hebo 2025-09-23 21:53:36 +08:00
parent 2d2314c336
commit dea3be0d4a
3 changed files with 498 additions and 472 deletions

View File

@ -145,12 +145,6 @@ export function getGwFlowByIdApi(id: string) {
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) {
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

View File

@ -119,6 +119,7 @@ import { onShow } from "@dcloudio/uni-app";
import { navigateTo } from "@/utils/uniapp";
import BasicSearch from "@/components/BasicSearch/Search.vue";
import { gwFindPageApi, findUserTodosApi } from "@/api/routine/gw";
import { gwSqApi, gwSpApi, gwTransferApi, gwStopApi, gwCxtjApi, gwXtApi } from "@/api/routine/gw";
import dayjs from "dayjs";
import { imagUrl } from "@/utils";
import { useUserStore } from "@/store/modules/user";
@ -148,6 +149,7 @@ interface GwListItem {
fileFormat?: string;
files?: FileInfo[];
spZbqd?: string; // ID
spResult?: string; // A-B-C-D-
tjrtime?: string; //
[key: string]: any;
}
@ -278,8 +280,8 @@ const loadUserTodos = async (approveStatus: string, jsId: string) => {
loading.value = true;
uni.showLoading({ title: '加载中...' });
// findUserTodos
const response = await findUserTodosApi(approveStatus, jsId, 1, 1000); // pageSize
// findUserTodos 使
const response = await findUserTodosApi(approveStatus, jsId, 1, 50); // 使
// -
const result = (response as any).data || response;
@ -374,27 +376,58 @@ const getStatusText = (status: string) => {
return statusMap[status] || "未知";
};
//
// -
const getButtonText = (item: GwListItem) => {
const currentTeacherId = getCurrentTeacherId();
const { gwStatus, spZbqd } = item;
const { gwStatus, spZbqd, spResult } = item;
// IDspZbqdB""
if (currentTeacherId && spZbqd && gwStatus === 'B') {
// ""
if (currentTeacherId && spZbqd && gwStatus === 'B' && activeTab.value === 'pending') {
const approverIds = spZbqd.split(',').map(id => id.trim());
if (approverIds.includes(currentTeacherId)) {
return '审批';
}
}
//
if (activeTab.value === 'approved') {
if (spResult === 'B') {
return '已同意';
} else if (spResult === 'C') {
return '已驳回';
} else if (spResult === 'D') {
return '已终止';
}
}
// ""
return '详情';
};
//
// -
const getButtonClass = (item: GwListItem) => {
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-detail {
.action-button-detail,
.action-button-approved,
.action-button-rejected,
.action-button-stopped {
padding: 4px 8px !important;
border-radius: 12px !important;
font-size: 12px !important;
@ -901,6 +937,24 @@ onUnmounted(() => {
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) {
.query-component {