From 5b06632e774ac73f512cb8744d9570d73ecc9538 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Sat, 5 Jul 2025 17:19:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=90=E6=96=99=E7=AB=99=E9=A2=86=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/materialsStation/toolsLease/toolsLeaseAdd.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pages/materialsStation/toolsLease/toolsLeaseAdd.vue b/src/pages/materialsStation/toolsLease/toolsLeaseAdd.vue index 5cd4516..471abbc 100644 --- a/src/pages/materialsStation/toolsLease/toolsLeaseAdd.vue +++ b/src/pages/materialsStation/toolsLease/toolsLeaseAdd.vue @@ -325,7 +325,11 @@ const getAgreementInfoById = async () => { } const res = await getAgreementInfoByIdApi(params) console.log('🚀 ~ getAgreementInfoById ~ res:', res) - const agreementId = res.data.agreementId + if (!res.data || !Array.isArray(res.data)) { + equipmentList = [] + return + } + const agreementId = res.data getEquipmentList(agreementId) } catch (error) { console.log('🚀 ~ getAgreementInfoById ~ error:', error) @@ -335,7 +339,7 @@ const getAgreementInfoById = async () => { const getEquipmentList = async (params) => { console.log('🚀 ~ getEquipmentList ~ params:', params) try { - const res = await getTypeTreeList({ agreementId: params }) + const res = await getTypeTreeList({ agreementIdList: params, proId: formData.projectId, teamId: formData.teamId }) if (res.data.length > 0) { equipmentList.value = formatEquipmentTree(res.data) console.log('🚀 ~ getEquipmentList ~ machineList.value:', equipmentList.value)