```
feat(shopro_huifu): 添加汇付进件管理功能 - 新增汇付进件管理模块,支持新建、编辑进件流程 - 实现用户角色绑定验证功能,确保进件角色的有效性 - 集成Vue.js前端界面,提供完整的表单操作体验 - 支持个人和企业两种账户类型的进件资料录入 - 添加银行支行搜索功能,方便结算账户信息填写 - 完善进件状态管理和审核流程控制 - 增加图片上传组件,支持身份证、营业执照等证件上传 ```
这个提交包含在:
@@ -2,7 +2,10 @@
|
||||
|
||||
namespace app\admin\controller\shopro_huifu;
|
||||
|
||||
use addons\shopro_huifu\library\onboard\HuifuOnboardAdminService;
|
||||
use addons\shopro_huifu\library\onboard\HuifuOnboardAdminView;
|
||||
use addons\shopro_huifu\library\onboard\HuifuOnboardBankBranch;
|
||||
use addons\shopro_huifu\library\onboard\HuifuOnboardError;
|
||||
use addons\shopro_huifu\library\onboard\HuifuOnboardQuery;
|
||||
use addons\shopro_huifu\library\onboard\HuifuOnboardService;
|
||||
use addons\shopro_huifu\model\Onboard as OnboardModel;
|
||||
@@ -10,6 +13,7 @@ use app\admin\controller\shopro\Base;
|
||||
|
||||
class Onboard extends Base
|
||||
{
|
||||
protected $noNeedRight = ['userRoles', 'searchBranch'];
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
@@ -77,6 +81,78 @@ class Onboard extends Base
|
||||
}
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
return $this->persistDraft();
|
||||
}
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
public function edit($ids = null)
|
||||
{
|
||||
$row = OnboardModel::get($ids);
|
||||
if (!$row) {
|
||||
$this->error('记录不存在');
|
||||
}
|
||||
if ($this->request->isPost()) {
|
||||
return $this->persistDraft($row);
|
||||
}
|
||||
$this->assignconfig('onboardForm', HuifuOnboardAdminView::formDataFromRow($row));
|
||||
return $this->view->fetch('shopro_huifu/onboard/add');
|
||||
}
|
||||
|
||||
public function userRoles()
|
||||
{
|
||||
$userId = intval($this->request->get('user_id', 0));
|
||||
if ($userId <= 0) {
|
||||
$this->error('请选择用户');
|
||||
}
|
||||
$user = HuifuOnboardAdminView::enrichListRow(['user_id' => $userId, 'payload' => '']);
|
||||
$this->success('ok', null, [
|
||||
'user' => [
|
||||
'id' => $userId,
|
||||
'nickname' => $user['user_nickname'] ?? '',
|
||||
'mobile' => $user['user_mobile'] ?? '',
|
||||
],
|
||||
'roles' => HuifuOnboardAdminView::listRolesForUser($userId),
|
||||
]);
|
||||
}
|
||||
|
||||
public function searchBranch()
|
||||
{
|
||||
$keyword = trim((string) $this->request->get('keyword', ''));
|
||||
$areaId = trim((string) $this->request->get('area_id', ''));
|
||||
$this->success('ok', null, HuifuOnboardBankBranch::search($keyword, $areaId, 20));
|
||||
}
|
||||
|
||||
protected function persistDraft($row = null)
|
||||
{
|
||||
$userId = intval($this->request->post('user_id', 0));
|
||||
$roleType = trim((string) $this->request->post('role_type', ''));
|
||||
$roleRefId = intval($this->request->post('role_ref_id', 0));
|
||||
$form = $this->request->post('form/a', []);
|
||||
if ($row) {
|
||||
$userId = intval($row['user_id']);
|
||||
$roleType = $row['role_type'];
|
||||
$roleRefId = intval($row['role_ref_id']);
|
||||
}
|
||||
if (!$form || !is_array($form)) {
|
||||
$this->error('请填写进件资料');
|
||||
}
|
||||
try {
|
||||
$service = new HuifuOnboardAdminService();
|
||||
$saved = $service->saveDraft($userId, $roleType, $roleRefId, $form);
|
||||
$this->success('进件资料已保存,状态为待后台审核', null, [
|
||||
'id' => $saved ? $saved['id'] : 0,
|
||||
]);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
$this->error($e->getMessage());
|
||||
} catch (\Throwable $e) {
|
||||
$this->error(HuifuOnboardError::translate($e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
public function retry($ids = null)
|
||||
{
|
||||
$row = OnboardModel::get($ids);
|
||||
|
||||
在新工单中引用
屏蔽一个用户