Compare commits

..

No commits in common. "00d0378320349a82c4863ce1594071169c36c655" and "4162e6946e751162c881be21972188c155a9991a" have entirely different histories.

19 changed files with 309 additions and 2674 deletions

View File

@ -28,19 +28,19 @@ class ConstFlowController extends AdminController
$this->baseFilter()->body([ $this->baseFilter()->body([
amisMake()->TextControl('name', '名称')->size('md'), amisMake()->TextControl('name', '名称')->size('md'),
amisMake()->TextControl('card_no', '身份证')->size('md'), amisMake()->TextControl('card_no', '身份证')->size('md'),
amisMake()->TextControl('sn', '单据编号')->size('md'),
amis('button')->label(__('admin.reset'))->actionType('clear-and-submit'), amis('button')->label(__('admin.reset'))->actionType('clear-and-submit'),
amis('submit')->label(__('admin.search'))->level('primary'), amis('submit')->label(__('admin.search'))->level('primary'),
])->actions([]) ])->actions([])
) )
->columns([ ->columns([
amisMake()->TableColumn('sn', '单据编号')->copyable(true), amisMake()->TableColumn('id', 'ID')->sortable(),
amisMake()->TableColumn('oldman.name', '客人'), amisMake()->TableColumn('oldman.name', '客人'),
amisMake()->TableColumn('const_type', '缴费类型')->type('mapping')->map(ConstFlow::typeMapLabel())->className('text-primary'), amisMake()->TableColumn('const_type', '缴费类型')->type('mapping')->map(ConstFlow::typeMapLabel())->className('text-primary'),
amisMake()->TableColumn('money', '金额'), amisMake()->TableColumn('money', '金额'),
amisMake()->TableColumn('created_at', '办理时间')->type('datetime')->sortable(true), amisMake()->TableColumn('created_at', '办理时间')->type('datetime')->sortable(true),
amisMake()->Operation()->label(__('admin.actions'))->buttons([ amisMake()->Operation()->label(__('admin.actions'))->buttons([
$this->showFlow(), $this->showFlow(),
//打印票据
]), ]),
]); ]);
@ -68,18 +68,8 @@ class ConstFlowController extends AdminController
$rows = []; $rows = [];
$flow = $this->service->getDetail($id); $flow = $this->service->getDetail($id);
$rows = $this->service->makeFeelist($flow); $rows = $this->service->makeFeelist($flow);
$page = amisMake()->CRUDTable()->affixHeader(false) $page = amisMake()->table()->affixHeader(false)
->headerToolbar([
'bulkActions',
])
->primaryField('ukey')
->bulkActions([
//打印明细
amisMake()->Button()->label('打印预览')->actionType('url')->blank(true)
->url(url('/print-const-flow').'?id=${id}&ukeys=${ids}')
])
->data([ ->data([
'id' => $id,
'rows' => $rows 'rows' => $rows
]) ])
->title('') ->title('')
@ -88,10 +78,10 @@ class ConstFlowController extends AdminController
->columns([ ->columns([
amisMake()->TableColumn()->name('name')->label('名称'), amisMake()->TableColumn()->name('name')->label('名称'),
amisMake()->TableColumn()->name('fee_name')->label('费用项'), amisMake()->TableColumn()->name('fee_name')->label('费用项'),
amisMake()->TableColumn()->name('fee_value')->label('费用') amisMake()->TableColumn()->name('fee_value')->label('费用'),
])->affixRow([ ])->affixRow([
// amis('text')->text('合计')->colSpan(2), amis('text')->text('合计')->colSpan(2),
// amis('tpl')->tpl('${SUM(ARRAYMAP(rows, item => item.fee_value))}') amis('tpl')->tpl('${SUM(ARRAYMAP(rows, item => item.fee_value))}')
]); ]);
return $this->response()->success($page); return $this->response()->success($page);
} }

View File

