<!DOCTYPE html>
|
<html>
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<title>月度工资报表</title>
|
<meta name="renderer" content="webkit">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
|
<script src="../../../layuiadmin/layui/layui.js"></script>
|
<script src="../../../layuiadmin/layui/layui.js"></script>
|
<script src="../../../layuiadmin/Scripts/json2.js"></script>
|
<script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
|
<script src="../../../layuiadmin/Scripts/webConfig.js"></script>
|
<script src="../../../layuiadmin/PubCustom.js"></script>
|
<script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
|
</head>
|
<body>
|
<div class="layui-fluid">
|
<div class="layui-col-md12">
|
<div class="layui-card" style="padding: 1px">
|
<div class="layui-card-body" style="padding: 1px;">
|
<form class="layui-form" action="" lay-filter="component-form-group">
|
<div class="layui-collapse">
|
<div class="layui-colla-item">
|
<div class="layui-colla-title layui-inline">
|
<div class="layui-inline">
|
<span>更多</span>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">日期</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" id="HBeginDate" style="width:190px;">
|
</div>
|
</div>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
|
</div>
|
</div>
|
</div>
|
<table class="" id="mainTable" lay-filter="mainTable"></table>
|
<script type="text/html" id="toolbarDemo">
|
<div class="layui-btn-container">
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
|
</div>
|
</script>
|
</form>
|
</div>
|
</div>
|
</div>
|
</div>
|
<script type="text/javascript">
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index', //主入口模块
|
}).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
|
//#region 公共变量
|
var $ = layui.$
|
, admin = layui.admin
|
, layer = layui.layer
|
, table = layui.table
|
, form = layui.form
|
, element = layui.element
|
, laypage = layui.laypage
|
, laydate = layui.laydate
|
, util = layui.util
|
//查询条件
|
var sWhere = "";
|
var option = []; var columns = [];
|
var Name = "MouldProdInHouseCellWidth";
|
//#endregion
|
//年月选择器
|
laydate.render({
|
elem: '#HBeginDate'
|
, type: 'month'
|
});
|
//#region 进入页面既加载
|
set_ClearBill();
|
//#endregion
|
//#region 点击事件包括on form事件等
|
//头工具栏事件
|
table.on('toolbar(mainTable)', function (obj) {
|
switch (obj.event) {
|
//新增按钮
|
case 'btn-Add': set_AddNew();
|
break;
|
//编辑按钮
|
case 'btn-Edit': set_ShowBill();
|
break;
|
//删除按钮
|
case 'btn-Delete': set_DeleteBill();
|
break;
|
//浏览
|
case 'btn-view': get_ViewReport();
|
break;
|
//打印
|
case 'btn-print': get_PrintReport();
|
break;
|
//刷新
|
case 'get_Refresh': set_Refresh();
|
break;
|
|
//退出
|
case 'get_Exit': Pub_Close(2);
|
break;
|
//分配
|
case 'btn-fp': set_Distribut();
|
break;
|
//发布
|
case 'btn-fb': set_Release();
|
break;
|
//优先级
|
case 'btn-yxj': set_Yxj();
|
break;
|
case 'btn-back': set_Back();
|
break;
|
};
|
});
|
//重置按钮
|
form.on('submit(btnReSearch)', function (data) {
|
set_ClearQuery();
|
});
|
//查询按钮
|
form.on('submit(btnSearch)', function (data) {
|
get_FastQuery(table, option);
|
});
|
//#endregion
|
//#region 此页面所有方法
|
function set_ClearBill() {
|
//初始化表格
|
//set_InitGrid();
|
$("#HBeginDate").val(Format(new Date(), "yyyy-MM"));
|
//直接执行列表筛选 加载数据到网格
|
get_FastQuery(table, option)
|
}
|
//初始化表格
|
function set_InitGrid() {
|
$.ajax({
|
url: GetWEBURL() + '/Pay_MonthlySalaryReport/list2',
|
type: "GET",
|
async: false,
|
data: { "sWhere": $("#HBeginDate").val()},
|
success: function (data1) {
|
if (data1.count == 1) {
|
columns = data1.data;
|
columns.unshift({ type: 'checkbox', fixed: 'left', totalRowText: '合计' });
|
} else {
|
layer.alert(data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, page: true
|
, cellMinWidth: 120
|
, totalRow: true
|
, limit: 500
|
, height: 'full-50'
|
, cols: [columns]
|
, limits: [500, 5000, 20000]
|
, done: function (res, curr, count) {
|
|
}
|
};
|
////设置列宽
|
//var colWidth = getColumnsWidth();
|
//if (colWidth == "" || colWidth == []) {
|
|
//}
|
//else {
|
// $.each(columns, function (x, m) {
|
// m["width"] = colWidth[x];
|
// });
|
//}
|
}
|
//加载网格
|
function get_Display(sWhere) {
|
set_InitGrid();
|
var wait = layer.load();//遮罩
|
$.ajax({
|
url: GetWEBURL() + '/Pay_MonthlySalaryReport/list',
|
type: "GET",
|
data: { "sWhere": sWhere},
|
success: function (data1) {
|
if (data1.count == 1) {
|
DataList = data1.data;
|
option.data = data1.data;
|
table.render(option);
|
layer.close(wait);
|
} else {
|
layer.close(wait);
|
layer.alert(data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(wait);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
//获取列宽
|
function getColumnsWidth() {
|
var result = [];
|
var colNum = $(".layui-table-header").find("tr").eq(0).find("th").length;
|
//获取列宽
|
$.ajax({
|
url: GetWEBURL() + '/Cg_POOrderBill/list',
|
async: false,
|
type: "Get",
|
dataType: "json",
|
data: { "colNum": colNum, "Name": Name },
|
success: function (data1) {
|
if (data1.code == 1) {
|
result = data1.data;
|
}
|
else if (data1.code == -1) {
|
|
}
|
else {
|
layer.alert(data1.Message, { icon: 5 });
|
}
|
}, error: function (e) {
|
layer.alert(e.Message, { icon: 5 });
|
}
|
});
|
|
return result;
|
}
|
//保存列宽
|
function set_SaveGridColWidth() {
|
var arr = [];
|
// 列数
|
var colNum = $(".layui-table-header").find("tr").eq(0).find("th").length;
|
for (var i = 0; i <= colNum; i++) {
|
var colName = $(".layui-table-header").find("tr").eq(0).find("th").eq(i).text();
|
var colWidth = $(".layui-table-header").find("tr").eq(0).find("th").eq(i).width();
|
if (colName != "" && colName != null) {
|
arr.push(colWidth == -1 ? 200 : colWidth);
|
}
|
}
|
arr.unshift(40); //首位追加
|
$.ajax({
|
url: GetWEBURL() + '/tb_CellWidth/GetMouldScrapInHouseCellWidth',
|
async: false,
|
type: "POST",
|
dataType: "json",
|
data: { "myMap": JSON.stringify(arr), "Name": Name },
|
success: function (data1) {
|
if (data1.count == 1) {
|
layer.alert(data1.Message, { icon: 1 });
|
} else {
|
layer.alert(data1.Message, { icon: 5 });
|
}
|
}, error: function (e) {
|
layer.alert(e.Message, { icon: 5 });
|
}
|
});
|
//设置赋值列宽
|
var colWidth = getColumnsWidth();
|
if (colWidth == "" || colWidth == []) {
|
|
}
|
else {
|
$.each(columns, function (x, m) {
|
m["width"] = colWidth[x];
|
});
|
}
|
get_FastQuery(table, option);
|
}
|
//默认列宽
|
function set_DefaultGridColWidth() {
|
var arr = [];
|
// 列数
|
var colNum = $(".layui-table-header").find("tr").eq(0).find("th").length;
|
for (var i = 0; i <= colNum; i++) {
|
var colName = $(".layui-table-header").find("tr").eq(0).find("th").eq(i).text();
|
if (colName != "" && colName != null) {
|
arr.push(200); //默认宽度200
|
}
|
}
|
arr.unshift(40); //首位追加
|
$.ajax({
|
url: GetWEBURL() + '/tb_CellWidth/GetMouldScrapInHouseCellWidth',
|
async: false,
|
type: "POST",
|
dataType: "json",
|
data: { "myMap": JSON.stringify(arr), "Name": Name },
|
success: function (data1) {
|
if (data1.count == 1) {
|
layer.alert(data1.Message, { icon: 1 });
|
|
} else {
|
layer.alert(data1.Message, { icon: 5 });
|
}
|
}, error: function (e) {
|
layer.alert(e.Message, { icon: 5 });
|
}
|
});
|
//设置赋值列宽
|
var colWidth = getColumnsWidth();
|
if (colWidth == "" || colWidth == []) {
|
|
}
|
else {
|
$.each(columns, function (x, m) {
|
m["width"] = colWidth[x];
|
});
|
}
|
get_FastQuery(table, option);
|
}
|
//快速过滤
|
function get_FastQuery(table, option) {
|
var HBeginDate = $("#HBeginDate").val();//开始日期
|
if (HBeginDate) {
|
sWhere = HBeginDate;
|
}
|
var index = layer.load(0);
|
get_Display(sWhere);
|
//调用接口后清空sWhere缓存
|
sWhere = "";
|
}
|
//重置过滤条件
|
function set_ClearQuery() {
|
$('#HStatus').find("option[value='-1']").attr("selected", true);
|
$("#HBeginDate").val(Format(new Date(), "yyyy-MM"));
|
$("#HBillNo").val("");
|
$("#HEmpName").val("");
|
$("#HMaterNumber").val("");
|
$("#HMaterName").val("");
|
$("#HSupName").val("");
|
$("select[name='HFeedback']").val("");
|
sWhere = Format(new Date(), "yyyy-MM");
|
get_Display(sWhere);
|
}
|
//刷新
|
function set_Refresh() {
|
$("#btnSearch").click();
|
}
|
//以上是layui模块
|
});
|
</script>
|
</body>
|
</html>
|