添加续费配置、入住列表
parent
8d44553b86
commit
7eb468ce1a
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Models\CostAdvice;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Show;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
|
||||
class CostAdviceController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Make a grid builder.
|
||||
*
|
||||
* @return Grid
|
||||
*/
|
||||
protected function grid()
|
||||
{
|
||||
return Grid::make(new CostAdvice(), function (Grid $grid) {
|
||||
// $grid->column('id')->sortable();
|
||||
$grid->column('nape_id');
|
||||
$grid->column('nurse_lv');
|
||||
$grid->column('money');
|
||||
$grid->column('created_at')->sortable();
|
||||
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->equal('nape_id')->select()->width(3);
|
||||
$filter->equal('nurse_lv')->select()->width(3);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a show builder.
|
||||
*
|
||||
* @param mixed $id
|
||||
*
|
||||
* @return Show
|
||||
*/
|
||||
protected function detail($id)
|
||||
{
|
||||
return Show::make($id, new CostAdvice(), function (Show $show) {
|
||||
$show->field('id');
|
||||
$show->field('nape_id');
|
||||
$show->field('nurse_lv');
|
||||
$show->field('money');
|
||||
$show->field('created_at');
|
||||
$show->field('updated_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a form builder.
|
||||
*
|
||||
* @return Form
|
||||
*/
|
||||
protected function form()
|
||||
{
|
||||
return Form::make(new CostAdvice(), function (Form $form) {
|
||||
$form->display('id');
|
||||
$form->select('nape_id');
|
||||
$form->select('nurse_lv');
|
||||
$form->currency('money')->symbol('¥');
|
||||
|
||||
$form->display('created_at');
|
||||
$form->display('updated_at');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Models\Oldman;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Show;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
|
||||
class LiveInController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Make a grid builder.
|
||||
*
|
||||
* @return Grid
|
||||
*/
|
||||
protected function grid()
|
||||
{
|
||||
// $builder = Oldman::where();
|
||||
return Grid::make(new Oldman(), function (Grid $grid) {
|
||||
$grid->column('name');
|
||||
$grid->column('card_no');
|
||||
$grid->column('client_name');
|
||||
$grid->column('nurse_lv')->sortable();
|
||||
$grid->column('live_in_at')->sortable();
|
||||
$grid->column('avliable_at')->sortable();
|
||||
// $grid->column('created_at')->sortable();
|
||||
|
||||
$grid->disableCreateButton();
|
||||
$grid->tools("
|
||||
<div class='pull-right' data-responsive-table-toolbar='grid-table'>
|
||||
<button data-url='/admin' class='btn btn-primary dialog-create btn-outline'>
|
||||
<i class='feather icon-plus'></i><span class='d-none d-sm-inline'> 入住</span>
|
||||
</button>
|
||||
</div>");
|
||||
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->equal('name')->width(3);
|
||||
$filter->equal('card_no')->width(3);
|
||||
$filter->equal('nurse_lv')->select()->width(3);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a show builder.
|
||||
*
|
||||
* @param mixed $id
|
||||
*
|
||||
* @return Show
|
||||
*/
|
||||
protected function detail($id)
|
||||
{
|
||||
return Show::make($id, new Oldman(), function (Show $show) {
|
||||
$show->field('id');
|
||||
$show->field('floor_name');
|
||||
$show->field('agreement_no');
|
||||
$show->field('name');
|
||||
$show->field('sex');
|
||||
$show->field('birthday');
|
||||
$show->field('card_no');
|
||||
$show->field('card_province_id');
|
||||
$show->field('card_city_id');
|
||||
$show->field('card_area_id');
|
||||
$show->field('card_address');
|
||||
$show->field('client_name');
|
||||
$show->field('client_province_id');
|
||||
$show->field('client_city_id');
|
||||
$show->field('client_area_id');
|
||||
$show->field('client_address');
|
||||
$show->field('client_phone');
|
||||
$show->field('nurse_lv');
|
||||
$show->field('created_at');
|
||||
$show->field('updated_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a form builder.
|
||||
*
|
||||
* @return Form
|
||||
*/
|
||||
protected function form()
|
||||
{
|
||||
return Form::make(new Oldman(), function (Form $form) {
|
||||
$form->display('id');
|
||||
$form->row(function (Form\Row $form) {
|
||||
$form->divider('居住人');
|
||||
});
|
||||
$form->row(function (Form\Row $form) {
|
||||
$form->width(6)->text('floor_name');
|
||||
$form->width(6)->text('agreement_no');
|
||||
});
|
||||
$form->row(function (Form\Row $form) {
|
||||
$form->width(6)->text('name')->required();
|
||||
$form->width(3)->radio('sex')->options(['1'=>'男', '2'=>'女'])->required();
|
||||
});
|
||||
$form->row(function (Form\Row $form) {
|
||||
$form->width(6)->text('card_no')->required();
|
||||
$form->width(6)->date('birthday')->required();
|
||||
});
|
||||
|
||||
$form->row(function (Form\Row $form) {
|
||||
$form->width(3)->select('card_province_id')->required();
|
||||
$form->width(3)->select('card_city_id')->required();
|
||||
$form->width(3)->select('card_area_id')->required();
|
||||
});
|
||||
$form->row(function (Form\Row $form) {
|
||||
$form->text('card_address')->required();
|
||||
});
|
||||
$form->row(function (Form\Row $form) {
|
||||
$form->select('nurse_lv')->required();
|
||||
});
|
||||
|
||||
$form->row(function (Form\Row $form) {
|
||||
$form->divider('委托人');
|
||||
});
|
||||
|
||||
$form->row(function (Form\Row $form) {
|
||||
$form->width(6)->text('client_name')->required();
|
||||
$form->width(6)->text('client_phone')->required();
|
||||
});
|
||||
$form->row(function (Form\Row $form) {
|
||||
$form->width(3)->select('client_province_id')->required();
|
||||
$form->width(3)->select('client_city_id')->required();
|
||||
$form->width(3)->select('client_area_id')->required();
|
||||
});
|
||||
$form->row(function (Form\Row $form) {
|
||||
$form->text('client_address')->required();
|
||||
});
|
||||
|
||||
$form->display('created_at');
|
||||
$form->display('updated_at');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ class OldmanController extends AdminController
|
|||
$grid->column('name');
|
||||
$grid->column('card_no');
|
||||
$grid->column('sex');
|
||||
//年龄-todo
|
||||
$grid->column('age');
|
||||
$grid->column('client_name');
|
||||
$grid->column('client_phone');
|
||||
$grid->column('nurse_lv');
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ Route::group([
|
|||
$router->get('/', 'HomeController@index');
|
||||
|
||||
$router->resource('oldmen', 'OldmanController')->names('oldmen');
|
||||
$router->resource('cost-advices', 'CostAdviceController')->names('cost_advices');
|
||||
|
||||
$router->get('live-in', 'LiveInController@index');
|
||||
|
||||
$router->group([
|
||||
'prefix' => 'api',
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ namespace App\Models;
|
|||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CostAdivce extends Model
|
||||
class CostAdvice extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'cost_advices';
|
||||
}
|
||||
|
|
@ -3,9 +3,11 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Oldman extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasDateTimeFormatter;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
"laravel/framework": "^9.19",
|
||||
"laravel/sanctum": "^3.0",
|
||||
"laravel/tinker": "^2.7",
|
||||
"overtrue/laravel-lang": "^6.0",
|
||||
"peidikeji/dcat-admin": "^1.2"
|
||||
},
|
||||
"require-dev": {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "ebb63203f2e171fd6a7192c5ac6ec40e",
|
||||
"content-hash": "96fceb38d5bcac126f8bac5cb6b9a003",
|
||||
"packages": [
|
||||
{
|
||||
"name": "brick/math",
|
||||
|
|
@ -996,6 +996,68 @@
|
|||
],
|
||||
"time": "2021-10-07T12:57:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel-lang/lang",
|
||||
"version": "10.9.5",
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://mirrors.cloud.tencent.com/repository/composer/laravel-lang/lang/10.9.5/laravel-lang-lang-10.9.5.zip",
|
||||
"reference": "e341421d40f2cd28feca24ab2cb84fa5cb5ddaf6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*"
|
||||
},
|
||||
"conflict": {
|
||||
"laravel-lang/publisher": "<12.0 >=14.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"dragon-code/pretty-array": "^4.0",
|
||||
"dragon-code/simple-dto": "^2.3",
|
||||
"dragon-code/support": "^6.1",
|
||||
"ext-zip": "*",
|
||||
"guzzlehttp/guzzle": "^7.3",
|
||||
"laravel-lang/publisher": "^13.0",
|
||||
"laravel/breeze": "^1.2",
|
||||
"laravel/fortify": "^1.7",
|
||||
"laravel/jetstream": "^2.3",
|
||||
"laravel/ui": "^3.4",
|
||||
"orchestra/testbench": "^7.0",
|
||||
"php": "^8.1",
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"symfony/finder": "^6.0",
|
||||
"symfony/var-dumper": "^6.0",
|
||||
"vlucas/phpdotenv": "^5.4.1"
|
||||
},
|
||||
"suggest": {
|
||||
"arcanedev/laravel-lang": "Translations manager and checker for Laravel 5",
|
||||
"laravel-lang/publisher": "Easy installation and update of translation files for your project",
|
||||
"overtrue/laravel-lang": "Command to add languages in your project"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"LaravelLang\\Lang\\": "src"
|
||||
}
|
||||
},
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Laravel-Lang Team",
|
||||
"homepage": "https://github.com/Laravel-Lang"
|
||||
}
|
||||
],
|
||||
"description": "Languages for Laravel",
|
||||
"keywords": [
|
||||
"lang",
|
||||
"languages",
|
||||
"laravel",
|
||||
"lpm"
|
||||
],
|
||||
"time": "2022-06-27T01:57:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v9.52.4",
|
||||
|
|
@ -1977,6 +2039,55 @@
|
|||
],
|
||||
"time": "2023-02-08T01:06:31+00:00"
|
||||
},
|
||||
{
|
||||
"name": "overtrue/laravel-lang",
|
||||
"version": "6.0.3",
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://mirrors.cloud.tencent.com/repository/composer/overtrue/laravel-lang/6.0.3/overtrue-laravel-lang-6.0.3.zip",
|
||||
"reference": "9bdbc7cf422b2e93f8db1125f8f2b97f6e6eadad",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"laravel-lang/lang": "^10.4",
|
||||
"symfony/process": "^6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"laravel/framework": "^9.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Overtrue\\LaravelLang\\TranslationServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Overtrue\\LaravelLang\\": "src/"
|
||||
}
|
||||
},
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "overtrue",
|
||||
"email": "anzhengchao@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "List of 75 languages for Laravel.",
|
||||
"keywords": [
|
||||
"i18n",
|
||||
"languages",
|
||||
"laravel",
|
||||
"locale",
|
||||
"overtrue"
|
||||
],
|
||||
"time": "2022-06-18T12:46:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "peidikeji/dcat-admin",
|
||||
"version": "1.2.1",
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ return new class extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('cost_adivces', function (Blueprint $table) {
|
||||
Schema::create('cost_advices', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('nape_id')->default(0)->comment('费用项');
|
||||
$table->unsignedBigInteger('nurse_lv')->default(0)->comment('护理等级');
|
||||
|
|
@ -31,6 +31,6 @@ return new class extends Migration
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('cost_adivces');
|
||||
Schema::dropIfExists('cost_advices');
|
||||
}
|
||||
};
|
||||
|
|
@ -22,15 +22,17 @@ class AdminMenuSeeder extends Seeder
|
|||
$menus = [
|
||||
['title' => '主页', 'icon' => 'feather icon-bar-chart-2', 'uri' => '/'],
|
||||
['title' => '客人信息', 'icon' => 'feather icon-users', 'uri' => '/oldmen'],
|
||||
['title' => '入住管理', 'icon' => 'feather icon-feather', 'uri' => '/',
|
||||
['title' => '入住管理', 'icon' => 'feather icon-feather', 'uri' => '',
|
||||
'children' =>[
|
||||
['title' => '入住列表', 'icon' => '', 'uri' => '/auth/users', 'permission' => ''],
|
||||
['title' => '入住列表', 'icon' => '', 'uri' => '/live-in', 'permission' => ''],
|
||||
['title' => '续费列表', 'icon' => '', 'uri' => '/auth/users', 'permission' => ''],
|
||||
]],
|
||||
['title' => '快捷操作', 'icon' => 'feather icon-fast-forward', 'uri' => '/', 'children' =>[
|
||||
['title' => '入住', 'icon' => '', 'uri' => '/auth/users', 'permission' => ''],
|
||||
['title' => '续费', 'icon' => '', 'uri' => '/auth/users', 'permission' => ''],
|
||||
['title' => '结算', 'icon' => '', 'uri' => '/auth/users', 'permission' => ''],
|
||||
]],
|
||||
['title' => '费用配置', 'icon' => 'feather icon-stop-circle', 'uri' => '/cost-advices'],
|
||||
['title' => '系统管理', 'icon' => 'feather icon-settings', 'uri' => '',
|
||||
'permission' => ['administrators', 'roles', 'keywords', 'settings'],
|
||||
'children' => [
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection last_used_at
|
||||
* @property Grid\Column|Collection expires_at
|
||||
* @property Grid\Column|Collection email_verified_at
|
||||
* @property Grid\Column|Collection index
|
||||
*
|
||||
* @method Grid\Column|Collection id(string $label = null)
|
||||
* @method Grid\Column|Collection name(string $label = null)
|
||||
|
|
@ -144,6 +145,7 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection last_used_at(string $label = null)
|
||||
* @method Grid\Column|Collection expires_at(string $label = null)
|
||||
* @method Grid\Column|Collection email_verified_at(string $label = null)
|
||||
* @method Grid\Column|Collection index(string $label = null)
|
||||
*/
|
||||
class Grid {}
|
||||
|
||||
|
|
@ -216,6 +218,7 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection last_used_at
|
||||
* @property Show\Field|Collection expires_at
|
||||
* @property Show\Field|Collection email_verified_at
|
||||
* @property Show\Field|Collection index
|
||||
*
|
||||
* @method Show\Field|Collection id(string $label = null)
|
||||
* @method Show\Field|Collection name(string $label = null)
|
||||
|
|
@ -283,6 +286,7 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection last_used_at(string $label = null)
|
||||
* @method Show\Field|Collection expires_at(string $label = null)
|
||||
* @method Show\Field|Collection email_verified_at(string $label = null)
|
||||
* @method Show\Field|Collection index(string $label = null)
|
||||
*/
|
||||
class Show {}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
return [
|
||||
'labels' => [
|
||||
'CostAdvice' => '费用配置',
|
||||
'cost-advices' => '费用配置',
|
||||
],
|
||||
'fields' => [
|
||||
'nape_id' => '费用项',
|
||||
'nurse_lv' => '护理等级',
|
||||
'money' => '金额',
|
||||
],
|
||||
'options' => [
|
||||
],
|
||||
];
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
return [
|
||||
'labels' => [
|
||||
'LiveIn' => '入住列表',
|
||||
'live-ins' => '入住列表',
|
||||
],
|
||||
'fields' => [
|
||||
'name' => '姓名',
|
||||
'card_no' => '身份证号',
|
||||
'client_name' => '委托人',
|
||||
'nurse_lv' => '护理等级',
|
||||
'live_in_at' => '入住时间',
|
||||
'avliable_at' => '截至时间',
|
||||
],
|
||||
'options' => [
|
||||
],
|
||||
];
|
||||
|
|
@ -9,6 +9,7 @@ return [
|
|||
'agreement_no' => '协议号码',
|
||||
'name' => '姓名',
|
||||
'sex' => '性别',
|
||||
'age' => '年龄',
|
||||
'birthday' => '出生日期',
|
||||
'card_no' => '身份证号码',
|
||||
'card_province_id' => '户籍-省',
|
||||
|
|
|
|||
Loading…
Reference in New Issue