| | |
| | | </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>  |
| | | <button id="hospital-btn-add" class="layui-btn icon-btn"><i class="layui-icon"></i>添加</button> |
| | | <button id="hospita-btn-search" class="layui-btn icon-btn"><i |
| | | class="layui-icon"></i>搜索</button>  |
| | | <button id="hospital-btn-add" class="layui-btn icon-btn"><i class="layui-icon"></i>添加医院</button> |
| | | </div> |
| | | |
| | | <!-- 数据表格 --> |
| | |
| | | |
| | | <!-- 表格操作列 --> |
| | | <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-primary layui-btn-xs" lay-event="detail">查看详情</a> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="addDepartment">添加科室</a> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a> |
| | | </script> |
| | | <!-- 表格状态列 --> |
| | |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | page: true, |
| | | cols: [[ |
| | | { field: 'hospitalName', width: 250, title: '医院名称' }, |
| | | { field: 'departmentName', width: 100, title: '科室' }, |
| | | { field: 'hospitalName', width: 250, title: '医院名称',fixed:'left'}, |
| | | { field: 'departmentName', width: 100, title: '科室' ,fixed:'left'}, |
| | | { |
| | | field: 'hospitalArea', width: 200, title: '所在地区', templet: function (d) { |
| | | field: 'hospitalArea', width: 250, 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: 'hospitalTel', width: 100, title: '联系方式' }, |
| | | { |
| | | field: 'enabled', width: 80, sort: true, title: '状态', templet: function (d) { |
| | | return d.hospitalState == 0 ? "试用" : "正式" |
| | |
| | | // return d.isScreen?"是":"否" |
| | | // } }, |
| | | |
| | | { field: 'serverUserName', width: 100, title: '服务人员' }, |
| | | { field: 'serverUserName', width: 100, title: '服务人员' }, |
| | | { field: 'createTime', width: 120, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd')}}</div>" }, |
| | | { field: 'enabled', width: 100, templet: '#hospital-tpl-state', sort: true, title: '状态' }, |
| | | { field: 'hospitalId', width: 300, align: 'center', toolbar: '#businessRecords-table-bar', title: '操作' } |
| | | { field: 'hospitalId', width: 300, align: 'center', toolbar: '#businessRecords-table-bar', title: '操作' ,fixed:'right'} |
| | | ]] |
| | | }); |
| | | //省份数据加载 |
| | |
| | | if (layEvent === 'del') { |
| | | layer.confirm('确定要删除吗?', function (i) { |
| | | layer.load(2); |
| | | var whereModel={ |
| | | var whereModel = { |
| | | id: obj.data.hospitalId, |
| | | departmentId: obj.data.departmentId |
| | | }; |
| | | departmentId: obj.data.departmentId |
| | | }; |
| | | admin.req('api-user/syshospital/delete', whereModel, function (data) { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, { icon: 1, time: 500 }, function () { |
| | |
| | | obj.del(); |
| | | }, 'GET'); |
| | | }); |
| | | } |
| | | else if (layEvent === 'addDepartment') { |
| | | //添加科室 |
| | | admin.putTempData("t_hospital", data); |
| | | admin.popupCenter({ |
| | | title: '添加科室', |
| | | path: 'pages/opration/department_form.html', |
| | | area: ['900px', '60%'], |
| | | finish: function () { |
| | | //清理缓存数据 |
| | | admin.putTempData("t_hospital", ""); |
| | | } |
| | | }) |
| | | } |
| | | else if (layEvent === "edit") { |
| | | //修改 |
| | | admin.putTempData("t_hospital", data); |
| | | showEditModel(); |
| | | } |
| | | }); |
| | | // 搜索按钮点击事件 |
| | |
| | | |
| | | // // 显示编辑弹窗 |
| | | var showEditModel = function (data) { |
| | | admin.popupCenter({ |
| | | title: '编辑医院/科室', |
| | | path: 'pages/opration/hospital_form_tab.html', |
| | | area: ['900px', '80%'], |
| | | finish: function () { |
| | | |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | //装载市区数据 |
| | |
| | | }); |
| | | // 添加按钮点击事件 |
| | | $('#hospital-btn-add').click(function () { |
| | | admin.popupCenter({ |
| | | title: '添加医院', |
| | | path: 'pages/opration/hospital_form_base.html', |
| | | finish: function () { |
| | | //renderTable(); |
| | | } |
| | | }) |
| | | showEditModel(); |
| | | }); |
| | | }); |
| | | </script> |