优化管理模块页面的校验
This commit is contained in:
@@ -52,18 +52,18 @@
|
||||
</div>
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
<div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px"
|
||||
<div id="supplierDlg" class="easyui-dialog" style="padding:10px 40px" fit="true"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
|
||||
<form id="supplierFM">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 80px;height: 20px">名称</td>
|
||||
<td style="width: 180px;padding:5px">
|
||||
<td style="width: 120px;height: 20px">名称</td>
|
||||
<td style="width: 250px;padding:5px">
|
||||
<input name="supplier" id="supplier" class="easyui-textbox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 160px;"/>
|
||||
</td>
|
||||
<td style="width: 60px;height: 20px">联系人</td>
|
||||
<td style="width:180px;padding:5px;">
|
||||
<td style="width: 120px;height: 20px">联系人</td>
|
||||
<td style="width:250px;padding:5px;">
|
||||
<input name="contacts" id="contacts" class="easyui-textbox" style="width: 160px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -134,13 +134,13 @@
|
||||
<tr>
|
||||
<td>地址</td>
|
||||
<td style="padding:5px" colspan="3">
|
||||
<input name="address" id="address" class="easyui-textbox" style="width: 401px;"/>
|
||||
<input name="address" id="address" class="easyui-textbox" style="width: 530px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:5px" colspan="3">
|
||||
<input name="description" id="description" class="easyui-textbox" data-options="multiline:true" style="width: 401px;height: 40px;"/>
|
||||
<input name="description" id="description" class="easyui-textbox" data-options="multiline:true" style="width: 530px;height: 40px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -457,11 +457,14 @@
|
||||
|
||||
//保存信息
|
||||
$("#saveDepot").off("click").on("click", function () {
|
||||
var infoObj = $("#depotFM").serializeObject();
|
||||
infoObj.type = 0;
|
||||
if(!$('#depotFM').form('validate')){
|
||||
return;
|
||||
}
|
||||
if (checkDepotName()) {
|
||||
return;
|
||||
}
|
||||
var infoObj = $("#depotFM").serializeObject();
|
||||
infoObj.type = 0;
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "post",
|
||||
|
||||
@@ -353,13 +353,16 @@
|
||||
|
||||
//保存收支项目
|
||||
$("#saveInOutItem").off("click").on("click", function () {
|
||||
if (checkInOutItemName()) {
|
||||
if(!$('#inOutItemFM').form('validate')){
|
||||
return;
|
||||
}
|
||||
if (!$("#type").val()) {
|
||||
$.messager.alert('提示', '请选择类型!', 'warning');
|
||||
return;
|
||||
}
|
||||
if (checkInOutItemName()) {
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "post",
|
||||
|
||||
@@ -52,18 +52,18 @@
|
||||
</div>
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
<div id="supplierDlg" class="easyui-dialog" style="width:600px;padding:10px 20px"
|
||||
<div id="supplierDlg" class="easyui-dialog" style="padding:10px 40px" fit="true"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
|
||||
<form id="supplierFM">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 80px;height: 20px">名称</td>
|
||||
<td style="width: 180px;padding:5px">
|
||||
<td style="width: 120px;height: 20px">名称</td>
|
||||
<td style="width: 250px;padding:5px">
|
||||
<input name="supplier" id="supplier" class="easyui-textbox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 160px;"/>
|
||||
</td>
|
||||
<td style="width: 60px;height: 20px">联系人</td>
|
||||
<td style="width:180px;padding:5px;">
|
||||
<td style="width: 120px;height: 20px">联系人</td>
|
||||
<td style="width:250px;padding:5px;">
|
||||
<input name="contacts" id="contacts" class="easyui-textbox" style="width: 160px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -116,7 +116,7 @@
|
||||
<td style="padding:5px">
|
||||
<input name="taxNum" id="taxNum" class="easyui-textbox" style="width: 160px;"/>
|
||||
</td>
|
||||
<td>税率</td>
|
||||
<td>税率(%)</td>
|
||||
<td style="padding:5px">
|
||||
<input name="taxRate" id="taxRate" class="easyui-textbox" style="width: 160px;"/>
|
||||
</td>
|
||||
@@ -134,13 +134,13 @@
|
||||
<tr>
|
||||
<td>地址</td>
|
||||
<td style="padding:5px" colspan="3">
|
||||
<input name="address" id="address" class="easyui-textbox" style="width: 401px;"/>
|
||||
<input name="address" id="address" class="easyui-textbox" style="width: 530px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:5px" colspan="3">
|
||||
<textarea name="description" id="description" class="easyui-textbox" data-options="multiline:true" style="width: 401px;height: 40px;"></textarea>
|
||||
<textarea name="description" id="description" class="easyui-textbox" data-options="multiline:true" style="width: 530px;height: 40px;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -272,6 +272,9 @@
|
||||
|
||||
//保存信息
|
||||
$("#saveRole").off("click").on("click", function () {
|
||||
if(!$('#roleFM').form('validate')){
|
||||
return;
|
||||
}
|
||||
if (checkRoleName()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -52,18 +52,18 @@
|
||||
</div>
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
<div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px"
|
||||
<div id="supplierDlg" class="easyui-dialog" style="padding:10px 40px" fit="true"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
|
||||
<form id="supplierFM">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 80px;height: 20px">名称</td>
|
||||
<td style="width: 180px;padding:5px">
|
||||
<td style="width: 120px;height: 20px">名称</td>
|
||||
<td style="width: 250px;padding:5px">
|
||||
<input name="supplier" id="supplier" class="easyui-textbox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 160px;"/>
|
||||
</td>
|
||||
<td style="width: 60px;height: 20px">联系人</td>
|
||||
<td style="width:180px;padding:5px;">
|
||||
<td style="width: 120px;height: 20px">联系人</td>
|
||||
<td style="width:250px;padding:5px;">
|
||||
<input name="contacts" id="contacts" class="easyui-textbox" style="width: 160px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -134,13 +134,13 @@
|
||||
<tr>
|
||||
<td>地址</td>
|
||||
<td style="padding:5px" colspan="3">
|
||||
<input name="address" id="address" class="easyui-textbox" style="width: 401px;"/>
|
||||
<input name="address" id="address" class="easyui-textbox" style="width: 530px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:5px" colspan="3">
|
||||
<input name="description" id="description" class="easyui-textbox" data-options="multiline:true" style="width: 401px;height: 40px;"/>
|
||||
<input name="description" id="description" class="easyui-textbox" data-options="multiline:true" style="width: 530px;height: 40px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -345,6 +345,9 @@
|
||||
|
||||
//保存信息
|
||||
$("#savePerson").off("click").on("click", function () {
|
||||
if(!$('#personFM').form('validate')){
|
||||
return;
|
||||
}
|
||||
if (!$("#Type").val()) {
|
||||
$.messager.alert('提示', '请选择类型!', 'warning');
|
||||
return;
|
||||
|
||||
@@ -65,7 +65,7 @@ public class RoleComponent implements ICommonQuery {
|
||||
|
||||
@Override
|
||||
public int checkIsNameExist(Long id, String name)throws Exception {
|
||||
return 0;
|
||||
return roleService.checkIsNameExist(id, name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -136,6 +136,18 @@ public class RoleService {
|
||||
return result;
|
||||
}
|
||||
|
||||
public int checkIsNameExist(Long id, String name) throws Exception{
|
||||
RoleExample example = new RoleExample();
|
||||
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<Role> list =null;
|
||||
try{
|
||||
list=roleMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
|
||||
public List<Role> findUserRole()throws Exception{
|
||||
RoleExample example = new RoleExample();
|
||||
example.setOrderByClause("Id");
|
||||
|
||||
Reference in New Issue
Block a user