From 594de416075f2b44449cd91e4ea6f2a14763fb04 Mon Sep 17 00:00:00 2001 From: taoge1020 Date: Thu, 21 Aug 2025 21:39:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/bidding/listOfWinningBids/index.ts | 2 +- .../listOfWinningBids/index.vue | 56 +- src/views/tender/supplierInput/index.vue | 106 ++-- src/views/tender/supplierInput/indexEdit.vue | 521 ++++++++++++++++++ 4 files changed, 601 insertions(+), 84 deletions(-) create mode 100644 src/views/tender/supplierInput/indexEdit.vue diff --git a/src/api/bidding/listOfWinningBids/index.ts b/src/api/bidding/listOfWinningBids/index.ts index f943e08..8e509df 100644 --- a/src/api/bidding/listOfWinningBids/index.ts +++ b/src/api/bidding/listOfWinningBids/index.ts @@ -8,7 +8,7 @@ import { ListOfWinningBidsVO, ListOfWinningBidsForm, ListOfWinningBidsQuery } fr * @returns {*} */ -export const listListOfWinningBids = (query?: ListOfWinningBidsQuery): AxiosPromise => { +export const listListOfWinningBids = (query) => { return request({ url: '/bidding/listOfWinningBids/list', method: 'get', diff --git a/src/views/biddingManagemen/listOfWinningBids/index.vue b/src/views/biddingManagemen/listOfWinningBids/index.vue index b972a03..f2c7700 100644 --- a/src/views/biddingManagemen/listOfWinningBids/index.vue +++ b/src/views/biddingManagemen/listOfWinningBids/index.vue @@ -7,9 +7,22 @@

投标项目信息填写

{{ currentProject.name }} +
+ + 点击编辑 + +
- + @@ -100,14 +113,14 @@ - + - + import { ref, reactive, toRefs, watch, onMounted, onUnmounted, getCurrentInstance, ComponentInternalInstance, computed } from 'vue'; -import { addListOfWinningBids, updateListOfWinningBids, getListOfWinningBids } from '@/api/bidding/listOfWinningBids'; +import { addListOfWinningBids, updateListOfWinningBids, listListOfWinningBids, getListOfWinningBids } from '@/api/bidding/listOfWinningBids'; import { ListOfWinningBidsVO, ListOfWinningBidsForm } from '@/api/bidding/listOfWinningBids/types'; import { useUserStoreHook } from '@/store/modules/user'; import { ElFormInstance, ElMessage } from 'element-plus'; @@ -145,6 +158,7 @@ const currentProject = computed(() => userStore.selectedProject); const listOfWinningBidsFormRef = ref(); // 加载状态 const buttonLoading = ref(false); +const isDisabled = ref(false); // 表单初始数据 const initFormData: ListOfWinningBidsForm = { id: undefined, @@ -189,7 +203,6 @@ const data = reactive({ // 解构响应式数据 const { form, rules } = toRefs(data); - /** * 计算人民币中标价 * 显式触发的计算函数,确保执行时机可靠 @@ -216,16 +229,21 @@ const calculateWinningBid = () => { const initData = async () => { try { if (currentProject.value?.id) { - const res = await getListOfWinningBids(currentProject.value.id); - if (res.data && res.data.id) { - Object.assign(form.value, res.data); - // 初始化时手动触发一次计算 - setTimeout(calculateWinningBid, 0); + const res = await listListOfWinningBids({ projectId: currentProject.value.id }); + if (res.code == 200) { + console.log(res.data); + resetForm(); + if (!res.data) { + isDisabled.value = false; + return; + } else { + Object.assign(form.value, res.data); + } + isDisabled.value = true; } } } catch (error) { - console.error('初始化数据失败:', error); - ElMessage.error('初始化数据失败'); + // ElMessage.error('初始化数据失败'); } }; @@ -239,16 +257,10 @@ const submitForm = () => { try { // 提交前确保计算正确 calculateWinningBid(); - form.value.projectId = currentProject.value?.id; - if (form.value.id) { - await updateListOfWinningBids(form.value); - } else { - await addListOfWinningBids(form.value); - } - + await addListOfWinningBids(form.value); + isDisabled.value = true; ElMessage.success('提交成功'); - resetForm(); } catch (error) { ElMessage.error('提交失败,请重试'); console.error('提交表单失败:', error); @@ -258,7 +270,6 @@ const submitForm = () => { } }); }; - /** * 重置表单 */ @@ -266,7 +277,6 @@ const resetForm = () => { form.value = { ...initFormData, projectId: currentProject.value?.id }; listOfWinningBidsFormRef.value?.resetFields(); }; - /** * 监听项目ID变化 - 重新初始化数据 */ diff --git a/src/views/tender/supplierInput/index.vue b/src/views/tender/supplierInput/index.vue index 5c05dd3..0382169 100644 --- a/src/views/tender/supplierInput/index.vue +++ b/src/views/tender/supplierInput/index.vue @@ -15,13 +15,6 @@ - - - - - - - 搜索 重置 @@ -38,32 +31,16 @@ 新增 - - 修改 - - - 删除 - - + - + @@ -72,11 +49,9 @@ - + @@ -86,34 +61,30 @@ - + - - @@ -249,7 +220,6 @@ - @@ -261,7 +231,6 @@ - @@ -282,7 +251,6 @@ - @@ -303,7 +271,6 @@ - @@ -342,7 +309,6 @@ -