工器具个体管理

This commit is contained in:
hayu 2024-07-22 09:12:12 +08:00
parent 8b0c8b4d71
commit d886a64846
10 changed files with 189 additions and 78 deletions

View File

@ -24,6 +24,11 @@ public class ToolsManageDto extends PageEntity {
*/ */
private String customName; private String customName;
/**
* 送样部门
*/
private String sampleDepartment;
/** /**
* 送样人 * 送样人
*/ */
@ -57,6 +62,11 @@ public class ToolsManageDto extends PageEntity {
/** /**
* 设备编号 * 设备编号
*/ */
private String devCode;
/**
* 客户自编号
*/
private String devTypeCode; private String devTypeCode;
/** /**
@ -67,12 +77,37 @@ public class ToolsManageDto extends PageEntity {
/** /**
* 生产日期 * 生产日期
*/ */
private String produceDate; private String manufactureDate;
/** /**
* 设备规格 * 设备规格
*/ */
private String devModule; private String devModule;
/**
* 试验日期
*/
private String experTime;
/**
* 下次试验日期
*/
private String nextExperTime;
/**
* 试验人员
*/
private String experUser;
/**
* 试验结论
*/
private String experConclu;
/**
* 关键字
*/
private String keyWord;
} }

View File

@ -45,10 +45,10 @@ public class ToolsManageServiceImpl implements ToolsManageService {
@Override @Override
public List<ToolsManageDto> list(ToolsManageDto bean) { public List<ToolsManageDto> list(ToolsManageDto bean) {
List<ToolsManageDto> list = toolsManageDao.list(bean); List<ToolsManageDto> list = toolsManageDao.list(bean);
for (ToolsManageDto dto : list){ // for (ToolsManageDto dto : list){
String sampleTools = toolsManageDao.getSampleTools(dto.getId()); // String sampleTools = toolsManageDao.getSampleTools(dto.getId());
dto.setSampleTools(sampleTools); // dto.setSampleTools(sampleTools);
} // }
return list; return list;
} }

View File

@ -3,27 +3,38 @@
<mapper namespace="com.bonus.aqgqj.basis.dao.ToolsManageDao"> <mapper namespace="com.bonus.aqgqj.basis.dao.ToolsManageDao">
<select id="list" resultType="com.bonus.aqgqj.basis.entity.dto.ToolsManageDto"> <select id="list" resultType="com.bonus.aqgqj.basis.entity.dto.ToolsManageDto">
SELECT ts.id, SELECT
tsd.id,
tsd.dev_type_name as sampleTools,
tsd.dev_code as devCode,
tsd.dev_type_code as devTypeCode,
tsd.dev_module as devModule,
tc.custom_name as customName, tc.custom_name as customName,
ts.sample_user as sampleUser, ted.manufacture_date as manufactureDate,
ts.sample_time as sampleTime, te.exper_time as experTime,
su.user_name as collectSamplesUser, te.next_exper_time as nextExperTime,
tsd.create_time as collectSamplesTime, te.exper_conclu as experConclu,
tt.team_name as teamName su.user_name as experUser
FROM tb_sample ts FROM
LEFT JOIN tb_custom tc tb_sample_device tsd
on tc.id = ts.custom_id LEFT JOIN tb_sample ts on ts.id=tsd.sample_id
LEFT JOIN tb_sample_device tsd on tsd.sample_id = ts.id LEFT JOIN tb_custom tc on tc.id=ts.custom_id
LEFT JOIN sys_user su on su.id = tsd.create_user LEFT JOIN tb_exper te on te.sample_id=ts.id
LEFT JOIN tb_team tt on tt.id = ts.team_id LEFT JOIN tb_exper_dev ted on ted.exper_id =te.id
WHERE ts.del_flag = '0' LEFT JOIN sys_user su on su.id=te.create_user
<if test="collectSamplesUser != null and collectSamplesUser != ''"> WHERE
AND su.user_name like concat('%', #{collectSamplesUser}, '%') tsd.del_falg=0
</if>
<if test="sampleTools != null and sampleTools != ''"> <if test="sampleTools != null and sampleTools != ''">
and tsd.dev_type_name like concat('%',#{sampleTools}, '%') and tsd.dev_type_name like concat('%',#{sampleTools}, '%')
</if> </if>
GROUP BY ts.id <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>
<select id="getSampleTools" resultType="java.lang.String"> <select id="getSampleTools" resultType="java.lang.String">
SELECT GROUP_CONCAT(aa.dev_type_name SEPARATOR '、') AS sampleTools SELECT GROUP_CONCAT(aa.dev_type_name SEPARATOR '、') AS sampleTools

View File

@ -151,7 +151,7 @@ function setFormData(data) {
$("#password").removeAttr("lay-verify"); $("#password").removeAttr("lay-verify");
$("#pwd").css("display","none"); $("#pwd").css("display","none");
$('#id').val(data.id) $('#id').val(data.id)
$('#userCode').val(data.userCode) // $('#userCode').val(data.userCode)
$('#username').val(data.username) $('#username').val(data.username)
$('#loginName').val(data.loginName) $('#loginName').val(data.loginName)
$('#phone').val(data.phone) $('#phone').val(data.phone)

View File

@ -127,7 +127,7 @@ function initTable(dataList, limit, page) {
unresize: true, unresize: true,
align: "center" align: "center"
}, },
{field: "state", title: "启用状态", align: "center",templet: '#is-state'}, {field: "state", title: "状态", align: "center",templet: '#is-state'},
{ {
title: "操作", title: "操作",
unresize: true, unresize: true,

View File

@ -97,7 +97,7 @@ function initTable(dataList, limit, page) {
}, },
{field: "loginName", title: "登录名", unresize: true, align: "center"}, {field: "loginName", title: "登录名", unresize: true, align: "center"},
{field: "username", title: "用户名", unresize: true, align: "center"}, {field: "username", title: "用户名", unresize: true, align: "center"},
{field: "userCode", title: "工号", unresize: true, align: "center"}, // {field: "userCode", title: "工号", unresize: true, align: "center"},
{field: "sex", title: "性别", unresize: true, align: "center", {field: "sex", title: "性别", unresize: true, align: "center",
templet: function (d) { templet: function (d) {
if (d.sex == 0) { if (d.sex == 0) {

View File

@ -85,27 +85,40 @@ function initTable(dataList, limit, page) {
return (page - 1) * limit + d.LAY_INDEX; return (page - 1) * limit + d.LAY_INDEX;
} }
}, },
{field: "sampleTools", title: "设备类型", unresize: true, align: "center"},
{field: "devCode", title: "设备编号", unresize: true, align: "center"},
{field: "devTypeCode", title: "客户自编号", unresize: true, align: "center"},
{field: "devModule", title: "设备规格", unresize: true, align: "center"},
{field: "customName", title: "送样单位", unresize: true, align: "center"}, {field: "customName", title: "送样单位", unresize: true, align: "center"},
{field: "sampleUser", title: "送样人", unresize: true, align: "center"}, {field: "sampleDepartment", title: "送样部门", unresize: true, align: "center"},
{field: "sampleTime", title: "送样时间", unresize: true, align: "center"}, {field: "manufactureDate", title: "生产日期", unresize: true, align: "center"},
{field: "sampleTools", title: "送样设备", unresize: true, align: "center"}, {field: "experTime", title: "试验日期", unresize: true, align: "center"},
{field: "collectSamplesUser", title: "收样人", unresize: true, align: "center"}, {field: "experConclu", title: "试验结果", unresize: true, align: "center"},
{field: "collectSamplesTime", title: "收样时间", unresize: true, align: "center"}, {
{field: "teamName", title: "试验班组", unresize: true, align: "center"}, field: "certificate", title: "合格证", unresize: true, align: "center", templet: function (d) {
{title: "操作", unresize: true, width: 85, align: "center", console.log("d",d.id);
templet: function (d) { return '<a href="#" style="color: blue;" onclick="handleClick1(\'' + d.sampleTools + '\',\'' + d.devModule + '\',\'' + d.devCode + '\',\'' + d.experTime + '\',\'' + d.nextExperTime + '\',\'' + d.experUser + '\',\'' + d.experConclu + '\',\'' + d.customName + '\')">查看</a>';
let html = '';
// let updaetpwd="<a class=\"layui-icon layui-icon-password\" style='cursor:pointer;' title='修改密码' onclick=\"resetPwd('" + d.id + "')\"></a>";
// let del="<a class=\"layui-icon layui-icon-delete\" style='cursor:pointer;' title='删除' onclick=\"delData('" + d.id + "')\"></a>"
let view="<a class=\"layui-icon layui-icon-form\" style='cursor:pointer;' title='查看' onclick=\"addData('" + d.id + "')\"></a>";
html=view;
if(d.delFlag==1){
return '';
}
return html;
} }
}, },
{
field: "qrCode", title: "二维码", unresize: true, align: "center", templet: function (d) {
return '<a href="#" style="color: blue;" onclick="handleClick2(\'' + d + '\')">打印</a>';
}
},
// {title: "操作", unresize: true, width: 85, align: "center",
// templet: function (d) {
//
// let html = '';
// // let updaetpwd="<a class=\"layui-icon layui-icon-password\" style='cursor:pointer;' title='修改密码' onclick=\"resetPwd('" + d.id + "')\"></a>";
// // let del="<a class=\"layui-icon layui-icon-delete\" style='cursor:pointer;' title='删除' onclick=\"delData('" + d.id + "')\"></a>"
// let view="<a class=\"layui-icon layui-icon-form\" style='cursor:pointer;' title='查看' onclick=\"addData('" + d.id + "')\"></a>";
// html=view;
// if(d.delFlag==1){
// return '';
// }
// return html;
// }
// },
], ],
], ],
done: function (res, curr, count) { done: function (res, curr, count) {
@ -117,13 +130,32 @@ function initTable(dataList, limit, page) {
}); });
} }
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) { function getReqParams(page, limit, type) {
var selectedValue =$('#sampleTools').val() var selectedValue =$('#sampleTools').val()
// 2. 查找对应的选项文本 // 2. 查找对应的选项文本
var selectedText = $('#sampleTools option[value="' + selectedValue + '"]').text(); var selectedText = $('#sampleTools option[value="' + selectedValue + '"]').text();
if (selectedText=='请选择'){ if (selectedText=='请选择设备类型'){
selectedText='' selectedText=''
} }
let obj = {}; let obj = {};
@ -132,13 +164,14 @@ function getReqParams(page, limit, type) {
page: page + "", page: page + "",
limit: limit + "", limit: limit + "",
sampleTools: selectedText, sampleTools: selectedText,
collectSamplesUser:$('#collectSamplesUser').val() keyWord:$('#keyWord').val()
}; };
} else { } else {
obj = { obj = {
page: '1', page: '1',
limit: '10', limit: '10',
collectSamplesUser: '' sampleTools: '',
keyWord: ''
}; };
} }
console.log(obj) console.log(obj)
@ -226,7 +259,7 @@ function resetPwd(id) {
/*下拉选表单赋值*/ /*下拉选表单赋值*/
function setSelectValue(list, selectName) { function setSelectValue(list, selectName) {
console.log("list",list) console.log("list",list)
let html = '<option value="" selected>请选择</option>'; let html = '<option value="" selected>请选择设备类型</option>';
$.each(list, function (index, item) { $.each(list, function (index, item) {
html += '<option value="' + item.id + '">' + item.name + '</option>'; html += '<option value="' + item.id + '">' + item.name + '</option>';
}) })

View File

@ -1,37 +1,69 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="zh">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dynamic Table</title> <script src="../../../js/libs/jquery-2.1.1.min.js" charset="UTF-8" type="text/javascript"></script>
<script src="../../../js/tools/child/certificateView.js"></script>
<title>表格布局示例</title>
<style> <style>
table, th, td { table {
border: 1px solid black; width: 100%;
border-collapse: collapse; border-collapse: collapse;
} }
th, td { th, td {
padding: 10px; border: 1px solid #ddd;
padding: 8px;
text-align: left; text-align: left;
} }
th {
background-color: #f4f4f4;
}
</style> </style>
</head> </head>
<body> <body>
<div class="dynamic-text" id="address">xxxxxxxx</div>
<button onclick="fillTable()">Fill Table</button> <table>
<table id="dynamicTable"> <!-- 第一行 -->
<tr> <tr>
<th>序号</th> <td colspan="2" style="text-align: center;">试验结果</td>
<th>名称</th> </tr>
<th>规格型号</th> <!-- 第二行 -->
<th>唯一标识号</th> <tr>
<th>检验日期</th> <td style="width: 25%; text-align: center;">样品名称</td>
<th>下次检验日期</th> <td id="sampleTools"></td>
<th>试验人员</th> </tr>
<th>送检单位</th> <!-- 第三行 -->
<tr>
<td style="width: 25%; text-align: center;">规格型号</td>
<td id="devModule"></td>
</tr>
<!-- 第四行 -->
<tr>
<td style="width: 25%; text-align: center;">样品编号</td>
<td id="devCode"></td>
</tr>
<!-- 第五行 -->
<tr>
<td style="width: 25%; text-align: center;">检验日期</td>
<td id="experTime"></td>
</tr>
<tr>
<td style="width: 25%; text-align: center;">下次检验日期</td>
<td id="nextExperTime"></td>
</tr>
<tr>
<td style="width: 25%; text-align: center;">试验人员</td>
<td id="experUser"></td>
</tr>
<tr>
<td style="width: 25%; text-align: center;">试验结果</td>
<td id="experConclu"></td>
</tr>
<tr>
<td style="width: 25%; text-align: center;">送检单位</td>
<td id="customName"></td>
</tr> </tr>
<!-- 动态行将在这里插入 -->
</table> </table>
<script src="script.js"></script>
</body> </body>
</html> </html>

View File

@ -14,7 +14,7 @@
<script src="../../js/openIframe.js"></script> <script src="../../js/openIframe.js"></script>
<script src="../../js/my/aes.js"></script> <script src="../../js/my/aes.js"></script>
<script src="../../js/ajaxRequest.js"></script> <script src="../../js/ajaxRequest.js"></script>
<title>用户管理</title> <title>工器具个体管理</title>
</head> </head>
<body> <body>
<div id="content"> <div id="content">
@ -31,7 +31,7 @@
<div class="layui-inline" style="padding: 0 0 0 10px;"> <div class="layui-inline" style="padding: 0 0 0 10px;">
<div class="layui-input-inline"> <div class="layui-input-inline">
<input type="text" id="collectSamplesUser" maxlength="30" class="layui-input" autocomplete="off" placeholder="请输入收样人"> <input type="text" id="keyWord" maxlength="30" class="layui-input" autocomplete="off" placeholder="请输入关键字">
</div> </div>
</div> </div>

View File

@ -24,7 +24,7 @@
<label class="layui-form-label"><i style="padding: 0 10px;">*</i>登录名</label> <label class="layui-form-label"><i style="padding: 0 10px;">*</i>登录名</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input class="layui-input" id="loginName" name="loginName" autocomplete="off" <input class="layui-input" id="loginName" name="loginName" autocomplete="off"
lay-verify="required" maxlength="30"> lay-verify="required" maxlength="20">
</div> </div>
</div> </div>
@ -32,19 +32,19 @@
<label class="layui-form-label"><i style="padding: 0 10px;">*</i>用户名</label> <label class="layui-form-label"><i style="padding: 0 10px;">*</i>用户名</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input class="layui-input" id="username" name="username" autocomplete="off" <input class="layui-input" id="username" name="username" autocomplete="off"
lay-verify="required" maxlength="30"> lay-verify="required" maxlength="10">
</div> </div>
</div> </div>
<div class="layui-form-item" style="margin-top: 2%;"> <!-- <div class="layui-form-item" style="margin-top: 2%;">-->
<label class="layui-form-label"><i style="padding: 0 10px;">*</i>工号</label> <!-- <label class="layui-form-label"><i style="padding: 0 10px;">*</i>工号</label>-->
<div class="layui-input-inline"> <!-- <div class="layui-input-inline">-->
<input class="layui-input" id="userCode" name="userCode" autocomplete="off" <!-- <input class="layui-input" id="userCode" name="userCode" autocomplete="off"-->
lay-verify="required" maxlength="30"> <!-- lay-verify="required" maxlength="30">-->
</div> <!-- </div>-->
</div> <!-- </div>-->
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"> <i style="padding: 0 10px;">*</i> 性别</label> <label class="layui-form-label"> <i style="padding: 0 10px;">*</i> 性别</label>