main
Jing Li 2024-04-21 16:37:50 +08:00
parent c70868c91d
commit 9b5184cbbf
11 changed files with 21 additions and 13 deletions

View File

@ -124,7 +124,7 @@ class AgreementController extends AdminController
])->body([ ])->body([
$detail, $detail,
amisMake()->Divider(), amisMake()->Divider(),
$this->baseWorkflowLogService($detailId)->id($serviceId), $this->baseWorkflowLogList($detailId)->id($serviceId),
]); ]);
} }

View File

@ -165,7 +165,7 @@ class LedgerController extends AdminController
['label' => __('workflow_log.remarks'), 'content' => '${workflow.check_remarks}'], ['label' => __('workflow_log.remarks'), 'content' => '${workflow.check_remarks}'],
]), ]),
amis()->Divider(), amis()->Divider(),
$this->baseWorkflowLogService($detailId)->id($serviceId), $this->baseWorkflowLogList($detailId)->id($serviceId),
]); ]);
} }

View File

@ -90,7 +90,7 @@ class ReimbursementController extends AdminController
['label' => __('workflow_log.remarks'), 'content' => '${workflow.check_remarks}'], ['label' => __('workflow_log.remarks'), 'content' => '${workflow.check_remarks}'],
]), ]),
amis()->Divider(), amis()->Divider(),
$this->baseWorkflowLogService($detailId)->id($serviceId), $this->baseWorkflowLogList($detailId)->id($serviceId),
]); ]);
} }
} }

View File

@ -152,7 +152,7 @@ class StoreMasterCommissionController extends AdminController
['label' => __('workflow_log.remarks'), 'content' => '${workflow.check_remarks}', 'span' => 2], ['label' => __('workflow_log.remarks'), 'content' => '${workflow.check_remarks}', 'span' => 2],
]), ]),
amis()->Divider(), amis()->Divider(),
$this->baseWorkflowLogService($detailId)->id($serviceId), $this->baseWorkflowLogList($detailId)->id($serviceId),
]); ]);
} }
} }

View File

@ -133,7 +133,7 @@ class HolidayController extends AdminController
])->body([ ])->body([
$detail, $detail,
amisMake()->Divider(), amisMake()->Divider(),
$this->baseWorkflowLogService($detailId)->id($serviceId), $this->baseWorkflowLogList($detailId)->id($serviceId),
]); ]);
} }
} }

View File

@ -119,7 +119,7 @@ class OfficalBusinessController extends AdminController
])->body([ ])->body([
$detail, $detail,
amisMake()->Divider(), amisMake()->Divider(),
$this->baseWorkflowLogService($detailId)->id($serviceId), $this->baseWorkflowLogList($detailId)->id($serviceId),
]); ]);
} }
} }

View File

@ -123,7 +123,7 @@ class OvertimeController extends AdminController
])->body([ ])->body([
$detail, $detail,
amisMake()->Divider(), amisMake()->Divider(),
$this->baseWorkflowLogService($detailId)->id($serviceId), $this->baseWorkflowLogList($detailId)->id($serviceId),
]); ]);
} }
} }

View File

@ -123,7 +123,7 @@ class PromotionController extends AdminController
['label' => __('employee_promotion.invitor_id'), 'content' => '${invitor.name}'], ['label' => __('employee_promotion.invitor_id'), 'content' => '${invitor.name}'],
['label' => __('employee_promotion.promotion_status'), 'content' => amisMake()->Mapping()->name('promotion_status')->map(PromotionStatus::options())], ['label' => __('employee_promotion.promotion_status'), 'content' => amisMake()->Mapping()->name('promotion_status')->map(PromotionStatus::options())],
['label' => __('employee_promotion.remarks'), 'content' => '${remarks}'], ['label' => __('employee_promotion.remarks'), 'content' => '${remarks}'],
['label' => __('employee_promotion.created_at'), 'content' => '${created_at}', 'span' => 3], ['label' => __('employee_promotion.created_at'), 'content' => '${created_at}', 'span' => 3],
]); ]);
$data = amisMake()->Property()->items([ $data = amisMake()->Property()->items([
@ -149,7 +149,7 @@ class PromotionController extends AdminController
amisMake()->Divider()->title('补充资料'), amisMake()->Divider()->title('补充资料'),
$data, $data,
amisMake()->Divider(), amisMake()->Divider(),
$this->baseWorkflowLogService($detailId)->id($serviceId), $this->baseWorkflowLogList($detailId)->id($serviceId),
]); ]);
} }
} }

View File

@ -127,7 +127,7 @@ class SignRepairController extends AdminController
])->body([ ])->body([
$detail, $detail,
amisMake()->Divider(), amisMake()->Divider(),
$this->baseWorkflowLogService($detailId)->id($serviceId), $this->baseWorkflowLogList($detailId)->id($serviceId),
]); ]);
} }
} }

View File

@ -60,8 +60,15 @@ trait HasCheckActions
->visibleOn('${check_status == '.CheckStatus::Processing->value.'}'); ->visibleOn('${check_status == '.CheckStatus::Processing->value.'}');
} }
public function baseWorkflowLogService($reload = null): Service /**
* 审批流水
*/
public function baseWorkflowLogList($reloadAfterCheckSuccess = null, $reloadAfterCheckFailed = null): Service
{ {
if (func_num_args() === 1 && ! is_null($reloadAfterCheckSuccess)) {
$reloadAfterCheckFailed = $reloadAfterCheckSuccess;
}
return amis()->Service() return amis()->Service()
->initFetch(false) ->initFetch(false)
->api(admin_url('api/workflow/logs?id=${workflow.id}')) ->api(admin_url('api/workflow/logs?id=${workflow.id}'))
@ -74,8 +81,8 @@ trait HasCheckActions
amis()->TableColumn()->name('checked_at')->label(__('workflow_log.checked_at')), amis()->TableColumn()->name('checked_at')->label(__('workflow_log.checked_at')),
amis()->TableColumn()->name('remarks')->label(__('workflow_log.remarks')), amis()->TableColumn()->name('remarks')->label(__('workflow_log.remarks')),
])->itemActions([ ])->itemActions([
$this->succesAction()->visibleOn('${checkable}')->reload($reload), $this->succesAction()->visibleOn('${checkable}')->reload($reloadAfterCheckSuccess),
$this->failAction()->visibleOn('${checkable}')->reload($reload), $this->failAction()->visibleOn('${checkable}')->reload($reloadAfterCheckFailed),
]) ])
); );
} }

View File

@ -22,6 +22,7 @@ class AdminSeeder extends Seeder
'password' => bcrypt('admin'), 'password' => bcrypt('admin'),
'name' => 'Administrator', 'name' => 'Administrator',
]); ]);
DB::table('employees')->truncate();
DB::table('employees')->insert([ DB::table('employees')->insert([
'name' => 'admin', 'name' => 'admin',
'phone' => '12345678900', 'phone' => '12345678900',