Files
school-developer/src/api/finance/purchasingrequisition.ts
2026-03-01 11:22:54 +08:00

312 lines
7.8 KiB
TypeScript
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.

/*
* Copyright (c) 2018-2025, cyweb All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
*/
import request from '/@/utils/request';
/**
* 分页查询
* @param params 查询参数
*/
export function getPage(params?: any) {
return request({
url: '/purchase/purchasingapply/page',
method: 'get',
params
});
}
/**
* 通过id查询
* @param id ID
*/
export function getObj(id: number) {
return request({
url: '/purchase/purchasingapply/' + id,
method: 'get'
});
}
/**
* 新增采购申请(提交并启动流程)
* @param obj 对象数据
*/
export function addObj(obj: any) {
return request({
url: '/purchase/purchasingapply/submit',
method: 'post',
data: obj
});
}
/**
* 暂存采购申请
* @param obj 对象数据
*/
export function tempStore(obj: any) {
return request({
url: '/purchase/purchasingapply/temp-store',
method: 'post',
data: obj
});
}
/**
* 提交采购申请(启动流程)
* @param obj 对象数据
*/
export function submitObj(obj: any) {
return request({
url: '/purchase/purchasingapply/submit',
method: 'post',
data: obj
});
}
/**
* 分配招标代理(指定或随机),仅学校统一采购或部门自行采购且委托采购中心采购时可用
* @param applyId 采购申请ID
* @param mode random | designated
* @param agentId 指定模式时的代理ID
*/
export function assignAgent(applyId: number | string, mode: 'random' | 'designated', agentId?: string) {
return request({
url: '/purchase/purchasingapply/assign-agent',
method: 'post',
data: { id: Number(applyId), mode, agentId: agentId || undefined }
});
}
/**
* 发送招标代理:将采购项目发送给已分配的招标代理
* @param applyId 采购申请ID
*/
export function sendToAgent(applyId: number | string) {
return request({
url: '/purchase/purchasingapply/sendToAgent',
method: 'post',
data: { id: Number(applyId) }
});
}
/**
* 修改采购申请
* @param obj 对象数据
*/
export function editObj(obj: any) {
return request({
url: '/purchase/purchasingapply/edit',
method: 'post',
data: obj
});
}
/**
* 删除采购申请
* @param id ID
*/
export function delObj(id: number) {
return request({
url: '/purchase/purchasingapply/delete',
method: 'post',
data: id
});
}
/**
* 获取采购申请附件列表
* @param purchaseId 采购申请ID
*/
export function getApplyFiles(purchaseId: string | number) {
return request({
url: '/purchase/purchasingfiles/applyFiles',
method: 'post',
params: { purchaseId }
});
}
/**
* 履约验收关联的合同列表(未被使用的合同)
* @param params 可选参数,如 id 等
*/
export function getContracts(params?: any) {
return request({
url: '/purchase/purchasingapply/getContracts',
method: 'get',
params
});
}
/**
* 实施采购:上传采购文件并关联到申请单(可同时保存采购代表人方式与人员)
* @param id 采购申请ID
* @param fileIds 已上传的采购文件ID列表fileType=130
* @param implementType 实施采购方式 1:自行组织采购 2:委托代理采购
* @param representorTeacherNo 需求部门初审-指定采购代表人(单人)
* @param representors 需求部门初审-部门多人逗号分隔
*/
export function implementApply(
id: number,
fileIds: string[],
implementType?: string,
representorTeacherNo?: string,
representors?: string
) {
return request({
url: '/purchase/purchasingapply/implement',
method: 'get',
params: { id, fileIds, implementType, representorTeacherNo, representors }
});
}
/**
* 发起采购文件审批流程(需已实施采购并上传采购文件)
* @param id 采购申请ID
* @param representorTeacherNo 需求部门初审-指定采购代表人单人用户ID或工号
* @param representors 需求部门初审-部门多人由系统抽取多人用户ID或工号逗号分隔
*/
export function startFileFlow(
id: number,
representorTeacherNo?: string,
representors?: string
) {
return request({
url: '/purchase/purchasingapply/startFileFlow',
method: 'post',
data: { id, representorTeacherNo, representors }
});
}
/**
* 获取部门下人员(用于选采购代表人)
*/
export function getDeptMembers() {
return request({
url: '/purchase/purchasingapply/getDeptMembers',
method: 'get'
});
}
/**
* 保存采购代表(指定单人或部门多人)
* @param id 采购申请ID
* @param representorTeacherNo 指定采购代表人单人用户ID或工号
* @param representors 部门多人由系统抽取多人用户ID或工号逗号分隔
*/
export function saveRepresentor(id: number, representorTeacherNo?: string, representors?: string) {
return request({
url: '/purchase/purchasingapply/saveRepresentor',
method: 'post',
data: { id, representorTeacherNo, representors }
});
}
/**
* 文件归档按文件类型打包下载该申请单下所有附件的下载地址GET 请求,浏览器直接下载 zip
* @param purchaseId 采购申请ID
*/
export function getArchiveDownloadUrl(purchaseId: string | number) {
return `/purchase/purchasingfiles/archive?purchaseId=${encodeURIComponent(String(purchaseId))}`;
}
/**
* 下载审批表:导出采购审批表 Word 文档apply.docx 模板,仅占位符替换)
* @param id 采购申请ID
*/
export function getApplyTemplateDownloadUrl(id: string | number) {
return `/purchase/purchasingapply/export-apply-template?id=${encodeURIComponent(String(id))}`;
}
/**
* 下载文件审批表:导出采购文件审批表 Word 文档fileapply.docx 模板)
* @param id 采购申请ID
*/
export function getFileApplyTemplateDownloadUrl(id: string | number) {
return `/purchase/purchasingapply/export-file-apply-template?id=${encodeURIComponent(String(id))}`;
}
// ==================== 招标代理专用接口 ====================
/**
* 招标代理获取待处理列表
* @param params 分页参数
*/
export function getAgentPendingList(params?: any) {
return request({
url: '/purchase/purchasingdoc/agent/list',
method: 'get',
params
});
}
/**
* 招标代理获取采购需求文件列表
* @param applyId 采购申请ID
*/
export function getAgentRequirementFiles(applyId: number | string) {
return request({
url: `/purchase/purchasingdoc/agent/requirement/${applyId}`,
method: 'get'
});
}
/**
* 招标代理获取项目详情(仅返回采购编号和项目名称)
* @param applyId 采购申请ID
*/
export function getAgentApplyDetail(applyId: number | string) {
return request({
url: `/purchase/purchasingdoc/agent/detail/${applyId}`,
method: 'get'
});
}
/**
* 招标代理上传采购文件
* @param data 文件数据
*/
export function uploadAgentDoc(data: any) {
return request({
url: '/purchase/purchasingdoc/upload',
method: 'post',
data
});
}
/**
* 招标代理重新上传采购文件
* @param data 文件数据
*/
export function reuploadAgentDoc(data: any) {
return request({
url: '/purchase/purchasingdoc/reupload',
method: 'post',
data
});
}
/**
* 获取采购文件列表
* @param applyId 采购申请ID
*/
export function getDocList(applyId: number | string) {
return request({
url: `/purchase/purchasingdoc/list/${applyId}`,
method: 'get'
});
}