| | |
| | | }); |
| | | // 使用 Promise.all 处理所有异步请求 |
| | | const processedOrders = await Promise.all(response.data.records.map(async (order) => { |
| | | // 等待异步获取产品记录 |
| | | // 等待异步获取产品记录(按采购台账id精确反显,合同号可能重复/为空) |
| | | const productRes = await selectProductRecordListByPuechaserId({ |
| | | purchaseContractNumber: order.purchaseContractNumber |
| | | purchaseLedgerId: order.id |
| | | }); |
| | | |
| | | // 确保 productRes.data 存在 |
| | |
| | | { |
| | | try { |
| | | loadingProducts.value = true |
| | | // 根据合同查询产品记录 |
| | | // 根据采购台账id查询产品记录 |
| | | const productRes = await selectProductRecordListByPuechaserId({ |
| | | purchaseContractNumber: receiptForm.value.purchaseContractNumber |
| | | purchaseLedgerId: receiptForm.value.purchaseLedgerId |
| | | }); |
| | | console.log('productRes:', productRes) |
| | | operationType.value = 'add' |