You've already forked guangan
工单位置详情
This commit is contained in:
@ -78,14 +78,12 @@ class InspectionShare extends Controller
|
|||||||
case 'new':
|
case 'new':
|
||||||
$data = $this->_vali([
|
$data = $this->_vali([
|
||||||
'type_id.require' => '类型不能为空',
|
'type_id.require' => '类型不能为空',
|
||||||
'user_id.require' => '请选择处理人员',
|
|
||||||
]);
|
]);
|
||||||
$ticket = TicketTicket::mk()->create([
|
$ticket = TicketTicket::mk()->create([
|
||||||
'source_type' => 2,
|
'source_type' => 2,
|
||||||
'type_id' => $data['type_id'],
|
'type_id' => $data['type_id'],
|
||||||
'user_type' => 'staff',
|
'user_type' => 'staff',
|
||||||
'user_id' => $share->user_id,
|
'user_id' => $share->user_id,
|
||||||
'current_admin_id' => $data['user_id'],
|
|
||||||
'title' => $share->title,
|
'title' => $share->title,
|
||||||
'content' => $share->content,
|
'content' => $share->content,
|
||||||
'ticket_region' => $share->ticket_region,
|
'ticket_region' => $share->ticket_region,
|
||||||
|
83
plugs/think-plugs-ticket/src/controller/Repair.php
Normal file
83
plugs/think-plugs-ticket/src/controller/Repair.php
Normal 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');
|
||||||
|
}
|
||||||
|
}
|
@ -82,14 +82,12 @@ class UserShare extends Controller
|
|||||||
case 'new':
|
case 'new':
|
||||||
$data = $this->_vali([
|
$data = $this->_vali([
|
||||||
'type_id.require' => '类型不能为空',
|
'type_id.require' => '类型不能为空',
|
||||||
'user_id.require' => '请选择处理人员',
|
|
||||||
]);
|
]);
|
||||||
$ticket = TicketTicket::mk()->create([
|
$ticket = TicketTicket::mk()->create([
|
||||||
'source_type' => 1,
|
'source_type' => 1,
|
||||||
'type_id' => $data['type_id'],
|
'type_id' => $data['type_id'],
|
||||||
'user_type' => 'user',
|
'user_type' => 'user',
|
||||||
'user_id' => $userShare->user_id,
|
'user_id' => $userShare->user_id,
|
||||||
'current_admin_id' => $data['user_id'],
|
|
||||||
'title' => $userShare->title,
|
'title' => $userShare->title,
|
||||||
'content' => $userShare->content,
|
'content' => $userShare->content,
|
||||||
'ticket_region' => $userShare->ticket_region,
|
'ticket_region' => $userShare->ticket_region,
|
||||||
|
83
plugs/think-plugs-ticket/src/controller/Verify.php
Normal file
83
plugs/think-plugs-ticket/src/controller/Verify.php
Normal 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');
|
||||||
|
}
|
||||||
|
}
|
83
plugs/think-plugs-ticket/src/controller/View.php
Normal file
83
plugs/think-plugs-ticket/src/controller/View.php
Normal 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');
|
||||||
|
}
|
||||||
|
}
|
@ -52,9 +52,57 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{if $vo.lat && $vo.lng}
|
||||||
|
<tr>
|
||||||
|
<td>位置</td>
|
||||||
|
<td>
|
||||||
|
<div id="map" style="height: 320px;"></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{/if}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user