This commit is contained in:
Teo
2025-08-22 16:18:00 +08:00
3 changed files with 30 additions and 22 deletions

View File

@ -1,9 +1,8 @@
<template> <template>
<el-dialog v-model="dialogVisible" title="招标文件" width="500" draggable> <el-dialog v-model="dialogVisible" title="招标文件" width="500" draggable @close="closeDialog">
<el-form ref="ruleFormRef" style="max-width: 600px" :model="ruleForm" :rules="rules" label-width="auto"> <el-form ref="ruleFormRef" style="max-width: 600px" :model="ruleForm" :rules="rules" label-width="auto">
<el-form-item label="招标文件" prop="name"> <el-form-item label="招标文件" prop="name">
<file-upload <file-upload
v-model="form.costEstimationFile"
:fileSize="100" :fileSize="100"
:auto-upload="false" :auto-upload="false"
uploadUrl="/tender/biddingPlan/uploadBiddingDocuments" uploadUrl="/tender/biddingPlan/uploadBiddingDocuments"
@ -11,7 +10,7 @@
ref="fileUploadRef" ref="fileUploadRef"
:data="{ :data="{
projectId: currentProject?.id, projectId: currentProject?.id,
planType: planType, type: planType,
fileType: '1', fileType: '1',
bidStatus: '0', bidStatus: '0',
id: row.id id: row.id
@ -22,7 +21,7 @@
</el-form> </el-form>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button @click="resetForm()"> 取消 </el-button> <el-button @click="closeDialog()"> 取消 </el-button>
<el-button type="primary" @click="submitForm()">确定</el-button> <el-button type="primary" @click="submitForm()">确定</el-button>
</div> </div>
</template> </template>
@ -41,15 +40,14 @@ const ruleForm = ref<any>();
const rules = ref({ const rules = ref({
costEstimationFile: [{ required: true, message: '请上传招标文件', trigger: ['blur'] }] costEstimationFile: [{ required: true, message: '请上传招标文件', trigger: ['blur'] }]
}); });
const emit = defineProps({ const emit = defineEmits(['success']);
success: {
type: Function
// required: true
}
});
const form = ref({ const form = ref({
costEstimationFile: '' costEstimationFile: ''
}); });
const closeDialog = () => {
dialogVisible.value = false;
emit('success');
};
const open = (rows: any, type: string) => { const open = (rows: any, type: string) => {
dialogVisible.value = true; dialogVisible.value = true;
@ -68,7 +66,7 @@ const submitForm = () => {
return; return;
} }
dialogVisible.value = false; dialogVisible.value = false;
emit.success(); emit('success');
}); });
}; };
defineExpose({ defineExpose({

View File

@ -1,5 +1,5 @@
<template> <template>
<el-dialog v-model="dialogVisible" title="招标文件" width="500" draggable> <el-dialog v-model="dialogVisible" title="招标文件" width="500" draggable @close="closeDialog">
<el-form ref="ruleFormRef" style="max-width: 600px" :model="form" :rules="rules" label-width="auto"> <el-form ref="ruleFormRef" style="max-width: 600px" :model="form" :rules="rules" label-width="auto">
<el-form-item label="中标单位" prop="winningBidder"> <el-form-item label="中标单位" prop="winningBidder">
<el-select v-model="form.winningBidder" filterable placeholder="请选择单位" style="width: 240px"> <el-select v-model="form.winningBidder" filterable placeholder="请选择单位" style="width: 240px">
@ -14,9 +14,10 @@
uploadUrl="/tender/biddingPlan/uploadBiddingDocuments" uploadUrl="/tender/biddingPlan/uploadBiddingDocuments"
method="put" method="put"
ref="fileUploadRef" ref="fileUploadRef"
:limit="1"
:data="{ :data="{
projectId: currentProject?.id, projectId: currentProject?.id,
planType: planType, type: planType,
fileType: '0', fileType: '0',
bidStatus: '0', bidStatus: '0',
id: row.id, id: row.id,
@ -28,7 +29,7 @@
</el-form> </el-form>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button @click="resetForm()"> 取消 </el-button> <el-button @click="closeDialog()"> 取消 </el-button>
<el-button type="primary" @click="submitForm()">确定</el-button> <el-button type="primary" @click="submitForm()">确定</el-button>
</div> </div>
</template> </template>
@ -50,12 +51,7 @@ const options = ref<any>([]);
const rules = ref({ const rules = ref({
costEstimationFile: [{ required: true, message: '请上传招标文件', trigger: ['blur'] }] costEstimationFile: [{ required: true, message: '请上传招标文件', trigger: ['blur'] }]
}); });
const emit = defineProps({ const emit = defineEmits(['success']);
success: {
type: Function
// required: true
}
});
const form = ref({ const form = ref({
costEstimationFile: '', costEstimationFile: '',
winningBidder: '' winningBidder: ''
@ -68,6 +64,11 @@ const open = (rows: any, type: string) => {
planType.value = type; planType.value = type;
getUnitListData(); getUnitListData();
}; };
const closeDialog = () => {
dialogVisible.value = false;
form.value.winningBidder = '';
emit('success');
};
const getUnitListData = async () => { const getUnitListData = async () => {
let res = await getUnitList({ let res = await getUnitList({
projectId: currentProject.value?.id projectId: currentProject.value?.id
@ -84,6 +85,13 @@ const getUnitListData = async () => {
}; };
const resetForm = () => {}; const resetForm = () => {};
const submitForm = () => { const submitForm = () => {
if (!form.value.winningBidder) {
ElMessage({
message: '请选择中标单位',
type: 'warning'
});
return;
}
fileUploadRef.value.submitUpload().then((res) => { fileUploadRef.value.submitUpload().then((res) => {
if (res == 'noFile') { if (res == 'noFile') {
ElMessage({ ElMessage({
@ -93,7 +101,7 @@ const submitForm = () => {
return; return;
} }
dialogVisible.value = false; dialogVisible.value = false;
emit.success(); emit('success');
}); });
}; };
defineExpose({ defineExpose({

View File

@ -41,7 +41,9 @@
<el-table-column prop="winningBidder" label="中标单位" /> <el-table-column prop="winningBidder" label="中标单位" />
<el-table-column prop="bidFileName" label="中标文件"> <el-table-column prop="bidFileName" label="中标文件">
<template #default="scope"> <template #default="scope">
<el-button type="primary" link :disabled="scope.row.bidStatus == 1">{{ scope.row.bidFileName }} </el-button> <el-button type="primary" link :disabled="scope.row.bidStatus == 1" @click="openPdf(scope.row.bidFile)"
>{{ scope.row.bidFileName }}
</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="plannedBiddingTime" label="计划招标时间" align="center"> <el-table-column prop="plannedBiddingTime" label="计划招标时间" align="center">