Files
td_official/src/views/tender/plan/comm/planPage.vue
tcy e6f235036e refactor(components): 优化多个组件的样式和布局
- 调整了多个组件的输入框、按钮等元素的样式
- 优化了部分对话框的布局结构
- 统一了表单项的样式
- 调整了部分字体大小和颜色
2025-09-09 21:12:04 +08:00

75 lines
2.2 KiB
Vue

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