From cf07ad499f66a5c7a0db97ae28eb58ed78396d9b Mon Sep 17 00:00:00 2001 From: chenxi Date: Wed, 30 Sep 2026 17:04:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93=E6=98=8E=E7=BB=86=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E2=80=9C=E6=80=BB=E8=AE=A1=E2=80=9D=E5=88=97=EF=BC=88?= =?UTF-8?q?=3D=E9=87=91=E9=A2=9D+=E9=A2=84=E4=BC=B0=E9=87=91=E9=A2=9D?= =?UTF-8?q?=EF=BC=89=EF=BC=8C=E9=A1=B5=E9=9D=A2=E4=B8=8E=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Business/Pages.php | 6 ++++++ .../views/business/pages/partials/directory-table.blade.php | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Business/Pages.php b/app/Http/Controllers/Business/Pages.php index be7ea85cd..675dbcb91 100644 --- a/app/Http/Controllers/Business/Pages.php +++ b/app/Http/Controllers/Business/Pages.php @@ -562,6 +562,7 @@ class Pages extends Controller 'supplier' => '供应商', 'item_no' => '货号', 'barcode' => '条码', 'spec_name' => '规格名', 'quantity' => '库存变动量', 'unit_price' => '单价', 'amount' => '金额', 'estimated_unit_price' => '预估单价', 'estimated_amount' => '预估金额', + 'total' => '总计', 'supplier_barcode' => '供应商条码', 'remark' => '备注', 'warehouse' => '仓库', 'warehouse_short_name' => '仓库简称', 'created_at_raw' => '创建时间(实际)', 'express_name' => '快递名称', 'express_no' => '快递单号', 'not_sent' => '未发出', 'owner_name' => '负责人', @@ -594,6 +595,11 @@ class Pages extends Controller foreach ($rows as $row) { $line = []; foreach (array_keys($labels) as $column) { + if ($column === 'total') { + // 总计 = 金额 + 预估金额 + $line[] = number_format((float) ($row->amount ?? 0) + (float) ($row->estimated_amount ?? 0), 2); + continue; + } $value = $row->{$column} ?? ''; $line[] = is_string($value) ? $value : (string) $value; } diff --git a/resources/views/business/pages/partials/directory-table.blade.php b/resources/views/business/pages/partials/directory-table.blade.php index d49eb666d..223900f9c 100644 --- a/resources/views/business/pages/partials/directory-table.blade.php +++ b/resources/views/business/pages/partials/directory-table.blade.php @@ -1605,6 +1605,7 @@ 金额 预估单价 预估金额 + 总计 供应商条码 备注 仓库 @@ -1631,6 +1632,7 @@ {{ $inboundRow->amount === null ? '—' : number_format((float) $inboundRow->amount, 2) }} {{ $inboundRow->estimated_unit_price === null ? '—' : number_format((float) $inboundRow->estimated_unit_price, 2) }} {{ $inboundRow->estimated_amount === null ? '—' : number_format((float) $inboundRow->estimated_amount, 2) }} + {{ ($inboundRow->amount === null && $inboundRow->estimated_amount === null) ? '—' : number_format((float) ($inboundRow->amount ?? 0) + (float) ($inboundRow->estimated_amount ?? 0), 2) }} {{ $inboundRow->supplier_barcode ?? '—' }} {{ $inboundRow->remark ?? '—' }} {{ $inboundRow->warehouse ?? '—' }} @@ -1643,7 +1645,7 @@ @empty - +
尚未导入入库明细数据。