generated from liutk/owl-admin-base
Update
parent
90dc552bc0
commit
9132391b3d
|
|
@ -50,44 +50,6 @@ class LedgerController extends AdminController
|
|||
return $this->response()->success($page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核
|
||||
*/
|
||||
public function approval($id, Request $request)
|
||||
{
|
||||
$validator = Validator::make(
|
||||
data: $request->all(),
|
||||
rules: [
|
||||
'approval_result' => ['bail', 'required', Rule::in([1, 2])],
|
||||
'failed_reason' => ['bail', 'required_if:approval_result,2'],
|
||||
],
|
||||
attributes: [
|
||||
'approval_result' => __('finance.ledger.approval_result'),
|
||||
'failed_reason' => __('finance.ledger.failed_reason'),
|
||||
],
|
||||
);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return $this->response()->fail($validator->errors()->first());
|
||||
}
|
||||
|
||||
$ledger = Ledger::findOrFail($id);
|
||||
|
||||
if ($ledger->ledger_status !== LedgerStatus::Processing) {
|
||||
return $this->response()->fail('上报数据不是待审核状态');
|
||||
}
|
||||
|
||||
if ($request->input('approval_result') == 1) {
|
||||
$ledger->ledger_status = LedgerStatus::Passed;
|
||||
} else {
|
||||
$ledger->ledger_status = LedgerStatus::Rejected;
|
||||
}
|
||||
|
||||
$ledger->save();
|
||||
|
||||
return $this->response()->success(null, '审核成功');
|
||||
}
|
||||
|
||||
public function updateLedgerAmount($id, Request $request)
|
||||
{
|
||||
$validator = Validator::make(
|
||||
|
|
@ -129,10 +91,6 @@ class LedgerController extends AdminController
|
|||
->valueField('id')
|
||||
->clearable()
|
||||
->columnRatio(3),
|
||||
amis()->SelectControl('status', __('finance.ledger.ledger_status'))
|
||||
->multiple()
|
||||
->options(LedgerStatus::options())
|
||||
->columnRatio(3),
|
||||
amis()->DateRangeControl('date_range', __('finance.ledger.date'))
|
||||
->valueFormat('YYYY-MM-DD'),
|
||||
]),
|
||||
|
|
@ -151,20 +109,13 @@ class LedgerController extends AdminController
|
|||
amis()->TableColumn()->name('actual_commission')->label(__('finance.ledger.actual_commission')),
|
||||
amis()->TableColumn()->name('expected_income')->label(__('finance.ledger.expected_income')),
|
||||
amis()->TableColumn()->name('actual_income')->label(__('finance.ledger.actual_income')),
|
||||
amis()->TableColumn()
|
||||
->name('ledger_status')
|
||||
->label(__('finance.ledger.ledger_status'))
|
||||
->type('mapping')
|
||||
->map(LedgerStatus::labelMap()),
|
||||
amis()->TableColumn()->name('created_at')->label(__('finance.ledger.created_at')),
|
||||
$this->rowActions([
|
||||
$this->rowApprovalButton()
|
||||
->visibleOn('${ledger_status == 2}'),
|
||||
$this->rowEditLedgerAmountButton()
|
||||
->visible(Admin::user()->can('admin.finance.ledgers.update_ledger_amount')),
|
||||
$this->rowEditButton(true)
|
||||
->visible(Admin::user()->can('admin.finance.ledgers.update'))
|
||||
->visibleOn('${ledger_status == 1 || ledger_status == 4}'),
|
||||
// $this->rowEditButton(true)
|
||||
// ->visible(Admin::user()->can('admin.finance.ledgers.update'))
|
||||
// ->visibleOn('${ledger_status == 1 || ledger_status == 4}'),
|
||||
$this->rowShowButton()
|
||||
->visible(Admin::user()->can('admin.finance.ledgers.view')),
|
||||
]),
|
||||
|
|
@ -214,33 +165,11 @@ class LedgerController extends AdminController
|
|||
'span' => 3
|
||||
],
|
||||
['label' => __('finance.ledger.photos'), 'content' => amis()->Images()->enlargeAble()->source('${photos}')->enlargeWithGallary(), 'span' => 3],
|
||||
['label' => __('finance.ledger.ledger_status'), 'content' => amis()->Mapping()->map(LedgerStatus::labelMap())->value('${ledger_status}'), 'span' => 3],
|
||||
// ['label' => __('finance.ledger.ledger_status'), 'content' => amis()->Mapping()->map(LedgerStatus::labelMap())->value('${ledger_status}'), 'span' => 3],
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
protected function rowApprovalButton()
|
||||
{
|
||||
return amis()->DialogAction()->icon('fa-regular fa-check-circle')->label(__('finance.ledger.approval'))->level('link')->dialog(
|
||||
amis()->Dialog()->title(__('finance.ledger.approval'))->body([
|
||||
amis()->Form()->title('')
|
||||
->api('post:'.admin_url('finance/ledgers/${id}/approval'))
|
||||
->body([
|
||||
amis()->RadiosControl('approval_result', __('finance.ledger.approval_result'))
|
||||
->options([
|
||||
['label' => '通过', 'value' => 1],
|
||||
['label' => '驳回', 'value' => 2],
|
||||
])
|
||||
->selectFirst()
|
||||
->required(),
|
||||
amis()->TextareaControl('failed_reason', __('finance.ledger.failed_reason'))
|
||||
->visibleOn('${approval_result == 2}')
|
||||
->required(),
|
||||
]),
|
||||
])->size('md')
|
||||
);
|
||||
}
|
||||
|
||||
protected function rowEditLedgerAmountButton()
|
||||
{
|
||||
return amis()->DialogAction()
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ use App\Admin\Controllers\AdminController;
|
|||
use App\Admin\Services\Finance\ReimbursementService;
|
||||
use App\Enums\ReimbursementStatus;
|
||||
use App\Models\Reimbursement;
|
||||
use App\Traits\HasCheckActions;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
|
@ -19,45 +20,10 @@ use Slowlyo\OwlAdmin\Renderers\Page;
|
|||
*/
|
||||
class ReimbursementController extends AdminController
|
||||
{
|
||||
use HasCheckActions;
|
||||
|
||||
protected string $serviceName = ReimbursementService::class;
|
||||
|
||||
/**
|
||||
* 审核
|
||||
*/
|
||||
public function approval($id, Request $request)
|
||||
{
|
||||
$validator = Validator::make(
|
||||
data: $request->all(),
|
||||
rules: [
|
||||
'approval_result' => ['bail', 'required', Rule::in([1, 2])],
|
||||
'failed_reason' => ['bail', 'required_if:approval_result,2'],
|
||||
],
|
||||
attributes: [
|
||||
'approval_result' => __('finance.reimbursement.approval_result'),
|
||||
'failed_reason' => __('finance.reimbursement.failed_reason'),
|
||||
],
|
||||
);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return $this->response()->fail($validator->errors()->first());
|
||||
}
|
||||
|
||||
/** @var \App\Models\Reimbursement */
|
||||
$reimbursement = Reimbursement::findOrFail($id);
|
||||
|
||||
if (! $reimbursement->isPending()) {
|
||||
return $this->response()->fail('收支报销不是待审核状态');
|
||||
}
|
||||
|
||||
$reimbursement->update([
|
||||
'reimbursement_status' => $request->input('approval_result') == 1
|
||||
? ReimbursementStatus::Passed
|
||||
: ReimbursementStatus::Rejected,
|
||||
]);
|
||||
|
||||
return $this->response()->success(null, '审核成功');
|
||||
}
|
||||
|
||||
public function list(): Page
|
||||
{
|
||||
$crud = $this->baseCRUD()
|
||||
|
|
@ -74,9 +40,9 @@ class ReimbursementController extends AdminController
|
|||
->source(admin_url('api/keywords/tree-list?parent_key=reimbursement_type'))
|
||||
->labelField('name')
|
||||
->valueField('key'),
|
||||
amis()->SelectControl('status', __('finance.reimbursement.status'))
|
||||
->multiple()
|
||||
->options(ReimbursementStatus::options()),
|
||||
// amis()->SelectControl('status', __('finance.reimbursement.status'))
|
||||
// ->multiple()
|
||||
// ->options(ReimbursementStatus::options()),
|
||||
]),
|
||||
amis()->GroupControl()->mode('horizontal')->body([
|
||||
amis()->InputDatetimeRange()
|
||||
|
|
@ -92,16 +58,14 @@ class ReimbursementController extends AdminController
|
|||
amis()->TableColumn()->name('expense')->label(__('finance.reimbursement.expense')),
|
||||
amis()->TableColumn()->name('reason')->label(__('finance.reimbursement.reason')),
|
||||
amis()->TableColumn()->name('type.name')->label(__('finance.reimbursement.type')),
|
||||
amis()->TableColumn()
|
||||
->name('reimbursement_status')
|
||||
->label(__('finance.reimbursement.status'))
|
||||
->type('mapping')
|
||||
->map(ReimbursementStatus::labelMap()),
|
||||
// amis()->TableColumn()
|
||||
// ->name('reimbursement_status')
|
||||
// ->label(__('finance.reimbursement.status'))
|
||||
// ->type('mapping')
|
||||
// ->map(ReimbursementStatus::labelMap()),
|
||||
amis()->TableColumn()->name('created_at')->label(__('finance.reimbursement.created_at')),
|
||||
$this->rowActions([
|
||||
$this->rowApprovalButton()
|
||||
->visibleOn('${reimbursement_status == '.ReimbursementStatus::Pending->value.'}'),
|
||||
$this->rowShowButton()->visible(Admin::user()->can('admin.finance.reimbursements.view')),
|
||||
$this->rowShowButton()->visible(Admin::user()->can('admin.finance.reimbursements.view')),
|
||||
]),
|
||||
]);
|
||||
|
||||
|
|
@ -116,35 +80,10 @@ class ReimbursementController extends AdminController
|
|||
['label' => __('finance.reimbursement.expense'), 'content' => '${expense}'],
|
||||
['label' => __('finance.reimbursement.reason'), 'content' => '${reason}'],
|
||||
['label' => __('finance.reimbursement.type'), 'content' => '${type.name}'],
|
||||
['label' => __('finance.reimbursement.status'), 'content' => amis()->Mapping()->map(ReimbursementStatus::labelMap())->value('${reimbursement_status}')],
|
||||
// ['label' => __('finance.reimbursement.status'), 'content' => amis()->Mapping()->map(ReimbursementStatus::labelMap())->value('${reimbursement_status}')],
|
||||
['label' => __('finance.reimbursement.created_at'), 'content' => '${created_at}'],
|
||||
['label' => __('finance.reimbursement.photos'), 'content' => amis()->Images()->enlargeAble()->source('${photos}')->enlargeWithGallary(), 'span' => 3],
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核操作按钮
|
||||
*/
|
||||
protected function rowApprovalButton(): DialogAction
|
||||
{
|
||||
return amis()->DialogAction()->icon('fa-regular fa-check-circle')->label(__('finance.reimbursement.approval'))->level('link')->dialog(
|
||||
amis()->Dialog()->title(__('finance.reimbursement.approval'))->body([
|
||||
amis()->Form()->title('')
|
||||
->api('post:'.admin_url('finance/reimbursements/${id}/approval'))
|
||||
->body([
|
||||
amis()->RadiosControl('approval_result', __('finance.reimbursement.approval_result'))
|
||||
->options([
|
||||
['label' => '通过', 'value' => 1],
|
||||
['label' => '驳回', 'value' => 2],
|
||||
])
|
||||
->selectFirst()
|
||||
->required(),
|
||||
amis()->TextareaControl('failed_reason', __('finance.reimbursement.failed_reason'))
|
||||
->visibleOn('${approval_result == 2}')
|
||||
->required(),
|
||||
]),
|
||||
])->size('md')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,44 +20,6 @@ class StoreMasterCommissionController extends AdminController
|
|||
{
|
||||
protected string $serviceName = StoreMasterCommissionService::class;
|
||||
|
||||
/**
|
||||
* 审核
|
||||
*/
|
||||
public function approval($id, Request $request)
|
||||
{
|
||||
$validator = Validator::make(
|
||||
data: $request->all(),
|
||||
rules: [
|
||||
'approval_result' => ['bail', 'required', Rule::in([1, 2])],
|
||||
'failed_reason' => ['bail', 'required_if:approval_result,2'],
|
||||
],
|
||||
attributes: [
|
||||
'approval_result' => __('finance.store_master_commission.approval_result'),
|
||||
'failed_reason' => __('finance.store_master_commission.failed_reason'),
|
||||
],
|
||||
);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return $this->response()->fail($validator->errors()->first());
|
||||
}
|
||||
|
||||
$masterCommission = StoreMasterCommission::findOrFail($id);
|
||||
|
||||
if ($masterCommission->approval_status !== StoreMasterCommissionApprovalStatus::Pending) {
|
||||
return $this->response()->fail('店长提成不是待审核状态');
|
||||
}
|
||||
|
||||
if ($request->input('approval_result') == 1) {
|
||||
$masterCommission->approval_status = StoreMasterCommissionApprovalStatus::Passed;
|
||||
} else {
|
||||
$masterCommission->approval_status = StoreMasterCommissionApprovalStatus::Rejected;
|
||||
}
|
||||
|
||||
$masterCommission->save();
|
||||
|
||||
return $this->response()->success(null, '操作成功');
|
||||
}
|
||||
|
||||
public function list(): Page
|
||||
{
|
||||
$crud = $this->baseCRUD()
|
||||
|
|
@ -80,10 +42,6 @@ class StoreMasterCommissionController extends AdminController
|
|||
->valueField('id')
|
||||
->clearable()
|
||||
->columnRatio(3),
|
||||
amis()->SelectControl('status', __('finance.store_master_commission.approval_status'))
|
||||
->multiple()
|
||||
->options(StoreMasterCommissionApprovalStatus::options())
|
||||
->columnRatio(3),
|
||||
]),
|
||||
]))
|
||||
->columns([
|
||||
|
|
@ -95,19 +53,12 @@ class StoreMasterCommissionController extends AdminController
|
|||
amis()->TableColumn()->name('daily_expenses')->label(__('finance.store_master_commission.daily_expenses')),
|
||||
amis()->TableColumn()->name('employee_expenses')->label(__('finance.store_master_commission.employee_expenses')),
|
||||
amis()->TableColumn()->name('other_expenses')->label(__('finance.store_master_commission.other_expenses')),
|
||||
amis()->TableColumn()
|
||||
->name('approval_status')
|
||||
->label(__('finance.store_master_commission.approval_status'))
|
||||
->type('mapping')
|
||||
->map(StoreMasterCommissionApprovalStatus::labelMap()),
|
||||
amis()->TableColumn()->name('created_at')->label(__('finance.store_master_commission.created_at')),
|
||||
$this->rowActions([
|
||||
$this->rowApprovalButton()
|
||||
->visibleOn('${approval_status == '.StoreMasterCommissionApprovalStatus::Pending->value.'}'),
|
||||
$this->rowEditTypeButton('drawer', 'lg')
|
||||
->visible(Admin::user()->can('admin.finance.store_master_commissions.update'))
|
||||
->visibleOn('${approval_status == '.StoreMasterCommissionApprovalStatus::Rejected->value.'}'),
|
||||
$this->rowDeleteButton()->visible(Admin::user()->can('admin.finance.store_master_commissions.delete')),
|
||||
->visible(Admin::user()->can('admin.finance.store_master_commissions.update')),
|
||||
$this->rowDeleteButton()
|
||||
->visible(Admin::user()->can('admin.finance.store_master_commissions.delete')),
|
||||
]),
|
||||
]);
|
||||
|
||||
|
|
@ -159,26 +110,4 @@ class StoreMasterCommissionController extends AdminController
|
|||
->required(),
|
||||
]);
|
||||
}
|
||||
|
||||
protected function rowApprovalButton()
|
||||
{
|
||||
return amis()->DialogAction()->icon('fa-regular fa-check-circle')->label(__('finance.store_master_commission.approval'))->level('link')->dialog(
|
||||
amis()->Dialog()->title(__('finance.store_master_commission.approval'))->body([
|
||||
amis()->Form()->title('')
|
||||
->api('post:'.admin_url('finance/store-master-commissions/${id}/approval'))
|
||||
->body([
|
||||
amis()->RadiosControl('approval_result', __('finance.store_master_commission.approval_result'))
|
||||
->options([
|
||||
['label' => '通过', 'value' => 1],
|
||||
['label' => '驳回', 'value' => 2],
|
||||
])
|
||||
->selectFirst()
|
||||
->required(),
|
||||
amis()->TextareaControl('failed_reason', __('finance.store_master_commission.failed_reason'))
|
||||
->visibleOn('${approval_result == 2}')
|
||||
->required(),
|
||||
]),
|
||||
])->size('md')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,6 @@ Route::group([
|
|||
$router->get('commission-incomes', [CommissionIncomeController::class, 'index'])->name('commission_incomes.index');
|
||||
// 收支报销
|
||||
$router->resource('reimbursements', ReimbursementController::class);
|
||||
$router->post('reimbursements/{reimbursement}/approval', [ReimbursementController::class, 'approval'])->name('reimbursements.approval');
|
||||
// 销售统计
|
||||
$router->get('sales-statistics', [SalesStatisticController::class, 'index'])->name('sales_statistics.index');
|
||||
// 门店统计
|
||||
|
|
|
|||
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum LedgerStatus: int
|
||||
{
|
||||
case Pending = 1;
|
||||
case Processing = 2;
|
||||
case Passed = 3;
|
||||
case Rejected = 4;
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Pending => '待编辑',
|
||||
self::Processing => '待审核',
|
||||
self::Passed => '已完成',
|
||||
self::Rejected => '未通过',
|
||||
};
|
||||
}
|
||||
|
||||
public static function options(): array
|
||||
{
|
||||
return collect(self::cases())
|
||||
->map(fn (LedgerStatus $case) => [
|
||||
'label' => $case->label(),
|
||||
'value' => $case->value,
|
||||
])
|
||||
->all();
|
||||
}
|
||||
|
||||
public static function labelMap(): array
|
||||
{
|
||||
return [
|
||||
self::Pending->value => '<span class="label label-primary">待编辑</span>',
|
||||
self::Processing->value => '<span class="label label-warning">待审核</span>',
|
||||
self::Passed->value => '<span class="label label-success">已完成</span>',
|
||||
self::Rejected->value => '<span class="label label-danger">未通过</span>',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum ReimbursementStatus: int
|
||||
{
|
||||
case Pending = 1;
|
||||
case Passed = 2;
|
||||
case Rejected = 3;
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Pending => '待审核',
|
||||
self::Passed => '已通过',
|
||||
self::Rejected => '未通过',
|
||||
};
|
||||
}
|
||||
|
||||
public static function options(): array
|
||||
{
|
||||
return collect(self::cases())
|
||||
->map(fn (ReimbursementStatus $case) => [
|
||||
'label' => $case->label(),
|
||||
'value' => $case->value,
|
||||
])
|
||||
->all();
|
||||
}
|
||||
|
||||
public static function labelMap(): array
|
||||
{
|
||||
return [
|
||||
self::Pending->value => '<span class="label label-primary">'.self::Pending->label().'</span>',
|
||||
self::Passed->value => '<span class="label label-success">'.self::Passed->label().'</span>',
|
||||
self::Rejected->value => '<span class="label label-danger">'.self::Rejected->label().'</span>',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum StoreMasterCommissionApprovalStatus: int
|
||||
{
|
||||
case Pending = 1;
|
||||
case Passed = 2;
|
||||
case Rejected = 3;
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Pending => '待审核',
|
||||
self::Passed => '已通过',
|
||||
self::Rejected => '未通过',
|
||||
};
|
||||
}
|
||||
|
||||
public static function options(): array
|
||||
{
|
||||
return collect(self::cases())
|
||||
->map(fn (StoreMasterCommissionApprovalStatus $case) => [
|
||||
'label' => $case->label(),
|
||||
'value' => $case->value,
|
||||
])
|
||||
->all();
|
||||
}
|
||||
|
||||
public static function labelMap(): array
|
||||
{
|
||||
return [
|
||||
self::Pending->value => '<span class="label label-primary">'.self::Pending->label().'</span>',
|
||||
self::Passed->value => '<span class="label label-success">'.self::Passed->label().'</span>',
|
||||
self::Rejected->value => '<span class="label label-danger">'.self::Rejected->label().'</span>',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Contracts\Checkable;
|
||||
use App\Enums\CheckStatus;
|
||||
use App\Enums\ReimbursementStatus;
|
||||
use App\Traits\HasCheckable;
|
||||
use App\Traits\HasDateTimeFormatter;
|
||||
use EloquentFilter\Filterable;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
|
|
@ -10,16 +13,12 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Reimbursement extends Model
|
||||
class Reimbursement extends Model implements Checkable
|
||||
{
|
||||
use Filterable, HasDateTimeFormatter, HasFactory;
|
||||
|
||||
protected $attributes = [
|
||||
'reimbursement_status' => ReimbursementStatus::Pending,
|
||||
];
|
||||
use Filterable, HasDateTimeFormatter, HasFactory, HasCheckable;
|
||||
|
||||
protected $casts = [
|
||||
'reimbursement_status' => ReimbursementStatus::class,
|
||||
'check_status' => CheckStatus::class
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
|
|
|
|||
|
|
@ -13,14 +13,6 @@ class StoreMasterCommission extends Model
|
|||
{
|
||||
use Filterable, HasDateTimeFormatter, HasFactory;
|
||||
|
||||
protected $attributes = [
|
||||
'approval_status' => StoreMasterCommissionApprovalStatus::Pending,
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'approval_status' => StoreMasterCommissionApprovalStatus::class,
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'month',
|
||||
'store_id',
|
||||
|
|
@ -29,7 +21,6 @@ class StoreMasterCommission extends Model
|
|||
'daily_expenses',
|
||||
'employee_expenses',
|
||||
'other_expenses',
|
||||
'approval_status',
|
||||
];
|
||||
|
||||
public function store()
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class AppServiceProvider extends ServiceProvider
|
|||
\App\Models\HolidayApply::class,
|
||||
\App\Models\OvertimeApply::class,
|
||||
\App\Models\OfficalBusiness::class,
|
||||
\App\Models\Reimbursement::class,
|
||||
])->mapWithKeys(fn ($model) => [(new $model)->getTable() => $model])->all()
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ trait HasCheckable
|
|||
|
||||
/**
|
||||
* 审核通过
|
||||
*
|
||||
*
|
||||
* @param array $options {remarks: 不通过原因, time: 审核时间(默认当前时间)}
|
||||
*/
|
||||
public function checkSuccess(array $options = [])
|
||||
|
|
@ -33,7 +33,7 @@ trait HasCheckable
|
|||
|
||||
/**
|
||||
* 审核未通过
|
||||
*
|
||||
*
|
||||
* @param array $options {remarks: 不通过原因, time: 审核时间(默认当前时间)}
|
||||
*/
|
||||
public function checkFail(array $options = [])
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ return new class extends Migration
|
|||
$table->decimal('expected_income', 10, 2)->comment('预期收益=预计佣金-支出');
|
||||
$table->decimal('actual_income', 10, 2)->nullable()->comment('实际收益');
|
||||
$table->text('photos')->nullable()->comment('照片');
|
||||
$table->tinyInteger('ledger_status')->default(1)->comment('状态: 1 待编辑, 2 待审核, 3 已通过, 4 未通过');
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['store_id', 'date']);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ return new class extends Migration
|
|||
$table->decimal('daily_expenses', 10, 2)->comment('日常支出');
|
||||
$table->decimal('employee_expenses', 10, 2)->comment('员工支出');
|
||||
$table->decimal('other_expenses', 10, 2)->comment('其他支出');
|
||||
$table->tinyInteger('approval_status')->default(1)->comment('状态: 1 待审核, 2 已通过, 3 已拒绝');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ return new class extends Migration
|
|||
$table->decimal('expense', 10, 2)->comment('报销费用');
|
||||
$table->string('reason')->nullable()->comment('报销原因');
|
||||
$table->text('photos')->nullable()->comment('照片');
|
||||
$table->tinyInteger('reimbursement_status')->default(1)->comment('状态: 1 待审核, 2 已通过, 3 已拒绝');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('reimbursement_type_id');
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ class WorkflowSeeder extends Seeder
|
|||
['key' => 'holiday_apply', 'name' => '请假申请', 'config' => $config, 'created_at' => now(), 'updated_at' => now()],
|
||||
['key' => 'overtime_apply', 'name' => '加班申请', 'config' => $config, 'created_at' => now(), 'updated_at' => now()],
|
||||
['key' => 'offical_business', 'name' => '出差报备', 'config' => $config, 'created_at' => now(), 'updated_at' => now()],
|
||||
['key' => 'reimbursement', 'name' => '收支报销', 'config' => $config, 'created_at' => now(), 'updated_at' => now()],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue