Files
td_official/src/views/tender/plan/comm/planPage.vue

78 lines
2.1 KiB
Vue
Raw Normal View History

2025-08-21 01:39:29 +08:00
<template>
2025-08-22 15:57:20 +08:00
<el-dialog v-model="dialogVisible" title="招标文件" width="500" draggable @close="closeDialog">
2025-08-22 11:42:12 +08:00
<el-form ref="ruleFormRef" style="max-width: 600px" :model="ruleForm" :rules="rules" label-width="auto">
<el-form-item label="招标文件" prop="name">
<file-upload
:fileSize="100"
:auto-upload="false"
uploadUrl="/tender/biddingPlan/uploadBiddingDocuments"
method="put"
ref="fileUploadRef"
:data="{
projectId: currentProject?.id,
2025-08-22 15:57:20 +08:00
type: planType,
2025-08-22 11:42:12 +08:00
fileType: '1',
bidStatus: '0',
id: row.id
}"
showFileList
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
2025-08-22 15:57:20 +08:00
<el-button @click="closeDialog()"> 取消 </el-button>
2025-08-22 11:42:12 +08:00
<el-button type="primary" @click="submitForm()">确定</el-button>
</div>
</template>
</el-dialog>
2025-08-21 01:39:29 +08:00
</template>
<script setup lang="ts">
import { useUserStoreHook } from '@/store/modules/user';
const userStore = useUserStoreHook();
const currentProject = computed(() => userStore.selectedProject);
2025-08-22 11:42:12 +08:00
const dialogVisible = ref(false);
const row = ref<any>();
const planType = ref<any>('');
const fileUploadRef = ref<any>();
const ruleForm = ref<any>();
const rules = ref({
costEstimationFile: [{ required: true, message: '请上传招标文件', trigger: ['blur'] }]
2025-08-21 01:39:29 +08:00
});
2025-08-22 15:57:20 +08:00
const emit = defineEmits(['success']);
2025-08-22 11:42:12 +08:00
const form = ref({
costEstimationFile: ''
});
2025-08-22 15:57:20 +08:00
const closeDialog = () => {
dialogVisible.value = false;
emit('success');
};
2025-08-21 01:39:29 +08:00
2025-08-22 11:42:12 +08:00
const open = (rows: any, type: string) => {
dialogVisible.value = true;
console.log(rows, type);
row.value = rows;
planType.value = type;
2025-08-21 01:39:29 +08:00
};
2025-08-22 11:42:12 +08:00
const resetForm = () => {};
const submitForm = () => {
fileUploadRef.value.submitUpload().then((res) => {
if (res == 'noFile') {
2025-08-21 01:39:29 +08:00
ElMessage({
2025-08-22 11:42:12 +08:00
message: '请上传招标文件',
2025-08-21 01:39:29 +08:00
type: 'warning'
});
return;
}
2025-08-22 11:42:12 +08:00
dialogVisible.value = false;
2025-08-22 15:57:20 +08:00
emit('success');
2025-08-21 01:39:29 +08:00
});
};
2025-08-22 11:42:12 +08:00
defineExpose({
open
2025-08-21 01:39:29 +08:00
});
</script>
2025-08-22 11:42:12 +08:00
<style scoped lang="scss"></style>