添加续住表单
parent
d0ccd7cc79
commit
b1ddba164c
|
|
@ -2,13 +2,14 @@
|
|||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Models\Keyword;
|
||||
use App\Models\{Keyword,Oldmen};
|
||||
use Slowlyo\OwlAdmin\Renderers\Page;
|
||||
use Slowlyo\OwlAdmin\Renderers\Form;
|
||||
use Slowlyo\OwlAdmin\Renderers\TableColumn;
|
||||
use Slowlyo\OwlAdmin\Controllers\AdminController;
|
||||
use App\Services\Admin\LiveContinueService;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Admin\Components;
|
||||
|
||||
class LiveContinueController extends AdminController
|
||||
{
|
||||
|
|
@ -54,4 +55,168 @@ class LiveContinueController extends AdminController
|
|||
|
||||
]);
|
||||
}
|
||||
|
||||
public function doForm(){
|
||||
|
||||
$feeKeys =[];
|
||||
$feeKeys['add_extends'] = '${add_extends}';
|
||||
$feeKeys['del_extends'] = '${del_extends}';
|
||||
$feeKeys['continue_fee'] = '${continue_fee}';
|
||||
$feeKeys['bonds_fee'] = '${bonds_fee}';
|
||||
|
||||
$page = $this->basePage()->body([
|
||||
amisMake()->Card()->className('border-0')->body(
|
||||
amisMake()->Wrapper()->className('p-0')->body(
|
||||
amisMake()->Grid()->className('relative')->columns([
|
||||
amisMake()->Wrapper()->sm(8)->body([
|
||||
amisMake()->Panel()->title('续住表单')->body(
|
||||
amisMake()->form()->title('')->panelClassName('border-0')->mode('horizontal')->name('base_form')
|
||||
->api(admin_url('live-continue-do'))
|
||||
->body([
|
||||
amisMake()->FieldSetControl()->title('续住人信息')->collapsable(true)->body([
|
||||
amisMake()->Service()->api([
|
||||
"method"=>'get',
|
||||
"url" => admin_url('oldmen/${oldman_id}/edit'),
|
||||
"data"=>[
|
||||
'_action' => 'getData',
|
||||
],
|
||||
"sendOn" => "this.oldman_id > 0 "
|
||||
]),
|
||||
amisMake()->GroupControl()->body([
|
||||
amisMake()->PickerControl('oldman_id', '姓名')
|
||||
->valueField('id')
|
||||
->labelField('name')
|
||||
->joinValues(false)->extractValue(true)
|
||||
->size('lg')
|
||||
->source([
|
||||
'method' => 'get',
|
||||
'url' => admin_url('oldmen?_action=getData&live_in='.Oldmen::STATUS_LIVE),
|
||||
'data' => [
|
||||
'name'=>'${term}',
|
||||
]
|
||||
])
|
||||
->pickerSchema(
|
||||
[
|
||||
'mode' => 'table',
|
||||
'name' => 'monitor_list',
|
||||
'headerToolbar' => amisMake()->form()
|
||||
->wrapWithPanel(false)
|
||||
->className('text-right')
|
||||
->target('monitor_list')
|
||||
->mode('inline')
|
||||
->body([
|
||||
amisMake()->TextControl('term', '姓名/身份证号')->addOn(
|
||||
amis('submit')->label(__('admin.search'))->level('primary')
|
||||
)
|
||||
]),
|
||||
'columns' => [
|
||||
TableColumn::make()->name('name')->label('姓名'),
|
||||
TableColumn::make()->name('card_no')->label('身份证号码'),
|
||||
]
|
||||
]
|
||||
)->value(0)
|
||||
->required(true),
|
||||
|
||||
amisMake()->RadiosControl('sex', '性别')->options([
|
||||
1=>'男',2=>'女'
|
||||
])->disabled(true),
|
||||
]),
|
||||
amisMake()->GroupControl()->body([
|
||||
amisMake()->TextControl('card_no', '身份证号码')->disabled(true),
|
||||
amisMake()->DateControl('birthday', '出生日期')->format('YYYY-MM-DD')->disabled(true),
|
||||
]),
|
||||
|
||||
amisMake()->GroupControl()->body([
|
||||
amisMake()->TextControl('floor_name', '楼栋')->disabled(true),
|
||||
amisMake()->TextControl('agreement_no', '协议号码')->disabled(true),
|
||||
]),
|
||||
amisMake()->GroupControl()->body([
|
||||
amisMake()->RadiosControl('nurse_lv', '护理等级')->options(Keyword::getByParentKey('nurse_lv')->pluck('name', 'value'))->disabledOn('data.change_lv == 0')->required(true),
|
||||
amisMake()->SwitchControl('change_lv', '变更护理等级')->value(0),
|
||||
]),
|
||||
|
||||
amisMake()->GroupControl()->body([
|
||||
amisMake()->TextControl('start_at', '开始时间')->disabled(true),
|
||||
amisMake()->DateControl('end_at', '截至时间')->format('YYYY-MM-DD')->required(true),
|
||||
]),
|
||||
]),
|
||||
|
||||
|
||||
amisMake()->FieldSetControl()->className('mt-10')->title('费用明细')->collapsable(true)->body([
|
||||
amisMake()->FieldSetControl()->title('基础费用')->className('mt-5')->collapsable(true)->size('base')->body(
|
||||
amisMake()->Service()->schemaApi([
|
||||
"method"=>'get',
|
||||
"url" => admin_url('live-fee-form').'?nurse_lv=${nurse_lv}&start_at=${start_at}&end_at=${end_at}&type=continue_fee',
|
||||
])
|
||||
),
|
||||
]),
|
||||
|
||||
amisMake()->FieldSetControl()->className('mt-10')->title('附加项')->collapsable(true)->body([
|
||||
amisMake()->ComboControl('add_extends','收费项')->multiple(true)->items([
|
||||
amisMake()->TextControl('name', '名称'),
|
||||
Components::make()->decimalControl('fee', '金额')
|
||||
]),
|
||||
amisMake()->ComboControl('del_extends','抵扣项')->multiple(true)->items([
|
||||
amisMake()->TextControl('name', '名称'),
|
||||
Components::make()->decimalControl('fee', '金额')
|
||||
]),
|
||||
]),
|
||||
])
|
||||
->actions([
|
||||
amis('button')->label("生成清单")->level('primary')
|
||||
->onEvent([
|
||||
'click'=>[
|
||||
'actions'=>[
|
||||
[
|
||||
'actionType'=>'reload',
|
||||
'componentId'=>'fee_table'
|
||||
],
|
||||
[
|
||||
'actionType'=>'setValue',
|
||||
'componentId'=>'fee_table',
|
||||
'args'=>[
|
||||
'value'=> $feeKeys
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]),
|
||||
amis('submit')->label('确认续住')->confirmText('是否确认续住,并且已查看续住费用清单?')
|
||||
->redirect('live-in')
|
||||
->level('danger'),
|
||||
]),
|
||||
),
|
||||
]),
|
||||
amisMake()->Wrapper()->sm(4)->className('absolute bottom-20 w-2/6')->body([
|
||||
amisMake()->Panel()->title('结算清单')->body([
|
||||
amisMake()->Service()->name('fee_table_name')->id('fee_table')
|
||||
->data($feeKeys)
|
||||
->body(
|
||||
amisMake()->table()->affixHeader(false)
|
||||
->title('')
|
||||
->source('${rows}')
|
||||
->combineNum(2)
|
||||
->columns([
|
||||
amisMake()->TableColumn()->name('name')->label('名称'),
|
||||
amisMake()->TableColumn()->name('fee_name')->label('费用项'),
|
||||
amisMake()->TableColumn()->name('fee_value')->label('费用'),
|
||||
])->affixRow([
|
||||
amis('text')->text('合计')->colSpan(2),
|
||||
amis('tpl')->tpl('${SUM(ARRAYMAP(rows, item => item.fee_value))}')
|
||||
]),
|
||||
)->api([
|
||||
'method'=>'get',
|
||||
'data'=> $feeKeys,
|
||||
'url' =>admin_url('feelist')
|
||||
]),
|
||||
]),
|
||||
|
||||
]),
|
||||
]),
|
||||
)
|
||||
),
|
||||
]);
|
||||
|
||||
return $this->response()->success($page);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,12 @@ class OldmenController extends AdminController
|
|||
if ($this->actionOfGetData()) {
|
||||
$data = null;
|
||||
if($id){
|
||||
$data = $this->service->getEditData($id);
|
||||
$data = $this->service->getEditData($id);
|
||||
//处理下
|
||||
if($data->avliable_at){
|
||||
//续住时的开始时间
|
||||
$data->offsetSet('start_at', Carbon::parse($data->avliable_at)->addSecond()->format('Y-m-d'));
|
||||
}
|
||||
}
|
||||
return $this->response()->success($data);
|
||||
}
|
||||
|
|
@ -208,6 +213,7 @@ class OldmenController extends AdminController
|
|||
{
|
||||
$type = $request->input('type', 'live_fee');
|
||||
$dateRange = $request->input('live_in_date', null);
|
||||
//处理续住时间传递
|
||||
$startDay = $dateRange ? explode(',', $dateRange)[0].' 00:00:00' : null;
|
||||
$endDay = $dateRange ? explode(',', $dateRange)[1].' 23:59:59' : null;
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ Route::group([
|
|||
$router->get('live-fee-form', '\App\Admin\Controllers\OldmenController@liveSchemaForm');
|
||||
|
||||
$router->get('live-continue', '\App\Admin\Controllers\LiveContinueController@index');
|
||||
$router->get('live-continue-do', '\App\Admin\Controllers\LiveContinueController@doForm');
|
||||
$router->post('live-continue-do', '\App\Admin\Controllers\LiveContinueController@do');
|
||||
|
||||
$router->get('const-setting', '\App\Admin\Controllers\SettingController@settingFeeConfig');
|
||||
$router->post('const-setting', '\App\Admin\Controllers\SettingController@settingFeeConfigStore');
|
||||
|
|
|
|||
Loading…
Reference in New Issue