物品归还
This commit is contained in:
@@ -178,6 +178,9 @@ class InvRequisitionItemReturnService
|
||||
$created = $this->logicCreate($item);
|
||||
}
|
||||
$this->processRequisitionItemReturnAttachment($res, $attachment);
|
||||
InvRequisition::where('id',$request->post('requisition_id'))->update(
|
||||
['status' => 14] //审批状态:10默认、11审批中、12已审批(待归还)、13拒绝、14申请归还、15归还审核中、16部分归还、17已全部归还、18已拒绝
|
||||
);
|
||||
$this->postProcess('Store', $created);
|
||||
return $res;
|
||||
});
|
||||
@@ -406,6 +409,7 @@ class InvRequisitionItemReturnService
|
||||
// 全部非耗材都已归还
|
||||
$affected = InvRequisition::where('id', $requisitionId)->update([
|
||||
'is_returned' => 1,
|
||||
'status' => 17,
|
||||
'updated_at' => time(),
|
||||
]);
|
||||
|
||||
@@ -413,6 +417,12 @@ class InvRequisitionItemReturnService
|
||||
if ($affected === 0) {
|
||||
throw new BusinessException('更新领用单状态失败,可能记录不存在');
|
||||
}
|
||||
}else{
|
||||
// 非耗材未全部都已归还
|
||||
$affected = InvRequisition::where('id', $requisitionId)->update([
|
||||
'status' => 16,
|
||||
'updated_at' => time(),
|
||||
]);
|
||||
}
|
||||
|
||||
// 7. 返回处理结果(保持你原来的 postProcess 习惯)
|
||||
@@ -444,13 +454,13 @@ class InvRequisitionItemReturnService
|
||||
$config['where']['id'] = $p['requisition_item_return_id'];
|
||||
break;
|
||||
case 'index':
|
||||
$config['where']['status'] = 1;
|
||||
$config['order']['sort'] = 'desc';
|
||||
if(isset($p['status'])){
|
||||
$config['where']['status'] = $p['status'];
|
||||
}
|
||||
$config['order']['id'] = 'desc';
|
||||
break;
|
||||
case 'show':
|
||||
$config['where']['id'] = $p['id'];
|
||||
$config['where']['status'] = 1;
|
||||
break;
|
||||
case 'store':
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user