1.组织数据功能分离独立成模块
2.组织,医院,科室添加/修改功能
3.本周整理制作了3类JS通用插件(字典分类加载下来列表通用组件,省市区联动通用组件,文本框按输入内容自动搜索提示数据通用组件)
3 files added
8 files modified
| | |
| | | package com.kidgrow.usercenter.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.kidgrow.common.model.SuperModel; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | import org.hibernate.validator.constraints.NotEmpty; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | |
| | | /** |
| | | * 组织Id |
| | | */ |
| | | @NotEmpty(message = "组织Id不能为空") |
| | | @NotNull(message = "组织Id不能为空") |
| | | private Long orgId; |
| | | /** |
| | | * 医院Id |
| | | */ |
| | | @NotNull(message = "医院Id不能为空") |
| | | private Long hospitalId; |
| | | /** |
| | | * 负责的销售代表 |
| | | */ |
| | | @NotEmpty(message = "负责的销售代表不能为空") |
| | | @NotNull(message = "负责的销售代表不能为空") |
| | | private Long serverUserId; |
| | | /** |
| | | * 销售代表的名字 |
| | |
| | | /** |
| | | * 是否删除,1删除,0未删除 |
| | | */ |
| | | @TableLogic |
| | | private Boolean isDel; |
| | | } |
| | |
| | | import lombok.NoArgsConstructor; |
| | | import org.hibernate.validator.constraints.NotEmpty; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | |
| | | @NotEmpty(message = "医院名称 同组织名字不能为空") |
| | | private String hospitalName; |
| | | /** |
| | | * 组织ID |
| | | * 组织ID- |
| | | */ |
| | | @NotEmpty(message = "组织ID不能为空") |
| | | @NotNull(message = "组织ID不能为空") |
| | | private Long orgId; |
| | | /** |
| | | * 医院简称 |
| | |
| | | /** |
| | | * 医院类型ID 从字典表关联 社区/儿保等等之类 |
| | | */ |
| | | private Long hospitalTypeId; |
| | | private String hospitalTypeId; |
| | | /** |
| | | * 医院类型 社区/儿保等等之类 |
| | | */ |
| | |
| | | /** |
| | | * 资质ID |
| | | */ |
| | | private Long hospitalQualifiedId; |
| | | private String hospitalQualifiedId; |
| | | /** |
| | | * 资质(三甲医院) |
| | | */ |
| | |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.hibernate.validator.constraints.NotBlank; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | |
| | | List<SysUserOrg> sysUserOrgs = iSysUserOrgService.list(queryWrapper); |
| | | List<Long> userIds = sysUserOrgs.stream().map(e -> e.getUserId()).collect(Collectors.toList()); |
| | | QueryWrapper<SysUser> sysUserQueryWrapper=new QueryWrapper(); |
| | | sysUserQueryWrapper.in("id",userIds); |
| | | sysUserQueryWrapper.in("id",userIds.stream().distinct().collect(Collectors.toList())); |
| | | sysUsers= baseMapper.selectList(sysUserQueryWrapper); |
| | | } |
| | | } |
| | |
| | | package com.kidgrow.usercenter.controller; |
| | | |
| | | import java.util.Map; |
| | | import com.kidgrow.common.controller.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.ObjectError; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.usercenter.model.SysDepartment; |
| | | import com.kidgrow.usercenter.service.ISysDepartmentService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import com.kidgrow.usercenter.model.SysDepartment; |
| | | import com.kidgrow.usercenter.service.ISysDepartmentService; |
| | | import com.kidgrow.common.model.*; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.validation.ObjectError; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | return ResultBody.failed().msg(errMsg.toString()); |
| | | } else { |
| | | //先检查该医院下的该科室名是否已经存在? |
| | | SysDepartment sysDepartmentTemp=new SysDepartment(); |
| | | sysDepartmentTemp.setHospitalId(sysDepartment.getHospitalId()); |
| | | sysDepartmentTemp.setDepartmentName(sysDepartment.getDepartmentName().trim()); |
| | | sysDepartmentTemp=sysDepartmentService.findByObject(sysDepartmentTemp); |
| | | if (sysDepartmentTemp!=null) { |
| | | return ResultBody.failed().msg(String.format("该医院下已经存在 %s",sysDepartment.getDepartmentName())); |
| | | } |
| | | boolean v= sysDepartmentService.saveOrUpdate(sysDepartment); |
| | | if(v) { |
| | | return ResultBody.ok().data(sysDepartment).msg("保存成功"); |
| | |
| | | package com.kidgrow.usercenter.controller; |
| | | |
| | | import java.util.Map; |
| | | import com.kidgrow.common.controller.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.model.SysOrganization; |
| | | import com.kidgrow.usercenter.service.ISysOrganizationService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import com.kidgrow.usercenter.service.ISysOrganizationService; |
| | | import com.kidgrow.common.model.*; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.validation.ObjectError; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | return ResultBody.ok().data(sysOrganizationService.findList(params)); |
| | | } |
| | | /** |
| | | * 列表 |
| | | */ |
| | | @ApiOperation(value = "模糊查询列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping("/listByName") |
| | | public ResultBody listByName(@RequestParam Map<String, Object> params) { |
| | | if(params.size()==0){ |
| | | params.put("page",1); |
| | | params.put("limit",10); |
| | | } |
| | | return ResultBody.ok().data(sysOrganizationService.findList(params).getData()); |
| | | } |
| | | @ApiOperation(value = "查询列表by MAP") |
| | | @GetMapping("getListByMap") |
| | | public ResultBody getListByMap(@RequestParam Map<String, Object> params) { |
| | |
| | | } |
| | | |
| | | layui.link('/module/complete/autocomplete.css'); |
| | | layui.define(['jquery', 'laytpl', 'layer'], function (e) { |
| | | layui.define(['jquery', 'laytpl', 'layer','config'], function (e) { |
| | | "use strict"; |
| | | var hint = layui.hint(), |
| | | $ = layui.jquery, |
| | |
| | | filter = 'layui-autocomplete', |
| | | container = 'layui-form-autocomplete', |
| | | container_focus = 'layui-form-autocomplete-focus', |
| | | sysconfig=layui.config, |
| | | system = { |
| | | config: { |
| | | template: ['<div class="layui-form-autocomplete">', '<dl class="layui-anim layui-anim-upbit">', '</dl>', '</div>'].join(''), |
| | | layout: ['<dd data-index="{{d.index}}">{{d.text}}</dd>'].join(''), |
| | | template_txt: '{{d.text}}', |
| | | template_val: '{{d.value}}', |
| | | cache: false |
| | | cache: false, |
| | | keywordsName:'' |
| | | }, |
| | | data: {} |
| | | }, |
| | |
| | | msg: 'msg' |
| | | }, |
| | | request: { |
| | | keywords: 'keywords' |
| | | keywords: system.config.keywordsName |
| | | }, |
| | | statusCode: 0, |
| | | time_limit: 300, |
| | |
| | | } |
| | | job.prototype.render = function () { |
| | | var _self = this, _config = _self.config; |
| | | _config.request.keywords=_config.keywordsName; |
| | | if (_config.elem = $(_config.elem), _config.where = _config.where || {}, !_config.elem[0]) return _self; |
| | | var _elem = _config.elem, |
| | | _container = _elem.next('.' + container), |
| | |
| | | if ((_config.cache || !_config.url) && _config.data instanceof Object && Object.keys(_config.data).length > 0) return _self.renderData(_config.data); |
| | | var keywords = _config.request.keywords |
| | | var params = { |
| | | t: new Date().getTime() |
| | | //t: new Date().getTime() |
| | | } |
| | | params[keywords] = _config.filter; |
| | | params[keywords] = _config.filter.replace("'",""); |
| | | |
| | | var $loading = $('<i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop"></i>'); |
| | | $.ajax($.extend({ |
| | |
| | | data: $.extend(params, _config.params instanceof Function ? _config.params() :_config.params), |
| | | contentType: 'text/json,charset=utf-8', |
| | | dataType: "json", |
| | | beforeSend: function () { |
| | | beforeSend: function (xhr) { |
| | | xhr.setRequestHeader("Authorization", "Bearer " + sysconfig.getToken().access_token); |
| | | xhr.setRequestHeader("Content-Type", "application/json"); |
| | | $loading.attr('style', [ |
| | | 'position:absolute', |
| | | 'left:' + (_elem.offset().left + _elem.outerWidth() - 20) + 'px', |
New file |
| | |
| | | <form id="department-form" lay-filter="department-form" class="layui-form model-form" method="POST"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label">医院名称</label> |
| | | <div class="layui-input-block"> |
| | | <input id="hospitalName" name="hospitalName" type="text" class="layui-input" maxlength="50" |
| | | lay-verify="required" required style="width: 200px;" value="" readonly /> |
| | |  </div> |
| | | </div> |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label">科室名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="departmentName" id="departmentName" placeholder="科室名称" type="text" class="layui-input" |
| | | maxlength="50" lay-verify="required" required style="width: 150px;" /> |
| | |  </div> |
| | | </div> |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label">服务人员</label> |
| | | <div class="layui-input-block"> |
| | | <input name="serverUserId" id="serverUserId" type="hidden" value="" /> |
| | | <select name="serverUserName" id="serverUserName" lay-filter="serverUserName" style="width: 150px;"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">科室简介</label> |
| | | <div class="layui-input-block"> |
| | | <textarea name="departmentAbout" class="layui-textarea" maxlength="500"></textarea> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item model-form-footer"> |
| | | <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button> |
| | | <button class="layui-btn" lay-filter="department-form-submit" lay-submit>保存</button> |
| | | </div> |
| | | <input type="hidden" id="orgId" name="orgId" value="" /> |
| | | <input type="hidden" id="hospitalId" name="hospitalId" value="" /> |
| | | </form> |
| | | |
| | | <script> |
| | | parent.layui.use(['form', 'table', 'util', 'config', 'admin', 'formSelects'], function () { |
| | | var form = parent.layui.form; |
| | | var table = parent.layui.table; |
| | | var config = parent.layui.config; |
| | | var layer = parent.layui.layer; |
| | | var util = parent.layui.util; |
| | | var admin = parent.layui.admin; |
| | | var formSelects = parent.layui.formSelects; |
| | | var $ = parent.layui.jquery; |
| | | debugger |
| | | // 回显组织数据 |
| | | let hospitals = admin.getTempData('t_hospital'); |
| | | if (hospitals != null) { |
| | | $('input[name="hospitalName"]').val(hospitals.hospitalName); |
| | | $('input[name="orgId"]').val(hospitals.orgId); |
| | | if (!strUtil.isEmpty(hospitals.id)) { |
| | | $('input[name="hospitalId"]').val(hospitals.id); |
| | | } |
| | | else { |
| | | $('input[name="hospitalId"]').val(hospitals.hospitalId); |
| | | } |
| | | } |
| | | //加载当前所在部门的在职员工 |
| | | admin.req('api-user/users/getThisUserOrganizationUser', {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | if (data.data.length > 0) { |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | console.log(item.nickname) |
| | | $('#serverUserName').append(new Option(item.nickname, item.id, false, false)); |
| | | }) |
| | | $('#serverUserName').val(config.getUser().id); |
| | | $('#serverUserId').val(config.getUser().id); |
| | | } |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } |
| | | }, 'get'); |
| | | // 表单提交事件 |
| | | form.on('submit(department-form-submit)', function (data) { |
| | | layer.load(2); |
| | | if (data.field != null) { |
| | | data.field.serverUserId = data.field.serverUserName; |
| | | data.field.serverUserName = $("#serverUserName option:selected").text(); |
| | | admin.req('api-user/sysdepartment', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 1000 }, function () { |
| | | admin.finishPopupCenter(); |
| | | }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | } |
| | | }, "POST"); |
| | | } |
| | | else { |
| | | layer.msg("数据异常!", { icon: 2, time: 1000 }); |
| | | } |
| | | return false; |
| | | }); |
| | | form.render(); |
| | | }); |
| | | </script> |
| | |
| | | </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> |
| | |
| | | <fieldset class="layui-elem-field layui-field-title"> |
| | | <legend>医院基本信息</legend> |
| | | </fieldset> |
| | | <form id="hospital-form" lay-filter="hospital-form" class="layui-form model-form" method="POST"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医院名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalName" id="hospitalName" placeholder="请输入医院名称" type="text" class="layui-input" |
| | | maxlength="50" lay-verify="required" required autocomplete="on" /> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm7"> |
| | | <label class="layui-form-label">医院名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalName" id="hospitalName" placeholder="请输入医院名称" type="text" class="layui-input" |
| | | maxlength="50" lay-verify="required" required autocomplete="on" style="width: 390px;" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">医院简称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalShortName" type="text" class="layui-input" maxlength="50" |
| | | style="width: 200px;" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医院简称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalShortName" type="text" class="layui-input" maxlength="50" /> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm7"> |
| | | <label class="layui-form-label">联系电话</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalTel" id="hospitalTel" type="text" class="layui-input" maxlength="50" |
| | | style="width: 390px;" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">联系人</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalLink" type="text" class="layui-input" maxlength="50" style="width: 200px;" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医院类型</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalTypeId" id="hospitalTypeId" type="hidden" /> |
| | | <select name="hospitalTypeName" id="hospitalTypeName" lay-filter="hospitalTypeName"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm7"> |
| | | <label class="layui-form-label">医院类型</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalTypeId" id="hospitalTypeId" type="hidden" value=""/> |
| | | <select name="hospitalTypeName" id="hospitalTypeName" lay-filter="hospitalTypeName" |
| | | style="width: 300px;"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">医院资质</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalQualifiedId" id="hospitalQualifiedId" type="hidden" value=""/> |
| | | <select name="hospitalQualifiedName" id="hospitalQualifiedName" lay-filter="hospitalQualifiedName" |
| | | style="width: 300px;"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医院资质</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalQualifiedId" id="hospitalQualifiedId" type="hidden" /> |
| | | <select name="hospitalQualifiedName" id="hospitalQualifiedName" lay-filter="hospitalQualifiedName"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">所在地区</label> |
| | | <div class="layui-input-block"> |
| | | <select id="hospitalProvince" placeholder="省份" lay-filter="hospitalProvince"> |
| | | </select> |
| | | <select id="hospitalCity" placeholder="市" lay-filter="hospitalCity"> |
| | | <option value="">选择市</option> |
| | | </select> |
| | | <select id="hospitalArea" placeholder="区县" lay-filter="hospitalArea"> |
| | | <option value="">选择区县</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">区号</label> |
| | | <div class="layui-input-block"> |
| | | <input name="areaCode" type="text" class="layui-input" maxlength="10" /> |
| | | <div class="layui-row"> |
| | | <label class="layui-form-label">所在地区</label> |
| | | <div class="layui-input-block"> |
| | | <div class="layui-col-sm4"> |
| | | <select id="hospitalProvince" placeholder="省份" lay-filter="hospitalProvince" style="width: 400px;"> |
| | | </select></div> |
| | | <div class="layui-col-sm4"> |
| | | <select id="hospitalCity" placeholder="市" lay-filter="hospitalCity" style="width: 350px;"> |
| | | <option value="">选择市</option> |
| | | </select></div> |
| | | <div class="layui-col-sm4"> |
| | | <select id="hospitalArea" placeholder="区县" lay-filter="hospitalArea" style="width: 350px;"> |
| | | <option value="">选择区县</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">经度</label> |
| | | <div class="layui-input-block"> |
| | | <input name="longitude" type="text" class="layui-input" maxlength="20" /> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">区号</label> |
| | | <div class="layui-input-block"> |
| | | <input name="areaCode" type="text" class="layui-input" maxlength="10" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">经度</label> |
| | | <div class="layui-input-block"> |
| | | <input name="longitude" type="text" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">纬度</label> |
| | | <div class="layui-input-block"> |
| | | <input name="latitude" type="text" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">纬度</label> |
| | | <div class="layui-input-block"> |
| | | <input name="latitude" type="text" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医院简介</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospital_about" type="text" class="layui-input" maxlength="500" /> |
| | | <textarea name="hospital_about" class="layui-textarea" maxlength="500"></textarea> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item model-form-footer"> |
| | | <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button> |
| | | <button class="layui-btn" lay-filter="hospital-form-submit" lay-submit>保存</button> |
| | | </div> |
| | | <input type="hidden" id="orgId" name="orgId" value=""/> |
| | | </form> |
| | | |
| | | <script> |
| | | layui.use(['form', 'table', 'laydate', 'util', 'config', 'admin', 'area', 'formSelects', 'dic', 'autocomplete'], function () { |
| | | var form = layui.form; |
| | | var table = layui.table; |
| | | var config = layui.config; |
| | | var layer = layui.layer; |
| | | var util = layui.util; |
| | | var admin = layui.admin; |
| | | var area = layui.area; |
| | | var dic = layui.dic; |
| | | var formSelects = layui.formSelects; |
| | | var autocomplete = layui.autocomplete; |
| | | parent.layui.use(['form', 'table','util', 'config', 'admin', 'area', 'formSelects', 'dic', 'autocomplete'], function () { |
| | | var form = parent.layui.form; |
| | | var table = parent.layui.table; |
| | | var config = parent.layui.config; |
| | | var layer = parent.layui.layer; |
| | | var util = parent.layui.util; |
| | | var admin = parent.layui.admin; |
| | | var area = parent.layui.area; |
| | | var dic = parent.layui.dic; |
| | | var formSelects = parent.layui.formSelects; |
| | | var autocomplete = parent.layui.autocomplete; |
| | | var $ = parent.layui.jquery; |
| | | |
| | | autocomplete.render({ |
| | | elem: $('#hospitalName'), |
| | |
| | | form.on("select(hospitalTypeName)", function (data) { |
| | | $("#hospitalTypeId").val(data.value); |
| | | }); |
| | | |
| | | // 回显组织数据 |
| | | let orgs = admin.getTempData('t_org'); |
| | | if (orgs != null) { |
| | | $('input[name="hospitalName"]').val(orgs.orgName); |
| | | $('input[name="orgId"]').val(orgs.id); |
| | | form.render(); |
| | | } |
| | | // 表单提交事件 |
| | | form.on('submit(hospital-form-submit)', function (data) { |
| | | layer.load(2); |
| | | if(data.field!=null){ |
| | | |
| | | data.field.hospitalTypeName=$("#hospitalTypeName option:selected").text(); |
| | | data.field.hospitalQualifiedName=$("#hospitalQualifiedName option:selected").text(); |
| | | data.field.hospitalProvince=$("#hospitalProvince option:selected").text(); |
| | | data.field.hospitalCity=$("#hospitalCity option:selected").text(); |
| | | data.field.hospitalArea=$("#hospitalArea option:selected").text(); |
| | | |
| | | admin.req('api-user/syshospital', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | //将医院数据存入本地 |
| | | admin.putTempData('t_hospital', data.data); |
| | | layer.msg(data.msg, { icon: 1, time: 1000 }, function () { |
| | | //清理组织数据 |
| | | admin.putTempData('t_org',''); |
| | | }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | } |
| | | }, "POST");} |
| | | else{ |
| | | layer.msg("数据异常!", { icon: 2, time: 1000 }); |
| | | } |
| | | return false; |
| | | }); |
| | | }); |
| | | </script> |
New file |
| | |
| | | <div class="layui-tab"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">组织信息</li> |
| | | <li>基本信息</li> |
| | | </ul> |
| | | <div class="layui-tab-content"> |
| | | <div class="layui-tab-item layui-show"> |
| | | <form id="app-form" lay-filter="app-form" class="layui-form model-form"> |
| | | <input name="id" type="hidden" /> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">上级组织</label> |
| | | <div class="layui-input-block"> |
| | | <input name="orgParentId" id="orgParentId" type="hidden" value="-1"/> |
| | | <input placeholder="输入上级组织名称..." pname="orgParentName" id="orgParentName" type="text" class="layui-input" maxlength="50" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">组织类型</label> |
| | | <div class="layui-input-block"> |
| | | <select id="orgAttr" name="orgAttr" placeholder="选择一个类型"> |
| | | <option value="0" selected='selected'>集团</option> |
| | | <option value="1">公司/医院</option> |
| | | <option value="2">部门/科室</option> |
| | | <option value="3">子部门/子科室</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">组织层级</label> |
| | | <div class="layui-input-block"> |
| | | <select name="orgLevel" id='orgLevel' placeholder="选择一个层级"> |
| | | <option value="0" selected='selected'>1级</option> |
| | | <option value="1">2级</option> |
| | | <option value="2">3级</option> |
| | | <option value="3">4级</option> |
| | | <option value="4">5级</option> |
| | | <option value="5">6级</option> |
| | | <option value="6">7级</option> |
| | | <option value="7">8级</option> |
| | | <option value="8">9级</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">组织名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="orgName" id="orgName" type="text" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item model-form-footer"> |
| | | <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button> |
| | | <button class="layui-btn" id="sure" lay-filter="org-form-submit" lay-submit>保存</button> |
| | | </div> |
| | | <input name="id" id="id" type="hidden" value=""/> |
| | | </form> |
| | | </div> |
| | | <div class="layui-tab-item"> |
| | | </div> |
| | | </div> |
| | | <script> |
| | | layui.use(['form', 'table', 'laydate', 'util','config', 'admin','element','autocomplete'], function () { |
| | | var form = layui.form; |
| | | var table = layui.table; |
| | | var config = layui.config; |
| | | var layer = layui.layer; |
| | | var util = layui.util; |
| | | var admin = layui.admin; |
| | | //树形插件 |
| | | var tree = layui.tree; |
| | | var $ = layui.jquery; |
| | | var element = layui.element; |
| | | var autocomplete=layui.autocomplete; |
| | | //自动完成-上级组织 |
| | | autocomplete.render({ |
| | | elem: $('#orgParentName')[0], |
| | | keywordsName:'orgName',//查询关键字名称 |
| | | url: config.base_server +'api-user/sysorganization/listByName?page=1&limit=9999999', |
| | | template_val: '{{d.orgName}}',//选择后文本框显示的数据字段 |
| | | template_txt: "<div class='layui-table-cell'>{{d.orgName}}</div>",//下拉列表模板 |
| | | onselect: function (resp) { |
| | | $("#orgParentId").val(resp.id); |
| | | $("#orgLevel").val(resp.orgLevel+1); |
| | | $("#orgAttr").val(resp.orgLevel+1); |
| | | form.render(); |
| | | } |
| | | }) |
| | | |
| | | //自动完成-医院名称 |
| | | autocomplete.render({ |
| | | elem: $('#orgName')[0], |
| | | keywordsName:'orgName',//查询关键字名称 |
| | | url: config.base_server +'api-user/sysorganization/listByName?page=1&limit=9999999', |
| | | template_val: '{{d.orgName}}',//选择后文本框显示的数据字段 |
| | | template_txt: "<div class='layui-table-cell'>{{d.orgName}}</div>",//下拉列表模板 |
| | | onselect: function (resp) { |
| | | $("#id").val(resp.id); |
| | | form.render(); |
| | | } |
| | | }) |
| | | |
| | | // 表单提交事件 |
| | | form.on('submit(org-form-submit)', function (data) { |
| | | layer.load(2); |
| | | admin.req('api-user/sysorganization', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | //将组织数据存入本地 |
| | | admin.putTempData('t_org', data.data); |
| | | //组织数据维护成功后,进入医院基本信息页面 |
| | | layer.msg("组织数据编辑成功,继续编辑基本数据...", { icon: 1, time: 1000 },function(){ |
| | | //admin.finishPopupCenter(); |
| | | }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | } |
| | | }, "POST"); |
| | | return false; |
| | | }); |
| | | form.render(); |
| | | getData(); |
| | | }); |
| | | </script> |
New file |
| | |
| | | <form id="app-form" lay-filter="app-form" class="layui-form model-form"> |
| | | <input name="id" type="hidden" /> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">上级组织:</label> |
| | | <div class="layui-input-block"> |
| | | <div id="orgParentId-tree" class="demo-tree demo-tree-box"></div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">上级组织:</label> |
| | | <div class="layui-input-block"> |
| | | <input name="orgParentId" id="orgParentId" type="hidden" value="-1" class="layui-input" maxlength="20" /> |
| | | <input name="orgParentName" id="orgParentName" type="text" class="layui-input" maxlength="50" readonly /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">组织类型:</label> |
| | | <div class="layui-input-block"> |
| | | <select id="orgAttr" name="orgAttr" placeholder="选择一个类型"> |
| | | <option value="">-请选择-</option> |
| | | <option value="0">集团</option> |
| | | <option value="1">公司/医院</option> |
| | | <option value="2">部门/科室</option> |
| | | <option value="3">子部门/子科室</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">组织层级:</label> |
| | | <div class="layui-input-block"> |
| | | <select name="orgLevel" id='orgLevel' placeholder="选择一个层级"> |
| | | <option value="">-请选择-</option> |
| | | <option value="0">1级</option> |
| | | <option value="1">2级</option> |
| | | <option value="2">3级</option> |
| | | <option value="3">4级</option> |
| | | <option value="4">5级</option> |
| | | <option value="5">6级</option> |
| | | <option value="6">7级</option> |
| | | <option value="7">8级</option> |
| | | <option value="8">9级</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医院/科室名称:</label> |
| | | <div class="layui-input-block"> |
| | | <input name="orgName" type="text" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item model-form-footer"> |
| | | <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button> |
| | | <button class="layui-btn" id="sure" lay-filter="org-form-submit" lay-submit>保存</button> |
| | | </div> |
| | | </form> |
| | | <script> |
| | | parent.layui.use(['form', 'table', 'laydate', 'util', 'tree', 'config', 'admin'], function () { |
| | | var form = parent.layui.form; |
| | | var table = parent.layui.table; |
| | | var config = parent.layui.config; |
| | | var layer = parent.layui.layer; |
| | | var util = parent.layui.util; |
| | | var admin = parent.layui.admin; |
| | | //树形插件 |
| | | var tree = parent.layui.tree; |
| | | var $ = parent.layui.jquery; |
| | | |
| | | //组织结构树 |
| | | var getData = function () { |
| | | admin.req('api-user/sysorganization/getTree', { is_del: 0, enabled: 1 }, function (data) { |
| | | if (0 === data.code) { |
| | | tree({ |
| | | elem: "#orgParentId-tree", |
| | | nodes: data.data, |
| | | click: function (node) { |
| | | //将数据赋值 |
| | | $("#orgParentId").val(node.id); |
| | | $("#orgParentName").val(node.name); |
| | | $("#orgAttr").val(node.level + 1); |
| | | $("#orgLevel").val(node.level + 1); |
| | | //刷新form表单 |
| | | form.render('select'); |
| | | } |
| | | }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | } |
| | | }, 'get'); |
| | | } |
| | | |
| | | // 表单提交事件 |
| | | form.on('submit(org-form-submit)', function (data) { |
| | | layer.load(2); |
| | | admin.req('api-user/sysorganization', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | //将组织数据存入本地 |
| | | admin.putTempData('t_org', data.data); |
| | | //组织数据维护成功后,进入医院基本信息页面 |
| | | layer.msg("组织数据编辑成功,继续编辑基本数据...", { icon: 1, time: 1000 },function(){ |
| | | //admin.finishPopupCenter(); |
| | | }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | } |
| | | }, "POST"); |
| | | return false; |
| | | }); |
| | | form.render(); |
| | | getData(); |
| | | }); |
| | | </script> |