归还
This commit is contained in:
@@ -119,10 +119,10 @@ class InvRequisitionItemReturnService
|
||||
$data['applicant_id'] = $user['user']['id'];
|
||||
$data['applicant_name'] = $user['user']['name'];
|
||||
|
||||
$reqItemId = $data['requisition_id'];
|
||||
//$reqItemId = $data['requisition_id'];
|
||||
$arr = [];
|
||||
foreach ($reqItemsArr as $reqItem) {
|
||||
|
||||
$reqItemId = $reqItem['id'];
|
||||
// 检查是否有对应的新申请项数据
|
||||
if (!isset($newReqItems[$reqItemId])) {
|
||||
continue;
|
||||
@@ -135,7 +135,7 @@ class InvRequisitionItemReturnService
|
||||
'apply_user_id' => $user['user']['id'],
|
||||
'apply_user_name' => $user['user']['name'],
|
||||
'return_qty' => $newReqItems[$reqItemId]['return_qty'] ?: '1',
|
||||
'apply_remark' => $newReqItems[$reqItemId]['apply_remark'] ?? '',
|
||||
'apply_remark' => $data['apply_remark'] ?? '',
|
||||
//'attachment' => $newReqItems[$reqItemId]['attachment'],
|
||||
//'return_at' => time(),
|
||||
'return_at' => $data['return_at'],
|
||||
@@ -175,6 +175,7 @@ class InvRequisitionItemReturnService
|
||||
$created = [];
|
||||
foreach ($items as $item) {
|
||||
//$created = $this->logicCreate($item, $dl);
|
||||
$item['requisition_id'] = $data['requisition_id'];
|
||||
$created = $this->logicCreate($item);
|
||||
}
|
||||
$this->processRequisitionItemReturnAttachment($res, $attachment);
|
||||
|
||||
@@ -226,13 +226,14 @@ class InvRequisitionService
|
||||
}
|
||||
|
||||
foreach ($items as $item) {
|
||||
$invitem = InvItem::where('id',$item)->first();
|
||||
$itemData = [
|
||||
'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']?? 0, // 修改:使用 snap 字段
|
||||
'is_consumable_snap' => $item['is_consumable_snap']?? ($invitem['is_consumable_snap']??0), // 修改:使用 snap 字段
|
||||
'request_qty' => (int) $item['request_qty'] ?? 1, // 动态获取数量,转为整型
|
||||
'approved_qty' => (int) $item['request_qty'] ?? 1, // 初始审批数量等于申请数量
|
||||
'remark' => $item['remark'] ?? ''
|
||||
|
||||
Reference in New Issue
Block a user