mirror of https://gitee.com/stylefeng/guns
Merge remote-tracking branch 'origin/group2'
commit
84517ec302
|
@ -1,11 +1,10 @@
|
|||
layui.use(['table', 'admin', 'ax', 'form', 'func', 'ajaxUtil', 'dropdown','util'], function () {
|
||||
layui.use(['table', 'form', 'func', 'HttpRequest', 'xmSelect', 'util'], function () {
|
||||
var $ = layui.$;
|
||||
var table = layui.table;
|
||||
var form = layui.form;
|
||||
var func = layui.func;
|
||||
var ajaxUtil = layui.ajaxUtil;
|
||||
var dropdown = layui.dropdown;
|
||||
var util = layui.util;
|
||||
var HttpRequest = layui.HttpRequest;
|
||||
var xmSelect = layui.xmSelect;
|
||||
|
||||
// 职位表管理
|
||||
var Organization = {
|
||||
|
@ -16,17 +15,11 @@ layui.use(['table', 'admin', 'ax', 'form', 'func', 'ajaxUtil', 'dropdown','util'
|
|||
Organization.initColumn = function () {
|
||||
return [[
|
||||
{type: 'checkbox'},
|
||||
{field: 'positionId', hide: true, title: '主键id'},
|
||||
{field: 'positionName', sort: true, title: '职位名称'},
|
||||
{field: 'positionCode', sort: true, title: '职位编码'},
|
||||
{field: 'positionRemark', sort: true, title: '备注'},
|
||||
{field: 'createTime', sort: true, title: '创建时间',templet: function (d) {
|
||||
return util.toDateString(d.createTime);
|
||||
}},
|
||||
{field: 'updateTime', sort: true, title: '更新时间',templet: function (d) {
|
||||
console.log(d.updateTime);
|
||||
return d.updateTime==null?'': util.toDateString(d.updateTime);
|
||||
}},
|
||||
{field: 'orgId', hide: true, title: '主键id'},
|
||||
{field: 'orgName', sort: true, title: '机构名称'},
|
||||
{field: 'orgCode', sort: true, title: '机构编码'},
|
||||
{field: 'orgSort', sort: true, title: '排序'},
|
||||
{field: 'orgRemark', sort: true, title: '备注'},
|
||||
{field: 'statusFlag', sort: true, templet: '#statusTpl', title: '状态'},
|
||||
{align: 'center', toolbar: '#tableBar', title: '操作'}
|
||||
]];
|
||||
|
@ -35,8 +28,7 @@ layui.use(['table', 'admin', 'ax', 'form', 'func', 'ajaxUtil', 'dropdown','util'
|
|||
// 点击查询按钮
|
||||
Organization.search = function () {
|
||||
var queryData = {};
|
||||
queryData['positionName'] = $("#positionName").val();
|
||||
//queryData['positionCode'] = $("#positionCode").val();
|
||||
queryData['orgName'] = $("#orgName").val();
|
||||
table.reload(Organization.tableId, {
|
||||
where: queryData,
|
||||
page: {curr: 1}
|
||||
|
@ -47,7 +39,7 @@ layui.use(['table', 'admin', 'ax', 'form', 'func', 'ajaxUtil', 'dropdown','util'
|
|||
Organization.openAddDlg = function () {
|
||||
func.open({
|
||||
height: 800,
|
||||
title: '添加职位',
|
||||
title: '添加机构',
|
||||
content: Feng.ctxPath + '/hrOrganization/addView',
|
||||
tableId: Organization.tableId
|
||||
});
|
||||
|
@ -57,8 +49,8 @@ layui.use(['table', 'admin', 'ax', 'form', 'func', 'ajaxUtil', 'dropdown','util'
|
|||
Organization.openEditDlg = function (data) {
|
||||
func.open({
|
||||
height: 800,
|
||||
title: '修改职位',
|
||||
content: Feng.ctxPath + '/organization/editView?positionId=' + data.positionId,
|
||||
title: '修改机构',
|
||||
content: Feng.ctxPath + '/organization/editView?orgId=' + data.orgId,
|
||||
tableId: Organization.tableId
|
||||
});
|
||||
};
|
||||
|
@ -76,7 +68,7 @@ layui.use(['table', 'admin', 'ax', 'form', 'func', 'ajaxUtil', 'dropdown','util'
|
|||
// 点击删除
|
||||
Organization.delete = function (data) {
|
||||
var operation = function () {
|
||||
ajaxUtil.post(Feng.ctxPath + "/hrOrganization/delete", {"positionId":data.positionId},function (data) {
|
||||
ajaxUtil.post(Feng.ctxPath + "/hrOrganization/delete", {"orgId":data.positionId},function (data) {
|
||||
Feng.success("删除成功!");
|
||||
table.reload(Organization.tableId);
|
||||
},function (data) {
|
||||
|
@ -88,7 +80,7 @@ layui.use(['table', 'admin', 'ax', 'form', 'func', 'ajaxUtil', 'dropdown','util'
|
|||
|
||||
// 修改职位状态
|
||||
Organization.updateStatus = function (positionId, checked) {
|
||||
ajaxUtil.post(Feng.ctxPath + "/hrOrganization/updateStatus", {"positionId":positionId,"statusFlag":checked},function (data) {
|
||||
ajaxUtil.post(Feng.ctxPath + "/hrOrganization/updateStatus", {"orgId":positionId,"statusFlag":checked},function (data) {
|
||||
Feng.success("修改成功!");
|
||||
},function (data) {
|
||||
Feng.error("修改失败!" + data.responseJSON.message);
|
||||
|
@ -132,7 +124,6 @@ layui.use(['table', 'admin', 'ax', 'form', 'func', 'ajaxUtil', 'dropdown','util'
|
|||
} else if (event === 'delete') {
|
||||
Organization.delete(data);
|
||||
}
|
||||
dropdown.hideAll();
|
||||
});
|
||||
|
||||
// 修改状态
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
layui.use(['form', 'admin', 'ax', 'ajaxUtil'], function () {
|
||||
layui.use(['form', 'admin', 'HttpRequest'], function () {
|
||||
var form = layui.form;
|
||||
var admin = layui.admin;
|
||||
var ajaxUtil = layui.ajaxUtil;
|
||||
var HttpRequest = layui.HttpRequest;
|
||||
|
||||
//表单提交事件
|
||||
form.on('submit(btnSubmit)', function (data) {
|
||||
ajaxUtil.post(Feng.ctxPath + "/hrOrganization/add", data.field, function (res) {
|
||||
var request = new HttpRequest(Feng.ctxPath + "/hrOrganization/add", 'post', function (data) {
|
||||
admin.closeThisDialog();
|
||||
Feng.success("添加成功!");
|
||||
admin.putTempData('formOk', true);
|
||||
|
||||
}, function (res) {
|
||||
}, function (data) {
|
||||
admin.closeThisDialog();
|
||||
Feng.error("添加失败!" + res.responseJSON.message);
|
||||
Feng.error("添加失败!" + data.message);
|
||||
});
|
||||
request.set(data.field);
|
||||
request.start(true);
|
||||
});
|
||||
});
|
|
@ -1,25 +1,25 @@
|
|||
layui.use(['form', 'admin', 'ajaxUtil'], function () {
|
||||
layui.use(['form', 'admin', 'HttpRequest'], function () {
|
||||
var form = layui.form;
|
||||
var admin = layui.admin;
|
||||
var ajaxUtil = layui.ajaxUtil;
|
||||
//获取详情信息,填充表单
|
||||
var HttpRequest = layui.HttpRequest;
|
||||
|
||||
ajaxUtil.get("/hrOrganization/detail?orgId=" + Feng.getUrlParam("positionId"), function (res) {
|
||||
form.val('positionForm', res.data);
|
||||
}, function (res) {
|
||||
admin.closeThisDialog();
|
||||
Feng.error("编辑异常!" + res.responseJSON.message);
|
||||
});
|
||||
//获取信息详情填充表单
|
||||
var request = new HttpRequest(Feng.ctxPath + "/hrOrganization/detail?orgId=" + Feng.getUrlParam("orgId"), 'get');
|
||||
var result = request.start();
|
||||
console.log(result);
|
||||
form.val('organizationForm', result.data);
|
||||
|
||||
//表单提交事件
|
||||
form.on('submit(btnSubmit)', function (data) {
|
||||
ajaxUtil.post(Feng.ctxPath + "/hrOrganization/edit", data.field, function (res) {
|
||||
var request = new HttpRequest(Feng.ctxPath + "/hrOrganization/edit", 'post', function (data) {
|
||||
admin.closeThisDialog();
|
||||
Feng.success("修改成功!");
|
||||
admin.putTempData('formOk', true);
|
||||
}, function (data) {
|
||||
admin.closeThisDialog();
|
||||
}, function (res) {
|
||||
admin.closeThisDialog();
|
||||
Feng.error("修改失败!" + res.responseJSON.message);
|
||||
Feng.error("修改失败!" + data.message);
|
||||
});
|
||||
request.set(data.field);
|
||||
request.start(true);
|
||||
});
|
||||
});
|
|
@ -1,10 +1,9 @@
|
|||
layui.use(['table', 'admin', 'form', 'func', 'HttpRequest', 'dropdown', 'util'], function () {
|
||||
layui.use(['table', 'form', 'func', 'HttpRequest', 'util'], function () {
|
||||
var $ = layui.$;
|
||||
var table = layui.table;
|
||||
var form = layui.form;
|
||||
var func = layui.func;
|
||||
var HttpRequest = layui.HttpRequest;
|
||||
var dropdown = layui.dropdown;
|
||||
var util = layui.util;
|
||||
|
||||
// 职位表管理
|
||||
|
|
|
@ -2,10 +2,8 @@ layui.use(['form', 'admin', 'HttpRequest'], function () {
|
|||
var form = layui.form;
|
||||
var admin = layui.admin;
|
||||
var HttpRequest = layui.HttpRequest;
|
||||
//获取详情信息,填充表单
|
||||
|
||||
|
||||
//获取用户详情
|
||||
//获取信息详情填充表单
|
||||
var request = new HttpRequest(Feng.ctxPath + "/hrPosition/detail?positionId=" + Feng.getUrlParam("positionId"), 'get');
|
||||
var result = request.start();
|
||||
form.val('positionForm', result.data);
|
||||
|
@ -13,9 +11,9 @@ layui.use(['form', 'admin', 'HttpRequest'], function () {
|
|||
//表单提交事件
|
||||
form.on('submit(btnSubmit)', function (data) {
|
||||
var request = new HttpRequest(Feng.ctxPath + "/hrPosition/edit", 'post', function (data) {
|
||||
admin.closeThisDialog();
|
||||
Feng.success("修改成功!");
|
||||
admin.putTempData('formOk', true);
|
||||
admin.closeThisDialog();
|
||||
}, function (data) {
|
||||
admin.closeThisDialog();
|
||||
Feng.error("修改失败!" + data.message);
|
||||
|
|
|
@ -30,8 +30,20 @@
|
|||
<div class="layui-col-md9">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body" style="padding: 10px;">
|
||||
<div class="layui-form toolbar">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<input id="orgName" class="layui-input" type="text" placeholder="机构名称"/>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button id="btnSearch" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button>
|
||||
<button id="btnAdd" class="layui-btn icon-btn"><i class="layui-icon"></i>添加</button>
|
||||
<button id="btnExp" class="layui-btn icon-btn"><i class="layui-icon"></i>导出</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 数据表格 -->
|
||||
<table id="organizationUserTable" lay-filter="organizationUserTable"></table>
|
||||
<table id="organizationTable" lay-filter="organizationTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -41,21 +53,6 @@
|
|||
<script type="text/html" id="tableBar">
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete">删除</a>
|
||||
<a class="layui-btn layui-btn-xs" data-dropdown="#userTbDrop{{d.LAY_INDEX}}" no-shade="true">
|
||||
更多<i class="layui-icon layui-icon-drop" style="font-size: 12px;margin-right: 0;"></i></a>
|
||||
<!-- 下拉菜单 -->
|
||||
<ul class="dropdown-menu-nav dropdown-bottom-right layui-hide" id="userTbDrop{{d.LAY_INDEX}}">
|
||||
<div class="dropdown-anchor"></div>
|
||||
<li><a lay-event="lock"><i class="layui-icon layui-icon-password"></i>锁定用户</a></li>
|
||||
<li><a lay-event="reset"><i class="layui-icon layui-icon-key"></i>重置密码</a></li>
|
||||
<li class="have-more show-left">
|
||||
<a><i class="layui-icon layui-icon-upload-drag"></i>上传资料 </a>
|
||||
<ul class="dropdown-menu-nav-child">
|
||||
<li><a><i class="layui-icon layui-icon-camera"></i>上传头像</a></li>
|
||||
<li><a><i class="layui-icon layui-icon-picture-fine"></i>上传照片</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="statusTpl">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@layout("/layout/_form.html",{js:["/assets/modular/system/organization/organization_add.js"]}){
|
||||
|
||||
<form class="layui-form" id="positionForm" lay-filter="positionForm">
|
||||
<form class="layui-form" id="organizationForm" lay-filter="organizationForm">
|
||||
<div class="layui-fluid" style="padding-bottom: 75px;">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">基本信息</div>
|
||||
|
@ -9,27 +9,27 @@
|
|||
<input name="positionId" type="hidden"/>
|
||||
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label">职位名称<span style="color: red;">*</span></label>
|
||||
<label class="layui-form-label">机构名称<span style="color: red;">*</span></label>
|
||||
<div class="layui-input-block">
|
||||
<input id="positionName" name="positionName" placeholder="请输入职位名称" type="text" class="layui-input" lay-verify="required" required/>
|
||||
<input id="orgName" name="orgName" placeholder="请输入机构名称" type="text" class="layui-input" lay-verify="required" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label">职位编码<span style="color: red;">*</span></label>
|
||||
<label class="layui-form-label">机构编码<span style="color: red;">*</span></label>
|
||||
<div class="layui-input-block">
|
||||
<input id="positionCode" name="positionCode" placeholder="请输入职位编码" type="text" class="layui-input" lay-verify="required" required/>
|
||||
<input id="orgCode" name="orgCode" placeholder="请输入机构编码" type="text" class="layui-input" lay-verify="required" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label">顺序<span style="color: red;">*</span></label>
|
||||
<div class="layui-input-block">
|
||||
<input id="positionSort" name="positionSort" placeholder="请输入顺序" type="text" class="layui-input" lay-verify="required" required/>
|
||||
<input id="orgSort" name="orgSort" placeholder="请输入顺序" type="text" class="layui-input" lay-verify="required" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label">备注<span style="color: red;">*</span></label>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="positionRemark" name="positionRemark" placeholder="请输入备注" class="layui-textarea" lay-verify="required" required></textarea>
|
||||
<textarea id="orgRemark" name="orgRemark" placeholder="请输入备注" class="layui-textarea" lay-verify="required" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@layout("/layout/_form.html",{js:["/assets/modular/system/organization/organization_edit.js"]}){
|
||||
|
||||
<form class="layui-form" id="positionForm" lay-filter="positionForm">
|
||||
<form class="layui-form" id="organizationForm" lay-filter="organizationForm">
|
||||
<div class="layui-fluid" style="padding-bottom: 75px;">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">基本信息</div>
|
||||
|
@ -9,27 +9,27 @@
|
|||
<input name="positionId" type="hidden"/>
|
||||
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label">职位名称<span style="color: red;">*</span></label>
|
||||
<label class="layui-form-label">机构名称<span style="color: red;">*</span></label>
|
||||
<div class="layui-input-block">
|
||||
<input id="positionName" name="positionName" placeholder="请输入职位名称" type="text" class="layui-input" lay-verify="required" required/>
|
||||
<input id="orgName" name="orgName" placeholder="请输入机构名称" type="text" class="layui-input" lay-verify="required" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label">职位编码<span style="color: red;">*</span></label>
|
||||
<label class="layui-form-label">机构编码<span style="color: red;">*</span></label>
|
||||
<div class="layui-input-block">
|
||||
<input id="positionCode" name="positionCode" placeholder="请输入职位编码" type="text" class="layui-input" lay-verify="required" required/>
|
||||
<input id="orgCode" name="orgCode" placeholder="请输入机构编码" type="text" class="layui-input" lay-verify="required" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label">顺序<span style="color: red;">*</span></label>
|
||||
<div class="layui-input-block">
|
||||
<input id="positionSort" name="positionSort" placeholder="请输入顺序" type="text" class="layui-input" lay-verify="required" required/>
|
||||
<input id="orgSort" name="orgSort" placeholder="请输入顺序" type="text" class="layui-input" lay-verify="required" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label">备注<span style="color: red;">*</span></label>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="positionRemark" name="positionRemark" placeholder="请输入备注" class="layui-textarea" lay-verify="required" required></textarea>
|
||||
<textarea id="orgRemark" name="orgRemark" placeholder="请输入备注" class="layui-textarea" lay-verify="required" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue