fix
This commit is contained in:
@@ -187,13 +187,34 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="BidFileAudit">
|
||||
import { ref, reactive, computed, onMounted, watch } from 'vue';
|
||||
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 { Session } from '/@/utils/storage';
|
||||
import { useUserInfo } from '/@/stores/userInfo';
|
||||
@@ -248,6 +269,14 @@ const PURCHASE_TYPE_MAP: Record<string, string> = {
|
||||
'10': '邀请招标',
|
||||
};
|
||||
|
||||
// 流转去向选项(资产管理处审核时使用)
|
||||
const FLOW_TARGET_OPTIONS = [
|
||||
{ label: '需求部门负责人', value: '4' },
|
||||
{ label: '文件内审部门', value: '2' },
|
||||
{ label: '招标代理', value: '1' },
|
||||
{ label: '确认定稿', value: '3' },
|
||||
] as const;
|
||||
|
||||
// ==================== 响应式数据 ====================
|
||||
|
||||
const route = useRoute();
|
||||
@@ -276,6 +305,12 @@ const showUploadSection = computed(() => {
|
||||
return false;
|
||||
});
|
||||
|
||||
// 是否显示流转去向选择区域(仅资产管理处在审核时显示)
|
||||
const showFlowTargetSection = computed(() => {
|
||||
if (isViewMode.value) return false;
|
||||
return isAsset.value && isFlowEmbed.value;
|
||||
});
|
||||
|
||||
// 采购申请数据
|
||||
const applyData = ref<any>({});
|
||||
const purchaseTypeLabel = computed(() => {
|
||||
@@ -313,6 +348,9 @@ const uploadRules = {
|
||||
// 招标文件上传为可选,后续可补充上传
|
||||
};
|
||||
|
||||
// 流转去向(资产管理处审核时使用)
|
||||
const flowTarget = ref<string>('');
|
||||
|
||||
// ==================== 计算属性 ====================
|
||||
|
||||
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 () => {
|
||||
// 资产管理处审核时,必须选择流转去向
|
||||
if (showFlowTargetSection.value && !flowTarget.value) {
|
||||
ElMessage.warning('请选择流转去向');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 如果有待保存的文件,先保存文件
|
||||
if (uploadForm.fileId) {
|
||||
const saved = await saveUploadedFile();
|
||||
@@ -618,6 +601,7 @@ const handleFlowSave = async () => {
|
||||
fileName: uploadForm.fileName || '',
|
||||
fileUrl: uploadForm.fileUrl || '',
|
||||
comment: uploadForm.comment || '',
|
||||
flowTarget: flowTarget.value || ''
|
||||
};
|
||||
|
||||
const res = await tempStoreBidFile(params);
|
||||
@@ -627,6 +611,9 @@ const handleFlowSave = async () => {
|
||||
if (props.currJob && props.currElTab?.id) {
|
||||
currElTabIsSave(props.currJob, props.currElTab.id, true, emit);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
} else {
|
||||
ElMessage.error(res.msg || '暂存失败');
|
||||
@@ -741,4 +728,19 @@ watch(
|
||||
color: var(--el-color-warning);
|
||||
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>
|
||||
Reference in New Issue
Block a user