增加审批时间轴&&调整采购单

This commit is contained in:
mzl
2025-09-24 17:38:04 +08:00
parent 07af16ed9d
commit 2a44802994
7 changed files with 299 additions and 60 deletions
@@ -169,4 +169,33 @@ class ApprovalRecordsController extends BaseController
return $this->error($e->getMessage());
}
}
public function approvalTimeline(Request $request)
{
try {
$raw = $this->service->serviceApprovalTimeline($request, $request->all());
$data = $this->transformData($raw, method_exists($this, 'timelineFormat')
? [$this, 'timelineFormat']
: null);
return $this->success($data);
} catch (\Throwable $e) {
return $this->error($e->getMessage());
}
}
protected function timelineFormat($data)
{
$result = [];
foreach ($data as $record) {
$result[] = [
'id' => $record['id'],
'name' => $record['approver']['name'],
'comment' => $record['comment'],
'time' => $record['updated_at']
];
}
return $result;
}
}