generated from liutk/owl-admin-base
Merge branch 'main' of https://gitea.hmily.club/pdkj/store-manage into main
commit
2a9af8a8b0
|
|
@ -16,6 +16,24 @@ use App\Traits\CustomActionTrait;
|
|||
abstract class AdminController extends Controller
|
||||
{
|
||||
use CustomActionTrait;
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
try {
|
||||
if ($this->actionOfQuickEdit()) {
|
||||
$result = $this->service->quickEdit($request->all());
|
||||
} else {
|
||||
$result = $this->service->store($request->all());
|
||||
}
|
||||
} catch (Throwable $th) {
|
||||
return $this->renderExceptionResponse(
|
||||
tap($th, fn () => report($th))
|
||||
);
|
||||
}
|
||||
|
||||
return $this->autoResponse($result, __('admin.save'));
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
{
|
||||
$input = $request->all();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,88 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers\Finance;
|
||||
|
||||
use App\Admin\Controllers\AdminController;
|
||||
use App\Admin\Filters\LedgerFilter;
|
||||
use App\Admin\Filters\LedgerItemFilter;
|
||||
use App\Models\Keyword;
|
||||
use App\Models\Ledger;
|
||||
use App\Models\LedgerItem;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
/**
|
||||
* @property mixed $name
|
||||
*/
|
||||
class CommissionIncomeController extends AdminController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
if ($this->actionOfGetData()) {
|
||||
return $this->response()->success([
|
||||
'items' => [$this->getCommissionIncomeStatistics(request())],
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->response()->success(
|
||||
$this->baseList(
|
||||
$this->baseCRUD()
|
||||
->headerToolbar([
|
||||
amis('filter-toggler')->align('right'),
|
||||
])
|
||||
->footerToolbar([])
|
||||
->bulkActions([])
|
||||
->filter($this->baseFilter()->body([
|
||||
amis()->GroupControl()->mode('horizontal')->body([
|
||||
amis()->DateRangeControl('date_range', '日期')
|
||||
->valueFormat('YYYY-MM-DD')
|
||||
->columnRatio(6),
|
||||
amis()->InputCityControl('region', '区域')
|
||||
->allowDistrict(false)
|
||||
->extractValue(false),
|
||||
amis()->SelectControl('store_id', __('finance.ledger.store'))
|
||||
->source(admin_url('api/stores?region=${region}'))
|
||||
->labelField('title')
|
||||
->valueField('id')
|
||||
->clearable(),
|
||||
]),
|
||||
]))
|
||||
->columns([
|
||||
amis()->TableColumn('expected_commission', '预期佣金'),
|
||||
amis()->TableColumn('actual_commission', '实际佣金'),
|
||||
amis()->TableColumn('diff_commission', '佣金差异'),
|
||||
amis()->TableColumn('expected_income', '预期收益'),
|
||||
amis()->TableColumn('actual_income', '实际收益'),
|
||||
amis()->TableColumn('diff_income', '收益差异'),
|
||||
])
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
protected function getCommissionIncomeStatistics(Request $request): array
|
||||
{
|
||||
$aggregate = Ledger::select([
|
||||
DB::raw('SUM(expenditure) as expenditure'),
|
||||
DB::raw('SUM(expected_commission) as expected_commission'),
|
||||
DB::raw('SUM(actual_commission) as actual_commission'),
|
||||
DB::raw('SUM(expected_income) as expected_income'),
|
||||
DB::raw('SUM(actual_income) as actual_income'),
|
||||
])
|
||||
->filter($request->input(), LedgerFilter::class)
|
||||
->first();
|
||||
|
||||
$expectedCommission = $aggregate->expected_commission ?? '0';
|
||||
$actualCommission = $aggregate->actual_commission ?? '0';
|
||||
$expectedIncome = $aggregate->expected_income ?? '0';
|
||||
$actualIncome = $aggregate->actual_income ?? '0';
|
||||
|
||||
return [
|
||||
'expected_commission' => trim_zeros($expectedCommission),
|
||||
'actual_commission' => trim_zeros($actualCommission),
|
||||
'diff_commission' => trim_zeros(bcsub($actualCommission, $expectedCommission, 2)),
|
||||
'expected_income' => trim_zeros($expectedIncome),
|
||||
'actual_income' => trim_zeros($actualIncome),
|
||||
'diff_income' => trim_zeros(bcsub($actualIncome, $expectedIncome, 2)),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -36,7 +36,6 @@ class SalesStatisticController extends AdminController
|
|||
->valueFormat('YYYY-MM-DD')
|
||||
->columnRatio(6),
|
||||
amis()->InputCityControl('region', '区域')
|
||||
->inputClassName('w-40')
|
||||
->allowDistrict(false)
|
||||
->extractValue(false),
|
||||
amis()->SelectControl('store_id', __('finance.ledger.store'))
|
||||
|
|
|
|||
|
|
@ -0,0 +1,184 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers\Finance;
|
||||
|
||||
use App\Admin\Controllers\AdminController;
|
||||
use App\Admin\Services\Finance\StoreMasterCommissionService;
|
||||
use App\Enums\StoreMasterCommissionApprovalStatus;
|
||||
use App\Models\StoreMasterCommission;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Slowlyo\OwlAdmin\Admin;
|
||||
use Slowlyo\OwlAdmin\Renderers\Form;
|
||||
use Slowlyo\OwlAdmin\Renderers\Page;
|
||||
|
||||
/**
|
||||
* @property StoreMasterCommissionService $service
|
||||
*/
|
||||
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()
|
||||
->headerToolbar([
|
||||
$this->createTypeButton('drawer', 'lg')
|
||||
->visible(Admin::user()->can('admin.finance.store_master_commissions.create')),
|
||||
...$this->baseHeaderToolBar(),
|
||||
])
|
||||
->bulkActions([])
|
||||
->filter($this->baseFilter()->body([
|
||||
amis()->GroupControl()->mode('horizontal')->body([
|
||||
amis()->MonthControl()
|
||||
->name('month')
|
||||
->label(__('finance.store_master_commission.month'))
|
||||
->valueFormat('YYYY-MM')
|
||||
->columnRatio(3),
|
||||
amis()->SelectControl('store_id', __('finance.ledger.store'))
|
||||
->source(admin_url('api/stores'))
|
||||
->labelField('title')
|
||||
->valueField('id')
|
||||
->clearable()
|
||||
->columnRatio(3),
|
||||
amis()->SelectControl('status', __('finance.store_master_commission.approval_status'))
|
||||
->multiple()
|
||||
->options(StoreMasterCommissionApprovalStatus::options())
|
||||
->columnRatio(3),
|
||||
]),
|
||||
]))
|
||||
->columns([
|
||||
amis()->TableColumn()->name('id')->label(__('finance.store_master_commission.id')),
|
||||
amis()->TableColumn()->name('month')->label(__('finance.store_master_commission.month')),
|
||||
amis()->TableColumn()->name('store.title')->label(__('finance.store_master_commission.store')),
|
||||
amis()->TableColumn()->name('master.name')->label(__('finance.store_master_commission.store_master')),
|
||||
amis()->TableColumn()->name('commission')->label(__('finance.store_master_commission.commission')),
|
||||
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')),
|
||||
]),
|
||||
]);
|
||||
|
||||
return $this->baseList($crud);
|
||||
}
|
||||
|
||||
public function form(): Form
|
||||
{
|
||||
return $this->baseForm()->title('')->body([
|
||||
amis()->MonthControl()
|
||||
->name('month')
|
||||
->label(__('finance.store_master_commission.month'))
|
||||
->required()
|
||||
->valueFormat('YYYY-MM'),
|
||||
|
||||
amis()->SelectControl('store_id', __('finance.store_master_commission.store'))
|
||||
->source(admin_url('api/stores'))
|
||||
->labelField('title')
|
||||
->valueField('id')
|
||||
->required()
|
||||
->clearable(),
|
||||
|
||||
amis()->NumberControl()
|
||||
->name('commission')
|
||||
->label(__('finance.store_master_commission.commission'))
|
||||
->precision(2)
|
||||
->showSteps(false)
|
||||
->required(),
|
||||
|
||||
amis()->NumberControl()
|
||||
->name('daily_expenses')
|
||||
->label(__('finance.store_master_commission.daily_expenses'))
|
||||
->precision(2)
|
||||
->showSteps(false)
|
||||
->required(),
|
||||
|
||||
amis()->NumberControl()
|
||||
->name('employee_expenses')
|
||||
->label(__('finance.store_master_commission.employee_expenses'))
|
||||
->precision(2)
|
||||
->showSteps(false)
|
||||
->required(),
|
||||
|
||||
amis()->NumberControl()
|
||||
->name('other_expenses')
|
||||
->label(__('finance.store_master_commission.other_expenses'))
|
||||
->precision(2)
|
||||
->showSteps(false)
|
||||
->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')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -24,11 +24,12 @@ class LedgerFilter extends ModelFilter
|
|||
|
||||
public function region($region)
|
||||
{
|
||||
if (! is_array($region)) {
|
||||
if (array_key_exists('store_id', $this->input) || ! is_array($region)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$provinceCode = Arr::get($region, 'provinceCode');
|
||||
|
||||
$cityCode = Arr::get($region, 'cityCode');
|
||||
|
||||
if (empty($provinceCode) && empty($cityCode)) {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class LedgerItemFilter extends ModelFilter
|
|||
|
||||
public function region($region)
|
||||
{
|
||||
if ($this->input('store_id') !== null || ! is_array($region)) {
|
||||
if (array_key_exists('store_id', $this->input) || ! is_array($region)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Filters;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class StoreMasterCommissionFilter extends ModelFilter
|
||||
{
|
||||
public function month($month)
|
||||
{
|
||||
$this->where('month', $month);
|
||||
}
|
||||
|
||||
public function store($id)
|
||||
{
|
||||
$this->where('store_id', $id);
|
||||
}
|
||||
|
||||
public function status($status)
|
||||
{
|
||||
$this->whereIn('approval_status', explode(',', $status));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Services\Finance;
|
||||
|
||||
use App\Admin\Filters\StoreMasterCommissionFilter;
|
||||
use App\Admin\Services\BaseService;
|
||||
use App\Enums\StoreMasterCommissionApprovalStatus;
|
||||
use App\Models\Store;
|
||||
use App\Models\StoreMasterCommission;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class StoreMasterCommissionService extends BaseService
|
||||
{
|
||||
protected array $withRelationships = ['store', 'master'];
|
||||
|
||||
protected string $modelName = StoreMasterCommission::class;
|
||||
|
||||
protected string $modelFilterName = StoreMasterCommissionFilter::class;
|
||||
|
||||
public function store($data): bool
|
||||
{
|
||||
$validated = Validator::validate($data, [
|
||||
'month' => ['bail', 'required', 'date_format:Y-m'],
|
||||
'store_id' => ['bail', 'required', 'int'],
|
||||
'commission' => ['bail', 'required', 'numeric'],
|
||||
'daily_expenses' => ['bail', 'required', 'numeric'],
|
||||
'employee_expenses' => ['bail', 'required', 'numeric'],
|
||||
'other_expenses' => ['bail', 'required', 'numeric'],
|
||||
], [], [
|
||||
'month' => __('finance.store_master_commission.month'),
|
||||
'store_id' => __('finance.store_master_commission.store'),
|
||||
'commission' => __('finance.store_master_commission.commission'),
|
||||
'daily_expenses' => __('finance.store_master_commission.daily_expenses'),
|
||||
'employee_expenses' => __('finance.store_master_commission.employee_expenses'),
|
||||
'other_expenses' => __('finance.store_master_commission.other_expenses'),
|
||||
]);
|
||||
|
||||
$store = Store::findOrFail($validated['store_id']);
|
||||
|
||||
$this->modelName::create(
|
||||
array_merge($validated, ['store_master_id' => $store->master_id])
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function update($primaryKey, $data): bool
|
||||
{
|
||||
$validated = Validator::validate($data, [
|
||||
'month' => ['bail', 'required', 'date_format:Y-m'],
|
||||
'store_id' => ['bail', 'required', 'int'],
|
||||
'commission' => ['bail', 'required', 'numeric'],
|
||||
'daily_expenses' => ['bail', 'required', 'numeric'],
|
||||
'employee_expenses' => ['bail', 'required', 'numeric'],
|
||||
'other_expenses' => ['bail', 'required', 'numeric'],
|
||||
], [], [
|
||||
'month' => __('finance.store_master_commission.month'),
|
||||
'store_id' => __('finance.store_master_commission.store'),
|
||||
'commission' => __('finance.store_master_commission.commission'),
|
||||
'daily_expenses' => __('finance.store_master_commission.daily_expenses'),
|
||||
'employee_expenses' => __('finance.store_master_commission.employee_expenses'),
|
||||
'other_expenses' => __('finance.store_master_commission.other_expenses'),
|
||||
]);
|
||||
|
||||
$model = $this->query()->whereKey($primaryKey)->firstOrFail();
|
||||
|
||||
if ($model->approval_status !== StoreMasterCommissionApprovalStatus::Rejected) {
|
||||
abort(400, '只能编辑状态是“未通过”的店长提成');
|
||||
}
|
||||
|
||||
$attributes = array_merge(
|
||||
$validated, ['approval_status' => StoreMasterCommissionApprovalStatus::Pending]
|
||||
);
|
||||
|
||||
return $model->update($attributes);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,10 @@
|
|||
<?php
|
||||
|
||||
use App\Admin\Controllers\BaseKeywordController;
|
||||
use App\Admin\Controllers\Finance\CommissionIncomeController;
|
||||
use App\Admin\Controllers\Finance\LedgerController;
|
||||
use App\Admin\Controllers\Finance\SalesStatisticController;
|
||||
use App\Admin\Controllers\Finance\StoreMasterCommissionController;
|
||||
use App\Admin\Controllers\Finance\StoreStatisticController;
|
||||
use App\Admin\Controllers\Hr\EmployeeController;
|
||||
use App\Admin\Controllers\Hr\RestController;
|
||||
|
|
@ -93,10 +95,15 @@ Route::group([
|
|||
// 上报数据
|
||||
$router->resource('ledgers', LedgerController::class);
|
||||
$router->post('ledgers/{ledger}/approval', [LedgerController::class, 'approval'])->name('ledgers.approval');
|
||||
// 佣金收入
|
||||
$router->get('commission-incomes', [CommissionIncomeController::class, 'index'])->name('commission_incomes.index');
|
||||
// 销售统计
|
||||
$router->get('sales-statistics', [SalesStatisticController::class, 'index'])->name('sales_statistics.index');
|
||||
// 门店统计
|
||||
$router->get('store-statistics', [StoreStatisticController::class, 'index'])->name('store_statistics.index');
|
||||
// 店长提成
|
||||
$router->resource('store-master-commissions', StoreMasterCommissionController::class);
|
||||
$router->post('store-master-commissions/{store_master_commission}/approval', [StoreMasterCommissionController::class, 'approval'])->name('store_statistics.approval');
|
||||
});
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
<?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>',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\StoreMasterCommissionApprovalStatus;
|
||||
use App\Traits\HasDateTimeFormatter;
|
||||
use EloquentFilter\Filterable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
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',
|
||||
'store_master_id',
|
||||
'commission',
|
||||
'daily_expenses',
|
||||
'employee_expenses',
|
||||
'other_expenses',
|
||||
'approval_status',
|
||||
];
|
||||
|
||||
public function store()
|
||||
{
|
||||
return $this->belongsTo(Store::class, 'store_id');
|
||||
}
|
||||
|
||||
public function master(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Employee::class, 'store_master_id');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('store_master_commissions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('month')->comment('月份: 2024-03');
|
||||
$table->foreignId('store_id')->comment('门店ID');
|
||||
$table->foreignId('store_master_id')->comment('店长ID');
|
||||
$table->decimal('commission', 10, 2)->comment('佣金');
|
||||
$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();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('store_master_commissions');
|
||||
}
|
||||
};
|
||||
|
|
@ -148,6 +148,15 @@ class AdminPermissionSeeder extends Seeder
|
|||
'resource' => ['list', 'update', 'view'],
|
||||
'children' => [],
|
||||
],
|
||||
'commission_incomes' => [
|
||||
'name' => '佣金收入',
|
||||
'icon' => 'ri:money-cny-circle-line',
|
||||
'uri' => '/finance/commission-incomes',
|
||||
'resource' => false,
|
||||
'children' => [
|
||||
'index' => '佣金收入',
|
||||
],
|
||||
],
|
||||
'sales_statistics' => [
|
||||
'name' => '销售统计',
|
||||
'icon' => 'ri:bar-chart-2-line',
|
||||
|
|
@ -166,6 +175,13 @@ class AdminPermissionSeeder extends Seeder
|
|||
'index' => '门店统计',
|
||||
],
|
||||
],
|
||||
'store_master_commissions' => [
|
||||
'name' => '店长提成',
|
||||
'icon' => 'icon-park-outline:paper-money',
|
||||
'uri' => '/finance/store-master-commissions',
|
||||
'resource' => ['list', 'create', 'update', 'delete'],
|
||||
'children' => [],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -19,4 +19,21 @@ return [
|
|||
'approval_result' => '审核结果',
|
||||
'failed_reason' => '驳回原因',
|
||||
],
|
||||
|
||||
'store_master_commission' => [
|
||||
'id' => 'ID',
|
||||
'month' => '月份',
|
||||
'store' => '门店',
|
||||
'store_master' => '店长',
|
||||
'commission' => '佣金',
|
||||
'daily_expenses' => '日常支出',
|
||||
'employee_expenses' => '员工支出',
|
||||
'other_expenses' => '其他支出',
|
||||
'approval' => '审核',
|
||||
'approval_status' => '状态',
|
||||
'approval_result' => '审核结果',
|
||||
'failed_reason' => '驳回原因',
|
||||
'created_at' => '创建时间',
|
||||
'updated_at' => '更新时间',
|
||||
],
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue