Merge branch 'dev' of http://192.168.2.240:7070/r/kidgrow-microservices-platform into dev
Conflicts:
kidgrow-commons/kidgrow-common-spring-boot-starter/src/main/java/com/kidgrow/common/constant/ServiceNameConstants.java
65 files modified
3 files added
| | |
| | | /** |
| | | * base64图片下载 |
| | | */ |
| | | ResultBody baseDownLoad(Map<String, Object> map); |
| | | ResultBody baseDownLoad(Map<String, Object> map) throws Exception; |
| | | } |
| | |
| | | package com.kidgrow.filecenter.service.impl; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.aliyun.oss.model.OSSObject; |
| | | import com.aliyun.oss.model.ObjectMetadata; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import sun.misc.BASE64Decoder; |
| | | import sun.misc.BASE64Encoder; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | |
| | | protected abstract void uploadFile(MultipartFile file, FileInfo fileInfo) throws Exception; |
| | | protected abstract void fileUpLoadOss(FileInfo fileInfo,String newFilePath, InputStream fileStream); |
| | | protected abstract String FilePath(String imgType,String folderByDate); |
| | | protected abstract OSSObject down(String url); |
| | | |
| | | /** |
| | | * 删除文件 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody baseDownLoad(Map<String, Object> map) { |
| | | public ResultBody baseDownLoad(Map<String, Object> map) throws Exception { |
| | | List<FileInfo> fileInfos = baseMapper.selectByMap(map); |
| | | if(fileInfos.size()>0){ |
| | | FileInfo fileInfo = fileInfos.get(0); |
| | | InputStream in = null; |
| | | byte[] data = null; |
| | | //读取图片字节数组 |
| | | try{ |
| | | in = new FileInputStream(fileInfo.getUrl()); |
| | | data = new byte[in.available()]; |
| | | in.read(data); |
| | | in.close(); |
| | | }catch (IOException e){ |
| | | e.printStackTrace(); |
| | | } |
| | | //对字节数组Base64编码 |
| | | BASE64Encoder encoder = new BASE64Encoder(); |
| | | OSSObject down1 = this.down(fileInfo.getUrl().replace("https://kidgrow.oss-accelerate.aliyuncs.com/","")); |
| | | InputStream objectContent = down1.getObjectContent(); |
| | | //返回Base64编码过的字节数组字符串 |
| | | String encode = encoder.encode(data); |
| | | byte[] data = null; |
| | | // 读取图片字节数组 |
| | | try { |
| | | ByteArrayOutputStream swapStream = new ByteArrayOutputStream(); |
| | | byte[] buff = new byte[100]; |
| | | int rc = 0; |
| | | while ((rc = objectContent.read(buff, 0, 100)) > 0) { |
| | | swapStream.write(buff, 0, rc); |
| | | } |
| | | data = swapStream.toByteArray(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | if (objectContent != null) { |
| | | try { |
| | | objectContent.close(); |
| | | down1.close(); |
| | | } catch (IOException e) { |
| | | throw new Exception("输入流关闭异常"); |
| | | } |
| | | } |
| | | } |
| | | String encode="data:"+fileInfo.getContentType()+";base64,"+Base64.getEncoder().encodeToString(data); |
| | | return ResultBody.ok().data(encode); |
| | | }else { |
| | | return ResultBody.failed("获取数据失败"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import com.aliyun.oss.OSSClient; |
| | | import com.aliyun.oss.common.auth.DefaultCredentialProvider; |
| | | import com.aliyun.oss.model.GetObjectRequest; |
| | | import com.aliyun.oss.model.OSSObject; |
| | | import com.kidgrow.common.constant.SecurityConstants; |
| | | import com.kidgrow.common.utils.DateUtil; |
| | | import com.kidgrow.common.utils.StringUtils; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.InputStream; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | |
| | | { |
| | | ossClient.putObject(fileProperties.getOss().getBucketName(), newFilePath, fileStream); |
| | | fileInfo.setUrl(fileProperties.getOss().getDomain() + newFilePath); |
| | | |
| | | } |
| | | public OSSObject down(String url){ |
| | | GetObjectRequest request=new GetObjectRequest(fileProperties.getOss().getBucketName(),url); |
| | | return ossClient.getObject(request); |
| | | } |
| | | /** |
| | | * 组合sso上的文件路径 |
| | |
| | | package com.kidgrow.filecenter.config; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.aliyun.oss.model.OSSObject; |
| | | import com.kidgrow.filecenter.model.FileInfo; |
| | | import com.kidgrow.filecenter.properties.FileServerProperties; |
| | | import com.kidgrow.filecenter.service.impl.AbstractIFileService; |
| | |
| | | } |
| | | |
| | | @Override |
| | | protected OSSObject down(String url) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean deleteFile(FileInfo fileInfo) { |
| | | if (fileInfo != null && StrUtil.isNotEmpty(fileInfo.getPath())) { |
| | | StorePath storePath = StorePath.parseFromUrl(fileInfo.getPath()); |
| | |
| | | package com.kidgrow.filecenter.config; |
| | | |
| | | import com.aliyun.oss.model.OSSObject; |
| | | import com.kidgrow.filecenter.model.FileInfo; |
| | | import com.kidgrow.filecenter.properties.FileServerProperties; |
| | | import com.kidgrow.filecenter.service.impl.AbstractIFileService; |
| | |
| | | } |
| | | |
| | | @Override |
| | | protected OSSObject down(String url) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean deleteFile(FileInfo fileInfo) { |
| | | try { |
| | | Response response = bucketManager.delete(fileProperties.getOss().getBucketName(), fileInfo.getPath()); |
| | |
| | | /** |
| | | * base64图片下载 |
| | | */ |
| | | @PostMapping(value="baseDownLoad",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
| | | public ResultBody baseDownLoad(@RequestBody Map<String,Object> map){ |
| | | @PostMapping(value="baseDownLoad") |
| | | public ResultBody baseDownLoad(@RequestBody Map<String,Object> map) throws Exception{ |
| | | return fileService.baseDownLoad(map); |
| | | } |
| | | |
| | |
| | | import com.kidgrow.oprationcenter.vo.ConsumptionRequest; |
| | | import com.kidgrow.ribbon.config.FeignHttpInterceptorConfig; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | |
| | | */ |
| | | @PostMapping(value = "consumption/Artificial") |
| | | ResultBody consumptionArtificial (@RequestBody ConsumptionRequest consumptionRequest); |
| | | /** |
| | | * 获取医院套餐是否到期和到期时间 |
| | | * data内 isend为true说明套餐到期 |
| | | * endtime上套餐的到期时间 |
| | | * @param hospitalId |
| | | * @param departmentId |
| | | */ |
| | | @GetMapping(value = "productorderdetail/UserProductDetailData") |
| | | ResultBody UserProductDetailData (@RequestParam Long hospitalId, Long departmentId); |
| | | } |
| | |
| | | return new ConsumptionService() { |
| | | @Override |
| | | public ResultBody consumptionAIStart(ConsumptionRequest consumptionRequest) { |
| | | return ResultBody.failed().msg("consumptionAIStart的FeignClient调用参数传递测试失败"); |
| | | return ResultBody.failed().msg("consumptionAIStart的FeignClient调用失败"); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody consumptionAIReturn(ConsumptionRequest consumptionRequest) { |
| | | return ResultBody.failed().msg("consumptionAIReturn的FeignClient调用参数传递测试失败"); |
| | | return ResultBody.failed().msg("consumptionAIReturn的FeignClient调用失败"); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody consumptionAIFail(ConsumptionRequest consumptionRequest) { |
| | | return ResultBody.failed().msg("consumptionAIFail的FeignClient调用参数传递测试失败"); |
| | | return ResultBody.failed().msg("consumptionAIFail的FeignClient调用失败"); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody consumptionArtificial(ConsumptionRequest consumptionRequest) { |
| | | return ResultBody.failed().msg("consumptionArtificial的FeignClient调用参数传递测试失败"); |
| | | return ResultBody.failed().msg("consumptionArtificial的FeignClient调用失败"); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody UserProductDetailData(Long hospitalId, Long departmentId) { |
| | | return ResultBody.failed().msg("UserProductDetailData的FeignClient调用失败"); |
| | | } |
| | | }; |
| | | } |
| | |
| | | package com.kidgrow.oprationcenter.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | |
| | | * 状态,1启用,0停用 |
| | | */ |
| | | private Boolean enabled; |
| | | /** |
| | | * 产品结束时间-供前端使用 |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date endTime; |
| | | /** |
| | | * 产品结束时间-供前端使用 |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date beginTime; |
| | | /** |
| | | * 共享,1是,0不 |
| | | */ |
| | | private Boolean isShare; |
| | | // /** |
| | | // * 产品结束时间-供前端使用 |
| | | // */ |
| | | // @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | // private Date endTime; |
| | | // /** |
| | | // * 产品结束时间-供前端使用 |
| | | // */ |
| | | // @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | // @TableField(exist = false) |
| | | // private Date beginTime; |
| | | // /** |
| | | // * 共享,1是,0不 |
| | | // */ |
| | | // private Boolean isShare; |
| | | /** |
| | | * 创建者的部门 |
| | | */ |
New file |
| | |
| | | package com.kidgrow.oprationcenter.vo; |
| | | |
| | | import com.kidgrow.oprationcenter.model.ProductOrderDetail; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ProductOrderDetailVo extends ProductOrderDetail { |
| | | private String hospitalName; |
| | | private Long hospitalId; |
| | | private String departmentName; |
| | | private Long departmentId; |
| | | } |
| | |
| | | |
| | | ResultBody biUserNowProduct(Long hospitalId,Long departmentId); |
| | | ResultBody UserProductDetailData(Long hospitalId,Long departmentId); |
| | | |
| | | PageResult all(Map<String, Object> params); |
| | | } |
| | | |
| | |
| | | BusinessRecords businessRecords=new BusinessRecords(); |
| | | businessRecords.setAppName(httpServletRequest.getHeader(SecurityConstants.TENANT_HEADER)); |
| | | businessRecords.setUserId(Long.valueOf(httpServletRequest.getHeader(SecurityConstants.USER_ID_HEADER))); |
| | | businessRecords.setUserName(httpServletRequest.getHeader(SecurityConstants.USER_REAL_NAME)); |
| | | businessRecords.setUserName(httpServletRequest.getHeader(SecurityConstants.USER_HEADER)); |
| | | businessRecords.setRecordTitle(recordTitle); |
| | | businessRecords.setRecordIp(httpServletRequest.getHeader(CommonConstant.USER_AGENT_IP)); |
| | | businessRecords.setRecordDetail(recordNote); |
| | |
| | | import com.kidgrow.oprationcenter.feign.DiagnosticService; |
| | | import com.kidgrow.oprationcenter.mapper.ConsumptionRecordMapper; |
| | | import com.kidgrow.oprationcenter.mapper.ProductOrderDetailMapper; |
| | | import com.kidgrow.oprationcenter.mapper.ProductOrderMapper; |
| | | import com.kidgrow.oprationcenter.model.ConsumptionRecord; |
| | | import com.kidgrow.oprationcenter.model.ProductOrder; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderDetail; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderDetailService; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderService; |
| | | import com.kidgrow.oprationcenter.vo.*; |
| | | import com.kidgrow.usercenter.feign.SysDoctorService; |
| | | import com.kidgrow.usercenter.feign.SysHospitalService; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cglib.beans.BeanCopier; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | |
| | | private SysHospitalService sysHospitalService; |
| | | @Autowired |
| | | private ConsumptionRecordMapper consumptionRecordMapper; |
| | | @Autowired |
| | | private IProductOrderService iProductOrderService; |
| | | /** |
| | | * 列表 |
| | | * @param params |
| | |
| | | } |
| | | return ResultBody.ok().data(userProductData); |
| | | } |
| | | |
| | | @Override |
| | | public PageResult all(Map<String, Object> params) { |
| | | Page<ProductOrderDetail> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit")); |
| | | List<ProductOrderDetail> list = baseMapper.findList(page, params); |
| | | List<ProductOrderDetailVo> volist=new ArrayList<>(); |
| | | for (ProductOrderDetail productOrderDetail : list) { |
| | | ProductOrderDetailVo productOrderDetailVo=new ProductOrderDetailVo(); |
| | | BeanCopier beanCopier = BeanCopier.create(ProductOrderDetail.class, ProductOrderDetailVo.class, false); |
| | | beanCopier.copy(productOrderDetail,productOrderDetailVo,null); |
| | | //查询医院 |
| | | if(productOrderDetail.getOrderId()!=null){ |
| | | ProductOrder productOrder = iProductOrderService.getById(productOrderDetail.getOrderId()); |
| | | if(productOrder!=null){ |
| | | productOrderDetailVo.setDepartmentId(productOrder.getDepartmentId()); |
| | | productOrderDetailVo.setDepartmentName(productOrder.getDepartmentName()); |
| | | productOrderDetailVo.setHospitalId(productOrder.getHospitalId()); |
| | | productOrderDetailVo.setHospitalName(productOrder.getHospitalName()); |
| | | } |
| | | volist.add(productOrderDetailVo); |
| | | } |
| | | } |
| | | return PageResult.<ProductOrderDetailVo>builder().data(volist).code(0).count(page.getTotal()).build(); |
| | | } |
| | | |
| | | /** |
| | | * 获取诊断列表 |
| | | * @param params |
| | |
| | | } |
| | | return productOrderDetailService.findList(params); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | */ |
| | | @ApiOperation(value = "查询列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping("all") |
| | | public PageResult all(@RequestParam Map<String, Object> params) { |
| | | if (params.size() == 0) { |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | return productOrderDetailService.all(params); |
| | | } |
| | | /** |
| | | * 列表 |
| | | */ |
New file |
| | |
| | | package com.kidgrow.usercenter.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SysRoleOrganizationMybatisDto { |
| | | private boolean flag; |
| | | private Object object; |
| | | } |
| | |
| | | package com.kidgrow.usercenter.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | |
| | | /** |
| | | * 是否删除,1删除,0未删除 |
| | | */ |
| | | @TableLogic |
| | | private Boolean isDel; |
| | | /** |
| | | * 是否管理员 0否 1是 |
| | |
| | | /** |
| | | * 医生状态 1正常 0试用 |
| | | */ |
| | | @NotNull(message = "医生状态 1正常 0试用不能为空") |
| | | @NotNull(message = "医生状态不能为空") |
| | | private Boolean doctorState; |
| | | /** |
| | | * 医生类型 0H+C端都可用 1H端 2C端 默认2 |
| | | */ |
| | | @NotNull(message = "医生类型不能为空") |
| | | private Integer doctorType; |
| | | /** |
| | | * 启用禁用状态,1启用,0停用 |
| | | */ |
| | | private Boolean enabled; |
| | |
| | | * 创建者的部门 |
| | | */ |
| | | private String createUserOrgCode; |
| | | |
| | | /** |
| | | * 帐号数量,默认6 |
| | | */ |
| | | private Integer accountsCount; |
| | | } |
| | |
| | | |
| | | @Data |
| | | public class SysDoctorDto extends SysDoctorVo { |
| | | private String username; |
| | | //private String username; |
| | | private String password; |
| | | private List<Long> roles; |
| | | } |
| | |
| | | package com.kidgrow.usercenter.service; |
| | | |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.SysOrganization; |
| | | import com.kidgrow.common.model.SysUserOrg; |
| | | import com.kidgrow.common.service.ISuperService; |
| | | |
| | |
| | | * @return SysUserOrg对象 |
| | | */ |
| | | SysUserOrg findByObject(SysUserOrg sysUserOrg); |
| | | |
| | | List<SysUserOrg> getListByMap(Map<String, Object> params); |
| | | |
| | | List<SysOrganization> getListUser(Long userId); |
| | | } |
| | | |
| | |
| | | * @param newPassword |
| | | * @return |
| | | */ |
| | | ResultBody updatePassword(Long id, String oldPassword, String newPassword,Boolean isdefault); |
| | | ResultBody updatePassword(Long id, String oldPassword, String newPassword,Boolean isdefault) throws Exception; |
| | | /** |
| | | * 更新手机号 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | ResultBody updateUserTel(Map<String,Object> params); |
| | | ResultBody updateUserTel(Map<String,Object> params) throws Exception ; |
| | | /** |
| | | * 用户列表 |
| | | * @param params |
| | |
| | | |
| | | ResultBody findCountByMap(Map<String, Object> map); |
| | | |
| | | ResultBody passwordByPhone(Map<String, Object> map); |
| | | ResultBody passwordByPhone(Map<String, Object> map) throws Exception; |
| | | |
| | | ResultBody registerByPhone(Map<String, Object> map); |
| | | |
| | |
| | | * @param userRegVo |
| | | * @return |
| | | */ |
| | | ResultBody doctorUserReg(UserRegVo userRegVo,SysUser sysUser); |
| | | ResultBody doctorUserReg(UserRegVo userRegVo,SysUser sysUser) throws Exception; |
| | | /** |
| | | * 获取医院科室下的所有有效的医生 |
| | | * @param hospitalId |
| | |
| | | import com.kidgrow.common.utils.StringUtils; |
| | | import com.kidgrow.redis.util.RedisConstant; |
| | | import com.kidgrow.redis.util.RedisUtils; |
| | | import com.kidgrow.usercenter.mapper.SysDoctorMapper; |
| | | import com.kidgrow.usercenter.mapper.SysRoleMapper; |
| | | import com.kidgrow.usercenter.mapper.SysUserRoleMapper; |
| | | import com.kidgrow.usercenter.mapper.*; |
| | | import com.kidgrow.usercenter.model.SysDepartment; |
| | | import com.kidgrow.usercenter.model.SysDoctor; |
| | | import com.kidgrow.usercenter.model.SysHospital; |
| | | import com.kidgrow.usercenter.model.SysRoleUser; |
| | | import com.kidgrow.usercenter.service.ISysDoctorService; |
| | | import com.kidgrow.usercenter.service.ISysUserOrgService; |
| | |
| | | private SysRoleOrganizationServiceImpl SysRoleOrganizationServiceImpl; |
| | | @Autowired |
| | | private SysRoleMapper sysRoleMapper; |
| | | @Autowired |
| | | private SysHospitalMapper sysHospitalMapper; |
| | | @Autowired |
| | | private SysDepartmentMapper sysDepartmentMapper; |
| | | @Autowired |
| | | private SysUserRoleMapper sysUserRoleMapper; |
| | | @Autowired |
| | |
| | | if(sysUserServiceImpl.departmetAccountsCount(sysDoctor.getDepartmentId())<=0){ |
| | | return ResultBody.failed("该部门创建人数已经达到上限"); |
| | | } |
| | | Long departmentId = sysDoctor.getDepartmentId(); |
| | | SysHospital sysHospital= sysHospitalMapper.selectById(sysDoctor.getHospitalId()); |
| | | SysDepartment sysDepartment= sysDepartmentMapper.selectById(sysDoctor.getDepartmentId()); |
| | | if (sysDoctor.getId()==null) { |
| | | //保存 |
| | | SysUser sysUser=new SysUser(); |
| | |
| | | //保存将sys_user_org 保存部门 |
| | | SysUserOrg sysUserOrg=new SysUserOrg(); |
| | | sysUserOrg.setUserId(sysUser.getId()); |
| | | sysUserOrg.setOrgId(sysDoctor.getDepartmentId()); |
| | | sysUserOrg.setFromId(sysDoctor.getDepartmentId()); |
| | | sysUserOrg.setFromLevel(CommonConstant.SYSTEM_ORG_DEP_LEVEL); |
| | | sysUserOrg.setOrgId(sysDepartment.getOrgId()); |
| | | //保存公司 |
| | | sysUserOrgService.saveOrUpdate(sysUserOrg); |
| | | SysUserOrg sysGongsi=new SysUserOrg(); |
| | | sysGongsi.setUserId(sysUser.getId()); |
| | | sysGongsi.setOrgId(sysDoctor.getHospitalId()); |
| | | sysGongsi.setOrgId(sysHospital.getOrgId()); |
| | | sysGongsi.setFromId(sysDoctor.getHospitalId()); |
| | | sysGongsi.setFromLevel(CommonConstant.SYSTEM_ORG_DEP_LEVEL); |
| | | sysUserOrgService.saveOrUpdate(sysGongsi); |
| | | //保存到Redis |
| | | boolean hset = redisUtils.hset(RedisConstant.USER_ORGANIZATION, sysUserOrg.getUserId().toString(), sysUserOrg); |
| | |
| | | SysUserOrg sysUserOrg=new SysUserOrg(); |
| | | sysUserOrg.setUserId(getOne.getUserId()); |
| | | sysUserOrg.setEnabled(false); |
| | | sysUserOrg.setOrgId(sysDoctor.getDepartmentId()); |
| | | sysUserOrg.setFromId(sysDoctor.getDepartmentId()); |
| | | sysUserOrg.setFromLevel(CommonConstant.SYSTEM_ORG_DEP_LEVEL); |
| | | sysUserOrg.setOrgId(sysDepartment.getOrgId()); |
| | | sysUserOrg.setCreateTime(new Date()); |
| | | sysUserOrgService.saveOrUpdate(sysUserOrg); |
| | | SysUserOrg sysGongsi=new SysUserOrg(); |
| | | sysGongsi.setUserId(getOne.getId()); |
| | | sysGongsi.setOrgId(sysDoctor.getHospitalId()); |
| | | sysGongsi.setOrgId(sysHospital.getOrgId()); |
| | | sysGongsi.setFromId(sysDoctor.getHospitalId()); |
| | | sysGongsi.setFromLevel(CommonConstant.SYSTEM_ORG_DEP_LEVEL); |
| | | sysUserOrgService.saveOrUpdate(sysGongsi); |
| | | baseMapper.updateById(sysDoctor); |
| | | if(redisUtils.hHasKey(RedisConstant.USER_ORGANIZATION, getOne.getUserId().toString())){ |
| | |
| | | public PageResult<HospitalListVo> findHospitalList(Map<String, Object> params, SysUser user) { |
| | | Page<HospitalListVo> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit")); |
| | | SysRoleOrganizationServiceImpl.getRoleOrg(params, user); |
| | | if(params.get("roleOrg")==null){ |
| | | return PageResult.<HospitalListVo>builder().data(null).code(0).count(page.getTotal()).build(); |
| | | } |
| | | List<HospitalListVo> list = baseMapper.findHospitalList(page, params); |
| | | return PageResult.<HospitalListVo>builder().data(list).code(0).count(page.getTotal()).build(); |
| | | } |
| | |
| | | package com.kidgrow.usercenter.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.kidgrow.common.constant.CommonConstant; |
| | | import com.kidgrow.common.context.ClientContextHolder; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.model.SysMenu; |
| | |
| | | |
| | | @Override |
| | | public List<SysMenu> findByRoleCodes(Set<String> roleCodes, Integer type) { |
| | | return roleMenuService.findMenusByRoleCodes(roleCodes, type, ClientContextHolder.getClient()); |
| | | String tentid=ClientContextHolder.getClient(); |
| | | if (roleCodes.contains(CommonConstant.SYSTEM_ADMIN_ROLE_CODE)) { |
| | | tentid=""; |
| | | } |
| | | return roleMenuService.findMenusByRoleCodes(roleCodes, type,tentid); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.kidgrow.common.annotation.LoginUser; |
| | | import com.kidgrow.common.model.*; |
| | | import com.kidgrow.usercenter.dto.SysRoleOrganizationDto; |
| | | import com.kidgrow.usercenter.dto.SysRoleOrganizationMybatisDto; |
| | | import com.kidgrow.usercenter.mapper.SysRoleMapper; |
| | | import com.kidgrow.usercenter.service.ISysOrganizationService; |
| | | import com.kidgrow.usercenter.service.ISysRoleService; |
| | | import com.kidgrow.usercenter.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | |
| | | import com.kidgrow.usercenter.model.SysRoleOrganization; |
| | | import com.kidgrow.usercenter.mapper.SysRoleOrganizationMapper; |
| | | import com.kidgrow.usercenter.service.ISysRoleOrganizationService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | |
| | | public class SysRoleOrganizationServiceImpl extends SuperServiceImpl<SysRoleOrganizationMapper, SysRoleOrganization> implements ISysRoleOrganizationService { |
| | | |
| | | |
| | | private final Integer TYPE_QUAN_BU = 1;//全部数据权限 |
| | | private final Integer TYPE_ZI_DING_YI = 2;//自定义数据权限 |
| | | private final Integer TYPE_BEN_BU_MEN = 3;//本部门数据权限 |
| | | private final Integer TYPE_BEN_BU_MEN_YI_XIA = 4;//本部门及以下数据权限 |
| | | private final Integer TYPE_BEN_REN = 5;//仅本人数据权限不能为空 |
| | | @Autowired |
| | | private ISysOrganizationService iSysOrganizationService; |
| | | @Autowired |
| | | private ISysRoleService iSysRoleService; |
| | | @Autowired |
| | | private ISysRoleUserService iSysRoleUserService; |
| | | @Autowired |
| | | private ISysUserOrgService iSysUserOrgService; |
| | | @Autowired |
| | | private SysOrganizationServiceImpl sysOrganizationService; |
| | | @Autowired |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean saveOrUpdateSer(SysRoleOrganizationDto sysRoleOrganizationDto, SysUser user) { |
| | | if (sysRoleOrganizationDto.getRoleId() != null) { |
| | | SysRole sysRole = iSysRoleService.getById(sysRoleOrganizationDto.getRoleId()); |
| | |
| | | } |
| | | SysRoleOrganization sysRoleOrganization = new SysRoleOrganization(); |
| | | sysRoleOrganization.setRoleId(sysRoleOrganizationDto.getRoleId()); |
| | | List<SysOrganization> organizations = user.getOrganizations(); |
| | | // 1代表全部数据权限,2自定义数据权限,3本部门数据权限,4本部门及以下数据权限,5仅本人数据权限不能为空") |
| | | //先清除数据 |
| | | if(sysRoleOrganizationDto.getRoleId()!=null){ |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("role_id",sysRoleOrganizationDto.getRoleId()); |
| | | map.put("is_del",0); |
| | | if (sysRoleOrganizationDto.getRoleId() != null) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("role_id", sysRoleOrganizationDto.getRoleId()); |
| | | map.put("is_del", 0); |
| | | List<SysRoleOrganization> sysRoleOrganizations = baseMapper.selectByMap(map); |
| | | List<Long> collect = sysRoleOrganizations.stream().map(e -> e.getId()).collect(Collectors.toList()); |
| | | if(collect.size()>0){ |
| | | if (collect.size() > 0) { |
| | | int i = baseMapper.deleteBatchIds(collect); |
| | | } |
| | | } |
| | | |
| | | //全部数据 |
| | | if (sysRoleOrganizationDto.getType() == TYPE_QUAN_BU) { |
| | | // sysRoleOrganization.setOrgCode("10"); |
| | | // if (organizations != null && organizations.size() > 0) { |
| | | // sysRoleOrganization.setOrgId(organizations.get(organizations.size()-1).getId()); |
| | | // } |
| | | // baseMapper.insert(sysRoleOrganization); |
| | | } |
| | | //2自定义数据权限 |
| | | if (sysRoleOrganizationDto.getType() == TYPE_ZI_DING_YI) { |
| | | |
| | | List<Long> orgIds = sysRoleOrganizationDto.getOrgIds(); |
| | | orgIds.forEach(e -> { |
| | | sysRoleOrganization.setId(null); |
| | |
| | | } |
| | | baseMapper.insert(sysRoleOrganization); |
| | | }); |
| | | }else { |
| | | |
| | | } |
| | | //3本部门数据权限 |
| | | if (sysRoleOrganizationDto.getType() == TYPE_BEN_BU_MEN) { |
| | | if (organizations != null && organizations.size() > 0) { |
| | | sysRoleOrganization.setOrgCode(organizations.get(organizations.size()-1).getOrgCode()); |
| | | sysRoleOrganization.setOrgId(organizations.get(organizations.size()-1).getId()); |
| | | baseMapper.insert(sysRoleOrganization); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | //4本部门及以下数据权限 |
| | | if (sysRoleOrganizationDto.getType() == TYPE_BEN_BU_MEN_YI_XIA) { |
| | | if (organizations != null && organizations.size() > 0) { |
| | | sysRoleOrganization.setOrgCode(organizations.get(organizations.size()-1).getOrgCode()); |
| | | sysRoleOrganization.setOrgId(organizations.get(organizations.size()-1).getId()); |
| | | baseMapper.insert(sysRoleOrganization); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | //5仅本人数据权限不能为空 |
| | | if (sysRoleOrganizationDto.getType() == TYPE_BEN_REN) { |
| | | sysRoleOrganization.setOrgCode(organizations.get(organizations.size()-1).getOrgCode()); |
| | | sysRoleOrganization.setOrgId(organizations.get(organizations.size()-1).getId()); |
| | | baseMapper.insert(sysRoleOrganization); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 将权限 分装到map对像 |
| | | * |
| | | * @param params |
| | | * @param user |
| | | */ |
| | | |
| | | public void getRoleOrg(Map<String, Object> params, SysUser user){ |
| | | List<SysRole> roles = user.getRoles(); |
| | | List<Map<Integer,List<SysRoleOrganization>>> listroleOrg=new ArrayList<>(); |
| | | if (!roles.isEmpty()) { |
| | | roles.forEach(e->{ |
| | | Map<Integer,List<SysRoleOrganization>> rolemap=new HashMap<>(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("role_id",e.getId()); |
| | | List<SysRoleOrganization> sysRoleOrganizations = baseMapper.selectByMap(map); |
| | | if(sysRoleOrganizations.size()>0){ |
| | | SysRole sysRole = sysRoleMapper.selectById(e.getId()); |
| | | rolemap.put(sysRole.getType(),sysRoleOrganizations); |
| | | public void getRoleOrg(Map<String, Object> params, SysUser user) { |
| | | //获取角色接口 |
| | | List<SysRole> roles = iSysRoleUserService.findRolesByUserId(user.getId()); |
| | | List<SysOrganization> listUser = iSysUserOrgService.getListUser(user.getId()); |
| | | List<Map<Integer, Object>> listroleOrg = new ArrayList<>(); |
| | | if(listUser!=null){ |
| | | if (!roles.isEmpty()) { |
| | | int index=0; |
| | | for (SysRole e : roles) { |
| | | Map<Integer, Object> rolemap = new HashMap<>(); |
| | | SysRoleOrganizationMybatisDto dto=new SysRoleOrganizationMybatisDto(); |
| | | if(e.getType() == 1){ |
| | | dto.setFlag(index==0); |
| | | dto.setObject(user.getId()); |
| | | rolemap.put(e.getType(), dto); |
| | | }else if (e.getType() == 2) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("role_id", e.getId()); |
| | | List<SysRoleOrganization> sysRoleOrganizations = baseMapper.selectByMap(map); |
| | | if (sysRoleOrganizations.size() > 0) { |
| | | dto.setFlag(index==0); |
| | | dto.setObject(sysRoleOrganizations); |
| | | rolemap.put(e.getType(), dto); |
| | | } |
| | | } else if (e.getType() == 3) { |
| | | dto.setFlag(index==0); |
| | | dto.setObject(user.getOrganizations().get(user.getOrganizations().size() - 1).getOrgCode()); |
| | | rolemap.put(e.getType(), dto); |
| | | } else if (e.getType() == 4) { |
| | | dto.setFlag(index==0); |
| | | dto.setObject(user.getOrganizations().get(user.getOrganizations().size() - 1).getOrgCode()); |
| | | rolemap.put(e.getType(), dto); |
| | | } else if (e.getType() == 5) { |
| | | dto.setFlag(index==0); |
| | | dto.setObject(user.getId()); |
| | | rolemap.put(e.getType(), dto); |
| | | } |
| | | index+=1; |
| | | listroleOrg.add(rolemap); |
| | | } |
| | | }); |
| | | }; |
| | | } |
| | | } |
| | | //添加权限控制 |
| | | params.put("roleOrg",listroleOrg); |
| | | params.put("roleOrg", listroleOrg); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getRoleOrgMap(SysUser user) { |
| | | Map<String, Object> map=new HashMap<>(); |
| | | getRoleOrg(map,user); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | getRoleOrg(map, user); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.SysOrganization; |
| | | import com.kidgrow.common.model.SysUserOrg; |
| | | import com.kidgrow.common.service.impl.SuperServiceImpl; |
| | | import com.kidgrow.usercenter.mapper.SysUserOrgMapper; |
| | | import com.kidgrow.usercenter.service.ISysOrganizationService; |
| | | import com.kidgrow.usercenter.service.ISysUserOrgService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class SysUserOrgServiceImpl extends SuperServiceImpl<SysUserOrgMapper, SysUserOrg> implements ISysUserOrgService { |
| | | @Autowired |
| | | private ISysOrganizationService iSysOrganizationService; |
| | | /** |
| | | * 列表 |
| | | * @param params |
| | |
| | | List<SysUserOrg> sysUserOrg = baseMapper.selectByMap(params); |
| | | return sysUserOrg; |
| | | } |
| | | /** |
| | | 根据用户id ,查询组织 |
| | | */ |
| | | @Override |
| | | public List<SysOrganization> getListUser(Long userId) { |
| | | List<SysOrganization> list=new ArrayList<>(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("user_id",userId); |
| | | map.put("is_del",0); |
| | | map.put("enabled",1); |
| | | List<SysUserOrg> sysUserOrgs = baseMapper.selectByMap(map); |
| | | if (!sysUserOrgs.isEmpty()) { |
| | | //查询组织 |
| | | sysUserOrgs.forEach(e ->{ |
| | | SysOrganization byId = iSysOrganizationService.getById(e.getOrgId()); |
| | | if (byId!=null) { |
| | | list.add(byId); |
| | | } |
| | | }); |
| | | } |
| | | return list; |
| | | } |
| | | } |
| | |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.common.model.*; |
| | | import com.kidgrow.common.service.impl.SuperServiceImpl; |
| | | import com.kidgrow.common.utils.AesUtils; |
| | | import com.kidgrow.common.utils.DateUtils; |
| | | import com.kidgrow.common.utils.Pinyin4jUtil; |
| | | import com.kidgrow.redis.util.RedisUtils; |
| | |
| | | public SysUser selectByUsername(String username) { |
| | | String clientId = ClientContextHolder.getClient(); |
| | | List<SysUser> users = baseMapper.selectList( |
| | | new QueryWrapper<SysUser>().eq("username", username).eq("tenant_id", clientId) |
| | | //new QueryWrapper<SysUser>().eq("username", username).eq("tenant_id", clientId) |
| | | new QueryWrapper<SysUser>().eq("username", username) |
| | | ); |
| | | return getUser(users); |
| | | } |
| | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public ResultBody updatePassword(Long id, String oldPassword, String newPassword, Boolean isdefault) { |
| | | public ResultBody updatePassword(Long id, String oldPassword, String newPassword, Boolean isdefault) throws Exception { |
| | | |
| | | SysUser sysUser = baseMapper.selectById(id); |
| | | if (StrUtil.isNotBlank(oldPassword)) { |
| | | oldPassword=AesUtils.desEncrypt(oldPassword).trim(); |
| | | if (!passwordEncoder.matches(oldPassword, sysUser.getPassword())) { |
| | | return ResultBody.failed("旧密码错误!"); |
| | | } |
| | | } |
| | | if (StrUtil.isBlank(newPassword)) { |
| | | newPassword = com.kidgrow.common.utils.RandomValueUtils.getRandom(6); |
| | | }else { |
| | | newPassword=AesUtils.desEncrypt(newPassword).trim(); |
| | | } |
| | | SysUser user = new SysUser(); |
| | | user.setId(id); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ResultBody updateUserTel(Map<String, Object> params) { |
| | | public ResultBody updateUserTel(Map<String, Object> params) throws Exception { |
| | | Long id = MapUtils.getLong(params, "id"); |
| | | String oldTel = MapUtils.getString(params, "oldTel"); |
| | | String newTel = MapUtils.getString(params, "newTel"); |
| | | String authCode = MapUtils.getString(params, "authCode"); |
| | | String userPassword = MapUtils.getString(params, "userPassword"); |
| | | String newTel = AesUtils.desEncrypt(MapUtils.getString(params, "newTel")).trim(); |
| | | String authCode = AesUtils.desEncrypt(MapUtils.getString(params, "authCode")).trim(); |
| | | String userPassword = AesUtils.desEncrypt(MapUtils.getString(params, "userPassword")).trim(); |
| | | |
| | | if (id > 0 && StringUtils.isNotBlank(oldTel) && StringUtils.isNotBlank(newTel) && StringUtils.isNotBlank(authCode) && StringUtils.isNotBlank(userPassword)) { |
| | | //检查验证码 |
| | |
| | | } else { |
| | | //验证旧手机号和密码 |
| | | SysUser sysUser = baseMapper.selectById(id); |
| | | userPassword = AesUtils.desEncrypt(userPassword); |
| | | if (passwordEncoder.matches(userPassword, sysUser.getPassword()) && sysUser.getMobile().equals((oldTel))) { |
| | | //验证通过,修改手机号 |
| | | SysUser user = new SysUser(); |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultBody passwordByPhone(Map<String, Object> map) { |
| | | public ResultBody passwordByPhone(Map<String, Object> map) throws Exception { |
| | | //手机号,type,验证码,新密码 |
| | | String phone = MapUtils.getString(map, "phone"); |
| | | if (phone == null || "".equals(phone.trim())) { |
| | |
| | | if (newPass == null || "".equals(newPass.trim())) { |
| | | return ResultBody.failed("请输入正确的密码"); |
| | | } |
| | | if (CheckVerificationCode(ConstantSMS.PASSWORD_SMS, map.get("phone").toString(), verificationCode)) { |
| | | phone= AesUtils.desEncrypt(phone.trim()); |
| | | verificationCode= AesUtils.desEncrypt(verificationCode.trim()); |
| | | newPass= AesUtils.desEncrypt(newPass.trim()); |
| | | if (CheckVerificationCode(ConstantSMS.PASSWORD_SMS, phone, verificationCode)) { |
| | | //查询表 |
| | | Map<String, Object> selectMap = new HashMap<>(); |
| | | selectMap.put("mobile", phone); |
| | |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public ResultBody doctorUserReg(UserRegVo userRegVo, SysUser sysUserd) { |
| | | public ResultBody doctorUserReg(UserRegVo userRegVo, SysUser sysUserd) throws Exception { |
| | | if(sysUserd.getId()==null){ |
| | | sysUserd = this.baseMapper.selectById(userRegVo.getUserId()); |
| | | } |
| | | userRegVo.setPassword(AesUtils.desEncrypt(userRegVo.getPassword()).trim()); |
| | | userRegVo.setUsername(AesUtils.desEncrypt(userRegVo.getUsername()).trim()); |
| | | //检查手机号是否已经注册 H端登录名和手机号存一样的值 |
| | | if (phoneIsUsed(userRegVo.getMobile())) { |
| | | return ResultBody.failed("该手机号已经注册"); |
| | |
| | | |
| | | sysUserOrgH.setUserId(sysUser.getId()); |
| | | sysUserOrgH.setOrgId(organizationHos); |
| | | sysUserOrgH.setFromLevel(CommonConstant.SYSTEM_ORG_HOS_LEVEL); |
| | | sysUserOrgH.setFromId(userRegVo.getHospitalId()); |
| | | sysUserOrgH.setCreateUserId(isReg ? createUserId : sysUserd.getId()); |
| | | sysUserOrgH.setCreateUserName(isReg ? createUserName : sysUserd.getUsername()); |
| | | sysUserOrgList.add(sysUserOrgH); |
| | | |
| | | sysUserOrgD.setUserId(sysUser.getId()); |
| | | sysUserOrgD.setOrgId(organizationDep); |
| | | sysUserOrgD.setFromId(userRegVo.getDepartmentId()); |
| | | sysUserOrgD.setFromLevel(CommonConstant.SYSTEM_ORG_DEP_LEVEL); |
| | | sysUserOrgD.setCreateUserId(isReg ? createUserId : sysUserd.getId()); |
| | | sysUserOrgD.setCreateUserName(isReg ? createUserName : sysUserd.getUsername()); |
| | | sysUserOrgList.add(sysUserOrgD); |
| | |
| | | sysDoctor.setDepartmentName(userRegVo.getDepartmentName()); |
| | | sysDoctor.setDoctorRank(userRegVo.getDoctorRank()); |
| | | sysDoctor.setDoctorRankId(userRegVo.getDoctorRankId()); |
| | | sysDoctor.setDoctorType(CommonConstant.H_DOCTOR_TYPE); |
| | | sysDoctor.setCreateUserId(isReg ? createUserId : sysUserd.getId()); |
| | | sysDoctor.setCreateUserName(isReg ? createUserName : sysUserd.getUsername()); |
| | | if (isReg) { |
| | |
| | | sysDoctor.setDoctorName(userRegVo.getNickname()); |
| | | sysDoctor.setServerUserId(isReg ? createUserId : sysUserd.getId()); |
| | | sysDoctor.setServerUserName(isReg ? createUserName : sysUserd.getUsername()); |
| | | sysDoctor.setIsAdminUser(false); |
| | | sysDoctor.setEnabled(false); |
| | | if (sysDoctorMapper.insert(sysDoctor) == 1) { |
| | | //非自主注册的 返回信息带密码 |
| | | if (!isReg) { |
| | |
| | | <if test="p.updateTime != null and p.updateTime !=''"> |
| | | and update_time = #{p.updateTime} |
| | | </if> |
| | | <if test="p.accountsCount != null and p.accountsCount !=''"> |
| | | and accounts_count = #{p.accountsCount} |
| | | </if> |
| | | </where> |
| | | </sql> |
| | | |
| | |
| | | <if test="p.hospitalName != null and p.hospitalName !=''"> |
| | | and hospital_name LIKE concat('%',#{p.hospitalName},'%') |
| | | </if> |
| | | <include refid="com.kidgrow.usercenter.mapper.SysRoleOrganizationMapper.Role_Organization"></include> |
| | | <if test="p.roleOrg != null and p.roleOrg.size>0"> |
| | | |
| | | <foreach item="item" collection="p.roleOrg" index=""> |
| | | <foreach item="itemto" collection="item" index="inx"> |
| | | |
| | | <choose> |
| | | <when test="inx == 1"> |
| | | <if test="itemto.flag"> |
| | | and 1=1 |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or (1=1 and HOS.is_del = 0 and HOS.enabled=1) |
| | | </if> |
| | | </when> |
| | | <when test="inx==2"> |
| | | <if test="itemto.flag"> |
| | | AND |
| | | <foreach item="itemtoto" collection="itemto.object" separator="or" open="(" close=")" |
| | | index=""> |
| | | create_user_org_code = #{itemtoto.orgCode} |
| | | </foreach> |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or ( |
| | | <foreach item="itemtoto" collection="itemto.object" separator="or" open="(" close=")" |
| | | index=""> |
| | | create_user_org_code = #{itemtoto.orgCode} |
| | | </foreach> and HOS.is_del = 0 and HOS.enabled=1 |
| | | ) |
| | | </if> |
| | | </when> |
| | | <when test="inx == 3"> |
| | | <if test="itemto.flag"> |
| | | AND |
| | | create_user_org_code = #{itemto.object} |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or (create_user_org_code = #{itemto.object} and HOS.is_del = 0 and HOS.enabled=1) |
| | | </if> |
| | | </when> |
| | | <when test="inx == 4"> |
| | | <if test="itemto.flag"> |
| | | AND |
| | | create_user_org_code like '${itemto.object}%' |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or (create_user_org_code like '${itemto.object}%' and HOS.is_del = 0 and HOS.enabled=1) |
| | | </if> |
| | | </when> |
| | | <when test="inx == 5"> |
| | | <if test="itemto.flag"> |
| | | AND |
| | | HOS.create_user_id = #{itemto.object} |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or (HOS.create_user_id = #{itemto.object} and HOS.is_del = 0 and HOS.enabled=1) |
| | | </if> |
| | | </when> |
| | | <otherwise> |
| | | AND id is null |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | </foreach> |
| | | </foreach> |
| | | </if> |
| | | <!-- <include refid="com.kidgrow.usercenter.mapper.SysRoleOrganizationMapper.Role_Organization"></include>--> |
| | | </where> |
| | | </sql> |
| | | <select id="findHospitalList" resultType="com.kidgrow.usercenter.vo.HospitalListVo"> |
| | |
| | | HOS.area_code, |
| | | HOS.create_time |
| | | FROM |
| | | sys_department DEP |
| | | LEFT JOIN sys_hospital HOS ON DEP.hospital_id = HOS.id |
| | | sys_department DEP |
| | | LEFT JOIN sys_hospital HOS ON DEP.hospital_id = HOS.id |
| | | <include refid="whereList"/> |
| | | order by create_time desc |
| | | order by create_time desc |
| | | </select> |
| | | <select id="findByName" resultType="com.kidgrow.usercenter.model.SysHospital"> |
| | | select id, |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.kidgrow.usercenter.mapper.SysRoleMenuMapper"> |
| | | |
| | | <update id="delete"> |
| | | <delete id="delete"> |
| | | delete from sys_role_menu |
| | | <where> |
| | | <if test="roleId != null"> |
| | |
| | | and menu_id = #{menuId} |
| | | </if> |
| | | </where> |
| | | </update> |
| | | </delete> |
| | | |
| | | <select id="findMenusByRoleIds" resultType="com.kidgrow.common.model.SysMenu"> |
| | | select distinct t.* from sys_menu t |
| | |
| | | <if test="type != null"> |
| | | and t.type = #{type} |
| | | </if> |
| | | <if test="tenantId != null and tenantId !=''"> |
| | | and t.tenant_id = #{tenantId} |
| | | </if> |
| | | and t.hidden = 0 |
| | | and t.enabled = 1 |
| | | ORDER BY sort ASC |
| | |
| | | <!--定义数据权限的查询--> |
| | | <sql id="Role_Organization"> |
| | | <if test="p.roleOrg != null and p.roleOrg.size>0"> |
| | | |
| | | <foreach item="item" collection="p.roleOrg" index=""> |
| | | <foreach item="itemto" collection="item" index="inx"> |
| | | |
| | | |
| | | <choose> |
| | | <when test="inx == 1"></when> |
| | | |
| | | <when test="inx == 1"> |
| | | <if test="itemto.flag"> |
| | | and 1=1 |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or (1=1 and is_del = 0 and enabled=1) |
| | | </if> |
| | | </when> |
| | | <when test="inx==2"> |
| | | AND |
| | | <foreach item="itemtoto" collection="itemto" separator="or" open="(" close=")" index=""> |
| | | create_user_org_code like '${itemtoto.orgCode}%' |
| | | </foreach> |
| | | <if test="itemto.flag"> |
| | | AND |
| | | <foreach item="itemtoto" collection="itemto.object" separator="or" open="(" close=")" |
| | | index=""> |
| | | create_user_org_code = #{itemtoto.orgCode} |
| | | </foreach> |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or ( |
| | | <foreach item="itemtoto" collection="itemto.object" separator="or" open="(" close=")" |
| | | index=""> |
| | | create_user_org_code = #{itemtoto.orgCode} |
| | | </foreach> |
| | | and is_del = 0 and enabled=1 |
| | | ) |
| | | </if> |
| | | </when> |
| | | <when test="inx == 3"> |
| | | AND |
| | | <foreach item="itemtoto" collection="itemto" separator="or" open="(" close=")" index=""> |
| | | create_user_org_code = #{itemtoto.orgCode} |
| | | </foreach> |
| | | <if test="itemto.flag"> |
| | | AND |
| | | create_user_org_code = #{itemto.object} |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or (create_user_org_code = #{itemto.object} and is_del = 0 and enabled=1) |
| | | </if> |
| | | </when> |
| | | <when test="inx == 4"> |
| | | AND |
| | | <foreach item="itemtoto" collection="itemto" separator="or" open="(" close=")" index=""> |
| | | create_user_org_code like '${itemtoto.orgCode}%' |
| | | </foreach> |
| | | <if test="itemto.flag"> |
| | | AND |
| | | create_user_org_code like '${itemto.object}%' |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or (create_user_org_code like '${itemto.object}%' and is_del = 0 and enabled=1) |
| | | </if> |
| | | </when> |
| | | <when test="inx == 5"> |
| | | AND |
| | | <foreach item="itemtoto" collection="itemto" separator="or" open="(" close=")" index=""> |
| | | create_user_id = #{itemtoto.orgCode} |
| | | </foreach> |
| | | <if test="itemto.flag"> |
| | | AND |
| | | create_user_id = #{itemto.object} |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or (create_user_id = #{itemto.object} and is_del = 0 and enabled=1) |
| | | </if> |
| | | </when> |
| | | <otherwise> |
| | | AND id is null |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | </foreach> |
| | | </foreach> |
| | | </if> |
| | | </sql> |
| | | |
| | | </sql> |
| | | |
| | | <!--定义查询列--> |
| | | <sql id="Column_List"> |
| | | * |
| | |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | return sysHospitalService.findHospitalList(params,user); |
| | | return sysHospitalService.findHospitalList(params, user); |
| | | } |
| | | |
| | | @PostMapping("findAll") |
| | |
| | | @PostMapping("findAllByMap") |
| | | @ApiOperation(value = "查询所有列表") |
| | | public ResultBody<SysHospital> findAllByMap(@RequestBody Map<String, Object> params) { |
| | | return sysHospitalService.findAll(params); |
| | | return sysHospitalService.findAll(params); |
| | | } |
| | | |
| | | /** |
| | |
| | | SysHospital model = sysHospitalService.getById(id); |
| | | return ResultBody.ok().data(model).msg("查询成功"); |
| | | } |
| | | |
| | | /** |
| | | * 查询 |
| | | */ |
| | |
| | | return ResultBody.ok().data(null).msg(""); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据SysHospital当做查询条件进行查询 |
| | | */ |
| | |
| | | SysHospital model = sysHospitalService.findByObject(sysHospital); |
| | | return ResultBody.ok().data(model).msg("查询成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改医院logo |
| | | */ |
| | | @ApiOperation(value = "保存") |
| | | @PostMapping("/updateLogo") |
| | | public ResultBody updateLogo(@RequestBody Map<String, Object> params) |
| | | { |
| | | public ResultBody updateLogo(@RequestBody Map<String, Object> params) { |
| | | return sysHospitalService.updateLogo(params); |
| | | } |
| | | |
| | | /** |
| | | * 新增or更新 |
| | | */ |
| | |
| | | return ResultBody.failed().msg(errMsg.toString()); |
| | | } else { |
| | | //先检查该医院是否存在组织信息 |
| | | SysOrganization sysOrganization=new SysOrganization(); |
| | | if(sysHospital.getOrgId()!=null){ |
| | | sysOrganization.setId(sysHospital.getOrgId());} |
| | | else{ |
| | | SysOrganization sysOrganization = new SysOrganization(); |
| | | if (sysHospital.getOrgId() != null) { |
| | | sysOrganization.setId(sysHospital.getOrgId()); |
| | | } else { |
| | | sysOrganization.setOrgName(sysHospital.getHospitalName()); |
| | | sysOrganization.setOrgParentId(DictionariesConstants.ORG_PARENT_ID); |
| | | } |
| | | sysOrganization=organizationService.findByObject(sysOrganization); |
| | | if(sysOrganization==null) |
| | | { |
| | | sysOrganization = organizationService.findByObject(sysOrganization); |
| | | if (sysOrganization == null) { |
| | | //创建一个组织 |
| | | sysOrganization=new SysOrganization(); |
| | | sysOrganization = new SysOrganization(); |
| | | sysOrganization.setOrgName(sysHospital.getHospitalName()); |
| | | sysOrganization.setOrgAttr(1); |
| | | sysOrganization.setOrgLevel(1); |
| | | sysOrganization.setOrgParentId(DictionariesConstants.ORG_PARENT_ID); |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | sysOrganization.setOrgName(sysHospital.getHospitalName()); |
| | | } |
| | | boolean org=organizationService.saveOrUpdate(sysOrganization); |
| | | boolean org = organizationService.saveOrUpdate(sysOrganization); |
| | | sysHospital.setOrgId(sysOrganization.getId()); |
| | | List<SysOrganization> organizations = sysUser.getOrganizations(); |
| | | if (organizations.size()>0) { |
| | | sysHospital.setCreateUserOrgCode(organizations.get(organizations.size()-1).getOrgCode()); |
| | | if (organizations.size() > 0) { |
| | | sysHospital.setCreateUserOrgCode(organizations.get(organizations.size() - 1).getOrgCode()); |
| | | } |
| | | boolean v = sysHospitalService.saveOrUpdate(sysHospital); |
| | | if (v) { |
| | |
| | | } |
| | | return ResultBody.failed().msg(errMsg.toString()); |
| | | } else { |
| | | boolean v = sysOrganizationService.saveOrUpdate(sysOrganization); |
| | | boolean v = sysOrganizationService.saveOrUpdateSer(sysOrganization); |
| | | if (v) { |
| | | return ResultBody.ok().data(sysOrganization).msg("保存成功"); |
| | | } else { |
| | |
| | | */ |
| | | @ApiOperation(value = "根据access_token当前登录用户") |
| | | @GetMapping("/users/current") |
| | | public ResultBody<LoginAppUser> getLoginAppUser(@LoginUser(isFull = true) SysUser user) { |
| | | public ResultBody<LoginAppUser> getLoginAppUser(@LoginUser(isFull = true) SysUser user,HttpServletRequest request) { |
| | | if(user!=null){ |
| | | loginLogs(user, request); |
| | | } |
| | | return ResultBody.ok().data(appUserService.getLoginAppUser(user)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @GetMapping(value = "/users-anon/login", params = "username") |
| | | @ApiOperation(value = "根据用户名查询用户") |
| | | public LoginAppUser findByUsername(String username, HttpServletRequest request) { |
| | | |
| | | public LoginAppUser findByUsername(String username) { |
| | | LoginAppUser loginAppUser = appUserService.findByUsername(username); |
| | | if (loginAppUser != null) { |
| | | loginLogs(loginAppUser, request); |
| | | } |
| | | return loginAppUser; |
| | | } |
| | | |
| | |
| | | * @param sysUser |
| | | * @return |
| | | */ |
| | | private int loginLogs(LoginAppUser sysUser, HttpServletRequest request) { |
| | | private int loginLogs(SysUser sysUser, HttpServletRequest request) { |
| | | SysUserLogs sysUserLogs = new SysUserLogs(); |
| | | sysUserLogs.setClientId(ClientContextHolder.getClient()); |
| | | sysUserLogs.setLoginAgentSystem(request.getHeader(CommonConstant.USER_AGENT_SYSTEM)); |
| | |
| | | */ |
| | | @PutMapping(value = "/users/{id}/password") |
| | | @AuditLog(operation = "'重置用户密码:' + #id") |
| | | public ResultBody resetPassword(@PathVariable Long id) { |
| | | public ResultBody resetPassword(@PathVariable Long id) throws Exception{ |
| | | if (checkAdmin(id)) { |
| | | return ResultBody.failed(ADMIN_CHANGE_MSG); |
| | | } |
| | |
| | | * 用户自己修改密码 |
| | | */ |
| | | @PutMapping(value = "/users/password") |
| | | public ResultBody resetPassword(@RequestBody SysUser sysUser) { |
| | | public ResultBody resetPassword(@RequestBody SysUser sysUser) throws Exception { |
| | | if (checkAdmin(sysUser.getId())) { |
| | | return ResultBody.failed().msg(ADMIN_CHANGE_MSG); |
| | | } |
| | |
| | | * 用户自己修改密码-后端以外 |
| | | */ |
| | | @PutMapping(value = "/users/resetpassword") |
| | | public ResultBody resetClientPassword(@RequestParam Map<String, Object> params) { |
| | | public ResultBody resetClientPassword(@RequestParam Map<String, Object> params) throws Exception { |
| | | Long id = MapUtils.getLong(params, "id"); |
| | | String oldPassword = MapUtils.getString(params, "oldPassword"); |
| | | String newPassword = MapUtils.getString(params, "newPassword"); |
| | |
| | | * @return |
| | | */ |
| | | @PutMapping(value = "/users/updateusertel") |
| | | public ResultBody updateUserTel(@RequestParam Map<String, Object> params,@LoginUser SysUser sysUser) { |
| | | public ResultBody updateUserTel(@RequestParam Map<String, Object> params,@LoginUser SysUser sysUser) throws Exception { |
| | | String oldTel = MapUtils.getString(params, "oldTel"); |
| | | if (oldTel==null){ |
| | | return ResultBody.failed("请输入原账号"); |
| | |
| | | */ |
| | | @PostMapping("/users/doctorUserReg") |
| | | @AuditLog(operation = "'注册/添加用户:' + #userRegVo.mobile") |
| | | public ResultBody doctorUserReg(@RequestBody UserRegVo userRegVo,SysUser sysUser) { |
| | | public ResultBody doctorUserReg(@RequestBody UserRegVo userRegVo,SysUser sysUser) throws Exception { |
| | | return appUserService.doctorUserReg(userRegVo,sysUser); |
| | | } |
| | | |
| | |
| | | * 通过手机修改密码 |
| | | */ |
| | | @PutMapping(value = "/users/passwordByPhone") |
| | | public ResultBody passwordByPhone(@RequestBody Map<String, Object> map) { |
| | | public ResultBody passwordByPhone(@RequestBody Map<String, Object> map) throws Exception { |
| | | return appUserService.passwordByPhone(map); |
| | | } |
| | | |
| | |
| | | tenant: |
| | | enable: true |
| | | #多租户隔离字段 |
| | | |
| | | tenantid: tenant_id |
| | | ignoreTables: |
| | | - sys_user |
| | |
| | | * 自主注册的创建人名称 |
| | | */ |
| | | public static final String CREATE_USER_NAME= "自动创建"; |
| | | /** |
| | | * 管理员医生角色code标识 |
| | | */ |
| | | public static final String SYSTEM_ADMIN_ROLE_CODE="ADMIN"; |
| | | |
| | | /** |
| | | * 集团组织级别 |
| | | */ |
| | | public static final Integer SYSTEM_ORG_TOP_CODE=0; |
| | | /** |
| | | * 公司/医院组织级别 |
| | | */ |
| | | public static final Integer SYSTEM_ORG_HOS_LEVEL=1; |
| | | /** |
| | | * 科室部门组织级别 |
| | | */ |
| | | public static final Integer SYSTEM_ORG_DEP_LEVEL=2; |
| | | /** |
| | | * 医生类型 C+H |
| | | */ |
| | | public static final Integer CH_DOCTOR_TYPE=0; |
| | | /** |
| | | * 医生类型 H |
| | | */ |
| | | public static final Integer H_DOCTOR_TYPE=1; |
| | | /** |
| | | * 医生类型 C |
| | | */ |
| | | public static final Integer C_DOCTOR_TYPE=2; |
| | | } |
| | |
| | | * 文件服务名 |
| | | */ |
| | | String FILE_CENTER_SERVER="filecenter-server"; |
| | | |
| | | |
| | | /** |
| | | * smartbox服务 |
| | | * SmartBox服务名 |
| | | */ |
| | | String SMARTBOX_SERVER="smartbox-server"; |
| | | |
| | | /** |
| | | * 报告中心服务名 |
| | | */ |
| | | String REPORT_SERVER="report-server"; |
| | | |
| | | /** |
| | | * BI分析中心服务名 |
| | | */ |
| | | String BICENTER_SERVER="bicenter-server"; |
| | | |
| | | /** |
| | | * 骨龄评价中心服务名 |
| | | */ |
| | | String EVALUATION_SERVER="evaluation-server"; |
| | | |
| | | } |
| | |
| | | @NotNull(message = "组织ID不能为空") |
| | | private Long orgId; |
| | | /** |
| | | * 医院/科室表里面的id |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @NotNull(message = "医院/科室表里面的id") |
| | | private Long fromId; |
| | | /** |
| | | * 组织级别 0集团 1医院公司 2科室部门 |
| | | */ |
| | | private Integer fromLevel; |
| | | /** |
| | | * 数据权限code |
| | | */ |
| | | private String createUserOrgCode; |
| | |
| | | requestHeaders.add(CommonConstant.KIDGROW_VERSION); |
| | | requestHeaders.add(CommonConstant.USER_AGENT_BROWSER); |
| | | requestHeaders.add(CommonConstant.USER_AGENT_IP); |
| | | requestHeaders.add(CommonConstant.USER_AGENT_SYSTEM_SCREEN); |
| | | requestHeaders.add(CommonConstant.USER_AGENT_SYSTEM); |
| | | requestHeaders.add(SecurityConstants.USER_HOSPITAL_ID_HEADER); |
| | | } |
| | |
| | | requestHeaders.add(CommonConstant.KIDGROW_VERSION); |
| | | requestHeaders.add(CommonConstant.USER_AGENT_BROWSER); |
| | | requestHeaders.add(CommonConstant.USER_AGENT_IP); |
| | | requestHeaders.add(CommonConstant.USER_AGENT_SYSTEM_SCREEN); |
| | | requestHeaders.add(CommonConstant.USER_AGENT_SYSTEM); |
| | | requestHeaders.add(SecurityConstants.USER_HOSPITAL_ID_HEADER); |
| | | } |
| | |
| | | kidgrow.audit-log.datasource.driver-class-name=com.mysql.jdbc.Driver |
| | | kidgrow.audit-log.datasource.jdbc-url=jdbc:mysql://${kidgrow.datasource.ip}:3306/logger_center?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai |
| | | kidgrow.audit-log.datasource.username=${kidgrow.datasource.username} |
| | | kidgrow.audit-log.datasource.password=${kidgrow.datasource.password} |
| | | kidgrow.audit-log.datasource.password=${kidgrow.datasource.password} |
| | | |
| | | ## appUrl \u9759\u6001\u6587\u4EF6\u4E0A\u4F20\u8DEF\u5F84 |
| | | appUrl=http://192.168.2.240/upload/ |
| | |
| | | return theRequest; |
| | | } |
| | | /** |
| | | * 自动将没权限的按钮隐藏 |
| | | * 1.判断用户是否在登录状态 |
| | | * 2.自动将没权限的按钮隐藏 |
| | | * 如果页面有列表,则在列表的 done事件内调用 |
| | | * 如果页面没有列表,则在页面所有js执行的最后调用此函数 |
| | | * |
| | |
| | | * 同时在控件上增加permissions="user-btn-import"这样的自定义属性 |
| | | * 其中引号内是菜单管理--里面对应的资源的菜单path |
| | | */ |
| | | function permissionsInput() { |
| | | function permissionsInput(res,config) { |
| | | if(!strUtil.isEmpty(res)&&res.code==401){ |
| | | config.removeToken(); |
| | | layer.msg('登录过期', {icon: 2, time: 1500}, function () { |
| | | location.replace('/login.html'); |
| | | }, 1000); |
| | | return; |
| | | } |
| | | var needpPermissions = $(".permissions"); |
| | | var permissions = layui.sessionData('tempData')['permissions']; |
| | | needpPermissions.each(function () { |
| | |
| | | // var my_api_server_url = 'http://zuul.kidgrow.com/'; |
| | | // var my_api_server_url = 'http://192.168.2.240:8888/'; |
| | | // var my_api_server_url = 'http://192.168.2.240:8888/'; |
| | | var my_api_server_url = 'http://127.0.0.1:8888/'; |
| | | // var my_api_server_url = 'http://uat-zuul.kidgrow.cloud/'; |
| | | //var my_api_server_url = 'http://123.57.164.62:8888/'; |
| | | |
| | |
| | | {field: 'authorizedGrantTypes',width:250, sort: true, title: 'oauth授权方式'}, |
| | | {align: 'center',width:150, toolbar: '#app-table-bar', title: '操作'} |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar"> |
| | | <input id="app-edit-search" class="layui-input search-input" type="text" placeholder="请输入标题" />  |
| | | <input type="text" class="layui-input search-input" id="test1"> 至 <input type="text" |
| | | class="layui-input search-input" id="test2">   |
| | | <select id="role_clients" placeholder="选择一个应用" lay-filter="role_clients"> |
| | | <option value="">-请选择-</option> |
| | | </select> |
| | | <input id="app-edit-search" class="layui-input search-input" type="text" placeholder="按内容模糊查找..." />  |
| | | <input type="text" class="layui-input search-input" id="test1" placeholder="开始时间"> 至 <input type="text" |
| | | class="layui-input search-input" id="test2" placeholder="结束时间">   |
| | | <button id="app-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button> |
| | | </div> |
| | | |
| | | <!-- 数据表格 --> |
| | | <table class="layui-table" id="app-table" lay-filter="app-table"></table> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="businessRecords-table-bar"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看详情</a> |
| | | </script> |
| | | |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="app-model"> |
| | | <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="recordTitle" disabled="true" type="text" class="layui-input" maxlength="20" |
| | | lay-verify="required" required/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">操作人姓名</label> |
| | | <div class="layui-input-block"> |
| | | <input name="userName" disabled="true" placeholder="请输入应用名称" 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="appName" disabled="true" type="text" class="layui-input" maxlength="20" |
| | | lay-verify="required" required /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">ip</label> |
| | | <div class="layui-input-block"> |
| | | <input name="recordIp" disabled="true" 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="recordDetail" disabled="true" 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> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | |
| | | |
| | | <script> |
| | | layui.use(['form', 'table', 'laydate', 'util', 'config', 'admin'], function () { |
| | |
| | | var util = layui.util; |
| | | var admin = layui.admin; |
| | | |
| | | // 获取应用列表 |
| | | // layer.load(2); |
| | | admin.req('api-user/users/findAll', {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | let selected = false; |
| | | clientsAll = data.data; |
| | | $.each(data.data, function (index, item) { |
| | | if (config.clientId === item.clientId) { |
| | | selected = true; |
| | | } else { |
| | | selected = false; |
| | | } |
| | | //往下拉菜单里添加元素 |
| | | $('#role_clients').append(new Option(item.username, item.id, false, selected)); |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } |
| | | }, 'Post'); |
| | | |
| | | //时间格式 |
| | | var laydate = layui.laydate; |
| | |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | page: true, |
| | | cols: [[ |
| | | { type: 'numbers' }, |
| | | { field: 'userName', width: 180, sort: true, title: '用户' }, |
| | | { field: 'appName', width: 200, sort: true, title: '应用名' }, |
| | | { field: 'recordIp', width: 180, sort: true, title: 'IP' }, |
| | | { field: 'recordTitle', width: 300, sort: true, title: '标题' }, |
| | | { field: 'id', width: 250, align: 'center', toolbar: '#businessRecords-table-bar', sort: true, title: '查看详情' },// 0就诊数据 1筛查 |
| | | { field: 'createTime', width: 250, sort: true, title: '时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" } |
| | | ]] |
| | | }); |
| | | |
| | | // 工具条点击事件 |
| | | table.on('tool(app-table)', function (obj) { |
| | | var data = obj.data; |
| | | var layEvent = obj.event; |
| | | if (layEvent === 'detail') { // 查看详情 |
| | | showEditModel(data); |
| | | { field: 'userName', width: 180, title: '用户' }, |
| | | { field: 'appName', width: 200, title: '应用名' }, |
| | | { field: 'recordIp', width: 180,title: 'IP' }, |
| | | { field: 'recordTitle', width: 300,title: '日志内容' }, |
| | | { field: 'createTime', width: 250, sort: true, title: '日志时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" } |
| | | ]], |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | | // 搜索按钮点击事件 |
| | | $('#app-btn-search').click(function () { |
| | | var userId = $('#role_clients').val(); |
| | | var key = $('#app-edit-search').val(); |
| | | var startTime = $('#test1').val(); |
| | | var endTime = $('#test2').val(); |
| | |
| | | } |
| | | } |
| | | |
| | | table.reload('app-table', { where: { recordTitle: key, startTime: startTime, endTime: endTime, userId: userId } }); |
| | | table.reload('app-table', { where: { recordTitle: key, startTime: startTime, endTime: endTime} }); |
| | | }); |
| | | //比较日期大小 |
| | | function compareDate(logintime, logouttime) { |
| | |
| | | } |
| | | } |
| | | } |
| | | // 导出 |
| | | $('#app-btn-export').click(function () { |
| | | var url = config.base_server + 'api-opration/dataneed/export'; |
| | | var xhr = new XMLHttpRequest(); |
| | | xhr.open('POST', url, true); |
| | | xhr.responseType = "blob"; |
| | | xhr.setRequestHeader("client_type", "DESKTOP_WEB"); |
| | | xhr.setRequestHeader("Authorization", "Bearer " + config.getToken().access_token); |
| | | xhr.onload = function () { |
| | | if (this.status == 200) { |
| | | var fileName = "user.xlsx"; |
| | | var blob = this.response; |
| | | var a = document.createElement('a'); |
| | | a.innerHTML = fileName; |
| | | // 指定生成的文件名 |
| | | a.download = fileName; |
| | | a.href = URL.createObjectURL(blob); |
| | | document.body.appendChild(a); |
| | | var evt = document.createEvent("MouseEvents"); |
| | | evt.initEvent("click", false, false); |
| | | a.dispatchEvent(evt); |
| | | document.body.removeChild(a); |
| | | } |
| | | } |
| | | xhr.send(); |
| | | }); |
| | | |
| | | // // 显示编辑弹窗 |
| | | var showEditModel = function (data) { |
| | | layer.open({ |
| | | type: 1, |
| | | title: '查看详情', |
| | | area: '450px', |
| | | offset: '120px', |
| | | content: $('#app-model').html(), |
| | | success: function () { |
| | | $('#app-form')[0].reset(); |
| | | $('#app-form').attr('method', 'POST'); |
| | | if (data) { |
| | | $("input[name='clientId']").attr('disabled', true); |
| | | $("input[name='clientId']").attr('class', "layui-input layui-disabled"); |
| | | $("input[name='webServerRedirectUri']").attr('disabled', true); |
| | | $("input[name='webServerRedirectUri']").attr('class', "layui-input layui-disabled"); |
| | | form.val('app-form', data); |
| | | // $('#app-form').attr('method', 'POST'); |
| | | } |
| | | } |
| | | }); |
| | | }; |
| | | }); |
| | | </script> |
| | |
| | | { field: 'createTime', width: 250, title: '时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy-MM-dd HH:mm')}}</div>" }, |
| | | { field: 'id', width: 250, align: 'center', toolbar: '#company-table-bar', title: '操作' }, |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | }}, |
| | | { align: 'center', width: 150, toolbar: '#contract-table-bar', title: '操作' } |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | } |
| | |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar"> |
| | | <input id="app-edit-search" class="layui-input search-input" type="text" placeholder="输入医生姓名" />  |
| | | <input type="text" class="layui-input search-input" id="test1"> 至 <input type="text" |
| | | class="layui-input search-input" id="test2">   |
| | | <input type="text" class="layui-input search-input" id="test1" placeholder="请输入开始时间" > 至 <input type="text" |
| | | class="layui-input search-input" id="test2" placeholder="请输入结束时间" >   |
| | | <button id="app-btn-search" class="layui-btn icon-btn permissions" permissions="diagnostic-get"><i class="layui-icon"></i>搜索</button> |
| | | <!-- <button id="app-btn-add" class="layui-btn icon-btn"><i class="layui-icon"></i>添加</button> --> |
| | | <button id="app-btn-export" class="layui-btn icon-btn permissions" permissions="dataneed-export"><i class="layui-icon"></i>导出</button> |
| | |
| | | { field: 'needTags', width: 100, align: 'center', toolbar: '#app-table-bar', title: '需求标签' }, |
| | | { field: 'enabled', width: 200, toolbar: '#app-table-bar1', title: '处理状态', }, |
| | | { field: 'downTime', width: 250, title: '下载时间', templet: "<div>{{layui.util.toDateString(d.downTime, 'yyyy-MM-dd HH:mm')}}</div>" } |
| | | ]],done:function(){ |
| | | permissionsInput(); |
| | | ]],done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | } |
| | | // 导出 |
| | | $('#app-btn-export').click(function () { |
| | | //获取 |
| | | var url = config.base_server + 'api-opration/dataneed/export'; |
| | | var xhr = new XMLHttpRequest(); |
| | | xhr.open('POST', url, true); |
| | |
| | | }, |
| | | { field: 'enabled', width: 100, templet: '#diagnostic-table-bar', title: '查看' } |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | // 搜索按钮点击事件 |
| | |
| | | </form> |
| | | </script> |
| | | |
| | | <!-- 表单弹窗 添加--> |
| | | <script type="text/html" id="app-model-add"> |
| | | |
| | | <form id="app-form-add" lay-filter="app-form-add" class="layui-form model-form"> |
| | | <input name="id" type="hidden"/> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医院名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalName" id="hospitalId-add" type="hidden" class="layui-input" maxlength="20"/> |
| | | <select id="hospitalName-add" name="hospitalId" lay-filter="getdepartment-add" placeholder="选择一个应用" lay-verify="required" required > |
| | | <option value="">-请选择-</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">姓名</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorName" type="text" class="layui-input" maxlength="20" |
| | | lay-verify="required" required /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">科室</label> |
| | | <div class="layui-input-block"> |
| | | <input name="departmentName" id="departmentName" placeholder="请输入应用名称" type="hidden" class="layui-input" maxlength="20"/> |
| | | <select id="departmentId" name="departmentId" lay-filter="departmentId" placeholder="选择一个应用" lay-verify="required" required> |
| | | <option value="">-请选择-</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">职称</label> |
| | | <div class="layui-input-block"> |
| | | <select id="doctorRankId" name="doctorRankId" lay-filter="doctorRankId" placeholder="选择一个职称" lay-verify="required" required> |
| | | <option value="">-请选择-</option> |
| | | </select> |
| | | <input name="doctorRank" id='doctorRank' type="hidden" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">联系电话</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorTel" id="doctorTel-add" type="text" class="layui-input" maxlength="20" lay-verify="required|phone" required/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">其它联系方式</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorOtherLink" type="text" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医生的email</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorEmail" type="text" class="layui-input" maxlength="20" lay-verify="required|email" required/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医生简介</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorAbout" type="text" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label" >销售代表名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="serverUserName" id="serverUserName-add" type="hidden" class="layui-input" maxlength="15"/> |
| | | <select id="serverUserId-add" name="serverUserId" lay-filter="serverUserId-add" placeholder="选择一个应用" lay-verify="required" required> |
| | | <option value="">-请选择-</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label"> 是否置顶</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isTop" id="isTop-shi" type="radio" checked value="true" title="是" class="layui-input" maxlength="20"/> |
| | | <input name="isTop" id="isTop-fou" type="radio" value="false" title="否" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">是否医答</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isAnswer" id="isAnswer-shi" type="radio" checked value="true" title="是" class="layui-input" maxlength="20"/> |
| | | <input name="isAnswer" id="isAnswer-fou" type="radio" value="false" title="否" 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="isSigning" id="isSigning-shi" type="radio" checked value="true" title="是" class="layui-input" maxlength="20"/> |
| | | <input name="isSigning" id="isSigning-fou" type="radio" value="false" title="否" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label"> 医生状态</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorState" id="doctorState-shi" type="radio" checked value="true" title="是" class="layui-input" maxlength="20"/> |
| | | <input name="doctorState" id="doctorState-fou" type="radio" value="false" title="否" 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="username" id="username" readonly type="text" class="layui-input" maxlength="15" lay-verify="required" required/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label" >登录密码</label> |
| | | <div class="layui-input-block"> |
| | | <input name="password" type="password" lay-verify="required" class="layui-input" maxlength="15" lay-verify="required|phone" required/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label" >确认密码</label> |
| | | <div class="layui-input-block"> |
| | | <input name="passwordSure" type="password" lay-verify="required|confirmPass" class="layui-input" maxlength="15"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医生的头像</label> |
| | | <div class="layui-input-block" id="demo"> |
| | | <button type="button" class="layui-btn" id="phonto"> |
| | | <i class="layui-icon"></i>上传图片 |
| | | </button> |
| | | <input name="doctorLogo" id="doctorLogo-add" type="hidden" class="layui-input" maxlength="20"/> |
| | | <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;"> |
| | | 预览图: |
| | | <div class="layui-upload-list" id="demo2"></div> |
| | | </blockquote> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label" >角色</label> |
| | | <div class="layui-input-block"> |
| | | <select name="roleId" xm-select="roleId" lay-verify="required"> |
| | | </select> |
| | | </div> |
| | | </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 permissions" permissions="sysdoctor-edit" id="sure" lay-filter="user-form-submit" lay-submit>保存</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | |
| | | |
| | | <script> |
| | | layui.use(['form', 'table', 'laydate', 'util', 'config', 'upload', 'admin', 'autocomplete','formSelects'], function () { |
| | |
| | | var layer = layui.layer; |
| | | var util = layui.util; |
| | | var admin = layui.admin; |
| | | var upload = layui.upload; |
| | | var autocomplete = layui.autocomplete; |
| | | var formSelects = layui.formSelects; |
| | | var $ = layui.jquery; |
| | |
| | | { width: 300, align: 'center', toolbar: '#doctor-table-bar', title: '操作' }, |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | permissionsInput(); |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | var doctorName = $('#doctorName').val(); |
| | | table.reload('app-table', { where: { doctorState: doctorState, hospitalName: hospitalName, doctorTel: doctorTel, doctorName: doctorName } }); |
| | | }); |
| | | //获取角色 |
| | | var get_role=function(){ |
| | | admin.req('api-user/findByMap?tenant_id=hospital',{}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 == data.code) { |
| | | // 渲染多选下拉框 |
| | | var roleSelectData = new Array(); |
| | | for (var i = 0; i < data.data.length; i++) { |
| | | roleSelectData.push({name: data.data[i].name, value: data.data[i].id}); |
| | | } |
| | | formSelects.data('roleId', 'local', {arr: roleSelectData}); |
| | | |
| | | // 回显user数据 |
| | | var user = admin.getTempData('t_user'); |
| | | $('#user-form').attr('method', 'POST'); |
| | | if (user) { |
| | | form.val('user-form', user); |
| | | $('#user-form').attr('method', 'POST'); |
| | | var rds = new Array(); |
| | | for (var i = 0; i < user.roles.length; i++) { |
| | | rds.push(user.roles[i].id); |
| | | } |
| | | formSelects.value('roleId', rds); |
| | | } |
| | | } else { |
| | | layer.msg('获取角色失败', {icon: 2, time: 500}); |
| | | } |
| | | }, 'GET'); |
| | | } |
| | | |
| | | // 显示新增弹窗 |
| | | var showEditModel_add = function () { |
| | | layer.open({ |
| | | type: 1, |
| | | title: '新增', |
| | | area: '600px', |
| | | offset: '120px', |
| | | content: $('#app-model-add').html(), |
| | | success: function () { |
| | | $('#app-form-add')[0].reset(); |
| | | $('#app-form-add').attr('method', 'POST'); |
| | | $('.layui-layer-content').css('overflow', 'auto'); |
| | | //将医院的数据保存到下拉表 |
| | | let selected = false; |
| | | //获取职称的 |
| | | getZhiCheng(); |
| | | //获取销售代表 |
| | | getXiaoShouDaiBiao(); |
| | | //获取角色 |
| | | get_role(); |
| | | var upload = layui.upload; |
| | | //执行实例 |
| | | upload.render({ |
| | | elem: '#phonto', |
| | | url: config.base_server + 'api-file/files-anon', |
| | | accept: 'file', |
| | | auto: true, |
| | | headers: { "Authorization": "Bearer " + config.getToken().access_token }, |
| | | before: function (obj) { |
| | | layer.load(); //上传loading |
| | | //预读本地文件示例,不支持ie8 |
| | | obj.preview(function (index, file, result) { |
| | | $(".layui-upload-img").remove(); |
| | | $('#demo2').append('<img src="' + result + '" width="50px" height="50px" alt="' + file.name + '" class="layui-upload-img">') |
| | | }); |
| | | }, |
| | | done: function (data) { |
| | | layer.closeAll('loading'); |
| | | $("#doctorLogo-add").val(data.url); |
| | | }, |
| | | error: function (data) { |
| | | layer.closeAll('loading'); |
| | | } |
| | | }); |
| | | $.each(hospital, function (index, item) { |
| | | if (config.clientId === item.clientId) { |
| | | selected = true; |
| | | } else { |
| | | selected = false; |
| | | } |
| | | console.log(item) |
| | | $('#hospitalName-add').append(new Option(item.hospitalName, item.id, false, selected)); |
| | | }) |
| | | form.render(); |
| | | $("#username").blur(function () { |
| | | username_is_usered("username"); |
| | | }) |
| | | $("#doctorTel-add").blur(function () { |
| | | $("#username").val($("#doctorTel-add").val()) |
| | | username_is_usered("username"); |
| | | }) |
| | | admin.popupCenter({ |
| | | title: '编辑医生', |
| | | path: 'pages/opration/doctor_form.html', |
| | | area: '800px', |
| | | finish: function () { |
| | | } |
| | | }); |
| | | }; |
| | | //判断用户名是否被使用 |
| | | var username_is_usered=function(username_id){ |
| | | var username=$("#"+username_id).val() |
| | | admin.req('api-user/users/findCountByMap',JSON.stringify({username:username}), function (data) { |
| | | if (data.code == 0) { |
| | | if(data.data>0){ |
| | | $("#"+username_id).val("") |
| | | layer.msg("该登录帐号已经使用",{ icon: 2, time: 500 }) |
| | | } |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } |
| | | }, 'post'); |
| | | } |
| | | // 显示编辑弹窗 |
| | | var showEditModel = function (data, flag) { |
| | | var title = ""; |
| | | if (flag == 1) { |
| | | title = "查看详情"; |
| | | } else if (flag == 2) { |
| | | title = "新增"; |
| | | } else if (flag == 3) { |
| | | title = "编辑"; |
| | | } |
| | | |
| | | layer.open({ |
| | | type: 1, |
| | | title: title, |
| | | area: '650px', |
| | | offset: '120px', |
| | | content: $('#app-model').html(), |
| | | success: function () { |
| | | $('#app-form')[0].reset(); |
| | | $('#app-form').attr('method', 'POST'); |
| | | //将医院的数据保存到下拉表 |
| | | let selected = false; |
| | | $.each(hospital, function (index, item) { |
| | | if (config.clientId === item.clientId) { |
| | | selected = true; |
| | | } else { |
| | | selected = false; |
| | | } |
| | | //往下拉菜单里添加元素 |
| | | $('#hospitalId').append(new Option(item.hospitalName, item.id, false, selected)); |
| | | }) |
| | | //将科室的数据绑定到里面 |
| | | if (flag != 2) { |
| | | getdepartment(data.hospitalId); |
| | | } |
| | | if (data) { |
| | | if (data.isAnswer) { |
| | | $("#isAnswer-shi").attr('checked', true); |
| | | } else { |
| | | $("#isAnswer-fou").attr('checked', true); |
| | | } |
| | | |
| | | if (data.isSigning) { |
| | | $("#isSigning-shi").attr('checked', true); |
| | | } else { |
| | | $("#isSigning-fou").attr('checked', true); |
| | | } |
| | | |
| | | if (data.isTop) { |
| | | $("#isTop-shi").attr('checked', true); |
| | | } else { |
| | | $("#isTop-fou").attr('checked', true); |
| | | } |
| | | |
| | | if (data.doctorState) { |
| | | $("#doctorState-shi").attr('checked', true); |
| | | } else { |
| | | $("#doctorState-fou").attr('checked', true); |
| | | } |
| | | form.val('app-form', data); |
| | | if (flag == 1) { |
| | | //将确定隐藏 doctorState-shi |
| | | $("#sure").hide(); |
| | | $("#phonto").hide(); |
| | | //将所有的设置为只读 |
| | | $('#app-form').find('input').attr('readonly', true); |
| | | $('#app-form').find('select,input[type="radio"]').attr('disabled', true); |
| | | } else { |
| | | $("#sure").show(); |
| | | $('#app-form').attr('method', 'POST'); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }; |
| | | // 表单提交事件 |
| | | form.on('submit(user-form-submit)', function (data) { |
| | | layer.load(2); |
| | | data.field.hospitalId = parseInt(data.field.hospitalId); |
| | | if(data.field.roleId!=null&&data.field.roleId!=""){ |
| | | data.field.roles=data.field.roleId.split(','); |
| | | } |
| | | data.field.roleId=null; |
| | | admin.req('api-user/sysdoctor', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | // layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.closeAll(); |
| | | table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } |
| | | }, "POST"); |
| | | return false; |
| | | }); |
| | | //更新 点击医院触发的事件 |
| | | form.on('select(getdepartment)', function (data) { |
| | | //将医院名称赋值 |
| | | $.each(hospital, function (index, item) { |
| | | if (item.id == data.value) { |
| | | $('#hospitalName').val(item.hospitalName); |
| | | } |
| | | }) |
| | | // |
| | | getdepartment(data.value); |
| | | }); |
| | | //新增----点击医院触发的事件 |
| | | form.on('select(getdepartment-add)', function (data) { |
| | | //将医院名称赋值 |
| | | $.each(hospital, function (index, item) { |
| | | if (item.id == data.value) { |
| | | $('#hospitalId-add').val(item.hospitalName); |
| | | console.log($('#hospitalId-add').val()) |
| | | } |
| | | }) |
| | | // |
| | | getdepartment(data.value); |
| | | }); |
| | | //将新增 中的 serverUserName 赋值 |
| | | form.on('select(serverUserId-add)', function (data) { |
| | | //将医院名称赋值 |
| | | $.each(user, function (index, item) { |
| | | if (item.id == data.value) { |
| | | $('#serverUserName-add').val(item.nickname); |
| | | console.log($('#serverUserName-add').val()) |
| | | } |
| | | }) |
| | | // |
| | | }); |
| | | //新增 点击职称的触发事件 |
| | | form.on('select(doctorRankId)', function (data) { |
| | | //将部门名称赋值 |
| | | |
| | | $.each(doctorRank, function (index, item) { |
| | | if (item.id == data.value) { |
| | | console.log(12312312312) |
| | | $('#doctorRank').val(item.dictionariesName); |
| | | console.log($('#doctorRank').val()) |
| | | } |
| | | }) |
| | | }); |
| | | //新增 和 更新 科室触发的事件 |
| | | form.on('select(departmentId)', function (data) { |
| | | //将部门名称赋值 |
| | | $.each(department, function (index, item) { |
| | | if (item.id == data.value) { |
| | | $('#departmentName').val(item.departmentName); |
| | | } |
| | | }) |
| | | // |
| | | // getdepartment(data.value); |
| | | }); |
| | | //获取科室 |
| | | var getdepartment = function (data) { |
| | | admin.req('api-user/sysdepartment/findListByHospitalId', { id: data }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | department = data.data; |
| | | $('#departmentId').empty(); |
| | | if (data.data.length > 0) { |
| | | $('#departmentName').val(data.data[0].departmentName); |
| | | } |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | $('#departmentId').append(new Option(item.departmentName, item.id, false, false)); |
| | | form.render('select', 'app-form'); |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } |
| | | }, 'get'); |
| | | } |
| | | |
| | | }); |
| | | </script> |
| | |
| | | </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="user-form-submit permissions" permissions=" |
| | | <button class="layui-btn" id="sure" lay-filter="user-form-submit" permissions=" |
| | | doctortemplete-edit" lay-submit>保存</button> |
| | | </div> |
| | | </form> |
| | |
| | | { field: 'templeteTitle', width: 180, sort: true, title: '标题' }, |
| | | { |
| | | field: 'publicType', width: 200, sort: true, title: '开放类型', templet: function (d) { |
| | | return d.publicType ==true ? "公开" : "私有" |
| | | return d.publicType ==true ? "私有" : "公开" |
| | | } |
| | | }, |
| | | { |
| | |
| | | { field: 'enabled', width: 100, sort: true, templet: '#doctor-templete-tpl-state', title: '状态' }, |
| | | { field: 'recordTitle', width: 300, toolbar: '#doctor-templete-table-bar', sort: true, title: '操作' }, |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
New file |
| | |
| | | <form id="app-form-add" lay-filter="app-form-add" class="layui-form model-form"> |
| | | <input name="id" type="hidden" /> |
| | | <div style="display:flex"> |
| | | <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 style="width: 175px;"/> |
| | | <input type="hidden" name="hospitalId" id="hospitalId"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">科室</label> |
| | | <div class="layui-input-block"> |
| | | <input name="departmentName" id="departmentName" placeholder="请选择科室" type="hidden" class="layui-input" |
| | | maxlength="20" /> |
| | | <select id="departmentId" name="departmentId" lay-filter="departmentId" placeholder="请选择科室" |
| | | lay-verify="required" required> |
| | | <option value="">-请选择科室-</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医生类型</label> |
| | | <div class="layui-input-block"> |
| | | <select id="doctorType" name="doctorType" lay-filter="doctorType" |
| | | lay-verify="required" required> |
| | | <option value="2" selected>C端医生</option> |
| | | <option value="1">H端医生</option> |
| | | <option value="0">C端+H端</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">姓名</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorName" type="text" class="layui-input" maxlength="20" lay-verify="required" |
| | | required style="width: 175px;"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">职称</label> |
| | | <div class="layui-input-block"> |
| | | <select id="doctorRankId" name="doctorRankId" lay-filter="doctorRankId" placeholder="选择一个职称" |
| | | lay-verify="required" required> |
| | | <option value="">-请选择-</option> |
| | | </select> |
| | | <input name="doctorRank" id='doctorRank' type="hidden" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">角色</label> |
| | | <div class="layui-input-block"> |
| | | <select name="roleId" xm-select="roleId" lay-verify="required"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">联系电话</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorTel" id="doctorTel-add" type="text" class="layui-input" maxlength="20" |
| | | lay-verify="required|phone" required style="width: 175px;"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">联系电话2</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorOtherLink" type="text" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">Email</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorEmail" type="text" class="layui-input" maxlength="20" lay-verify="required|email" |
| | | required /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医生简介</label> |
| | | <div class="layui-input-block"> |
| | | <textarea name="doctorAbout" id="doctorAbout" class="layui-textarea" maxlength="300" style="width: 650px;"></textarea> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医生状态</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorState" id="doctorState-shi" type="radio" checked value="true" title="正常" class="layui-input"/> |
| | | <input name="doctorState" id="doctorState-fou" type="radio" value="false" title="试用" class="layui-input" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label"> 置顶</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isTop" id="isTop-shi" type="radio" checked value="true" title="是" class="layui-input"/> |
| | | <input name="isTop" id="isTop-fou" type="radio" value="false" title="否" class="layui-input" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医答</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isAnswer" id="isAnswer-shi" type="radio" checked value="true" title="是" class="layui-input"/> |
| | | <input name="isAnswer" id="isAnswer-fou" type="radio" value="false" title="否" class="layui-input" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">签约</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isSigning" id="isSigning-shi" type="radio" checked value="true" title="是" |
| | | class="layui-input"/> |
| | | <input name="isSigning" id="isSigning-fou" type="radio" value="false" title="否" class="layui-input"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">登录帐号</label> |
| | | <div class="layui-input-block"> |
| | | <input name="username" id="username" readonly type="text" class="layui-input" maxlength="20" |
| | | lay-verify="required" required /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">登录密码</label> |
| | | <div class="layui-input-block"> |
| | | <input name="password" type="password" lay-verify="required" class="layui-input" maxlength="20" |
| | | lay-verify="required|phone" required /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">确认密码</label> |
| | | <div class="layui-input-block"> |
| | | <input name="passwordSure" type="password" lay-verify="required|confirmPass" class="layui-input" |
| | | maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医生的头像</label> |
| | | <div class="layui-input-block" id="demo"> |
| | | <button type="button" class="layui-btn" id="phonto"> |
| | | <i class="layui-icon"></i>上传图片 |
| | | </button> |
| | | <input name="doctorLogo" id="doctorLogo-add" type="hidden" class="layui-input" maxlength="20" /> |
| | | <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;"> |
| | | 预览效果 |
| | | <div class="layui-upload-list" id="demo2"></div> |
| | | </blockquote> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">销售代表</label> |
| | | <div class="layui-input-block"> |
| | | <input name="serverUserName" id="serverUserName-add" type="hidden" class="layui-input" maxlength="15" /> |
| | | <select id="serverUserId-add" name="serverUserId" lay-filter="serverUserId-add" |
| | | lay-verify="required" required> |
| | | <option value="">-请选择-</option> |
| | | </select> |
| | | </div> |
| | | </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 permissions" permissions="sysdoctor-edit" id="sure" lay-filter="user-form-submit" |
| | | lay-submit>保存</button> |
| | | </div> |
| | | </form> |
| | | |
| | | <script> |
| | | layui.use(['form', 'laydate', 'util', 'config', 'admin', 'autocomplete', 'formSelects'], function () { |
| | | var form = layui.form; |
| | | var config = layui.config; |
| | | var layer = layui.layer; |
| | | var util = layui.util; |
| | | var admin = layui.admin; |
| | | var upload = layui.upload; |
| | | var autocomplete = layui.autocomplete; |
| | | var formSelects = layui.formSelects; |
| | | var $ = layui.jquery; |
| | | |
| | | //获取角色 |
| | | var get_role = function () { |
| | | admin.req('api-user/findByMap?tenant_id=hospital', {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 == data.code) { |
| | | // 渲染多选下拉框 |
| | | var roleSelectData = new Array(); |
| | | for (var i = 0; i < data.data.length; i++) { |
| | | roleSelectData.push({ |
| | | name: data.data[i].name, |
| | | value: data.data[i].id |
| | | }); |
| | | } |
| | | formSelects.data('roleId', 'local', { |
| | | arr: roleSelectData |
| | | }); |
| | | |
| | | // 回显user数据 |
| | | var user = admin.getTempData('t_user'); |
| | | $('#user-form').attr('method', 'POST'); |
| | | if (user) { |
| | | form.val('user-form', user); |
| | | $('#user-form').attr('method', 'POST'); |
| | | var rds = new Array(); |
| | | for (var i = 0; i < user.roles.length; i++) { |
| | | rds.push(user.roles[i].id); |
| | | } |
| | | formSelects.value('roleId', rds); |
| | | } |
| | | } else { |
| | | layer.msg('获取角色失败', { |
| | | icon: 2, |
| | | time: 500 |
| | | }); |
| | | } |
| | | }, 'GET'); |
| | | } |
| | | //判断用户名是否被使用 |
| | | var username_is_usered = function (username_id) { |
| | | var username = $("#" + username_id).val() |
| | | admin.req('api-user/users/findCountByMap', JSON.stringify({ |
| | | username: username |
| | | }), function (data) { |
| | | if (data.code == 0) { |
| | | if (data.data > 0) { |
| | | $("#" + username_id).val("") |
| | | layer.msg("该登录帐号已经使用", { |
| | | icon: 2, |
| | | time: 500 |
| | | }) |
| | | } |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 500 |
| | | }); |
| | | } |
| | | }, 'post'); |
| | | } |
| | | // // 显示编辑弹窗 |
| | | // var showEditModel = function (data, flag) { |
| | | // var title = ""; |
| | | // if (flag == 1) { |
| | | // title = "查看详情"; |
| | | // } else if (flag == 2) { |
| | | // title = "新增"; |
| | | // } else if (flag == 3) { |
| | | // title = "编辑"; |
| | | // } |
| | | |
| | | // layer.open({ |
| | | // type: 1, |
| | | // title: title, |
| | | // area: '650px', |
| | | // offset: '120px', |
| | | // content: $('#app-model').html(), |
| | | // success: function () { |
| | | // $('#app-form')[0].reset(); |
| | | // $('#app-form').attr('method', 'POST'); |
| | | // //将医院的数据保存到下拉表 |
| | | // let selected = false; |
| | | // //将科室的数据绑定到里面 |
| | | // if (flag != 2) { |
| | | // getdepartment(data.hospitalId); |
| | | // } |
| | | // if (data) { |
| | | // if (data.isAnswer) { |
| | | // $("#isAnswer-shi").attr('checked', true); |
| | | // } else { |
| | | // $("#isAnswer-fou").attr('checked', true); |
| | | // } |
| | | |
| | | // if (data.isSigning) { |
| | | // $("#isSigning-shi").attr('checked', true); |
| | | // } else { |
| | | // $("#isSigning-fou").attr('checked', true); |
| | | // } |
| | | |
| | | // if (data.isTop) { |
| | | // $("#isTop-shi").attr('checked', true); |
| | | // } else { |
| | | // $("#isTop-fou").attr('checked', true); |
| | | // } |
| | | |
| | | // if (data.doctorState) { |
| | | // $("#doctorState-shi").attr('checked', true); |
| | | // } else { |
| | | // $("#doctorState-fou").attr('checked', true); |
| | | // } |
| | | // form.val('app-form', data); |
| | | // if (flag == 1) { |
| | | // //将确定隐藏 doctorState-shi |
| | | // $("#sure").hide(); |
| | | // $("#phonto").hide(); |
| | | // //将所有的设置为只读 |
| | | // $('#app-form').find('input').attr('readonly', true); |
| | | // $('#app-form').find('select,input[type="radio"]').attr('disabled', |
| | | // true); |
| | | // } else { |
| | | // $("#sure").show(); |
| | | // $('#app-form').attr('method', 'POST'); |
| | | // } |
| | | // } |
| | | // } |
| | | // }); |
| | | // }; |
| | | // 表单提交事件 |
| | | form.on('submit(user-form-submit)', function (data) { |
| | | layer.load(2); |
| | | data.field.hospitalId = parseInt($("#hospitalId").val()); |
| | | if (data.field.roleId != null && data.field.roleId != "") { |
| | | data.field.roles = data.field.roleId.split(','); |
| | | } |
| | | data.field.roleId = null; |
| | | debugger |
| | | admin.req('api-user/sysdoctor', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.closeAll(); |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 3000 |
| | | }); |
| | | } |
| | | }, "POST"); |
| | | return false; |
| | | }); |
| | | |
| | | //将新增 中的 serverUserName 赋值 |
| | | form.on('select(serverUserId-add)', function (data) { |
| | | //将医院名称赋值 |
| | | $('#serverUserName-add').val($(this)[0].innerHTML); |
| | | }); |
| | | //新增 点击职称的触发事件 |
| | | form.on('select(doctorRankId)', function (data) { |
| | | //将部门名称赋值 |
| | | $('#doctorRank').val($(this)[0].innerHTML); |
| | | }); |
| | | //新增 和 更新 科室触发的事件 |
| | | form.on('select(departmentId)', function () { |
| | | //将部门名称赋值 |
| | | $('#departmentName').val($(this)[0].innerHTML); |
| | | }); |
| | | //获取科室 |
| | | var getdepartment = function (data) { |
| | | admin.req('api-user/sysdepartment/findListByHospitalId', { |
| | | id: data |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | department = data.data; |
| | | $('#departmentId').empty(); |
| | | if (data.data.length > 0) { |
| | | $('#departmentName').val(data.data[0].departmentName); |
| | | } |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | $('#departmentId').append(new Option(item.departmentName, item.id, |
| | | false, false)); |
| | | form.render('select', 'app-form'); |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 500 |
| | | }); |
| | | } |
| | | }, 'get'); |
| | | } |
| | | //职称添加数据 |
| | | var getZhiCheng = function () { |
| | | admin.req('api-user/sysdictionaries/findAll', JSON.stringify({ |
| | | dictionariesClassId: "1248150699682988034" |
| | | }), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | let selected = false; |
| | | doctorRank = data.data; |
| | | $.each(data.data, function (index, item) { |
| | | if (config.clientId === item.clientId) { |
| | | selected = true; |
| | | } else { |
| | | selected = false; |
| | | } |
| | | //往下拉菜单里添加元素 |
| | | $('#doctorRankId').append(new Option(item.dictionariesName, item.id, |
| | | false, selected)); |
| | | }) |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 500 |
| | | }); |
| | | } |
| | | }, 'Post'); |
| | | } |
| | | //获取销售代表 |
| | | var getXiaoShouDaiBiao = function () { |
| | | admin.req('api-user/users/getThisUserOrganizationUser', {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | user = data.data; |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | $('#serverUserId-add').append(new Option(item.nickname, item.id, |
| | | false, false)); |
| | | }) |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 500 |
| | | }); |
| | | } |
| | | }, 'get'); |
| | | } |
| | | // 显示新增弹窗 |
| | | var loadEditData = function () { |
| | | $('#app-form-add')[0].reset(); |
| | | $('#app-form-add').attr('method', 'POST'); |
| | | $('.layui-layer-content').css('overflow', 'auto'); |
| | | //将医院的数据保存到下拉表 |
| | | let selected = false; |
| | | //获取职称的 |
| | | getZhiCheng(); |
| | | //获取销售代表 |
| | | getXiaoShouDaiBiao(); |
| | | //获取角色 |
| | | get_role(); |
| | | var upload = layui.upload; |
| | | //执行实例 |
| | | upload.render({ |
| | | elem: '#phonto', |
| | | url: config.base_server + 'api-file/files-anon', |
| | | accept: 'file', |
| | | auto: true, |
| | | headers: { |
| | | "Authorization": "Bearer " + config.getToken().access_token |
| | | }, |
| | | before: function (obj) { |
| | | layer.load(); //上传loading |
| | | //预读本地文件示例,不支持ie8 |
| | | obj.preview(function (index, file, result) { |
| | | $(".layui-upload-img").remove(); |
| | | $('#demo2').append('<img src="' + result + |
| | | '" width="50px" height="50px" alt="' + file.name + |
| | | '" class="layui-upload-img">') |
| | | }); |
| | | }, |
| | | done: function (data) { |
| | | layer.closeAll('loading'); |
| | | $("#doctorLogo-add").val(data.url); |
| | | }, |
| | | error: function (data) { |
| | | layer.closeAll('loading'); |
| | | } |
| | | }); |
| | | form.render(); |
| | | $("#username").blur(function () { |
| | | username_is_usered("username"); |
| | | }) |
| | | $("#doctorTel-add").blur(function () { |
| | | $("#username").val($("#doctorTel-add").val()) |
| | | username_is_usered("username"); |
| | | }) |
| | | }; |
| | | loadEditData(); |
| | | //自动完成-医院名称 |
| | | autocomplete.render({ |
| | | elem: $('#hospitalName')[0], |
| | | keywordsName: 'hospitalName', //查询关键字名称 |
| | | url: config.base_server + 'api-user/syshospital/findByName', |
| | | template_val: '{{d.hospitalName}}', //选择后文本框显示的数据字段 |
| | | template_txt: "<div class='layui-table-cell'>{{d.hospitalName}}</div>", //下拉列表模板 |
| | | onselect: function (resp) { |
| | | $("#hospitalId").val(resp.id); |
| | | //重新装载科室 |
| | | getdepartment(resp.id); |
| | | } |
| | | }); |
| | | }); |
| | | </script> |
| | |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar">  |
| | | <input id="user-search-value" class="layui-input search-input" type="text" placeholder="输入医生姓名" />  |
| | | <input type="text" name="date" id="datebegin" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" |
| | | <input type="text" name="date" id="datebegin" lay-verify="date" placeholder="请输入开始时间" autocomplete="off" |
| | | class="layui-input search-input"> |
| | | 至 |
| | | <input type="text" name="date" id="dateend" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" |
| | | <input type="text" name="date" id="dateend" lay-verify="date" placeholder="请输入结束时间" autocomplete="off" |
| | | class="layui-input search-input">   |
| | | <button id="user-btn-search" class="layui-btn icon-btn permissioins" permissioins="feedback-list"><i class="layui-icon"></i>搜索</button> |
| | | </div> |
| | |
| | | return new Date(d.createTime).dateFormat("yyyy-MM-dd hh:mm"); |
| | | } }, |
| | | { align: 'center', width: 200, toolbar: '#feeedback-table-bar', title: '操作' } |
| | | ]],done:function(){ |
| | | permissionsInput(); |
| | | ]],done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | { field: 'enabled', width: 100, templet: '#hospital-tpl-state', title: '状态' }, |
| | | { field: 'hospitalId', width: 300, align: 'center', toolbar: '#businessRecords-table-bar', title: '操作', fixed: 'right' } |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | //省份数据加载 |
| | |
| | | <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" |
| | | <input name="hospitalShortName" type="text" class="layui-input" maxlength="20" |
| | | style="width: 200px;" /> |
| | | </div> |
| | | </div> |
| | |
| | | <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: 175px;" /> |
| | | maxlength="20" lay-verify="required" required style="width: 175px;" /> |
| | |  </div> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">联系电话</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalTel" id="hospitalTel" type="text" class="layui-input" maxlength="50" /> |
| | | <input name="hospitalTel" id="hospitalTel" 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="hospitalLink" type="text" class="layui-input" maxlength="50" style="width: 200px;" /> |
| | | <input name="hospitalLink" type="text" class="layui-input" maxlength="20" style="width: 200px;" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <label class="layui-form-label">帐号数量</label> |
| | | <div class="layui-input-block"> |
| | | <input id="accountsCount" name="accountsCount" type="text" value="6" class="layui-input" |
| | | maxlength="50" lay-verify="required|integer" style="width: 200px;" /> |
| | | maxlength="1" lay-verify="required|integer" style="width: 200px;" /> |
| | | </div> |
| | | </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="" /> |
| | | <input name="serverUserId" id="serverUserId" type="hidden" value="" maxlength="20" /> |
| | | <select lay-verify="required" required name="serverUserName" id="serverUserName" |
| | | style="width: 150px;" lay-filter="serverUserName"> |
| | | </select> |
| | |
| | | <div class="layui-col-sm6"> |
| | | <label class="layui-form-label">服务人电话</label> |
| | | <div class="layui-input-block"> |
| | | <input name="serverUserTel" id="serverUserTel" type="text" class="layui-input" maxlength="20" value=""/> |
| | | <input name="serverUserTel" id="serverUserTel" type="text" class="layui-input" maxlength="20" |
| | | value="" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label">销售人员</label> |
| | | <div class="layui-input-block"> |
| | | <input name="saleUserId" id="saleUserId" type="hidden" value="" /> |
| | | <select lay-verify="required" required name="saleUserName" id="saleUserName" style="width: 150px;" lay-filter="saleUserName"> |
| | | <input name="saleUserId" id="saleUserId" type="hidden" value="" maxlength="20" /> |
| | | <select lay-verify="required" required name="saleUserName" id="saleUserName" style="width: 150px;" |
| | | lay-filter="saleUserName"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="layui-col-sm6"> |
| | | <label class="layui-form-label">销售人电话</label> |
| | | <div class="layui-input-block"> |
| | | <input name="saleUserTel" id="saleUserTel" type="text" class="layui-input" maxlength="20" value=""/> |
| | | <input name="saleUserTel" id="saleUserTel" type="text" class="layui-input" maxlength="20" value="" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医院简介</label> |
| | | <div class="layui-input-block"> |
| | | <textarea name="hospitalAbout" class="layui-textarea" maxlength="500"></textarea> |
| | | <textarea name="hospitalAbout" class="layui-textarea" maxlength="300"></textarea> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item model-form-footer"> |
| | |
| | | </form> |
| | | |
| | | <script> |
| | | |
| | | |
| | | layui.use(['form', 'table', 'util', 'config', 'admin', 'area', 'dic', 'autocomplete'], function () { |
| | | var form = layui.form; |
| | | var table = layui.table; |
| | |
| | | var dic = layui.dic; |
| | | var autocomplete = layui.autocomplete; |
| | | var $ = layui.jquery; |
| | | |
| | | //加载服务人员信息 |
| | | var loadServerUser = function (selectVal) { |
| | | admin.req('api-user/users/getAppointUser', { type: 1 }, function (data) { |
| | | admin.req('api-user/users/getAppointUser', { |
| | | type: 1 |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | if (data.data.length > 0) { |
| | | $.each(data.data, function (index, item) { |
| | | if (selectVal == item.id) { |
| | | $('#serverUserName').append(new Option(item.nickname, item.id, false, true)); |
| | | } |
| | | else { |
| | | if (!strUtil.isEmpty(selectVal) && selectVal == item.id) { |
| | | $('#serverUserName').append(new Option(item.nickname, item |
| | | .id, false, true)); |
| | | } else { |
| | | //往下拉菜单里添加元素 |
| | | $('#serverUserName').append(new Option(item.nickname, item.id, false, false)); |
| | | $('#serverUserName').append(new Option(item.nickname, item |
| | | .id, false, false)); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if(hosIdForEdit == ""){ |
| | | if (hosIdForEdit == "") { |
| | | $("#serverUserTel").val(data.data[0].mobile); |
| | | $('#serverUserName').val(data.data[0].id); |
| | | form.render(); |
| | | } |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 500 |
| | | }); |
| | | } |
| | | |
| | | |
| | | }, 'get'); |
| | | } |
| | | |
| | | //加载销售人员信息 |
| | | var loadSaleUser = function (selectVal) { |
| | | admin.req('api-user/users/getAppointUser', { type: 0 }, function (data) { |
| | | admin.req('api-user/users/getAppointUser', { |
| | | type: 0 |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | if (data.data.length > 0) { |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | if (selectVal == item.id) { |
| | | $('#saleUserName').append(new Option(item.nickname, item.id, false, true)); |
| | | if (!strUtil.isEmpty(selectVal) && selectVal == item.id) { |
| | | $('#saleUserName').append(new Option(item.nickname, item.id, |
| | | false, true)); |
| | | } else { |
| | | $('#saleUserName').append(new Option(item.nickname, item.id, false, false)); |
| | | $('#saleUserName').append(new Option(item.nickname, item.id, |
| | | false, false)); |
| | | } |
| | | }); |
| | | |
| | | if(hosIdForEdit == ""){ |
| | | $("#saleUserTel").val(data.data[0].mobile); |
| | | form.render(); |
| | | } |
| | | if (hosIdForEdit == "") { |
| | | $("#saleUserTel").val(data.data[0].mobile); |
| | | $('#saleUserName').val(data.data[0].id); |
| | | form.render(); |
| | | } |
| | | } |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 500 |
| | | }); |
| | | } |
| | | |
| | | |
| | | }, 'get'); |
| | | } |
| | | |
| | | |
| | | //医院资质数据 |
| | | dic.dicData("#hospitalQualifiedName", "HOSPITAL_QUALIFIED", ""); |
| | | //医院类型数据 |
| | | dic.dicData("#hospitalTypeName", "HOSPITAL_TYPE", ""); |
| | | //省份数据加载 |
| | | area.areaData("#hospitalProvince", 1, "", ""); |
| | | //回显组织数据 |
| | | let edithospitalData = admin.getTempData('t_hospital'); |
| | | var hosIdForEdit = ""; |
| | | if (edithospitalData != null) { |
| | | hosIdForEdit = edithospitalData.hospitalId; |
| | | } |
| | | //装载销售人员 服务人员数据 |
| | | loadServerUser(); |
| | | loadSaleUser(); |
| | | |
| | | //装载市区数据 |
| | | form.on("select(hospitalProvince)", function (data) { |
| | | area.areasClear("#hospitalArea", 3); |
| | |
| | | }) |
| | | } |
| | | }); |
| | | |
| | | //赋值资质数据ID |
| | | form.on("select(hospitalQualifiedName)", function (data) { |
| | | $("#hospitalQualifiedId").val(data.value); |
| | |
| | | layer.load(2); |
| | | if (data.field != null) { |
| | | |
| | | data.field.hospitalTypeName = $("#hospitalTypeName option:selected").text() != "请选择" ? $("#hospitalTypeName option:selected").text() : ""; |
| | | data.field.hospitalQualifiedName = $("#hospitalQualifiedName option:selected").text() != "请选择" ? $("#hospitalQualifiedName option:selected").text() : ""; |
| | | data.field.hospitalProvince = $("#hospitalProvince option:selected").text() != "选择省" ? $("#hospitalProvince option:selected").text() : ""; |
| | | data.field.hospitalCity = $("#hospitalCity option:selected").text() != "选择市" ? $("#hospitalCity option:selected").text() : ""; |
| | | data.field.hospitalArea = $("#hospitalArea option:selected").text() != "选择区县" ? $("#hospitalArea option:selected").text() : ""; |
| | | data.field.hospitalTypeName = $("#hospitalTypeName option:selected").text() != "请选择" ? |
| | | $("#hospitalTypeName option:selected").text() : ""; |
| | | data.field.hospitalQualifiedName = $("#hospitalQualifiedName option:selected").text() != |
| | | "请选择" ? $("#hospitalQualifiedName option:selected").text() : ""; |
| | | data.field.hospitalProvince = $("#hospitalProvince option:selected").text() != "选择省" ? |
| | | $("#hospitalProvince option:selected").text() : ""; |
| | | data.field.hospitalCity = $("#hospitalCity option:selected").text() != "选择市" ? $( |
| | | "#hospitalCity option:selected").text() : ""; |
| | | data.field.hospitalArea = $("#hospitalArea option:selected").text() != "选择区县" ? $( |
| | | "#hospitalArea option:selected").text() : ""; |
| | | |
| | | admin.req('api-user/syshospital', JSON.stringify(data.field), function (data) { |
| | | if (data.code === 0) { |
| | |
| | | serverUserTel: $("#serverUserTel").val(), |
| | | departmentName: $("#departmentName").val(), |
| | | id: $("#departmentId").val(), |
| | | orgId: $("#departmentOrgId").val(), |
| | | orgId: ''+$("#departmentOrgId").val(), |
| | | updateUserId: data.data.orgId, |
| | | hospitalId: data.data.id, |
| | | saleUserId: $("#saleUserName").val(), |
| | | saleUserName: $("#saleUserName option:selected").text(), |
| | | saleUserTel: $("#saleUserTel").val() |
| | | saleUserTel: $("#saleUserTel").val(), |
| | | accountsCount: $("#accountsCount").val() |
| | | }; |
| | | admin.req('api-user/sysdepartment', JSON.stringify(departmentData), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 1000 }, function () { |
| | | admin.finishPopupCenter(); |
| | | }); |
| | | admin.putTempData("t_hospital", ""); |
| | | admin.putTempData("t_city", ""); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | } |
| | | }, "POST"); |
| | | admin.req('api-user/sysdepartment', JSON.stringify(departmentData), |
| | | function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { |
| | | icon: 1, |
| | | time: 1000 |
| | | }, function () { |
| | | admin.finishPopupCenter(); |
| | | }); |
| | | admin.putTempData("t_hospital", ""); |
| | | admin.putTempData("t_city", ""); |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 1000 |
| | | }); |
| | | } |
| | | }, "POST"); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 1000 |
| | | }); |
| | | } |
| | | }, "POST"); |
| | | } |
| | | else { |
| | | layer.msg("数据异常!", { icon: 2, time: 1000 }); |
| | | } else { |
| | | layer.msg("数据异常!", { |
| | | icon: 2, |
| | | time: 1000 |
| | | }); |
| | | } |
| | | return false; |
| | | }); |
| | | //自动完成-医院名称 |
| | | autocomplete.render({ |
| | | elem: $('#hospitalName')[0], |
| | | keywordsName: 'hospitalName',//查询关键字名称 |
| | | keywordsName: 'hospitalName', //查询关键字名称 |
| | | url: config.base_server + 'api-user/syshospital/findByName', |
| | | template_val: '{{d.hospitalName}}',//选择后文本框显示的数据字段 |
| | | template_txt: "<div class='layui-table-cell'>{{d.hospitalName}}</div>",//下拉列表模板 |
| | | template_val: '{{d.hospitalName}}', //选择后文本框显示的数据字段 |
| | | template_txt: "<div class='layui-table-cell'>{{d.hospitalName}}</div>", //下拉列表模板 |
| | | onselect: function (resp) { |
| | | loadDatas(resp.id); |
| | | } |
| | | }); |
| | | //加载当前所在部门的在职员工 |
| | | /*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) { |
| | | //往下拉菜单里添加元素 |
| | | $('#serverUserName').append(new Option(item.nickname, item.id, false, false)); |
| | | }) |
| | | $('#serverUserName').val(config.getUser().id); |
| | | $('#serverUserId').val(config.getUser().id); |
| | | form.render('select'); |
| | | } |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } |
| | | }, 'get');*/ |
| | | |
| | | |
| | | |
| | | //检查科室名是否存在 |
| | | $("#departmentName").blur(function () { |
| | |
| | | } |
| | | let hosIdForDep = $("#id").val(); |
| | | if (!strUtil.isEmpty($("#departmentName").val()) && !strUtil.isEmpty(hosIdForDep)) { |
| | | admin.req('api-user/sysdepartment/checkName', { hospitalId: hosIdForDep, departmentName: $("#departmentName").val() }, function (data) { |
| | | admin.req('api-user/sysdepartment/checkName', { |
| | | hospitalId: hosIdForDep, |
| | | departmentName: $("#departmentName").val() |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 != data.code) { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 1000 |
| | | }); |
| | | return false; |
| | | } |
| | | }, 'get'); |
| | |
| | | if (!strUtil.isEmpty(hosData.hospitalProvince)) |
| | | area.areaData("#hospitalProvince", 1, "", hosData.hospitalProvince); |
| | | if (!strUtil.isEmpty(hosData.hospitalCity)) |
| | | area.areaData("#hospitalCity", 2, $("#hospitalProvince").val(), hosData.hospitalCity); |
| | | area.areaData("#hospitalCity", 2, $("#hospitalProvince").val(), hosData |
| | | .hospitalCity); |
| | | |
| | | if (!strUtil.isEmpty(hosData.hospitalArea)) |
| | | area.areaData("#hospitalArea", 3, $("#hospitalCity").val(), hosData.hospitalArea); |
| | | area.areaData("#hospitalArea", 3, $("#hospitalCity").val(), hosData |
| | | .hospitalArea); |
| | | //装载资质 类型 |
| | | $("#hospitalQualifiedName").val(hosData.hospitalQualifiedId); |
| | | $("#hospitalTypeName").val(hosData.hospitalTypeId); |
| | | |
| | | //装载科室数据 |
| | | admin.req('api-user/sysdepartment', { hospitalId: hosId, isDel: 0, page: 1, limit: 20 }, function (data) { |
| | | admin.req('api-user/sysdepartment', { |
| | | hospitalId: hosId, |
| | | isDel: 0, |
| | | page: 1, |
| | | limit: 20 |
| | | }, function (data) { |
| | | if (data.code == 0) { |
| | | let departData = data.data.data; |
| | | if (departData.length > 0) { |
| | | if (departData.length > 1) { |
| | | layer.msg("该医院下有多个科室,默认显示第一个", { icon: 1, time: 2000 }); |
| | | layer.msg("该医院下有多个科室,默认显示第一个", { |
| | | icon: 1, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | |
| | | $("#serverUserId").val(departData[0].serverUserId); |
| | | loadServerUser(departData[0].serverUserId); |
| | | |
| | | $('#serverUserName').val(departData[0].serverUserId); |
| | | |
| | | $("#departmentName").val(departData[0].departmentName); |
| | | $("#departmentId").val(departData[0].id); |
| | | $("#departmentOrgId").val(departData[0].orgId); |
| | | $("#saleUserId").val(departData[0].saleUserId); |
| | | loadSaleUser(departData[0].saleUserId); |
| | | |
| | | if(hosIdForEdit != ""){ |
| | | $("#serverUserTel").val(departData[0].serverUserTel); |
| | | $("#accountsCount").val(departData[0].accountsCount); |
| | | $('#saleUserName').val(departData[0].saleUserId); |
| | | |
| | | if (hosIdForEdit != "") { |
| | | $("#serverUserTel").val(departData[0] |
| | | .serverUserTel); |
| | | $("#saleUserTel").val(departData[0].saleUserTel); |
| | | } |
| | | form.render(); |
| | | } |
| | | } |
| | | else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 500 |
| | | }); |
| | | } |
| | | }, 'get'); |
| | | form.render(); |
| | | |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 500 |
| | | }); |
| | | } |
| | | }, 'get'); |
| | | } |
| | | } |
| | | //回显组织数据 |
| | | let edithospitalData = admin.getTempData('t_hospital'); |
| | | var hosIdForEdit = ""; |
| | | if (edithospitalData != null) { |
| | | hosIdForEdit = edithospitalData.hospitalId; |
| | | if (!strUtil.isEmpty(hosIdForEdit)){} |
| | | loadDatas(hosIdForEdit); |
| | | |
| | | //装载基本数据 |
| | | if (!strUtil.isEmpty(hosIdForEdit)) { |
| | | loadDatas(hosIdForEdit); |
| | | } |
| | | |
| | | layui.use('form', function () { |
| | | var $ = layui.$ |
| | | , layer = layui.layer |
| | | , form = layui.form |
| | | var $ = layui.$, |
| | | layer = layui.layer, |
| | | form = layui.form |
| | | |
| | | form.verify({ |
| | | integer: [ |
| | | /^[1-9]\d*$/ |
| | | , '只能输入正整数' |
| | | /^[1-9]\d*$/, '只能输入正整数' |
| | | ] |
| | | }); |
| | | }); |
| | | |
| | | form.on("select(serverUserName)", function (data) { |
| | | loadUserMobile('serverUserTel',data.value); |
| | | loadUserMobile('serverUserTel', data.value); |
| | | }); |
| | | |
| | | form.on("select(saleUserName)", function (data) { |
| | | loadUserMobile('saleUserTel',data.value); |
| | | loadUserMobile('saleUserTel', data.value); |
| | | }); |
| | | |
| | | var loadUserMobile = function(id,userId){ |
| | | admin.req('api-user/users/' + userId, { }, function (data) { |
| | | var loadUserMobile = function (id, userId) { |
| | | admin.req('api-user/users/' + userId, {}, function (data) { |
| | | if (data != null) { |
| | | $("#" + id).val(data.mobile); |
| | | }else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 500 |
| | | }); |
| | | } |
| | | }, 'get') |
| | | } |
| | |
| | | var tree = parent.layui.tree; |
| | | var $ = parent.layui.jquery; |
| | | |
| | | permissionsInput(); |
| | | permissionsInput(res,config); |
| | | //组织结构树 |
| | | var getData = function () { |
| | | admin.req('api-user/sysorganization/getTree', { is_del: 0, enabled: 1 }, function (data) { |
| | |
| | | }, |
| | | { align: 'center', width: 100, toolbar: '#product-table-bar', title: '操作' } |
| | | ]], |
| | | done: function () { |
| | | permissionsInput(); |
| | | done: function (res) { |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | } |
| | |
| | | |
| | | }); |
| | | |
| | | permissionsInput(); |
| | | permissionsInput(res,config); |
| | | </script> |
| | |
| | | }, |
| | | { field: 'isShare', fixed: 'right', align: 'center', width: 100, templet: '#product-tpl-isShare', title: '共享' }, |
| | | { field: 'id', fixed: 'right', align: 'center', width: 100, toolbar: '#product-tpl-bar', title: '操作' } |
| | | ]] |
| | | ]], |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | //待充值列表功能操作 |
| | | table.on('tool(product-table-temp)', function (obj) { |
| | |
| | | return false; |
| | | }); |
| | | }); |
| | | permissionsInput(); |
| | | </script> |
| | |
| | | { field: 'enabled', align: 'right', sort: true, templet: '#organization-tpl-state', title: '状态' }, |
| | | { toolbar: '#organization-table-bar', align: 'right', align: 'center', title: '操作' } |
| | | ]], |
| | | done: function () { |
| | | permissionsInput(); |
| | | done: function (res) { |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | }; |
| | |
| | | { field: 'createTime', width: 250, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy-MM-dd HH:mm')}}</div>" }, |
| | | { field: 'id', width: 250, align: 'center', toolbar: '#dictionaries-table-bar', title: '操作' },// 0就诊数据 1筛查 |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | }, |
| | | { field: 'enabled', width: 100, templet: '#product-tpl-state', sort: true, title: '审核' } |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | } |
| | |
| | | { field: 'enabled', width: 100, sort: true, templet: '#menu-tpl-state', title: '状态' }, |
| | | { templet: '#menus-state', width: 120, align: 'center', title: '操作' } |
| | | ]], |
| | | done: function () { |
| | | permissionsInput(); |
| | | done: function (res) { |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | }; |
| | |
| | | { field: 'enabled', width: 100, sort: true, templet: '#role-tpl-state', title: '状态' }, |
| | | { align: 'center', toolbar: '#role-table-bar', title: '操作', width: 320 } |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | { field: 'enabled', width: 100, sort: true, templet: '#area-tpl-state', title: '状态' }, |
| | | { templet: '#area-table-bar', width: 120, align: 'center', title: '操作' } |
| | | ]], |
| | | done: function () { |
| | | done: function (res) { |
| | | layer.closeAll('loading'); |
| | | permissionsInput(); |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | }; |
| | |
| | | {field: 'clientId',width:180, sort: true, title: '所属应用'}, |
| | | {align: 'center',width:100, toolbar: '#tokens-table-bar', title: '操作'} |
| | | ]], |
| | | done:function(){ |
| | | permissionsInput(); |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | elem: '#user-table', |
| | | url: config.base_server + 'api-user/users', |
| | | method: 'GET', |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token}, |
| | | page: true, |
| | | cols: [[ |
| | | { field: 'id', sort: true, width: 200, title: '标识' }, |
| | |
| | | { fixed: 'right', align: 'center', toolbar: '#user-table-bar', title: '操作', width: 300 } |
| | | ]], |
| | | done:function(res){ |
| | | if(res.code==401){ |
| | | config.removeToken(); |
| | | layer.msg('登录过期', {icon: 2, time: 1500}, function () { |
| | | location.replace('/login.html'); |
| | | }, 1000); |
| | | return; |
| | | } |
| | | permissionsInput(); |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.alert("密码重置为:"+data.data, {icon: 1}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } |
| | |
| | | |
| | | // 获取所有角色 |
| | | layer.load(2); |
| | | admin.req('api-user/allRoles', {}, function (data) { |
| | | admin.req('api-user/findByMap', {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 == data.code) { |
| | | // 渲染多选下拉框 |
| | |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <script type="text/javascript" src="../../module/aes.js"></script> |
| | | <script> |
| | | layui.use(['layer','form', 'admin','config'], function () { |
| | | var form = layui.form; |
| | |
| | | form.on('submit(submit-psw)', function (data) { |
| | | |
| | | layer.load(2); |
| | | data.field.oldPassword=getAesString(data.field.oldPassword) |
| | | data.field.newPassword=getAesString(data.field.newPassword) |
| | | data.field.rePassword=getAesString(data.field.rePassword) |
| | | admin.req('api-user/users/password',JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |