<div class="layui-card">
|
<div class="layui-card-header">
|
<h2 class="header-title">咨询管理</h2>
|
<span class="layui-breadcrumb pull-right">
|
<a href="#!home_console">首页</a>
|
<a><cite>咨询管理</cite></a>
|
</span>
|
</div>
|
<div class="layui-card-body">
|
<div class="layui-form toolbar">
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<select id="type" lay-filter="role_clients">
|
<option value="">服务类型</option>
|
<option value="1">图文</option>
|
<option value="3">图文/电话</option>
|
</select>
|
<select id="status" lay-filter="role_clients">
|
<option value="">咨询状态</option>
|
<option value="1">待咨询</option>
|
<option value="2">咨询中</option>
|
<option value="3">待完成</option>
|
<option value="4">已完成</option>
|
</select>
|
</div>
|
<div class="layui-inline" >
|
<input name="keyword" id="keyword" placeholder="咨询ID/医生名/用户名称" type="text"
|
class="layui-input search-input" maxlength="50" autocomplete="off"/> 
|
</div>
|
|
<button id="app-btn-search" class="layui-btn icon-btn" layt="abc"><i class="layui-icon"></i>搜索
|
</button>
|
<table class="layui-table" id="app-table" lay-filter="app-table"></table>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<input id="hospitalId" type="hidden"/>
|
<!-- 表格操作列 -->
|
<script type="text/html" id="doctor-table-bar">
|
<button class="layui-btn layui-btn-primary layui-btn-xs" lay-event="show">查看
|
</button>
|
{{# if(d.type == 2 && d.payStatus == 1){ }}
|
<button class="layui-btn layui-btn-xs" lay-event="refund">
|
退款
|
</button>
|
{{# } }}
|
{{# if(d.type == 1 && d.consultationStatus != 4 && d.consultationStatus != -1){ }}
|
<button class="layui-btn layui-btn-primary layui-btn-xs" lay-event="complete">
|
完成
|
</button>
|
{{# } }}
|
</script>
|
<script>
|
layui.use(['form', 'table', 'laydate', 'util', 'config', 'upload', 'admin', 'formSelects','area'],
|
function () {
|
var form = layui.form;
|
var table = layui.table;
|
var config = layui.config;
|
var admin = layui.admin;
|
var $ = layui.jquery;
|
|
// 渲染表格
|
table.render({
|
elem: '#app-table',
|
url: config.base_server + 'api-opration/advisorydoctor/findAll',
|
method: 'GET',
|
headers: {
|
'Authorization': 'Bearer ' + config.getToken().access_token
|
},
|
page: true,
|
cols: [
|
[{
|
field: 'advisoryId',
|
width: "300",
|
title: '咨询ID',
|
align: 'center',
|
fixed: 'left',
|
},{
|
field: 'type',
|
width: "90",
|
title: '服务类型',
|
fixed: 'left',
|
templet: function (d) {
|
if (d.type == 1) {
|
return "图文"
|
} else if (d.type == 2) {
|
return "电话"
|
} else {
|
return "图文/电话"
|
}
|
}
|
},{
|
field: 'createTime',
|
width: "160",
|
title: '创建时间',
|
align: 'center',
|
fixed: 'left',
|
},{
|
field: 'doctorName',
|
width: "150",
|
title: '咨询医生',
|
align: 'center',
|
fixed: 'left',
|
},{
|
field: 'userName',
|
width: "150",
|
align: 'center',
|
title: '用户名',
|
fixed: 'left',
|
},
|
{
|
field: 'appointmentTime',
|
width: "250",
|
align: 'center',
|
title: '预约时间',
|
fixed: 'left',
|
},
|
{
|
field: 'consultationStatus',
|
width: "90",
|
align: 'center',
|
title: '咨询状态',
|
fixed: 'left',
|
templet: function (d) {
|
if (d.consultationStatus == 1) {
|
return "待咨询"
|
} else if (d.consultationStatus == 2) {
|
return "咨询中"
|
} else if (d.consultationStatus == 3) {
|
return "待完成"
|
}else if (d.consultationStatus == 4) {
|
return "已完成"
|
}else{
|
return "已取消"
|
}
|
}
|
},
|
{
|
field: 'evaluationLevel',
|
width: "80",
|
align: 'center',
|
title: '评价',
|
fixed: 'left',
|
templet: function (d) {
|
return (d.evaluationLevel == null || d.evaluationLevel == 0) ? "" : d.evaluationLevel + "星";
|
}
|
},
|
{
|
width: "200",
|
align: 'center',
|
title: '操作',
|
fixed: 'right',
|
templet: '#doctor-table-bar'
|
}
|
]
|
],
|
done: function (res, curr, count) {
|
permissionsInput(res, config);
|
}
|
});
|
|
|
// 搜索按钮点击事件
|
$('#app-btn-search').click(function () {
|
var type = $('#type').val();
|
var status = $("#status").val();
|
var keyword = $('#keyword').val();
|
table.reload('app-table', {
|
where: {
|
type: type,
|
status: status,
|
keyword: keyword
|
}
|
});
|
});
|
|
var showEditModel_add = function (title, data) {
|
admin.putTempData('t_adisory', data);
|
admin.popupCenter({
|
title: title,
|
path: 'pages/keaigao/AdvisoryManager_form.html',
|
area: '610px',
|
offset: '0px',
|
finish: function () {
|
}
|
});
|
};
|
|
// 工具条点击事件
|
table.on('tool(app-table)', function (obj) {
|
var data = obj.data;
|
var layEvent = obj.event;
|
if (layEvent === 'show') {
|
showEditModel_add("查看", data);
|
}else if(layEvent === 'complete'){
|
doComplete(data);
|
}else if(layEvent === 'refund'){
|
doRefund(data);
|
}
|
});
|
|
//标记完成
|
var doComplete = function (obj) {
|
var name = "确定要标记完成吗?";
|
if(obj.payStatus !== 1 && obj.type == 2){
|
name = "该咨询支付异常,确定要标记完成吗?"
|
}
|
layer.confirm(name , function (i) {
|
layer.close(i);
|
layer.load(2);
|
admin.req('api-opration/advisorydoctor/update/' + obj.advisoryId, {}, function (data) {
|
layer.closeAll('loading');
|
if (data.code == 0) {
|
layer.msg(data.msg, { icon: 1, time: 2000 });
|
table.reload('app-table', {});
|
} else {
|
layer.msg(data.msg, { icon: 2, time: 2000 });
|
}
|
}, 'Get');
|
});
|
};
|
|
//退款
|
var doRefund = function (obj) {
|
if(obj.payStatus == -1){
|
layer.msg("已退款,无需重复操作", { icon: 2, time: 2000 });
|
return;
|
}
|
|
var name = "确定要将"+(obj.payStatus == 1 ? "已支付" : "未支付")+"的订单进行退款吗?";
|
layer.confirm(name , function (i) {
|
layer.close(i);
|
layer.load(2);
|
admin.req('api-opration/advisorydoctor/refund', JSON.stringify({'advisoryId':obj.advisoryId}), function (data) {
|
layer.closeAll('loading');
|
if (data.code == 0) {
|
layer.msg("申请成功,请等待微信退款!", { icon: 1, time: 2000 });
|
table.reload('app-table', {});
|
} else {
|
layer.msg("操作失败", { icon: 2, time: 2000 });
|
}
|
}, 'POST');
|
});
|
};
|
|
});
|
</script>
|