This commit is contained in:
吴红兵
2026-03-08 17:10:23 +08:00
parent ec690ecab5
commit 877d9f0848
3 changed files with 68 additions and 66 deletions

View File

@@ -233,7 +233,7 @@ const methods = {
}) })
.catch((e) => { .catch((e) => {
methods.currFlowFormFlowDesigning(false, false); methods.currFlowFormFlowDesigning(false, false);
$message.error('获取流程信息失败'); $message.error('获取流程信息失败1');
console.error(e); console.error(e);
}); });
} else { } else {

View File

@@ -187,13 +187,34 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<!-- 流转去向选择资产管理处审核时显示 -->
<el-card v-if="showFlowTargetSection" shadow="never" class="flow-target-card">
<template #header>
<div class="card-header">
<span class="card-title">
<el-icon><Guide /></el-icon>
流转去向
</span>
</div>
</template>
<el-form label-width="100px">
<el-form-item label="选择去向" required>
<el-radio-group v-model="flowTarget" :disabled="isViewMode">
<el-radio v-for="item in FLOW_TARGET_OPTIONS" :key="item.value" :label="item.value">
{{ item.label }}
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</el-card>
</div> </div>
</template> </template>
<script setup lang="ts" name="BidFileAudit"> <script setup lang="ts" name="BidFileAudit">
import { ref, reactive, computed, onMounted, watch } from 'vue'; import { ref, reactive, computed, onMounted, watch } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { Document, FolderOpened, Upload, Link } from '@element-plus/icons-vue'; import { Document, FolderOpened, Upload, Link, Guide } from '@element-plus/icons-vue';
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { Session } from '/@/utils/storage'; import { Session } from '/@/utils/storage';
import { useUserInfo } from '/@/stores/userInfo'; import { useUserInfo } from '/@/stores/userInfo';
@@ -248,6 +269,14 @@ const PURCHASE_TYPE_MAP: Record<string, string> = {
'10': '邀请招标', '10': '邀请招标',
}; };
// 流转去向选项(资产管理处审核时使用)
const FLOW_TARGET_OPTIONS = [
{ label: '需求部门负责人', value: '4' },
{ label: '文件内审部门', value: '2' },
{ label: '招标代理', value: '1' },
{ label: '确认定稿', value: '3' },
] as const;
// ==================== 响应式数据 ==================== // ==================== 响应式数据 ====================
const route = useRoute(); const route = useRoute();
@@ -276,6 +305,12 @@ const showUploadSection = computed(() => {
return false; return false;
}); });
// 是否显示流转去向选择区域(仅资产管理处在审核时显示)
const showFlowTargetSection = computed(() => {
if (isViewMode.value) return false;
return isAsset.value && isFlowEmbed.value;
});
// 采购申请数据 // 采购申请数据
const applyData = ref<any>({}); const applyData = ref<any>({});
const purchaseTypeLabel = computed(() => { const purchaseTypeLabel = computed(() => {
@@ -313,6 +348,9 @@ const uploadRules = {
// 招标文件上传为可选,后续可补充上传 // 招标文件上传为可选,后续可补充上传
}; };
// 流转去向(资产管理处审核时使用)
const flowTarget = ref<string>('');
// ==================== 计算属性 ==================== // ==================== 计算属性 ====================
const BID_FILE_TYPE = '130'; const BID_FILE_TYPE = '130';
@@ -539,71 +577,16 @@ const handleDownload = (row: any) => {
} }
}; };
// 暂存招标文件(模拟保存)
const handleTempStoreBidFile = async () => {
if (!uploadForm.fileId) {
ElMessage.warning('请先上传招标文件');
return;
}
tempStoreLoading.value = true;
try {
const params = {
purchaseId: effectivePurchaseId.value,
fileId: uploadForm.fileId,
fileName: uploadForm.fileName,
fileUrl: uploadForm.fileUrl,
comment: uploadForm.comment,
};
const res = await tempStoreBidFile(params);
if (res.code === 0) {
await loadBidFiles();
isTempStored.value = true;
ElMessage.success('暂存成功,可继续上传或提交');
// 清空表单和上传组件,允许继续上传新文件
uploadForm.fileId = '';
uploadForm.fileUrl = '';
uploadForm.fileName = '';
uploadForm.comment = '';
fileList.value = [];
uploadRef.value?.clearFiles();
} else {
ElMessage.error(res.msg || '暂存失败');
}
} catch (e: any) {
ElMessage.error(e?.msg || '暂存招标文件失败');
} finally {
tempStoreLoading.value = false;
}
};
// 提交招标文件(启动流程)
const handleSubmitBidFile = async () => {
submitLoading.value = true;
try {
const res = await submitBidFile(effectivePurchaseId.value);
if (res.code === 0) {
await loadApplyData();
await loadBidFiles();
isTempStored.value = false;
ElMessage.success('提交成功,流程已启动');
} else {
ElMessage.error(res.msg || '提交失败');
}
} catch (e: any) {
ElMessage.error(e?.msg || '提交招标文件失败');
} finally {
submitLoading.value = false;
}
};
// ==================== 流程集成 ==================== // ==================== 流程集成 ====================
// 流程保存回调 - 审核时自动调用暂存接口 // 流程保存回调 - 审核时自动调用暂存接口
const handleFlowSave = async () => { const handleFlowSave = async () => {
// 资产管理处审核时,必须选择流转去向
if (showFlowTargetSection.value && !flowTarget.value) {
ElMessage.warning('请选择流转去向');
return false;
}
// 如果有待保存的文件,先保存文件 // 如果有待保存的文件,先保存文件
if (uploadForm.fileId) { if (uploadForm.fileId) {
const saved = await saveUploadedFile(); const saved = await saveUploadedFile();
@@ -618,6 +601,7 @@ const handleFlowSave = async () => {
fileName: uploadForm.fileName || '', fileName: uploadForm.fileName || '',
fileUrl: uploadForm.fileUrl || '', fileUrl: uploadForm.fileUrl || '',
comment: uploadForm.comment || '', comment: uploadForm.comment || '',
flowTarget: flowTarget.value || ''
}; };
const res = await tempStoreBidFile(params); const res = await tempStoreBidFile(params);
@@ -627,6 +611,9 @@ const handleFlowSave = async () => {
if (props.currJob && props.currElTab?.id) { if (props.currJob && props.currElTab?.id) {
currElTabIsSave(props.currJob, props.currElTab.id, true, emit); currElTabIsSave(props.currJob, props.currElTab.id, true, emit);
} }
return true; return true;
} else { } else {
ElMessage.error(res.msg || '暂存失败'); ElMessage.error(res.msg || '暂存失败');
@@ -741,4 +728,19 @@ watch(
color: var(--el-color-warning); color: var(--el-color-warning);
font-size: 13px; font-size: 13px;
} }
.flow-target-card {
margin-bottom: 16px;
}
.flow-target-card :deep(.el-radio-group) {
display: flex;
flex-direction: column;
gap: 12px;
}
.flow-target-card :deep(.el-radio) {
height: auto;
line-height: 1.5;
}
</style> </style>

View File

@@ -78,9 +78,9 @@
<el-button type="success" :loading="sendToAgentSubmitting" @click="handleSendToAgent">发送招标代理</el-button> <el-button type="success" :loading="sendToAgentSubmitting" @click="handleSendToAgent">发送招标代理</el-button>
</el-form-item> </el-form-item>
<!-- 撤回招标代理按钮 --> <!-- 撤回招标代理按钮 -->
<el-form-item v-if="canRevokeAgent"> <!-- <el-form-item v-if="canRevokeAgent">-->
<el-button type="warning" :loading="revokeAgentSubmitting" @click="handleRevokeAgent">撤回</el-button> <!-- <el-button type="warning" :loading="revokeAgentSubmitting" @click="handleRevokeAgent">撤回</el-button>-->
</el-form-item> <!-- </el-form-item>-->
</div> </div>
</div> </div>
</div> </div>