新增一个根据传入的资产编号查询设备明细的页

This commit is contained in:
Xpesir 2022-06-24 06:16:29 +00:00 committed by Gitee
parent 10c81bb2d2
commit 40d9c4b705
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 23601 additions and 3 deletions

View File

@ -0,0 +1,56 @@
<?php
namespace App\Admin\Controllers;
use Illuminate\Support\Facades\DB;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\Translation\Translator;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
use Illuminate\Http\Request;
class DeviceTagController
{
/**
* 页面.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
*/
public function checktag(Request $request): View|Factory|Application
{
$assetnumber = $request->input("assetnumber");
if (!empty($assetnumber)) {
$datas = DB::table('device_records')
->select([
'device_records.asset_number AS asset_number',
'device_records.name AS name',
'device_categories.name AS categories',
'device_records.description AS description',
'device_records.ip AS ip',
'departments.name AS departments',
'admin_users.name AS admin_users',
'device_records.expired AS expired',
'device_records.purchased AS purchased',
'device_records.model AS model'
])
->join('device_categories', 'device_records.category_id', '=', 'device_categories.id')
->join('device_tracks', 'device_records.id', '=', 'device_tracks.device_id')
->join('admin_users', 'admin_users.id', '=', 'device_tracks.user_id')
->join('departments', 'admin_users.department_id', '=', 'departments.id')
->where('device_records.asset_number', $assetnumber)
->get();
return view("check_tag", ["data" => $datas[0]]);
}
}
public function title(): array|string|Translator|null
{
return admin_trans_label('title');
}
}

View File

@ -242,9 +242,9 @@ Route::group([
->name('site.version.index'); ->name('site.version.index');
/** /**
* 标签查询. * 设备标签查询.
*/ */
$router->get('/device/tag', [DevicePrintController::class, 'tag']) $router->get('/device/tag', [DeviceTagController::class, 'checktag'])
->name('device.tag'); ->name('device.tag');
/** /**

19956
public/static/css/checktag/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

3506
public/static/css/checktag/main.css vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,80 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>IT资产管理系统 | {{$data->asset_number}}</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="robots" content="all,follow">
<link rel="stylesheet" href="{{asset("static/css/checktag/bootstrap.css")}}" crossorigin="anonymous">
<link rel="stylesheet" href="{{asset("static/css/checktag/main.css")}}" crossorigin="anonymous">
<link id="new-stylesheet" rel="stylesheet">
</head>
<body>
<div class="page login-page">
<div class="container d-flex align-items-center">
<div class="form-holder has-shadow">
<div class="row">
<div class="col-lg-6">
<div class="info d-flex align-items-center">
<div class="content">
<div class="logo">
<h1>{{$data->asset_number}}</h1>
</div>
<p>IT资产管理系统 | 资产明细</p>
</div>
</div>
</div>
<div class="col-lg-6 bg-white">
<div class="form d-flex align-items-center">
<div class="content">
<table>
<tbody>
<tr>
<th align='left' width='120px'>资产名称</th>
<td>{{$data->name}}</td>
</tr>
<tr>
<th align='left' width='120px'>资产类型</th>
<td>{{$data->categories}}</td>
</tr>
<!--
<tr>
<th align='left' width='120px'>资产规格</th>
<td >{{$data->model}}</td>
</tr>
-->
<tr>
<th align='left' width='120px'>网络地址</th>
<td>{{$data->ip}}</td>
</tr>
<tr>
<th align='left' width='120px'>购保日期</th>
<td>{{$data->purchased}} --> {{$data->expired}}</td>
</tr>
<tr>
<th align='left' width='120px'>使用部门</th>
<td>{{$data->departments}}</td>
</tr>
<tr>
<th align='left' width='120px'>使用人员</th>
<td>{{$data->admin_users}}</td>
</tr>
<tr>
<th align='left' width='120px'>资产备注</th>
<td >{{$data->description}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>