工单位置详情

This commit is contained in:
2025-03-19 11:04:09 +08:00
parent 3d82a417a0
commit 483bcfd6d8
6 changed files with 297 additions and 4 deletions

View File

@ -78,14 +78,12 @@ class InspectionShare extends Controller
case 'new':
$data = $this->_vali([
'type_id.require' => '类型不能为空',
'user_id.require' => '请选择处理人员',
]);
$ticket = TicketTicket::mk()->create([
'source_type' => 2,
'type_id' => $data['type_id'],
'user_type' => 'staff',
'user_id' => $share->user_id,
'current_admin_id' => $data['user_id'],
'title' => $share->title,
'content' => $share->content,
'ticket_region' => $share->ticket_region,

View File

@ -0,0 +1,83 @@
<?php
namespace plugin\ticket\controller;
use plugin\ticket\model\TicketRepair;
use think\admin\Controller;
use think\admin\helper\QueryHelper;
/**
* 维修工单管理
*/
class Repair extends Controller
{
/**
* 维修工单列表
* @auth true
* @menu true
* @return void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function index()
{
$this->title = '维修工单管理';
TicketRepair::mQuery()->layTable(function () {
}, static function (QueryHelper $query) {
$query->equal('status')->like('title');
$query->timeBetween('create_at');
});
}
/**
* 添加维修工单
* @auth true
* @menu true
* @return void
*/
public function add()
{
$this->title = '添加维修工单';
TicketRepair::mForm('form');
}
/**
* 编辑维修工单
* @auth true
* @menu true
* @return void
*/
public function edit()
{
$this->title = '编辑维修工单';
$this->id = $this->request->param('id');
TicketRepair::mForm('form', 'id');
}
/**
* 删除维修工单
* @auth true
* @menu true
* @return void
*/
public function remove()
{
TicketRepair::mDelete('id');
}
/**
* 修改维修工单状态
* @auth true
* @menu true
* @return void
*/
public function status()
{
TicketRepair::mSave($this->_vali([
'id.require' => '工单ID不能为空',
'status.in:0,1' => '状态值范围异常!',
'status.require' => '状态值不能为空!',
]), 'id');
}
}

View File

@ -82,14 +82,12 @@ class UserShare extends Controller
case 'new':
$data = $this->_vali([
'type_id.require' => '类型不能为空',
'user_id.require' => '请选择处理人员',
]);
$ticket = TicketTicket::mk()->create([
'source_type' => 1,
'type_id' => $data['type_id'],
'user_type' => 'user',
'user_id' => $userShare->user_id,
'current_admin_id' => $data['user_id'],
'title' => $userShare->title,
'content' => $userShare->content,
'ticket_region' => $userShare->ticket_region,

View File

@ -0,0 +1,83 @@
<?php
namespace plugin\ticket\controller;
use plugin\ticket\model\TicketVerify;
use think\admin\Controller;
use think\admin\helper\QueryHelper;
/**
* 验收工单管理
*/
class Verify extends Controller
{
/**
* 验收工单列表
* @auth true
* @menu true
* @return void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function index()
{
$this->title = '验收工单管理';
TicketVerify::mQuery()->layTable(function () {
}, static function (QueryHelper $query) {
$query->equal('status')->like('title');
$query->timeBetween('create_at');
});
}
/**
* 添加验收工单
* @auth true
* @menu true
* @return void
*/
public function add()
{
$this->title = '添加验收工单';
TicketVerify::mForm('form');
}
/**
* 编辑验收工单
* @auth true
* @menu true
* @return void
*/
public function edit()
{
$this->title = '编辑验收工单';
$this->id = $this->request->param('id');
TicketVerify::mForm('form', 'id');
}
/**
* 删除验收工单
* @auth true
* @menu true
* @return void
*/
public function remove()
{
TicketVerify::mDelete('id');
}
/**
* 修改验收工单状态
* @auth true
* @menu true
* @return void
*/
public function status()
{
TicketVerify::mSave($this->_vali([
'id.require' => '工单ID不能为空',
'status.in:0,1' => '状态值范围异常!',
'status.require' => '状态值不能为空!',
]), 'id');
}
}

View File

@ -0,0 +1,83 @@
<?php
namespace plugin\ticket\controller;
use plugin\ticket\model\TicketView;
use think\admin\Controller;
use think\admin\helper\QueryHelper;
/**
* 查看工单管理
*/
class View extends Controller
{
/**
* 查看工单列表
* @auth true
* @menu true
* @return void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function index()
{
$this->title = '查看工单管理';
TicketView::mQuery()->layTable(function () {
}, static function (QueryHelper $query) {
$query->equal('status')->like('title');
$query->timeBetween('create_at');
});
}
/**
* 添加查看工单
* @auth true
* @menu true
* @return void
*/
public function add()
{
$this->title = '添加查看工单';
TicketView::mForm('form');
}
/**
* 编辑查看工单
* @auth true
* @menu true
* @return void
*/
public function edit()
{
$this->title = '编辑查看工单';
$this->id = $this->request->param('id');
TicketView::mForm('form', 'id');
}
/**
* 删除查看工单
* @auth true
* @menu true
* @return void
*/
public function remove()
{
TicketView::mDelete('id');
}
/**
* 修改查看工单状态
* @auth true
* @menu true
* @return void
*/
public function status()
{
TicketView::mSave($this->_vali([
'id.require' => '工单ID不能为空',
'status.in:0,1' => '状态值范围异常!',
'status.require' => '状态值不能为空!',
]), 'id');
}
}

View File

@ -52,9 +52,57 @@
</div>
</td>
</tr>
{if $vo.lat && $vo.lng}
<tr>
<td>位置</td>
<td>
<div id="map" style="height: 320px;"></div>
</td>
</tr>
{/if}
</tbody>
</table>
</div>
{if $vo.lat && $vo.lng}
<script src="https://map.qq.com/api/gljs?v=1.exp&key=T6XBZ-L33CB-TMFUL-JQ4D6-MKBTK-KNBED"></script>
<script>
function initMap() {
//定义地图中心点坐标
var center = new TMap.LatLng("{$vo.lat}", "{$vo.lng}")
//定义map变量,调用 TMap.Map() 构造函数创建地图
var map = new TMap.Map(document.getElementById('map'), {
center: center,//设置地图中心点坐标
zoom: 17.2, //设置地图缩放级别
pitch: 30, //设置俯仰角
});
var marker = new TMap.MultiMarker({
map: map,
styles: {
// 点标记样式
marker: new TMap.MarkerStyle({
width: 20, // 样式宽
height: 30, // 样式高
anchor: { x: 10, y: 30 }, // 描点位置
}),
},
geometries: [
// 点标记数据数组
{
// 标记位置(纬度,经度,高度)
position: center,
id: 'marker',
},
],
});
}
var mapInit = setInterval(function () {
if (window.TMap) {
clearInterval(mapInit)
initMap()
}
}, 500)
</script>
{/if}
</div>
</div>
</div>