generated from liutk/owl-admin-base
Update
parent
e63c72d96e
commit
b9a4a46c45
|
|
@ -98,16 +98,14 @@ class LedgerController extends AdminController
|
||||||
->url(admin_url('api/workflow/apply'))
|
->url(admin_url('api/workflow/apply'))
|
||||||
->method('post')
|
->method('post')
|
||||||
->data(['id' => '${workflow.id}'])
|
->data(['id' => '${workflow.id}'])
|
||||||
),
|
)
|
||||||
|
->visibleOn('${actual_commission != null && actual_income != null}'),
|
||||||
$this->cancelAction(),
|
$this->cancelAction(),
|
||||||
$this->rowEditLedgerAmountButton()
|
$this->rowEditLedgerAmountButton()
|
||||||
->visible(Admin::user()->can('admin.finance.ledgers.update_ledger_amount')),
|
->visible(Admin::user()->can('admin.finance.ledgers.update_ledger_amount')),
|
||||||
$this->rowEditActualCommissionButton()
|
$this->rowEditTypeButton('drawer', 'lg')
|
||||||
->visible(Admin::user()->can('admin.finance.ledgers.update_actual_commission'))
|
->visible(Admin::user()->can('admin.finance.ledgers.update'))
|
||||||
->visibleOn('${OR(workflow.check_status == '.CheckStatus::None->value.', workflow.check_status == '.CheckStatus::Cancel->value.', workflow.check_status == '.CheckStatus::Fail->value.')}'),
|
->visibleOn('${ARRAYINCLUDES(['.CheckStatus::None->value.','.CheckStatus::Cancel->value.','.CheckStatus::Fail->value.'], workflow.check_status)}'),
|
||||||
$this->rowEditActualIncomeButton()
|
|
||||||
->visible(Admin::user()->can('admin.finance.ledgers.update_actual_income'))
|
|
||||||
->visibleOn('${OR(workflow.check_status == '.CheckStatus::None->value.', workflow.check_status == '.CheckStatus::Cancel->value.', workflow.check_status == '.CheckStatus::Fail->value.')}'),
|
|
||||||
$this->rowShowButton()
|
$this->rowShowButton()
|
||||||
->visible(Admin::user()->can('admin.finance.ledgers.view')),
|
->visible(Admin::user()->can('admin.finance.ledgers.view')),
|
||||||
]),
|
]),
|
||||||
|
|
@ -197,26 +195,6 @@ class LedgerController extends AdminController
|
||||||
return $this->response()->success(null, '保存成功');
|
return $this->response()->success(null, '保存成功');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改实际佣金
|
|
||||||
*/
|
|
||||||
public function updateActualCommission($id, Request $request)
|
|
||||||
{
|
|
||||||
$this->service->update($id, $request->only(['actual_commission']));
|
|
||||||
|
|
||||||
return $this->response()->success(null, '保存成功');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改实际收益
|
|
||||||
*/
|
|
||||||
public function updateActualIncome($id, Request $request)
|
|
||||||
{
|
|
||||||
$this->service->update($id, $request->only(['actual_income']));
|
|
||||||
|
|
||||||
return $this->response()->success(null, '保存成功');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑总账金额按钮
|
* 编辑总账金额按钮
|
||||||
*/
|
*/
|
||||||
|
|
@ -241,54 +219,4 @@ class LedgerController extends AdminController
|
||||||
])->size('lg')
|
])->size('lg')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑实际佣金按钮
|
|
||||||
*/
|
|
||||||
protected function rowEditActualCommissionButton(): DrawerAction
|
|
||||||
{
|
|
||||||
return amis()->DrawerAction()
|
|
||||||
->icon('fa-regular fa-pen-to-square')
|
|
||||||
->label(__('finance.ledger.actual_commission'))
|
|
||||||
->level('link')
|
|
||||||
->drawer(
|
|
||||||
amis()->Drawer()->title(__('finance.ledger.actual_commission'))->body([
|
|
||||||
amis()->Form()->title('')
|
|
||||||
->api('post:'.admin_url('finance/ledgers/${id}/actual-commission'))
|
|
||||||
->body([
|
|
||||||
amis()->NumberControl()
|
|
||||||
->name('actual_commission')
|
|
||||||
->label(__('finance.ledger.actual_commission'))
|
|
||||||
->precision(2)
|
|
||||||
->showSteps(false)
|
|
||||||
->required(),
|
|
||||||
]),
|
|
||||||
])->size('lg')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑实际收益按钮
|
|
||||||
*/
|
|
||||||
protected function rowEditActualIncomeButton(): DrawerAction
|
|
||||||
{
|
|
||||||
return amis()->DrawerAction()
|
|
||||||
->icon('fa-regular fa-pen-to-square')
|
|
||||||
->label(__('finance.ledger.actual_income'))
|
|
||||||
->level('link')
|
|
||||||
->drawer(
|
|
||||||
amis()->Drawer()->title(__('finance.ledger.actual_income'))->body([
|
|
||||||
amis()->Form()->title('')
|
|
||||||
->api('post:'.admin_url('finance/ledgers/${id}/actual-income'))
|
|
||||||
->body([
|
|
||||||
amis()->NumberControl()
|
|
||||||
->name('actual_income')
|
|
||||||
->label(__('finance.ledger.actual_income'))
|
|
||||||
->precision(2)
|
|
||||||
->showSteps(false)
|
|
||||||
->required(),
|
|
||||||
]),
|
|
||||||
])->size('lg')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -128,8 +128,6 @@ Route::group([
|
||||||
// 上报数据
|
// 上报数据
|
||||||
$router->resource('ledgers', LedgerController::class);
|
$router->resource('ledgers', LedgerController::class);
|
||||||
$router->post('ledgers/{ledger}/ledger-amount', [LedgerController::class, 'updateLedgerAmount'])->name('ledgers.update_ledger_amount');
|
$router->post('ledgers/{ledger}/ledger-amount', [LedgerController::class, 'updateLedgerAmount'])->name('ledgers.update_ledger_amount');
|
||||||
$router->post('ledgers/{ledger}/actual-commission', [LedgerController::class, 'updateActualCommission'])->name('ledgers.update_actual_commission');
|
|
||||||
$router->post('ledgers/{ledger}/actual-income', [LedgerController::class, 'updateActualIncome'])->name('ledgers.update_actual_income');
|
|
||||||
// 佣金收入
|
// 佣金收入
|
||||||
$router->get('commission-incomes', [CommissionIncomeController::class, 'index'])->name('commission_incomes.index');
|
$router->get('commission-incomes', [CommissionIncomeController::class, 'index'])->name('commission_incomes.index');
|
||||||
// 收支报销
|
// 收支报销
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue