收样管理
This commit is contained in:
parent
18de904a41
commit
52d3248787
|
|
@ -0,0 +1,116 @@
|
|||
package com.bonus.aqgqj.basis.controller;
|
||||
|
||||
import com.bonus.aqgqj.annotation.DecryptAndVerify;
|
||||
import com.bonus.aqgqj.annotation.LogAnnotation;
|
||||
import com.bonus.aqgqj.basis.entity.dto.SamplesManageDto;
|
||||
import com.bonus.aqgqj.basis.entity.dto.SamplesManageDto;
|
||||
import com.bonus.aqgqj.basis.service.SamplesManageService;
|
||||
import com.bonus.aqgqj.basis.service.ToolsManageService;
|
||||
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
||||
import com.bonus.aqgqj.system.vo.SysOrgVo;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 收样管理
|
||||
* @author hay
|
||||
*/
|
||||
@Api(tags = "收样管理")
|
||||
@RestController
|
||||
@RequestMapping("/samples/")
|
||||
public class SamplesManageController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger("adminLogger");
|
||||
|
||||
@Autowired
|
||||
private SamplesManageService samplesManageService;
|
||||
|
||||
@PostMapping(value = "getList")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageDto.class)
|
||||
@LogAnnotation(operModul = "收样管理-收样管理", operation = "查询用列表", operDesc = "业务级事件",operType="查询")
|
||||
@PreAuthorize("@pms.hasPermission('sys:samples:query')" )
|
||||
public ServerResponse listUsers(EncryptedReq<SamplesManageDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
List<SamplesManageDto> list = samplesManageService.list(data.getData());
|
||||
PageInfo<SamplesManageDto> pageInfo = new PageInfo<>(list);
|
||||
return ServerResponse.createSuccessPage(pageInfo,data.getData().getPage(),data.getData().getLimit());
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErrorPage(data.getData().getPage(),data.getData().getLimit());
|
||||
}
|
||||
|
||||
@PostMapping(value = "getDetailsList")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageDto.class)
|
||||
@LogAnnotation(operModul = "收样管理-收样管理详情", operation = "查询用列表", operDesc = "业务级事件",operType="查询")
|
||||
@PreAuthorize("@pms.hasPermission('sys:samples:query')" )
|
||||
public ServerResponse getDetailsList(EncryptedReq<SamplesManageDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
List<SamplesManageDto> list = samplesManageService.getDetailsList(data.getData());
|
||||
PageInfo<SamplesManageDto> pageInfo = new PageInfo<>(list);
|
||||
return ServerResponse.createSuccessPage(pageInfo,data.getData().getPage(),data.getData().getLimit());
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErrorPage(data.getData().getPage(),data.getData().getLimit());
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "all")
|
||||
@LogAnnotation(operModul = "收样管理", operation = "查询所有工器具", operDesc = "业务级事件",operType="查询")
|
||||
@PreAuthorize("@pms.hasPermission('sys:samples:query')" )
|
||||
public ServerResponse getAll() {
|
||||
try {
|
||||
List<SamplesManageDto> list = samplesManageService.listTools();
|
||||
return ServerResponse.createSuccess(list);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
|
||||
@PostMapping(value = "allCustomName")
|
||||
@LogAnnotation(operModul = "收样管理", operation = "查询所有单位", operDesc = "业务级事件",operType="查询")
|
||||
@PreAuthorize("@pms.hasPermission('sys:samples:query')" )
|
||||
public ServerResponse getAllCustomName() {
|
||||
try {
|
||||
List<SamplesManageDto> list = samplesManageService.getAllCustomName();
|
||||
return ServerResponse.createSuccess(list);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 新增收样数据
|
||||
*/
|
||||
@PostMapping("addSamples")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageDto.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "收样管理", operation = "新增收样数据", operDesc = "业务级事件", operType = "新增")
|
||||
@PreAuthorize("@pms.hasPermission('sys:samples:add')")
|
||||
public ServerResponse addSamples(EncryptedReq<SamplesManageDto> vo) {
|
||||
try {
|
||||
return samplesManageService.addSamples(vo.getData());
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -49,7 +49,7 @@ public class ToolsManageController {
|
|||
|
||||
@PostMapping(value = "getList")
|
||||
@DecryptAndVerify(decryptedClass = ToolsManageDto.class)
|
||||
@LogAnnotation(operModul = "工器具管理-工器具个体管理", operation = "查询用列表", operDesc = "系统级事件",operType="查询")
|
||||
@LogAnnotation(operModul = "工器具管理-工器具个体管理", operation = "查询用列表", operDesc = "业务级事件",operType="查询")
|
||||
@PreAuthorize("@pms.hasPermission('sys:tools:query')" )
|
||||
public ServerResponse listUsers(EncryptedReq<ToolsManageDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
|
|
@ -65,7 +65,7 @@ public class ToolsManageController {
|
|||
|
||||
@PostMapping(value = "getDetailsList")
|
||||
@DecryptAndVerify(decryptedClass = ToolsManageDto.class)
|
||||
@LogAnnotation(operModul = "工器具管理-工器具个体管理详情", operation = "查询用列表", operDesc = "系统级事件",operType="查询")
|
||||
@LogAnnotation(operModul = "工器具管理-工器具个体管理详情", operation = "查询用列表", operDesc = "业务级事件",operType="查询")
|
||||
@PreAuthorize("@pms.hasPermission('sys:tools:query')" )
|
||||
public ServerResponse getDetailsList(EncryptedReq<ToolsManageDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
|
|
@ -81,7 +81,7 @@ public class ToolsManageController {
|
|||
|
||||
|
||||
@PostMapping(value = "all")
|
||||
@LogAnnotation(operModul = "工器具管理", operation = "查询所有工器具", operDesc = "系统级事件",operType="查询")
|
||||
@LogAnnotation(operModul = "工器具管理", operation = "查询所有工器具", operDesc = "业务级事件",operType="查询")
|
||||
@PreAuthorize("@pms.hasPermission('sys:tools:query')" )
|
||||
public ServerResponse getAll() {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
package com.bonus.aqgqj.basis.dao;
|
||||
|
||||
import com.bonus.aqgqj.basis.entity.dto.SamplesManageDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SamplesManageDao {
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<SamplesManageDto> list(SamplesManageDto bean);
|
||||
|
||||
/**
|
||||
* 获取工器具
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
String getSampleTools(Integer id);
|
||||
|
||||
/**
|
||||
* 获取详情列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<SamplesManageDto> getDetailsList(SamplesManageDto data);
|
||||
|
||||
/**
|
||||
* 获取工器具
|
||||
* @return
|
||||
*/
|
||||
List<SamplesManageDto> listTools();
|
||||
|
||||
/**
|
||||
* 获取所有单位名称
|
||||
* @return
|
||||
*/
|
||||
List<SamplesManageDto> getAllCustomName();
|
||||
|
||||
/**
|
||||
* 新增收样数据 tb_samples
|
||||
* @param samplesManageDto
|
||||
* @return
|
||||
*/
|
||||
int addSamples(SamplesManageDto samplesManageDto);
|
||||
|
||||
/**
|
||||
* 新增设备数据 tb_samples_device
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int addSamplesDevice(SamplesManageDto dto);
|
||||
}
|
||||
|
|
@ -15,6 +15,9 @@ import org.apache.ibatis.annotations.Update;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hay
|
||||
*/
|
||||
@Mapper
|
||||
public interface ToolsManageDao {
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,125 @@
|
|||
package com.bonus.aqgqj.basis.entity.dto;
|
||||
|
||||
import com.bonus.aqgqj.base.entity.PageEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 工器具个体管理
|
||||
* @author hay
|
||||
*/
|
||||
@Data
|
||||
public class SamplesManageDto extends PageEntity {
|
||||
|
||||
private static final long serialVersionUID = -6525908145032868837L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 送样单位id
|
||||
*/
|
||||
private Integer customId;
|
||||
|
||||
/**
|
||||
* 送样单位
|
||||
*/
|
||||
private String customName;
|
||||
|
||||
/**
|
||||
* 送样部门
|
||||
*/
|
||||
private String sampleDepartment;
|
||||
|
||||
/**
|
||||
* 送样人
|
||||
*/
|
||||
private String sampleUser;
|
||||
|
||||
/**
|
||||
* 送样时间
|
||||
*/
|
||||
private String sampleTime;
|
||||
|
||||
/**
|
||||
* 送样设备
|
||||
*/
|
||||
private String sampleTools;
|
||||
|
||||
/**
|
||||
* 收样人
|
||||
*/
|
||||
private String collectSamplesUser;
|
||||
|
||||
/**
|
||||
* 收样时间
|
||||
*/
|
||||
private String collectSamplesTime;
|
||||
|
||||
/**
|
||||
* 班组
|
||||
*/
|
||||
private String teamName;
|
||||
|
||||
/**
|
||||
* 设备编号
|
||||
*/
|
||||
private String devCode;
|
||||
|
||||
/**
|
||||
* 客户自编号
|
||||
*/
|
||||
private String devTypeCode;
|
||||
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
private String factoryName;
|
||||
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
private String manufactureDate;
|
||||
|
||||
/**
|
||||
* 设备规格
|
||||
*/
|
||||
private String devModule;
|
||||
|
||||
/**
|
||||
* 试验日期
|
||||
*/
|
||||
private String experTime;
|
||||
|
||||
/**
|
||||
* 下次试验日期
|
||||
*/
|
||||
private String nextExperTime;
|
||||
|
||||
/**
|
||||
* 试验人员
|
||||
*/
|
||||
private String experUser;
|
||||
|
||||
/**
|
||||
* 试验结论
|
||||
*/
|
||||
private String experConclu;
|
||||
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private String keyWord;
|
||||
|
||||
private String paramsList;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Integer createBy;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -60,12 +60,12 @@ public class ToolsManageDto extends PageEntity {
|
|||
private String teamName;
|
||||
|
||||
/**
|
||||
* 设备编号
|
||||
* 客户自编号
|
||||
*/
|
||||
private String devCode;
|
||||
|
||||
/**
|
||||
* 客户自编号
|
||||
* 设备编号
|
||||
*/
|
||||
private String devTypeCode;
|
||||
|
||||
|
|
@ -104,6 +104,16 @@ public class ToolsManageDto extends PageEntity {
|
|||
*/
|
||||
private String experConclu;
|
||||
|
||||
/**
|
||||
* 试验周期
|
||||
*/
|
||||
private String experCycle;
|
||||
|
||||
/**
|
||||
* 试验单价(元)
|
||||
*/
|
||||
private String experPrice;
|
||||
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
package com.bonus.aqgqj.basis.service;
|
||||
|
||||
import com.bonus.aqgqj.basis.entity.dto.SamplesManageDto;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工器具个体管理
|
||||
* @author hay
|
||||
*/
|
||||
public interface SamplesManageService {
|
||||
/**
|
||||
* 查询列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<SamplesManageDto> list(SamplesManageDto bean);
|
||||
|
||||
/**
|
||||
* 详情列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<SamplesManageDto> getDetailsList(SamplesManageDto data);
|
||||
|
||||
/**
|
||||
* 工器具列表
|
||||
* @return
|
||||
*/
|
||||
List<SamplesManageDto> listTools();
|
||||
|
||||
/**
|
||||
* 单位列表
|
||||
* @return
|
||||
*/
|
||||
List<SamplesManageDto> getAllCustomName();
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
ServerResponse addSamples(SamplesManageDto data);
|
||||
}
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
package com.bonus.aqgqj.basis.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bonus.aqgqj.basis.dao.SamplesManageDao;
|
||||
import com.bonus.aqgqj.basis.dao.ToolsManageDao;
|
||||
import com.bonus.aqgqj.basis.entity.dto.SamplesManageDto;
|
||||
import com.bonus.aqgqj.basis.service.SamplesManageService;
|
||||
import com.bonus.aqgqj.basis.service.ToolsManageService;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
import com.bonus.aqgqj.utils.UserUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 工器具个体管理
|
||||
* @author hay
|
||||
* @date 2024/7/20 16:10
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SamplesManageServiceImpl implements SamplesManageService {
|
||||
|
||||
|
||||
@Resource
|
||||
private SamplesManageDao samplesManageDao;
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SamplesManageDto> list(SamplesManageDto bean) {
|
||||
List<SamplesManageDto> list = samplesManageDao.list(bean);
|
||||
for (SamplesManageDto dto : list){
|
||||
String sampleTools = samplesManageDao.getSampleTools(dto.getId());
|
||||
dto.setSampleTools(sampleTools);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SamplesManageDto> getDetailsList(SamplesManageDto data) {
|
||||
return samplesManageDao.getDetailsList(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SamplesManageDto> listTools() {
|
||||
List<SamplesManageDto> list = samplesManageDao.listTools();
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有单位列表
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SamplesManageDto> getAllCustomName() {
|
||||
return samplesManageDao.getAllCustomName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponse addSamples(SamplesManageDto data) {
|
||||
JSONArray jsonArray = JSONObject.parseArray(data.getParamsList());
|
||||
List<SamplesManageDto> samplesManageDtos = jsonArray.toJavaList(SamplesManageDto.class);
|
||||
if (samplesManageDtos.size() > 0){
|
||||
//先增加基础数据表,并返回Id
|
||||
Integer userId = Integer.parseInt(UserUtil.getLoginUser().getId().toString());
|
||||
samplesManageDtos.get(0).setCreateBy(userId);
|
||||
int re= samplesManageDao.addSamples(samplesManageDtos.get(0));
|
||||
if (re>0){
|
||||
//添加详情数据
|
||||
for (SamplesManageDto dto : samplesManageDtos){
|
||||
dto.setId(samplesManageDtos.get(0).getId());
|
||||
dto.setCreateBy(userId);
|
||||
int res= samplesManageDao.addSamplesDevice(dto);
|
||||
if (res<=0){
|
||||
return ServerResponse.createByErrorMsg(500,"新增失败");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
return ServerResponse.createByErrorMsg(500,"新增失败");
|
||||
}
|
||||
}else {
|
||||
return ServerResponse.createByErrorMsg(500,"新增失败");
|
||||
}
|
||||
return ServerResponse.createBySuccessMsg("上传成功");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.aqgqj.basis.dao.SamplesManageDao">
|
||||
<insert id="addSamples" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
|
||||
INSERT INTO tb_sample(custom_id,
|
||||
custom_name,
|
||||
department,
|
||||
sample_user,
|
||||
sample_time,
|
||||
create_time,
|
||||
create_user,
|
||||
sample_date)
|
||||
VALUES (#{customId},
|
||||
#{customName},
|
||||
#{sampleDepartment},
|
||||
#{sampleUser},
|
||||
#{sampleTime},
|
||||
NOW(),
|
||||
#{createBy},
|
||||
#{sampleTime})
|
||||
</insert>
|
||||
<insert id="addSamplesDevice">
|
||||
INSERT INTO tb_sample_device(sample_id,
|
||||
dev_type_name,
|
||||
dev_type_code,
|
||||
dev_module,
|
||||
sample_time,
|
||||
create_time,
|
||||
create_user)
|
||||
VALUES (#{id},
|
||||
#{sampleTools},
|
||||
#{devTypeCode},
|
||||
#{devModule},
|
||||
#{sampleTime},
|
||||
NOW(),
|
||||
#{createBy})
|
||||
</insert>
|
||||
|
||||
<select id="list" resultType="com.bonus.aqgqj.basis.entity.dto.SamplesManageDto">
|
||||
SELECT ts.id,
|
||||
tc.custom_name as customName,
|
||||
ts.sample_user as sampleUser,
|
||||
ts.sample_time as sampleTime,
|
||||
su.user_name as collectSamplesUser,
|
||||
tsd.create_time as collectSamplesTime,
|
||||
tt.team_name as teamName
|
||||
FROM tb_sample ts
|
||||
LEFT JOIN tb_custom tc
|
||||
on tc.id = ts.custom_id
|
||||
LEFT JOIN tb_sample_device tsd on tsd.sample_id = ts.id
|
||||
LEFT JOIN sys_user su on su.id = tsd.create_user
|
||||
LEFT JOIN tb_team tt on tt.id = ts.team_id
|
||||
WHERE ts.del_flag = '0'
|
||||
<if test="collectSamplesUser != null and collectSamplesUser != ''">
|
||||
AND su.user_name like concat('%', #{collectSamplesUser}, '%')
|
||||
</if>
|
||||
<if test="sampleTools != null and sampleTools != ''">
|
||||
and tsd.dev_type_name like concat('%',#{sampleTools}, '%')
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
ts.sample_user like concat('%', #{keyWord}, '%') OR
|
||||
tc.custom_name like concat('%', #{keyWord}, '%') OR
|
||||
tt.team_name like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY ts.id
|
||||
</select>
|
||||
<select id="getSampleTools" resultType="java.lang.String">
|
||||
SELECT GROUP_CONCAT(aa.dev_type_name SEPARATOR '、') AS sampleTools
|
||||
FROM (SELECT DISTINCT tsd.dev_type_name
|
||||
FROM tb_sample_device tsd
|
||||
LEFT JOIN tb_sample ts ON ts.id = tsd.sample_id
|
||||
WHERE tsd.sample_id = #{id}
|
||||
AND tsd.del_falg = '0') aa
|
||||
</select>
|
||||
<select id="getDetailsList" resultType="com.bonus.aqgqj.basis.entity.dto.SamplesManageDto">
|
||||
select
|
||||
tsd.id,
|
||||
tsd.dev_type_name as sampleTools,
|
||||
tsd.dev_type_code as devTypeCode,
|
||||
tsd.dev_code as devCode,
|
||||
tsd.dev_module as devModule,
|
||||
tc.custom_name as customName
|
||||
from
|
||||
tb_sample_device tsd
|
||||
LEFT JOIN tb_sample ts on tsd.sample_id=ts.id
|
||||
LEFT JOIN tb_custom tc on tc.id=ts.custom_id
|
||||
where tsd.del_falg = 0
|
||||
and tsd.sample_id = #{id}
|
||||
<if test="sampleTools != null and sampleTools != ''">
|
||||
and tsd.dev_type_name like concat('%',#{sampleTools}, '%')
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
tsd.dev_code like concat('%', #{keyWord}, '%') OR
|
||||
tsd.dev_type_code like concat('%', #{keyWord}, '%') OR
|
||||
tsd.dev_module like concat('%', #{keyWord}, '%') OR
|
||||
tc.custom_name like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
<select id="listTools" resultType="com.bonus.aqgqj.basis.entity.dto.SamplesManageDto">
|
||||
select
|
||||
id,
|
||||
dict_name as name
|
||||
from
|
||||
sys_distinct
|
||||
where
|
||||
p_id = 92
|
||||
and del_flag = 0
|
||||
</select>
|
||||
<select id="getAllCustomName" resultType="com.bonus.aqgqj.basis.entity.dto.SamplesManageDto">
|
||||
SELECT
|
||||
id,
|
||||
custom_name AS name
|
||||
FROM
|
||||
tb_custom
|
||||
WHERE
|
||||
del_flag = 0
|
||||
and custom_status=0
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,245 @@
|
|||
let form, layer,laydate, table, tableIns;
|
||||
let pageNum = 1, limitSize = 10; // 默认第一页,分页数量为10
|
||||
let orgData,selectOrgId;
|
||||
let idParam;
|
||||
let listData=[];
|
||||
|
||||
function setParams(params) {
|
||||
idParam = JSON.parse(params).id;
|
||||
layui.use(['form', 'layer', 'table', 'laydate'], function () {
|
||||
form = layui.form;
|
||||
layer = layui.layer;
|
||||
laydate = layui.laydate;
|
||||
table = layui.table;
|
||||
layui.form.render();
|
||||
getCustomNameSelected();
|
||||
getToolsSelected();
|
||||
initTable(listData)
|
||||
laydate.render({
|
||||
elem: '#sampleTime',
|
||||
type: 'datetime',
|
||||
fullPanel: true
|
||||
});
|
||||
|
||||
form.on('submit(formData)', function (data) {
|
||||
console.log("data123456:",data)
|
||||
console.log($('#sampleTime').val())
|
||||
pages(data.field)
|
||||
$('#devTypeCode').val('')
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据处理
|
||||
* @param data
|
||||
*/
|
||||
function pages(data) {
|
||||
var customNameValue =$('#customName').val()
|
||||
// 2. 查找对应的选项文本
|
||||
var selectedText = $('#customName option[value="' + customNameValue + '"]').text();
|
||||
|
||||
var sampleToolsValue =$('#sampleTools').val()
|
||||
// 2. 查找对应的选项文本
|
||||
var sampleToolsText = $('#sampleTools option[value="' + sampleToolsValue + '"]').text();
|
||||
|
||||
// 向数组中添加数据
|
||||
listData.push({
|
||||
customId: data.customName,
|
||||
customName: selectedText,
|
||||
sampleDepartment: data.sampleDepartment,
|
||||
sampleUser: data.sampleUser,
|
||||
sampleTime: $('#sampleTime').val(),
|
||||
sampleToolsId: data.sampleTools,
|
||||
sampleTools: sampleToolsText,
|
||||
devModule: data.devModule,
|
||||
devTypeCode: data.devTypeCode
|
||||
});
|
||||
console.log("listData:",listData)
|
||||
//启用/禁用控件
|
||||
enableDisableControl();
|
||||
|
||||
initTable(listData)
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用/禁用控件
|
||||
* 判断列表是否为空,不为空的话,将控件设置为不可点击
|
||||
*/
|
||||
function enableDisableControl() {
|
||||
if (listData.length > 0) {
|
||||
$('#customName').prop('disabled', true);
|
||||
$('#sampleTools').prop('disabled', true);
|
||||
form.render();
|
||||
$('#sampleDepartment').prop('disabled', true);
|
||||
$('#sampleUser').prop('disabled', true);
|
||||
$('#sampleTime').prop('disabled', true);
|
||||
$('#devModule').prop('disabled', true);
|
||||
} else {
|
||||
$('#customName').prop('disabled', false);
|
||||
$('#sampleTools').prop('disabled', false);
|
||||
form.render();
|
||||
$('#sampleDepartment').prop('disabled', false);
|
||||
$('#sampleUser').prop('disabled', false);
|
||||
$('#sampleTime').prop('disabled', false);
|
||||
$('#devModule').prop('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单位数据
|
||||
*/
|
||||
function getCustomNameSelected() {
|
||||
let url = dataUrl + '/samples/allCustomName';
|
||||
ajaxRequest(url, "POST", null, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
setSelectValue(result.data, 'customName');
|
||||
// return result.data
|
||||
} else {
|
||||
layer.alert(result.msg, {icon: 2})
|
||||
}
|
||||
}, function (xhr) {
|
||||
error(xhr)
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备类型数据
|
||||
*/
|
||||
function getToolsSelected() {
|
||||
let url = dataUrl + '/tools/all';
|
||||
ajaxRequest(url, "POST", null, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
setSelectValue(result.data, 'sampleTools');
|
||||
// return result.data
|
||||
} else {
|
||||
layer.alert(result.msg, {icon: 2})
|
||||
}
|
||||
}, function (xhr) {
|
||||
error(xhr)
|
||||
});
|
||||
}
|
||||
|
||||
/*初始化表格*/
|
||||
function initTable(dataList) {
|
||||
tableIns = table.render({
|
||||
elem: "#table_data",
|
||||
height: "full-130",
|
||||
data: dataList,
|
||||
cols: [
|
||||
[
|
||||
//表头
|
||||
{type: 'numbers', title: '序号', width: '10%', align: 'center'},
|
||||
{field: "sampleTools",width: '25%', title: "设备类型", unresize: true, align: "center"},
|
||||
{field: "devTypeCode", width: '25%', title: "设备编号", unresize: true, align: "center"},
|
||||
{field: "sampleTime", width: '30%', title: "收样时间", unresize: true, align: "center"},
|
||||
{
|
||||
field: "view1",width: '10%', title: "操作", unresize: true, align: "center",
|
||||
templet: function (d) {
|
||||
return '<a href="#" style="color: blue;" onclick="handleClick1(\'' + (d.LAY_INDEX-1) + '\')">删除</a>';
|
||||
}
|
||||
},
|
||||
],
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
function handleClick1(index) {
|
||||
console.log(index)
|
||||
// 根据行索引删除 listData 中对应的数据
|
||||
listData.splice(index, 1);
|
||||
|
||||
// 更新表格
|
||||
initTable(listData);
|
||||
|
||||
//启用/禁用控件
|
||||
enableDisableControl();
|
||||
}
|
||||
|
||||
// 获取参数
|
||||
function getReqParams(page, limit, type) {
|
||||
var selectedValue =$('#sampleTools').val()
|
||||
// 2. 查找对应的选项文本
|
||||
var selectedText = $('#sampleTools option[value="' + selectedValue + '"]').text();
|
||||
if (selectedText=='请选择'){
|
||||
selectedText=''
|
||||
}
|
||||
let obj = {};
|
||||
if (!type) {
|
||||
obj = {
|
||||
page: page + "",
|
||||
limit: limit + "",
|
||||
id: idParam,
|
||||
sampleTools: selectedText,
|
||||
keyWord:$('#keyWord').val()
|
||||
};
|
||||
} else {
|
||||
obj = {
|
||||
page: '1',
|
||||
limit: '10',
|
||||
id: idParam,
|
||||
sampleTools: selectedText,
|
||||
keyWord: ''
|
||||
};
|
||||
}
|
||||
console.log(obj)
|
||||
obj={
|
||||
encryptedData:encryptCBC(JSON.stringify(obj))
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传数据
|
||||
*/
|
||||
function uploadData() {
|
||||
if (listData.length == 0) {
|
||||
return layer.msg('请先添加数据', {
|
||||
icon: 2,
|
||||
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
||||
});
|
||||
}
|
||||
let loadingMsg = layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0});
|
||||
let url = dataUrl + '/samples/addSamples';
|
||||
let params = {
|
||||
"paramsList": listData
|
||||
}
|
||||
params={
|
||||
encryptedData:encryptCBC(JSON.stringify(params))
|
||||
}
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
}, function (result) {
|
||||
layer.close(loadingMsg); // 关闭提示层
|
||||
if (result.code === 200) {
|
||||
closePage(1);
|
||||
parent.layer.msg("收样信息添加成功", {icon: 1});
|
||||
}else {
|
||||
layer.alert(result.msg, {icon: 2})
|
||||
}
|
||||
}, function (xhr) {
|
||||
layer.close(loadingMsg); // 关闭提示层
|
||||
error(xhr)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/*下拉选表单赋值*/
|
||||
function setSelectValue(list, selectName) {
|
||||
console.log("list",list)
|
||||
let html = '<option value="" selected>请选择</option>';
|
||||
$.each(list, function (index, item) {
|
||||
html += '<option value="' + item.id + '">' + item.name + '</option>';
|
||||
})
|
||||
$('#' + selectName).empty().append(html);
|
||||
layui.form.render();
|
||||
}
|
||||
|
||||
function closePage(type) {
|
||||
let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
|
||||
parent.layer.close(index); //再执行关闭
|
||||
if (type === 1) {
|
||||
parent.reloadData()
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,272 @@
|
|||
let form, layer, table, tableIns;
|
||||
let pageNum = 1, limitSize = 10; // 默认第一页,分页数量为10
|
||||
let orgData,selectOrgId;
|
||||
let idParam;
|
||||
|
||||
function setParams(params){
|
||||
idParam = JSON.parse(params).id;
|
||||
layui.use(['form', 'layer', 'table', 'laydate'], function () {
|
||||
form = layui.form;
|
||||
layer = layui.layer;
|
||||
table = layui.table;
|
||||
layui.form.render();
|
||||
pages(1, 10, 1);
|
||||
getToolsSelected();
|
||||
})
|
||||
}
|
||||
|
||||
function pages(pageNum, pageSize, typeNum) {
|
||||
let params = getReqParams(pageNum, pageSize, typeNum);
|
||||
let url = dataUrl + "/samples/getDetailsList"
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
}, function (result) {
|
||||
console.log(result);
|
||||
if (result.code === 200) {
|
||||
if (result.data) {
|
||||
initTable(result.data, result.limit, result.curr)
|
||||
laypages(result.count, result.curr, result.limit)
|
||||
}
|
||||
} else if (result.code === 500) {
|
||||
layer.alert(result.msg, {icon: 2})
|
||||
}
|
||||
}, function (xhr) {
|
||||
error(xhr)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function getToolsSelected() {
|
||||
let url = dataUrl + '/samples/all';
|
||||
ajaxRequest(url, "POST", null, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
setSelectValue(result.data, 'sampleTools');
|
||||
// return result.data
|
||||
} else {
|
||||
layer.alert(result.msg, {icon: 2})
|
||||
}
|
||||
}, function (xhr) {
|
||||
error(xhr)
|
||||
});
|
||||
}
|
||||
|
||||
function laypages(total, page, limit) {
|
||||
layui.use(['laypage'], function () {
|
||||
let laypage = layui.laypage;
|
||||
laypage.render({
|
||||
elem: 'voi-page',
|
||||
count: total,
|
||||
curr: page,
|
||||
limit: limit,
|
||||
limits: [10, 20, 50, 100, 200, 500],
|
||||
layout: ['prev', 'page', 'next', 'skip', 'count', 'limit'],
|
||||
groups: 5,
|
||||
jump: function (obj, first) {
|
||||
if (!first) {
|
||||
pageNum = obj.curr, limitSize = obj.limit;
|
||||
pages(obj.curr, obj.limit, null);
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/*初始化表格*/
|
||||
function initTable(dataList, limit, page) {
|
||||
let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,});
|
||||
tableIns = table.render({
|
||||
elem: "#table_data",
|
||||
height: "full-130",
|
||||
data: dataList,
|
||||
limit: limit,
|
||||
cols: [
|
||||
[
|
||||
//表头
|
||||
{title: "序号", width: 80, unresize: true, align: "center",
|
||||
templet: function (d) {
|
||||
return (page - 1) * limit + d.LAY_INDEX;
|
||||
}
|
||||
},
|
||||
{field: "sampleTools", title: "设备类型", unresize: true, align: "center"},
|
||||
{field: "devTypeCode", title: "设备编号", unresize: true, align: "center"},
|
||||
{field: "devCode", title: "客户自编号", unresize: true, align: "center"},
|
||||
{field: "devModule", title: "规格型号", unresize: true, align: "center"},
|
||||
{field: "customName", title: "送检部门", unresize: true, align: "center"},
|
||||
{field: "experCycle", title: "试验周期", unresize: true, align: "center"},
|
||||
{field: "experPrice", title: "试验单价(元)", unresize: true, align: "center"},
|
||||
{
|
||||
field: "view1", title: "收样标签", unresize: true, align: "center",
|
||||
templet: function (d) {
|
||||
return '<a href="#" style="color: blue;" onclick="handleClick1(\'' + d.id + '\')">打印</a>';
|
||||
}
|
||||
},
|
||||
],
|
||||
],
|
||||
done: function (res, curr, count) {
|
||||
layer.close(loadingMsg);
|
||||
table.resize("table_data");
|
||||
count || this.elem.next(".layui-table-view").find(".layui-table-header").css("display", "inline-block");
|
||||
count || this.elem.next(".layui-table-view").find(".layui-table-box").css("overflow", "auto");
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleClick1(view1) {
|
||||
alert('Clicked on: ' + view1);
|
||||
}
|
||||
|
||||
function handleClick2(view1) {
|
||||
alert('Clicked on: ' + view1);
|
||||
}
|
||||
|
||||
function handleClick3(view1) {
|
||||
alert('Clicked on: ' + view1);
|
||||
}
|
||||
|
||||
// 获取参数
|
||||
function getReqParams(page, limit, type) {
|
||||
var selectedValue =$('#sampleTools').val()
|
||||
// 2. 查找对应的选项文本
|
||||
var selectedText = $('#sampleTools option[value="' + selectedValue + '"]').text();
|
||||
if (selectedText=='请选择设备类型'){
|
||||
selectedText=''
|
||||
}
|
||||
let obj = {};
|
||||
if (!type) {
|
||||
obj = {
|
||||
page: page + "",
|
||||
limit: limit + "",
|
||||
id: idParam,
|
||||
sampleTools: selectedText,
|
||||
keyWord:$('#keyWord').val()
|
||||
};
|
||||
} else {
|
||||
obj = {
|
||||
page: '1',
|
||||
limit: '10',
|
||||
id: idParam,
|
||||
sampleTools: selectedText,
|
||||
keyWord: ''
|
||||
};
|
||||
}
|
||||
console.log(obj)
|
||||
obj={
|
||||
encryptedData:encryptCBC(JSON.stringify(obj))
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
// 查询/重置
|
||||
function query() {
|
||||
let pattern = new RegExp("[%_<>]");
|
||||
if (pattern.test($("#loginName").val())) {
|
||||
$("#loginName").val('');
|
||||
return layer.msg('用户名查询包含特殊字符,请重新输入', {
|
||||
icon: 2,
|
||||
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
||||
});
|
||||
}
|
||||
if (pattern.test($("#phone").val())) {
|
||||
$("#phone").val('');
|
||||
return layer.msg('手机号查询包含特殊字符,请重新输入', {
|
||||
icon: 2,
|
||||
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
||||
});
|
||||
}
|
||||
pageNum = 1;
|
||||
pages(1, limitSize);
|
||||
}
|
||||
|
||||
|
||||
//重置
|
||||
function reset() {
|
||||
pages(1, limitSize, 1)
|
||||
}
|
||||
|
||||
|
||||
function reloadData() {
|
||||
pages(pageNum, limitSize);
|
||||
}
|
||||
|
||||
// 新增/修改平台用户
|
||||
function addData(id) {
|
||||
if (id) {
|
||||
title = '详情';
|
||||
}
|
||||
let param = {
|
||||
'id': id
|
||||
}
|
||||
openIframe2("addOrEditUser", title, "child/toolsFrom.html", '100%', '100%', param);
|
||||
}
|
||||
|
||||
/*删除用户*/
|
||||
function delData(id) {
|
||||
layer.confirm("确定删除吗?", {
|
||||
move: false
|
||||
}, function () {
|
||||
let loadingMsg = layer.msg('数据删除中,请稍候...', {icon: 16, scrollbar: false, time: 0});
|
||||
let url = dataUrl + "/users/delById";
|
||||
let params = {
|
||||
'id': id
|
||||
}
|
||||
params={
|
||||
encryptedData:encryptCBC(JSON.stringify(params))
|
||||
}
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
}, function (result) {
|
||||
layer.close(loadingMsg); // 关闭提示层
|
||||
if (result.code === 200) {
|
||||
parent.layer.msg(result.msg, {icon: 1})
|
||||
query()
|
||||
} else if (result.code === 500) {
|
||||
layer.alert(result.msg, {icon: 2})
|
||||
}
|
||||
}, function (xhr) {
|
||||
layer.close(loadingMsg); // 关闭提示层
|
||||
error(xhr)
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
// 启用/停用/解除锁定
|
||||
function editUserAccountStatus(id, status, type) {
|
||||
let url = dataUrl + "/sys/user/editUserAccountStatus?token=" + token;
|
||||
let params = {
|
||||
'id': id,
|
||||
'accountStatus': status,
|
||||
'type': type
|
||||
}
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
if(type){
|
||||
reloadData();
|
||||
}
|
||||
parent.layer.msg(result.msg, {icon: 1})
|
||||
} else if (result.code === 500) {
|
||||
layer.alert(result.msg, {icon: 2})
|
||||
}
|
||||
}, function (xhr) {
|
||||
error(xhr)
|
||||
});
|
||||
}
|
||||
|
||||
// 管理员修改密码
|
||||
function resetPwd(id) {
|
||||
let param = {
|
||||
'id': id,
|
||||
'type': '1'
|
||||
}
|
||||
openIframe2("addOrEditUnifyUser", '修改密码', "password.html", '770px', '400px', param);
|
||||
}
|
||||
|
||||
/*下拉选表单赋值*/
|
||||
function setSelectValue(list, selectName) {
|
||||
console.log("list",list)
|
||||
let html = '<option value="" selected>请选择设备类型</option>';
|
||||
$.each(list, function (index, item) {
|
||||
html += '<option value="' + item.id + '">' + item.name + '</option>';
|
||||
})
|
||||
$('#' + selectName).empty().append(html);
|
||||
layui.form.render();
|
||||
}
|
||||
|
|
@ -0,0 +1,247 @@
|
|||
let form, layer, table, tableIns;
|
||||
let pageNum = 1, limitSize = 10; // 默认第一页,分页数量为10
|
||||
let orgData,selectOrgId;
|
||||
|
||||
layui.use(['form', 'layer', 'table', 'laydate'], function () {
|
||||
form = layui.form;
|
||||
layer = layui.layer;
|
||||
table = layui.table;
|
||||
layui.form.render();
|
||||
pages(1, 10, 1);
|
||||
getToolsSelected();
|
||||
})
|
||||
|
||||
|
||||
function getToolsSelected() {
|
||||
let url = dataUrl + '/tools/all';
|
||||
ajaxRequest(url, "POST", null, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
setSelectValue(result.data, 'sampleTools');
|
||||
// return result.data
|
||||
} else {
|
||||
layer.alert(result.msg, {icon: 2})
|
||||
}
|
||||
}, function (xhr) {
|
||||
error(xhr)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function pages(pageNum, pageSize, typeNum) {
|
||||
let params = getReqParams(pageNum, pageSize, typeNum);
|
||||
let url = dataUrl + "/samples/getList"
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
}, function (result) {
|
||||
console.log("result.data:",result.data);
|
||||
if (result.code === 200) {
|
||||
if (result.data) {
|
||||
initTable(result.data, result.limit, result.curr)
|
||||
laypages(result.count, result.curr, result.limit)
|
||||
}
|
||||
} else if (result.code === 500) {
|
||||
layer.alert(result.msg, {icon: 2})
|
||||
}
|
||||
}, function (xhr) {
|
||||
error(xhr)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function laypages(total, page, limit) {
|
||||
layui.use(['laypage'], function () {
|
||||
let laypage = layui.laypage;
|
||||
laypage.render({
|
||||
elem: 'voi-page',
|
||||
count: total,
|
||||
curr: page,
|
||||
limit: limit,
|
||||
limits: [10, 20, 50, 100, 200, 500],
|
||||
layout: ['prev', 'page', 'next', 'skip', 'count', 'limit'],
|
||||
groups: 5,
|
||||
jump: function (obj, first) {
|
||||
if (!first) {
|
||||
pageNum = obj.curr, limitSize = obj.limit;
|
||||
pages(obj.curr, obj.limit, null);
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/*初始化表格*/
|
||||
function initTable(dataList, limit, page) {
|
||||
let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,});
|
||||
tableIns = table.render({
|
||||
elem: "#table_data",
|
||||
height: "full-130",
|
||||
data: dataList,
|
||||
limit: limit,
|
||||
cols: [
|
||||
[
|
||||
//表头
|
||||
{title: "序号", width: 80, unresize: true, align: "center",
|
||||
templet: function (d) {
|
||||
return (page - 1) * limit + d.LAY_INDEX;
|
||||
}
|
||||
},
|
||||
{field: "customName", title: "送样单位", unresize: true, align: "center"},
|
||||
{field: "sampleUser", title: "送样人", unresize: true, align: "center"},
|
||||
{field: "sampleTime", title: "送样时间", unresize: true, align: "center"},
|
||||
{field: "sampleTools", title: "送样设备", unresize: true, align: "center"},
|
||||
{field: "collectSamplesUser", title: "收样人", unresize: true, align: "center"},
|
||||
{field: "collectSamplesTime", title: "收样时间", unresize: true, align: "center"},
|
||||
{
|
||||
field: "teamName", title: "试验班组", unresize: true, align: "center", templet: function (d) {
|
||||
let html = '';
|
||||
let view ='';
|
||||
if (d.teamName == null) {
|
||||
view="<a style='cursor:pointer; background: #F2F3FF'' >未派工</a>";
|
||||
} else {
|
||||
view="<a style='color: black;'>" + d.teamName + "</a>";
|
||||
}
|
||||
html=view;
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{title: "操作", unresize: true, width: 85, align: "center",
|
||||
templet: function (d) {
|
||||
|
||||
let html = '';
|
||||
let view="<a style='cursor:pointer;' onclick=\"addData('" + d.id + "')\">详情</a>";
|
||||
html=view;
|
||||
if(d.delFlag==1){
|
||||
return '';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
},
|
||||
],
|
||||
],
|
||||
done: function (res, curr, count) {
|
||||
layer.close(loadingMsg);
|
||||
table.resize("table_data");
|
||||
count || this.elem.next(".layui-table-view").find(".layui-table-header").css("display", "inline-block");
|
||||
count || this.elem.next(".layui-table-view").find(".layui-table-box").css("overflow", "auto");
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleClick1(sampleTools,devModule,devCode,experTime,nextExperTime,experUser,experConclu,customName) {
|
||||
title = '合格证';
|
||||
let param = {
|
||||
'sampleTools' : sampleTools,
|
||||
'devModule' : devModule,
|
||||
'devCode' : devCode,
|
||||
'experTime' : experTime,
|
||||
'nextExperTime' : nextExperTime,
|
||||
'experUser': experUser,
|
||||
'experConclu': experConclu,
|
||||
'customName': customName
|
||||
}
|
||||
openIframe2("addOrEditUser", title, "child/certificateView.html", '30%', '70%', param);
|
||||
}
|
||||
|
||||
function handleClick2(view1) {
|
||||
alert('Clicked on: ' + view1);
|
||||
}
|
||||
|
||||
|
||||
// 获取参数
|
||||
function getReqParams(page, limit, type) {
|
||||
var selectedValue =$('#sampleTools').val()
|
||||
// 2. 查找对应的选项文本
|
||||
var selectedText = $('#sampleTools option[value="' + selectedValue + '"]').text();
|
||||
if (selectedText=='请选择设备类型'){
|
||||
selectedText=''
|
||||
}
|
||||
let obj = {};
|
||||
if (!type) {
|
||||
obj = {
|
||||
page: page + "",
|
||||
limit: limit + "",
|
||||
sampleTools: selectedText,
|
||||
collectSamplesUser:$('#collectSamplesUser').val(),
|
||||
keyWord:$('#keyWord').val()
|
||||
};
|
||||
} else {
|
||||
obj = {
|
||||
page: '1',
|
||||
limit: '10',
|
||||
sampleTools: '',
|
||||
collectSamplesUser: '',
|
||||
keyWord: ''
|
||||
};
|
||||
}
|
||||
console.log(obj)
|
||||
obj={
|
||||
encryptedData:encryptCBC(JSON.stringify(obj))
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
// 查询/重置
|
||||
function query() {
|
||||
let pattern = new RegExp("[%_<>]");
|
||||
if (pattern.test($("#loginName").val())) {
|
||||
$("#loginName").val('');
|
||||
return layer.msg('用户名查询包含特殊字符,请重新输入', {
|
||||
icon: 2,
|
||||
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
||||
});
|
||||
}
|
||||
if (pattern.test($("#phone").val())) {
|
||||
$("#phone").val('');
|
||||
return layer.msg('手机号查询包含特殊字符,请重新输入', {
|
||||
icon: 2,
|
||||
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
||||
});
|
||||
}
|
||||
pageNum = 1;
|
||||
pages(1, limitSize);
|
||||
}
|
||||
|
||||
|
||||
//重置
|
||||
function reset() {
|
||||
pages(1, limitSize, 1)
|
||||
}
|
||||
|
||||
|
||||
function reloadData() {
|
||||
pages(pageNum, limitSize);
|
||||
}
|
||||
|
||||
// 新增/修改平台用户
|
||||
function addData(id) {
|
||||
if (id) {
|
||||
title = '收样管理/详情';
|
||||
}
|
||||
let param = {
|
||||
'id': id
|
||||
}
|
||||
openIframe2("addOrEditUser", title, "child/samplesForm.html", '100%', '100%', param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 收样
|
||||
*/
|
||||
function collectSamples(id) {
|
||||
title = '收样';
|
||||
let param = {
|
||||
'id': id
|
||||
}
|
||||
openIframe2("addOrEditUser", title, "child/samplesAdd.html", '70%', '90%', param);
|
||||
}
|
||||
|
||||
|
||||
/*下拉选表单赋值*/
|
||||
function setSelectValue(list, selectName) {
|
||||
console.log("list",list)
|
||||
let html = '<option value="" selected>请选择设备类型</option>';
|
||||
$.each(list, function (index, item) {
|
||||
html += '<option value="' + item.id + '">' + item.name + '</option>';
|
||||
})
|
||||
$('#' + selectName).empty().append(html);
|
||||
layui.form.render();
|
||||
}
|
||||
|
|
@ -1,16 +1,15 @@
|
|||
|
||||
function setParams(params){
|
||||
var data=JSON.parse(params);
|
||||
console.log("data",data);
|
||||
//给控件赋值
|
||||
document.getElementById('sampleTools').textContent = data.sampleTools;
|
||||
document.getElementById('devModule').textContent = data.devModule;
|
||||
document.getElementById('devCode').textContent = data.devCode;
|
||||
document.getElementById('experTime').textContent = data.experTime;
|
||||
document.getElementById('nextExperTime').textContent = data.nextExperTime;
|
||||
document.getElementById('experUser').textContent = data.experUser;
|
||||
document.getElementById('experConclu').textContent = data.experConclu;
|
||||
document.getElementById('customName').textContent = data.customName;
|
||||
document.getElementById('sampleTools').textContent = data.sampleTools === "null" || data.sampleTools === undefined ? '' : data.sampleTools;
|
||||
document.getElementById('devModule').textContent = data.devModule === "null" || data.devModule === undefined ? '' : data.devModule;
|
||||
document.getElementById('devCode').textContent = data.devCode === "null" || data.devCode === undefined ? '' : data.devCode;
|
||||
document.getElementById('experTime').textContent = data.experTime === "null" || data.experTime === undefined ? '' : data.experTime;
|
||||
document.getElementById('nextExperTime').textContent = data.nextExperTime === "null" || data.nextExperTime === undefined ? '' : data.nextExperTime;
|
||||
document.getElementById('experUser').textContent = data.experUser === "null" || data.experUser === undefined ? '' : data.experUser;
|
||||
document.getElementById('experConclu').textContent = data.experConclu === "null" || data.experConclu === undefined ? '' : data.experConclu;
|
||||
document.getElementById('customName').textContent = data.customName === "null" || data.customName === undefined ? '' : data.customName;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,8 +86,8 @@ function initTable(dataList, limit, page) {
|
|||
}
|
||||
},
|
||||
{field: "sampleTools", title: "设备类型", unresize: true, align: "center"},
|
||||
{field: "devCode", title: "设备编号", unresize: true, align: "center"},
|
||||
{field: "devTypeCode", title: "客户自编号", unresize: true, align: "center"},
|
||||
{field: "devTypeCode", title: "设备编号", unresize: true, align: "center"},
|
||||
{field: "devCode", title: "客户自编号", unresize: true, align: "center"},
|
||||
{field: "devModule", title: "设备规格", unresize: true, align: "center"},
|
||||
{field: "customName", title: "送样单位", unresize: true, align: "center"},
|
||||
{field: "sampleDepartment", title: "送样部门", unresize: true, align: "center"},
|
||||
|
|
|
|||
|
|
@ -0,0 +1,137 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="../../../js/layui-v2.6.8/css/layui-v2.8.11.css" media="all">
|
||||
<link rel="stylesheet" href="../../../js/layui-v2.6.8/dtree/dtree.css">
|
||||
<link rel="stylesheet" href="../../../js/layui-v2.6.8/dtree/font/dtreefont.css">
|
||||
<link rel="stylesheet" href="../../../css/table-common2.css">
|
||||
<script src="../../../js/libs/jquery-2.1.1.min.js" charset="UTF-8" type="text/javascript"></script>
|
||||
<script src="../../../js/layui-v2.6.8/layui.js" charset="UTF-8" type="text/javascript"></script>
|
||||
<script src="../../../js/publicJs.js"></script>
|
||||
<script src="../../../js/commonUtils.js"></script>
|
||||
<script src="../../../js/openIframe.js"></script>
|
||||
<script src="../../../js/my/aes.js"></script>
|
||||
<script src="../../../js/ajaxRequest.js"></script>
|
||||
<title>详情</title>
|
||||
<style>
|
||||
.layui-table td {
|
||||
font-size: 14px; /* 调整表格中所有单元格的字体大小 */
|
||||
}
|
||||
.layui-form-item .layui-input-inline {
|
||||
width: 270px !important;
|
||||
}
|
||||
.layui-table thead tr th {
|
||||
font-size: 13px !important;
|
||||
}
|
||||
.layui-form-label {
|
||||
width: 92px !important;
|
||||
}
|
||||
#content {
|
||||
display: flex;
|
||||
align-items: stretch; /* 使分隔线与左右内容的高度相同 */
|
||||
}
|
||||
.left-box {
|
||||
flex: 0.6;
|
||||
display: flex;
|
||||
flex-direction: column; /* 垂直排列 */
|
||||
justify-content: center; /* 垂直居中 */
|
||||
align-items: center; /* 水平居中 */
|
||||
height: 100%; /* 可根据需要调整高度 */
|
||||
}
|
||||
|
||||
.layui-form-item {
|
||||
width: 100%; /* 可根据需要调整,确保宽度适应容器 */
|
||||
text-align: center; /* 水平居中内容(如标签和输入框) */
|
||||
}
|
||||
|
||||
.layui-form-label, .layui-input-inline {
|
||||
display: inline-block; /* 使其在同一行内显示 */
|
||||
}
|
||||
.right-box {
|
||||
flex: 1;
|
||||
/* 右边内容的样式 */
|
||||
}
|
||||
.separator {
|
||||
width: 1px; /* 分隔线的宽度 */
|
||||
background-color: #ccc; /* 分隔线的颜色 */
|
||||
height: 100%; /* 分隔线的高度,与容器高度一致 */
|
||||
margin: 0 10px; /* 分隔线的左右边距 */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content">
|
||||
<div class="basic-search-box layout left-box">
|
||||
<form class="layui-form" onsubmit="return false;">
|
||||
<input hidden id="id">
|
||||
<div class="layui-form-item" style="margin-top: 5%;">
|
||||
<label class="layui-form-label"><i style="padding: 0 10px; color: red;">*</i>送样单位</label>
|
||||
<div class="layui-input-inline">
|
||||
<select id="customName" lay-filter="customName" lay-verify="required" name="customName" class="form-control input-sm">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-top: 5%;">
|
||||
<label class="layui-form-label"><i style="padding: 0 10px; color: red">*</i>送检部门</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" placeholder="请输入内容" id="sampleDepartment" name="sampleDepartment" autocomplete="off"
|
||||
lay-verify="required" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-top: 5%;">
|
||||
<label class="layui-form-label"><i style="padding: 0 10px; color: red;">*</i>送样人</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" placeholder="请输入送样人" id="sampleUser" name="sampleUser" autocomplete="off"
|
||||
lay-verify="required" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-top: 5%;">
|
||||
<label class="layui-form-label"><i style="padding: 0 10px; color: red">*</i>送样时间</label>
|
||||
<div class="layui-input-inline">
|
||||
|
||||
<input type="text" lay-verify="required" id="sampleTime" class="layui-input" autocomplete="off" placeholder="请选择日期">
|
||||
|
||||
<!-- <input class="layui-input" placeholder="请选择日期" id="sampleTime" name="sampleTime" autocomplete="off"-->
|
||||
<!-- lay-verify="required" maxlength="30">-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div style="width: 100%; height: 1px; background-color: #ccc; margin-top: 10%;margin-bottom: 10%;"></div>
|
||||
|
||||
|
||||
<div class="layui-form-item" style="margin-top: 5%;">
|
||||
<label class="layui-form-label"><i style="padding: 0 10px; color: red;">*</i>设备类型</label>
|
||||
<div class="layui-input-inline">
|
||||
<select id="sampleTools" placeholder="请选择" lay-verify="required" name="sampleTools" class="form-control input-sm">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-top: 5%;">
|
||||
<label class="layui-form-label"><i style="padding: 0 10px; color: red">*</i>规格型号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" placeholder="请输入规格型号" id="devModule" name="devModule" autocomplete="off"
|
||||
lay-verify="required" maxlength="30">
|
||||
</div>
|
||||
</div> <div class="layui-form-item" style="margin-top: 5%;">
|
||||
<label class="layui-form-label"><i style="padding: 0 10px; color: red;">*</i>设备编号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" placeholder="请输入设备编号" id="devTypeCode" name="devTypeCode" autocomplete="off"
|
||||
lay-verify="required" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<button style="margin-top: 15%; width: 300px; margin-left: 12%" type="submit" id="formSubmit" class="layui-btn" lay-submit="" lay-filter="formData">确认</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="separator"></div>
|
||||
<div class="table-box right-box" table-responsive style="z-index: 1;">
|
||||
<table id="table_data" class="table" lay-filter="table_data"></table>
|
||||
<!-- <div id="voi-page" class="layout"></div>-->
|
||||
<button style="margin-top: 5%; width: 100px; margin-left: 55%" id="cancel" class="layui-btn" >取消</button>
|
||||
<button style="margin-top: 5%; width: 100px; margin-left: 5%" id="upload" class="layui-btn" onclick="uploadData()" >上传</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../../../js/samples/child/samplesAdd.js" charset="UTF-8" type="text/javascript"></script>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="../../../js/layui-v2.6.8/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="../../../js/layui-v2.6.8/dtree/dtree.css">
|
||||
<link rel="stylesheet" href="../../../js/layui-v2.6.8/dtree/font/dtreefont.css">
|
||||
<link rel="stylesheet" href="../../../css/table-common2.css">
|
||||
<script src="../../../js/libs/jquery-2.1.1.min.js" charset="UTF-8" type="text/javascript"></script>
|
||||
<script src="../../../js/layui-v2.6.8/layui.js" charset="UTF-8" type="text/javascript"></script>
|
||||
<script src="../../../js/publicJs.js"></script>
|
||||
<script src="../../../js/commonUtils.js"></script>
|
||||
<script src="../../../js/openIframe.js"></script>
|
||||
<script src="../../../js/my/aes.js"></script>
|
||||
<script src="../../../js/ajaxRequest.js"></script>
|
||||
<title>详情</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content">
|
||||
<div class="basic-search-box layout">
|
||||
<form class="layui-form basic-form" onsubmit="return false;">
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-inline" style="padding: 0 0 0 10px;">
|
||||
<div class="layui-input-inline">
|
||||
<select id="sampleTools" name="sampleTools" class="form-control input-sm">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline" style="padding: 0 0 0 10px;">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="keyWord" maxlength="30" class="layui-input" autocomplete="off" placeholder="请输入关键字">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-inline btns">
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="query(1)">查询
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="table-box" table-responsive style="z-index: 1;">
|
||||
<table id="table_data" class="table" lay-filter="table_data"></table>
|
||||
<div id="voi-page" class="layout"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../../../js/samples/child/samplesForm.js" charset="UTF-8" type="text/javascript"></script>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="../../js/layui-v2.6.8/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="../../js/layui-v2.6.8/dtree/dtree.css">
|
||||
<link rel="stylesheet" href="../../js/layui-v2.6.8/dtree/font/dtreefont.css">
|
||||
<link rel="stylesheet" href="../../css/table-common2.css">
|
||||
<script src="../../js/libs/jquery-2.1.1.min.js" charset="UTF-8" type="text/javascript"></script>
|
||||
<script src="../../js/layui-v2.6.8/layui.js" charset="UTF-8" type="text/javascript"></script>
|
||||
<script src="../../js/publicJs.js"></script>
|
||||
<script src="../../js/dict.js"></script>
|
||||
<script src="../../js/commonUtils.js"></script>
|
||||
<script src="../../js/openIframe.js"></script>
|
||||
<script src="../../js/my/aes.js"></script>
|
||||
<script src="../../js/ajaxRequest.js"></script>
|
||||
<title>收样管理</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content">
|
||||
<div class="basic-search-box layout">
|
||||
<form class="layui-form basic-form" onsubmit="return false;">
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-inline" style="padding: 0 0 0 10px;">
|
||||
<div class="layui-input-inline">
|
||||
<select id="sampleTools" name="sampleTools" class="form-control input-sm">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline" style="padding: 0 0 0 10px;">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="collectSamplesUser" maxlength="30" class="layui-input" autocomplete="off" placeholder="请输入收样人">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline" style="padding: 0 0 0 10px;">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="keyWord" maxlength="30" class="layui-input" autocomplete="off" placeholder="请输入关键字">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-inline btns">
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="query(1)">查询
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline btns">
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="dispatch()">派工
|
||||
</button>
|
||||
</div>
|
||||
<div class="layui-inline btns">
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="collectSamples()">收样
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="table-box" table-responsive style="z-index: 1;">
|
||||
<table id="table_data" class="table" lay-filter="table_data"></table>
|
||||
<div id="voi-page" class="layout"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<style>
|
||||
.layui-table-init {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script src="../../js/samples/samplesMge.js" charset="UTF-8" type="text/javascript"></script>
|
||||
</html>
|
||||
Loading…
Reference in New Issue