upMerge branch 'master' of 210.16.180.245:/data/git/tiantian2

master
weizong song 2 years ago
commit 8e60e94fa1

@ -12,28 +12,28 @@ class AskSubmitForm extends Form
public function buildForm()
{
$this->add("project_id", Field::SELECT, ["label" => "所属项目/医院", "rules" => "required", "empty_value" => "请选择"]);
$this->add("visit", Field::TEXT, ["label" => "拜访人员", "rules" => "required"]);
// $this->add("visit", Field::TEXT, ["label" => "拜访人员", "rules" => "required"]);
$this->add("date", Field::DATE, ["label" => "考核日期", "rules" => "required"]);
$this->add("department", Field::TEXT, ["label" => "科室", "rules" => "required"]);
$this->add("ask[0]", Field::NUMBER, ["label" => AskSubmit::$askList[0],
$this->add("department", Field::TEXT, ["label" => "就诊科室", "rules" => "required"]);
$this->add("ask[0]", Field::SELECT, ["label" => AskSubmit::$askList[0],
"rules" => "required",
'attr' => ['placeholder' => '18-20分满意15-17分较满意14分及以下不满意']
"choices" => ['20' => '1820', '17' => '1715', '14' => '14以下']
]);
$this->add("ask[1]", Field::NUMBER, ["label" => AskSubmit::$askList[1],
$this->add("ask[1]", Field::SELECT, ["label" => AskSubmit::$askList[1],
"rules" => "required",
'attr' => ['placeholder' => '18-20分满意15-17分较满意14分及以下不满意']
"choices" => ['20' => '1820', '17' => '1715', '14' => '14以下']
]);
$this->add("ask[2]", Field::NUMBER, ["label" => AskSubmit::$askList[2],
$this->add("ask[2]", Field::SELECT, ["label" => AskSubmit::$askList[2],
"rules" => "required",
'attr' => ['placeholder' => '18-20分满意15-17分较满意14分及以下不满意']
"choices" => ['20' => '1820', '17' => '1715', '14' => '14以下']
]);
$this->add("ask[3]", Field::NUMBER, ["label" => AskSubmit::$askList[3],
$this->add("ask[3]", Field::SELECT, ["label" => AskSubmit::$askList[3],
"rules" => "required",
'attr' => ['placeholder' => '18-20分满意15-17分较满意14分及以下不满意']
"choices" => ['20' => '1820', '17' => '1715', '14' => '14以下']
]);
$this->add("ask[4]", Field::NUMBER, ["label" => AskSubmit::$askList[4],
$this->add("ask[4]", Field::SELECT, ["label" => AskSubmit::$askList[4],
"rules" => "required",
'attr' => ['placeholder' => '18-20分满意15-17分较满意14分及以下不满意']
"choices" => ['20' => '1820', '17' => '1715', '14' => '14以下']
]);
$this->add("tip", Field::TEXT, ["label" => "建议"]);
$this->add('buttons', 'buttongroup', ["splitted" => true, "buttons" => [

@ -0,0 +1,68 @@
<?php
namespace App\Forms;
use App\Models\AskSubmit;
use App\Models\Project;
use Kris\LaravelFormBuilder\Form;
use Kris\LaravelFormBuilder\Field;
class AskSubmitScForm extends Form
{
public function buildForm()
{
$this->add("name", Field::TEXT, ["label" => "名字", "rules" => "required"]);
$this->add("mobile", Field::TEXT, ["label" => "电话", "rules" => "required"]);
$this->add("project_id", Field::SELECT, ["label" => "所属项目/医院", "rules" => "required", "empty_value" => "请选择"]);
// $this->add("visit", Field::TEXT, ["label" => "拜访人员", "rules" => "required"]);
$this->add("date", Field::DATE, ["label" => "考核日期", "rules" => "required"]);
$this->add("department", Field::TEXT, ["label" => "就诊科室", "rules" => "required"]);
$this->add("ask[0]", Field::SELECT, ["label" => AskSubmit::$askListSc[0],
"rules" => "required",
"choices" => ['10' => '非常满意', '9' => '满意', '7' => '一般','5'=>'不满意']
]);
$this->add("ask[1]", Field::SELECT, ["label" => AskSubmit::$askListSc[1],
"rules" => "required",
"choices" => ['10' => '非常满意', '9' => '满意', '7' => '一般','5'=>'不满意']
]);
$this->add("ask[2]", Field::SELECT, ["label" => AskSubmit::$askListSc[2],
"rules" => "required",
"choices" => ['10' => '非常满意', '9' => '满意', '7' => '一般','5'=>'不满意']
]);
$this->add("ask[3]", Field::SELECT, ["label" => AskSubmit::$askListSc[3],
"rules" => "required",
"choices" => ['10' => '非常满意', '9' => '满意', '7' => '一般','5'=>'不满意']
]);
$this->add("ask[4]", Field::SELECT, ["label" => AskSubmit::$askListSc[4],
"rules" => "required",
"choices" => ['10' => '非常满意', '9' => '满意', '7' => '一般','5'=>'不满意']
]);
$this->add("ask[5]", Field::SELECT, ["label" => AskSubmit::$askListSc[5],
"rules" => "required",
"choices" => ['10' => '非常满意', '9' => '满意', '7' => '一般','5'=>'不满意']
]);
$this->add("ask[6]", Field::SELECT, ["label" => AskSubmit::$askListSc[6],
"rules" => "required",
"choices" => ['10' => '非常满意', '9' => '满意', '7' => '一般','5'=>'不满意']
]);
$this->add("ask[7]", Field::SELECT, ["label" => AskSubmit::$askListSc[7],
"rules" => "required",
"choices" => ['10' => '非常满意', '9' => '满意', '7' => '一般','5'=>'不满意']
]);
$this->add("ask[8]", Field::SELECT, ["label" => AskSubmit::$askListSc[8],
"rules" => "required",
"choices" => ['10' => '非常满意', '9' => '满意', '7' => '一般','5'=>'不满意']
]);
$this->add("ask[9]", Field::SELECT, ["label" => AskSubmit::$askListSc[9],
"rules" => "required",
"choices" => ['10' => '非常满意', '9' => '满意', '7' => '一般','5'=>'不满意']
]);
$this->add("tip", Field::TEXT, ["label" => "建议"]);
$this->add('buttons', 'buttongroup', ["splitted" => true, "buttons" => [
["label" => "保存", "attr" => ["class" => "btn btn-primary mr-1", "type" => "submit"]],
["label" => "返回", "attr" => ["class" => "btn btn-light btn-back", "type" => "button"]]
]]);
}
}

@ -2,11 +2,21 @@
namespace App\Http\Controllers\Admin;
use App\Models\AdminAreaLink;
use App\Models\Area;
use App\Models\Bed;
use App\Models\FactorItems;
use App\Models\OrderItems;
use App\Models\Orders;
use App\Models\Paramedic;
use App\Models\Product;
use App\Models\ProductItems;
use App\Models\Project;
use App\Models\Refund;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Spatie\Permission\Models\Role;
class HomeController extends CommonController
{
@ -14,21 +24,133 @@ class HomeController extends CommonController
public function index()
{
// $month = date("Y-m");
// $order_items = OrderItems::whereHas("order")->whereRaw("DATE_FORMAT(`service_date`,'%Y-%m') = '{$month}'")
// ->where("total", ">", 0)->get();
// $order_items_count = $order_items->count();
// $total = $order_items->sum("total");
// $orders_count = $order_items->groupBy("order_id")->count();
//
// foreach ($order_items as &$item) {
// $item = $item->calculateFee();
// }
// $total_paramedic = $order_items->sum("paramedic_total");
// $fee = $total - $total_paramedic;
// $laravel_duration = microtime(true) - LARAVEL_START;
$project_id = request()->project_id;
$projects = Project::get();
if (empty($project_id)) {
$project_id = Project::first()->id;
}
$counts = [];
// 订单总数
$counts["orders_all"] = (new Orders())->ofProject($project_id)->count();
// 待处理
$counts["orders_pending"] = (new Orders())->ofProject($project_id)->whereIn("status", [Orders::STATUS_UNCONFIRMED, Orders::STATUS_UNASSIGNED])->count();
// 在陪患者
$counts["orders_ongoing"] = (new Orders())->ofProject($project_id)->where("status", Orders::STATUS_ONGOING)->count();
// 日派工
$counts["orders_ongoing_in_today"] = (new Orders())->ofProject($project_id)
->where("status", Orders::STATUS_ONGOING)
->whereRaw("DATEDIFF(`from_date`,now()) = 0")
->count();
// 已完成
$counts["orders_finished"] = (new Orders())->ofProject($project_id)->where("status", Orders::STATUS_FINISHED)->count();
// 日结算
$counts["orders_finished_in_today"] = (new Orders())->ofProject($project_id)
->where("status", Orders::STATUS_FINISHED)
->whereRaw("DATEDIFF(`to_date`,now()) = 0")
->count();
// 护工数量
$counts["paramedics"] = (new Paramedic())->ofProject($project_id)->count();
// 今日应收
$counts["bill_today"] = (new OrderItems())->where("service_date", date("Y-m-d"))->whereHas("order", function ($query) use ($project_id) {
$query->ofProject($project_id);
})->sum("total");
// 今日退款
$counts["refund_today"] = (new Refund())->whereNotNull("paid_at")->whereRaw("DATEDIFF(`paid_at`,now()) = 0")->whereHas("order", function ($query) use ($project_id) {
$query->ofProject($project_id);
})->sum("money");
// 在岗护工
$counts["paramedic_has_order"] = (new Paramedic())->ofProject($project_id)->whereHas("orders", function ($query) {
$query->where("status", Orders::STATUS_ONGOING);
})->count();
// 各产品占比
$lies = [];
$product = Product::where('project_id', $project_id)->first();
if ($product) {
$productItem = ProductItems::where('product_id', $product->id)->get();
$factor = FactorItems::where('factor_id', $product->statistic_factor_id)->get();
$order_total = OrderItems::whereIn('product_item_id', $productItem->pluck('id'))->sum('total');
$lies = Cache::remember('cache_lies', 24 * 60 * 60, function () use ($productItem, $factor, $order_total) {
return $this->getLies($productItem, $factor, $order_total);
});
}
$allMontn = [
date("Y") . '-01',
date("Y") . '-02',
date("Y") . '-03',
date("Y") . '-04',
date("Y") . '-05',
date("Y") . '-06',
date("Y") . '-07',
date("Y") . '-08',
date("Y") . '-09',
date("Y") . '-10',
date("Y") . '-11',
date("Y") . '-12',
];
// 销售额
$saleList = [];
foreach ($allMontn as $month) {
$saleList[] = [
'month' => $month,
'total' => (new OrderItems())->where("service_date", 'like', $month . '%')->whereHas("order", function ($query) use ($project_id) {
$query->ofProject($project_id);
})->sum("total")
];
}
// 订单量
$orderList = [];
foreach ($allMontn as $month) {
$orderList[] = [
'month' => $month,
'total' => (new Orders())->ofProject($project_id)->where('created_at', 'like', $month . '%')->count()
];
}
// 判断是否有权限
$userId = auth()->id();
$roleId = Role::where('name', 'like', '%首页统计%')->where('guard_name', 'admin')->value('id');
$tongji = DB::table('model_has_roles')->where('role_id', $roleId)
->where('model_type', 'App\Admin')->where('model_id', $userId)->count();
// 判断是否有大屏幕权限
$roleIdBydp = Role::where('name', 'like', '%大屏统计%')->where('guard_name', 'admin')->value('id');
$dp = DB::table('model_has_roles')->where('role_id', $roleIdBydp)
->where('model_type', 'App\Admin')->where('model_id', $userId)->count();
return view($this->bladePath . ".home");
if (is_mobile() || empty($tongji)) {
return view($this->bladePath . ".mobile_home");
} else {
$jump_dp = 0;
if ($dp) $jump_dp = 1;
return view($this->bladePath . ".home", compact('jump_dp', 'project_id', 'projects', 'counts', 'lies', 'saleList', 'orderList'));
}
}
/**
* 获取动态列
*/
public function getLies($productItem, $factor, $order_total)
{
$list = [];
foreach ($productItem as $item) {
foreach ($factor as $factor_item) {
$total = OrderItems::where('product_item_id', $item->id)
->whereRaw("factors like '%\"factor_item_id\": $factor_item->id%'")
->sum('total');
$list [] = [
'name' => $item->price + $factor_item->price . '元/天',
'total_price' => $item->price + $factor_item->price,
'product_item_id' => $item->id,
'factor_item_id' => $factor_item->id,
'total' => $total,
'product_item_name' => $item->name,
'rate' => round($total / $order_total, 2)
];
}
}
return $list;
}

@ -12,6 +12,7 @@ use App\Admin;
use App\Events\ProjectSaved;
use App\Exports\CommonExport;
use App\Forms\AskSubmitForm;
use App\Forms\AskSubmitScForm;
use App\Forms\ProjectForm;
use App\Models\AdminAreaLink;
use App\Models\Area;
@ -23,6 +24,7 @@ use App\Models\Project;
use App\Models\Room;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Kris\LaravelFormBuilder\Field;
use Kris\LaravelFormBuilder\FormBuilder;
use Maatwebsite\Excel\Facades\Excel;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
@ -298,8 +300,9 @@ class ProjectController extends CommonController
{
$is_export = \request('export', 0);
$userId = auth()->id();
$project_id = \request('project_id', 0);
$projects = (new ProjectController())->_checkProjects();
$project_id = \request('project_id', ($projects[0]->id) ?? '');
// 判断是否护士长
$roleId = Role::where('name', 'like', '%护士长%')->where('guard_name', 'admin')->value('id');
@ -332,14 +335,19 @@ class ProjectController extends CommonController
$sheet->getColumnDimension('E')->setWidth(20);
$sheet->getColumnDimension('F')->setWidth(20);
$count = count($data); //计算有多少条数据
$count = count($data); //计算有多少条数据1
for ($i = 2; $i <= $count + 1; $i++) {
$content = '';
foreach ($data[$i - 2]['content'] as $item) {
$content .= $item['ask'] . ':' . $item['score'] . "\n";
}
if ($data[$i - 2]['mobile']) {
$name = $data[$i - 2]['name'] . "(" . $data[$i - 2]['mobile'] . ")";
} else {
$name = $data[$i - 2]['admin']['name'];
}
$sheet->setCellValue('A' . $i, $data[$i - 2]['date']);
$sheet->setCellValue('B' . $i, $data[$i - 2]['admin']['name']);
$sheet->setCellValue('B' . $i, $name);
$sheet->setCellValue('C' . $i, $data[$i - 2]['project']['name']);
$sheet->setCellValue('D' . $i, $content);
$sheet->setCellValue('E' . $i, $data[$i - 2]['tip']);
@ -352,7 +360,8 @@ class ProjectController extends CommonController
$writer->save('php://output');
exit;
}
$data = $data->paginate(10);
$data = $data->orderBy('id', 'desc')->paginate(10);
$data = $data->appends(['project_id' => $project_id]);
return view($this->bladePath . ".asksubmit_index", compact("data", "projects", "project_id"));
}
@ -360,28 +369,42 @@ class ProjectController extends CommonController
public function askSubmitCreate(FormBuilder $formBuilder)
{
$project_ids = auth()->user()->project_ids;
$project_id = \request('project_id');
if ($project_ids) {
$project_ids = explode(',', $project_ids);
}
$form = $formBuilder->create(AskSubmitForm::class, [
if ($project_id == 7) {
$askSubmitForm = AskSubmitScForm::class;
} else {
$askSubmitForm = AskSubmitForm::class;
}
$form = $formBuilder->create($askSubmitForm, [
"method" => "POST",
"id" => "fm",
"url" => url($this->urlPrefix . "/asksubmit_store")
"url" => url($this->urlPrefix . "/asksubmit_store?project_id=" . $project_id)
]);
$choices = (new Project())->where(function ($query) use ($project_ids) {
if ($project_ids) {
$query->whereIn("id", $project_ids);
}
})->get()->pluck("name", "id");
$form->modify("project_id", "select", [
"choices" => (new Project())->where(function ($query) use ($project_ids) {
if ($project_ids) {
$query->whereIn("id", $project_ids);
}
})->get()->pluck("name", "id")->toArray()
"choices" => $choices->toArray(),
"selected" => $choices->keys()->first()
]);
$form->modify('project_id', Field::HIDDEN, ["default_value" => $project_id]);
$form->modify('date', Field::DATE, ['default_value' => date('Y-m-d')]);
return view($this->bladePath . ".asksubmit_create", compact("form"));
}
public function askSubmitStore(Request $request)
{
$all = \request()->all();
$project_id = \request('project_id');
$userId = auth()->user()->id;
// 一个月只能提交一次
$has = AskSubmit::where('admin_id', $userId)
@ -391,9 +414,13 @@ class ProjectController extends CommonController
if ($has) return $this->error("每个月只能提交一次");
$content = [];
$socre = 0;
$askList = AskSubmit::$askList;
if ($project_id == 7) {
$askList = AskSubmit::$askListSc;
}
foreach ($all['ask'] as $key => $item) {
$content[] = [
'ask' => AskSubmit::$askList[$key],
'ask' => $askList[$key],
'score' => $item
];
$socre += $item;
@ -409,7 +436,14 @@ class ProjectController extends CommonController
public function askSubmitEdit(Request $request, FormBuilder $formBuilder)
{
$vo = AskSubmit::find($request->id);
$form = $formBuilder->create(AskSubmitForm::class, [
if ($vo->project_id == 7) {
$askSubmitForm = AskSubmitScForm::class;
} else {
$askSubmitForm = AskSubmitForm::class;
}
$form = $formBuilder->create($askSubmitForm, [
"method" => "POST",
"id" => "fm",
"url" => url($this->urlPrefix . "/asksubmit_update/" . $vo->id),
@ -427,6 +461,7 @@ class ProjectController extends CommonController
}
})->get()->pluck("name", "id")->toArray()
]);
$form->modify('project_id', Field::HIDDEN, ["default_value" => $vo->project_id]);
$form->add("_previous", "hidden", ["value" => (url()->previous())]);
return view($this->bladePath . ".asksubmit_create", compact("form"));
}
@ -473,4 +508,59 @@ class ProjectController extends CommonController
}
}
public function askSubmitCreateV2(FormBuilder $formBuilder)
{
$project_id = \request('project_id');
if ($project_id == 7) {
$askSubmitForm = AskSubmitScForm::class;
} else {
$askSubmitForm = AskSubmitForm::class;
}
$form = $formBuilder->create($askSubmitForm, [
"method" => "POST",
"id" => "fm",
"url" => url($this->urlPrefix . "/asksubmit_store_v2?project_id=" . $project_id)
]);
$choices = (new Project())->get()->pluck("name", "id");
$form->modify("project_id", "select", [
"choices" => $choices->toArray(),
"selected" => $choices->keys()->first()
]);
$form->modify('project_id', Field::HIDDEN, ["default_value" => $project_id]);
$form->modify('date', Field::DATE, ['default_value' => date('Y-m-d')]);
return view($this->bladePath . ".asksubmit_create_v2", compact("form"));
}
public function askSubmitStoreV2(Request $request)
{
$all = \request()->all();
if (!isset($all['mobile']) || empty($all['mobile'])) {
return $this->error("手机号不存在", '');
}
$project_id = \request('project_id');
// 一个月只能提交一次
$has = AskSubmit::where('project_id', $all['project_id'])
->where('mobile', $all['mobile'])
->first();
if ($has) return $this->error("请勿重复提交");
$content = [];
$socre = 0;
$askList = AskSubmit::$askList;
if ($project_id == 7) {
$askList = AskSubmit::$askListSc;
}
foreach ($all['ask'] as $key => $item) {
$content[] = [
'ask' => $askList[$key],
'score' => $item
];
$socre += $item;
}
$all['score'] = $socre;
$all['content'] = $content;
$model = AskSubmit::create($all);
return $this->success("新增成功", '', $model);
}
}

@ -28,6 +28,7 @@ use App\Models\Refund;
use App\Scopes\AdminProjectScope;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
@ -266,6 +267,7 @@ class StatisticsController extends CommonController
$query->where("project_id", $project_id);
})
->get();
$recharges_sum = $recharges->sum('money');
$refunds = Refund::whereNotNull("paid_at")
->where(function ($query) use ($hushizhang, $orderIds) {
@ -278,8 +280,8 @@ class StatisticsController extends CommonController
$query->where("project_id", $project_id);
})
->get();
return view($this->bladePath . ".finance", compact("recharges", "refunds", "projects", "project_id", "months", "month"));
$refunds_sum = $refunds->sum('money');
return view($this->bladePath . ".finance", compact("recharges_sum", "refunds_sum", "recharges", "refunds", "projects", "project_id", "months", "month"));
}
public function memberBalanceByDate(Request $request)
@ -419,12 +421,12 @@ class StatisticsController extends CommonController
}
// 获取所有列
$lie = [];
if(isset($data[0]->lies)){
if (isset($data[0]->lies)) {
$lie = array_column($data[0]->lies, 'name');
}
$months = $this->_getMonths();
return view($this->bladePath . ".huli", compact("sumOrderTotal","data", "month", "lie", "projects", "project_id"));
return view($this->bladePath . ".huli", compact("sumOrderTotal", "data", "month", "lie", "projects", "project_id"));
}
/**
@ -526,4 +528,78 @@ class StatisticsController extends CommonController
return view($this->bladePath . ".bed", compact("area", "orderTotal", "totalBed", "project", "project_id", "month", "projects"));
}
/**
* 收入统计
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function income()
{
$is_export = \request('is_export', 0);
$projects = $this->_checkProjects();
if (!$projects->count()) {
return $this->error($this->noProjects);
}
$project_id = request()->project_id ?? $projects->first()->id;
$project = Project::find($project_id);
$month = request()->month ?? date("Y-m");
$months = $this->_getMonths();
// 当月天数
$days = date('t', strtotime($month));
$areaList = Area::withCount('beds')->where('project_id', $project_id)->get();
// 合计
$total['order_total'] = $total['shouxufei'] = $total['zengshishui'] = $total['shijishouru'] = $total['guanlifei'] = 0;
$area = [];
foreach ($areaList as $item) {
$beds = Bed::where('area_id', $item->id)->where('project_id', $project_id)->get();
// 订单总数
$orders = Orders::where('project_id', $project_id)
// ->where('created_at', 'like', '%' . $month . '%')
->whereIn('bed_id', $beds->pluck('id'))
->get();
$orderTotal = Balance::where('created_at', 'like', '%' . $month . '%')
->where('belongs_type', 'App\Models\Recharge')
->whereIn('order_id', $orders->pluck('id'))
->sum("money");
$item->order_total = $orderTotal;
$item->shouxufei = round($orderTotal * 0.006, 2);
$item->zengshishui = round($orderTotal * 0.06, 2);
$item->shijishouru = round($orderTotal - $item->shouxufei - $item->zengshishui, 2);
$item->guanlifei = round($item->shijishouru * 0.06, 2);
if (!empty($item->order_total)) {
$area[] = $item;
}
// 合计
$total['order_total'] += $item->order_total;
$total['shouxufei'] += $item->shouxufei;
$total['zengshishui'] += $item->zengshishui;
$total['shijishouru'] += $item->shijishouru;
$total['guanlifei'] += $item->guanlifei;
}
// 获取所有订单数据
// $beds = Bed::whereIn('area_id', $areaList->pluck('id'))->where('project_id', $project_id)->get();
// // 订单总数
// $allOrderTotal = Orders::where('project_id', $project_id)
// ->where('created_at', 'like', '%' . $month . '%')
// ->whereIn('bed_id', $beds->pluck('id'))
// ->get();
$refund['order_total'] = abs(Balance::where('created_at', 'like', '%' . $month . '%')
->where('belongs_type', 'App\Models\Refund')
->whereHas("order", function ($query) use ($project_id) {
$query->where("project_id", $project_id);
})->sum("money"));
$refund['shijishouru'] = $refund['order_total'];
$refund['guanlifei'] = round($refund['order_total'] * 0.06, 2);
// 总计
$zongji['order_total'] = $total['order_total'] - $refund['order_total'];
$zongji['shouxufei'] = $total['shouxufei'] * 2;
$zongji['zengshishui'] = $total['zengshishui'] * 2;
$zongji['shijishouru'] = $total['shijishouru'] - $refund['shijishouru'];
$zongji['guanlifei'] = $total['guanlifei'] - $refund['guanlifei'];
$admin = Auth::guard("admin")->user();
return view($this->bladePath . ".income", compact("admin", "zongji", "refund", "total", "area", "project", "project_id", "month", "projects"));
}
}

@ -8,7 +8,7 @@ use App\Admin;
class AskSubmit extends SoftDeletesModel
{
protected $table = "ask_submits";
protected $casts = ['content'=>'json'];
protected $casts = ['content' => 'json'];
protected $guarded = ['id'];
public static $askList = [
@ -19,14 +19,27 @@ class AskSubmit extends SoftDeletesModel
"公司管理人员对陪护工作管理及持续改进。"
];
public static $askListSc = [
"仪表及态度:态度良好、服装整洁统一、佩证上岗",
"工作能力:工作人员具备胜任岗位工作的能力(沟通能力、工作技能、应知应会等)",
"安全措施:细心、耐心照顾患者,协助护士为患者翻身等护理,做好预防患者跌倒、坠床等安全工作",
"行为规范:不参与医疗护理任何诊疗工作;不发表涉及医院相关事件的任何言论。保护患者的隐私,不向他人泄露患者任何信息;不聚集、不串岗、不大声说话等",
"个人卫生与防护:规范洗手;做好院感防护",
"保持床单位整洁,物品摆放整齐;做好医废、生活垃圾、废品及医用织物等按规定存放",
"突发事件与消预防安全:熟悉紧急突发事件的处理及预防措施;规范用电、用水,掌握消防安全应知应会。不抽烟并积极劝阻他人吸烟",
"规范收费:不向患者(家属)索取金钱礼券、实物等或从事任何经营活动等",
"团结协作,服从科室管理,保持良好沟通,不得拉帮结派等",
"管理人员能主动到科室巡查、沟通,对科室提出的问题能积极处理"
];
public function admin()
{
return $this->hasOne(Admin::class,'id','admin_id');
return $this->hasOne(Admin::class, 'id', 'admin_id');
}
public function project()
{
return $this->hasOne(Project::class,'id','project_id');
return $this->hasOne(Project::class, 'id', 'project_id');
}

@ -8,6 +8,7 @@ use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use OwenIt\Auditing\Contracts\Auditable;
use Spatie\Permission\Models\Role;
class CommonModel extends Model
{
@ -132,4 +133,19 @@ class CommonModel extends Model
$router->post("{$prefix}/update/{id?}", "{$controller}@update");
$router->post("{$prefix}/delete", "{$controller}@delete");
}
/**
* 判断是否有导出权限
*/
public static function checkExport()
{
$userId = auth()->id();
$roleId = Role::where('name', 'like', '%导出%')->where('guard_name', 'admin')->value('id');
return DB::table('model_has_roles')
->where('role_id', $roleId)
->where('model_type', 'App\Admin')
->where('model_id', $userId)
->count();
}
}

@ -399,12 +399,12 @@ class Orders extends SoftDeletesModel
$product = (new Project())->find($bed->project_id)->products->first();
foreach ($paramedics as $paramedic) {
$product_item = ProductItems::where("product_id", $product->id)->where("patient_quantity", "<=", $paramedic->ongoing_orders_count + 1)->orderBy("patient_quantity", "desc")->first();
$_product_item_price = $product_item->price ? $product_item->price : 0;
$_paramedic_price = $paramedic->levelInProject->price ? $paramedic->levelInProject->price : 0;
$_product_item_price = $product_item->price ?? 0;
$_paramedic_price = $paramedic->levelInProject->price ?? 0;
$price = $_product_item_price + $_paramedic_price;
foreach ($factors as $factor) {
$_factor_price = $factor["price"] ? $factor["price"] : 0;
$_factor_price = $factor["price"] ?? 0;
$price += $_factor_price;
}
$paramedic->price = $price;

3996
composer.lock generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateAskSubmitsAddMobile extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table("ask_submits", function (Blueprint $table) {
$table->string('name')->nullable();
$table->string('mobile')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

File diff suppressed because one or more lines are too long

@ -6,70 +6,583 @@
@push("header")
<style>
.content-page {
height: 100%;
padding-bottom: 62px;
overflow-y: scroll;
}
.footer {
background: #fff;
}
.toll-free-box i {
transform: none !important;
left: 1rem;
bottom: .4rem;
}
.static-container {
display: flex;
flex-wrap: wrap;
}
.static-container > .card1 {
margin-bottom: 20px;
}
.static-container > .card1 + .card1 {
margin-left: 20px;
}
.static-container > .card1:nth-child(1) {
flex-basis: 36%;
}
.static-container > .card1:nth-child(2) {
flex-basis: calc(64% - 20px);
}
.static-container > .card1:nth-child(3) {
flex-basis: 100%;
height: 300px;
margin-left: 0 !important;
}
.static-container > .card1:nth-child(3) .card1-title > div::before {
display: none;
}
.card1 {
background: #fff;
border-radius: 4px;
font-size: 14px;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
overflow: hidden;
position: relative;
}
.card1::before {
content: "";
height: 28px;
width: 28px;
border-radius: 100%;
background: #78d3a9;
opacity: .25;
position: absolute;
bottom: -14px;
right: 12px;
}
.card1::after {
content: "";
height: 42px;
width: 42px;
border-radius: 100%;
background: #78d3a9;
opacity: .25;
position: absolute;
bottom: -4px;
right: -14px;
}
.card1-title {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #e8eaec;
padding: 12px 14px;
line-height: 1;
}
.card1-title > div:nth-child(1) {
color: #333;
position: relative;
}
.card1-title > div:nth-child(1)::before {
content: '';
height: 14px;
width: 140px;
background: radial-gradient(12px 9px at 10px 40%, #7ed3b155 20%, #0000 70%) 0 0/12px 12px no-repeat,
radial-gradient(120px 9px at 10px 40%, #7ed3b155 20%, #0000 70%) 12px 0/130px 12px no-repeat;
position: absolute;
bottom: -6px;
left: -6px;
}
.card1-title__arrow {
padding-right: 20px;
cursor: pointer;
position: relative;
}
.card1-title__arrow::before {
content: "\F142";
display: inline-block;
font-family: 'Material Design Icons';
text-rendering: auto;
font-size: 1.1rem;
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
position: absolute;
top: 0;
bottom: 0;
right: 0;
}
.card1-body {
padding: 7px;
}
.card1-body .static1, .card1-body .static2 {
display: flex;
flex-wrap: wrap;
align-items: center;
margin-top: 20px;
}
.static1 .static1__item, .static2 .static2__item {
margin: 14px;
padding-left: 20px;
font-size: 14px;
}
.static1 .static1__item .static1__item--label, .static2 .static2__item .static2__item--label {
color: #666;
position: relative;
}
.static1 .static1__item .static1__item--label::before {
content: "";
width: 4px;
height: 78%;
background: #73cdb9;
border-radius: 4px;
transform: translateY(11%);
position: absolute;
left: -10px;
top: 0;
}
.static2 .static2__item--label {
padding-left: 4px;
}
.static2 .static2__item .static2__item--label::before {
content: "";
width: 8px;
height: 8px;
background: #f2b34e;
border-radius: 100%;
transform: translateY(-50%);
position: absolute;
left: -10px;
top: 50%;
}
.static2 .static2__item:nth-child(2) .static2__item--label::before {
background: #548fee;
}
.static2 .static2__item:nth-child(3) .static2__item--label::before {
background: #78d3a9;
}
.static1 .static1__item .static1__item--value, .static2 .static2__item .static2__item--value {
font-weight: 600;
color: #333;
line-height: 2;
font-size: 15px;
}
.static2 .static2__item .static2__item--value {
text-align: center;
}
.card1-body:has(#pie-chart) {
height: calc(100% - 39px);
}
#pie-chart {
height: 100%;
width: 100%;
}
#bar-chart {
height: 100%;
width: 100%;
}
.type-switch {
display: flex;
}
.type-switch .type-switch__item {
padding: 0 20px;
position: relative;
}
.type-switch .type-switch__item > input {
opacity: 0;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.type-switch .type-switch__item:has(input:checked) .text {
color: #609ff9;
position: relative;
}
.type-switch .type-switch__item:has(input:checked) .text::after {
content: "";
width: 100%;
height: 4px;
background: #609ff9;
position: absolute;
left: 0;
bottom: -12px;
}
.hospital-select:focus {
outline: none;
}
.card1-body:has(#bar-chart) {
height: calc(100% - 39px);
}
.hospital-select {
padding: 0 6px;
border: none;
height: 34px;
background: #7fd4b0;
color: #fff;
width: 150px;
position: absolute;
top: 20px;
right: 12px;
}
</style>
@endpush
@section("content")
{{-- <div class="row">--}}
{{-- <div class="col-lg-3">--}}
{{-- <div class="card text-white bg-info overflow-hidden">--}}
{{-- <div class="card-body p-2">--}}
{{-- <div class="toll-free-box">--}}
{{-- <h4 class="text-right pr-2">--}}
{{-- <i class="mdi mdi-bed-empty"></i>--}}
{{-- <div class="font-12 font-weight-normal pb-1">本月护理人天数/订单数</div>--}}
{{-- {{ $order_items_count }} / {{ $orders_count }}--}}
{{-- </h4>--}}
{{-- </div>--}}
{{-- </div> <!-- end card-body-->--}}
{{-- </div>--}}
{{-- </div> <!-- end col-->--}}
{{-- <div class="col-lg-3">--}}
{{-- <div class="card text-white bg-warning overflow-hidden">--}}
{{-- <div class="card-body p-2">--}}
{{-- <div class="toll-free-box">--}}
{{-- <h4 class="text-right pr-2">--}}
{{-- <i class="mdi mdi-currency-cny"></i>--}}
{{-- <div class="font-12 font-weight-normal pb-1">本月应扣款</div>--}}
{{-- {{ $total }}--}}
{{-- </h4>--}}
{{-- </div>--}}
{{-- </div> <!-- end card-body-->--}}
{{-- </div>--}}
{{-- </div> <!-- end col-->--}}
{{-- <div class="col-lg-3">--}}
{{-- <div class="card text-white bg-primary overflow-hidden">--}}
{{-- <div class="card-body p-2">--}}
{{-- <div class="toll-free-box">--}}
{{-- <h4 class="text-right pr-2">--}}
{{-- <i class="mdi mdi-account-group"></i>--}}
{{-- <div class="font-12 font-weight-normal pb-1">本月应发护工酬劳</div>--}}
{{-- {{ $total_paramedic }}--}}
{{-- </h4>--}}
{{-- </div>--}}
{{-- </div> <!-- end card-body-->--}}
{{-- </div>--}}
{{-- </div> <!-- end col-->--}}
{{-- <div class="col-lg-3">--}}
{{-- <div class="card text-white bg-success overflow-hidden">--}}
{{-- <div class="card-body p-2">--}}
{{-- <div class="toll-free-box">--}}
{{-- <h4 class="text-right pr-2">--}}
{{-- <i class="mdi mdi-pocket"></i>--}}
{{-- <div class="font-12 font-weight-normal pb-1">本月管理费</div>--}}
{{-- {{ $fee }}--}}
{{-- </h4>--}}
{{-- </div>--}}
{{-- </div> <!-- end card-body-->--}}
{{-- </div>--}}
{{-- </div> <!-- end col-->--}}
{{-- </div>--}}
<select class="hospital-select" name="hospital-select">
@foreach($projects as $project)
<option
value="{{$project->id}}" @if(request()->project_id === $project->id){{ "selected" }}@endif>{{$project->name}}</option>
@endforeach
</select>
<div class="static-container">
<div class="card1">
<div class="card1-title">
<div>数据统计
@if($jump_dp == 1)
<a href="/dashboard" target="_blank">大屏数据</a>
@endif
</div>
<div>
{{-- <span class="card1-title__arrow">更多</span>--}}
</div>
</div>
<div class="card1-body">
<div class="static1">
<div class="static1__item">
<div class="static1__item--label">今日应收(元)</div>
<div class="static1__item--value">{{$counts['bill_today']}}</div>
</div>
<div class="static1__item">
<div class="static1__item--label">今日退款(元)</div>
<div class="static1__item--value">{{$counts['refund_today']}}</div>
</div>
<div class="static1__item">
<div class="static1__item--label">在岗护工</div>
<div class="static1__item--value">{{$counts['paramedic_has_order']}}</div>
</div>
<div class="static1__item">
<div class="static1__item--label">订单总数(个)</div>
<div class="static1__item--value">{{$counts['orders_all']}}</div>
</div>
<div class="static1__item">
<div class="static1__item--label">护工数量(人)</div>
<div class="static1__item--value">{{$counts['paramedics']}}</div>
</div>
<div class="static1__item">
<div class="static1__item--label">日结算</div>
<div class="static1__item--value">{{$counts['orders_finished_in_today']}}</div>
</div>
<div class="static1__item">
<div class="static1__item--label">日派工</div>
<div class="static1__item--value">{{$counts['orders_ongoing_in_today']}}</div>
</div>
</div>
<div class="static2">
<div class="static2__item">
<div class="static2__item--label">待处理</div>
<div class="static2__item--value">{{$counts['orders_pending']}}</div>
</div>
<div class="static2__item">
<div class="static2__item--label">在陪患者</div>
<div class="static2__item--value">{{$counts['orders_ongoing']}}</div>
</div>
<div class="static2__item">
<div class="static2__item--label">已完成</div>
<div class="static2__item--value">{{$counts['orders_finished']}}</div>
</div>
</div>
</div>
</div>
<div class="card1">
<div class="card1-title">
<div>各产品占比</div>
<div>
{{-- <span class="card1-title__arrow">更多</span>--}}
</div>
</div>
<div class="card1-body">
<div id="pie-chart"></div>
</div>
</div>
<div class="card1">
<div class="card1-title">
<div class="type-switch">
<div class="type-switch__item">
<input type="radio" name="type-switch" value="1" checked>
<div class="text">营收</div>
</div>
<div class="type-switch__item">
<input type="radio" name="type-switch" value="2">
<div class="text">订单量</div>
</div>
</div>
{{-- <div class="date-select">--}}
{{-- <span>今日</span>--}}
{{-- <span>本周</span>--}}
{{-- <span>本月</span>--}}
{{-- <span>全年</span>--}}
{{-- <select name="date"></select>--}}
{{-- </div>--}}
</div>
<div class="card1-body">
<div id="bar-chart"></div>
</div>
</div>
</div>
@endsection
<script>
function jump(url) {
window.open(url)
}
</script>
@push("footer")
<script src="/plugins/echarts/echarts.min.js"></script>
<script>
var lies = {!! json_encode($lies) !!};
var saleList = {!! json_encode($saleList) !!};
var orderList = {!! json_encode($orderList) !!};
console.log(lies, saleList, orderList)
function initPieChart() {
var datas = lies.map(function (item) {
return [
{
name: item.name,
value: parseFloat(item.total ?? "0") * item.rate,
label: {
show: true,
position: 'center',
fontWeight: "bold",
formatter: function (params) {
return params.name + "\n" + item.product_item_name + "\n" + (item.rate * 100).toFixed(2) + "%"
}
}
},
{
name: '未完成',
value: parseFloat(item.total ?? "0") * (1 - item.rate),
itemStyle: {
color: "#f1f2f5"
}
}
]
})
var pieChart = echarts.init(document.querySelector("#pie-chart"));
var pieColumns = 5; // 每行的饼图数量
var pieRows = Math.ceil(datas.length / pieColumns); // 计算行数
var gap = 10; // 间隔为20像素
var pieWidth = (100 - (pieColumns - 1) * (gap / pieColumns)) / pieColumns;
var pieHeight = (100 - (pieRows - 1) * (gap / pieRows)) / pieRows;
var option = {
series: datas.map(function (data, idx) {
var columnIndex = idx % pieColumns; // 当前饼图在其行中的列索引
var rowIndex = Math.floor(idx / pieColumns); // 当前饼图的行索引
var left = columnIndex * (pieWidth + gap / pieColumns); // 计算left位置
var top = rowIndex * (pieHeight + gap / pieRows); // 计算top位置
return {
type: 'pie',
radius: [40, 60],
top: top + "%",
height: pieHeight + "%",
left: left + '%',
width: pieWidth + "%",
itemStyle: {
borderColor: '#fff',
borderWidth: 1
},
label: {
normal: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: false,
fontSize: 15,
fontWeight: 'bold',
fontColor: "#666",
}
},
},
labelLine: {
show: false
},
data: data
};
})
};
// 使用刚指定的配置项和数据显示图表。
pieChart.setOption(option);
}
var barChart
function initBarChart() {
barChart = echarts.init(document.querySelector("#bar-chart"));
var option = {
title: {
text: '销售额趋势'
},
tooltip: {},
legend: {
data: ['销量']
},
xAxis: {
data: saleList.map(function (item) {
return item.month
})
},
yAxis: {},
series: [
{
name: '销量',
type: 'bar',
data: saleList.map(function (item) {
return item.total
})
}
]
}
barChart.setOption(option)
}
function setBarChartOption(type) {
var option
if (type == 1) {
option = {
title: {
text: '销售额趋势'
},
tooltip: {},
legend: {
data: ['销量']
},
xAxis: {
data: saleList.map(function (item) {
return item.month
})
},
yAxis: {},
series: [
{
name: '销量',
type: 'bar',
data: saleList.map(function (item) {
return item.total
})
}
]
}
barChart.setOption(option)
} else {
option = {
title: {
text: '订单量趋势'
},
tooltip: {},
legend: {
data: ['订单']
},
xAxis: {
data: orderList.map(function (item) {
return item.month
})
},
yAxis: {},
series: [
{
name: '订单',
type: 'bar',
data: orderList.map(function (item) {
return item.total
})
}
]
}
barChart.setOption(option)
}
}
function typeSwitchListener() {
$("[name=type-switch]").change(function () {
setBarChartOption($(this).val())
})
}
function hospitalSelectListner() {
if (window.location.search) {
var project_id = window.location.search.split("=")
if (project_id[1]) {
$("[name=hospital-select] option[value=" + project_id[1] + "]").prop("selected", true)
}
}
$("[name=hospital-select]").change(function () {
var url = window.location.origin + window.location.pathname;
url += ("?project_id=" + $(this).val());
window.open(url, '_self');
})
}
(function () {
initPieChart()
initBarChart()
typeSwitchListener()
hospitalSelectListner()
})()
</script>
@endpush

@ -222,7 +222,7 @@
<!-- end Topbar -->
<!-- Start Content-->
<div class="container-fluid">
<div class="container-fluid position-relative">
<!-- start page title -->
<div class="row">
@ -245,7 +245,7 @@
<!-- Footer Start -->
<footer class="footer">
<div class="container-fluid">
<div class="container-fluid position-relative">
<div class="row">
<div class="col-md-6">
{{ date("Y") }} &copy; {{ env("COPYRIGHT") }}

@ -0,0 +1,76 @@
@extends("admin.layouts.layout")
@php
$pageTitle = "首页";
@endphp
@push("header")
<style>
.toll-free-box i {
transform: none !important;
left: 1rem;
bottom: .4rem;
}
</style>
@endpush
@section("content")
<div class="row">
<div class="col-lg-3">
<div class="card text-white bg-info overflow-hidden">
<div class="card-body p-2" onclick="jump('/admin/orders')">
<div class="toll-free-box">
<h4 class="text-center pr-2">
订单列表
</h4>
</div>
</div>
</div>
</div> <!-- end col-->
<div class="col-lg-3">
<div class="card text-white bg-warning overflow-hidden">
<div class="card-body p-2" onclick="jump('/admin/orders/score')">
<div class="toll-free-box">
<h4 class="text-center pr-2">
评价管理
</h4>
</div>
</div>
</div>
</div> <!-- end col-->
<div class="col-lg-3">
<div class="card text-white bg-primary overflow-hidden">
<div class="card-body p-2" onclick="jump('/admin/orders/artboard')">
<div class="toll-free-box">
<h4 class="text-center pr-2">
陪护一览
</h4>
</div>
</div>
</div>
</div> <!-- end col-->
<div class="col-lg-3">
<div class="card text-white bg-success overflow-hidden">
<div class="card-body p-2" onclick="jump('/admin/project/asksubmit')">
<div class="toll-free-box">
<h4 class="text-center pr-2">
满意度调查
</h4>
</div>
</div>
</div>
</div> <!-- end col-->
</div>
@endsection
<script>
function jump(url){
window.open(url)
}
</script>

@ -37,8 +37,9 @@
<input class="form-control" type="text" name="keyword" value="{{ request()->keyword }}"
placeholder="订单编号/联系人/联系电话">
@if(\App\Models\CommonModel::checkExport())
<button class="btn btn-primary ml-1" type="button" onclick="doExport(this)">导出</button>
@endif
</form>
</div>
<table class="table table-bordered" id="data-table">

@ -0,0 +1,186 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>{{ env("APP_NAME")}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="内部信息化平台" name="description"/>
<meta content="{{csrf_token()}}" name="csrf-token"/>
<meta content="langye.net" name="author"/>
<!-- App favicon -->
<link rel="shortcut icon" href="/hyper/dist/saas/assets/images/favicon.ico">
<!-- third party css -->
<link href="/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.css" rel="stylesheet" type="text/css"/>
<link href="/plugins/select2/css/select2.css" rel="stylesheet" type="text/css" media="all"/>
<link href="/plugins/webuploader/webuploader.css" rel="stylesheet" type="text/css"/>
<link href="/plugins/webuploader/webuploader.my.css" rel="stylesheet" type="text/css"/>
<link href="/plugins/sweetalert2/sweetalert2.min.css" rel="stylesheet" type="text/css"/>
<!-- third party css end -->
<!-- App css -->
<link href="/hyper/dist/saas/assets/css/icons.min.css" rel="stylesheet" type="text/css"/>
<link href="/hyper/dist/saas/assets/css/app.min.css" rel="stylesheet" type="text/css" id="light-style"/>
<link href="/hyper/dist/saas/assets/css/app-dark.min.css" rel="stylesheet" type="text/css" id="dark-style"/>
<link href="/css/common.css" rel="stylesheet" type="text/css"/>
@stack("header")
<style>
.card-body{
overflow: scroll;
}
.table td {
word-break: keep-all;
white-space: nowrap;
}
.table th {
word-break: keep-all;
white-space: nowrap;
}
body[data-leftbar-compact-mode=condensed] .wrapper .content-page{
margin-left: 0px;
}
.content-page{
margin-left: 0px;
}
</style>
</head>
<body class="loading"
data-layout-config='{"leftSideBarTheme":"default","layoutBoxed":false, "leftSidebarCondensed":false, "leftSidebarScrollable":false,"darkMode":false, "showRightSidebarOnStart": false}'>
<!-- Begin page -->
<!-- Pre-loader -->
<div id="preloader">
<div id="status">
<div class="bouncing-loader">
<div></div>
<div></div>
<div></div>
</div>
</div>
</div>
<!-- End Preloader-->
<div class="wrapper">
<!-- ========== Left Sidebar Start ========== -->
<!-- Left Sidebar End -->
<!-- ============================================================== -->
<!-- Start Page Content here -->
<!-- ============================================================== -->
<div class="content-page">
<div class="content">
<!-- end Topbar -->
<!-- Start Content-->
<div class="container-fluid position-relative">
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box">
<div class="page-title-right">
</div>
<h4 class="page-title">陪护工作满意度调查表</h4>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
@include("public._form")
</div>
</div>
</div>
</div>
</div>
<!-- container -->
</div>
<!-- content -->
<!-- Footer Start -->
<footer class="footer">
<div class="container-fluid position-relative">
<div class="row">
<div class="col-md-6">
{{ date("Y") }} &copy; {{ env("COPYRIGHT") }}
</div>
<div class="col-md-6">
<div class="text-md-right footer-links d-none d-md-block">
{{ isset($laravel_duration) ? $laravel_duration : "" }}
</div>
</div>
</div>
</div>
</footer>
<!-- end Footer -->
</div>
<!-- ============================================================== -->
<!-- End Page content -->
<!-- ============================================================== -->
</div>
<!-- END wrapper -->
<div class="rightbar-overlay"></div>
<!-- /Right-bar -->
<!-- bundle -->
<script src="/hyper/dist/saas/assets/js/vendor.min.js"></script>
<script src="/hyper/dist/saas/assets/js/app.min.js"></script>
<!-- third party js -->
<script src="/plugins/jquery-validate/jquery.validate.min.js" type="text/javascript"></script>
<script src="/plugins/jquery-validate/additional-methods.js" type="text/javascript"></script>
<script src="/plugins/jquery-validate/localization/messages_zh.js" type="text/javascript"></script>
<script src="/plugins/moment/js/moment-with-locales.min.js"></script>
<script src="/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.js"></script>
<script src="/plugins/autofill/jquery.formautofill.min.js"></script>
<script src="/plugins/webuploader/webuploader.nolog.js"></script>
<script src="/plugins/bignumber/bignumber.js"></script>
<script src="/plugins/select2/js/select2.full.js" type="text/javascript"></script>
<script src="/plugins/select2/js/pinyin.js" type="text/javascript"></script>
<script src="/plugins/sweetalert2/sweetalert2.min.js"></script>
<!-- third party js ends -->
<!-- common js -->
<script src="/js/common.js"></script>
<script>
var page_title = "{{ isset($pageTitle) ? $pageTitle : "" }}";
$(function () {
setPageTitle();
});
function setPageTitle() {
if ($("h4.page-title").text() != "") {
return;
}
$(".left-side-menu a.active").each(function () {
if ($(this).siblings().length > 0) return;
page_title = $(this).text();
});
$("h4.page-title").text(page_title);
}
</script>
<!-- end common js-->
@stack("footer")
</body>
</html>

@ -7,11 +7,10 @@
<div class="card-body">
<div class="mb-3">
<form class="form-inline" id="search-form" autocomplete="off">
<a class="btn btn-primary" href="{{url($urlPrefix.'/asksubmit_create')}}">
<a class="btn btn-primary" href="{{url($urlPrefix.'/asksubmit_create?project_id='.$project_id)}}">
@lang("icons.action_create") @lang('actions.create')新建满意度调查
</a>&nbsp;&nbsp;&nbsp;
<button class="btn btn-primary ml-1" type="button" onclick="doExport(this)">导出</button>
&nbsp;&nbsp;
<button class="btn btn-primary ml-1" type="button" onclick="doExport(this)">导出</button>&nbsp;&nbsp;
<select class="form-control mr-1" name="project_id"
onchange="$(this).closest('form').submit()">
@foreach($projects as $pp)
@ -44,7 +43,11 @@
{{ $row->date }}
</td>
<td>
{{ $row->admin->name }}
@if(!$row->mobile)
{{ $row->admin->name }}
@else
{{ $row->name }}({{ $row->mobile }})
@endif
</td>
<td>{{ $row->project->name }}</td>
<td>

@ -23,7 +23,10 @@
<option value="{{$mm}}" @if($mm == $month) {{ "selected" }}@endif>{{$mm}}</option>
@endforeach
</select>
@if(\App\Models\CommonModel::checkExport())
<button class="btn btn-primary ml-1" type="button" onclick="doExport(this)">导出</button>
@endif
</form>
</div>
<table class="table table-bordered mb-0 table-datatable">

@ -37,7 +37,7 @@
</form>
</div>
<h5>客户余额表</h5>
<table class="table table-bordered mb-0 table-datatable">
<table class="table table-bordered mb-0 @if(\App\Models\CommonModel::checkExport())table-datatable @endif">
<thead>
<tr>
<th class="p-1" style="white-space: nowrap">序号</th>

@ -45,8 +45,8 @@
{{-- </select>--}}
</form>
</div>
<h5>收款明细</h5>
<table class="table table-bordered mb-0 table-datatable">
<h5>收款明细(合计:{{$recharges_sum}})</h5>
<table class="table table-bordered mb-0 @if(\App\Models\CommonModel::checkExport())table-datatable @endif">
<thead>
<tr>
<th class="p-1" style="white-space: nowrap">序号</th>
@ -84,8 +84,8 @@
@endforeach
</tbody>
</table>
<h5>退款明细</h5>
<table class="table table-bordered mb-0 table-datatable">
<h5>退款明细(合计:{{$refunds_sum}})</h5>
<table class="table table-bordered mb-0 @if(\App\Models\CommonModel::checkExport())table-datatable @endif">
<thead>
<tr>
<th class="p-1" style="white-space: nowrap">序号</th>

@ -0,0 +1,122 @@
@extends("admin.layouts.layout")
@push("header")
@endpush
@section("content")
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body" style="overflow: auto;">
<div class="mb-3">
<form class="form-inline">
<select class="form-control mr-1" name="project_id"
onchange="$(this).closest('form').submit()">
@foreach($projects as $pp)
<option
value="{{$pp->id}}" @if($pp->id == $project_id) {{ "selected" }}@endif>{{$pp->name}}</option>
@endforeach
</select>
<select class="form-control" name="month" onchange="$(this).closest('form').submit()">
@foreach($months as $mm)
<option value="{{$mm}}" @if($mm == $month) {{ "selected" }}@endif>{{$mm}}</option>
@endforeach
</select>
<button class="btn btn-primary ml-1" type="button" onclick="PageBodyPrint()">打印</button>
</form>
</div>
<!--start print-->
<div style="position: relative;padding-bottom: 20px;">
<table class="table table-bordered mb-0 table-datatable">
<thead>
<tr>
<th class="p-1" style="white-space: nowrap">病区</th>
<th class="p-1" style="white-space: nowrap">护理费用(元)</th>
<th class="p-1" style="white-space: nowrap">手续费0.6%</th>
<th class="p-1" style="white-space: nowrap">增值税6%</th>
<th class="p-1" style="white-space: nowrap">实际收入(元)</th>
<th class="p-1" style="white-space: nowrap">院方管理费6%</th>
</tr>
</thead>
<tbody>
@foreach ($area as $row)
<tr>
<td>{{ $row->name }}</td>
<td>{{ $row->order_total }}</td>
<td>{{ $row->shouxufei }}</td>
<td>{{ $row->zengshishui }}</td>
<td>{{ $row->shijishouru }}</td>
<td>{{ $row->guanlifei }}</td>
</tr>
@endforeach
<tr>
<td>合计</td>
<td>{{ $total['order_total'] }}</td>
<td>{{ $total['shouxufei'] }}</td>
<td>{{ $total['zengshishui'] }}</td>
<td>{{ $total['shijishouru'] }}</td>
<td>{{ $total['guanlifei'] }}</td>
</tr>
<tr>
<td>退款</td>
<td>{{ $refund['order_total'] }}</td>
<td></td>
<td></td>
<td>{{ $refund['shijishouru'] }}</td>
<td>{{ $refund['guanlifei'] }}</td>
</tr>
<tr>
<td>总计</td>
<td>{{ $zongji['order_total'] }}</td>
<td>{{ $zongji['shouxufei'] }}</td>
<td>{{ $zongji['zengshishui'] }}</td>
<td>{{ $zongji['shijishouru'] }}</td>
<td>{{ $zongji['guanlifei'] }}</td>
</tr>
</tbody>
</table>
<img class="print-yz" src="/images/yz.png" alt=""
style="filter: saturate(2);position: absolute;right: 20px; bottom: 20px; width: 154px;">
<div
style="text-align: right;line-height: 2;margin-top: 20px;font-weight: 600;position: relative;z-index: 3;">
<div>
江苏天天欣业物业服务有限公司
</div>
<div style="padding-right: 20px;">
填报人:{{ $admin->name }}
</div>
</div>
</div>
<!--end print-->
</div>
</div>
</div>
</div>
<script>
function doExport(ele) {
var url = "{{ url("admin/statistics/income") }}";
url += "?is_export=1";
var params = $(ele).closest("form").serialize();
url += "&" + params;
window.open(url);
}
function PageBodyPrint() {
var bdhtml = window.document.body.innerHTML; //获取当前页的html代码
var sprnstr = "<!--start print-->"; //设置打印开始区域
var eprnstr = "<!--end print-->"; //设置打印结束区域
var prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 18);
prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
window.document.body.innerHTML = prnhtml;
$(".print-yz").on("load", function () {
window.print();
window.document.body.innerHTML = bdhtml;
})
}
</script>
@endsection

@ -35,7 +35,7 @@
</select>
</form>
</div>
<table class="table table-bordered mb-0 table-datatable">
<table class="table table-bordered mb-0 @if(\App\Models\CommonModel::checkExport())table-datatable @endif">
<thead>
<tr>
<th class="p-1" style="white-space: nowrap">序号</th>
@ -74,7 +74,7 @@
</table>
<h5>明细</h5>
<table class="table table-bordered mb-0 table-datatable">
<table class="table table-bordered mb-0 @if(\App\Models\CommonModel::checkExport())table-datatable @endif">
<thead>
<tr>
<th class="p-1" style="white-space: nowrap">序号</th>

@ -32,6 +32,9 @@ Route::group(["namespace" => "Admin", "prefix" => "admin"], function () {
Route::get('home', 'HomeController@index');
Route::post('upload', 'CommonController@upload');
});
// 所有人都可以提交
Route::get("project/asksubmit_create_v2", 'ProjectController@askSubmitCreateV2');
Route::post("project/asksubmit_store_v2", 'ProjectController@askSubmitStoreV2');
Route::group(['middleware' => ['authorize:admin', 'rbac:admin']], function () {
\App\Models\CommonModel::generateCurdRouter("PermissionController", "permission");
@ -96,6 +99,8 @@ Route::group(["namespace" => "Admin", "prefix" => "admin"], function () {
Route::get("orders/artboard", 'OrdersController@artboard');
Route::get("statistics/bed", 'StatisticsController@bed');
Route::get("statistics/income", 'StatisticsController@income');
Route::get("statistics/huli", 'StatisticsController@huli');
Route::get("statistics/overview", 'StatisticsController@overview');
Route::get("statistics/salary", 'StatisticsController@salary');

Loading…
Cancel
Save