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)