generated from liutk/owl-admin-base
门店佣金比例
parent
bc27f3fa45
commit
302b6dd702
|
|
@ -30,42 +30,43 @@ class StoreController extends AdminController
|
|||
->bulkActions([])
|
||||
->filter($this->baseFilter()->body([
|
||||
amis()->GroupControl()->mode('horizontal')->body([
|
||||
amisMake()->TextControl()->name('title')->label(__('store.title'))->columnRatio(3)->clearable(),
|
||||
amisMake()->TreeSelectControl()->name('category_id')->label(__('store.category_id'))->columnRatio(3)
|
||||
amis()->TextControl()->name('title')->label(__('store.title'))->columnRatio(3)->clearable(),
|
||||
amis()->TreeSelectControl()->name('category_id')->label(__('store.category_id'))->columnRatio(3)
|
||||
->source(admin_url('api/keywords/tree-list?parent_key=store_category'))
|
||||
->labelField('name')
|
||||
->valueField('key')
|
||||
->onlyLeaf(true)
|
||||
->clearable(),
|
||||
amisMake()->SelectControl()->name('business_id')->label(__('store.business_id'))->columnRatio(3)
|
||||
amis()->SelectControl()->name('business_id')->label(__('store.business_id'))->columnRatio(3)
|
||||
->source(admin_url('api/keywords/tree-list?parent_key=store_business'))
|
||||
->labelField('name')
|
||||
->valueField('key')
|
||||
->clearable(),
|
||||
]),
|
||||
amisMake()->GroupControl()->mode('horizontal')->body([
|
||||
amisMake()->SelectControl()->name('level_id')->label(__('store.level_id'))->columnRatio(3)
|
||||
amis()->GroupControl()->mode('horizontal')->body([
|
||||
amis()->SelectControl()->name('level_id')->label(__('store.level_id'))->columnRatio(3)
|
||||
->source(admin_url('api/keywords/tree-list?parent_key=store_level'))
|
||||
->labelField('name')
|
||||
->valueField('key')
|
||||
->clearable(),
|
||||
// amisMake()->InputCityControl()->name('region')->label(__('store.region'))->columnRatio(3)
|
||||
// amis()->InputCityControl()->name('region')->label(__('store.region'))->columnRatio(3)
|
||||
// ->allowDistrict(false)
|
||||
// ->extractValue(false)
|
||||
// ->clearable(),
|
||||
amisMake()->SelectControl()->name('business_status')->label(__('store.business_status'))->options(BusinessStatus::options())->columnRatio(3)->clearable(),
|
||||
amis()->SelectControl()->name('business_status')->label(__('store.business_status'))->options(BusinessStatus::options())->columnRatio(3)->clearable(),
|
||||
]),
|
||||
]))
|
||||
->columns([
|
||||
amisMake()->TableColumn()->name('id')->label(__('store.id')),
|
||||
amisMake()->TableColumn()->name('title')->label(__('store.title')),
|
||||
amisMake()->TableColumn()->name('master.name')->label(__('store.master_id')),
|
||||
amisMake()->TableColumn()->name('category.name')->label(__('store.category_id')),
|
||||
amisMake()->TableColumn()->name('business.name')->label(__('store.business_id')),
|
||||
amisMake()->TableColumn()->name('level.name')->label(__('store.level_id')),
|
||||
amisMake()->TableColumn()->name('region')->label(__('store.region'))->set('type', 'tpl')->set('tpl', '${region.province}-${region.city}'),
|
||||
amisMake()->TableColumn()->name('business_status')->label(__('store.business_status'))->type('switch')->trueValue(BusinessStatus::Open)->falseValue(BusinessStatus::Close),
|
||||
amisMake()->TableColumn()->name('created_at')->label(__('store.created_at')),
|
||||
amis()->TableColumn()->name('id')->label(__('store.id')),
|
||||
amis()->TableColumn()->name('title')->label(__('store.title')),
|
||||
amis()->TableColumn()->name('master.name')->label(__('store.master_id')),
|
||||
amis()->TableColumn()->name('category.name')->label(__('store.category_id')),
|
||||
amis()->TableColumn()->name('business.name')->label(__('store.business_id')),
|
||||
amis()->TableColumn()->name('level.name')->label(__('store.level_id')),
|
||||
amis()->TableColumn()->name('profit_ratio')->label(__('store.profit_ratio'))->type('tpl')->set('tpl', '${profit_ratio}%'),
|
||||
amis()->TableColumn()->name('region')->label(__('store.region'))->set('type', 'tpl')->set('tpl', '${region.province}-${region.city}'),
|
||||
amis()->TableColumn()->name('business_status')->label(__('store.business_status'))->type('switch')->trueValue(BusinessStatus::Open)->falseValue(BusinessStatus::Close),
|
||||
amis()->TableColumn()->name('created_at')->label(__('store.created_at')),
|
||||
$this->rowActions([
|
||||
$this->rowShowButton()->visible($user->can('admin.store.stores.view')),
|
||||
$this->rowEditTypeButton('drawer', 'lg')->visible($user->can('admin.store.stores.update')),
|
||||
|
|
@ -79,40 +80,47 @@ class StoreController extends AdminController
|
|||
public function form($edit): Form
|
||||
{
|
||||
return $this->baseForm()->title('')->body([
|
||||
amisMake()->TextControl()->name('title')->label(__('store.title'))->required(),
|
||||
amisMake()->SelectControl()->name('master_id')->label(__('store.master_id'))
|
||||
amis()->TextControl()->name('title')->label(__('store.title'))->required(),
|
||||
amis()->SelectControl()->name('master_id')->label(__('store.master_id'))
|
||||
->source($edit ? admin_url('api/employees?_all=1&employee_status='.EmployeeStatus::Online->value) : admin_url('api/employees?_all=1&store_id=0&employee_status='.EmployeeStatus::Online->value))
|
||||
->labelField('name')
|
||||
->valueField('id')
|
||||
->searchable()
|
||||
->required(),
|
||||
amisMake()->TreeSelectControl()->name('category_id')->label(__('store.category_id'))
|
||||
amis()->TreeSelectControl()->name('category_id')->label(__('store.category_id'))
|
||||
->source(admin_url('api/keywords/tree-list?parent_key=store_category'))
|
||||
->labelField('name')
|
||||
->valueField('key')
|
||||
->onlyLeaf(true)
|
||||
->required(),
|
||||
amisMake()->SelectControl()->name('business_id')->label(__('store.business_id'))
|
||||
amis()->SelectControl()->name('business_id')->label(__('store.business_id'))
|
||||
->source(admin_url('api/keywords/tree-list?parent_key=store_business'))
|
||||
->labelField('name')
|
||||
->valueField('key')
|
||||
->required(),
|
||||
amisMake()->SelectControl()->name('level_id')->label(__('store.level_id'))
|
||||
amis()->SelectControl()->name('level_id')->label(__('store.level_id'))
|
||||
->source(admin_url('api/keywords/tree-list?parent_key=store_level'))
|
||||
->labelField('name')
|
||||
->valueField('key')
|
||||
->required(),
|
||||
amisMake()->InputCityControl()->name('region')->label(__('store.region'))->allowDistrict(false)->extractValue(false)->required(),
|
||||
amisMake()->LocationControl()->name('location')->label(__('store.location'))->ak(config('baidu.js_secret'))->autoSelectCurrentLoc(),
|
||||
amis()->NumberControl()
|
||||
->name('profit_ratio')
|
||||
->label(__('store.profit_ratio'))
|
||||
->placeholder(__('store.profit_ratio'))
|
||||
->precision(2)
|
||||
->showSteps(false)
|
||||
->required(),
|
||||
amis()->InputCityControl()->name('region')->label(__('store.region'))->allowDistrict(false)->extractValue(false)->required(),
|
||||
amis()->LocationControl()->name('location')->label(__('store.location'))->ak(config('baidu.js_secret'))->autoSelectCurrentLoc(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function detail(): Form
|
||||
{
|
||||
$detail = amisMake()->Property()->items([
|
||||
$detail = amis()->Property()->items([
|
||||
['label' => __('store.title'), 'content' => '${title}'],
|
||||
['label' => __('store.master_id'), 'content' => '${master.name}'],
|
||||
['label' => __('store.business_status'), 'content' => amisMake()->Tag()->label('${business_status_text}')->color('${business_status_color}')],
|
||||
['label' => __('store.business_status'), 'content' => amis()->Tag()->label('${business_status_text}')->color('${business_status_color}')],
|
||||
['label' => __('store.category_id'), 'content' => '${category.name}'],
|
||||
['label' => __('store.business_id'), 'content' => '${business.name}'],
|
||||
['label' => __('store.level_id'), 'content' => '${level.name}'],
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class LedgerController extends Controller
|
|||
throw new RuntimeException('上报数据已更新,不可重新上传');
|
||||
}
|
||||
|
||||
$ratio = bcdiv($user->store->profit_ratio, 100, 2);
|
||||
$ratio = bcdiv($user->store->profit_ratio, 100, 4);
|
||||
|
||||
// 计算预期佣金
|
||||
$validated['expected_commission'] = bcmul($validated['sales'], $ratio, 2);
|
||||
|
|
|
|||
Loading…
Reference in New Issue