Browse Source

[feat] 工程管理

产品型号管理后端controller层新增查询所有工程员的接口
产品型号管理前端列表页面:新增查询所有工程员的js方法,工程员筛选修改为下拉选择
dev
liuxiaoxu 2 months ago
parent
commit
91aff0835d
  1. 19
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysProductModelController.java
  2. 31
      ruoyi-admin/src/main/resources/templates/system/model/model.html

19
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysProductModelController.java

@ -3,11 +3,13 @@ package com.ruoyi.system.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysProductModel;
import com.ruoyi.system.service.ISysProductModelService;
import com.ruoyi.system.service.ISysUserService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -31,6 +33,10 @@ public class SysProductModelController extends BaseController
@Autowired
private ISysProductModelService sysProductModelService;
@Autowired
private ISysUserService sysUserService;
@RequiresPermissions("system:model:view")
@GetMapping()
public String model()
@ -145,4 +151,17 @@ public class SysProductModelController extends BaseController
}
/**
* 查询工程员列表
* */
@GetMapping ("/getEngineerList")
@ResponseBody
public TableDataInfo getEngineerList(){
startPage();
List<SysUser> list = sysUserService.selectRoleToUserList("gcwyRole,gcjlRole,gczgRole,yfzjRole,");
return getDataTable(list);
}
}

31
ruoyi-admin/src/main/resources/templates/system/model/model.html

@ -32,7 +32,9 @@
</li>
<li>
<label>工程员:</label>
<input type="text" name="engineer"/>
<select name="engineer">
<option value="">所有</option>
</select>
</li>
<li class="select-time">
<label>录入时间:</label>
@ -68,8 +70,14 @@
var removeFlag = [[${@permission.hasPermi('system:model:remove')}]];
var cancelFlag = [[${@permission.hasPermi('system:model:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('system:model:restore')}]];
var userName = [[${@permission.getPrincipalProperty('userName')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var prefix = ctx + "system/model";
$(function() {
engineer();
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
@ -113,6 +121,27 @@
};
$.table.init(options);
});
//查询工程员
function engineer(){
$.ajax({
url: prefix + '/getEngineerList',
type: 'get',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("select[name='engineer']").append(
"<option value='" + usertData[i].loginName + "'>" + usertData[i].userName + "</option>");
}
} else {
$.modal.msgError(res.msg);
}
}
});
}
</script>
</body>
</html>
Loading…
Cancel
Save