Merge branch 'dev' of http://192.168.2.240:7070/r/kidgrow-microservices-platform into dev
9 files added
22 files modified
| | |
| | | package com.kidgrow.filecenter.config; |
| | | |
| | | import com.aliyun.oss.OSSClient; |
| | | import com.aliyun.oss.common.auth.DefaultCredentialProvider; |
| | | import com.kidgrow.common.utils.DateUtil; |
| | | import com.kidgrow.filecenter.model.FileInfo; |
| | | import com.kidgrow.filecenter.properties.FileServerProperties; |
| | | import com.kidgrow.filecenter.service.impl.AbstractIFileService; |
| | |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import com.aliyun.oss.OSSClient; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | |
| | | |
| | | @Override |
| | | protected void uploadFile(MultipartFile file, FileInfo fileInfo) throws Exception { |
| | | ossClient.putObject(fileProperties.getOss().getBucketName(), fileInfo.getName(), file.getInputStream()); |
| | | fileInfo.setUrl(fileProperties.getOss().getDomain() + "/" + fileInfo.getName()); |
| | | String folderByDate =DateUtil.formatDate(new Date()); |
| | | ossClient.putObject(fileProperties.getOss().getBucketName(), fileProperties.getOss().getFolder()+ folderByDate+"/"+fileInfo.getName(), file.getInputStream()); |
| | | fileInfo.setUrl(fileProperties.getOss().getDomain() + fileProperties.getOss().getFolder()+ folderByDate+"/" + fileInfo.getName()); |
| | | } |
| | | |
| | | @Override |
| | | protected boolean deleteFile(FileInfo fileInfo) { |
| | | |
| | | ossClient.deleteObject(fileProperties.getOss().getBucketName(), fileInfo.getName()); |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | FdfsProperties fdfs = new FdfsProperties(); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | * 说明 |
| | | */ |
| | | private String domain; |
| | | |
| | | /** |
| | | * 文件夹 |
| | | */ |
| | | private String folder; |
| | | } |
| | | |
| | |
| | | # web-url: 192.168.28.130 |
| | | # trackerList: ${kidgrow.fdfs.web-url}:22122 |
| | | file-server: |
| | | type: qiniu |
| | | type: aliyun |
| | | fdfs: |
| | | web-url: ${kidgrow.fdfs.web-url} |
| | | #oss配置 |
| | | oss: |
| | | access-key: j977Ii3DODvQXzE241Z6ouW9so4Q6_6PeOPwN5UZ |
| | | accessKeySecret: W8ArRp3mr-w3n4R-lHEvSFzGdgdrYfC9wHkZlqec |
| | | endpoint: http://q68nl7reu.bkt.clouddn.com |
| | | # access-key: j977Ii3DODvQXzE241Z6ouW9so4Q6_6PeOPwN5UZ |
| | | # accessKeySecret: W8ArRp3mr-w3n4R-lHEvSFzGdgdrYfC9wHkZlqec |
| | | # endpoint: http://q68nl7reu.bkt.clouddn.com |
| | | # bucketName: kidgrow |
| | | # domain: kidgrow.s3-cn-east-1.qiniucs.com |
| | | access-key: LTAI4FennfcwZupz3B6hkK3N |
| | | accessKeySecret: NzBBGe8SS41qJlp0nA3tlJ3t74lBZM |
| | | endpoint: oss-accelerate.aliyuncs.com |
| | | bucketName: kidgrow |
| | | domain: kidgrow.s3-cn-east-1.qiniucs.com |
| | | #注意加上/ |
| | | domain: https://kidgrow.oss-accelerate.aliyuncs.com/ |
| | | folder: kidgrow/ |
| | | swagger: |
| | | base-package: com.kidgrow.filecenter.controller |
| | | description: 文件上传服务接口文档 |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Map; |
| | | |
| | | |
| | |
| | | return ResultBody.ok().data(model).msg("查询成功"); |
| | | } |
| | | |
| | | // /** |
| | | // * 新增or更新 |
| | | // */ |
| | | // @ApiOperation(value = "保存") |
| | | // @PostMapping |
| | | // public ResultBody save(@Valid @RequestBody BusinessRecords businessRecords, BindingResult bindingResult) { |
| | | // if (bindingResult.hasErrors()) { |
| | | // return ResultBody.failed().msg(bindingResult.getFieldError().getDefaultMessage()); |
| | | // } else { |
| | | // BusinessRecords model = businessRecordsService.getById(businessRecords.getId()); |
| | | // if (model == null) { |
| | | // boolean v = businessRecordsService.saveOrUpdate(businessRecords); |
| | | // if (v) { |
| | | // return ResultBody.ok().data(businessRecords).msg("保存成功"); |
| | | // } else { |
| | | // return ResultBody.failed().msg("保存失败"); |
| | | // } |
| | | // } else { |
| | | // return ResultBody.failed().msg("业务日志不允许更新!"); |
| | | // } |
| | | // } |
| | | // } |
| | | /** |
| | | * 新增or更新 |
| | | * 新增 |
| | | */ |
| | | @ApiOperation(value = "保存") |
| | | @PostMapping |
| | | public ResultBody save(@Valid @RequestBody BusinessRecords businessRecords, BindingResult bindingResult) { |
| | | if (bindingResult.hasErrors()) { |
| | | return ResultBody.failed().msg(bindingResult.getFieldError().getDefaultMessage()); |
| | | public ResultBody save(String recordTitle,String recordNote) { |
| | | if (recordTitle.isEmpty()||recordNote.isEmpty()) { |
| | | return ResultBody.failed().msg("业务日志参数有误!"); |
| | | } else { |
| | | BusinessRecords model = businessRecordsService.getById(businessRecords.getId()); |
| | | if (model == null) { |
| | | boolean v = businessRecordsService.saveOrUpdate(businessRecords); |
| | | boolean v = businessRecordsService.recordBusinessData(recordTitle,recordNote); |
| | | if (v) { |
| | | return ResultBody.ok().data(businessRecords).msg("保存成功"); |
| | | return ResultBody.ok().msg("保存成功"); |
| | | } else { |
| | | return ResultBody.failed().msg("保存失败"); |
| | | } |
| | | } else { |
| | | return ResultBody.failed().msg("业务日志不允许更新!"); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.kidgrow.usercenter.model; |
| | | |
| | | import com.kidgrow.common.model.SuperModel; |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.kidgrow.common.model.SuperModel; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | import org.hibernate.validator.constraints.*; |
| | | import org.hibernate.validator.constraints.NotEmpty; |
| | | |
| | | import java.util.Date; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | |
| | | /** |
| | | * 组织Id |
| | | */ |
| | | @NotEmpty(message = "组织Id不能为空") |
| | | @NotNull(message = "组织Id不能为空") |
| | | private Long orgId; |
| | | /** |
| | | * 医院Id |
| | | */ |
| | | @NotNull(message = "医院Id不能为空") |
| | | private Long hospitalId; |
| | | /** |
| | | * 负责的销售代表 |
| | | */ |
| | | @NotEmpty(message = "负责的销售代表不能为空") |
| | | @NotNull(message = "负责的销售代表不能为空") |
| | | private Long serverUserId; |
| | | /** |
| | | * 销售代表的名字 |
| | |
| | | * 状态,1启用,0停用 |
| | | */ |
| | | private Boolean enabled; |
| | | /** |
| | | * 是否删除,1删除,0未删除 |
| | | */ |
| | | @TableLogic |
| | | private Boolean isDel; |
| | | } |
| | |
| | | import lombok.NoArgsConstructor; |
| | | import org.hibernate.validator.constraints.NotEmpty; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | |
| | | @NotEmpty(message = "医院名称 同组织名字不能为空") |
| | | private String hospitalName; |
| | | /** |
| | | * 组织ID |
| | | * 组织ID- |
| | | */ |
| | | @NotEmpty(message = "组织ID不能为空") |
| | | @NotNull(message = "组织ID不能为空") |
| | | private Long orgId; |
| | | /** |
| | | * 医院简称 |
| | |
| | | /** |
| | | * 医院类型ID 从字典表关联 社区/儿保等等之类 |
| | | */ |
| | | private Long hospitalTypeId; |
| | | private String hospitalTypeId; |
| | | /** |
| | | * 医院类型 社区/儿保等等之类 |
| | | */ |
| | |
| | | /** |
| | | * 资质ID |
| | | */ |
| | | private Long hospitalQualifiedId; |
| | | private String hospitalQualifiedId; |
| | | /** |
| | | * 资质(三甲医院) |
| | | */ |
| | |
| | | * 医院数据创建时间 |
| | | */ |
| | | private Date createTime; |
| | | /** |
| | | * 状态,1启用,0停用 |
| | | */ |
| | | private Boolean enabled; |
| | | /** |
| | | * 租户字段 |
| | | */ |
| | | private String tenantId; |
| | | /** |
| | | * 是否删除,1删除,0未删除 |
| | | */ |
| | | private Boolean isDel; |
| | | } |
| | |
| | | SysHospital findByObject(SysHospital sysHospital); |
| | | |
| | | ResultBody<SysHospital> findAll(Map<String, Object> params); |
| | | } |
| | | |
| | | /** |
| | | * 状态变更 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | ResultBody updateEnabled(Map<String, Object> params); |
| | | /** |
| | | * 逻辑删除数据 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | ResultBody delete(Map<String, Object> params); |
| | | } |
| | |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.service.impl.SuperServiceImpl; |
| | | import com.kidgrow.usercenter.mapper.SysDepartmentMapper; |
| | | import com.kidgrow.usercenter.mapper.SysHospitalMapper; |
| | | import com.kidgrow.usercenter.model.SysDepartment; |
| | | import com.kidgrow.usercenter.model.SysHospital; |
| | | import com.kidgrow.usercenter.service.ISysHospitalService; |
| | | import com.kidgrow.usercenter.vo.HospitalListVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class SysHospitalServiceImpl extends SuperServiceImpl<SysHospitalMapper, SysHospital> implements ISysHospitalService { |
| | | @Resource |
| | | private SysDepartmentMapper departmentMapper; |
| | | /** |
| | | * 列表 |
| | | * @param params |
| | |
| | | List<SysHospital> sysHospitals = baseMapper.selectByMap(params); |
| | | return ResultBody.ok().data(sysHospitals).msg("查询成功"); |
| | | } |
| | | /** |
| | | * 根据id和启用禁用值更新数据 |
| | | * @param params |
| | | * @return ResultBody |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public ResultBody updateEnabled(Map<String, Object> params) { |
| | | Long id = MapUtils.getLong(params, "id"); |
| | | Long departmentId = MapUtils.getLong(params, "departmentId"); |
| | | Boolean enabled = MapUtils.getBoolean(params, "enabled"); |
| | | //科室数据 |
| | | SysDepartment sysDepartment=departmentMapper.selectById(departmentId); |
| | | //医院数据 |
| | | SysHospital sysHospital = baseMapper.selectById(id); |
| | | //医院下的所有数据 |
| | | Map<String,Object> columnMap=new HashMap<String,Object>(); |
| | | columnMap.put("hospital_id",id); |
| | | columnMap.put("is_del",(boolean)false); |
| | | columnMap.put("enabled",!enabled); |
| | | List<SysDepartment> sysDepartmentList=departmentMapper.selectByMap(columnMap); |
| | | if (sysHospital == null) { |
| | | return ResultBody.failed("医院数据不存在!"); |
| | | } |
| | | if (sysDepartment == null) { |
| | | return ResultBody.failed("科室数据不存在!"); |
| | | } |
| | | //如果这个医院下有多个科室,禁用只对当前科室有效,否则也要禁用医院 |
| | | if(sysDepartmentList.size()==1) |
| | | { |
| | | sysHospital.setEnabled(enabled); |
| | | int i =baseMapper.updateById(sysHospital); |
| | | //Log.info("修改医院状态为:{}",enabled+" "+i); |
| | | } |
| | | sysDepartment.setEnabled(enabled); |
| | | int j=departmentMapper.updateById(sysDepartment); |
| | | return (j > 0) ? ResultBody.ok().data(sysHospital).msg("更新成功") : ResultBody.failed("更新失败"); |
| | | } |
| | | |
| | | /** |
| | | * 删除医院科室信息 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public ResultBody delete(Map<String, Object> params) { |
| | | Long id = MapUtils.getLong(params, "id"); |
| | | Long departmentId = MapUtils.getLong(params, "departmentId"); |
| | | //科室数据 |
| | | SysDepartment sysDepartment=departmentMapper.selectById(departmentId); |
| | | //医院数据 |
| | | SysHospital sysHospital = baseMapper.selectById(id); |
| | | //医院下的所有数据 |
| | | Map<String,Object> columnMap=new HashMap<String,Object>(); |
| | | columnMap.put("hospital_id",id); |
| | | List<SysDepartment> sysDepartmentList=departmentMapper.selectByMap(columnMap); |
| | | if (sysHospital == null) { |
| | | return ResultBody.failed("医院数据不存在!"); |
| | | } |
| | | if (sysDepartment == null) { |
| | | return ResultBody.failed("科室数据不存在!"); |
| | | } |
| | | //如果这个医院下有多个科室,禁用只对当前科室有效,否则也要禁用医院 |
| | | if(sysDepartmentList.size()==1) |
| | | { |
| | | sysHospital.setIsDel(true); |
| | | int i =baseMapper.updateById(sysHospital); |
| | | //Log.info("修改医院状态为:{}",enabled+" "+i); |
| | | } |
| | | sysDepartment.setIsDel(true); |
| | | int j=departmentMapper.updateById(sysDepartment); |
| | | return (j > 0) ? ResultBody.ok().data(sysHospital).msg("删除成功") : ResultBody.failed("删除失败"); |
| | | } |
| | | } |
| | |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.hibernate.validator.constraints.NotBlank; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | |
| | | List<SysUserOrg> sysUserOrgs = iSysUserOrgService.list(queryWrapper); |
| | | List<Long> userIds = sysUserOrgs.stream().map(e -> e.getUserId()).collect(Collectors.toList()); |
| | | QueryWrapper<SysUser> sysUserQueryWrapper=new QueryWrapper(); |
| | | sysUserQueryWrapper.in("id",userIds); |
| | | sysUserQueryWrapper.in("id",userIds.stream().distinct().collect(Collectors.toList())); |
| | | sysUsers= baseMapper.selectList(sysUserQueryWrapper); |
| | | } |
| | | } |
| | |
| | | <if test="p.id != null and p.id !=''"> |
| | | and id = #{p.id} |
| | | </if> |
| | | <if test="p.hospitalId != null and p.hospitalId !=''"> |
| | | and hospital_id = #{p.hospitalId} |
| | | </if> |
| | | <if test="p.departmentName != null and p.departmentName !=''"> |
| | | and department_name = #{p.departmentName} |
| | | </if> |
| | |
| | | DEP.server_user_name, |
| | | DEP.server_user_id, |
| | | DEP.org_id, |
| | | DEP.is_del, |
| | | DEP.enabled, |
| | | HOS.id hospital_id, |
| | | HOS.hospital_name, |
| | | HOS.hospital_code, |
| | |
| | | HOS.hospital_link, |
| | | HOS.is_screen, |
| | | HOS.is_answer, |
| | | HOS.tenant_id, |
| | | HOS.create_time |
| | | FROM |
| | | sys_department DEP |
| | |
| | | package com.kidgrow.usercenter.controller; |
| | | |
| | | import java.util.Map; |
| | | import com.kidgrow.common.controller.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.ObjectError; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.usercenter.model.SysDepartment; |
| | | import com.kidgrow.usercenter.service.ISysDepartmentService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import com.kidgrow.usercenter.model.SysDepartment; |
| | | import com.kidgrow.usercenter.service.ISysDepartmentService; |
| | | import com.kidgrow.common.model.*; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.validation.ObjectError; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | return ResultBody.failed().msg(errMsg.toString()); |
| | | } else { |
| | | //先检查该医院下的该科室名是否已经存在? |
| | | SysDepartment sysDepartmentTemp=new SysDepartment(); |
| | | sysDepartmentTemp.setHospitalId(sysDepartment.getHospitalId()); |
| | | sysDepartmentTemp.setDepartmentName(sysDepartment.getDepartmentName().trim()); |
| | | sysDepartmentTemp=sysDepartmentService.findByObject(sysDepartmentTemp); |
| | | if (sysDepartmentTemp!=null) { |
| | | return ResultBody.failed().msg(String.format("该医院下已经存在 %s",sysDepartment.getDepartmentName())); |
| | | } |
| | | boolean v= sysDepartmentService.saveOrUpdate(sysDepartment); |
| | | if(v) { |
| | | return ResultBody.ok().data(sysDepartment).msg("保存成功"); |
| | |
| | | * 删除 |
| | | */ |
| | | @ApiOperation(value = "删除") |
| | | @DeleteMapping("/{id}") |
| | | public ResultBody delete(@PathVariable Long id) { |
| | | boolean v= sysHospitalService.removeById(id); |
| | | if(v) { |
| | | return ResultBody.ok().msg("删除成功"); |
| | | @GetMapping("/delete") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "departmentId", value = "departmentId", required = true, dataType = "Integer") |
| | | }) |
| | | public ResultBody delete(@RequestParam Map<String, Object> params) { |
| | | if (params.size()==0) |
| | | { |
| | | return ResultBody.failed().msg("参数异常!"); |
| | | } |
| | | else { |
| | | return ResultBody.failed().msg("删除失败"); |
| | | return sysHospitalService.delete(params); |
| | | } |
| | | /** |
| | | * 修改状态 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "修改反馈数据状态") |
| | | @GetMapping("/updateEnabled") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "departmentId", value = "departmentId", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "enabled", value = "是否启用", required = true, dataType = "Boolean") |
| | | }) |
| | | public ResultBody updateEnabled(@RequestParam Map<String, Object> params) { |
| | | if (params.size()==0) |
| | | { |
| | | return ResultBody.failed().msg("参数异常!"); |
| | | } |
| | | return sysHospitalService.updateEnabled(params); |
| | | } |
| | | } |
| | |
| | | package com.kidgrow.usercenter.controller; |
| | | |
| | | import java.util.Map; |
| | | import com.kidgrow.common.controller.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.model.SysOrganization; |
| | | import com.kidgrow.usercenter.service.ISysOrganizationService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import com.kidgrow.usercenter.service.ISysOrganizationService; |
| | | import com.kidgrow.common.model.*; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.validation.ObjectError; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | return ResultBody.ok().data(sysOrganizationService.findList(params)); |
| | | } |
| | | /** |
| | | * 列表 |
| | | */ |
| | | @ApiOperation(value = "模糊查询列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping("/listByName") |
| | | public ResultBody listByName(@RequestParam Map<String, Object> params) { |
| | | if(params.size()==0){ |
| | | params.put("page",1); |
| | | params.put("limit",10); |
| | | } |
| | | return ResultBody.ok().data(sysOrganizationService.findList(params).getData()); |
| | | } |
| | | @ApiOperation(value = "查询列表by MAP") |
| | | @GetMapping("getListByMap") |
| | | public ResultBody getListByMap(@RequestParam Map<String, Object> params) { |
New file |
| | |
| | | package com.kidgrow.common.constant; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: 分类字典key值对定值 自行确保表内唯一<br> |
| | | * @Project: <br> |
| | | * @CreateDate: Created in 2020/4/15 16:16 <br> |
| | | * @Author: <a href="411269194@kidgrow.com">hrj</a> |
| | | */ |
| | | public interface DictionariesConstants { |
| | | /** |
| | | * 医院分类 |
| | | */ |
| | | String HOSPITAL_TYPE = "HOSPITAL_TYPE"; |
| | | /** |
| | | * 医院资质 |
| | | */ |
| | | String HOSPITAL_QUALIFIED = "HOSPITAL_QUALIFIED"; |
| | | /** |
| | | * 医生职称 |
| | | */ |
| | | String DOCTOR_RANK = "DOCTOR_RANK"; |
| | | } |
New file |
| | |
| | | package com.kidgrow.order.controller; |
| | | |
| | | import com.kidgrow.common.constant.SecurityConstants; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: <br> |
| | | * @Project: <br> |
| | | * @CreateDate: Created in 2020/4/14 16:21 <br> |
| | | * @Author: <a href="4345453@kidgrow.com">liuke</a> |
| | | */ |
| | | @Component |
| | | public class BaseController { |
| | | |
| | | @Autowired |
| | | private HttpServletRequest request; |
| | | |
| | | private String userID; |
| | | |
| | | |
| | | public String getUserID(){ |
| | | userID=request.getHeader(SecurityConstants.USER_ID_HEADER); |
| | | return userID; |
| | | } |
| | | } |
| | |
| | | @RestController |
| | | @Slf4j |
| | | @RequestMapping("order") |
| | | public class OrderInfoController { |
| | | public class OrderInfoController extends BaseController{ |
| | | |
| | | @Autowired |
| | | private OrderInfoMapper orderInfoMapper; |
| | |
| | | |
| | | log.info("用户ID:"+request.getHeader(SecurityConstants.USER_ID_HEADER)); |
| | | |
| | | log.info("用户ID:"+ getUserID()); |
| | | |
| | | log.info("ClientID:"+request.getHeader(SecurityConstants.CLIENT_HEADER)); |
| | | |
| | | log.info("TenantID:"+request.getHeader(SecurityConstants.TENANT_HEADER)); |
| | |
| | | formSelects: 'formSelects/formSelects-v4', |
| | | treetable: 'treetable-lay/treetable', |
| | | treetable2: 'treetable2/TreeTable', |
| | | autocomplete: 'complete/autocomplete', |
| | | step: 'step-lay/step' |
| | | }).use(['layer','config', 'index', 'element'], function () { |
| | | var $ = layui.jquery; |
| | |
| | | var layer = layui.layer; |
| | | var admin = layui.admin; |
| | | var area = { |
| | | //4个参数依次是 下拉控件的id,/区域级别(1.2.3)/上级id/选中id |
| | | //4个参数依次是 下拉控件的id,/区域级别(1.2.3)/上级id/选中值 例如河北省 |
| | | areaData: function (domId, levelType, parentId, selectValue) { |
| | | if (levelType == 1) { |
| | | parentId = 100000; |
New file |
| | |
| | | .layui-form-autocomplete {position: relative;} |
| | | .layui-form-autocomplete dl {display: none; position: absolute; left: 0; top: 0; padding: 5px 0; z-index: 999; min-width: 100%; border: 1px solid #d2d2d2; max-height: 300px; overflow-y: auto; background-color: #fff; border-radius: 2px; box-shadow: 0 2px 4px rgba(0,0,0,.12); box-sizing: border-box;} |
| | | .layui-form-autocomplete dl dd, .layui-form-autocomplete dl dt {padding: 0 10px; line-height: 36px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;} |
| | | .layui-form-autocomplete dl dt {font-size: 12px; color: #999;} |
| | | .layui-form-autocomplete dl dd {cursor: pointer;} |
| | | .layui-form-autocomplete dl dd:hover {background-color: #f2f2f2;} |
| | | .layui-form-autocomplete .layui-autocomplete-group dd {padding-left: 20px;} |
| | | .layui-form-autocomplete dl dd.layui-autocomplete-tips {padding-left: 10px!important; color: #999;} |
| | | .layui-form-autocomplete dl dd.layui-this {background-color: #5FB878; color: #fff;} |
| | | .layui-form-autocomplete-focus dl {display: block;} |
New file |
| | |
| | | if (!Object.keys) { |
| | | Object.keys = (function () { |
| | | var hasOwnProperty = Object.prototype.hasOwnProperty, |
| | | hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'), |
| | | dontEnums = [ |
| | | 'toString', |
| | | 'toLocaleString', |
| | | 'valueOf', |
| | | 'hasOwnProperty', |
| | | 'isPrototypeOf', |
| | | 'propertyIsEnumerable', |
| | | 'constructor' |
| | | ], |
| | | dontEnumsLength = dontEnums.length; |
| | | |
| | | return function (obj) { |
| | | if (typeof obj !== 'object' && typeof obj !== 'function' || obj === null) throw new TypeError('Object.keys called on non-object'); |
| | | |
| | | var result = []; |
| | | |
| | | for (var prop in obj) { |
| | | if (hasOwnProperty.call(obj, prop)) result.push(prop); |
| | | } |
| | | |
| | | if (hasDontEnumBug) { |
| | | for (var i = 0; i < dontEnumsLength; i++) { |
| | | if (hasOwnProperty.call(obj, dontEnums[i])) result.push(dontEnums[i]); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | })() |
| | | } |
| | | |
| | | layui.link('/module/complete/autocomplete.css'); |
| | | layui.define(['jquery', 'laytpl', 'layer','config'], function (e) { |
| | | "use strict"; |
| | | var hint = layui.hint(), |
| | | $ = layui.jquery, |
| | | laytpl = layui.laytpl, |
| | | layer = layui.layer, |
| | | module = 'autocomplete', |
| | | filter = 'layui-autocomplete', |
| | | container = 'layui-form-autocomplete', |
| | | container_focus = 'layui-form-autocomplete-focus', |
| | | sysconfig=layui.config, |
| | | system = { |
| | | config: { |
| | | template: ['<div class="layui-form-autocomplete">', '<dl class="layui-anim layui-anim-upbit">', '</dl>', '</div>'].join(''), |
| | | layout: ['<dd data-index="{{d.index}}">{{d.text}}</dd>'].join(''), |
| | | template_txt: '{{d.text}}', |
| | | template_val: '{{d.value}}', |
| | | cache: false, |
| | | keywordsName:'' |
| | | }, |
| | | data: {} |
| | | }, |
| | | callback = function () { |
| | | var _self = this, |
| | | _config = _self.config; |
| | | return { |
| | | call: function (handle, params) { |
| | | if (!_self.handles[handle]) return hint.error(handle + " handle is not defined"); |
| | | _self.handles[handle].call(_self, params) |
| | | } |
| | | } |
| | | }, |
| | | job = function (e) { |
| | | var _self = this; |
| | | _self.config = $.extend({}, _self.config, system.config, e); |
| | | _self.render(); |
| | | }; |
| | | job.prototype.config = { |
| | | response: { |
| | | code: 'code', |
| | | data: 'data', |
| | | msg: 'msg' |
| | | }, |
| | | request: { |
| | | keywords: system.config.keywordsName |
| | | }, |
| | | statusCode: 0, |
| | | time_limit: 300, |
| | | pullTimer: null, |
| | | data: {}, |
| | | temp_data: {}, |
| | | params: {}, |
| | | filter: '', |
| | | method: 'get', |
| | | ajaxParams: {} |
| | | } |
| | | job.prototype.render = function () { |
| | | var _self = this, _config = _self.config; |
| | | _config.request.keywords=_config.keywordsName; |
| | | if (_config.elem = $(_config.elem), _config.where = _config.where || {}, !_config.elem[0]) return _self; |
| | | var _elem = _config.elem, |
| | | _container = _elem.next('.' + container), |
| | | _html = _self.elem = $(laytpl(_config.template).render({})); |
| | | _config.id = _self.id, _container && _container.remove(), _elem.attr('autocomplete', 'off'), _elem.after(_html); |
| | | _self.events() |
| | | } |
| | | job.prototype.pullData = function () { |
| | | var _self = this, |
| | | _config = _self.config, |
| | | _elem = _config.elem, |
| | | _container = _elem.next('.' + container); |
| | | if (!_config.filter) return _self.renderData([]); |
| | | if ((_config.cache || !_config.url) && _config.data instanceof Object && Object.keys(_config.data).length > 0) return _self.renderData(_config.data); |
| | | var keywords = _config.request.keywords |
| | | var params = { |
| | | //t: new Date().getTime() |
| | | } |
| | | params[keywords] = _config.filter.replace("'",""); |
| | | |
| | | var $loading = $('<i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop"></i>'); |
| | | $.ajax($.extend({ |
| | | type: _config.method, |
| | | url: _config.url, |
| | | data: $.extend(params, _config.params instanceof Function ? _config.params() :_config.params), |
| | | contentType: 'text/json,charset=utf-8', |
| | | dataType: "json", |
| | | beforeSend: function (xhr) { |
| | | xhr.setRequestHeader("Authorization", "Bearer " + sysconfig.getToken().access_token); |
| | | xhr.setRequestHeader("Content-Type", "application/json"); |
| | | $loading.attr('style', [ |
| | | 'position:absolute', |
| | | 'left:' + (_elem.offset().left + _elem.outerWidth() - 20) + 'px', |
| | | 'top:' + _elem.offset().top + 'px', |
| | | 'height:' + _elem.height() + 'px', |
| | | 'line-height:' + _elem.height() + 'px' |
| | | ].join(';')); |
| | | $loading.appendTo('body'); |
| | | }, |
| | | success: function (resp) { |
| | | $loading.remove(); |
| | | return _config.statusCode != resp[_config.response.code] ? layer.msg(resp[_config.response.msg]) : _config.data = resp[_config.response.data], _self.renderData(_config.data) |
| | | }, |
| | | error: function () { |
| | | hint.error("请求失败") |
| | | } |
| | | }, _config.ajaxParams)) |
| | | } |
| | | job.prototype.renderData = function (resp) { |
| | | var _self = this, |
| | | _config = _self.config, |
| | | _elem = _config.elem, |
| | | _container = _elem.next('.' + container), |
| | | _dom = _container.find('dl'), |
| | | _list = []; |
| | | _config.temp_data = []; |
| | | layui.each(resp, function (i, e) { |
| | | if (_config.cache) { |
| | | if (e instanceof Object) { |
| | | layui.each(e, function (_i, _e) { |
| | | if (_e && _e.toString().toLowerCase().indexOf(_config.filter.toLowerCase()) > -1) { |
| | | _config.temp_data.push(e), _list.push(laytpl(_config.layout).render({ index: i, text: laytpl(_config.template_txt).render(e) })); |
| | | return true; |
| | | } |
| | | }); |
| | | } else { |
| | | if (e && e.toString().toLowerCase().indexOf(_config.filter.toLowerCase()) > -1) { |
| | | _config.temp_data.push(e), _list.push(laytpl(_config.layout).render({ index: i, text: laytpl(_config.template_txt).render(e) })); |
| | | } |
| | | } |
| | | } else { |
| | | _config.temp_data.push(e), _list.push(laytpl(_config.layout).render({ index: i, text: laytpl(_config.template_txt).render(e) })); |
| | | } |
| | | }); |
| | | _dom.html(_list.join('')), _list.length > 0 ? _container.addClass(container_focus) : _container.removeClass(container_focus) |
| | | } |
| | | job.prototype.handles = { |
| | | addData: function (data) { |
| | | var _self = this, |
| | | _config = _self.config; |
| | | if (data instanceof Array) { |
| | | _config.data = _config.data.concat(data) |
| | | } else { |
| | | _config.data.push(data) |
| | | } |
| | | }, |
| | | setData: function (data) { |
| | | var _self = this, |
| | | _config = _self.config; |
| | | _config.data = data; |
| | | } |
| | | } |
| | | job.prototype.events = function () { |
| | | var _self = this, |
| | | _config = _self.config, |
| | | _elem = _config.elem, |
| | | _container = _elem.next('.' + container), |
| | | _dom = _container.find('dl'); |
| | | _elem.unbind('focus').unbind('input propertychange').on('focus', function () { |
| | | _config.filter = this.value, _self.renderData(_config.data) |
| | | }).on('input propertychange', function (e) { |
| | | var _value = this.value; |
| | | clearTimeout(_config.pullTimer), _config.pullTimer = setTimeout(function () { |
| | | _config.filter = _value, _self.pullData() |
| | | }, _config.time_limit) |
| | | }) |
| | | $(document).on('click', function (e) { |
| | | var _target = e.target, _item = _dom.find(_target), _e = _item.length > 0 ? _item.closest('dd') : undefined; |
| | | if (_target === _elem[0]) return false; |
| | | if (_e !== undefined) { |
| | | if (_e.attr('autocomplete-load') !== undefined) return false; |
| | | var curr_data = _config.temp_data[_e.index()] |
| | | _elem.val(laytpl(_config.template_val).render(curr_data)), _config.onselect == undefined || _config.onselect(curr_data) |
| | | } |
| | | _container.removeClass(container_focus); |
| | | }) |
| | | } |
| | | system.init = function (e, c) { |
| | | var c = c || {}, _self = this, _elems = $(e ? 'input[lay-filter="' + e + '"]' : 'input[' + filter + ']'); |
| | | _elems.each(function (_i, _e) { |
| | | var _elem = $(_e), |
| | | _lay_data = _elem.attr('lay-data'); |
| | | try { |
| | | _lay_data = new Function("return " + _lay_data)() |
| | | } catch (ex) { |
| | | return hint.error("autocomplete元素属性lay-data配置项存在语法错误:" + _lay_data) |
| | | } |
| | | var _config = $.extend({ elem: this }, system.config, c, _lay_data); |
| | | _config.url == undefined && (_config.data == undefined || _config.length === 0) && hint.error("autocomplete配置有误,缺少获取数据方式"); |
| | | system.render(_config); |
| | | }) |
| | | } |
| | | system.render = function (e) { |
| | | var j = new job(e); |
| | | return callback.call(j) |
| | | } |
| | | system.init(), e(module, system); |
| | | }) |
New file |
| | |
| | | /** |
| | | * 根据字典分类加载字典列表,并装载到指定下拉列表 |
| | | * |
| | | */ |
| | | layui.define([ |
| | | 'form', |
| | | 'config', |
| | | 'admin', |
| | | 'layer' |
| | | ], function (exports) { |
| | | //var config = layui.config; |
| | | var form = layui.form; |
| | | var layer = layui.layer; |
| | | var admin = layui.admin; |
| | | var dic={ |
| | | //下拉列表id/分类key/选中id |
| | | dicData:function(domId,dicClass,selectValue){ |
| | | admin.req('api-user/sysdictionaries/findAll', JSON.stringify({dictionariesClassId: dicClass}), function (data) { |
| | | if (0 === data.code) { |
| | | $(domId).empty(); |
| | | let selected = ""; |
| | | clientsAll = data.data; |
| | | if (clientsAll.length > 0) { |
| | | $(domId).append("<option value='' selected='selected'>请选择</option>"); |
| | | $.each(clientsAll, function (index, item) { |
| | | if (selectValue == item.dictionariesKey) { selected = "selected='selected'"; } |
| | | else { |
| | | selected = ""; |
| | | } |
| | | //往下拉菜单里添加元素 |
| | | $(domId).append("<option value='" + item.dictionariesKey + "' " + selected + ">" + item.dictionariesName + "</option> "); |
| | | }) |
| | | } |
| | | //必须加这个刷新form! |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | } |
| | | }, 'POST'); |
| | | } |
| | | } |
| | | |
| | | exports('dic', dic); |
| | | }); |
New file |
| | |
| | | <form id="department-form" lay-filter="department-form" class="layui-form model-form" method="POST"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label">医院名称</label> |
| | | <div class="layui-input-block"> |
| | | <input id="hospitalName" name="hospitalName" type="text" class="layui-input" maxlength="50" |
| | | lay-verify="required" required style="width: 200px;" value="" readonly /> |
| | |  </div> |
| | | </div> |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label">科室名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="departmentName" id="departmentName" placeholder="科室名称" type="text" class="layui-input" |
| | | maxlength="50" lay-verify="required" required style="width: 150px;" /> |
| | |  </div> |
| | | </div> |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label">服务人员</label> |
| | | <div class="layui-input-block"> |
| | | <input name="serverUserId" id="serverUserId" type="hidden" value="" /> |
| | | <select name="serverUserName" id="serverUserName" lay-filter="serverUserName" style="width: 150px;"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">科室简介</label> |
| | | <div class="layui-input-block"> |
| | | <textarea name="departmentAbout" class="layui-textarea" maxlength="500"></textarea> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item model-form-footer"> |
| | | <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button> |
| | | <button class="layui-btn" lay-filter="department-form-submit" lay-submit>保存</button> |
| | | </div> |
| | | <input type="hidden" id="orgId" name="orgId" value="" /> |
| | | <input type="hidden" id="hospitalId" name="hospitalId" value="" /> |
| | | </form> |
| | | |
| | | <script> |
| | | parent.layui.use(['form', 'table', 'util', 'config', 'admin', 'formSelects'], function () { |
| | | var form = parent.layui.form; |
| | | var table = parent.layui.table; |
| | | var config = parent.layui.config; |
| | | var layer = parent.layui.layer; |
| | | var util = parent.layui.util; |
| | | var admin = parent.layui.admin; |
| | | var formSelects = parent.layui.formSelects; |
| | | var $ = parent.layui.jquery; |
| | | debugger |
| | | // 回显组织数据 |
| | | let hospitals = admin.getTempData('t_hospital'); |
| | | if (hospitals != null) { |
| | | $('input[name="hospitalName"]').val(hospitals.hospitalName); |
| | | $('input[name="orgId"]').val(hospitals.orgId); |
| | | if (!strUtil.isEmpty(hospitals.id)) { |
| | | $('input[name="hospitalId"]').val(hospitals.id); |
| | | } |
| | | else { |
| | | $('input[name="hospitalId"]').val(hospitals.hospitalId); |
| | | } |
| | | } |
| | | //加载当前所在部门的在职员工 |
| | | admin.req('api-user/users/getThisUserOrganizationUser', {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | if (data.data.length > 0) { |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | console.log(item.nickname) |
| | | $('#serverUserName').append(new Option(item.nickname, item.id, false, false)); |
| | | }) |
| | | $('#serverUserName').val(config.getUser().id); |
| | | $('#serverUserId').val(config.getUser().id); |
| | | } |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } |
| | | }, 'get'); |
| | | // 表单提交事件 |
| | | form.on('submit(department-form-submit)', function (data) { |
| | | layer.load(2); |
| | | if (data.field != null) { |
| | | data.field.serverUserId = data.field.serverUserName; |
| | | data.field.serverUserName = $("#serverUserName option:selected").text(); |
| | | admin.req('api-user/sysdepartment', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 1000 }, function () { |
| | | admin.finishPopupCenter(); |
| | | }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | } |
| | | }, "POST"); |
| | | } |
| | | else { |
| | | layer.msg("数据异常!", { icon: 2, time: 1000 }); |
| | | } |
| | | return false; |
| | | }); |
| | | form.render(); |
| | | }); |
| | | </script> |
| | |
| | | </select> |
| | |   |
| | | <input id="hospitalName" class="layui-input search-input" type="text" placeholder="按医院名" />  |
| | | <button id="hospita-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button> |
| | | <button id="hospita-btn-search" class="layui-btn icon-btn"><i |
| | | class="layui-icon"></i>搜索</button>  |
| | | <button id="hospital-btn-add" class="layui-btn icon-btn"><i class="layui-icon"></i>添加医院</button> |
| | | </div> |
| | | |
| | | <!-- 数据表格 --> |
| | |
| | | |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="businessRecords-table-bar"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看详情</a> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-xs" lay-event="pay">充值</a> |
| | | <a class="layui-btn layui-btn-xs" lay-event="del">删除</a> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看详情</a> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="addDepartment">添加科室</a> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a> |
| | | </script> |
| | | <!-- 表格状态列 --> |
| | | <script type="text/html" id="hospital-tpl-state"> |
| | | <input type="checkbox" lay-filter="hospital-tpl-state" value="{{d.hospitalId}}" value2="{{d.departmentId}}" lay-skin="switch" lay-text="启用|禁用" |
| | | {{d.enabled==true?'checked':''}}/> |
| | | </script> |
| | | <script> |
| | | layui.use(['form', 'table', 'laydate', 'util', 'config', 'admin', 'area'], function () { |
| | |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | page: true, |
| | | cols: [[ |
| | | { field: 'hospitalName', width: 250, title: '医院名称' }, |
| | | { field: 'departmentName', width: 100, title: '科室' }, |
| | | { field: 'hospitalName', width: 250, title: '医院名称',fixed:'left'}, |
| | | { field: 'departmentName', width: 100, title: '科室' ,fixed:'left'}, |
| | | { |
| | | field: 'hospitalArea', width: 200, title: '所在地区', templet: function (d) { |
| | | field: 'hospitalArea', width: 250, title: '所在地区', templet: function (d) { |
| | | return ((d.hospitalProvince==null)?"":d.hospitalProvince) + " " |
| | | + ((d.hospitalCity==null)?"":d.hospitalCity) + " " + |
| | | ((d.hospitalArea==null)?"":d.hospitalArea) |
| | | } |
| | | }, |
| | | { field: 'hospitalLink', width: 100, title: '联系人' }, |
| | | { field: 'hospitalTel', width: 150, title: '联系方式' }, |
| | | { field: 'hospitalTel', width: 100, title: '联系方式' }, |
| | | { |
| | | field: 'enabled', width: 100, sort: true, title: '状态', templet: function (d) { |
| | | field: 'enabled', width: 80, sort: true, title: '状态', templet: function (d) { |
| | | return d.hospitalState == 0 ? "试用" : "正式" |
| | | } |
| | | }, |
| | | { |
| | | field: 'isScreen', width: 100, sort: true, title: '筛查', templet: function (d) { |
| | | field: 'isScreen', width: 80, sort: true, title: '筛查', templet: function (d) { |
| | | return d.isScreen ? "是" : "否" |
| | | } |
| | | }, |
| | | // { field: 'isAnswer', width: 100, sort: true, title: '医答',templet:function (d) { |
| | | // { field: 'isAnswer', width: 80, sort: true, title: '医答',templet:function (d) { |
| | | // return d.isScreen?"是":"否" |
| | | // } }, |
| | | |
| | | { field: 'serverUserName', width: 150, title: '服务人员' }, |
| | | { field: 'createTime', width: 150, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd')}}</div>" }, |
| | | { field: 'hospitalId', width: 250, align: 'center', toolbar: '#businessRecords-table-bar', sort: true, title: '操作' } |
| | | ]], |
| | | done: function () { |
| | | } |
| | | { field: 'serverUserName', width: 100, title: '服务人员' }, |
| | | { field: 'createTime', width: 120, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd')}}</div>" }, |
| | | { field: 'enabled', width: 100, templet: '#hospital-tpl-state', sort: true, title: '状态' }, |
| | | { field: 'hospitalId', width: 300, align: 'center', toolbar: '#businessRecords-table-bar', title: '操作' ,fixed:'right'} |
| | | ]] |
| | | }); |
| | | //省份数据加载 |
| | | area.areaData("#province", 1, "", ""); |
| | |
| | | table.on('tool(hospital-table)', function (obj) { |
| | | var data = obj.data; |
| | | var layEvent = obj.event; |
| | | if (layEvent === 'detail') { // 查看详情 |
| | | showEditModel(data); |
| | | if (layEvent === 'del') { |
| | | layer.confirm('确定要删除吗?', function (i) { |
| | | layer.load(2); |
| | | var whereModel = { |
| | | id: obj.data.hospitalId, |
| | | departmentId: obj.data.departmentId |
| | | }; |
| | | admin.req('api-user/syshospital/delete', whereModel, function (data) { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, { icon: 1, time: 500 }, function () { |
| | | $('#hospita-btn-search').click(); |
| | | }); |
| | | obj.del(); |
| | | }, 'GET'); |
| | | }); |
| | | } |
| | | else if (layEvent === 'addDepartment') { |
| | | //添加科室 |
| | | admin.putTempData("t_hospital", data); |
| | | admin.popupCenter({ |
| | | title: '添加科室', |
| | | path: 'pages/opration/department_form.html', |
| | | area: ['900px', '60%'], |
| | | finish: function () { |
| | | //清理缓存数据 |
| | | admin.putTempData("t_hospital", ""); |
| | | } |
| | | }) |
| | | } |
| | | else if (layEvent === "edit") { |
| | | //修改 |
| | | admin.putTempData("t_hospital", data); |
| | | showEditModel(); |
| | | } |
| | | }); |
| | | // 搜索按钮点击事件 |
| | |
| | | |
| | | // // 显示编辑弹窗 |
| | | var showEditModel = function (data) { |
| | | admin.popupCenter({ |
| | | title: '编辑医院/科室', |
| | | path: 'pages/opration/hospital_form_tab.html', |
| | | area: ['900px', '80%'], |
| | | finish: function () { |
| | | |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | //装载市区数据 |
| | | form.on("select(province)", function (data) { |
| | | $("#city").empty(); |
| | | $("#areas").empty(); |
| | | area.areasClear("#areas", 3); |
| | | area.areaData("#city", 2, data.value, ""); |
| | | }); |
| | | |
| | | //装载区县数据 |
| | | form.on("select(city)", function (data) { |
| | | $("#areas").empty(); |
| | | area.areaData("#areas", 3, data.value, ""); |
| | | }); |
| | | // 修改状态 |
| | | form.on('switch(hospital-tpl-state)', function (obj) { |
| | | layer.load(2); |
| | | admin.req('api-user/syshospital/updateEnabled', { |
| | | id: obj.elem.value, |
| | | departmentId: obj.elem.getAttribute("value2"), |
| | | enabled: obj.elem.checked ? true : false |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | } |
| | | }, 'GET'); |
| | | }); |
| | | // 添加按钮点击事件 |
| | | $('#hospital-btn-add').click(function () { |
| | | showEditModel(); |
| | | }); |
| | | }); |
| | | </script> |
New file |
| | |
| | | <form id="hospital-form" lay-filter="hospital-form" class="layui-form model-form" method="POST"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm7"> |
| | | <label class="layui-form-label">医院名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalName" id="hospitalName" placeholder="请输入医院名称" type="text" class="layui-input" |
| | | maxlength="50" lay-verify="required" required autocomplete="on" style="width: 390px;" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">医院简称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalShortName" type="text" class="layui-input" maxlength="50" |
| | | style="width: 200px;" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm7"> |
| | | <label class="layui-form-label">联系电话</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalTel" id="hospitalTel" type="text" class="layui-input" maxlength="50" |
| | | style="width: 390px;" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">联系人</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalLink" type="text" class="layui-input" maxlength="50" style="width: 200px;" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm7"> |
| | | <label class="layui-form-label">医院类型</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalTypeId" id="hospitalTypeId" type="hidden" value=""/> |
| | | <select name="hospitalTypeName" id="hospitalTypeName" lay-filter="hospitalTypeName" |
| | | style="width: 300px;"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">医院资质</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalQualifiedId" id="hospitalQualifiedId" type="hidden" value=""/> |
| | | <select name="hospitalQualifiedName" id="hospitalQualifiedName" lay-filter="hospitalQualifiedName" |
| | | style="width: 300px;"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-row"> |
| | | <label class="layui-form-label">所在地区</label> |
| | | <div class="layui-input-block"> |
| | | <div class="layui-col-sm4"> |
| | | <select id="hospitalProvince" placeholder="省份" lay-filter="hospitalProvince" style="width: 400px;"> |
| | | </select></div> |
| | | <div class="layui-col-sm4"> |
| | | <select id="hospitalCity" placeholder="市" lay-filter="hospitalCity" style="width: 350px;"> |
| | | <option value="">选择市</option> |
| | | </select></div> |
| | | <div class="layui-col-sm4"> |
| | | <select id="hospitalArea" placeholder="区县" lay-filter="hospitalArea" style="width: 350px;"> |
| | | <option value="">选择区县</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">地址</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalAdress" type="text" class="layui-input" maxlength="100" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">区号</label> |
| | | <div class="layui-input-block"> |
| | | <input name="areaCode" type="text" class="layui-input" maxlength="10" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">经度</label> |
| | | <div class="layui-input-block"> |
| | | <input name="longitude" type="text" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">纬度</label> |
| | | <div class="layui-input-block"> |
| | | <input name="latitude" type="text" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医院简介</label> |
| | | <div class="layui-input-block"> |
| | | <textarea name="hospital_about" class="layui-textarea" maxlength="500"></textarea> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item model-form-footer"> |
| | | <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button> |
| | | <button class="layui-btn" lay-filter="hospital-form-submit" lay-submit>保存</button> |
| | | </div> |
| | | <input type="hidden" id="orgId" name="orgId" value=""/> |
| | | </form> |
| | | |
| | | <script> |
| | | parent.layui.use(['form', 'table','util', 'config', 'admin', 'area', 'formSelects', 'dic', 'autocomplete'], function () { |
| | | var form = parent.layui.form; |
| | | var table = parent.layui.table; |
| | | var config = parent.layui.config; |
| | | var layer = parent.layui.layer; |
| | | var util = parent.layui.util; |
| | | var admin = parent.layui.admin; |
| | | var area = parent.layui.area; |
| | | var dic = parent.layui.dic; |
| | | var formSelects = parent.layui.formSelects; |
| | | var autocomplete = parent.layui.autocomplete; |
| | | var $ = parent.layui.jquery; |
| | | |
| | | autocomplete.render({ |
| | | elem: $('#hospitalName'), |
| | | cache: true, |
| | | url: config.base_server + 'api-user/syshospital', |
| | | response: { code: 'code', data: 'data' }, |
| | | template_val: '{{d.hospitalName}}', |
| | | template_txt: '{{d.hospitalName}} <span class=\'layui-badge layui-bg-gray\'>{{d.id}}</span>', |
| | | onselect: function (resp) { |
| | | //$('#content1').html("NEW RENDER: " + JSON.stringify(resp)); |
| | | } |
| | | }) |
| | | //医院资质数据 |
| | | dic.dicData("#hospitalQualifiedName", "HOSPITAL_QUALIFIED", ""); |
| | | //医院类型数据 |
| | | dic.dicData("#hospitalTypeName", "HOSPITAL_TYPE", ""); |
| | | //省份数据加载 |
| | | area.areaData("#hospitalProvince", 1, "", ""); |
| | | //装载市区数据 |
| | | form.on("select(hospitalProvince)", function (data) { |
| | | area.areasClear("#hospitalArea", 3); |
| | | area.areaData("#hospitalCity", 2, data.value, ""); |
| | | }); |
| | | //装载区县数据 |
| | | form.on("select(hospitalCity)", function (data) { |
| | | area.areaData("#hospitalArea", 3, data.value, ""); |
| | | }); |
| | | //赋值资质数据ID |
| | | form.on("select(hospitalQualifiedName)", function (data) { |
| | | $("#hospitalQualifiedId").val(data.value); |
| | | }); |
| | | //赋值医院类型数据ID |
| | | form.on("select(hospitalTypeName)", function (data) { |
| | | $("#hospitalTypeId").val(data.value); |
| | | }); |
| | | |
| | | // 回显组织数据 |
| | | let orgs = admin.getTempData('t_org'); |
| | | if (orgs != null) { |
| | | $('input[name="hospitalName"]').val(orgs.orgName); |
| | | $('input[name="orgId"]').val(orgs.id); |
| | | form.render(); |
| | | } |
| | | // 表单提交事件 |
| | | form.on('submit(hospital-form-submit)', function (data) { |
| | | layer.load(2); |
| | | if(data.field!=null){ |
| | | |
| | | data.field.hospitalTypeName=$("#hospitalTypeName option:selected").text(); |
| | | data.field.hospitalQualifiedName=$("#hospitalQualifiedName option:selected").text(); |
| | | data.field.hospitalProvince=$("#hospitalProvince option:selected").text(); |
| | | data.field.hospitalCity=$("#hospitalCity option:selected").text(); |
| | | data.field.hospitalArea=$("#hospitalArea option:selected").text(); |
| | | |
| | | admin.req('api-user/syshospital', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | //将医院数据存入本地 |
| | | admin.putTempData('t_hospital', data.data); |
| | | layer.msg(data.msg, { icon: 1, time: 1000 }, function () { |
| | | //清理组织数据 |
| | | admin.putTempData('t_org',''); |
| | | }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | } |
| | | }, "POST");} |
| | | else{ |
| | | layer.msg("数据异常!", { icon: 2, time: 1000 }); |
| | | } |
| | | return false; |
| | | }); |
| | | }); |
| | | </script> |
New file |
| | |
| | | <div class="layui-tab"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">组织信息</li> |
| | | <li>基本信息</li> |
| | | </ul> |
| | | <div class="layui-tab-content"> |
| | | <div class="layui-tab-item layui-show"> |
| | | <form id="app-form" lay-filter="app-form" class="layui-form model-form"> |
| | | <input name="id" type="hidden" /> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">上级组织</label> |
| | | <div class="layui-input-block"> |
| | | <input name="orgParentId" id="orgParentId" type="hidden" value="-1"/> |
| | | <input placeholder="输入上级组织名称..." pname="orgParentName" id="orgParentName" type="text" class="layui-input" maxlength="50" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">组织类型</label> |
| | | <div class="layui-input-block"> |
| | | <select id="orgAttr" name="orgAttr" placeholder="选择一个类型"> |
| | | <option value="0" selected='selected'>集团</option> |
| | | <option value="1">公司/医院</option> |
| | | <option value="2">部门/科室</option> |
| | | <option value="3">子部门/子科室</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">组织层级</label> |
| | | <div class="layui-input-block"> |
| | | <select name="orgLevel" id='orgLevel' placeholder="选择一个层级"> |
| | | <option value="0" selected='selected'>1级</option> |
| | | <option value="1">2级</option> |
| | | <option value="2">3级</option> |
| | | <option value="3">4级</option> |
| | | <option value="4">5级</option> |
| | | <option value="5">6级</option> |
| | | <option value="6">7级</option> |
| | | <option value="7">8级</option> |
| | | <option value="8">9级</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">组织名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="orgName" id="orgName" type="text" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item model-form-footer"> |
| | | <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button> |
| | | <button class="layui-btn" id="sure" lay-filter="org-form-submit" lay-submit>保存</button> |
| | | </div> |
| | | <input name="id" id="id" type="hidden" value=""/> |
| | | </form> |
| | | </div> |
| | | <div class="layui-tab-item"> |
| | | </div> |
| | | </div> |
| | | <script> |
| | | layui.use(['form', 'table', 'laydate', 'util','config', 'admin','element','autocomplete'], function () { |
| | | var form = layui.form; |
| | | var table = layui.table; |
| | | var config = layui.config; |
| | | var layer = layui.layer; |
| | | var util = layui.util; |
| | | var admin = layui.admin; |
| | | //树形插件 |
| | | var tree = layui.tree; |
| | | var $ = layui.jquery; |
| | | var element = layui.element; |
| | | var autocomplete=layui.autocomplete; |
| | | //自动完成-上级组织 |
| | | autocomplete.render({ |
| | | elem: $('#orgParentName')[0], |
| | | keywordsName:'orgName',//查询关键字名称 |
| | | url: config.base_server +'api-user/sysorganization/listByName?page=1&limit=9999999', |
| | | template_val: '{{d.orgName}}',//选择后文本框显示的数据字段 |
| | | template_txt: "<div class='layui-table-cell'>{{d.orgName}}</div>",//下拉列表模板 |
| | | onselect: function (resp) { |
| | | $("#orgParentId").val(resp.id); |
| | | $("#orgLevel").val(resp.orgLevel+1); |
| | | $("#orgAttr").val(resp.orgLevel+1); |
| | | form.render(); |
| | | } |
| | | }) |
| | | |
| | | //自动完成-医院名称 |
| | | autocomplete.render({ |
| | | elem: $('#orgName')[0], |
| | | keywordsName:'orgName',//查询关键字名称 |
| | | url: config.base_server +'api-user/sysorganization/listByName?page=1&limit=9999999', |
| | | template_val: '{{d.orgName}}',//选择后文本框显示的数据字段 |
| | | template_txt: "<div class='layui-table-cell'>{{d.orgName}}</div>",//下拉列表模板 |
| | | onselect: function (resp) { |
| | | $("#id").val(resp.id); |
| | | form.render(); |
| | | } |
| | | }) |
| | | |
| | | // 表单提交事件 |
| | | form.on('submit(org-form-submit)', function (data) { |
| | | layer.load(2); |
| | | admin.req('api-user/sysorganization', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | //将组织数据存入本地 |
| | | admin.putTempData('t_org', data.data); |
| | | //组织数据维护成功后,进入医院基本信息页面 |
| | | layer.msg("组织数据编辑成功,继续编辑基本数据...", { icon: 1, time: 1000 },function(){ |
| | | //admin.finishPopupCenter(); |
| | | }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | } |
| | | }, "POST"); |
| | | return false; |
| | | }); |
| | | form.render(); |
| | | getData(); |
| | | }); |
| | | </script> |
New file |
| | |
| | | <form id="app-form" lay-filter="app-form" class="layui-form model-form"> |
| | | <input name="id" type="hidden" /> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">上级组织:</label> |
| | | <div class="layui-input-block"> |
| | | <div id="orgParentId-tree" class="demo-tree demo-tree-box"></div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">上级组织:</label> |
| | | <div class="layui-input-block"> |
| | | <input name="orgParentId" id="orgParentId" type="hidden" value="-1" class="layui-input" maxlength="20" /> |
| | | <input name="orgParentName" id="orgParentName" type="text" class="layui-input" maxlength="50" readonly /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">组织类型:</label> |
| | | <div class="layui-input-block"> |
| | | <select id="orgAttr" name="orgAttr" placeholder="选择一个类型"> |
| | | <option value="">-请选择-</option> |
| | | <option value="0">集团</option> |
| | | <option value="1">公司/医院</option> |
| | | <option value="2">部门/科室</option> |
| | | <option value="3">子部门/子科室</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">组织层级:</label> |
| | | <div class="layui-input-block"> |
| | | <select name="orgLevel" id='orgLevel' placeholder="选择一个层级"> |
| | | <option value="">-请选择-</option> |
| | | <option value="0">1级</option> |
| | | <option value="1">2级</option> |
| | | <option value="2">3级</option> |
| | | <option value="3">4级</option> |
| | | <option value="4">5级</option> |
| | | <option value="5">6级</option> |
| | | <option value="6">7级</option> |
| | | <option value="7">8级</option> |
| | | <option value="8">9级</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医院/科室名称:</label> |
| | | <div class="layui-input-block"> |
| | | <input name="orgName" type="text" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item model-form-footer"> |
| | | <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button> |
| | | <button class="layui-btn" id="sure" lay-filter="org-form-submit" lay-submit>保存</button> |
| | | </div> |
| | | </form> |
| | | <script> |
| | | parent.layui.use(['form', 'table', 'laydate', 'util', 'tree', 'config', 'admin'], function () { |
| | | var form = parent.layui.form; |
| | | var table = parent.layui.table; |
| | | var config = parent.layui.config; |
| | | var layer = parent.layui.layer; |
| | | var util = parent.layui.util; |
| | | var admin = parent.layui.admin; |
| | | //树形插件 |
| | | var tree = parent.layui.tree; |
| | | var $ = parent.layui.jquery; |
| | | |
| | | //组织结构树 |
| | | var getData = function () { |
| | | admin.req('api-user/sysorganization/getTree', { is_del: 0, enabled: 1 }, function (data) { |
| | | if (0 === data.code) { |
| | | tree({ |
| | | elem: "#orgParentId-tree", |
| | | nodes: data.data, |
| | | click: function (node) { |
| | | //将数据赋值 |
| | | $("#orgParentId").val(node.id); |
| | | $("#orgParentName").val(node.name); |
| | | $("#orgAttr").val(node.level + 1); |
| | | $("#orgLevel").val(node.level + 1); |
| | | //刷新form表单 |
| | | form.render('select'); |
| | | } |
| | | }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | } |
| | | }, 'get'); |
| | | } |
| | | |
| | | // 表单提交事件 |
| | | form.on('submit(org-form-submit)', function (data) { |
| | | layer.load(2); |
| | | admin.req('api-user/sysorganization', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | //将组织数据存入本地 |
| | | admin.putTempData('t_org', data.data); |
| | | //组织数据维护成功后,进入医院基本信息页面 |
| | | layer.msg("组织数据编辑成功,继续编辑基本数据...", { icon: 1, time: 1000 },function(){ |
| | | //admin.finishPopupCenter(); |
| | | }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | } |
| | | }, "POST"); |
| | | return false; |
| | | }); |
| | | form.render(); |
| | | getData(); |
| | | }); |
| | | </script> |
| | |
| | | </script> |
| | | <!-- 表格状态列 --> |
| | | <script type="text/html" id="product-tpl-state"> |
| | | <input type="checkbox" lay-filter="product-tpl-state" value="{{d.id}}" lay-skin="switch" lay-text="未处理|已处理" |
| | | <input type="checkbox" lay-filter="product-tpl-state" value="{{d.id}}" lay-skin="switch" lay-text="禁用|启用" |
| | | {{d.enabled==true?'checked':''}}/> |
| | | </script> |
| | | |
| | |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | // console.log(JSON.stringify(item)) |
| | | $('#role_clients').append(new Option(item.dictionariesName, item.id, false, selected)); |
| | | $('#role_clients').append(new Option(item.dictionariesName, item.dictionariesKey, false, selected)); |
| | | }) |
| | | form.render(); |
| | | } else { |