招标文件修改

This commit is contained in:
吴红兵
2026-03-15 15:10:52 +08:00
parent 2b7ea0754d
commit 055ff1f1e9
2 changed files with 49 additions and 94 deletions

View File

@@ -117,7 +117,17 @@ export function getFlowPurchaseDetail(purchaseId: string) {
}); });
} }
export function tempStoreBidFile(data: { purchaseId: string; fileId?: string; fileName?: string; fileUrl?: string; comment?: string }) { export function tempStoreBidFile(data: {
purchaseId: string;
fileId?: string;
fileName?: string;
fileUrl?: string;
comment?: string;
flowTarget?: string;
representorTeacherNo?: string;
representors?: string;
representorType?: string;
}) {
return request({ return request({
url: '/purchase/purchasingbidfile/tempStore', url: '/purchase/purchasingbidfile/tempStore',
method: 'post', method: 'post',

View File

@@ -283,11 +283,10 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<!-- 保存按钮 -->
<el-form-item> <el-form-item>
<el-button type="primary" :loading="saveRepresentorLoading" :disabled="!canSaveRepresentor || isViewMode" @click="handleSaveRepresentor"> <el-alert type="info" :closable="false" show-icon>
保存参与人信息 参与人信息将在审核提交时自动保存
</el-button> </el-alert>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
@@ -311,11 +310,10 @@ import {
getAgentPurchaseDetail, getAgentPurchaseDetail,
getFlowPurchaseDetail, getFlowPurchaseDetail,
tempStoreBidFile, tempStoreBidFile,
submitBidFile,
} from '/@/api/purchase/bidfile'; } from '/@/api/purchase/bidfile';
import { getRequirementFiles } from '/@/api/purchase/purchasingfiles'; import { getRequirementFiles } from '/@/api/purchase/purchasingfiles';
import { currElTabIsSave } from '/@/api/order/order-key-vue'; import { currElTabIsSave } from '/@/api/order/order-key-vue';
import { getDeptMembers, saveRepresentor, randomSelectRepresentor } from '/@/api/purchase/purchasingrequisition'; import { getDeptMembers, randomSelectRepresentor } from '/@/api/purchase/purchasingrequisition';
// ==================== Props & Emits ==================== // ==================== Props & Emits ====================
@@ -335,11 +333,9 @@ const currentUserRoleCodes = computed(() => userStore.userInfos.roleCodes || [])
const ROLE_LABEL_MAP: Record<string, string> = { const ROLE_LABEL_MAP: Record<string, string> = {
PURCHASE_AGENT: '招标代理', PURCHASE_AGENT: '招标代理',
PURCHASE_ASSET: '资产管理', PURCHASE_CENTER: '资产管理',
PURCHASE_DEPT_APPLY: '部门经办人', PURCHASE_DEPT_APPLY: '部门申请人',
PURCHASE_DEPT_AUDIT: '部门负责人',
PURCHASE_FILE_AUDIT: '内审部门', PURCHASE_FILE_AUDIT: '内审部门',
PURCHASE_CENTER: '采购中心',
}; };
const PURCHASE_TYPE_MAP: Record<string, string> = { const PURCHASE_TYPE_MAP: Record<string, string> = {
@@ -378,29 +374,28 @@ const isViewMode = computed(() => {
// 当前用户角色判断从用户store获取 // 当前用户角色判断从用户store获取
const isAgent = computed(() => currentUserRoleCodes.value.includes('PURCHASE_AGENT')); const isAgent = computed(() => currentUserRoleCodes.value.includes('PURCHASE_AGENT'));
const isAsset = computed(() => currentUserRoleCodes.value.includes('PURCHASE_ASSET')); const isCenter = computed(() => currentUserRoleCodes.value.includes('PURCHASE_CENTER'));
const isDeptApply = computed(() => currentUserRoleCodes.value.includes('PURCHASE_DEPT_APPLY')); const isDeptApply = computed(() => currentUserRoleCodes.value.includes('PURCHASE_DEPT_APPLY'));
const isDeptAudit = computed(() => currentUserRoleCodes.value.includes('PURCHASE_DEPT_AUDIT'));
const isFileAudit = computed(() => currentUserRoleCodes.value.includes('PURCHASE_FILE_AUDIT')); const isFileAudit = computed(() => currentUserRoleCodes.value.includes('PURCHASE_FILE_AUDIT'));
// 是否显示上传区域 // 是否显示上传区域
const showUploadSection = computed(() => { const showUploadSection = computed(() => {
if (isViewMode.value) return false; if (isViewMode.value) return false;
if (isAgent.value) return true; if (isAgent.value) return true;
if (isAsset.value || isDeptApply.value || isFileAudit.value) return true; if (isCenter.value || isDeptApply.value || isFileAudit.value) return true;
return false; return false;
}); });
// 是否显示流转去向选择区域(仅资产管理在审核时显示) // 是否显示流转去向选择区域(仅资产管理在审核时显示)
const showFlowTargetSection = computed(() => { const showFlowTargetSection = computed(() => {
if (isViewMode.value) return false; if (isViewMode.value) return false;
return isAsset.value && isFlowEmbed.value; return isCenter.value && isFlowEmbed.value;
}); });
// 是否显示部门参与人选择区域(仅部门负责人在审核时显示) // 是否显示部门参与人选择区域(仅部门申请人在审核时显示)
const showRepresentorSection = computed(() => { const showRepresentorSection = computed(() => {
if (isViewMode.value) return false; if (isViewMode.value) return false;
return isDeptAudit.value && isFlowEmbed.value; return isDeptApply.value && isFlowEmbed.value;
}); });
// 采购申请数据 // 采购申请数据
@@ -426,9 +421,6 @@ const requirementLoading = ref(false);
const uploadFormRef = ref(); const uploadFormRef = ref();
const uploadRef = ref(); const uploadRef = ref();
const fileList = ref<any[]>([]); const fileList = ref<any[]>([]);
const saveLoading = ref(false);
const tempStoreLoading = ref(false);
const submitLoading = ref(false);
const isTempStored = ref(false); const isTempStored = ref(false);
const uploadForm = reactive({ const uploadForm = reactive({
fileId: '', fileId: '',
@@ -451,16 +443,8 @@ const selectedRepresentor = ref<string>('');
const randomCandidates = ref<string[]>([]); const randomCandidates = ref<string[]>([]);
const currentRepresentor = ref<any>(null); const currentRepresentor = ref<any>(null);
const representorType = ref<string>('purchase_rep'); const representorType = ref<string>('purchase_rep');
const saveRepresentorLoading = ref(false);
const randomSelectLoading = ref(false); const randomSelectLoading = ref(false);
const canSaveRepresentor = computed(() => {
if (representorSelectMode.value === 'designate') {
return !!selectedRepresentor.value;
}
return !!currentRepresentor.value;
});
// ==================== 计算属性 ==================== // ==================== 计算属性 ====================
const BID_FILE_TYPE = '130'; const BID_FILE_TYPE = '130';
@@ -482,11 +466,6 @@ const effectivePurchaseId = computed(() => {
return (route.query.id as string) || (route.query.purchaseId as string) || ''; return (route.query.id as string) || (route.query.purchaseId as string) || '';
}); });
// 是否可以提交(非查看模式即可提交,不强制要求上传文件)
const canSubmitFile = computed(() => {
return !isViewMode.value;
});
// ==================== 方法定义 ==================== // ==================== 方法定义 ====================
// 获取角色标签 // 获取角色标签
@@ -616,24 +595,6 @@ const handleDownload = (row: any) => {
} }
}; };
// 手动保存上传的招标文件
const handleSaveBidFile = async () => {
if (!uploadForm.fileId) {
ElMessage.warning('请先上传招标文件');
return;
}
saveLoading.value = true;
try {
const saved = await saveUploadedFile();
if (saved) {
ElMessage.success('招标文件保存成功,版本已更新');
}
} finally {
saveLoading.value = false;
}
};
// 保存上传的招标文件 // 保存上传的招标文件
const saveUploadedFile = async () => { const saveUploadedFile = async () => {
if (!uploadForm.fileId) { if (!uploadForm.fileId) {
@@ -657,7 +618,7 @@ const saveUploadedFile = async () => {
if (isAgent.value) { if (isAgent.value) {
res = await agentUploadBidFile(params); res = await agentUploadBidFile(params);
} else if (isAsset.value) { } else if (isCenter.value) {
res = await assetUploadBidFile(params); res = await assetUploadBidFile(params);
} else { } else {
res = await uploadBidFileNewVersion(params); res = await uploadBidFileNewVersion(params);
@@ -691,12 +652,24 @@ const saveUploadedFile = async () => {
// 流程保存回调 - 审核时自动调用暂存接口 // 流程保存回调 - 审核时自动调用暂存接口
const handleFlowSave = async () => { const handleFlowSave = async () => {
// 资产管理审核时,必须选择流转去向 // 资产管理审核时,必须选择流转去向
if (showFlowTargetSection.value && !flowTarget.value) { if (showFlowTargetSection.value && !flowTarget.value) {
ElMessage.warning('请选择流转去向'); ElMessage.warning('请选择流转去向');
return false; return false;
} }
// 部门申请人审核时,检查部门参与人是否已选择
if (showRepresentorSection.value) {
if (representorSelectMode.value === 'designate' && !selectedRepresentor.value) {
ElMessage.warning('请选择部门参与人');
return false;
}
if (representorSelectMode.value === 'random' && !currentRepresentor.value) {
ElMessage.warning('请先随机抽取部门参与人');
return false;
}
}
// 如果有待保存的文件,先保存文件 // 如果有待保存的文件,先保存文件
if (uploadForm.fileId) { if (uploadForm.fileId) {
const saved = await saveUploadedFile(); const saved = await saveUploadedFile();
@@ -705,7 +678,7 @@ const handleFlowSave = async () => {
// 自动调用暂存接口(可以没有文件) // 自动调用暂存接口(可以没有文件)
try { try {
const params = { const params: any = {
purchaseId: effectivePurchaseId.value, purchaseId: effectivePurchaseId.value,
fileId: uploadForm.fileId || '', fileId: uploadForm.fileId || '',
fileName: uploadForm.fileName || '', fileName: uploadForm.fileName || '',
@@ -714,6 +687,17 @@ const handleFlowSave = async () => {
flowTarget: flowTarget.value || '', flowTarget: flowTarget.value || '',
}; };
// 部门参与人信息(仅部门申请人角色)
if (showRepresentorSection.value) {
if (representorSelectMode.value === 'designate') {
params.representorTeacherNo = selectedRepresentor.value;
} else {
params.representors = randomCandidates.value.join(',');
params.representorTeacherNo = currentRepresentor.value?.teacherNo;
}
params.representorType = representorType.value;
}
const res = await tempStoreBidFile(params); const res = await tempStoreBidFile(params);
if (res.code === 0) { if (res.code === 0) {
await loadBidFiles(); await loadBidFiles();
@@ -782,45 +766,6 @@ const handleRandomSelect = async () => {
} }
}; };
const handleSaveRepresentor = async () => {
if (!canSaveRepresentor.value) {
ElMessage.warning('请先选择参与人');
return;
}
if (!representorType.value) {
ElMessage.warning('请选择参与人身份');
return;
}
try {
saveRepresentorLoading.value = true;
let res: any;
if (representorSelectMode.value === 'designate') {
res = await saveRepresentor(Number(effectivePurchaseId.value), selectedRepresentor.value, undefined, representorType.value);
} else {
res = await saveRepresentor(
Number(effectivePurchaseId.value),
currentRepresentor.value?.teacherNo,
randomCandidates.value.join(','),
representorType.value
);
}
if (res.code === 0) {
ElMessage.success('保存参与人信息成功');
await loadApplyData();
} else {
ElMessage.error(res.msg || '保存失败');
}
} catch (e: any) {
ElMessage.error(e?.msg || '保存失败');
} finally {
saveRepresentorLoading.value = false;
}
};
// ==================== 生命周期 ==================== // ==================== 生命周期 ====================
onMounted(async () => { onMounted(async () => {