@ -51,7 +51,7 @@ class HomeController extends AdminController
->className('h-full clear-card-mb') ->className('h-full clear-card-mb')
->body( ->body(
Custom::make()->html(<<<HTML Custom::make()->html(<<<HTML
<div class="h-full flex flex-col mt-5 py-6 px-7"> <div class="h-full flex flex-col mt-5 py-5 px-7">
<div></div> <div></div>
<div class="flex flex-1 items-center w-full justify-center" id="hitokoto"> <div class="flex flex-1 items-center w-full justify-center" id="hitokoto">
<a class="text-dark" href="#" id="hitokoto_text" target="_blank"></a> <a class="text-dark" href="#" id="hitokoto_text" target="_blank"></a>

View File

@ -102,11 +102,11 @@ class LiveExitController extends AdminController
]), ]),
amisMake()->FieldSetControl()->className('mt-10')->title('附加项')->collapsable(true)->body([ amisMake()->FieldSetControl()->className('mt-10')->title('附加项')->collapsable(true)->body([
amisMake()->ComboControl('add_extends','收费项')->multiple(true)->items([ amisMake()->ComboControl('del_extends','收费项')->multiple(true)->items([
amisMake()->TextControl('name', '名称'), amisMake()->TextControl('name', '名称'),
Components::make()->decimalControl('fee', '金额') Components::make()->decimalControl('fee', '金额')
]), ]),
amisMake()->ComboControl('del_extends','抵扣项')->multiple(true)->items([ amisMake()->ComboControl('add_extends','抵扣项')->multiple(true)->items([
amisMake()->TextControl('name', '名称'), amisMake()->TextControl('name', '名称'),
Components::make()->decimalControl('fee', '金额') Components::make()->decimalControl('fee', '金额')
]), ]),

View File

@ -68,7 +68,6 @@ class OldmenController extends AdminController
amisMake()->Operation()->label(__('admin.actions'))->buttons([ amisMake()->Operation()->label(__('admin.actions'))->buttons([
amisMake()->LinkAction()->label('入住')->icon('fa fa-plus')->link('live-in-do?oldman_id=${id}')->level('link')->hiddenOn('this.live_in == 1'), amisMake()->LinkAction()->label('入住')->icon('fa fa-plus')->link('live-in-do?oldman_id=${id}')->level('link')->hiddenOn('this.live_in == 1'),
amisMake()->LinkAction()->label('续住')->icon('fa fa-plus')->link('live-continue-do?oldman_id=${id}')->level('link')->hiddenOn('this.live_in == 0'), amisMake()->LinkAction()->label('续住')->icon('fa fa-plus')->link('live-continue-do?oldman_id=${id}')->level('link')->hiddenOn('this.live_in == 0'),
$this->showOldman(),
$this->rowEditButton(true, 'lg'), $this->rowEditButton(true, 'lg'),
$this->rowDeleteButton() $this->rowDeleteButton()
]), ]),
@ -77,94 +76,6 @@ class OldmenController extends AdminController
return $this->baseList($crud); return $this->baseList($crud);
} }
public function showOldman(){
return amisMake()->DialogAction()->icon('fa-regular fa-eye')->label('查看')->level('link')->dialog(
amisMake()->Dialog()->title('查看详情')->body([
amisMake()->Grid()->columns([
//信息详情
amisMake()->Wrapper()->sm(6)->body([
amisMake()->Panel()->title('客人信息')
->subFormMode('horizontal')
->labelWidth(100)
->body([
amisMake()->form()->title('')->panelClassName('border-0')->mode('horizontal')
->static(true)->actions([])
->body([
amisMake()->FieldSetControl()->title('居住人信息')->collapsable(true)->body([
amisMake()->GroupControl()->body([
amisMake()->TextControl('name', '名称'),
amisMake()->RadiosControl('sex', '性别')->options([
1=>'男',2=>'女'
]),
]),
amisMake()->GroupControl()->body([
amisMake()->TextControl('card_no', '身份证号码'),
amisMake()->DateControl('birthday', '出生日期')->format('YYYY-MM-DD'),
]),
amisMake()->GroupControl()->body([
amisMake()->TextControl('card_complete_address', '详细地址'),
amisMake()->TextControl('age', '年龄'),
]),
amisMake()->GroupControl()->body([
amisMake()->TextControl('floor_name', '楼栋'),
amisMake()->TextControl('agreement_no', '协议号码'),
]),
amisMake()->GroupControl()->body([
amisMake()->RadiosControl('nurse_lv', '护理等级')->options(Keyword::getByParentKey('nurse_lv')->pluck('name', 'value')),
amis('static-mapping')->name('live_in')->label('状态')->map([
"0"=>"<span class='label label-info'>未入住</span>",
"1"=>"<span class='label label-success'>已入住</span>",
"*"=> '其他:${live_in}'
]),
]),
amisMake()->GroupControl()->body([
amisMake()->DateControl('live_in_at', '开始时间')->format('YYYY-MM-DD'),
amisMake()->DateControl('avliable_at', '截至时间')->format('YYYY-MM-DD'),
]),
]),
amisMake()->FieldSetControl()->title('委托人信息')->className('mt-10')->collapsable(true)->body([
amisMake()->GroupControl()->body([
amisMake()->TextControl('client_name', '名称'),
amisMake()->TextControl('client_phone', '手机号'),
]),
amisMake()->GroupControl()->body([
amisMake()->TextControl('client_complete_address', '详细地址'),
]),
]),
]),
]),
]),
//入住缴费情况
amisMake()->Wrapper()->sm(6)->body([
amisMake()->Panel()->title('缴费记录')
->body([
amisMake()->CRUDTable()->affixHeader(false)
->title('')
->api(admin_url('consts').'?_action=getData&oldman_id=${id}')
->columns([
amisMake()->TableColumn('sn', '单据编号')->copyable(true),
amisMake()->TableColumn('const_type', '缴费类型')->type('mapping')->map(ConstFlow::typeMapLabel())->className('text-primary'),
amisMake()->TableColumn('start_at', '开始时间')->type('datetime'),
amisMake()->TableColumn('end_at', '截至时间')->type('datetime'),
amisMake()->TableColumn('money', '金额'),
amisMake()->TableColumn('created_at', '办理时间')->type('datetime'),
amisMake()->Operation()->label(__('admin.actions'))->buttons([
amisMake()->DialogAction()->icon('fa-regular fa-eye')->label('费用清单')->level('link')->dialog(
amisMake()->Dialog()->title('查看详情')->body([
\amisMake()->Service()->schemaApi(admin_url('flow-list-tabs?id=${id}'))
])->size('lg')->actions([])
)
]),
])
]),
]),
]),
])->size('xl')->actions([])
);
}
public function form(): Form public function form(): Form
{ {
return $this->baseForm()->body([ return $this->baseForm()->body([
@ -203,6 +114,14 @@ class OldmenController extends AdminController
]); ]);
} }
public function detail(): Form
{
return $this->baseDetail()->body([
TextControl::make()->static()->name('id')->label('ID'),
TextControl::make()->static()->name('created_at')->label(__('admin.created_at')),
TextControl::make()->static()->name('updated_at')->label(__('admin.updated_at'))
]);
}
/** /**
* 获取编辑页面 * 获取编辑页面
@ -335,7 +254,6 @@ class OldmenController extends AdminController
if($oldMan){ if($oldMan){
$flowList = ConstFlow::where('oldman_id', $oldMan->id) $flowList = ConstFlow::where('oldman_id', $oldMan->id)
->whereIn('const_type', [ConstFlow::TYPE_IN, ConstFlow::TYPE_CONTINUE]) ->whereIn('const_type', [ConstFlow::TYPE_IN, ConstFlow::TYPE_CONTINUE])
->where('state', 0)
->whereBetween('start_at', [$oldMan->live_in_at, $oldMan->avliable_at])//开始时间在用户这段时间内的清单 ->whereBetween('start_at', [$oldMan->live_in_at, $oldMan->avliable_at])//开始时间在用户这段时间内的清单
->get(); ->get();
$tableList = []; $tableList = [];

View File

@ -1,8 +1 @@
<?php <?php
use Slowlyo\OwlAdmin\Admin;
Admin::styles([
'.cxd-Panel-heading { border-width: 0; background: #4080ffc7 !important; }',
// '.cxd-Panel {box-shadow: none; }',
'.cxd-Panel-title { color:white;font-size: 16px; }'
]);

View File

@ -13,10 +13,6 @@ class ConstFlowFilter extends ModelFilter
return $this->where('oldman_id', $oldmanId); return $this->where('oldman_id', $oldmanId);
} }
public function sn($sn){
return $this->where('sn', $sn);
}
/** /**
* 名称 * 名称
*/ */

View File

@ -1,128 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\Models\ConstFlow;
use Illuminate\Http\Request;
use App\Services\Admin\ConstFlowService;
class PrintController extends Controller
{
public function showConst(Request $request)
{
$name = '';
$time = now()->format('Y-m-d H:i:s');
$sn = '';
//默认list最少N行最多N行
$list = [];
$total = 0;
$bigTotal = '';
$adminName = '';
$timeZone = '';
$flow = ConstFlow::find($request->input('id', 0));
if($flow){
$rows = (new ConstFlowService())->makeFeelist($flow);
$flow->load(['oldman', 'adminuser']);
$name = $flow->oldman->name;
$time = $flow->created_at->format('Y-m-d H:i:s');
$sn = $flow->sn;
$ukeys = explode(',', $request->input('ukeys', ''));
$i = 0;
foreach($rows as $item){
if($i<4){
if(in_array($item['ukey'], $ukeys)){
$i++;
$list[] = $item;
}
}else{
break;
}
}
for($i; $i<4; $i++){
$list[] = [
'ukey' => '',
'name' => '',
'fee_name' => '',
'fee_value' => 0,
];
}
if(count($list) > 0){
$total = collect($list)->sum('fee_value');
if($total > 0){
$bigTotal = $this->num2chinese($total);
}else{
$bigTotal = '负'.$this->num2chinese(abs($total));
}
}
$adminName = $flow->adminuser->name;
$timeZone = substr($flow->start_at, 0, 10).'至'.substr($flow->end_at, 0, 10);
}
return view('print-const', compact('name', 'time', 'sn', 'list', 'total', 'bigTotal', 'timeZone', 'adminName'));
}
private function num2chinese($num) {
$cnNums = array(
"", "", "", "", "", "", "", "", "", ""
);
$cnIntUnits = array("", "", "", "");
$cnIntRadice = array("", "", "亿", "");
$cnDecUnits = array("", "");
$cnInteger = "";
$intStr = (string)$num;
$len = strlen($intStr);
if ($len > 15 || $num < 0) {
return false; // 超出处理范围
}
if ($num == 0) {
return "零元整";
}
$zeroCount = 0;
$outChinese = "";
for ($i = 0; $i < $len; $i++) {
$idx = $len - $i - 1;
$thisNum = (int)$intStr[$idx];
if ($thisNum == 0) {
$zeroCount++;
continue;
}
if ($zeroCount > 0) {
$outChinese = "" . $outChinese; // 处理零
}
$zeroCount = 0;
$outChinese = $cnNums[$thisNum] . $cnIntUnits[$i % 4] . $outChinese;
if ($i % 4 == 0) {
$outChinese = $cnIntRadice[$i / 4] . $outChinese;
}
}
if ($zeroCount > 0) {
$outChinese = "" . $outChinese; // 处理最后的零
}
$outChinese .= "";
// 处理小数部分
if (strpos($num, '.') !== false) {
$decPart = substr($num, strpos($num, '.') + 1);
for ($i = 0, $len = strlen($decPart); $i < $len; $i++) {
$thisNum = (int)$decPart[$i];
if ($thisNum == 0) {
continue;
}
$outChinese .= $cnNums[$thisNum] . $cnDecUnits[$i];
}
} else {
$outChinese .= "";
}
return $outChinese;
}
}

View File

@ -4,8 +4,6 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use EloquentFilter\Filterable; use EloquentFilter\Filterable;
use Slowlyo\OwlAdmin\Models\AdminUser;
use Carbon\Carbon;
class ConstFlow extends Model class ConstFlow extends Model
{ {
@ -40,29 +38,10 @@ class ConstFlow extends Model
protected $fillable = [ protected $fillable = [
'oldman_id', 'const_type', 'money', 'extends', 'start_at', 'end_at', 'oldman_id', 'const_type', 'money', 'extends', 'start_at', 'end_at',
'change_lv', 'old_lv', 'new_lv', 'change_lv', 'old_lv', 'new_lv'
'state', 'sn', 'adminuser_id',
]; ];
protected static function boot()
{
parent::boot();
// 监听 flow 创建事件创建sn
static::creating(function ($oldmen) {
$oldmen->sn = self::createSn();
});
}
public function oldman(){ public function oldman(){
return $this->belongsTo(Oldmen::class, 'oldman_id'); return $this->belongsTo(Oldmen::class, 'oldman_id');
} }
public function adminuser(){
return $this->belongsTo(AdminUser::class, 'adminuser_id');
}
private static function createSn()
{
return Carbon::now()->isoFormat('YYMMDDHHmmss').rand(1000, 9999);
}
} }

View File

@ -39,7 +39,7 @@ class BaseService extends AdminService
$query->filter(request()->input(), $filter); $query->filter(request()->input(), $filter);
} }
return $query->orderByDesc($model->getUpdatedAtColumn() ?? $model->getKeyName())->orderByDesc('id'); return $query->orderByDesc($model->getUpdatedAtColumn() ?? $model->getKeyName());
} }
public function getDetail($id) public function getDetail($id)

