| | |
| | | const calculateTotalPrice = (row) => { |
| | | const quantityStock = Number(row?.quantityStock ?? 0); |
| | | const taxInclusiveUnitPrice = Number(row?.taxInclusiveUnitPrice ?? 0); |
| | | |
| | | |
| | | if (Number.isFinite(quantityStock) && Number.isFinite(taxInclusiveUnitPrice)) { |
| | | row.taxInclusiveTotalPrice = quantityStock * taxInclusiveUnitPrice; |
| | | } else { |
| | |
| | | productList.value = []; |
| | | return |
| | | } |
| | | productList.value = productRes.data.map(item => { |
| | | const quantityStock = Number(item?.quantity0 ?? 0); |
| | | const taxInclusiveUnitPrice = Number(item?.taxInclusiveUnitPrice ?? 0); |
| | | return { |
| | | ...item, |
| | | quantityStock, |
| | | taxInclusiveUnitPrice, |
| | | taxInclusiveTotalPrice: quantityStock * taxInclusiveUnitPrice, |
| | | originalQuantityStock: Number(item.quantityStock ?? item.inboundQuantity ?? 0), |
| | | }; |
| | | }) |
| | | productList.value = productRes.data.map(item => ({ |
| | | ...item, |
| | | quantityStock: 0, |
| | | taxInclusiveUnitPrice: Number(item?.taxInclusiveUnitPrice ?? 0), |
| | | taxInclusiveTotalPrice: 0, |
| | | originalQuantityStock: Number(item.quantityStock ?? item.inboundQuantity ?? 0), |
| | | })) |
| | | } catch (error) { |
| | | console.error('查询产品记录失败:', error) |
| | | proxy.$modal.msgError('查询产品记录失败') |
| | |
| | | details: selectedRows.value.map(product => ({ |
| | | id: product.id, |
| | | inboundQuantity: Number(product.quantityStock), |
| | | taxInclusiveUnitPrice: Number(product.taxInclusiveUnitPrice), |
| | | unitPrice: Number(product.taxInclusiveUnitPrice), |
| | | taxRate: Number(product.taxRate), |
| | | taxInclusiveTotalPrice: Number(product.taxInclusiveTotalPrice) |
| | | })), |
| | | }; |
| | |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } |
| | | |
| | | function getCurrentDate() { |
| | | return formatDateTime(new Date(), false); |
| | | } |
| | | |
| | | const openDialog = async (type, row) => { |
| | | operationType.value = type |