From 68ea351c99d73c9a12c842ae6a0c85b154e69cd8 Mon Sep 17 00:00:00 2001 From: dxc Date: Mon, 2 Mar 2026 11:35:55 +0800 Subject: [PATCH] refactor: replace manual_cost with unit_total_cost and total_price Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) --- inventory-web/src/views/stock/inbound/product.vue | 6 +++++- inventory-web/src/views/stock/inbound/semi.vue | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/inventory-web/src/views/stock/inbound/product.vue b/inventory-web/src/views/stock/inbound/product.vue index 8756696..4c0d5b6 100644 --- a/inventory-web/src/views/stock/inbound/product.vue +++ b/inventory-web/src/views/stock/inbound/product.vue @@ -878,9 +878,13 @@ const handleUpdate = (row: any) => { inspection_report_link: row.inspection_report_link || [], in_quantity: Number(row.qty_inbound), raw_material_cost: (row.raw_material_cost !== null && row.raw_material_cost !== undefined) ? Number(row.raw_material_cost) : undefined, - manual_cost: (row.manual_cost !== null && row.manual_cost !== undefined) ? Number(row.manual_cost) : undefined, + unit_total_cost: (row.unit_total_cost !== null && row.unit_total_cost !== undefined) ? Number(row.unit_total_cost) : undefined, sale_price: (row.sale_price !== null && row.sale_price !== undefined) ? Number(row.sale_price) : undefined }) + // 计算总成本 + const u = Number(form.unit_total_cost || 0) + const q = Number(form.in_quantity || 1) + form.total_price = Number((u * q).toFixed(2)) if(row.production_start_time && row.production_end_time) { form.production_time_range = [row.production_start_time, row.production_end_time] } else { form.production_time_range = [] } productPhotoList.value = form.product_photo.map(url => ({ name: url.split('/').pop(), url: getImageUrl(url) })) const qReports = form.quality_report_link || [] diff --git a/inventory-web/src/views/stock/inbound/semi.vue b/inventory-web/src/views/stock/inbound/semi.vue index ece521d..6d32479 100644 --- a/inventory-web/src/views/stock/inbound/semi.vue +++ b/inventory-web/src/views/stock/inbound/semi.vue @@ -999,13 +999,16 @@ const handleUpdate = (row: any) => { in_quantity: Number(row.qty_inbound), stock_quantity: Number(row.qty_stock), available_quantity: Number(row.qty_available), bom_code: row.bom_code, bom_version: row.bom_version, work_order_code: row.work_order_code, raw_material_cost: (row.raw_material_cost !== null && row.raw_material_cost !== undefined) ? Number(row.raw_material_cost) : undefined, - manual_cost: (row.manual_cost !== null && row.manual_cost !== undefined) ? Number(row.manual_cost) : undefined, unit_total_cost: (row.unit_total_cost !== null && row.unit_total_cost !== undefined) ? Number(row.unit_total_cost) : undefined, production_manager: row.production_manager, production_time_range: (row.production_start_time && row.production_end_time) ? [row.production_start_time, row.production_end_time] : [], detail_link: row.detail_link, arrival_photo: row.arrival_photo || [], quality_report_link: row.quality_report_link || [] }) + // 计算总成本 + const u = Number(form.unit_total_cost || 0) + const q = Number(form.in_quantity || 1) + form.total_price = Number((u * q).toFixed(2)) arrivalFileList.value = form.arrival_photo.map(url => ({ name: url.split('/').pop(), url: getImageUrl(url) })) const reports = form.quality_report_link || [] const reportImgs = reports.filter(r => !isExternalLink(r))