From a256b9e7cdf3c31581c8a673de8ecbcd326beee0 Mon Sep 17 00:00:00 2001 From: chenxi Date: Mon, 16 Nov 2026 11:35:40 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=A1=BE=E5=AE=B6=E8=BF=87=E8=B4=A6):=20?= =?UTF-8?q?=E5=8F=91=E8=B4=A7=E6=98=8E=E7=BB=86=E4=BB=85=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../KukaPostingBasePageData.php | 10 ++- config/kuka_posting.php | 17 ++++ .../pages/partials/directory-table.blade.php | 13 ++-- .../posting-data/kuka-basic-data.blade.php | 3 +- .../Business/KukaPostingBasePageTest.php | 77 ++++++++++++++++--- 5 files changed, 102 insertions(+), 18 deletions(-) diff --git a/app/Business/KukaPostingBase/KukaPostingBasePageData.php b/app/Business/KukaPostingBase/KukaPostingBasePageData.php index 8ddf67c2..f60e2c6a 100644 --- a/app/Business/KukaPostingBase/KukaPostingBasePageData.php +++ b/app/Business/KukaPostingBase/KukaPostingBasePageData.php @@ -28,7 +28,15 @@ class KukaPostingBasePageData public function build(Request $request, int $companyId): array { $stores = array_values((array) config('kuka_posting.stores', [])); - $fields = array_values((array) config('kuka_posting.fields', [])); + $fieldDefinitions = collect((array) config('kuka_posting.fields', []))->keyBy('name'); + $displayFieldNames = array_values((array) config('kuka_posting.shipment_display_fields', [])); + $fields = $displayFieldNames === [] + ? $fieldDefinitions->values()->all() + : collect($displayFieldNames) + ->map(static fn (string $name): ?array => $fieldDefinitions->get($name)) + ->filter() + ->values() + ->all(); $available = $this->repository->available(); $periods = $available ? $this->repository->periods($companyId) : []; $latest = $available ? $this->repository->latestImport($companyId) : null; diff --git a/config/kuka_posting.php b/config/kuka_posting.php index d5b333ee..a90e17ac 100644 --- a/config/kuka_posting.php +++ b/config/kuka_posting.php @@ -138,6 +138,23 @@ return [ ['name' => 'specification_model', 'source' => '规格型号', 'label' => '规格型号'], ['name' => 'material', 'source' => '材质', 'label' => '材质'], ], + 'shipment_display_fields' => [ + 'online_order_no', + 'order_status', + 'shipping_warehouse', + 'store_name', + 'shipping_date', + 'product_code', + 'style_code', + 'item_number', + 'material_number', + 'model', + 'cost', + 'product_material', + 'shipped_quantity', + 'shipping_amount', + 'posting_label', + ], 'field_widths' => [ 'internal_order_no' => 120, 'marked_labels' => 340, diff --git a/resources/views/business/pages/partials/directory-table.blade.php b/resources/views/business/pages/partials/directory-table.blade.php index 059231d7..e7be83dc 100644 --- a/resources/views/business/pages/partials/directory-table.blade.php +++ b/resources/views/business/pages/partials/directory-table.blade.php @@ -1,5 +1,6 @@ @php $showDirectoryIntro = $showDirectoryIntro ?? true; + $showDirectoryIndex = $showDirectoryIndex ?? true; $enableColumnResize = $enableColumnResize ?? false; $columnWidths = is_array($columnWidths ?? null) ? $columnWidths : []; $directoryRows = $rows ?? collect(); @@ -3302,7 +3303,7 @@