| | |
| | | @RequestMapping("/base/appUser/listAll") |
| | | public List<QueryAppUserVO> listAll(@RequestBody QueryAppUser query){ |
| | | List<QueryAppUserVO> queryAppUserVOS = appUserService.listAll(query); |
| | | ArrayList<QueryAppUserVO> res = new ArrayList<>(); |
| | | |
| | | if (query.getUserIds()!=null && query.getUserIds().size()!=0){ |
| | | List<QueryAppUserVO> queryAppUserVOS1 = appUserService.listAll1(query); |
| | | queryAppUserVOS.addAll(queryAppUserVOS1); |
| | | } |
| | | return queryAppUserVOS.stream().distinct().collect(Collectors.toList()); |
| | | List<QueryAppUserVO> collect = queryAppUserVOS.stream().distinct().collect(Collectors.toList()); |
| | | for (QueryAppUserVO vo : collect) { |
| | | // 会员到期时间小于当前时间或者会员到期时间为null 则会员过期 |
| | | if (vo.getVipEndTime()!=null && vo.getVipEndTime().after(new Date())){ |
| | | vo.setIsVip(1); |
| | | }else{ |
| | | vo.setIsVip(0); |
| | | } |
| | | if (query.getIsVip() != null && (!query.getIsVip().equals("")) ){ |
| | | if (vo.getIsVip() == query.getIsVip()){ |
| | | res.add(vo); |
| | | } |
| | | }else{ |
| | | res.add(vo); |
| | | } |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | |
| | | <if test="query.phone!=null and query.phone!= ''"> |
| | | and t1.phone LIKE concat('%',#{query.phone},'%') |
| | | </if> |
| | | <if test="query.isVip!=null and query.isVip!= ''"> |
| | | and t1.isVip = #{query.isVip} |
| | | </if> |
| | | <if test="query.salesmanUser!=null and query.salesmanUser!= ''"> |
| | | and t1.salesmanUserId = #{query.salesmanUser} |
| | | </if> |
| | |
| | | case 1: |
| | | coupon.setIntegral(BigDecimal.valueOf(dataVo.getRequiredPoints())); |
| | | break; |
| | | case 2: |
| | | coupon.setCash(dataVo.getRequiredCash()); |
| | | coupon.setIntegral(BigDecimal.valueOf(dataVo.getRequiredPoints())); |
| | | break; |
| | | |
| | | case 3: |
| | | coupon.setCash(dataVo.getRequiredCash()); |
| | | break; |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.competition.mapper.ParticipantMapper"> |
| | | <select id="getPeopleFromId" resultType="com.dsh.competition.feignclient.model.CompetitionUser"> |
| | | select t2.name,t2.gender sex,t2.phone ,t2.idcard idCard ,t3.payStatus state from t_user_competition t1 left join t_participant t2 on t1.participantId = t2.id left join t_payment_competition t3 on t1.paymentCompetitionId = t3.id |
| | | select t2.id, t2.name,t2.gender sex,t2.phone ,t2.idcard idCard ,t3.payStatus state |
| | | from t_user_competition t1 left join t_participant t2 on t1.participantId = t2.id |
| | | left join t_payment_competition t3 on t1.paymentCompetitionId = t3.id |
| | | where t1.competitionId =#{id} and t2.id is not null and t3.id is not null |
| | | <if test="state !=null and state !='' and state ==1"> |
| | | and t3.payStatus in (1,2) |
| | |
| | | <if test="state !=null and state !='' and state ==3"> |
| | | and t3.payStatus =3 |
| | | </if> |
| | | |
| | | |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | </foreach> |
| | | </if> |
| | | <if test="null != item.name and '' != item.name"> |
| | | and a.name line CONCAT('%', #{item.name}, '%') |
| | | and a.name like CONCAT('%', #{item.name}, '%') |
| | | </if> |
| | | <if test="null != item.status"> |
| | | and a.status = #{item.status} |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.guns.core.dataScope.DataScope; |
| | | import com.dsh.guns.modular.system.model.User; |
| | | import com.dsh.guns.modular.system.model.UserListVO; |
| | | import com.dsh.guns.modular.system.model.UserQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | @Param("deptid") Integer deptid, |
| | | @Param("objectType") Integer objectType, |
| | | @Param("objectId") Integer objectId); |
| | | |
| | | List<UserListVO> searchUsers(@Param("query") UserQuery userQuery); |
| | | |
| | | } |
| | |
| | | if(objectType == 3) {// 门店 |
| | | storeIds.add(objectId); |
| | | } |
| | | Page<Map<String, Object>> mapPage = coursePackageService.queryCoursePackageLists(provinceCode, cityCode, coursePackageTypeId, storeIds, name, status, state); |
| | | Page<Map<String, Object>> mapPage = coursePackageService.queryCoursePackageLists(provinceCode, |
| | | cityCode, coursePackageTypeId, storeIds, name, status, state); |
| | | return super.packForBT(mapPage); |
| | | } |
| | | |
| | |
| | | public String payOfDetails(@PathVariable(value = "id") Integer id,Model model) { |
| | | System.out.println(id); |
| | | model.addAttribute("id",id); |
| | | Coupon coupon = client.queryCouponById(id); |
| | | model.addAttribute("type",coupon.getType()); |
| | | return PREFIX + "TGoods_pay.html"; |
| | | } |
| | | /** |
| | |
| | | String result = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map1); |
| | | System.out.println(result); |
| | | |
| | | |
| | | |
| | | for (String s : tStore.getIds().split(",")) { |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | |
| | | } |
| | | @RequestMapping(value = "/addConfig") |
| | | @ResponseBody |
| | | public Object addConfig(String name,Integer id) { |
| | | public Object addConfig(String name,Integer id,Integer sort) { |
| | | try { |
| | | List<TStoreOtherConfig> list = storeOtherConfigService.list(); |
| | | if(list.size()>0){ |
| | | TStoreOther tStoreOther = new TStoreOther(); |
| | | tStoreOther.setName(name); |
| | | tStoreOther.setStoreId(id); |
| | | tStoreOther.setSort(sort); |
| | | storeOtherService.save(tStoreOther); |
| | | |
| | | // 找出temp表数据 |
| | |
| | | } |
| | | @RequestMapping(value = "/addConfig1") |
| | | @ResponseBody |
| | | public Object addConfig1(String name,Integer id) { |
| | | public Object addConfig1(String name,Integer id,Integer sort) { |
| | | try { |
| | | TStoreOther byId = storeOtherService.getById(id); |
| | | byId.setName( |
| | | name |
| | | ); |
| | | byId.setName(name); |
| | | byId.setSort(sort); |
| | | storeOtherService.updateById(byId); |
| | | |
| | | |
| | |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.mapper.UserMapper; |
| | | import com.dsh.guns.config.UserExt; |
| | |
| | | import com.dsh.guns.core.util.SinataUtil; |
| | | import com.dsh.guns.modular.system.controller.util.MD5; |
| | | import com.dsh.guns.modular.system.factory.UserFactory; |
| | | import com.dsh.guns.modular.system.model.Role; |
| | | import com.dsh.guns.modular.system.model.User; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.IDeptService; |
| | | import com.dsh.guns.modular.system.service.IRoleService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.service.IUserService; |
| | | import com.dsh.guns.modular.system.transfer.UserDto; |
| | | import com.dsh.guns.modular.system.util.OBSUploadUtil; |
| | | import com.dsh.guns.modular.system.util.OssUploadUtil; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 系统管理员控制器 |
| | |
| | | |
| | | @Autowired |
| | | private IRoleService roleService; |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @RequestMapping("/user_add") |
| | | public String addView(Model model) { |
| | | model.addAttribute("role",UserExt.getUser().getObjectType()); |
| | | model.addAttribute("language",UserExt.getLanguage()); |
| | | LambdaQueryWrapper<Role> roleLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(UserExt.getUser().getObjectType()!=1){ |
| | |
| | | roleLambdaQueryWrapper.eq(Role::getObjType,UserExt.getUser().getObjectType()); |
| | | List<Role> list = roleService.list(roleLambdaQueryWrapper); |
| | | model.addAttribute("list",list); |
| | | // 部门列表 |
| | | List<Dept> depts = deptService.list(new QueryWrapper<>()); |
| | | model.addAttribute("depts",depts); |
| | | return PREFIX + "user_add.html"; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 跳转到编辑管理员页面 |
| | | * 跳转到编辑管理员页面 type=1编辑 type=2 查看详情 |
| | | */ |
| | | @Permission |
| | | @RequestMapping("/user_edit/{userId}") |
| | | public String userEdit(@PathVariable Integer userId, Model model) { |
| | | @RequestMapping("/user_edit/{userId}/{type}") |
| | | public String userEdit(@PathVariable Integer userId,@PathVariable Integer type, Model model) { |
| | | model.addAttribute("role",UserExt.getUser().getObjectType()); |
| | | if (Objects.isNull(userId)) { |
| | | throw new GunsException(BizExceptionEnum.REQUEST_NULL); |
| | | } |
| | |
| | | List<Role> list = roleService.list(roleLambdaQueryWrapper); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("language",UserExt.getLanguage()); |
| | | // 部门列表 |
| | | List<Dept> depts = deptService.list(new QueryWrapper<>()); |
| | | model.addAttribute("depts",depts); |
| | | model.addAttribute("type",type); |
| | | return PREFIX + "user_edit.html"; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | /** |
| | | * 查询管理员列表 |
| | | */ |
| | | @RequestMapping("/list") |
| | | @Permission |
| | | @ResponseBody |
| | | public Object list(@RequestParam(required = false) String name, @RequestParam(required = false) String createTime, @RequestParam(required = false) Integer deptid) { |
| | | //创建日期 |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(createTime)){ |
| | | String[] timeArray = createTime.split(" - "); |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | public List<UserListVO> list(String name, String phone, String idCard, Integer isSales, Integer state) { |
| | | UserQuery userQuery = new UserQuery(); |
| | | userQuery.setName(name); |
| | | userQuery.setPhone(phone); |
| | | userQuery.setIdCard(idCard); |
| | | userQuery.setIsSales(isSales); |
| | | userQuery.setStatus(state); |
| | | |
| | | // 根据当前登陆人类型来查询员工列表 |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | switch (objectType){ |
| | | case 1: |
| | | // 平台查询所有 |
| | | List<UserListVO> res= userService.searchUsers(userQuery); |
| | | return res; |
| | | case 2: |
| | | // 运营商查询运营商账号的员工和属于该运营商门店的员工 |
| | | userQuery.setObjectType(2); |
| | | userQuery.setObjectId(objectId); |
| | | // 获取属于这个运营商的门店的店长ids |
| | | List<Integer> storeStaffIds = storeService.list(new QueryWrapper<TStore>().eq("operatorId", objectId) |
| | | .ne("state", 3)).stream().map(TStore::getStoreStaffId).collect(Collectors.toList()); |
| | | userQuery.setStoreIds(storeStaffIds); |
| | | List<UserListVO> res1= userService.searchUsers(userQuery); |
| | | return res1; |
| | | case 3: |
| | | // 门店只查询门店员工 |
| | | TStore store = storeService.getById(objectId); |
| | | List<Integer> storeIds = userQuery.getStoreIds(); |
| | | storeIds.add(store.getStoreStaffId()); |
| | | List<UserListVO> res2= userService.searchUsers(userQuery); |
| | | return res2; |
| | | } |
| | | User user = UserExt.getUser(); |
| | | Role role = roleService.getBaseMapper().selectById(user.getRoleid()); |
| | | if ("administrator".equals(role.getTips())) { |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(userService.getUserListPage(page,null, name, beginTime, endTime, deptid)); |
| | | return super.packForBT(page); |
| | | } else { |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(userService.getUserListPage(page,null, name, beginTime, endTime, deptid)); |
| | | return super.packForBT(page); |
| | | } |
| | | return new ArrayList<>(); |
| | | // //创建日期 |
| | | // String beginTime = null; |
| | | // String endTime = null; |
| | | // if (SinataUtil.isNotEmpty(createTime)){ |
| | | // String[] timeArray = createTime.split(" - "); |
| | | // beginTime = timeArray[0]; |
| | | // endTime = timeArray[1]; |
| | | // } |
| | | // User user = UserExt.getUser(); |
| | | // Role role = roleService.getBaseMapper().selectById(user.getRoleid()); |
| | | // if ("administrator".equals(role.getTips())) { |
| | | // Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | // page.setRecords(userService.getUserListPage(page,null, name, beginTime, endTime, deptid)); |
| | | // return super.packForBT(page); |
| | | // } else { |
| | | // Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | // page.setRecords(userService.getUserListPage(page,null, name, beginTime, endTime, deptid)); |
| | | // return super.packForBT(page); |
| | | // } |
| | | } |
| | | |
| | | /** |
| | |
| | | @BussinessLog(value = "添加管理员", key = "account", dict = UserDict.class) |
| | | @Permission(Const.ADMIN_NAME) |
| | | @ResponseBody |
| | | public Tip add(@Valid UserDto user, BindingResult result) { |
| | | public Object add(@Valid UserDto user, BindingResult result) { |
| | | if (result.hasErrors()) { |
| | | throw new GunsException(BizExceptionEnum.REQUEST_NULL); |
| | | } |
| | | |
| | | // 判断账号是否重复 |
| | | //Check if the account is duplicated |
| | | User theUser = new User(); |
| | | if (user.getAccount()!=""){ |
| | | theUser = userService.getByAccount(user.getAccount()); |
| | | |
| | | if (user.getPhone()!=""){ |
| | | theUser = userService.getByAccount(user.getPhone()); |
| | | } |
| | | System.out.println("=====theUser======="+theUser); |
| | | if (theUser != null&&user.getAccount()!="") { |
| | | throw new GunsException(BizExceptionEnum.USER_ALREADY_REG); |
| | | if (theUser != null){ |
| | | return 5001; |
| | | } |
| | | |
| | | // 完善账号信息 |
| | | // Complete account information |
| | | user.setPassword(SecureUtil.md5(user.getPassword())); |
| | | user.setStatus(ManagerStatus.OK.getCode()); |
| | | user.setCreatetime(new Date()); |
| | | |
| | | User objectUser = UserFactory.createUser(user); |
| | | objectUser.setObjectType(UserExt.getUser().getObjectType()); |
| | | objectUser.setObjectType(Integer.valueOf(user.getRoleid())); |
| | | objectUser.setObjectId(UserExt.getUser().getObjectId()); |
| | | objectUser.setRoleid(user.getRoleid()); |
| | | objectUser.setAccount(user.getPhone()); |
| | | objectUser.setName(user.getName()); |
| | | objectUser.setPhone(user.getPhone()); |
| | | objectUser.setBirthday(user.getBirthday()); |
| | | objectUser.setDeptid(user.getDeptid()); |
| | | objectUser.setIdCard(user.getIdCard()); |
| | | objectUser.setSex(user.getSex()); |
| | | objectUser.setStatus(1); |
| | | objectUser.setPassword(SecureUtil.md5("a123456")); |
| | | //查找平台所属公司 |
| | | //Search for the company that owns the platform. |
| | | objectUser.setCreatetime(new Date()); |
| | | // 运营商添加员工 |
| | | if (UserExt.getUser().getObjectType() == 2){ |
| | | objectUser.setObjectType(UserExt.getUser().getObjectType()); |
| | | objectUser.setRoleid("2"); |
| | | objectUser.setObjectId(UserExt.getUser().getObjectId()); |
| | | } |
| | | // 门店添加员工 |
| | | if (UserExt.getUser().getObjectType() == 3){ |
| | | objectUser.setObjectType(UserExt.getUser().getObjectType()); |
| | | objectUser.setRoleid("3"); |
| | | objectUser.setObjectId(UserExt.getUser().getObjectId()); |
| | | } |
| | | this.userService.save(objectUser); |
| | | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | |
| | | @RequestMapping("/edit") |
| | | @BussinessLog(value = "修改管理员", key = "account", dict = UserDict.class) |
| | | @ResponseBody |
| | | public Tip edit(@Valid UserDto user, BindingResult result) throws NoPermissionException { |
| | | public Object edit(@Valid UserDto user, BindingResult result) throws NoPermissionException { |
| | | if (result.hasErrors()) { |
| | | throw new GunsException(BizExceptionEnum.REQUEST_NULL); |
| | | } |
| | | |
| | | |
| | | User oldUser = userService.getById(user.getId()); |
| | | // UserExt.hasRole(Const.ADMIN_NAME) |
| | | if (false) { |
| | | this.userService.updateById(UserFactory.editUser(user, oldUser)); |
| | | return SUCCESS_TIP; |
| | | // 判断是否更改电话 |
| | | if (!oldUser.getPhone().equals(user.getPhone())){ |
| | | User phone = userService.getOne(new QueryWrapper<User>().eq("phone", user.getPhone())); |
| | | if (phone == null){ |
| | | oldUser.setPhone(user.getPhone()); |
| | | } else { |
| | | assertAuth(user.getId()); |
| | | User shiroUser = UserExt.getUser(); |
| | | if (shiroUser.getId().equals(user.getId()) || shiroUser.getId()==1) { |
| | | this.userService.updateById(UserFactory.editUser(user, oldUser)); |
| | | return SUCCESS_TIP; |
| | | } else { |
| | | throw new GunsException(BizExceptionEnum.NO_PERMITION); |
| | | return 5001; |
| | | } |
| | | } |
| | | oldUser.setName(user.getName()); |
| | | oldUser.setBirthday(user.getBirthday()); |
| | | oldUser.setRoleid(user.getRoleid()); |
| | | oldUser.setDeptid(user.getDeptid()); |
| | | oldUser.setIdCard(user.getIdCard()); |
| | | oldUser.setSex(user.getSex()); |
| | | if (user.getAvatar()!=null && (!user.getAvatar().equals(""))) |
| | | oldUser.setAvatar(user.getAvatar()); |
| | | this.userService.updateById(oldUser); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 员工管理查询返回VO |
| | | */ |
| | | @Data |
| | | public class UserListVO { |
| | | // 用户id |
| | | private Integer id; |
| | | // 员工姓名 |
| | | private String name; |
| | | // 联系电话 |
| | | private String phone; |
| | | // 头像 |
| | | private String avatar; |
| | | // 生日 |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date birthday; |
| | | // 性别 1男2女 |
| | | private Integer sex; |
| | | // 身份证号 |
| | | private String idCard; |
| | | // 所在部门 |
| | | private String deptName; |
| | | // 状态 1=正常 2=冻结 |
| | | private Integer status; |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | import lombok.Data; |
| | | import org.omg.CORBA.PRIVATE_MEMBER; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 员工管理查询Query |
| | | */ |
| | | @Data |
| | | public class UserQuery { |
| | | private String name; |
| | | private String phone; |
| | | private String idCard; |
| | | private Integer isSales; |
| | | private Integer status; |
| | | // 以下为运营商、门店权限筛选条件 |
| | | private Integer objectType; |
| | | private Integer objectId; |
| | | // 门店员工ids |
| | | private List<Integer> storeIds; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.guns.core.dataScope.DataScope; |
| | | import com.dsh.guns.modular.system.model.User; |
| | | import com.dsh.guns.modular.system.model.UserListVO; |
| | | import com.dsh.guns.modular.system.model.UserQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | @Param("deptid") Integer deptid); |
| | | |
| | | |
| | | List<UserListVO> searchUsers(UserQuery userQuery); |
| | | } |
| | |
| | | import com.dsh.course.mapper.UserMapper; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.dataScope.DataScope; |
| | | import com.dsh.guns.modular.system.model.UserListVO; |
| | | import com.dsh.guns.modular.system.model.UserQuery; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.dsh.guns.modular.system.model.User; |
| | |
| | | List<Map<String, Object>> userListPage = this.baseMapper.getUserListPage(page, dataScope, name, beginTime, endTime, deptid,objectType,objectId); |
| | | return userListPage; |
| | | } |
| | | |
| | | @Override |
| | | public List<UserListVO> searchUsers(UserQuery userQuery) { |
| | | return this.baseMapper.searchUsers(userQuery); |
| | | } |
| | | } |
| | |
| | | </where> |
| | | order by o.id desc |
| | | </select> |
| | | <select id="searchUsers" resultType="com.dsh.guns.modular.system.model.UserListVO"> |
| | | select t1.id,t1.name ,t1.phone ,t1.avatar,t1.birthday,t1.sex,t1.idCard,t1.status |
| | | ,t2.simplename as deptName from sys_user t1 |
| | | left join sys_dept t2 on t1.deptid = t2.id |
| | | <where> |
| | | <if test="query.name != null and query.name != ''"> |
| | | and t1.name like CONCAT('%',#{query.name},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and t1.phone like CONCAT('%',#{query.phone},'%') |
| | | </if> |
| | | <if test="query.idCard != null and query.idCard != ''"> |
| | | and t1.idCard like CONCAT('%',#{query.idCard},'%') |
| | | </if> |
| | | <if test="query.isSales == 1"> |
| | | and (t2.simplename like CONCAT('%','销售','%') |
| | | or t2.fullname like CONCAT('%','销售','%')) |
| | | </if> |
| | | <if test="query.status != null and query.status != ''"> |
| | | and t1.status = #{query.status} |
| | | </if> |
| | | <if test="query.storeIds != null and query.storeIds.size()>0"> |
| | | AND t1.id IN |
| | | <foreach collection="query.storeIds" separator="," item="id" open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | and t1.status != 3 |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TStudent.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TStudent.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TStudentTableToolbar" role="group"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCompetitionTableToolbar" role="group"> |
| | | <#button name="导出" icon="fa-plus" clickFun="TCompetition.export()"/> |
| | | <#button name="导出" icon="fa-plus" clickFun="TCompetition.ouTCompetition()"/> |
| | | </div> |
| | | <#table id="TCompetitionTable"/> |
| | | </div> |
| | |
| | | <div class="form-group"> |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <label class="col-sm-3 control-label">*兑换方式: </label> |
| | | <input class="col-sm-1 control-label" name="exchangeMethod" checked onclick="exchangeMethod2()" type="radio" |
| | | value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | <label class="col-sm-1" style="width: 20%;margin-top: 7px">现金+积分</label> |
| | | <input class="col-sm-1 control-label" onclick="exchangeMethod1()" name="exchangeMethod" type="radio" |
| | | value="1" style="margin-top: 10px"/> |
| | | <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">积分</label> |
| | | <input class="col-sm-1 control-label" name="exchangeMethod" onclick="exchangeMethod2()" type="radio" |
| | | value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | <label class="col-sm-1" style="width: 20%;margin-top: 7px">现金+积分</label> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <#button name="重置" icon="fa-trash" clickFun="TPayInfo.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | @if(type==1){ |
| | | <div class="hidden-xs" id="TPayInfoTableToolbar" role="group"> |
| | | <#button name="核销" icon="fa-plus" clickFun="TPayInfo.WriteOff()"/> |
| | | </div> |
| | | @} |
| | | <#table id="TPayInfoTable"/> |
| | | |
| | | <div style="margin-left: 40%"> |
| | |
| | | <label class="col-sm-3 control-label">板块名称:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="name" name="name" type="text" style="width: 400px;"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="form-group" style="margin-left:-410px"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="sort" name="name" type="text" style="width: 400px;"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" style="margin-left:-410px"> |
| | |
| | | <label class="col-sm-3 control-label">板块名称:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="name" name="name" type="text" style="width: 400px;" value="${item.name}"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="form-group" style="margin-left:-410px"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="sort" name="name" type="text" value="${item.sort}" style="width: 400px;"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" style="margin-left:-410px"> |
| | |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>用户管理</h5> |
| | | <h5>员工管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | |
| | | <div class="col-lg-10 col-sm-9"> |
| | | <div class="row"> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <#NameCon id="name" name="搜索" placeholder="帐号/姓名/手机号"/> |
| | | <#NameCon id="name" name="员工姓名" placeholder="请输入"/> |
| | | </div> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <#NameCon id="phone" name="联系电话" placeholder="请输入"/> |
| | | </div> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <#NameCon id="idCard" name="身份证号" placeholder="请输入"/> |
| | | </div> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <#SelectCon id="isSales" name="销售人员" > |
| | | <option value="">全部</option> |
| | | <option value="1">是</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <#SelectCon id="status" name="状态" > |
| | | <option value="">全部</option> |
| | | <option value="1">正常</option> |
| | | <option value="2">冻结</option> |
| | | </#SelectCon> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | @if(shiro.hasPermission("/mgr/delete")){ |
| | | <#button name="删除" icon="fa-remove" clickFun="MgrUser.delMgrUser()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/mgr/reset")){ |
| | | <#button name="重置密码" icon="fa-refresh" clickFun="MgrUser.resetPwd()" space="true"/> |
| | | @if(shiro.hasPermission("/mgr/delete")){ |
| | | <#button name="查看详情" icon="fa-remove" clickFun="MgrUser.openChangeUser1()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/mgr/freeze")){ |
| | | <#button name="冻结" icon="fa-warning" clickFun="MgrUser.freezeAccount()" space="true"/> |
| | |
| | | @if(shiro.hasPermission("/mgr/unfreeze")){ |
| | | <#button name="解冻" icon="fa-check-circle" clickFun="MgrUser.unfreeze()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/mgr/reset")){ |
| | | <#button name="重置密码" icon="fa-refresh" clickFun="MgrUser.resetPwd()" space="true"/> |
| | | @} |
| | | |
| | | @if(shiro.hasPermission("/mgr/kanbanPermissions")){ |
| | | <#button name="看板权限设置" icon="fa-user-secret" clickFun="MgrUser.kanbanPermissions()" space="true"/> |
| | | @} |
| | |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="userInfoForm"> |
| | | <input type="hidden" id="id" value=""> |
| | | <input type="hidden" id="role" value="role"> |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div id="driverInfoContent"> |
| | | <#input id="name" name="员工姓名" underline="true"/> |
| | | <#input id="phone" name="联系电话" underline="true"/> |
| | | <#avatar id="avatar" name="照片" underline="true"/> |
| | | <#input id="birthday" name="生日" underline="true" type="text"/> |
| | | <#select id="sex" name="性别" underline="true" > |
| | | <#input id="name" name="*员工姓名" underline="true"/> |
| | | <#input id="phone" name="*联系电话" underline="true"/> |
| | | <#avatar id="avatar" name="*照片" underline="true"/> |
| | | <#input id="birthday" name="*生日" underline="true" type="text"/> |
| | | <#select id="sex" name="*性别" underline="true" > |
| | | <option value="1" selected>男</option> |
| | | <option value="2">女</option> |
| | | </#select> |
| | | <#input id="idCard" name="身份证号" type="text" underline="true"/> |
| | | <#select id="roleid" name="角色" underline="true" > |
| | | <#input id="idCard" name="*身份证号" type="text" underline="true"/> |
| | | <#select id="deptid" name="*所在部门" underline="true" > |
| | | <option value="">请选择</option> |
| | | @for(l in depts){ |
| | | <option value="${l.id}">${l.fullname}</option> |
| | | @} |
| | | </#select> |
| | | @if(role == 1){ |
| | | <#select id="roleid" name="*所属角色" underline="true" > |
| | | <option value="">请选择</option> |
| | | @for(l in list){ |
| | | <option value="${l.id}">${l.name}</option> |
| | | @} |
| | | |
| | | </#select> |
| | | @} |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <option value="${l.id}" ${l.id == user.roleid ? 'selected=selected' : ''}>${l.name}</option> |
| | | @} |
| | | </#select> |
| | | @if(role == 1){ |
| | | <#select id="deptid" name="角色" underline="true" > |
| | | @for(l in depts){ |
| | | <option value="${l.id}" ${l.id == user.deptid ? 'selected=selected' : ''}>${l.fullname}</option> |
| | | @} |
| | | </#select> |
| | | @} |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | @if(type == 1){ |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="UserInfoDlg.editSubmit()"/> |
| | | @} |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="UserInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | |
| | | queryData['date'] = $("#date").val(); |
| | | queryData['payMethod'] = $("#payMethod").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | |
| | | |
| | | |
| | | TStudent.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | /** |
| | | * 重置 |
| | | */ |
| | | TStudent.resetSearch = function () { |
| | | $("#pCode").val(""); |
| | | $("#cCode").val(""); |
| | | $("#store").val(""); |
| | | $("#peopleName").val(""); |
| | | $("#phone").val(""); |
| | | $("#date").val(""); |
| | | $("#payMethod").val(""); |
| | | $("#state").val(""); |
| | | TStudent.search(); |
| | | }; |
| | | $(function () { |
| | | var defaultColunms = TStudent.initColumn(); |
| | | var table = new BSTable(TStudent.id, "/ball/yuyuelist", defaultColunms); |
| | |
| | | queryData['cityCode'] = $("#cityCode").val(); |
| | | queryData['coursePackageTypeId'] = $("#coursePackageTypeId").val(); |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['status'] = $("#status").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | CoursePackage.table.refresh({query: queryData}); |
| | | } |
| | |
| | | {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '性别', field: 'sex', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '性别', field: 'sex', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function (data) { |
| | | return {1:"男",2:"女"}[data] |
| | | } |
| | | }, |
| | | {title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '身份证号', field: 'idCard', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | |
| | | stores = this.storeIds.join(','); |
| | | console.log('stores--===--',stores) |
| | | } |
| | | |
| | | var ensure = document.getElementById("ensure"); |
| | | ensure.disabled = true; |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/commitData", function (data) { |
| | | ensure.disabled = false; |
| | | Feng.success("添加成功!"); |
| | | window.parent.TCoupon.table.refresh(); |
| | | couponInfoDlg.close(); |
| | | }, function (data) { |
| | | ensure.disabled = false; |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("userType",$('#userType').val()); |
| | |
| | | |
| | | |
| | | let name = $("#name").val() |
| | | let sort = $("#sort").val() |
| | | |
| | | if(name=='' || name ==null){ |
| | | Feng.info("请填写板块名称") |
| | | return; |
| | | } |
| | | if(sort=='' || sort ==null){ |
| | | Feng.info("请填写排序") |
| | | return; |
| | | } |
| | | |
| | |
| | | }); |
| | | ajax.set("name",name); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.set("sort",$("#sort").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | |
| | | Feng.info("请填写板块名称") |
| | | return; |
| | | } |
| | | |
| | | let sort = $("#sort").val() |
| | | if(sort=='' || sort ==null){ |
| | | Feng.info("请填写排序") |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/addConfig1", function(data){ |
| | | if(data.code == 200){ |
| | |
| | | }); |
| | | ajax.set("name",name); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.set("sort",$("#sort").val()); |
| | | ajax.start(); |
| | | } |
| | | TCompetition.close = function() { |
| | |
| | | return ""; |
| | | } |
| | | }, |
| | | {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: language==1?'账号':(language==2?'Account number':'Nomor akun'), field: 'account', align: 'center', valign: 'middle', sortable: true}, |
| | | {title: language==1?'姓名':(language==2?'name':'Nama Lengkap'), field: 'name', align: 'center', valign: 'middle', sortable: true}, |
| | | {title: '序号', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '姓名', field: 'name', align: 'center', valign: 'middle', sortable: true}, |
| | | {title: '电话', field: 'phone', align: 'center', valign: 'middle', sortable: true}, |
| | | {title: '头像', field: 'avatar', align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | value = typeof value == "undefined" || value == '' ? '/static/img/NoPIC.png' : value; |
| | | return '<img src="' + value + '" style="height: 100px;"/>' |
| | | }, |
| | | sortable: true}, |
| | | {title: '生日', field: 'birthday', align: 'center', valign: 'middle', sortable: true}, |
| | | {title: language==1?'性别':(language==2?'Gender':'Jenis kelamin'), field: 'sexName', align: 'center', valign: 'middle', sortable: true, |
| | | formatter:function (data) { |
| | | if(language==1){ |
| | | if(data==1){ |
| | | return '男' |
| | | }else { |
| | | return '女' |
| | | } |
| | | }else if(language==2){ |
| | | } |
| | | }, |
| | | {title: '身份证号', field: 'idCard', align: 'center', valign: 'middle', sortable: true}, |
| | | {title: '所在部门', field: 'deptName', align: 'center', valign: 'middle', sortable: true}, |
| | | {title: '状态', field: 'status', align: 'center', valign: 'middle', sortable: true, |
| | | formatter:function (data) { |
| | | if(data==1){ |
| | | return 'man' |
| | | return '正常' |
| | | }else { |
| | | return 'woman' |
| | | return '冻结' |
| | | } |
| | | }else { |
| | | if(data==1){ |
| | | return 'laki-laki' |
| | | }else { |
| | | return 'wanita' |
| | | } |
| | | } |
| | | |
| | | } |
| | | }, |
| | | {title: language==1?'角色':(language==2?'role':'peran'), field: 'roleName', visible: true, align: 'center', valign: 'middle', sortable: true, |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.roleName != '' && row.roleName != null) { |
| | | var labelStr = ""; |
| | | var labelStrs = ""; |
| | | var labelArray = row.roleName.split(","); |
| | | for(var i=0;i<labelArray.length;i++){ |
| | | labelStr += labelArray[i] +"<br>"; |
| | | labelStrs += labelArray[i] + " "; |
| | | } |
| | | labelStr = labelStr.substring(0,labelStr.length-4); |
| | | labelStrs = labelStrs.substring(0,labelStrs.length-5); |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + labelStrs + '" onfocus="AppCar.tooltip()">' + labelStr + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: language==1?'部门':(language==2?'department':'departemen'), field: 'deptName', align: 'center', valign: 'middle', sortable: true}, |
| | | {title: language==1?'邮箱':(language==2?'email':'email'), field: 'email', align: 'center', valign: 'middle', sortable: true}, |
| | | {title: language==1?'电话':(language==2?'phone':'Telepon'), field: 'phone', align: 'center', valign: 'middle', sortable: true}, |
| | | {title:language==1?'创建时间':(language==2?'Creation time':'Waktu penciptaan'), field: 'createtime', visible: true, align: 'center', valign: 'middle', sortable: true, |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.createtime1 != '' && row.createtime1 != null) { |
| | | var time = row.createtime1.replace(" ",'<br>'); |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.createtime1 + '" onfocus="AppCar.tooltip()">' + time + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: language==1?'状态':(language==2?'State':'Status'), field: 'statusName', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.statusName != '' && row.statusName != null) { |
| | | if(language==1){ |
| | | if (row.statusName == "2"){ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: red;" title="' + `冻结` + '" onfocus="AppUserInfo.tooltip()">' + `冻结` + '</p>'] |
| | | }else{ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + `启用` + '" onfocus="AppUserInfo.tooltip()">' + `启用` + '</p>'] |
| | | } |
| | | }else if(language==2){ |
| | | if (row.statusName == "2"){ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: red;" title="' + `freeze` + '" onfocus="AppUserInfo.tooltip()">' + `freeze` + '</p>'] |
| | | }else{ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + `enable` + '" onfocus="AppUserInfo.tooltip()">' + `enable` + '</p>'] |
| | | } |
| | | }else { |
| | | if (row.statusName == "2"){ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: red;" title="' + `Membekukan` + '" onfocus="AppUserInfo.tooltip()">' + 'Membekukan' + '</p>'] |
| | | }else{ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + `aktifkan` + '" onfocus="AppUserInfo.tooltip()">' + 'aktifkan' + '</p>'] |
| | | } |
| | | } |
| | | |
| | | } |
| | | return btn; |
| | | } |
| | | } |
| | | ]; |
| | | return columns; |
| | | }; |
| | |
| | | area: ['800px', '450px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/mgr/user_edit/' + this.seItem.id |
| | | content: Feng.ctxPath + '/mgr/user_edit/' + this.seItem.id+"/1" |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | /** |
| | | * 点击查看详情按钮时 |
| | | * @param userId 管理员id |
| | | */ |
| | | MgrUser.openChangeUser1 = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'编辑':(language==2?'Edit':'Edit'), |
| | | area: ['800px', '450px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/mgr/user_edit/' + this.seItem.id+"/2" |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | |
| | | ajax.set("userId", userId); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | if(language==1){ |
| | | Feng.confirm("是否删除用户" + MgrUser.seItem.account + "?",operation); |
| | | }else if(language==2){ |
| | | Feng.confirm("Whether to delete a user" + MgrUser.seItem.account + "?",operation); |
| | | }else { |
| | | Feng.confirm("Apakah menghapus pengguna" + MgrUser.seItem.account + "?",operation); |
| | | } |
| | | |
| | | Feng.confirm("是否删除员工: " + MgrUser.seItem.name + "?",operation); |
| | | } |
| | | }; |
| | | |
| | |
| | | if (this.check()) { |
| | | var userId = this.seItem.id; |
| | | if(language==1){ |
| | | parent.layer.confirm('是否重置密码为a123456?', { |
| | | parent.layer.confirm('是否重置密码为<span style="color: red;">a123456</span>?', { |
| | | btn: ['确定', '取消'], |
| | | shade: false //不显示遮罩 |
| | | }, function () { |
| | |
| | | |
| | | MgrUser.resetSearch = function () { |
| | | $("#name").val(""); |
| | | $("#createTime").val(""); |
| | | $("#phone").val(""); |
| | | $("#idCard").val(""); |
| | | $("#isSales").val(""); |
| | | $("#status").val(""); |
| | | |
| | | MgrUser.search(); |
| | | } |
| | | |
| | | MgrUser.search = function () { |
| | | var queryData = {}; |
| | | |
| | | queryData['deptid'] = MgrUser.deptid; |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['createTime'] = $("#createTime").val(); |
| | | |
| | | queryData['phone'] = $("#phone").val(); |
| | | queryData['idCard'] = $("#idCard").val(); |
| | | queryData['isSales'] = $("#isSales").val(); |
| | | queryData['state'] = $("#status").val(); |
| | | MgrUser.table.refresh({query: queryData}); |
| | | } |
| | | |
| | |
| | | var defaultColunms = MgrUser.initColumn(); |
| | | var table = new BSTable(MgrUser.id, "/mgr/list", defaultColunms); |
| | | // 设置物理分页server(逻辑分页client) |
| | | table.setPaginationType("server"); |
| | | table.setPaginationType("client"); |
| | | // 表单提交参数 |
| | | var queryData = {}; |
| | | queryData['deptid'] = MgrUser.deptid; |
| | |
| | | * 收集数据 |
| | | */ |
| | | UserInfoDlg.collectData = function () { |
| | | this.set('id').set('account').set('sex').set('password').set('avatar') |
| | | this.set('id').set('account').set('sex').set('password').set('avatar').set("deptid") |
| | | .set('email').set('name').set('birthday').set('rePassword').set('roleid').set('phone').set('idCard'); |
| | | }; |
| | | |
| | |
| | | if (!this.validate()) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | if($("#name").val()==''){ |
| | | Feng.info("请输入员工姓名") |
| | | return; |
| | | } |
| | | var phonePattern = /^1[3-9]\d{9}$/; |
| | | if (!phonePattern.test($("#phone").val())) { |
| | | Feng.info("请输入合法手机号") |
| | | return ; |
| | | } |
| | | if($("#phone").val()==''){ |
| | | Feng.info("请输入员工电话") |
| | | return; |
| | | } |
| | | if($("#birthday").val()==''){ |
| | | Feng.info("请选择员工生日") |
| | | return; |
| | | } |
| | | var avatar = $("#avatar").val(); |
| | | if(avatar==''){ |
| | | Feng.info("请上传照片") |
| | |
| | | Feng.info("请选择性别") |
| | | return; |
| | | } |
| | | // 当前登陆人类型 如果不是平台 不校验角色选择 |
| | | var role = $("#role").val(); |
| | | if (role==1){ |
| | | var roleid = $("#roleid").val(); |
| | | if(roleid==''){ |
| | | Feng.info("请选择角色") |
| | | return; |
| | | } |
| | | } |
| | | var dept = $("#deptid").val(); |
| | | if(dept==''){ |
| | | Feng.info("请选择部门") |
| | | return; |
| | | } |
| | | console.log(this.userInfoData) |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/mgr/add", function (data) { |
| | | if (data==5001){ |
| | | Feng.error("该手机号已存在!"); |
| | | }else{ |
| | | Feng.success("添加成功!"); |
| | | window.parent.MgrUser.table.refresh(); |
| | | UserInfoDlg.close(); |
| | | $(".img-circle").each(function () { |
| | | $(this).attr("src",Feng.ctxPath+$("#avatar").val()); |
| | | }) |
| | | } |
| | | }, function (data) { |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | |
| | | } |
| | | console.log(this.userInfoData) |
| | | |
| | | if($("#name").val()==''){ |
| | | Feng.info("请输入员工姓名") |
| | | return; |
| | | } |
| | | var phonePattern = /^1[3-9]\d{9}$/; |
| | | if (!phonePattern.test($("#phone").val())) { |
| | | Feng.info("请输入合法手机号") |
| | | return ; |
| | | } |
| | | if($("#phone").val()==''){ |
| | | Feng.info("请输入员工电话") |
| | | return; |
| | | } |
| | | if($("#birthday").val()==''){ |
| | | Feng.info("请选择员工生日") |
| | | return; |
| | | } |
| | | |
| | | var sex = $("#sex").val(); |
| | | if(sex==''){ |
| | | Feng.info("请选择性别") |
| | | return; |
| | | } |
| | | // 当前登陆人类型 如果不是平台 不校验角色选择 |
| | | var role = $("#role").val(); |
| | | if (role==1){ |
| | | var roleid = $("#roleid").val(); |
| | | if(roleid==''){ |
| | | Feng.info("请选择角色") |
| | | return; |
| | | } |
| | | } |
| | | var dept = $("#deptid").val(); |
| | | if(dept==''){ |
| | | Feng.info("请选择部门") |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/mgr/edit", function (data) { |
| | | if (data==5001){ |
| | | Feng.error("该手机号已存在!"); |
| | | }else{ |
| | | Feng.success("修改成功!"); |
| | | if (window.parent.MgrUser != undefined) { |
| | | window.parent.MgrUser.table.refresh(); |
| | | UserInfoDlg.close(); |
| | | } |
| | | window.parent.$(".img-circle").each(function () { |
| | | $(this).attr("src",$("#avatar").val()); |
| | | $(".img-circle").each(function () { |
| | | $(this).attr("src",Feng.ctxPath+$("#avatar").val()); |
| | | }) |
| | | } |
| | | |
| | | window.parent.$("#userNameTab").text($("#name").val()); |
| | | }, function (data) { |