From daa697719eb0ddfd170f1ab94c5422a4f5b93951 Mon Sep 17 00:00:00 2001
From: zhaoxiaohao <279049017@qq.com>
Date: Fri, 18 Sep 2020 14:36:54 +0800
Subject: [PATCH] Merge branch 'dev'
---
kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/hospital.html | 329 ++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 280 insertions(+), 49 deletions(-)
diff --git a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/hospital.html b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/hospital.html
index 1a6002c..80b9a41 100644
--- a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/hospital.html
+++ b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/hospital.html
@@ -27,15 +27,18 @@
<option value="1">-是-</option>
<option value="0">-否-</option>
</select>
-   -->
+  
<select id="hospitalstate" placeholder="选择医院状态" lay-filter="hospitalstate">
<option value="">-医院状态-</option>
<option value="0">试用</option>
<option value="1">正式</option>
- </select>
+ </select> -->
 
- <input id="hospitalName" class="layui-input search-input" type="text" placeholder="按医院名" /> 
- <button id="hospita-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button>
+ <input id="hosName" class="layui-input search-input" type="text" placeholder="按医院名" /> 
+ <button id="hospita-btn-search" class="layui-btn icon-btn"><i class="layui-icon permissions"
+ permissions="hospital-get"></i>搜索</button> 
+ <button id="hospital-btn-add" class="layui-btn icon-btn"><i class="layui-icon permissions"
+ permissions="hospital-save"></i>添加医院/科室</button>
</div>
<!-- 数据表格 -->
@@ -45,13 +48,22 @@
<!-- 表格操作列 -->
<script type="text/html" id="businessRecords-table-bar">
- <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看详情</a>
- <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>
- <a class="layui-btn layui-btn-xs" lay-event="pay">充值</a>
- <a class="layui-btn layui-btn-xs" lay-event="del">删除</a>
+ <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="productdetail-List">套餐</a>
+ <a class="layui-btn layui-btn-xs permissions" permissions="product-rechage" lay-event="pay">充值</a>
+ <a class="layui-btn layui-btn-primary layui-btn-xs permissions" permissions="hospital-save" lay-event="edit">修改</a>
+ <a class="layui-btn layui-btn-danger layui-btn-xs permissions" permissions="hospital-del" lay-event="del">删除科室</a>
+</script>
+<!-- 表格状态列 -->
+<script type="text/html" id="hospital-tpl-state">
+ <input type="checkbox" lay-filter="hospital-tpl-state" value="{{d.hospitalId}}" value2="{{d.departmentId}}"
+ lay-skin="switch" lay-text="启用|禁用" {{d.enabled==true?'checked':''}} />
+</script>
+<!-- 套餐详情 -->
+<script type="text/html" id="productDetail">
+ <table class="layui-table" id="productDetail-table" lay-filter="productDetail-table"></table>
</script>
<script>
- layui.use(['form', 'table', 'laydate', 'util', 'config', 'admin', 'area'], function () {
+ layui.use(['form', 'table', 'laydate', 'util', 'config', 'admin', 'autocomplete', 'area'], function () {
var form = layui.form;
var table = layui.table;
var config = layui.config;
@@ -65,37 +77,100 @@
elem: '#hospital-table',
url: config.base_server + 'api-user/syshospital',
method: 'GET',
- headers: { 'Authorization': 'Bearer ' + config.getToken().access_token },
+ headers: {
+ 'Authorization': 'Bearer ' + config.getToken().access_token
+ },
page: true,
- cols: [[
- { field: 'hospitalName', width: 250, title: '医院名称' },
- { field: 'departmentName', width: 100, title: '科室' },
- {
- field: 'hospitalArea', width: 200, title: '所在地区', templet: function (d) {
- return d.hospitalProvince + "-" + d.hospitalCity + "-" + hospitalArea
- }
- },
- { field: 'hospitalLink', width: 100, title: '联系人' },
- { field: 'hospitalTel', width: 150, title: '联系方式' },
- {
- field: 'enabled', width: 100, sort: true, title: '状态', templet: function (d) {
- return d.hospitalState == 0 ? "试用" : "正式"
- }
- },
- {
- field: 'isScreen', width: 100, sort: true, title: '筛查', templet: function (d) {
- return d.isScreen ? "是" : "否"
- }
- },
- // { field: 'isAnswer', width: 100, sort: true, title: '医答',templet:function (d) {
- // return d.isScreen?"是":"否"
- // } },
+ cols: [
+ [{
+ field: 'hospitalId',
+ width: 180,
+ title: '医院编号',
+ fixed: 'left'
+ },
+ {
+ field: 'hospitalName',
+ width: 250,
+ title: '医院名称',
+ fixed: 'left'
+ },
+ {
+ field: 'departmentName',
+ width: 100,
+ title: '科室/部门',
+ fixed: 'left'
+ },
+ {
+ field: 'hospitalArea',
+ width: 200,
+ title: '所在地区',
+ templet: function (d) {
+ return ((d.hospitalProvince == null) ? "" : d.hospitalProvince) +
+ " " +
+ ((d.hospitalCity == null) ? "" : d.hospitalCity) + " " +
+ ((d.hospitalArea == null) ? "" : d.hospitalArea)
+ }
+ },
+ {
+ field: 'hospitalLink',
+ width: 100,
+ title: '联系人'
+ },
+ {
+ field: 'hospitalTel',
+ width: 150,
+ title: '联系方式'
+ },
+ // {
+ // field: 'enabled', width: 80, title: '状态', templet: function (d) {
+ // return d.hospitalState == 0 ? "试用" : "正式"
+ // }
+ // },
+ {
+ field: 'isScreen',
+ width: 80,
+ title: '筛查',
+ templet: function (d) {
+ return d.isScreen ? "是" : "否"
+ }
+ },
+ // { field: 'isAnswer', width: 80, title: '医答',templet:function (d) {
+ // return d.isScreen?"是":"否"
+ // } },
- { field: 'serverUserName', width: 150, title: '服务人员' },
- { field: 'createTime', width: 150, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd')}}</div>" },
- { field: 'hospitalId', width: 250, align: 'center', toolbar: '#businessRecords-table-bar', sort: true, title: '操作' }
- ]],
- done: function () {
+ {
+ field: 'serverUserName',
+ width: 100,
+ title: '服务人员'
+ },
+ {
+ field: 'createTime',
+ width: 150,
+ title: '创建时间',
+ templet: function (d) {
+ return new Date(d.createTime).dateFormat("yyyy-MM-dd hh:mm");
+ }
+ },
+ {
+ field: 'enabled',
+ width: 80,
+ templet: '#hospital-tpl-state',
+ title: '状态',
+ align: 'center',
+ fixed: 'right'
+ },
+ {
+ field: 'hospitalId',
+ width: 225,
+ align: 'center',
+ toolbar: '#businessRecords-table-bar',
+ title: '操作',
+ fixed: 'right'
+ }
+ ]
+ ],
+ done: function (res) {
+ permissionsInput(res, config);
}
});
//省份数据加载
@@ -104,8 +179,44 @@
table.on('tool(hospital-table)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
- if (layEvent === 'detail') { // 查看详情
- showEditModel(data);
+ if (layEvent === 'del') {
+ layer.confirm('确定要删除科室数据吗?', function (i) {
+ layer.load(2);
+ var whereModel = {
+ id: obj.data.hospitalId,
+ departmentId: obj.data.departmentId
+ };
+ admin.req('api-user/syshospital/delete', whereModel, function (data) {
+ layer.closeAll('loading');
+ layer.msg(data.msg, {
+ icon: 1,
+ time: 2000
+ }, function () {
+ $('#hospita-btn-search').click();
+ });
+ obj.del();
+ }, 'GET');
+ });
+ } else if (layEvent === "edit") {
+ //修改
+ admin.putTempData("t_hospital", data);
+ showEditModel("edit");
+ } else if (layEvent === "pay") {
+ //充值
+ admin.putTempData("t_hospital", data);
+ admin.popupCenter({
+ title: '医院科室充值',
+ path: 'pages/opration/recharge.html',
+ area: '1200px',
+ offset: '0px',
+ finish: function () {
+ $('#hospita-btn-search').click();
+ }
+ });
+ }
+ else if(layEvent==="productdetail-List")
+ {
+ productdetailShow(obj);
}
});
// 搜索按钮点击事件
@@ -113,11 +224,12 @@
var isscreen = $('#isscreen').val();
var isanswer = $('#isanswer').val();
var hospitalstate = $('#hospitalstate').val();
- var hospitalName = $('#hospitalName').val();
+ var hospitalName = $('#hosName').val();
- var hospitalProvince = $('#province').val();
- var hospitalCity = $('#city').val();
- var hospitalArea = $('#areas').val();
+ var hospitalProvince = ($("#province").val() != "") ? $('#province option:selected')
+ .text() : "";
+ var hospitalCity = ($("#city").val() != "") ? $('#city option:selected').text() : "";
+ var hospitalArea = ($("#areas").val() != "") ? $('#areas option:selected').text() : "";
var whereModel = {
isScreen: isscreen,
@@ -128,25 +240,144 @@
hospitalCity: hospitalCity,
hospitalArea: hospitalArea
};
- table.reload('hospital-table', { where: whereModel });
+ table.reload('hospital-table', {
+ where: whereModel
+ });
});
// // 显示编辑弹窗
var showEditModel = function (data) {
-
+ admin.popupCenter({
+ title: (strUtil.isEmpty(data)) ? '添加医院/科室' : '编辑医院/科室',
+ path: 'pages/opration/hospital_form_base.html',
+ area: '900px',
+ offset: '0px',
+ finish: function () {
+ $('#hospita-btn-search').click();
+ }
+ });
};
//装载市区数据
form.on("select(province)", function (data) {
- $("#city").empty();
- $("#areas").empty();
+ area.areasClear("#areas", 3);
area.areaData("#city", 2, data.value, "");
});
//装载区县数据
form.on("select(city)", function (data) {
- $("#areas").empty();
area.areaData("#areas", 3, data.value, "");
});
+ // 修改状态
+ form.on('switch(hospital-tpl-state)', function (obj) {
+ layer.load(2);
+ admin.req('api-user/syshospital/updateEnabled', {
+ id: obj.elem.value,
+ departmentId: obj.elem.getAttribute("value2"),
+ enabled: obj.elem.checked ? true : false
+ }, function (data) {
+ layer.closeAll('loading');
+ if (data.code == 0) {
+ layer.msg(data.msg, {
+ icon: 1,
+ time: 2000
+ });
+ } else {
+ layer.msg(data.msg, {
+ icon: 2,
+ time: 2000
+ });
+ $(obj.elem).prop('checked', !obj.elem.checked);
+ form.render('checkbox');
+ }
+ }, 'GET');
+ });
+ // 添加按钮点击事件
+ $('#hospital-btn-add').click(function () {
+ admin.putTempData("t_hospital", "");
+ showEditModel();
+ });
+ // 套餐按钮点击事件
+ var productdetailShow=function (obj) {
+ var data = obj.data;
+ layer.open({
+ type: 1,
+ title: data.hospitalName + '-' + data.departmentName + ' 所有套餐',
+ area: '1200px',
+ offset: '100px',
+ content: $('#productDetail').html(),
+ success: function () {
+ table.render({
+ elem: '#productDetail-table',
+ url: config.base_server +
+ 'api-opration/productorderdetail/alldetail',
+ method: 'GET',
+ where: {
+ 'hospitalId': data.hospitalId,
+ 'departmentId': data.departmentId
+ },
+ headers: {
+ 'Authorization': 'Bearer ' + config.getToken().access_token
+ },
+ page: true,
+ limit: 10,
+ limits: [5, 10],
+ cols: [
+ [{
+ field: 'proName',
+ width: 300,
+ title: '产品名称'
+ },
+ {
+ field: 'ailightCount',
+ width: 150,
+ title: '读片量(剩余)'
+ },
+ {
+ field: 'recordCount',
+ width: 150,
+ title: '报告量(剩余)'
+ },
+ {
+ field: 'isShare',
+ width: 100,
+ title: '是否共享',
+ templet: function (d) {
+ if (d.isShare)
+ return '共享'
+ else
+ return '私有'
+ }
+ },
+ {
+ field: 'proBegintime',
+ width: 150,
+ title: '开始时间',
+ templet: function (d) {
+ return new Date(d.proBegintime)
+ .dateFormat("yyyy/MM/dd");
+ }
+ },
+ {
+ field: 'proEndtime',
+ width: 180,
+ title: '结束时间',
+ templet: function (d) {
+ return new Date(d.proEndtime)
+ .dateFormat("yyyy/MM/dd");
+ }
+ },
+ {
+ field: 'createTime',
+ width: 160,
+ sort: true,
+ title: '创建时间'
+ }
+ ]
+ ]
+ });
+ }
+ });
+ };
});
</script>
\ No newline at end of file
--
Gitblit v1.8.0