From bb46964ee85946cc374291b6fe0c0a8218dab09f Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Wed, 20 Mar 2024 18:01:46 +0800 Subject: [PATCH] add --- src/api/bid_buy_bidding_document.ts | 12 +- src/components/uploadAnnex/index.vue | 10 +- src/views/bid_bidding_decision/edit.vue | 52 +---- src/views/bid_buy_bidding_document/detail.vue | 53 +++-- src/views/bid_buy_bidding_document/edit.vue | 136 +++++------- src/views/bid_buy_bidding_document/index.vue | 16 +- src/views/bid_document_examination/detail.vue | 71 +++--- src/views/bid_document_examination/edit.vue | 205 +++++------------- src/views/bid_document_examination/index.vue | 14 +- src/views/bid_result/detail.vue | 8 +- src/views/bid_result/index.vue | 9 +- 11 files changed, 201 insertions(+), 385 deletions(-) diff --git a/src/api/bid_buy_bidding_document.ts b/src/api/bid_buy_bidding_document.ts index eeb3c61..ea32290 100644 --- a/src/api/bid_buy_bidding_document.ts +++ b/src/api/bid_buy_bidding_document.ts @@ -11,14 +11,14 @@ export function apiBidBuyBiddingDocumentAdd(params: any) { } // 编辑购买标书 -// export function apiBidBuyBiddingDocumentEdit(params: any) { -// return request.post({ url: '/bid.bid_buy_bidding_document/edit', params }) -// } +export function apiBidBuyBiddingDocumentEdit(params: any) { + return request.post({ url: '/bid.bid_buy_bidding_document/edit', params }) +} // 删除购买标书 -// export function apiBidBuyBiddingDocumentDelete(params: any) { -// return request.post({ url: '/bid.bid_buy_bidding_document/delete', params }) -// } +export function apiBidBuyBiddingDocumentDelete(params: any) { + return request.post({ url: '/bid.bid_buy_bidding_document/delete', params }) +} // 购买标书详情 export function apiBidBuyBiddingDocumentDetail(params: any) { diff --git a/src/components/uploadAnnex/index.vue b/src/components/uploadAnnex/index.vue index 9b0709e..188a1c1 100644 --- a/src/components/uploadAnnex/index.vue +++ b/src/components/uploadAnnex/index.vue @@ -7,12 +7,10 @@ 上传 -
-
- {{ - item.name }} - x -
+ +
+ {{ item.name }} + x
diff --git a/src/views/bid_document_examination/detail.vue b/src/views/bid_document_examination/detail.vue index e1a8427..78d37c6 100644 --- a/src/views/bid_document_examination/detail.vue +++ b/src/views/bid_document_examination/detail.vue @@ -1,65 +1,56 @@ - - - @@ -219,11 +176,12 @@ + @@ -251,7 +209,7 @@ import Popup from '@/components/popup/index.vue' import customDialog1 from '@/components/product/index.vue' import biddocumentTable from "@/components/biddocument/index.vue" import { apiBidDocumentExaminationAdd, apiBidDocumentExaminationEdit, apiBidDocumentExaminationDetail } from '@/api/bid_document_examination' -import type { PropType } from 'vue' +import { apiBidDocumentExaminationDetailLists, apiBidDocumentExaminationDetailDelete } from '@/api/bid_document_examination_detail' import { watch } from "vue" import { useDictData } from '@/hooks/useDictOptions' const { dictData } = useDictData('whether_status,tax_rate,pay_type,construction_funds_sources,bidding_method') @@ -268,7 +226,6 @@ const bid_company_name = ref('') const amount = ref('') const buyer = ref('') const project_name = ref('') -const project_fund_source = ref('') const is_margin = ref('') const bid_date = ref('') const buy_date = ref('') @@ -280,36 +237,10 @@ const bidding_project_overview = ref('') const project_introduction = ref('') const bid_address = ref('') const tableData = ref([{}]) -const list1 = reactive([]) -const list2 = reactive([]) -import configs from "@/config" -const base_url = configs.baseUrl + configs.urlPrefix -import useUserStore from "@/stores/modules/user"; -const userStore = useUserStore(); -const formDataannex = reactive([]) -const formDataannex1 = reactive([]) -const formDataannex2 = reactive([]) -// 上传文件 -const handleAvatarSuccess_four1 = ( - response, - uploadFile -) => { - if (response.code == 0) { - ElMessage.error(response.msg); - return; - } - formDataannex1.push( - { uri: response.data.uri, name: response.data.name } - ); -}; -// 删除上传的文件 -const delFileFn1 = (index: number) => { - formDataannex1.splice(index, 1) -} //金额计算 const jiprice1 = (row: any, index: any) => { if (row.cost_price) { @@ -331,24 +262,7 @@ const jiprice3 = (row: any, index: any) => { } } -// 上传文件 -const handleAvatarSuccess_four2 = ( - response, - uploadFile -) => { - if (response.code == 0) { - ElMessage.error(response.msg); - return; - } - formDataannex2.push( - { uri: response.data.uri, name: response.data.name } - ); -}; -// 删除上传的文件 -const delFileFn2 = (index: number) => { - formDataannex2.splice(index, 1) -} const handleAdd = (row: any) => { // 在 row 后面插入一行数据 @@ -356,10 +270,12 @@ const handleAdd = (row: any) => { tableData.value.splice(index + 1, 0, {}); }; -const handleDelete = (row: any) => { +const handleDelete = async (row: any) => { + if (row.id) await apiBidDocumentExaminationDetailDelete({ id: row.id }) // 删除 row const index = tableData.value.indexOf(row); tableData.value.splice(index, 1); + calcTotalAmount() }; //打开产品弹窗 @@ -377,7 +293,9 @@ const formData = reactive({ id: '', approve_id: 0, buy_bidding_document_id: '', + project_name: "", custom_name: "", + is_margin: "", bidding_project_overview: '', project_introduction: '', technical_protocol_deviation: '', @@ -393,25 +311,28 @@ const formData = reactive({ quotation_detail: [], }) -watch(tableData.value, (newVal, oldVal) => { + +const calcTotalAmount = () => { formData.business_review_total_amount = 0 tableData.value.forEach(item => { formData.business_review_total_amount += Number(item.sale_amount) item.sale_amount = item.num * item.sale_price }) -}) +} + + //获取值 const customEvent = (e: any) => { formData.buy_bidding_document_id = e.id; - is_margin.value = e.is_margin + formData.is_margin = e.is_margin bid_document_no.value = e.bid_document_no invite_tenders_company_name.value = e.invite_tenders_company_name bid_company_name.value = e.bid_company_name amount.value = e.amount buyer.value = e.buyer - project_name.value = e.project_name + formData.project_name = e.project_name bid_date.value = e.bidding_time buy_date.value = e.buy_date invite_tenders_type.value = e.bid_type @@ -427,9 +348,9 @@ const customEvent = (e: any) => { }; const customEvent1 = (e: any) => { tableData.value[num.value].product_id = e.id - tableData.value[num.value].name = e.name - tableData.value[num.value].specs = e.specs - tableData.value[num.value].unit = e.unit + tableData.value[num.value].product_name = e.name + tableData.value[num.value].product_specs = e.specs + tableData.value[num.value].product_unit = e.unit showDialog1.value = false; }; @@ -454,31 +375,7 @@ const setFormData = async (data: Record) => { formData[key] = data[key] } } - if (data.dept_id) { - // getlist1(data.org_id) - } - - if (data.technical_review_annex && data.technical_review_annex.length > 0) { - const arry1 = data.technical_review_annex.map((item: any, index: any) => { - return { - name: `文件${index + 1}`, - uri: item - }; - }); - Object.assign(formDataannex1, arry1) - } - if (data.business_contract_deviation_annex && data.business_contract_deviation_annex.length > 0) { - - const arry1 = data.business_contract_deviation_annex.map((item: any, index: any) => { - return { - name: `文件${index + 1}`, - uri: item - }; - }); - Object.assign(formDataannex2, arry1) - - } bid_document_no.value = data.bid_document_no invite_tenders_company_name.value = data.invite_tenders_company_name bid_company_name.value = data.bid_company_name @@ -494,6 +391,15 @@ const setFormData = async (data: Record) => { deposit_refund_time.value = data.margin_amount_return_date bidding_project_overview.value = data.bid_project_overview project_introduction.value = data.project_desc + + let res = await apiBidDocumentExaminationDetailLists({ bid_document_examination_id: formData.id }) + tableData.value = res.lists + + calcTotalAmount() + + + + } const getDetail = async (row: Record) => { @@ -506,12 +412,7 @@ const getDetail = async (row: Record) => { // 提交按钮 const handleSubmit = async () => { - if (formDataannex1.length > 0) { - formData.technical_review_annex = formDataannex1.map(item => item.uri) - } - if (formDataannex2.length > 0) { - formData.business_contract_deviation_annex = formDataannex2.map(item => item.uri) - } + if (tableData.value.length > 0) { let data1 = tableData.value.map((item) => ({ product_id: item.product_id, diff --git a/src/views/bid_document_examination/index.vue b/src/views/bid_document_examination/index.vue index 24eda4e..602136a 100644 --- a/src/views/bid_document_examination/index.vue +++ b/src/views/bid_document_examination/index.vue @@ -30,9 +30,6 @@ 新增 -
@@ -50,12 +47,14 @@