View File

@ -7,7 +7,6 @@ use App\Models\ConstFlow;
use DB; use DB;
use Throwable; use Throwable;
use Carbon\Carbon; use Carbon\Carbon;
use Slowlyo\OwlAdmin\OwlAdmin;
/** /**
* @method Oldmen getModel() * @method Oldmen getModel()
@ -52,7 +51,6 @@ class LiveContinueService extends OldmenService
$flow->end_at = $endAt; $flow->end_at = $endAt;
$flow->money = $this->totalFee($feeArr); $flow->money = $this->totalFee($feeArr);
$flow->extends = $feeArr; $flow->extends = $feeArr;
$flow->adminuser_id = OwlAdmin::user()->id;
//记录变更护理等级情况; //记录变更护理等级情况;
if($changeLv && $lv != $oldMan->nurse_lv){ if($changeLv && $lv != $oldMan->nurse_lv){

View File

@ -5,7 +5,6 @@ namespace App\Services\Admin;
use App\Models\Oldmen; use App\Models\Oldmen;
use App\Models\ConstFlow; use App\Models\ConstFlow;
use DB; use DB;
use Slowlyo\OwlAdmin\OwlAdmin;
use Throwable; use Throwable;
/** /**
@ -26,13 +25,12 @@ class LiveExitService extends OldmenService
$flowList = ConstFlow::where('oldman_id', $oldMan->id) $flowList = ConstFlow::where('oldman_id', $oldMan->id)
->whereIn('const_type', [ConstFlow::TYPE_IN, ConstFlow::TYPE_CONTINUE]) ->whereIn('const_type', [ConstFlow::TYPE_IN, ConstFlow::TYPE_CONTINUE])
->where('state', 0)
->whereBetween('start_at', [$oldMan->live_in_at, $oldMan->avliable_at])//开始时间在用户这段时间内的清单 ->whereBetween('start_at', [$oldMan->live_in_at, $oldMan->avliable_at])//开始时间在用户这段时间内的清单
->get(); ->get();
$flowMoney = 0; $flowMoney = 0;
foreach($flowList as $flow){ foreach($flowList as $flow){
$flowMoney = bcsub($flowMoney, $flow->money, 2); $flowMoney = bcadd($flowMoney, $flow->money, 2);
} }
$flow = new ConstFlow(); $flow = new ConstFlow();
@ -42,19 +40,9 @@ class LiveExitService extends OldmenService
$flow->end_at = $oldMan->avliable_at;//办理结算时间 $flow->end_at = $oldMan->avliable_at;//办理结算时间
$flow->money = bcadd($flowMoney, $this->totalFee($feeArr), 2); $flow->money = bcadd($flowMoney, $this->totalFee($feeArr), 2);
$flow->extends = $feeArr; $flow->extends = $feeArr;
$flow->state = 1;
$flow->adminuser_id = OwlAdmin::user()->id;
try{ try{
DB::beginTransaction(); DB::beginTransaction();
//更新明细清算状态
ConstFlow::where('oldman_id', $oldMan->id)
->whereIn('const_type', [ConstFlow::TYPE_IN, ConstFlow::TYPE_CONTINUE])
->where('state', 0)
->whereBetween('start_at', [$oldMan->live_in_at, $oldMan->avliable_at])//开始时间在用户这段时间内的清单
->update([
'state' => 1
]);
//缴费生成流水; //缴费生成流水;
$flow->save(); $flow->save();
//更新客人信息状态; //更新客人信息状态;

View File

@ -6,7 +6,6 @@ use App\Models\ConstFlow;
use App\Models\Oldmen; use App\Models\Oldmen;
use DB; use DB;
use Throwable; use Throwable;
use Slowlyo\OwlAdmin\OwlAdmin;
/** /**
* @method Oldmen getModel() * @method Oldmen getModel()
@ -47,7 +46,6 @@ class LiveInService extends OldmenService
$flow->end_at = $endAt; $flow->end_at = $endAt;
$flow->money = $this->totalFee($feeArr); $flow->money = $this->totalFee($feeArr);
$flow->extends = $feeArr; $flow->extends = $feeArr;
$flow->adminuser_id = OwlAdmin::user()->id;
try{ try{
DB::beginTransaction(); DB::beginTransaction();

View File

@ -121,15 +121,13 @@ class OldmenService extends BaseService
$flowList = ConstFlow::where('oldman_id', $oldMan->id) $flowList = ConstFlow::where('oldman_id', $oldMan->id)
->whereIn('const_type', [ConstFlow::TYPE_IN, ConstFlow::TYPE_CONTINUE]) ->whereIn('const_type', [ConstFlow::TYPE_IN, ConstFlow::TYPE_CONTINUE])
->where('state', 0)
->whereBetween('start_at', [$startAt, $endAt])//开始时间在用户这段时间内的清单 ->whereBetween('start_at', [$startAt, $endAt])//开始时间在用户这段时间内的清单
->get(); ->get();
foreach($flowList as $flow){ foreach($flowList as $flow){
$rows[] = [ $rows[] = [
'ukey' => 'history_'.$flow->id,
'name' => '缴费记录', 'name' => '缴费记录',
'fee_name' => ConstFlow::typeMap()[$flow->const_type].'【'.$flow->created_at->format('m-d H:i:s').'】', 'fee_name' => ConstFlow::typeMap()[$flow->const_type].'【'.$flow->created_at->format('m-d H:i:s').'】',
'fee_value' => 0-$flow->money, 'fee_value' => $flow->money,
]; ];
} }
} }
@ -142,21 +140,19 @@ class OldmenService extends BaseService
if(!$delFee){ if(!$delFee){
$delFee = Arr::get($extends, 'del_fee', []); $delFee = Arr::get($extends, 'del_fee', []);
} }
foreach($addFee as $i => $item){ foreach($addFee as $item){
if(isset($item['name']) && isset($item['fee'])){ if(isset($item['name']) && isset($item['fee'])){
$rows[] = [ $rows[] = [
'ukey' => 'add_'.$i, 'name' => '抵扣项',
'name' => '收费项',
'fee_name' => $item['name'], 'fee_name' => $item['name'],
'fee_value' => $item['fee'], 'fee_value' => $item['fee'],
]; ];
} }
} }
foreach($delFee as $i => $item){ foreach($delFee as $item){
if(isset($item['name']) && isset($item['fee'])){ if(isset($item['name']) && isset($item['fee'])){
$rows[] = [ $rows[] = [
'ukey' => 'del_'.$i, 'name' => '收费项',
'name' => '抵扣项',
'fee_name' => $item['name'], 'fee_name' => $item['name'],
'fee_value' => 0-$item['fee'], 'fee_value' => 0-$item['fee'],
]; ];
@ -179,7 +175,6 @@ class OldmenService extends BaseService
foreach($value as $item =>$vv){ foreach($value as $item =>$vv){
$_fee = Keyword::where('key', $item)->first(); $_fee = Keyword::where('key', $item)->first();
$rows[] = [ $rows[] = [
'ukey' => $item,
'name' => $_fee->parent?->name ?? '', 'name' => $_fee->parent?->name ?? '',
'fee_name' => $_fee->name, 'fee_name' => $_fee->name,
'fee_value' => $vv, 'fee_value' => $vv,
@ -188,7 +183,6 @@ class OldmenService extends BaseService
}else{ }else{
$_fee = Keyword::where('key', $key)->first(); $_fee = Keyword::where('key', $key)->first();
$rows[] = [ $rows[] = [
'ukey' => $key,
'name' => $_fee->parent?->name ?? '', 'name' => $_fee->parent?->name ?? '',
'fee_name' => $_fee->name, 'fee_name' => $_fee->name,
'fee_value' => $value, 'fee_value' => $value,
@ -196,20 +190,18 @@ class OldmenService extends BaseService
} }
} }
} }
foreach($addFee as $i => $item){ foreach($addFee as $item){
if(isset($item['name']) && isset($item['fee'])){ if(isset($item['name']) && isset($item['fee'])){
$rows[] = [ $rows[] = [
'ukey' => 'add_'.$i,
'name' => '收费项', 'name' => '收费项',
'fee_name' => $item['name'], 'fee_name' => $item['name'],
'fee_value' => $item['fee'], 'fee_value' => $item['fee'],
]; ];
} }
} }
foreach($delFee as $i => $item){ foreach($delFee as $item){
if(isset($item['name']) && isset($item['fee'])){ if(isset($item['name']) && isset($item['fee'])){
$rows[] = [ $rows[] = [
'ukey' => 'del_'.$i,
'name' => '抵扣项', 'name' => '抵扣项',
'fee_name' => $item['name'], 'fee_name' => $item['name'],
'fee_value' => 0-$item['fee'], 'fee_value' => 0-$item['fee'],

2542
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -14,17 +14,14 @@ return new class extends Migration
Schema::create('const_flows', function (Blueprint $table) { Schema::create('const_flows', function (Blueprint $table) {
$table->id(); $table->id();
$table->unsignedBigInteger('oldman_id'); $table->unsignedBigInteger('oldman_id');
$table->string('sn')->comment('流水编号');
$table->unsignedTinyInteger('const_type')->comment('类别:1入住缴费2续住缴费3结算离场'); $table->unsignedTinyInteger('const_type')->comment('类别:1入住缴费2续住缴费3结算离场');
$table->decimal('money', 10, 2)->default(0.00)->nullable()->comment('总金额'); $table->decimal('money', 10, 2)->default(0.00)->nullable()->comment('总金额');
$table->text('extends')->nullable()->comment('收费明细'); $table->text('extends')->nullable()->comment('收费明细');
$table->unsignedTinyInteger('state')->nullable()->default(0)->comment('清算状态');
$table->timestamp('start_at')->nullable()->comment('开始时间'); $table->timestamp('start_at')->nullable()->comment('开始时间');
$table->timestamp('end_at')->nullable()->comment('结束时间'); $table->timestamp('end_at')->nullable()->comment('结束时间');
$table->unsignedTinyInteger('change_lv')->nullable()->comment('是否变更护理等级'); $table->unsignedTinyInteger('change_lv')->nullable()->comment('是否变更护理等级');
$table->unsignedTinyInteger('old_lv')->nullable()->comment('老护理等级'); $table->unsignedTinyInteger('old_lv')->nullable()->comment('老护理等级');
$table->unsignedTinyInteger('new_lv')->nullable()->comment('新护理等级'); $table->unsignedTinyInteger('new_lv')->nullable()->comment('新护理等级');
$table->unsignedBigInteger('adminuser_id')->comment('操作人');
$table->timestamps(); $table->timestamps();
}); });
} }

View File

@ -13,6 +13,5 @@ class DatabaseSeeder extends Seeder
public function run(): void public function run(): void
{ {
$this->call(AdminMenuSeeder::class); $this->call(AdminMenuSeeder::class);
$this->call(KeywordSeeder::class);
} }
} }

View File

@ -22,13 +22,13 @@ class KeywordSeeder extends Seeder
$list = [ $list = [
['key' => 'cost_nope', 'name' => '费用项', 'value' => '', 'list' => [ ['key' => 'cost_nope', 'name' => '费用项', 'value' => '', 'list' => [
['key' => 'live_fee', 'name' => '入住费用项', 'type_key' => 'cost_nope', 'value' => '', 'list'=>[ ['key' => 'live_fee', 'name' => '入住费用项', 'type_key' => 'cost_nope', 'value' => '', 'list'=>[
['key' => 'live_base_fee', 'name' => '综合服务费', 'type_key' => 'live_fee', 'value' => ''], ['key' => 'live_base_fee', 'name' => '养老费', 'type_key' => 'live_fee', 'value' => ''],
['key' => 'physical', 'name' => '体检', 'type_key' => 'live_fee', 'value' => ''], ['key' => 'physical', 'name' => '体检', 'type_key' => 'live_fee', 'value' => ''],
['key' => 'heating', 'name' => '暖气费', 'type_key' => 'live_fee', 'value' => ''], ['key' => 'heating', 'name' => '暖气费', 'type_key' => 'live_fee', 'value' => ''],
['key' => 'bedding', 'name' => '床上用品', 'type_key' => 'live_fee', 'value' => ''], ['key' => 'bedding', 'name' => '床上用品', 'type_key' => 'live_fee', 'value' => ''],
]], ]],
['key' => 'continue_fee', 'name' => '续住费用项', 'type_key' => 'cost_nope', 'value' => '', 'list'=>[ ['key' => 'continue_fee', 'name' => '续住费用项', 'type_key' => 'cost_nope', 'value' => '', 'list'=>[
['key' => 'continue_base_fee', 'name' => '综合服务费', 'type_key' => 'continue_fee', 'value' => ''], ['key' => 'continue_base_fee', 'name' => '养老费', 'type_key' => 'continue_fee', 'value' => ''],
['key' => 'water_fee', 'name' => '水电费', 'type_key' => 'continue_fee', 'value' => ''], ['key' => 'water_fee', 'name' => '水电费', 'type_key' => 'continue_fee', 'value' => ''],
['key' => 'nurse_items', 'name' => '护理用品', 'type_key' => 'continue_fee', 'value' => ''], ['key' => 'nurse_items', 'name' => '护理用品', 'type_key' => 'continue_fee', 'value' => ''],
['key' => 'check_up', 'name' => '血糖检查', 'type_key' => 'continue_fee', 'value' => ''], ['key' => 'check_up', 'name' => '血糖检查', 'type_key' => 'continue_fee', 'value' => ''],

View File

@ -1,100 +0,0 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8"/>
<title>打印</title>
<style>
@media print {
@page {
margin: 0;
}
body {
margin: 0.8cm;
}
}
body {
font-family: "宋体", sans-serif;
}
.container {
/* width: 800px; */
text-align: center;
}
.tag {
overflow: hidden; /* 清除浮动 */
}
span{
display: block;
float: left;
width: 33.333%;
text-align: left;
}
span.left {
text-align: left;
}
span.right {
float: right;
text-align: left;
}
table.print-table {
width: 100%;
border-collapse:collapse;
border: 1px solid black;
margin: 0 auto;
table-layout: fixed;
}
td, th{
line-height: 30px;
border: 1px solid black;
}
</style>
</head>
<body>
<button type="button" class="print-hide" onclick="this.style.display='none';window.print();this.style.display='inline';">打印</button>
<div class="container" id="print-content">
<p style="font-size:25px;margin-top: 10px">重庆市巴南区狮子山老年公寓收据</p>
<p class="tag" style="font-size:20px;">
<span class="left">客户姓名 {{$name}}</span>
<span class="middle">日期 {{$time}}</span>
<span class="right">单据编号 {{$sn}}</span>
</p>
<table class="print-table">
<tr>
<th style="width: 5%;">序号</th>
<th style="width: 25%;">费用类别</th>
<th style="width: 30%;">起止日期</th>
<th style="width: 15%;">金额(元)</th>
<th style="width: 25%;">备注</th>
</tr>
@foreach($list as $item)
<tr>
<td>{{$loop->iteration}}</td>
<td>{{$item['name']}}-{{$item['fee_name']}}</td>
<td>@if(empty($item['name']))-@else<input type="text" style="border:none" value="{{$timeZone}}">@endif</td>
<td>{{$item['fee_value']}}</td>
<td>
<input type="text" style="border:none">
</td>
</tr>
@endforeach
<tr>
<td colspan="3" style=" text-align: left;">合计大写:{{$bigTotal}}</td>
<td >{{$total}}</td>
<td ></td>
</tr>
</table>
<p class="tag" style="font-size:20px;">
<span class="left">单位盖章 </span>
<span class="middle"> </span>
<span class="right">收款人 {{$adminName}}</span>
</p>
<p class="tag" style="font-size:20px;">
<span class="left">白联:存根</span>
<span class="middle">红联:客户</span>
<span class="right">黄联:记账</span>
</p>
</div>
</body>
<script>
</script>
</html>

View File

@ -1,6 +1,5 @@
<?php <?php
use App\Http\Controllers\PrintController;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
/* /*
@ -17,5 +16,3 @@ use Illuminate\Support\Facades\Route;
Route::get('/', function () { Route::get('/', function () {
return view('welcome'); return view('welcome');
}); });
Route::get('/print-const-flow', [PrintController::class, 'showConst']);