Merge branch 'dev' of http://192.168.2.240:7070/r/kidgrow-microservices-platform into dev
1 files deleted
1 files added
21 files modified
| | |
| | | */ |
| | | @PostMapping(value = "/baseDownLoad",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
| | | ResultBody baseDownLoad(@RequestBody Map<String,Object> map) throws Exception; |
| | | /** |
| | | * byte数组模式上传 到 oss |
| | | * @param fileName bytes |
| | | */ |
| | | @PostMapping(value="byteUplaod") |
| | | FileInfo byteUplaod(@RequestParam("fileName") String fileName,@RequestBody byte[] bytes); |
| | | |
| | | } |
| | |
| | | public ResultBody baseDownLoad(Map<String, Object> map) throws Exception { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public FileInfo byteUplaod(String fileName, byte[] bytes) { |
| | | return null; |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.filecenter.model.FileInfo; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.InputStream; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | * base64图片下载 |
| | | */ |
| | | ResultBody baseDownLoad(Map<String, Object> map) throws Exception; |
| | | |
| | | FileInfo byteUplaod(String fileName, InputStream inputStream,int size); |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public FileInfo byteUplaod(String fileName, InputStream inputStream,int size) { |
| | | String houzhui=fileName.substring(fileName.lastIndexOf(".")+1); |
| | | String newFileName= RandomValueUtils.uuid()+"."+houzhui; |
| | | FileInfo newfileInfo=new FileInfo(); |
| | | newfileInfo.setName(newFileName); |
| | | newfileInfo.setId(IdUtil.fastSimpleUUID()); |
| | | newfileInfo.setSize(size); |
| | | newfileInfo.setIsImg(false); |
| | | newfileInfo.setContentType("byte[]"); |
| | | newfileInfo.setSource("aliyun"); |
| | | newfileInfo.setImgType(houzhui); |
| | | newfileInfo.setCreateTime(new Date()); |
| | | this.fileUpLoadOss(newfileInfo,"pdf/"+newFileName,inputStream); |
| | | baseMapper.insert(newfileInfo); |
| | | return newfileInfo; |
| | | } |
| | | } |
| | | |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | } |
| | | return fileService.baseDownLoad(map); |
| | | } |
| | | /** |
| | | * byte[]上传 |
| | | */ |
| | | @PostMapping(value="byteUplaod") |
| | | public FileInfo byteUplaod(@RequestParam("fileName") String fileName,@RequestBody byte[] bytes){ |
| | | if(bytes.length == 0){ |
| | | return null; |
| | | } |
| | | if (com.kidgrow.common.utils.StringUtils.isBlank(fileName)) { |
| | | return null; |
| | | } |
| | | InputStream inputStream = new ByteArrayInputStream(bytes); |
| | | return fileService.byteUplaod(fileName,inputStream,bytes.length); |
| | | } |
| | | /** |
| | | * byte[]上传 |
| | | */ |
| | | @PostMapping(value="byteUplaodTest",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
| | | public FileInfo byteUplaodTest(@RequestParam("fileName") String fileName,@RequestPart("file") MultipartFile file)throws IOException { |
| | | InputStream inputStream = file.getInputStream(); |
| | | ByteArrayOutputStream bytestream = new ByteArrayOutputStream(); |
| | | byte[] buffer=new byte[1024]; |
| | | int ch; |
| | | /** |
| | | * |
| | | * */ |
| | | while ((ch = inputStream.read(buffer)) != -1) { |
| | | bytestream.write(buffer,0,ch); |
| | | } |
| | | byte[] data = bytestream.toByteArray(); |
| | | InputStream inputStream1 = new ByteArrayInputStream(data); |
| | | return fileService.byteUplaod(fileName,inputStream,data.length); |
| | | } |
| | | |
| | | /** |
| | | * 文件删除 |
New file |
| | |
| | | package com.kidgrow.oprationcenter.vo; |
| | | |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class ProductAllVo extends Model<ProductAllVo> { |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 产品id |
| | | */ |
| | | private Long Id; |
| | | /** |
| | | * 产品名称 |
| | | */ |
| | | private String proName; |
| | | /** |
| | | * 时长(天) |
| | | */ |
| | | private Integer proTime; |
| | | /** |
| | | * 时长单位 |
| | | */ |
| | | private Integer proTimeUnit; |
| | | /** |
| | | * 产品类型 0试用 1正式 |
| | | */ |
| | | private Integer proType; |
| | | /** |
| | | * 建议售价 |
| | | */ |
| | | private BigDecimal proPrice; |
| | | /** |
| | | * 报告量 |
| | | */ |
| | | private Integer recordCount; |
| | | /** |
| | | * 读片量 |
| | | */ |
| | | private Integer ailightCount; |
| | | /** |
| | | * 产品结束时间-供前端使用 |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | private Date endTime; |
| | | /** |
| | | * 产品结束时间-供前端使用 |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | private Date beginTime; |
| | | /** |
| | | * 共享,1是,0不 |
| | | */ |
| | | private Boolean isShare; |
| | | } |
| | |
| | | package com.kidgrow.oprationcenter.mapper; |
| | | |
| | | import com.kidgrow.oprationcenter.model.SysProduct; |
| | | import com.kidgrow.db.mapper.SuperMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.kidgrow.db.mapper.SuperMapper; |
| | | import com.kidgrow.oprationcenter.model.SysProduct; |
| | | import com.kidgrow.oprationcenter.vo.ProductAllVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * @return |
| | | */ |
| | | List<SysProduct> findList(Page<SysProduct> page, @Param("p") Map<String, Object> params); |
| | | List<ProductAllVo> findAllList(@Param("p") Map<String, Object> params); |
| | | |
| | | /** |
| | | * 根据SysProduct对象当做查询条件进行查询 |
| | |
| | | import com.kidgrow.oprationcenter.model.SysProduct; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.service.ISuperService; |
| | | import com.kidgrow.oprationcenter.vo.ProductAllVo; |
| | | |
| | | import java.util.Map; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | PageResult<SysProduct> findList(Map<String, Object> params, SysUser sysUser); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | PageResult<ProductAllVo> findAllList(Map<String, Object> params, SysUser sysUser); |
| | | |
| | | /** |
| | | * 根据SysProduct对象当做查询条件进行查询 |
| | |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.common.service.impl.SuperServiceImpl; |
| | | import com.kidgrow.common.utils.DateUtil; |
| | | import com.kidgrow.oprationcenter.feign.RoleOrganizationService; |
| | | import com.kidgrow.oprationcenter.mapper.SysProductMapper; |
| | | import com.kidgrow.oprationcenter.model.SysProduct; |
| | | import com.kidgrow.oprationcenter.service.ISysProductService; |
| | | import com.kidgrow.oprationcenter.vo.ProductAllVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | List<SysProduct> list = baseMapper.findList(page, params); |
| | | return PageResult.<SysProduct>builder().data(list).code(0).count(page.getTotal()).build(); |
| | | } |
| | | /** |
| | | * 列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageResult<ProductAllVo> findAllList(Map<String, Object> params, SysUser sysUser){ |
| | | List<ProductAllVo> list = baseMapper.findAllList(params); |
| | | if (list != null) { |
| | | for (int i = 0; i <list.size() ; i++) { |
| | | list.get(i).setBeginTime(new Date()); |
| | | switch (list.get(i).getProTimeUnit()) |
| | | { |
| | | //天 |
| | | case 0: |
| | | list.get(i).setEndTime(DateUtil.addDays(new Date(),list.get(i).getProTime())); |
| | | break; |
| | | //月 |
| | | case 1: |
| | | list.get(i).setEndTime(DateUtil.addMonths(new Date(),list.get(i).getProTime())); |
| | | break; |
| | | //年 |
| | | case 2: |
| | | list.get(i).setEndTime(DateUtil.addYears(new Date(),list.get(i).getProTime())); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return PageResult.<ProductAllVo>builder().data(list).code(0).count(0L).build(); |
| | | } |
| | | |
| | | /** |
| | | * 根据SysProduct对象当做查询条件进行查询 |
| | |
| | | <include refid="where"/> |
| | | order by id desc |
| | | </select> |
| | | <!--定义根据-SysProduct当作查询条件返回对象集合--> |
| | | <select id="findAllList" resultType="com.kidgrow.oprationcenter.vo.ProductAllVo"> |
| | | select |
| | | <include refid="Column_List"/> |
| | | from sys_product |
| | | <include refid="where"/> |
| | | order by id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | } |
| | | return sysProductService.findList(params,sysUser); |
| | | } |
| | | |
| | | @GetMapping("/all") |
| | | public PageResult allList(@RequestParam Map<String, Object> params, @LoginUser SysUser sysUser) { |
| | | return sysProductService.findAllList(params,sysUser); |
| | | } |
| | | /** |
| | | * 查询 |
| | | */ |
| | |
| | | - /api-evaluation/evaluationxrayinfo/appSave |
| | | - /api-file/baseUplaod |
| | | - /api-user/users/python |
| | | - /api-evaluation/evaluationxrayinfo/checkQRCode |
| | | # - /api-user/syshospital/findAllByMap |
| | | # - /api-user/sysdictionaries/findAll |
| | | # - /api-user/sysdepartment/findListByHospitalId |
| | |
| | | /api-evaluation/evaluationxrayinfo/appUpload, |
| | | /api-evaluation/evaluationxrayinfo/appSave, |
| | | /api-file/baseUplaod, |
| | | /api-user/users/python |
| | | /api-user/users/python, |
| | | /api-evaluation/evaluationxrayinfo/checkQRCode |
| | | # /api-user/syshospital/findAllByMap, |
| | | # /api-user/sysdictionaries/findAll, |
| | | # /api-user/sysdepartment/findListByHospitalId |
| | |
| | | } else { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, {icon: 5, time: 2000}); |
| | | $('.login-captcha').click(); |
| | | } |
| | | }, |
| | | error: function (xhr) { |
| | | layer.closeAll('loading'); |
| | | layer.msg(xhr.responseJSON.msg, {icon: 5, time: 2000}); |
| | | $('.login-captcha').click(); |
| | | } |
| | | }); |
| | | //阻止表单跳转 |
| | |
| | | // var my_api_server_url = 'http://zuul.kidgrow.com/'; |
| | | // var my_api_server_url = 'http://192.168.2.240:8888/'; |
| | | // var my_api_server_url = 'http://127.0.0.1:8888/'; |
| | | var my_api_server_url = 'http://127.0.0.1:8888/'; |
| | | // var my_api_server_url = 'http://192.168.2.240:8888/'; |
| | | var my_api_server_url = 'http://open.zuul.kidgrow.cloud/'; |
| | | // var my_api_server_url = 'http://open.zuul.kidgrow.cloud/'; |
| | | // var my_api_server_url = 'http://uat.zuul.kidgrow.cloud/'; |
| | | // var my_api_server_url = 'https://zuul.kidgrow.cloud/'; |
| | | //var my_api_server_url = 'http://123.57.164.62:8888/'; |
| | |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="contract-table-bar"> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs permissions" permissions="contract-del" lay-event="del">删除</a> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs permissions" permissions="productorderdetail-save" lay-event="detail">查看产品</a> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs permissions" permissions="productorderdetail-save" lay-event="detail">查看套餐</a> |
| | | </script> |
| | | <!-- 表格状态列 --> |
| | | <script type="text/html" id="contract-tpl-state"> |
| | |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | page: true, |
| | | cols: [[ |
| | | { field: 'hospitalName', width: 263, title: '医院名称' }, |
| | | { field: 'departmentName', width: 100, title: '科室名称' }, |
| | | { field: 'hospitalName', width: 300, title: '医院名称' }, |
| | | { field: 'departmentName', width: 200, title: '科室名称' }, |
| | | { field: 'contractNo', width: 150, title: '合同编号' }, |
| | | { field: 'contractTitle', width: 260, title: '合同名' }, |
| | | { field: 'contractBeginTime', width: 150, title: '合同生效时间',templet:function(d) |
| | | { field: 'contractTitle', width: 200, title: '合同名' }, |
| | | { field: 'contractBeginTime', width: 120, title: '合同生效时间',templet:function(d) |
| | | { |
| | | return new Date(d.contractBeginTime).dateFormat("yyyy/MM/dd"); |
| | | } |
| | | }, |
| | | { field: 'contractEndTime', width: 150, title: '合同到期时间',templet:function(d){ |
| | | { field: 'contractEndTime', width: 120, title: '合同到期时间',templet:function(d){ |
| | | return new Date(d.contractEndTime).dateFormat("yyyy/MM/dd"); |
| | | } }, |
| | | { field: 'contractTime', width: 180, title: '合同签订时间',templet:function(d){ |
| | | { field: 'contractTime', width: 120, title: '合同签订时间',templet:function(d){ |
| | | return new Date(d.contractTime).dateFormat("yyyy/MM/dd"); |
| | | } }, |
| | | // { field: 'enabled', width: 120, templet: '#contract-tpl-state', sort: true, title: '状态' }, |
| | | { field: 'createTime', width: 160, title: '创建时间' , templet: function (d) { |
| | | return new Date(d.createTime).dateFormat("yyyy-MM-dd hh:mm"); |
| | | }}, |
| | | { align: 'center', width: 200, toolbar: '#contract-table-bar', title: '操作' } |
| | | { align: 'center', width: 150, toolbar: '#contract-table-bar', title: '操作', |
| | | fixed: 'right'} |
| | | ]], |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | |
| | | // 工具条点击事件 |
| | | table.on('tool(contract-table)', function (obj) { |
| | | if (obj.event === 'del') { // 删除 |
| | | layer.confirm('确定要删除吗?', function (i) { |
| | | layer.confirm('确定要删除合同及关联套餐吗?', function (i) { |
| | | layer.close(i); |
| | | layer.load(2); |
| | | admin.req('api-opration/contract/' + obj.data.id, {}, function (data) { |
| | |
| | | <!-- 表格操作列 --> |
| | | |
| | | <script type="text/html" id="doctor-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="detail">详情</a> |
| | | {{# if (d.doctorType !=2){}} |
| | | <button class="layui-btn layui-btn-primary layui-btn-xs permissions" permissions="users-edit" |
| | | lay-event="reset">重置密码</button> |
| | | {{#}}} |
| | | |
| | | <button class="layui-btn layui-btn-primary layui-btn-xs permissions" permissions="sysdoctor-edit" |
| | | lay-event="edit">修改</button> |
| | | <button class="layui-btn layui-btn-xs permissions" permissions="sysdoctor-del" lay-event="del">删除</button> |
| | | <button class="layui-btn layui-btn-danger layui-btn-xs permissions" permissions="sysdoctor-del" lay-event="del">删除</button> |
| | | </script> |
| | | |
| | | <!-- 表格状态列 --> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">Email</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="doctorEmail" type="text" class="layui-input" maxlength="20" |
| | | lay-verify="required|email" required /> |
| | | <input name="doctorEmail" type="text" class="layui-input" maxlength="50" |
| | | lay-verify="email" autocomplete="off"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | cols: [ |
| | | [{ |
| | | field: 'hospitalName', |
| | | width: "10%", |
| | | width: "200", |
| | | title: '医院名称', |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | field: 'departmentName', |
| | | width: "9%", |
| | | width: "150", |
| | | title: '科室', |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | field: 'doctorName', |
| | | width: "7%", |
| | | width: "150", |
| | | title: '医生姓名', |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | field: 'doctorRank', |
| | | width: "8%", |
| | | width: "100", |
| | | title: '职称' |
| | | }, |
| | | { |
| | | field: 'username', |
| | | width: "10%", |
| | | width: "150", |
| | | title: '登录帐号' |
| | | }, |
| | | { |
| | | field: 'doctorTel', |
| | | width: "10%", |
| | | width: "150", |
| | | title: '联系方式' |
| | | }, |
| | | { |
| | | field: 'isAnswer', |
| | | width: "5%", |
| | | width: "100", |
| | | title: '医答', |
| | | templet: function (d) { |
| | | return d.isAnswer ? "是" : "否" |
| | |
| | | }, |
| | | { |
| | | field: 'isSigning', |
| | | width: "5%", |
| | | width: "100", |
| | | title: '签约', |
| | | templet: function (d) { |
| | | return d.isSigning ? "是" : "否" |
| | | } |
| | | }, |
| | | // { |
| | | // field: 'enabled', |
| | | // width: 100, |
| | | // align: 'center', |
| | | // templet: '#doctor-tpl-state', |
| | | // title: '状态' |
| | | // }, |
| | | // { field: 'createTime', width: 150, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy-MM-dd HH:mm')}}</div>" }, |
| | | { |
| | | field: 'createTime', |
| | | width: "10%", |
| | | width: "120", |
| | | sort: true, |
| | | title: '创建时间', |
| | | templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" |
| | | }, |
| | | { |
| | | field: 'serverUserName', |
| | | width: "6%", |
| | | width: "120", |
| | | title: '销售代表' |
| | | }, |
| | | { |
| | | width: "20%", |
| | | width: "260", |
| | | align: 'center', |
| | | toolbar: '#doctor-table-bar', |
| | | title: '操作', |
| | |
| | | title: title, |
| | | path: 'pages/opration/doctor_form.html', |
| | | area: '900px', |
| | | offset: '0px', |
| | | finish: function () {} |
| | | }); |
| | | }; |
| | |
| | | <label class="layui-form-label">Email</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="doctorEmail" type="text" class="layui-input" maxlength="50" lay-verify="v_email" |
| | | /> |
| | | autocomplete="off" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | }, 'Post'); |
| | | } |
| | | //获取销售代表 |
| | | var getXiaoShouDaiBiao = function () { |
| | | var getXiaoShouDaiBiao = function (selectVal) { |
| | | admin.req('api-user/users/getAppointUser', { type: 0 }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | $('#serverUserId-add').append(new Option(item.nickname, item.id, |
| | | false, false)); |
| | | false, (!strUtil.isEmpty(selectVal) && selectVal == item.id))); |
| | | }) |
| | | } else { |
| | | layer.msg(data.msg, { |
| | |
| | | $('.layui-layer-content').css('overflow', 'auto'); |
| | | //将医院的数据保存到下拉表 |
| | | let selected = false; |
| | | var selectVal=""; |
| | | //先拿到当前登录用户的信息 |
| | | var nowUser = config.getUser(); |
| | | if (!strUtil.isEmpty(nowUser)) { |
| | | selectVal = nowUser.id; |
| | | } |
| | | //获取职称的 |
| | | getZhiCheng(); |
| | | //获取销售代表 |
| | | getXiaoShouDaiBiao(); |
| | | getXiaoShouDaiBiao(selectVal); |
| | | //获取角色 |
| | | get_role(); |
| | | var upload = layui.upload; |
| | |
| | | $("#password").removeAttr("lay-verify") |
| | | $("#password").removeAttr("required") |
| | | $("#passwordSure").removeAttr("lay-verify") |
| | | |
| | | |
| | | |
| | | form.render(); |
| | | } else { |
| | | loadEditData(); |
| | |
| | | width: 80, |
| | | templet: '#hospital-tpl-state', |
| | | title: '状态', |
| | | align: 'center', |
| | | fixed: 'right' |
| | | }, |
| | | { |
| | | field: 'hospitalId', |
| | | width: 250, |
| | | width: 225, |
| | | align: 'center', |
| | | toolbar: '#businessRecords-table-bar', |
| | | title: '操作', |
| | |
| | | title: (strUtil.isEmpty(data)) ? '添加医院/科室' : '编辑医院/科室', |
| | | path: 'pages/opration/hospital_form_base.html', |
| | | area: '900px', |
| | | offset: '0px', |
| | | finish: function () { |
| | | $('#hospita-btn-search').click(); |
| | | } |
| | |
| | | if (data.data.length > 0) { |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | if (!strUtil.isEmpty(selectVal) && selectVal == item.id) { |
| | | $('#saleUserName').append(new Option(item.nickname, item.id, |
| | | false, true)); |
| | | } else { |
| | | $('#saleUserName').append(new Option(item.nickname, item.id, |
| | | false, false)); |
| | | } |
| | | false, (!strUtil.isEmpty(selectVal) && selectVal == item.id))); |
| | | }); |
| | | |
| | | if (hosIdForEdit == "") { |
| | |
| | | time: 2000 |
| | | }); |
| | | } |
| | | |
| | | }, 'get'); |
| | | } |
| | | //医院资质数据 |
| | |
| | | let edithospitalData = admin.getTempData('t_hospital'); |
| | | var hosIdForEdit = ""; |
| | | var departmentId = ""; |
| | | //当前登录人员的id |
| | | var selectVal=""; |
| | | if (edithospitalData != null) { |
| | | hosIdForEdit = edithospitalData.hospitalId; |
| | | departmentId = edithospitalData.departmentId; |
| | | } |
| | | else{ |
| | | //先拿到当前登录用户的信息 |
| | | var nowUser = config.getUser(); |
| | | if (!strUtil.isEmpty(nowUser)) { |
| | | selectVal = nowUser.id; |
| | | } |
| | | } |
| | | //装载销售人员 服务人员数据 |
| | | loadServerUser(); |
| | | loadSaleUser(); |
| | | loadServerUser(selectVal); |
| | | loadSaleUser(selectVal); |
| | | |
| | | //装载市区数据 |
| | | form.on("select(hospitalProvince)", function (data) { |
| | |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header"> |
| | | <h2 class="header-title">产品消费记录</h2> |
| | | <h2 class="header-title">产品充值记录</h2> |
| | | <span class="layui-breadcrumb pull-right"> |
| | | <a href="#!console">首页</a> |
| | | <a><cite>产品消费记录</cite></a> |
| | | <a><cite>产品充值记录</cite></a> |
| | | </span> |
| | | </div> |
| | | <div class="layui-card-body"> |
| | |
| | | { field: 'proEndtime', width: 120, title: '结束时间',templet:function(d){ |
| | | return new Date(d.proEndtime).dateFormat("yyyy/MM/dd"); |
| | | } }, |
| | | // { field: 'createTime', width: 160, sort: true, title: '创建时间',templet:function(d){ |
| | | // return new Date(d.createTime).dateFormat("yyyy/MM/dd hh:mm:ss"); |
| | | // } }, |
| | | { field: 'createTime', width: 200, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" }, |
| | | { align: 'center', width: 100, toolbar: '#product-table-bar', title: '操作', |
| | | fixed: 'right' } |
| | |
| | | <form id="recharge-form" lay-filter="recharge-form" class="layui-form"> |
| | | <div style="overflow-y: auto; height:700px;"> |
| | | <div class="layui-tab"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">合同信息</li> |
| | | </ul> |
| | | <div class="layui-tab-content" style="margin: 0px;"> |
| | | <div class="layui-tab-item layui-show"> |
| | | <div class="layui-form-item" style="padding: 0; margin-bottom: 0px;"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm5"> |
| | | <label class="layui-form-label" style="padding: 0;">医院名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalName" id="hospitalName" type="text" class="layui-input" |
| | | style="border: none; margin-top:-10px" readonly /> |
| | | <div class="layui-tab"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">合同信息</li> |
| | | </ul> |
| | | <div class="layui-tab-content" style="margin: 0px 0px -10px 0px;"> |
| | | <div class="layui-tab-item layui-show"> |
| | | <div class="layui-form-item" style="padding: 0; margin-bottom: 0px;"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm5"> |
| | | <label class="layui-form-label" style="padding: 0;">医院名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalName" id="hospitalName" type="text" class="layui-input" |
| | | style="border: none; margin-top:-10px" readonly /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label" style="padding: 0;">科室名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="departmentName" id="departmentName" style="border: none; margin-top:-10px" |
| | | readonly class="layui-input" /> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label" style="padding: 0;">科室名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="departmentName" id="departmentName" |
| | | style="border: none; margin-top:-10px" readonly class="layui-input" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm2"> |
| | | <label class="layui-form-label" style="padding: 0;">服务人员</label> |
| | | <div class="layui-input-block"> |
| | | <input name="serverUserName" id="serverUserName" |
| | | style="border: none; margin-top:-10px;width: 120px;" readonly class="layui-input" /> |
| | | <div class="layui-col-sm2"> |
| | | <label class="layui-form-label" style="padding: 0;">服务人员</label> |
| | | <div class="layui-input-block"> |
| | | <input name="serverUserName" id="serverUserName" |
| | | style="border: none; margin-top:-10px;width: 120px;" readonly |
| | | class="layui-input" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item" style="padding: 0; margin-bottom: 0px;"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm5"> |
| | | <label class="layui-form-label" style="padding: 0 30px 0 0;">地区</label> |
| | | <input name="hospitalAreas" id="hospitalAreas" type="text" |
| | | style="border: none; width: 250px; margin-top:-10px" readonly class="layui-input" /> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label" style="padding: 0;">联系电话</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalTel" id="hospitalTel" type="text" class="layui-input" |
| | | style="border: none; margin-top:-10px" readonly /> |
| | | <div class="layui-form-item" style="padding: 0; margin-bottom: 0px;"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm5"> |
| | | <label class="layui-form-label" style="padding: 0 30px 0 0;">地区</label> |
| | | <input name="hospitalAreas" id="hospitalAreas" type="text" |
| | | style="border: none; width: 250px; margin-top:-10px" readonly class="layui-input" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm2"> |
| | | <label class="layui-form-label" style="padding: 0;">联系人</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalLink" type="text" class="layui-input" |
| | | style="border: none; margin-top:-10px;width: 120px;" readonly /> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label" style="padding: 0;">联系电话</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalTel" id="hospitalTel" type="text" class="layui-input" |
| | | style="border: none; margin-top:-10px" readonly /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm2"> |
| | | <label class="layui-form-label" style="padding: 0;">联系人</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalLink" type="text" class="layui-input" |
| | | style="border: none; margin-top:-10px;width: 120px;" readonly /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item" style="padding: 0; margin-bottom: 0px;"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label" style="padding: 10px 30px 0 0px;">合同名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="contractTitle" id="contractTitle" type="text" class="layui-input" |
| | | maxlength="50" lay-verify="required" required autocomplete="off" /> |
| | | <div class="layui-form-item" style="padding: 0; margin-bottom: 0px;"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label" style="padding: 10px 30px 0 0px;">合同名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="contractTitle" id="contractTitle" type="text" class="layui-input" |
| | | maxlength="50" lay-verify="required" required autocomplete="off" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">合同编号</label> |
| | | <div class="layui-input-block"> |
| | | <input name="contractNo" id="contractNo" type="text" class="layui-input" maxlength="50" |
| | | style="width: 185px;" autocomplete="off" lay-verify="required" required /> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">合同编号</label> |
| | | <div class="layui-input-block"> |
| | | <input name="contractNo" id="contractNo" type="text" class="layui-input" |
| | | maxlength="50" style="width: 185px;" autocomplete="off" lay-verify="required" |
| | | required /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item" style="margin: 10px 0px 0px 0px;"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label" style="padding: 10px 30px 0 0px;">开始日期</label> |
| | | <input autocomplete="off" name="contractBeginTime" id="contractBeginTime" type="text" |
| | | class="layui-input" style="width: 182px;" maxlength="50" lay-verify="required" |
| | | required /> |
| | | </div> |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label">截止日期</label> |
| | | <div class="layui-input-block"> |
| | | <input autocomplete="off" name="contractEndTime" id="contractEndTime" type="text" |
| | | class="layui-input" maxlength="50" lay-verify="required" required /> |
| | | <div class="layui-form-item" style="margin: 10px 0px 0px 0px;"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label" style="padding: 10px 30px 0 0px;">开始日期</label> |
| | | <input autocomplete="off" name="contractBeginTime" id="contractBeginTime" type="text" |
| | | class="layui-input" style="width: 182px;" maxlength="50" lay-verify="required" |
| | | required /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label">签订日期</label> |
| | | <div class="layui-input-block"> |
| | | <input autocomplete="off" name="contractTime" id="contractTime" type="text" |
| | | class="layui-input" maxlength="50" lay-verify="required" required /> |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label">截止日期</label> |
| | | <div class="layui-input-block"> |
| | | <input autocomplete="off" name="contractEndTime" id="contractEndTime" type="text" |
| | | class="layui-input" maxlength="50" lay-verify="required" required /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label">签订日期</label> |
| | | <div class="layui-input-block"> |
| | | <input autocomplete="off" name="contractTime" id="contractTime" type="text" |
| | | class="layui-input" maxlength="50" lay-verify="required" required /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-tab" style="margin: 0px;"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">产品信息</li> |
| | | </ul> |
| | | <div class="layui-tab-content" style="margin: 0px;"> |
| | | <div class="layui-tab-item layui-show" style="padding-top: 0px;"> |
| | | <table class="layui-table" id="product-table" lay-filter="product-table" style="margin: 0px;"></table> |
| | | <div class="layui-tab" style="margin: 0px;"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">产品信息</li> |
| | | </ul> |
| | | <div class="layui-tab-content" style="margin: -10px 0px -10px 0px;"> |
| | | <div class="layui-tab-item layui-show" style="padding-top: 0px;"> |
| | | <table class="layui-table" id="product-table" lay-filter="product-table" style="margin: 0px;"> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-tab" style="margin: 0px;"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">待充值产品</li> |
| | | </ul> |
| | | <div class="layui-tab-content"> |
| | | <div class="layui-tab-item layui-show" style="padding-top: 0px;"> |
| | | <table class="layui-table" id="product-table-temp" lay-filter="product-table-temp" style="margin: 0px;"> |
| | | </table> |
| | | <div class="layui-tab" style="margin: 0px;"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">待充值产品</li> |
| | | </ul> |
| | | <div class="layui-tab-content" style="margin: -10px 0px -10px 0px;"> |
| | | <div class="layui-tab-item layui-show" style="padding-top: 0px;"> |
| | | <table class="layui-table" id="product-table-temp" lay-filter="product-table-temp" |
| | | style="margin: 0px;"> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item model-form-footer" style="margin-right: 20px;"> |
| | | <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button> |
| | |
| | | var laydate = layui.laydate; |
| | | |
| | | //充值进行中 |
| | | var isRun=false; |
| | | var isRun = false; |
| | | //执行一个laydate实例 |
| | | laydate.render({ |
| | | elem: '#contractBeginTime' //指定元素 |
| | |
| | | cols: [ |
| | | [{ |
| | | field: 'proName', |
| | | width: 320, |
| | | width: 330, |
| | | title: '产品名称', |
| | | align: 'center', |
| | | fixed: 'left' |
| | |
| | | { |
| | | field: 'proType', |
| | | align: 'center', |
| | | width: 100, |
| | | width: 80, |
| | | templet: function (d) { |
| | | if (d.proType === 0) |
| | | return "试用" |
| | |
| | | } |
| | | }, |
| | | { |
| | | field: 'recordCount', |
| | | width: 110, |
| | | align: 'center', |
| | | title: '报告数' |
| | | }, |
| | | { |
| | | field: 'ailightCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '读片量' |
| | | }, |
| | | { |
| | | field: 'recordCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '报告量' |
| | | }, |
| | | { |
| | | field: 'beginTime', |
| | |
| | | field: 'id', |
| | | fixed: 'right', |
| | | align: 'center', |
| | | width: 80, |
| | | width: 100, |
| | | toolbar: '#product-tpl-bar-temp', |
| | | title: '操作' |
| | | } |
| | |
| | | //装载产品数据 |
| | | table.render({ |
| | | elem: '#product-table', |
| | | url: config.base_server + 'api-opration/product', |
| | | url: config.base_server + 'api-opration/product/all', |
| | | method: 'GET', |
| | | cellMinWidth: 50, |
| | | headers: { |
| | |
| | | [{ |
| | | field: 'proName', |
| | | sort: true, |
| | | width: 300, |
| | | width: 330, |
| | | title: '产品名称', |
| | | align: 'center', |
| | | fixed: 'left' |
| | |
| | | } |
| | | }, |
| | | { |
| | | field: 'recordCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '报告数' |
| | | }, |
| | | { |
| | | field: 'ailightCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '读片量' |
| | | }, |
| | | { |
| | | field: 'recordCount', |
| | | width: 100, |
| | | align: 'center', |
| | | title: '报告量' |
| | | }, |
| | | { |
| | | field: 'beginTime', |
| | | align: 'center', |
| | | width: 130, |
| | | width: 120, |
| | | title: '开始日期', |
| | | templet: function (d) { |
| | | return getNowDate(); |
| | | }, |
| | | event: "date", |
| | | edit: 'text' |
| | | event: "date" |
| | | }, |
| | | { |
| | | field: 'endTime', |
| | | align: 'center', |
| | | width: 130, |
| | | width: 120, |
| | | title: '结束日期', |
| | | templet: function (d) { |
| | | return getNowDate(d.proTime, d.proTimeUnit); |
| | | }, |
| | | event: "date", |
| | | edit: 'text' |
| | | event: "date" |
| | | }, |
| | | { |
| | | field: 'isShare', |
| | |
| | | }); |
| | | //单元格点击事件 |
| | | table.on('tool(product-table)', function (obj) { |
| | | var newdata = {}; |
| | | var data = obj.data; |
| | | var selectData = {}; |
| | | if (obj.event === 'date') { |
| | | var field = $(this).data('field'); |
| | | laydate.render({ |
| | | elem: this.firstChild, |
| | | format: "yyyy-MM-dd", |
| | | show: true, |
| | | done: function (value, date) { |
| | | var nowTr=obj.tr; |
| | | if (field === "beginTime") { |
| | | var endTimes = getNowDate(data.proTime, data.proTimeUnit, |
| | | value); |
| | | newdata["beginTime"] = value; |
| | | newdata["endTime"] = endTimes; |
| | | } else if (field === "endTime") { |
| | | newdata["endTime"] = value; |
| | | var beginTimes = getNowDate((0 - parseInt(data.proTime)), |
| | | data.proTimeUnit, value); |
| | | newdata["beginTime"] = beginTimes; |
| | | } |
| | | obj.update(newdata); |
| | | } |
| | | }); |
| | | } |
| | | if (obj.event === "pay") { |
| | | data.beginTime = obj.tr.find("td[data-field='beginTime'] input").val(); |
| | | data.endTime = obj.tr.find("td[data-field='endTime'] input").val(); |
| | |
| | | } |
| | | }); |
| | | //自动计算时间 |
| | | var getNowDate = function (proTime, proTimeUnit) { |
| | | var now = new Date(); |
| | | var getNowDate = function (proTime, proTimeUnit, now) { |
| | | if (strUtil.isEmpty(now)) { |
| | | now = new Date(); |
| | | } else { |
| | | now = dateUtil.strTurnDate(now); |
| | | } |
| | | if (strUtil.isEmpty(proTime) && strUtil.isEmpty(proTimeUnit)) { |
| | | return now.dateFormat("yyyy-MM-dd"); |
| | | } else { |
| | |
| | | return new Date(now.setDate(now.getDate() + proTime)).dateFormat("yyyy-MM-dd"); |
| | | break; |
| | | case 1: |
| | | return new Date(now.setMonth(now.getMonth() + proTime + 1)).dateFormat( |
| | | "yyyy-MM-dd"); |
| | | return new Date(now.setMonth(now.getMonth() + proTime)).dateFormat( |
| | | "yyyy-MM-dd"); |
| | | break; |
| | | case 2: |
| | | return new Date(now.setFullYear(now.getFullYear() + proTime)).dateFormat( |
| | |
| | | } |
| | | } |
| | | form.on('submit(recharge-form-submit)', function (data) { |
| | | if(!isRun){ |
| | | if (!isRun) { |
| | | layer.load(2); |
| | | var listData = admin.getTempData("t_tempProduct"); |
| | | if (listData != null) { |
| | | if (data.field != null) { |
| | | layer.confirm("确定要将待充值列表中的" + listData.length + "个产品充值给当前医院的科室吗?", { |
| | | btn: ["确定", "返回"] |
| | | }, function () { |
| | | isRun=true; |
| | | data.field.contractBeginTime = data.field.contractBeginTime + |
| | | " 00:00:00"; |
| | | data.field.contractEndTime = data.field.contractEndTime + " 23:59:59"; |
| | | data.field.contractTime = data.field.contractTime + " 00:00:00"; |
| | | admin.req('api-opration/contract', JSON.stringify(data.field), |
| | | function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code === 0) { |
| | | var orderData = data.data; |
| | | //处理订单明细数据 |
| | | var listDetailData = new Array(); |
| | | $.each(listData, function (index, item) { |
| | | var detailData = { |
| | | orderId: orderData.id, |
| | | proId: item.id, |
| | | proType: item.proType, |
| | | proName: item.proName, |
| | | isShare: item.isShare, |
| | | ailightCount: item.ailightCount, |
| | | recordCount: item.recordCount, |
| | | proBegintime: item.beginTime + |
| | | ' 00:00:00', |
| | | proEndtime: item.endTime + |
| | | ' 23:59:59' |
| | | }; |
| | | listDetailData.push(detailData); |
| | | }) |
| | | var listData = admin.getTempData("t_tempProduct"); |
| | | if (listData != null) { |
| | | if (data.field != null) { |
| | | layer.confirm("确定要将待充值列表中的" + listData.length + "个产品充值给当前医院的科室吗?", { |
| | | btn: ["确定", "返回"] |
| | | }, function () { |
| | | isRun = true; |
| | | data.field.contractBeginTime = data.field.contractBeginTime + |
| | | " 00:00:00"; |
| | | data.field.contractEndTime = data.field.contractEndTime + |
| | | " 23:59:59"; |
| | | data.field.contractTime = data.field.contractTime + " 00:00:00"; |
| | | admin.req('api-opration/contract', JSON.stringify(data.field), |
| | | function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code === 0) { |
| | | var orderData = data.data; |
| | | //处理订单明细数据 |
| | | var listDetailData = new Array(); |
| | | $.each(listData, function (index, item) { |
| | | var detailData = { |
| | | orderId: orderData.id, |
| | | proId: item.id, |
| | | proType: item.proType, |
| | | proName: item.proName, |
| | | isShare: item.isShare, |
| | | ailightCount: item.ailightCount, |
| | | recordCount: item.recordCount, |
| | | proBegintime: item.beginTime + |
| | | ' 00:00:00', |
| | | proEndtime: item.endTime + |
| | | ' 23:59:59' |
| | | }; |
| | | listDetailData.push(detailData); |
| | | }) |
| | | |
| | | if (listDetailData.length > 0) { |
| | | //提交订单数据 |
| | | admin.req('api-opration/productorderdetail/saveall', |
| | | JSON.stringify(listDetailData), |
| | | function (data) { |
| | | isRun=false; |
| | | layer.closeAll('loading'); |
| | | if (data.code === 0) { |
| | | //现将临时数据清理 |
| | | admin.putTempData("t_tempProduct", |
| | | ""); |
| | | layer.msg(data.msg, { |
| | | icon: 1, |
| | | time: 3000 |
| | | }, function () { |
| | | admin |
| | | .finishPopupCenter(); |
| | | }); |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 1000 |
| | | }); |
| | | } |
| | | }, 'POST'); |
| | | if (listDetailData.length > 0) { |
| | | //提交订单数据 |
| | | admin.req( |
| | | 'api-opration/productorderdetail/saveall', |
| | | JSON.stringify(listDetailData), |
| | | function (data) { |
| | | isRun = false; |
| | | layer.closeAll('loading'); |
| | | if (data.code === 0) { |
| | | //现将临时数据清理 |
| | | admin.putTempData( |
| | | "t_tempProduct", |
| | | ""); |
| | | layer.msg(data.msg, { |
| | | icon: 1, |
| | | time: 3000 |
| | | }, function () { |
| | | admin |
| | | .finishPopupCenter(); |
| | | }); |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 1000 |
| | | }); |
| | | } |
| | | }, 'POST'); |
| | | } else { |
| | | layer.msg("充值数据异常为空!", { |
| | | icon: 2, |
| | | time: 1000 |
| | | }); |
| | | isRun = false; |
| | | } |
| | | } else { |
| | | layer.msg("充值数据异常为空!", { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 1000 |
| | | }); |
| | | isRun=false; |
| | | isRun = false; |
| | | } |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 1000 |
| | | }); |
| | | isRun=false; |
| | | } |
| | | }, 'POST'); |
| | | }) |
| | | }, 'POST'); |
| | | }) |
| | | } else { |
| | | layer.msg("数据异常!", { |
| | | icon: 2, |
| | | time: 1000 |
| | | }); |
| | | } |
| | | } else { |
| | | layer.msg("数据异常!", { |
| | | layer.msg("请先将要充值的产品加入待充值!", { |
| | | icon: 2, |
| | | time: 1000 |
| | | time: 2000 |
| | | }); |
| | | } |
| | | } else { |
| | | layer.msg("请先将要充值的产品加入待充值!", { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | layer.closeAll('loading'); |
| | | return false; |
| | | layer.closeAll('loading'); |
| | | return false; |
| | | } |
| | | }); |
| | | }); |
| | |
| | | }, "POST"); |
| | | return false; |
| | | }); |
| | | //判断用户名是否被使用 |
| | | var username_is_usered = function (username_id) { |
| | | var username = $("#" + username_id).val() |
| | | admin.req('api-user/users/findCountByMap', JSON.stringify({ |
| | | username: username |
| | | }), function (data) { |
| | | if (data.code == 0) { |
| | | if (data.data > 0) { |
| | | $("#" + username_id).val("") |
| | | layer.msg("该手机号已经使用", { |
| | | icon: 2, |
| | | time: 2000 |
| | | }) |
| | | } |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'post'); |
| | | } |
| | | /* |
| | | * 验证手机号码 |
| | | */ |
| | | function validatorTel(content) { |
| | | // 正则验证格式 |
| | | eval("var reg = /^1[34578]\\d{9}$/;"); |
| | | var flag = RegExp(reg).test(content) |
| | | return flag; |
| | | } |
| | | //验证手机号是否被使用 |
| | | $("#mobile").blur(function () { |
| | | let mobile=$("#mobile").val() |
| | | if (!validatorTel(mobile)) { |
| | | layer.msg("请输入正确的手机号"); |
| | | } else { |
| | | username_is_usered("mobile"); |
| | | } |
| | | }) |
| | | }); |
| | | </script> |