diff --git a/src/main/resources/mappers/system/SysOrgMapper.xml b/src/main/resources/mappers/system/SysOrgMapper.xml index af6b0bc..aad8de8 100644 --- a/src/main/resources/mappers/system/SysOrgMapper.xml +++ b/src/main/resources/mappers/system/SysOrgMapper.xml @@ -5,13 +5,26 @@ - 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, + + org_sort, + + remarks,state) VALUES ( - #{orgName},#{name},#{phone},#{parentId},#{orgSort},#{remarks},#{state} + #{orgName},#{name},#{phone},#{parentId}, + + #{orgSort} + + #{remarks},#{state} ) - 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}, + + org_sort = #{orgSort}, + + remarks = #{remarks},state = #{state} WHERE org_id = #{id} diff --git a/src/main/resources/static/js/system/child/sysOrgForm.js b/src/main/resources/static/js/system/child/sysOrgForm.js index fa6936a..6ee8344 100644 --- a/src/main/resources/static/js/system/child/sysOrgForm.js +++ b/src/main/resources/static/js/system/child/sysOrgForm.js @@ -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) { diff --git a/src/main/resources/static/js/system/child/sysOrgFormAjax.js b/src/main/resources/static/js/system/child/sysOrgFormAjax.js index 539d51d..c66c97e 100644 --- a/src/main/resources/static/js/system/child/sysOrgFormAjax.js +++ b/src/main/resources/static/js/system/child/sysOrgFormAjax.js @@ -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"; diff --git a/src/main/resources/static/js/system/child/userForm.js b/src/main/resources/static/js/system/child/userForm.js index 4e3907d..745a9c5 100644 --- a/src/main/resources/static/js/system/child/userForm.js +++ b/src/main/resources/static/js/system/child/userForm.js @@ -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); }); diff --git a/src/main/resources/static/js/system/userMge.js b/src/main/resources/static/js/system/userMge.js index 7e44513..922781e 100644 --- a/src/main/resources/static/js/system/userMge.js +++ b/src/main/resources/static/js/system/userMge.js @@ -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(''); diff --git a/src/main/resources/static/js/testReport/testReportMge.js b/src/main/resources/static/js/testReport/testReportMge.js index d562cb2..ee76a9e 100644 --- a/src/main/resources/static/js/testReport/testReportMge.js +++ b/src/main/resources/static/js/testReport/testReportMge.js @@ -108,7 +108,7 @@ function initTable(dataList, limit, page) { let html = ''; let view =''; if (d.teamName == null) { - view="未派工"; + view=""; } else { view="" + d.teamName + ""; } diff --git a/src/main/resources/static/pages/system/child/sysOrgForm.html b/src/main/resources/static/pages/system/child/sysOrgForm.html index 33fbf4e..647f66b 100644 --- a/src/main/resources/static/pages/system/child/sysOrgForm.html +++ b/src/main/resources/static/pages/system/child/sysOrgForm.html @@ -46,7 +46,7 @@
- +
@@ -59,7 +59,7 @@
- +
diff --git a/src/main/resources/static/pages/user/userMge.html b/src/main/resources/static/pages/user/userMge.html index 853107c..29371a7 100644 --- a/src/main/resources/static/pages/user/userMge.html +++ b/src/main/resources/static/pages/user/userMge.html @@ -50,6 +50,8 @@
+