检测报告管理
This commit is contained in:
parent
feafbbb36d
commit
0c11f0b931
|
|
@ -5,13 +5,26 @@
|
|||
<!--新增/修改 组织机构-->
|
||||
<insert id="addOrUpdateSysOrg">
|
||||
<if test="type == 1 ">
|
||||
INSERT INTO sys_org(org_name,contacts,contacts_phone,p_id,org_sort,remarks,state)
|
||||
INSERT INTO sys_org(org_name,contacts,contacts_phone,p_id,
|
||||
<if test="orgSort != null and orgSort!=''">
|
||||
org_sort,
|
||||
</if>
|
||||
remarks,state)
|
||||
VALUES (
|
||||
#{orgName},#{name},#{phone},#{parentId},#{orgSort},#{remarks},#{state}
|
||||
#{orgName},#{name},#{phone},#{parentId},
|
||||
<if test="orgSort != null">
|
||||
#{orgSort}
|
||||
</if>
|
||||
#{remarks},#{state}
|
||||
)
|
||||
</if>
|
||||
<if test="type == 2 ">
|
||||
UPDATE sys_org SET org_name = #{orgName},contacts = #{name},contacts_phone = #{phone},p_id = #{parentId},org_sort = #{orgSort},remarks = #{remarks},state = #{state}
|
||||
UPDATE sys_org SET org_name = #{orgName},contacts = #{name},contacts_phone = #{phone},p_id =
|
||||
#{parentId},
|
||||
<if test="orgSort != null and orgSort!=''">
|
||||
org_sort = #{orgSort},
|
||||
</if>
|
||||
remarks = #{remarks},state = #{state}
|
||||
WHERE org_id = #{id}
|
||||
</if>
|
||||
</insert>
|
||||
|
|
|
|||
|
|
@ -34,6 +34,22 @@ function setParams(params) {
|
|||
let param = dtree.selectVal("selTree1");
|
||||
selectNodeId = param.selTree1_select_nodeId;
|
||||
});
|
||||
|
||||
// 监听输入框值变化
|
||||
$('#orgSort').on('input', function() {
|
||||
var inputVal = $(this).val();
|
||||
if (inputVal==''){
|
||||
$(this).val('');
|
||||
}
|
||||
// 转换为数字,并检查是否超出范围
|
||||
var numVal = Number(inputVal);
|
||||
if (isNaN(numVal) || numVal < 1 || numVal > 1000) {
|
||||
// 如果值不合法,清空输入框
|
||||
layer.msg('请输入不超过1000的正整数', {icon: 5});
|
||||
$(this).val('');
|
||||
}
|
||||
});
|
||||
|
||||
form.verify(
|
||||
{
|
||||
isOrgNameRepeat: function (value, item) {
|
||||
|
|
|
|||
|
|
@ -68,6 +68,13 @@ function saveData(data) {
|
|||
if (!selectNodeId) {
|
||||
return layer.msg('请选择上级组织', {icon: 7});
|
||||
}
|
||||
alert(data.field.phone)
|
||||
console.log(data.field)
|
||||
if (data.field.phone != "" && data.field.phone != '') {
|
||||
if (!(/^1[3456789]\d{9}$/.test(data.field.phone))) {
|
||||
return layer.alert("请输入正确的手机号", {icon: 2});
|
||||
}
|
||||
}
|
||||
data.field.parentId = selectNodeId;
|
||||
let loadingMsg = layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0});
|
||||
let url = idParam ? dataUrl + "/sys/org/addSysOrg" : dataUrl + "/sys/org/updateSysOrg";
|
||||
|
|
|
|||
|
|
@ -32,24 +32,18 @@ function setParams(params) {
|
|||
|
||||
// form.render();
|
||||
form.render("checkbox","select");//重新渲染页面checkbox控件
|
||||
form.verify(
|
||||
{
|
||||
isRepeat: function (value, item) {
|
||||
let phone = $('#phone').val();
|
||||
if(phone){
|
||||
if (!(/^1[3456789]\d{9}$/.test(phone))) {
|
||||
return '请输入正确的手机号';
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
form.on('submit(formData)', function (data) {
|
||||
data.field.id = $('#id').val();
|
||||
console.log( data.field.orgId_select_nodeId);
|
||||
if(!data.field.orgId_select_nodeId){
|
||||
return layer.alert("请选择组织机构!", {icon: 2})
|
||||
}
|
||||
let phone = $('#phone').val();
|
||||
if(phone){
|
||||
if (!(/^1[3456789]\d{9}$/.test(phone))) {
|
||||
return layer.alert("请输入正确的手机号", {icon: 2})
|
||||
}
|
||||
}
|
||||
saveData(data);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ function getReqParams(page, limit, type) {
|
|||
}
|
||||
|
||||
// 查询/重置
|
||||
function query() {
|
||||
function query(type) {
|
||||
let pattern = new RegExp("[%_<>]");
|
||||
if (pattern.test($("#loginName").val())) {
|
||||
$("#loginName").val('');
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ function initTable(dataList, limit, page) {
|
|||
let html = '';
|
||||
let view ='';
|
||||
if (d.teamName == null) {
|
||||
view="<a style='cursor:pointer; background: #F2F3FF'' >未派工</a>";
|
||||
view="<a style='cursor:pointer;' ></a>";
|
||||
} else {
|
||||
view="<a style='color: black;'>" + d.teamName + "</a>";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">联系电话</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" id="phone" name="phone" autocomplete="off" maxlength="30">
|
||||
<input class="layui-input" id="phone" name="phone" autocomplete="off" maxlength="11">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">排序</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="orgSort" name="orgSort" maxlength="3" lay-verify="required|isNum" autocomplete="off" class="layui-input">
|
||||
<input type="text" lay-affix="number" min="1" max="999" id="orgSort" name="orgSort" maxlength="3" lay-verify="isNum" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
|
|
|
|||
|
|
@ -50,6 +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-primary layui-btn-sm btn-2"
|
||||
onclick="addData(null)">
|
||||
<div class="layout" style="justify-content: space-around;"><img
|
||||
|
|
|
|||
Loading…
Reference in New Issue