优化新增部门时验证用户所属部门

master
RuoYi 2021-11-24 11:45:11 +08:00
parent 7414626137
commit 366459e8f3
1 changed files with 9 additions and 4 deletions

View File

@ -6,12 +6,12 @@
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-dept-add"> <form class="form-horizontal m" id="form-dept-add">
<input id="treeId" name="parentId" type="hidden" th:value="${dept.deptId}" /> <input id="treeId" name="parentId" type="hidden" th:value="${dept?.deptId}" />
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">上级部门:</label> <label class="col-sm-3 control-label is-required">上级部门:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group"> <div class="input-group">
<input class="form-control" type="text" onclick="selectDeptTree()" id="treeName" readonly="true" th:value="${dept.deptName}"> <input class="form-control" type="text" onclick="selectDeptTree()" id="treeName" readonly="true" th:value="${dept?.deptName}" required>
<span class="input-group-addon"><i class="fa fa-search"></i></span> <span class="input-group-addon"><i class="fa fa-search"></i></span>
</div> </div>
</div> </div>
@ -108,10 +108,15 @@
/*部门管理-新增-选择父部门树*/ /*部门管理-新增-选择父部门树*/
function selectDeptTree() { function selectDeptTree() {
var treeId = $("#treeId").val();
if ($.common.isEmpty(treeId)) {
$.modal.alertWarning("请先添加用户所属的部门!");
return;
}
var options = { var options = {
title: '部门选择', title: '部门选择',
width: "380", width: "380",
url: prefix + "/selectDeptTree/" + $("#treeId").val(), url: prefix + "/selectDeptTree/" + treeId,
callBack: doSubmit callBack: doSubmit
}; };
$.modal.openOptions(options); $.modal.openOptions(options);