检测报告管理
This commit is contained in:
parent
c3fc2a211f
commit
37ee96565a
|
|
@ -4,6 +4,7 @@ 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.entity.dto.ToolsManageDto;
|
||||
import com.bonus.aqgqj.basis.service.SamplesManageService;
|
||||
import com.bonus.aqgqj.basis.service.ToolsManageService;
|
||||
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
||||
|
|
@ -100,7 +101,7 @@ public class SamplesManageController {
|
|||
* @description 新增收样数据
|
||||
*/
|
||||
@PostMapping("addSamples")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageDto.class)//加解密统一管理
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageDto.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "新增收样数据", operDesc = "业务级事件", operType = "新增")
|
||||
@PreAuthorize("@pms.hasPermission('sys:samples:add')")
|
||||
public ServerResponse addSamples(EncryptedReq<SamplesManageDto> vo) {
|
||||
|
|
@ -141,5 +142,19 @@ public class SamplesManageController {
|
|||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = "getDeptSelectedById")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageDto.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "根据单位id获取部门", operDesc = "业务级事件",operType="查询")
|
||||
@PreAuthorize("@pms.hasPermission('sys:tools:query')" )
|
||||
public ServerResponse getDeptSelectedById(EncryptedReq<SamplesManageDto> data) {
|
||||
try {
|
||||
List<SamplesManageDto> list = samplesManageService.getDeptSelectedById(data.getData());
|
||||
return ServerResponse.createSuccess(list);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.aqgqj.basis.dao;
|
||||
|
||||
import com.bonus.aqgqj.basis.entity.dto.SamplesManageDto;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ToolsManageDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -81,4 +82,11 @@ public interface SamplesManageDao {
|
|||
* @return
|
||||
*/
|
||||
int updateTeamId(SamplesManageDto dto);
|
||||
|
||||
/**
|
||||
* 获取部门
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<SamplesManageDto> getDeptSelectedById(SamplesManageDto data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,4 +81,18 @@ public interface TestReportManageDao {
|
|||
* @return
|
||||
*/
|
||||
int updateTeamId(TestReportManageDto dto);
|
||||
|
||||
/**
|
||||
* 获取当前年月 报告编号
|
||||
* @param nowDate
|
||||
* @return
|
||||
*/
|
||||
String getReportCode(String nowDate);
|
||||
|
||||
/**
|
||||
* 修改报告编号
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int updateReportCode(TestReportManageDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,11 @@ public class SamplesManageDto extends PageEntity {
|
|||
*/
|
||||
private String customName;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
private Integer departmentId;
|
||||
|
||||
/**
|
||||
* 送样部门
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -148,5 +148,21 @@ public class TestReportManageDto extends PageEntity {
|
|||
*/
|
||||
private Integer devNum;
|
||||
|
||||
/**
|
||||
* 报告编号
|
||||
*/
|
||||
private String reportCode;
|
||||
|
||||
/**
|
||||
* 是否合格
|
||||
*/
|
||||
private String isHg;
|
||||
|
||||
/**
|
||||
* 检测时间
|
||||
*/
|
||||
private String detectionTime;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.aqgqj.basis.service;
|
||||
|
||||
import com.bonus.aqgqj.basis.entity.dto.SamplesManageDto;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ToolsManageDto;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -55,4 +56,11 @@ public interface SamplesManageService {
|
|||
* @return
|
||||
*/
|
||||
ServerResponse dispatchWork(SamplesManageDto data);
|
||||
|
||||
/**
|
||||
* 根据单位Id获取部门列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<SamplesManageDto> getDeptSelectedById(SamplesManageDto data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ 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.entity.dto.ToolsManageDto;
|
||||
import com.bonus.aqgqj.basis.service.SamplesManageService;
|
||||
import com.bonus.aqgqj.basis.service.ToolsManageService;
|
||||
import com.bonus.aqgqj.utils.DateTimeHelper;
|
||||
|
|
@ -121,6 +122,15 @@ public class SamplesManageServiceImpl implements SamplesManageService {
|
|||
return samplesManageDao.getTeamSelected();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单位Id获取部门列表
|
||||
*/
|
||||
@Override
|
||||
public List<SamplesManageDto> getDeptSelectedById(SamplesManageDto data) {
|
||||
List<SamplesManageDto> list = samplesManageDao.getDeptSelectedById(data);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ServerResponse dispatchWork(SamplesManageDto data) {
|
||||
|
|
|
|||
|
|
@ -38,10 +38,10 @@ public class TestReportManageServiceImpl implements TestReportManageService {
|
|||
@Override
|
||||
public List<TestReportManageDto> list(TestReportManageDto bean) {
|
||||
List<TestReportManageDto> list = testReportManageDao.list(bean);
|
||||
for (TestReportManageDto dto : list){
|
||||
String sampleTools = testReportManageDao.getSampleTools(dto.getId());
|
||||
dto.setSampleTools(sampleTools);
|
||||
}
|
||||
// for (TestReportManageDto dto : list){
|
||||
// String sampleTools = testReportManageDao.getSampleTools(dto.getId());
|
||||
// dto.setSampleTools(sampleTools);
|
||||
// }
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
@ -52,7 +52,49 @@ public class TestReportManageServiceImpl implements TestReportManageService {
|
|||
*/
|
||||
@Override
|
||||
public List<TestReportManageDto> getDetailsList(TestReportManageDto data) {
|
||||
return testReportManageDao.getDetailsList(data);
|
||||
List<TestReportManageDto> list = testReportManageDao.getDetailsList(data);
|
||||
//如果没有报告编号,需要生成报告编号
|
||||
for (TestReportManageDto dto : list){
|
||||
if (StringHelper.isEmpty(dto.getReportCode())){
|
||||
//生成报告编号
|
||||
String reportCode = generateReportCode(dto);
|
||||
dto.setReportCode(reportCode);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成报告编号
|
||||
* 报告编号生成规则:ML/BG-YYYY-MMNNN-DD-QQ
|
||||
* ML/BG:明丽/报告
|
||||
* YYYY:年份(4位数字),表示报告生成的年份
|
||||
* MM:月份(2位数字),表示报告生成的月份
|
||||
* NNN:报告序号,每个月从001开始,递增生成。每月的序号重新计数。
|
||||
* DD:部门的随机排序(2位数字),每个部门内部的随机编号
|
||||
* QQ:数量(2位数字),表示报告中设备的数量
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
private String generateReportCode(TestReportManageDto dto) {
|
||||
//获取当前年 yyyy
|
||||
String nowYear = DateTimeHelper.getNowYear();
|
||||
//获取当前月 MM
|
||||
String nowMonth = DateTimeHelper.getNowMonths();
|
||||
//查询当前年月的序号
|
||||
String code = testReportManageDao.getReportCode(nowYear+"-"+nowMonth);
|
||||
if (StringHelper.isNotEmpty(code)){
|
||||
int num = Integer.parseInt(code);
|
||||
num++;
|
||||
code = "ML/BG-"+nowYear+"-"+nowMonth+String.format("%03d",num)+"-00-"+String.format("%02d",dto.getDevNum());
|
||||
|
||||
}else {
|
||||
code = "ML/BG-"+nowYear+"-"+nowMonth+"001"+"-00-"+String.format("%02d",dto.getDevNum());
|
||||
}
|
||||
//将生成的报告编号保存到数据库
|
||||
dto.setReportCode(code);
|
||||
int res = testReportManageDao.updateReportCode(dto);
|
||||
return code;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -116,6 +116,11 @@ public class SysUser extends PageEntity {
|
|||
/**班组ID*/
|
||||
private String teamId;
|
||||
|
||||
/**
|
||||
* 班组名称
|
||||
*/
|
||||
private String teamName;
|
||||
|
||||
|
||||
public interface Status {
|
||||
int DISABLED = 0;
|
||||
|
|
|
|||
|
|
@ -102,7 +102,16 @@ public class UserServiceImpl implements UserService {
|
|||
*/
|
||||
@Override
|
||||
public List<SysUser> list(SysUser user) {
|
||||
return userDao.list(user);
|
||||
List<SysUser> list = userDao.list(user);
|
||||
if (list.size()>0){
|
||||
for (SysUser users : list){
|
||||
//如果班组为不空,则拼接;否则只展示组织
|
||||
if (StringHelper.isNotEmpty(users.getTeamName())){
|
||||
users.setOrgName(users.getOrgName()+"/"+users.getTeamName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
<insert id="addSamples" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
|
||||
INSERT INTO tb_sample(custom_id,
|
||||
custom_name,
|
||||
department,
|
||||
sample_user,
|
||||
sample_time,
|
||||
create_time,
|
||||
|
|
@ -12,7 +11,6 @@
|
|||
sample_date)
|
||||
VALUES (#{customId},
|
||||
#{customName},
|
||||
#{sampleDepartment},
|
||||
#{sampleUser},
|
||||
#{sampleTime},
|
||||
NOW(),
|
||||
|
|
@ -26,6 +24,7 @@
|
|||
dev_module,
|
||||
dev_code,
|
||||
customer_code,
|
||||
department_id,
|
||||
sample_time,
|
||||
create_time,
|
||||
create_user)
|
||||
|
|
@ -35,6 +34,7 @@
|
|||
#{devModule},
|
||||
#{devCode},
|
||||
#{customerCode},
|
||||
#{departmentId},
|
||||
#{sampleTime},
|
||||
NOW(),
|
||||
#{createBy})
|
||||
|
|
@ -84,16 +84,17 @@
|
|||
AND tsd.del_falg = '0') aa
|
||||
</select>
|
||||
<select id="getDetailsList" resultType="com.bonus.aqgqj.basis.entity.dto.SamplesManageDto">
|
||||
select
|
||||
select
|
||||
tsd.id,
|
||||
tsd.dev_type_name as sampleTools,
|
||||
tsd.dev_code as devCode,
|
||||
tsd.customer_code as customerCode,
|
||||
tsd.dev_module as devModule,
|
||||
ts.department as sampleDepartment
|
||||
tc.custom_name as sampleDepartment
|
||||
from
|
||||
tb_sample_device tsd
|
||||
LEFT JOIN tb_sample ts on tsd.sample_id=ts.id
|
||||
LEFT JOIN tb_custom tc on tsd.department_id=tc.id and tc.del_flag=0
|
||||
where tsd.del_falg = 0
|
||||
and tsd.sample_id = #{id}
|
||||
<if test="sampleTools != null and sampleTools != ''">
|
||||
|
|
@ -104,7 +105,7 @@
|
|||
tsd.dev_code like concat('%', #{keyWord}, '%') OR
|
||||
tsd.customer_code like concat('%', #{keyWord}, '%') OR
|
||||
tsd.dev_module like concat('%', #{keyWord}, '%') OR
|
||||
ts.department like concat('%', #{keyWord}, '%')
|
||||
tc.custom_name like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
|
@ -152,4 +153,11 @@
|
|||
FROM tb_team
|
||||
WHERE del_flag = 0
|
||||
</select>
|
||||
<select id="getDeptSelectedById" resultType="com.bonus.aqgqj.basis.entity.dto.SamplesManageDto">
|
||||
SELECT id,
|
||||
custom_name as name
|
||||
FROM tb_custom
|
||||
WHERE p_id = #{customId}
|
||||
and del_flag = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -44,49 +44,58 @@
|
|||
SET team_id = #{teamId}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<update id="updateReportCode">
|
||||
INSERT INTO tb_certificate
|
||||
(`code`, `exper_id`, `dev_type`, `is_hg`, `department`, `create_time`)
|
||||
values (#{reportCode},
|
||||
#{id},
|
||||
#{sampleTools},
|
||||
#{isHg},
|
||||
#{sampleDepartment},
|
||||
NOW())
|
||||
</update>
|
||||
|
||||
<select id="list" resultType="com.bonus.aqgqj.basis.entity.dto.TestReportManageDto">
|
||||
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,
|
||||
IFNULL(te.devNum,0) as devNum
|
||||
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 (
|
||||
SELECT
|
||||
aa.sample_id as id,
|
||||
tc.custom_name as customName,
|
||||
ts.sample_time as sampleTime,
|
||||
aa.sampleTools,
|
||||
aa.devNum,
|
||||
su.user_name as collectSamplesUser,
|
||||
ts.sample_date as collectSamplesTime,
|
||||
tt.team_name as teamName
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
te.sample_id,
|
||||
SUM( te.dev_num ) AS devNum
|
||||
GROUP_CONCAT( DISTINCT te.dev_type_name SEPARATOR '、' ) AS sampleTools,
|
||||
SUM(te.dev_num) as devNum
|
||||
FROM
|
||||
tb_exper te
|
||||
WHERE
|
||||
te.del_flag = 0
|
||||
and `status`=4
|
||||
and audit_status=1
|
||||
<if test="sampleTools != null and sampleTools != ''">
|
||||
and te.dev_type_name like concat('%',#{sampleTools}, '%')
|
||||
</if>
|
||||
GROUP BY
|
||||
te.sample_id
|
||||
) te ON te.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'
|
||||
sample_id
|
||||
) aa
|
||||
LEFT JOIN tb_sample ts on aa.sample_id=ts.id and ts.del_flag=0
|
||||
LEFT JOIN tb_custom tc on tc.id=ts.custom_id and tc.del_flag=0
|
||||
LEFT JOIN sys_user su on su.id=ts.create_user and su.del_flag=0
|
||||
LEFT JOIN tb_team tt on tt.id=ts.team_id and tt.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
|
||||
|
|
@ -97,27 +106,40 @@
|
|||
AND tsd.del_falg = '0') aa
|
||||
</select>
|
||||
<select id="getDetailsList" resultType="com.bonus.aqgqj.basis.entity.dto.TestReportManageDto">
|
||||
SELECT
|
||||
aa.*,
|
||||
tc.`code` as reportCode
|
||||
FROM
|
||||
(
|
||||
|
||||
SELECT
|
||||
te.id,
|
||||
te.dev_type_name as sampleTools,
|
||||
ts.department as sampleDepartment,
|
||||
te.dev_module as devModule,
|
||||
te.dev_num as devNum
|
||||
tsd.dev_type_name as sampleTools,
|
||||
tc.custom_name as sampleDepartment,
|
||||
GROUP_CONCAT( DISTINCT tsd.dev_module SEPARATOR '、' ) as devModule,
|
||||
COUNT(ted.id) as devNum,
|
||||
ted.is_hg as isHg,
|
||||
te.create_time as detectionTime
|
||||
FROM
|
||||
tb_exper te
|
||||
LEFT JOIN tb_sample ts on ts.id=te.sample_id and ts.del_flag=0
|
||||
LEFT JOIN tb_exper_dev ted on te.id=ted.exper_id
|
||||
LEFT JOIN tb_sample_device tsd on tsd.id=ted.dev_id and tsd.del_falg=0
|
||||
LEFT JOIN tb_custom tc on tc.id=ted.department_id and tc.del_flag=0
|
||||
WHERE
|
||||
te.del_flag=0
|
||||
and ts.id=#{id}
|
||||
te.sample_id=#{id}
|
||||
<if test="sampleTools != null and sampleTools != ''">
|
||||
and te.dev_type_name like concat('%',#{sampleTools}, '%')
|
||||
and tsd.dev_type_name like concat('%',#{sampleTools}, '%')
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
ts.department like concat('%', #{keyWord}, '%') OR
|
||||
te.dev_module like concat('%', #{keyWord}, '%')
|
||||
tc.custom_name like concat('%', #{keyWord}, '%') OR
|
||||
tsd.dev_module like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY tsd.dev_type_name,tsd.department_id,ted.is_hg
|
||||
)aa
|
||||
LEFT JOIN tb_certificate tc on tc.exper_id=aa.id and tc.dev_type=aa.sampleTools
|
||||
and tc.is_hg=aa.isHg and tc.department=aa.sampleDepartment
|
||||
</select>
|
||||
<select id="listTools" resultType="com.bonus.aqgqj.basis.entity.dto.TestReportManageDto">
|
||||
select
|
||||
|
|
@ -163,4 +185,10 @@
|
|||
FROM tb_team
|
||||
WHERE del_flag = 0
|
||||
</select>
|
||||
<select id="getReportCode" resultType="java.lang.String">
|
||||
SELECT SUBSTRING(`code`, 14, 3) AS reportCode
|
||||
FROM tb_certificate
|
||||
WHERE SUBSTRING(`code`, 7, 7) = #{nowDate}
|
||||
ORDER BY SUBSTRING( `code`, 14, 3 ) DESC LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -42,9 +42,19 @@
|
|||
</select>
|
||||
<!--新增用户-->
|
||||
<insert id="saveUser" parameterType="com.bonus.aqgqj.model.SysUser" >
|
||||
insert into sys_user(login_name, user_name, user_code, sex, org_id, role_id, phone, user_type, state, password,team_id,create_time)
|
||||
values (#{loginName}, #{username}, #{userCode}, #{sex}, #{orgId}, #{roleId}, #{phone}, #{userType}, #{state},
|
||||
#{password},#{teamId},NOW())
|
||||
insert into sys_user(login_name, user_name, user_code, sex, org_id,login_type, role_id, phone, user_type, state,
|
||||
password,
|
||||
<if test="teamId != null and teamId != ''">
|
||||
team_id,
|
||||
</if>
|
||||
create_time)
|
||||
values (#{loginName}, #{username}, #{userCode}, #{sex}, #{orgId},#{loginType}, #{roleId}, #{phone}, #{userType},
|
||||
#{state},
|
||||
#{password},
|
||||
<if test="teamId != null and teamId != ''">
|
||||
#{teamId},
|
||||
</if>
|
||||
NOW())
|
||||
</insert>
|
||||
<!--登录查询用户-->
|
||||
<select id="getUser" parameterType="String" resultType="com.bonus.aqgqj.model.SysUser">
|
||||
|
|
@ -84,7 +94,7 @@
|
|||
t.user_code AS userCode,
|
||||
t.sex,
|
||||
t.org_id as orgId,
|
||||
CONCAT(so.org_name,'/',tt.team_name) as orgName,
|
||||
so.org_name as orgName,
|
||||
sr.role_name roleName,
|
||||
t.phone AS phone,
|
||||
t.team_id as teamId,
|
||||
|
|
@ -138,6 +148,7 @@
|
|||
type,
|
||||
login_type as loginType,
|
||||
role_id as roleId,
|
||||
team_id as teamId,
|
||||
state
|
||||
from sys_user
|
||||
where id = #{id}
|
||||
|
|
@ -184,6 +195,8 @@
|
|||
t.role_id = #{roleId},
|
||||
t.phone = #{phone},
|
||||
t.user_type = #{userType},
|
||||
t.login_type = #{loginType},
|
||||
t.team_id = #{teamId},
|
||||
t.state = #{state},
|
||||
t.update_time = now()
|
||||
where t.id = #{id}
|
||||
|
|
|
|||
|
|
@ -17,16 +17,19 @@ function setParams(params) {
|
|||
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)
|
||||
$('#devCode').val('')
|
||||
});
|
||||
|
||||
form.on('select(customName)', function (data) {
|
||||
// 获得被选中的值
|
||||
var value = data.value;
|
||||
getDeptSelectedById(value);
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -39,6 +42,10 @@ function pages(data) {
|
|||
// 2. 查找对应的选项文本
|
||||
var selectedText = $('#customName option[value="' + customNameValue + '"]').text();
|
||||
|
||||
var sampleDepartmentValue =$('#sampleDepartment').val()
|
||||
// 2. 查找对应的选项文本
|
||||
var sampleDepartmentText = $('#sampleDepartment option[value="' + sampleDepartmentValue + '"]').text();
|
||||
|
||||
var sampleToolsValue =$('#sampleTools').val()
|
||||
// 2. 查找对应的选项文本
|
||||
var sampleToolsText = $('#sampleTools option[value="' + sampleToolsValue + '"]').text();
|
||||
|
|
@ -47,9 +54,11 @@ function pages(data) {
|
|||
listData.push({
|
||||
customId: data.customName,
|
||||
customName: selectedText,
|
||||
sampleDepartment: data.sampleDepartment,
|
||||
sampleUser: data.sampleUser,
|
||||
sampleTime: $('#sampleTime').val(),
|
||||
|
||||
departmentId: data.sampleDepartment,
|
||||
sampleDepartment: sampleDepartmentText,
|
||||
sampleToolsId: data.sampleTools,
|
||||
sampleTools: sampleToolsText,
|
||||
devModule: data.devModule,
|
||||
|
|
@ -69,59 +78,17 @@ function pages(data) {
|
|||
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);
|
||||
form.render();
|
||||
} 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);
|
||||
form.render();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单位数据
|
||||
*/
|
||||
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({
|
||||
|
|
|
|||
|
|
@ -215,6 +215,61 @@ function setFormSelects2(selName,list) {
|
|||
layui.form.render();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单位下拉选
|
||||
*/
|
||||
function getCustomNameSelected() {
|
||||
let url = dataUrl + '/samples/allCustomName';
|
||||
ajaxRequest(url, "POST", null, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
setSelectValue(result.data, 'customName');
|
||||
} 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');
|
||||
} else {
|
||||
layer.alert(result.msg, {icon: 2})
|
||||
}
|
||||
}, function (xhr) {
|
||||
error(xhr)
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门下拉选
|
||||
*/
|
||||
function getDeptSelectedById(customId) {
|
||||
let url = dataUrl + '/samples/getDeptSelectedById';
|
||||
let obj = {
|
||||
customId:customId
|
||||
}
|
||||
let params = {
|
||||
encryptedData: encryptCBC(JSON.stringify(obj))
|
||||
}
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
setSelectValue(result.data, 'sampleDepartment');
|
||||
} else {
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/**字典表下拉选*/
|
||||
function getDictsSelect(value) {
|
||||
let data = [];
|
||||
|
|
@ -244,4 +299,4 @@ function setDictSelectValue(list, selectName) {
|
|||
})
|
||||
$('#' + selectName).empty().append(html);
|
||||
layui.form.render();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -163,6 +163,7 @@ function getUserById() {
|
|||
|
||||
// 设置表单内容
|
||||
function setFormData(data) {
|
||||
console.log("data:",data)
|
||||
if (data) {
|
||||
$("#password").removeAttr("lay-verify");
|
||||
$("#pwd").css("display","none");
|
||||
|
|
@ -194,7 +195,17 @@ function setFormData(data) {
|
|||
$('#orgId').val(data.orgId)
|
||||
$('#roleId').val(data.roleId)
|
||||
$('#roleId option[value=' + data.roleId + ']').attr('selected', true)
|
||||
|
||||
$('#teamId').val(data.teamId)
|
||||
$('#teamId option[value=' + data.teamId + ']').attr('selected', true)
|
||||
var arrCB = data.loginTypes;
|
||||
for (var j = 0; j < arrCB.length; j++) {
|
||||
var cbthis = $("input[name='loginType']");
|
||||
for (var i = 0; i < cbthis.length; i++) {
|
||||
if (cbthis[i].value == arrCB[j]) {
|
||||
cbthis[i].checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
phoneParam = data.phone;
|
||||
layui.form.render();
|
||||
}
|
||||
|
|
@ -207,7 +218,6 @@ function saveData2() {
|
|||
// 保存数据
|
||||
function saveData(data) {
|
||||
let loadingMsg = layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0});
|
||||
// let url = dataUrl + "/sys/user/addOrUpdateUser?token=" + token;
|
||||
let url = dataUrl + "/users/add";
|
||||
let params = data.field;
|
||||
var arr_box = [];//固定复选框
|
||||
|
|
|
|||
|
|
@ -82,28 +82,38 @@ function initTable(dataList, limit, page) {
|
|||
cols: [
|
||||
[
|
||||
//表头
|
||||
{title: "序号", width: 80, unresize: true, align: "center",
|
||||
{title: "序号", width: 68, unresize: true, align: "center",
|
||||
templet: function (d) {
|
||||
return (page - 1) * limit + d.LAY_INDEX;
|
||||
}
|
||||
},
|
||||
{field: "sampleTools", title: "设备类型", unresize: true, align: "center"},
|
||||
{field: "devNum", title: "报告编号", unresize: true, align: "center"},
|
||||
{field: "reportCode", title: "报告编号", unresize: true, align: "center"},
|
||||
{field: "sampleDepartment", title: "送样部门", unresize: true, align: "center"},
|
||||
{field: "devModule", title: "规格型号", unresize: true, align: "center"},
|
||||
{
|
||||
field: "devNum",
|
||||
title: "样品数量",
|
||||
width: 68,
|
||||
unresize: true,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return `<span style="color: blue">${d.devNum}</span>`;
|
||||
}
|
||||
},
|
||||
{field: "devNum", title: "检测结果", unresize: true, align: "center"},
|
||||
{field: "devNum", title: "检测时间", unresize: true, align: "center"},
|
||||
{
|
||||
field: "view1", title: "检测报告", unresize: true, align: "center",
|
||||
field: "isHg", title: "检测结果", unresize: true, align: "center",
|
||||
templet: function (d) {
|
||||
if (d.isHg === "0") {
|
||||
return "合格";
|
||||
} else if (d.isHg === "1") {
|
||||
return "不合格";
|
||||
}
|
||||
}
|
||||
},
|
||||
{field: "detectionTime", title: "检测时间", unresize: true, align: "center"},
|
||||
{
|
||||
field: "view1", title: "检测报告",width: 68, unresize: true, align: "center",
|
||||
templet: function (d) {
|
||||
return '<a href="#" style="color: blue;" onclick="handleClick1(\'' + d.id + '\')">查看</a>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
<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/select.js"></script>
|
||||
<script src="../../../js/commonUtils.js"></script>
|
||||
<script src="../../../js/openIframe.js"></script>
|
||||
<script src="../../../js/my/aes.js"></script>
|
||||
|
|
@ -68,17 +69,11 @@
|
|||
<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 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">
|
||||
|
|
@ -92,14 +87,22 @@
|
|||
|
||||
<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="sampleDepartment" lay-filter="sampleDepartment" lay-verify="required" name="sampleDepartment" class="form-control input-sm">
|
||||
</select>
|
||||
<!-- <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>
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@
|
|||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><i style="padding: 0 10px;">*</i>班组</label>
|
||||
<label class="layui-form-label">班组</label>
|
||||
<div class="layui-input-inline">
|
||||
<select id="teamId" lay-verify="required" name="teamId" class="form-control input-sm">
|
||||
<select id="teamId" name="teamId" class="form-control input-sm">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -92,6 +92,16 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><i style="padding: 0 10px;">*</i>登录权限</label>
|
||||
<div class="layui-input-inline" id="cbGuDing" >
|
||||
<input type="checkbox" name="loginType" value="1" title="后台" lay-skin="primary" checked>
|
||||
<input type="checkbox" name="loginType" value="2" title="大屏" lay-skin="primary">
|
||||
<input type="checkbox" name="loginType" value="3" title="app" lay-skin="primary">
|
||||
<input type="hidden" id="loginType" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item" style="margin-top: 2%;" id="pwd">
|
||||
<label class="layui-form-label"><i style="padding: 0 10px;">*</i>密码</label>
|
||||
<div class="layui-input-inline password" >
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@
|
|||
<div class="layui-inline btns">
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="query(1)">查询
|
||||
</button>
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="reset()">重置
|
||||
</button>
|
||||
<!-- <button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="reset()">重置-->
|
||||
<!-- </button>-->
|
||||
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm btn-2"
|
||||
onclick="addData(null)">
|
||||
<div class="layout" style="justify-content: space-around;"><img
|
||||
|
|
|
|||
Loading…
Reference in New Issue