280 lines
12 KiB
Smarty
280 lines
12 KiB
Smarty
<!--<script type="text/javascript">-->
|
||
<!-- var currentLocation = "/user";-->
|
||
<!--</script>-->
|
||
{include file='user/header.tpl'}
|
||
|
||
<style>
|
||
body.swal2-height-auto {
|
||
height: 100% !important;
|
||
}
|
||
</style>
|
||
|
||
<!-- BEGIN: Content-->
|
||
<div class="app-content content">
|
||
<div class="content-overlay"></div>
|
||
<div class="header-navbar-shadow"></div>
|
||
<div class="content-wrapper">
|
||
<div class="content-header row">
|
||
<div class="content-header-left col-md-9 col-12 mb-2">
|
||
<div class="row breadcrumbs-top">
|
||
<div class="col-12">
|
||
<h2 class="content-header-title float-left mb-0">工单系统</h2>
|
||
<div class="breadcrumb-wrapper col-12">
|
||
<ol class="breadcrumb">
|
||
<li class="breadcrumb-item"><a href="/user">Home</a></li>
|
||
<li class="breadcrumb-item"><a href="/user/ticket">Ticket</a></li>
|
||
</ol>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="content-body">
|
||
<!-- account setting page start -->
|
||
<section>
|
||
<div class="row">
|
||
<div class="col-sm-12">
|
||
<div class="card overflow-hidden">
|
||
<div class="card-content">
|
||
<div class="card-body">
|
||
<div class="alert-text">
|
||
该页面记录您所有工单记录<br />
|
||
<a class="btn btn-primary btn-icon icon-left" style="float: right;color:white" data-toggle="modal" data-target="#ticket-create-modal"><i class="fas fa-plus"></i> 创建工单</a>
|
||
<br />请认真详细描述您的问题,客服在收到您的工单后24小时内回复。
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<div class="col-12">
|
||
<div class="card">
|
||
<div class="card-header">
|
||
<h4 class="card-title">列表</h4>
|
||
</div>
|
||
<div class="card-content">
|
||
<div class="card-body">
|
||
<div class="table-responsive">
|
||
<table class="table table-hover-animation">
|
||
<thead>
|
||
<tr>
|
||
<th><strong>工单ID</strong></th>
|
||
<th><strong>发起时间</strong></th>
|
||
<th><strong>工单标题</strong></th>
|
||
<th><strong>工单状态</strong></th>
|
||
<th><strong>操作</strong></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{foreach $oTicketList as $oTicket}
|
||
<tr>
|
||
<td>{$oTicket->id}</td>
|
||
<td>{$oTicket->datetime}</td>
|
||
<td>{$oTicket->title}</td>
|
||
<td><strong><span class="btn btn-bold btn-sm btn-font-sm btn-label-success">{$oTicket->status}</span></strong></td>
|
||
<td>
|
||
<a class="btn btn-primary btn-sm" href="/user/ticket/{$oTicket->id}/detail">查看</a>
|
||
{if $oTicket->status_code != "closed"}
|
||
<button type="button" class="btn btn-danger btn-sm" onclick="if (!window.__cfRLUnblockHandlers) return false; ticketClose({$oTicket->id});" data-toggle="modal" data-target="#ticket-close-modal">
|
||
关闭工单
|
||
</button>
|
||
{/if}
|
||
</td>
|
||
</tr>
|
||
{/foreach}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- modal -->
|
||
<div class="modal fade" id="ticket-create-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h5 class="modal-title"><strong>创建新工单</strong></h5>
|
||
</div>
|
||
<form id="ticket-create-text-form">
|
||
<div class="modal-body">
|
||
<div class="form-group">
|
||
<label for="recipient-name" class="form-control-label">标题</label>
|
||
<input type="text" class="form-control" id="ticket-create-title-text" name="ticket_create_title_text" />
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="message-text" class="form-control-label">部门</label>
|
||
<select class="custom-select" id="ticket-type">
|
||
<option>财务部门</option>
|
||
<option>技术部门</option>
|
||
</select>
|
||
</div>
|
||
<!--
|
||
<div class="form-group">
|
||
<label for="message-text" class="form-control-label">严重性</label>
|
||
<select class="custom-select" id="ticket-level">
|
||
<option>低</option>
|
||
<option>中</option>
|
||
<option>高</option>
|
||
</select>
|
||
</div>
|
||
-->
|
||
<div class="form-group">
|
||
<label for="message-text" class="form-control-label">内容</label>
|
||
<textarea class="form-control" style="height: 200px;" id="ticket-create-content-text" name="ticket_create_content_text"></textarea>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-primary" id="ticket-create-click">确定</button>
|
||
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- modal 关闭工单 -->
|
||
<div class="modal fade" id="ticket-close-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h5 class="modal-title"><strong>关闭工单</strong></h5>
|
||
</div>
|
||
<div class="modal-body">
|
||
关闭这条工单吗?
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-primary" id="ticket-close-click">确定</button>
|
||
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- END: Content-->
|
||
|
||
|
||
|
||
{include file='user/footer.tpl'}
|
||
|
||
<script type="c4d86746314722ec8753695f-text/javascript">
|
||
|
||
var ticketDetailId;
|
||
|
||
function ticketClose(id)
|
||
{
|
||
ticketDetailId = id;
|
||
}
|
||
|
||
function ticket_off(e, t) {
|
||
$.ajax({
|
||
type: "PUT",
|
||
url: "/user/ticket/" + e,
|
||
dataType: "json",
|
||
data: {
|
||
content: "这条工单已被关闭",
|
||
status: t
|
||
},
|
||
success: function (e) {
|
||
if (e.ret) {
|
||
var t = {
|
||
type: "success"
|
||
};
|
||
t.title = e.msg,
|
||
t.timer = 1500,
|
||
t.showConfirmButton = false,
|
||
Swal.fire(t),
|
||
setTimeout(function () {
|
||
window.location.reload()
|
||
}, 1e3)
|
||
} else {
|
||
var o = {
|
||
type: "error"
|
||
};
|
||
o.title = e.msg,
|
||
o.timer = 1500,
|
||
o.showConfirmButton = false,
|
||
Swal.fire(o)
|
||
}
|
||
},
|
||
error: function (e) {
|
||
var t = {
|
||
type: "error",
|
||
title: "出现错误",
|
||
html: "请刷新页面后重试",
|
||
timer: 1500,
|
||
showConfirmButton: false
|
||
};
|
||
Swal.fire(t)
|
||
}
|
||
})
|
||
}
|
||
|
||
$(function(){
|
||
|
||
$("#ticket-close-click").click(function(){
|
||
ticket_off(ticketDetailId, "closed")
|
||
});
|
||
|
||
$("#ticket-create-click").click(function () {
|
||
$("#ticket-create-click").text("提交中").attr("disabled", true),
|
||
$.ajax({
|
||
type: "POST",
|
||
url: "/user/ticket",
|
||
dataType: "json",
|
||
data: {
|
||
title: $("#ticket-create-title-text").val(),
|
||
comment: $("#ticket-create-content-text").val(),
|
||
type: $("#ticket-type").val()
|
||
//level: $("#ticket-level").val(),
|
||
//status: status
|
||
},
|
||
success: function (e) {
|
||
if (e.ret) {
|
||
var t = {
|
||
type: "success"
|
||
};
|
||
t.title = e.msg,
|
||
t.timer = 1500,
|
||
t.showConfirmButton = false,
|
||
Swal.fire(t),
|
||
setTimeout(function () {
|
||
window.location.reload()
|
||
}, 1e3)
|
||
} else {
|
||
var o = {
|
||
type: "error"
|
||
};
|
||
o.title = e.msg,
|
||
o.timer = 1500,
|
||
o.showConfirmButton = false,
|
||
Swal.fire(o)
|
||
}
|
||
},
|
||
error: function (e) {
|
||
var t = {
|
||
type: "error"
|
||
};
|
||
t.title = e.msg,
|
||
t.timer = 1500,
|
||
t.showConfirmButton = false,
|
||
Swal.fire(t)
|
||
}
|
||
})
|
||
});
|
||
});
|
||
|
||
</script>
|
||
|
||
<script src="/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="c4d86746314722ec8753695f-|49" defer></script>
|
||
|
||
</body>
|
||
|
||
</html>
|