提交 f34850dc 编写于 作者: doc_wei's avatar doc_wei

【删除】删除员工信息数据字典功能

上级 c3dab8a2
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$;
$.each(parent.typeList, function(key, value){
$("#typeId").append('<option value="' + key + '">' + value + '</option>');
});
matchingLanguage();
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
typeName: $("#typeName").val(),
typeId: $("#typeId").val()
};
AjaxPostUtil.request({url: reqBasePath + "sysstaffdatadictionary002", params: params, type: 'json', callback: function (json) {
if (json.returnCode == 0) {
parent.layer.close(index);
parent.refreshCode = '0';
} else {
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}});
}
return false;
});
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$;
showGrid({
id: "showForm",
url: reqBasePath + "sysstaffdatadictionary003",
params: {rowId:parent.rowId},
pagination: false,
template: getFileContent('tpl/sysStaffDataDictionary/sysStaffDataDictionaryEditTemplate.tpl'),
ajaxSendAfter:function (json) {
matchingLanguage();
form.on('submit(formEditBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
rowId: parent.rowId,
typeName: $("#typeName").val()
};
AjaxPostUtil.request({url: reqBasePath + "sysstaffdatadictionary004", params: params, type: 'json', callback: function (json) {
if (json.returnCode == 0) {
parent.layer.close(index);
parent.refreshCode = '0';
} else {
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}});
}
return false;
});
}
});
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
var rowId = "";
var typeList = {
"1": "政治面貌",
"2": "学历",
"3": "教育背景学习形式",
"4": "教育背景学校性质",
"5": "奖惩分类",
"6": "语种",
"7": "家庭情况与本人关系",
"8": "证件类型",
"9": "合同类别",
"10": "合同类型",
"11": "证书类型"
};
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
table = layui.table;
authBtn('1599919580170');
$.each(typeList, function(key, value){
$("#typeId").append('<option value="' + key + '">' + value + '</option>');
});
initTable();
function initTable(){
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: reqBasePath + 'sysstaffdatadictionary001',
where: getTableParams(),
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers'},
{ field: 'name', title: '名称', align: 'left', width: 160 },
{ field: 'typeId', title: '字典类型', rowspan: 2, width: 150, templet: function (d) {
return typeList[d.typeId];
}},
{ field: 'state', title: '状态', rowspan: 2, width: 90, templet: function (d) {
if(d.state == '1'){
return "<span class='state-new'>启用</span>";
}else if(d.state == '2'){
return "<span class='state-down'>禁用</span>";
}
}},
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], align: 'left', width: 120 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 100 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 100 },
{ field: 'lastUpdateTime', title: '最后修改时间', align: 'center', width: 100},
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 257, toolbar: '#tableBar'}
]],
done: function(){
matchingLanguage();
}
});
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'edit') { // 编辑
edit(data);
}else if (layEvent === 'delet') { // 删除
delet(data);
}else if (layEvent === 'up') { // 启用
up(data);
}else if (layEvent === 'down') { // 禁用
down(data);
}
});
}
form.render();
// 添加
$("body").on("click", "#addBean", function() {
_openNewWindows({
url: "../../tpl/sysStaffDataDictionary/sysStaffDataDictionaryAdd.html",
title: systemLanguage["com.skyeye.addPageTitle"][languageType],
pageId: "sysStaffDataDictionaryAdd",
area: ['90vw', '90vh'],
callBack: function(refreshCode){
if (refreshCode == '0') {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
} else if (refreshCode == '-9999') {
winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2, time: 2000});
}
}});
});
// 编辑
function edit(data){
rowId = data.id;
_openNewWindows({
url: "../../tpl/sysStaffDataDictionary/sysStaffDataDictionaryEdit.html",
title: systemLanguage["com.skyeye.editPageTitle"][languageType],
pageId: "sysStaffDataDictionaryEdit",
area: ['90vw', '90vh'],
callBack: function(refreshCode){
if (refreshCode == '0') {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
} else if (refreshCode == '-9999') {
winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2, time: 2000});
}
}
});
}
// 删除
function delet(data){
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function(index){
layer.close(index);
AjaxPostUtil.request({url: reqBasePath + "sysstaffdatadictionary007", params:{rowId: data.id}, type: 'json', callback: function (json) {
if (json.returnCode == 0) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
} else {
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}});
});
}
// 启用
function up(data){
layer.confirm('确认启用选中数据吗?', { icon: 3, title: '启用操作' }, function (index) {
layer.close(index);
AjaxPostUtil.request({url: reqBasePath + "sysstaffdatadictionary006", params:{rowId: data.id}, type: 'json', callback: function (json) {
if (json.returnCode == 0) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
} else {
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}});
});
}
// 禁用
function down(data){
layer.confirm('确认禁用选中数据吗?', { icon: 3, title: '禁用操作' }, function (index) {
layer.close(index);
AjaxPostUtil.request({url: reqBasePath + "sysstaffdatadictionary005", params:{rowId: data.id}, type: 'json', callback: function (json) {
if (json.returnCode == 0) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
} else {
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}});
});
}
// 搜索表单
$("body").on("click", "#formSearch", function() {
table.reload("messageTable", {page: {curr: 1}, where: getTableParams()});
});
// 刷新数据
$("body").on("click", "#reloadTable", function() {
loadTable();
});
function loadTable(){
table.reload("messageTable", {where: getTableParams()});
}
function getTableParams(){
return {
typeName: $("#typeName").val(),
state: $("#state").val(),
typeId: $("#typeId").val()
};
}
exports('sysStaffDataDictionaryList', {});
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">名称<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="typeName" name="typeName" win-verify="required" placeholder="请输入名称" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">字典类型<i class="red">*</i></label>
<div class="layui-input-block">
<select lay-filter="typeId" lay-search="" id="typeId">
</select>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formAddBean"><language showName="com.skyeye.save"></language></button>
</div>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/sysStaffDataDictionary/'}).use('sysStaffDataDictionaryAdd');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="padding:20px; margin:0 auto;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/sysStaffDataDictionary/'}).use('sysStaffDataDictionaryEdit');
</script>
</body>
</html>
\ No newline at end of file
{{#bean}}
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">名称<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="typeName" name="typeName" win-verify="required" placeholder="请输入名称" class="layui-input" value="{{name}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formEditBean"><language showName="com.skyeye.save"></language></button>
</div>
</div>
{{/bean}}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div class="txtcenter" style="margin:0 auto; padding-top:10px;">
<form class="layui-form layui-form-pane" action="" autocomplete="off">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">字典类型</label>
<div class="layui-input-inline">
<select lay-filter="typeId" lay-search="" id="typeId">
<option value="">全部</option>
</select>
</div>
<label class="layui-form-label">名称</label>
<div class="layui-input-inline">
<input type="text" id="typeName" name="typeName" placeholder="请输入名称" class="layui-input" />
</div>
<label class="layui-form-label">状态</label>
<div class="layui-input-inline">
<select lay-filter="state" lay-search="" id="state">
<option value="">全部</option>
<option value="1">启用</option>
<option value="2">禁用</option>
</select>
</div>
<button type="reset" class="layui-btn layui-btn-primary list-form-search"><language showName="com.skyeye.reset"></language></button>
<button class="layui-btn list-form-search" type="button" id="formSearch"><language showName="com.skyeye.search2"></language></button>
</div>
</div>
</form>
</div>
<div class="winui-toolbar">
<div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
<button id="addBean" class="winui-toolbtn" auth="1599919580170"><i class="fa fa-plus" aria-hidden="true"></i><language showName="com.skyeye.addBtn"></language></button>
</div>
</div>
<div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
{{# if(auth('1599919588392')){ }}
<a class="layui-btn layui-btn-xs" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# } }}
{{# if(auth('1599919611408')){ }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="delet"><language showName="com.skyeye.deleteBtn"></language></a>
{{# } }}
{{# if(auth('1599919596384') && d.state == '1'){ }}
<a class="layui-btn layui-btn-xs layui-btn-warm" lay-event="down"><language showName="com.skyeye.disableBtn"></language></a>
{{# } }}
{{# if(auth('1599919603762') && d.state == '2'){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="up"><language showName="com.skyeye.enableBtn"></language></a>
{{# } }}
</script>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/sysStaffDataDictionary/'}).use('sysStaffDataDictionaryList');
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册