Browse Source

[feat]工程员添加时为当前操作人不可该,编辑是可选范围增加到在角色组gcwyRole,gcjlRole,gczgRole,yfzjRole范围中的用户。

dev
zhangsiqi 6 months ago
parent
commit
f33832c750
  1. 2
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java
  2. 10
      ruoyi-admin/src/main/resources/templates/erp/material/add.html
  3. 20
      ruoyi-admin/src/main/resources/templates/erp/material/edit.html

2
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java

@ -399,7 +399,7 @@ public class ErpMaterialController extends BaseController
@ResponseBody
public TableDataInfo getEngineerList(){
startPage();
List<SysUser> list = sysUserService.selectRoleToUserList("gcwyRole");
List<SysUser> list = sysUserService.selectRoleToUserList("gcwyRole,gcjlRole,gczgRole,yfzjRole,");
return getDataTable(list);
}
}

10
ruoyi-admin/src/main/resources/templates/erp/material/add.html

@ -91,9 +91,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">工程员:</label>
<div class="col-sm-8">
<select name="businessMembers" id="businessMembers_add" class="form-control m-b" required >
<option value="">请选择</option>
</select>
<input name="businessMembers" id="businessMembers_add" class="form-control m-b" disabled required />
</div>
</div>
<div class="form-group">
@ -174,10 +172,12 @@
}
})
var prefix = ctx + "erp/material"
var prefix = ctx + "erp/material";
var userName = [[${@permission.getPrincipalProperty('userName')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
//获取工程员
$(function(){
$("#businessMembers_add").val(userName);
$.ajax({
url: ctx + 'erp/material/getEngineerList',
type: 'get',

20
ruoyi-admin/src/main/resources/templates/erp/material/edit.html

@ -85,7 +85,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">工程员:</label>
<div class="col-sm-8">
<select name="businessMembers" th:field="*{businessMembers}" id="businessMembers_edit" class="form-control m-b" required >
<select name="businessMembers" id="businessMembers_edit" class="form-control m-b" required >
<option value="">未选择</option>
</select>
</div>
@ -269,6 +269,24 @@
}
});
})
//获取工程员
$(function(){
$.ajax({
url: ctx + 'erp/material/getEngineerList',
type: 'get',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
} else {
$.modal.msgError(res.msg);
}
}
});
})
var materialType = $("#materialType").val();
$("#selectMaterialType").val(materialType).trigger("change");
function submitHandler() {

Loading…
Cancel
Save