From 139acd9e70468be95c075fed7dd4154fd15a0a6b Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Wed, 7 Jan 2026 09:42:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81=E8=A7=84=E6=A0=BC=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E4=BC=A0=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/service/InvItemService.php | 2 +- app/common/service/InvRequisitionService.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/common/service/InvItemService.php b/app/common/service/InvItemService.php index eb49fb9..5a4b8f1 100644 --- a/app/common/service/InvItemService.php +++ b/app/common/service/InvItemService.php @@ -112,7 +112,7 @@ class InvItemService $data['spec_model'] = ''; $data['unit'] = '件'; $data['is_consumable'] = 0; - $data['stock_qty'] = 1; + $data['stock_qty'] = $data['stock_qty']??1; $data['location'] = ''; return $data; } diff --git a/app/common/service/InvRequisitionService.php b/app/common/service/InvRequisitionService.php index 6c4e8e2..e7bf1a7 100644 --- a/app/common/service/InvRequisitionService.php +++ b/app/common/service/InvRequisitionService.php @@ -144,9 +144,9 @@ class InvRequisitionService 'requisition_id' => $created->id, 'item_id' => $item['item_id'], 'item_name_snap' => $item['item_name_snap'], // 修改:使用 snap 字段 - 'spec_model_snap' => $item['spec_model_snap'], // 修改:使用 snap 字段 - 'unit_snap' => $item['unit_snap'], // 修改:使用 snap 字段 - 'is_consumable_snap' => $item['is_consumable_snap'], // 修改:使用 snap 字段 + 'spec_model_snap' => $item['spec_model_snap']??'', // 修改:使用 snap 字段 + 'unit_snap' => $item['unit_snap']??'', // 修改:使用 snap 字段 + 'is_consumable_snap' => $item['is_consumable_snap']?? 0, // 修改:使用 snap 字段 'request_qty' => (int) $item['request_qty'] ?? 1, // 动态获取数量,转为整型 'approved_qty' => (int) $item['request_qty'] ?? 1, // 初始审批数量等于申请数量 'remark' => $item['remark'] ?? ''