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

113 lines
3.1 KiB
Vue
Raw Normal View History

2025-08-22 15:32:55 +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 15:32:55 +08:00
<el-form ref="ruleFormRef" style="max-width: 600px" :model="form" :rules="rules" label-width="auto">
<el-form-item label="中标单位" prop="winningBidder">
<el-select v-model="form.winningBidder" filterable placeholder="请选择单位" style="width: 240px">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="招标文件" prop="name">
<file-upload
v-model="form.costEstimationFile"
:fileSize="100"
:auto-upload="false"
uploadUrl="/tender/biddingPlan/uploadBiddingDocuments"
method="put"
ref="fileUploadRef"
2025-08-22 15:57:20 +08:00
:limit="1"
2025-08-22 15:32:55 +08:00
:data="{
projectId: currentProject?.id,
2025-08-22 15:57:20 +08:00
type: planType,
2025-08-22 15:32:55 +08:00
fileType: '0',
bidStatus: '0',
id: row.id,
winningBidderId: form.winningBidder
}"
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 15:32:55 +08:00
<el-button type="primary" @click="submitForm()">确定</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup lang="ts">
import { getUnitList } from '@/api/tender/index';
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 options = ref<any>([]);
const rules = ref({
costEstimationFile: [{ required: true, message: '请上传招标文件', trigger: ['blur'] }]
});
2025-08-22 15:57:20 +08:00
const emit = defineEmits(['success']);
2025-08-22 15:32:55 +08:00
const form = ref({
costEstimationFile: '',
winningBidder: ''
});
const open = (rows: any, type: string) => {
dialogVisible.value = true;
console.log(rows, type);
row.value = rows;
planType.value = type;
getUnitListData();
};
2025-08-22 15:57:20 +08:00
const closeDialog = () => {
dialogVisible.value = false;
form.value.winningBidder = '';
emit('success');
};
2025-08-22 15:32:55 +08:00
const getUnitListData = async () => {
let res = await getUnitList({
projectId: currentProject.value?.id
});
if (res.code == 200) {
options.value = res.data.map((item: any) => {
return {
label: item.supplierName,
value: item.id
};
});
}
console.log(res);
};
const resetForm = () => {};
const submitForm = () => {
2025-08-22 15:57:20 +08:00
if (!form.value.winningBidder) {
ElMessage({
message: '请选择中标单位',
type: 'warning'
});
return;
}
2025-08-22 15:32:55 +08:00
fileUploadRef.value.submitUpload().then((res) => {
if (res == 'noFile') {
ElMessage({
message: '请上传招标文件',
type: 'warning'
});
return;
}
dialogVisible.value = false;
2025-08-22 15:57:20 +08:00
emit('success');
2025-08-22 15:32:55 +08:00
});
};
defineExpose({
open
});
</script>
<style scoped lang="scss"></style>