<!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/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>
|
<style type="text/css">
|
input.layui-input.layui-unselect {
|
padding-right: 0;
|
}
|
</style>
|
</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-form layui-inline" style="position:relative;top:10px;">
|
<label class="layui-form-label">日期</label>
|
<div class="layui-form-item layui-inline">
|
<div class="layui-inline">
|
<div class="layui-input-inline">
|
<input type="text" class="layui-input" id="HBeginDate" style="width:190px;" placeholder="yyyy-MM-dd HH:mm">
|
</div>
|
</div>
|
</div>
|
<div class="layui-form-item layui-inline">
|
<div class="layui-inline">
|
<label class="layui-form-label">-</label>
|
<div class="layui-input-inline">
|
<input type="text" class="layui-input" id="HEndDate" style="width:190px;" placeholder="yyyy-MM-dd HH:mm">
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">维度</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<select name="HOperationType" id="HOperationType" lay-filter="HOperationType" style="width: 180px; ">
|
<option style="color:blue;" selected="selected" value="1">销售出库单审核时间</option>
|
<option style="color:blue;" value="2">出门确认时间</option>
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">销售出库单号</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HBillNo" id="HBillNo">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">出门确认单号</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HBillNo1" id="HBillNo1">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">产品类型</label>
|
<div class="layui-input-inline">
|
<select name="HProductType" id="HProductType" lay-filter="HProductType" style="width: 180px; ">
|
<option style="color:blue;" value="全部">全部</option>
|
<option style="color:blue;" value="非样品">非样品</option>
|
<option style="color:blue;" value="样品">样品</option>
|
</select>
|
</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 class="layui-inline" style="margin-left:5px;">
|
<div style="text-align:center;font-size:15px;font-weight:bold;color:#fc9393" id="HFilterScheme_Now"></div>
|
</div>
|
<div class="layui-colla-content" style="padding: 0px; margin-left: 6%;">
|
<div class="layui-row" style="margin-top:10px;">
|
<!--其他条件-->
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">产品代码</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HMaterNumber" id="HMaterNumber">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">产品名称</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HProductName" id="HProductName">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">规格型号</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HProductModel" id="HProductModel">
|
</div>
|
</div>
|
</div>
|
|
<div class="layui-row" style="margin:10px 0px">
|
<div class="layui-inline">
|
<label class="layui-form-label">过滤</label>
|
<div class="layui-input-block">
|
<select name="ColName" id="ColName" class="ForFilteringSchemes" lay-filter="ColName" style="width:190px;">
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<select name="Comparator" id="Comparator" class="ForFilteringSchemes" lay-filter="Comparator" style="width:190px;">
|
<option value="0" selected="selected"></option>
|
<option value="=">=</option>
|
<option value=">=">>=</option>
|
<option value=">">></option>
|
<option value="<="><=</option>
|
<option value="<"><</option>
|
<option value="<>"><></option>
|
<option value="7">包含</option>
|
<option value="8">左包含</option>
|
<option value="9">右包含</option>
|
<option value="10">不包含</option>
|
</select>
|
</div>
|
<div class="layui-inline">
|
<input type="text" class="layui-input ForFilteringSchemes" value="" name="ColContent" id="ColContent">
|
</div>
|
</div>
|
|
<div class="layui-row" style="margin-top: 10px; margin-bottom: 10px ">
|
<div class="layui-inline">
|
<label class="layui-form-label">过滤</label>
|
<div class="layui-input-block">
|
<select name="ColName1" id="ColName1" class="ForFilteringSchemes" lay-filter="ColName1" style="width:190px;">
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<select name="Comparator1" id="Comparator1" lay-filter="Comparator1" class="ForFilteringSchemes" style="width:190px;">
|
<option value="0" selected="selected"></option>
|
<option value="=">=</option>
|
<option value=">=">>=</option>
|
<option value=">">></option>
|
<option value="<="><=</option>
|
<option value="<"><</option>
|
<option value="<>"><></option>
|
<option value="7">包含</option>
|
<option value="8">左包含</option>
|
<option value="9">右包含</option>
|
<option value="10">不包含</option>
|
</select>
|
</div>
|
<div class="layui-inline">
|
<input type="text" class="layui-input ForFilteringSchemes" value="" name="ColContent1" id="ColContent1">
|
</div>
|
</div>
|
|
<!--<div class="layui-row" style="margin-top: 10px; margin-bottom: 10px ">
|
<div class="layui-inline">
|
<label class="layui-form-label">过滤</label>
|
<div class="layui-input-block">
|
<select name="ColName2" id="ColName2" class="ForFilteringSchemes" lay-filter="ColName2" style="width:190px;">
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<select name="Comparator2" id="Comparator2" lay-filter="Comparator2" class="ForFilteringSchemes" style="width:190px;">
|
<option value="0" selected="selected"></option>
|
<option value="=">=</option>
|
<option value=">=">>=</option>
|
<option value=">">></option>
|
<option value="<="><=</option>
|
<option value="<"><</option>
|
<option value="<>"><></option>
|
<option value="7">包含</option>
|
<option value="8">左包含</option>
|
<option value="9">右包含</option>
|
<option value="10">不包含</option>
|
</select>
|
</div>
|
<div class="layui-inline">
|
<input type="text" class="layui-input ForFilteringSchemes" value="" name="ColContent2" id="ColContent2">
|
</div>
|
</div>-->
|
</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="btn-exit"><i class="layui-icon layui-icon-return"></i>退出</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="get_export" id="get_export"><i class="layui-icon layui-icon-export"></i>导出</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="HideColumn"><i class="layui-icon layui-icon-form"></i>隐藏列设置</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="set_SaveScheme" id="set_SaveScheme"><i class="layui-icon layui-icon-template"></i>保存方案</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="set_ReadScheme" id="set_ReadScheme"><i class="layui-icon layui-icon-set"></i>读取方案</button>
|
</div>
|
</script>
|
</form>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<script>
|
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
|
|
//#region 【过滤方案】
|
|
//过滤条件的class类
|
var HClassTag = "ForFilteringSchemes";
|
//模块名称(中文版) 每个模块页面都需要修改
|
window.HModuleName = "出门确认单报表";
|
//是否已经选择了过滤方案(全局变量)
|
window.HDefaultFilter = "";
|
//选择的过滤方案内码(全局变量)
|
window.HInterID_Choose = 0;
|
|
//#endregion
|
|
//查询条件
|
var sWhere = "";
|
var option = [];
|
var HModName = "Xs_OutDoorBillReport";
|
var HProcExchBillNo = "";
|
var HBeginDate_u = "";
|
var HEndDate_u = "";
|
|
var titleData = ["HCusID"];//不需要显示的字段 可扩展
|
|
var ins; //用于导出excel
|
|
//#endregion
|
|
//#region 进入页面既加载
|
|
var params = getUrlVars();
|
var OperationType = params[params[0]];
|
|
//判断是否有参数传递
|
if (!isNaN(OperationType)) {
|
HProcExchBillNo = params[params[1]];
|
HBeginDate_u = decodeURI(params[params[2]]);
|
HEndDate_u = decodeURI(params[params[3]]);
|
} else {
|
HBeginDate_u = Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 1).setHours(7, 0, 0, 0), "yyyy-MM-dd hh:mm");
|
HEndDate_u = Format(new Date(new Date()).setHours(7, 0, 0, 0), "yyyy-MM-dd hh:mm");
|
}
|
|
|
//#region 初始化界面
|
|
set_ClearBill();
|
|
//#endregion
|
|
//#region 点击事件包括on form事件等
|
//头工具栏事件
|
table.on('toolbar(mainTable)', function (obj) {
|
switch (obj.event) {
|
//导出excel
|
case 'get_export':
|
get_Export();
|
break;
|
//退出
|
case 'btn-exit': Pub_Close(2);
|
break;
|
//隐藏列设置
|
case 'HideColumn':
|
get_HideColumn();
|
break;
|
//保存方案
|
case 'set_SaveScheme': set_SaveScheme();
|
break;
|
//读取方案
|
case 'set_ReadScheme': set_ReadScheme();
|
break;
|
};
|
});
|
//重置按钮
|
form.on('submit(btnReSearch)', function (data) {
|
set_ClearQuery();
|
});
|
//查询按钮
|
form.on('submit(btnSearch)', function (data) {
|
get_FastQuery();
|
});
|
|
//行监听事件-单击
|
table.on('row(mainTable)', function (obj) {
|
var flag = !obj.tr.find(':checkbox:first').prop('checked');
|
obj.tr.find(':checkbox').prop('checked', flag);
|
if (flag) {
|
obj.tr.find('.layui-form-checkbox').addClass('layui-form-checked'); //设置复选框选中样式
|
$(obj.tr.selector).attr({ "style": "background:#ceedfa;color:black" });//改变当前tr背景颜色和字体颜色
|
} else {
|
obj.tr.find('.layui-form-checkbox').removeClass('layui-form-checked');//取消复选框选中样式
|
$(obj.tr.selector).attr({ "style": "background:" });//取消当前tr颜色
|
}
|
//mainTable 为表格ID 注意此处如果ID不正确将导致你在监听复选框时获取不到你选择的数据,前面的只是添加或删除选中未选中样式以及设置背景色,字体颜色
|
layui.each(table.cache.mainTable, function (i, l) {
|
if (obj.tr.index() == l.LAY_TABLE_INDEX) {
|
l.LAY_CHECKED = flag;
|
}
|
});
|
});
|
//#endregion
|
|
//#region 此页面所有的方法
|
|
//初始化界面
|
function set_ClearBill() {
|
//初始化时间
|
laydate.render({
|
elem: '#HBeginDate',
|
type: 'datetime',
|
fullPanel: true
|
, format: 'yyyy-MM-dd HH:mm'
|
, value: HBeginDate_u
|
});
|
laydate.render({
|
elem: '#HEndDate',
|
type: 'datetime',
|
fullPanel: true
|
, format: 'yyyy-MM-dd HH:mm'
|
, value: HEndDate_u
|
});
|
|
//加载数据到网格
|
get_FastQuery();
|
ColFilter();
|
DisPlay_HideColumn();
|
//查询当前登录用户有没有在当前模块设置默认过滤方案
|
get_DefaultModule();
|
}
|
|
//列明显示下拉框
|
function ColFilter() {
|
var Organization = '<option value="0" selected="selected" ></option>';
|
for (var i = 1; i < option.cols[0].length; i++) {
|
if (option.cols[0][i].hide != true) {
|
Organization += '<option style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>';
|
}
|
}
|
$("#ColName").empty();
|
$("#ColName").append(Organization);
|
form.render('select');
|
|
$("#ColName1").empty();
|
$("#ColName1").append(Organization);
|
form.render('select');
|
|
//$("#ColName2").empty();
|
//$("#ColName2").append(Organization);
|
//form.render('select');
|
|
}
|
|
|
//加载网格
|
function get_Display(sWhere) {
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, cellMinWidth: 120
|
, limit: Number.MAX_VALUE // 数据表格默认全部显示
|
, height: 'full-70'
|
, totalRow: true //开启合计
|
, cols: [[]]
|
, data: []
|
};
|
|
var HBeginDate = $("#HBeginDate").val();//下达日期 开始日期
|
var HEndDate = $("#HEndDate").val();//结束日期
|
var HOperationType = $("#HOperationType").val(); //数据维度
|
|
//动态列-缓存列表
|
$.ajax({
|
url: GetWEBURL() + "/Xs_OutDoorBill/Xs_OutDoorBillReport",
|
async: false,
|
type: "GET",
|
async: false,
|
data: { "HBeginDate": HBeginDate, "HEndDate": HEndDate, "sWhere": sWhere, "user": sessionStorage["HUserName"], "HOperationType": HOperationType },
|
success: function (data1) {
|
|
if (data1.count == 1) {
|
|
var data = [];
|
var col = [];
|
//给空的数组赋值
|
for (var key in data1.list) {
|
data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
|
}
|
|
//在列表左边添加勾选框
|
col.push({ type: 'checkbox', fixed: 'left', totalRowText: '合计' });
|
for (var i = 0; i < data.length; i++) {
|
if ($.inArray(data[i].name, titleData) > -1) {
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
|
}
|
else {
|
switch (data[i].Type) {
|
//int
|
case 'DateTime':
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{(d." + data[i].name + " ==null||d." + data[i].name + "=='') ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 120 });
|
break;
|
case "decimal":
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow:true });
|
break;
|
case "Int32":
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true });
|
break;
|
default:
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true });
|
}
|
}
|
}
|
|
option.data = data1.data[0];
|
option.cols = [col];
|
ins = table.render(option);
|
DisPlay_HideColumn();
|
if ($("#Comparator").val() == 0 && $("#ColContent").val() == "" && $("#Comparator1").val() == 0 && $("#ColContent1").val() == "") {
|
ColFilter();
|
}
|
} else {
|
layer.alert(data1.count + data1.Message, { icon: 5 })
|
}
|
},
|
error: function (err) {
|
layer.msg('错误' + err, {
|
icon: 5,
|
time: 20000
|
}, function () {
|
//do something
|
});
|
}
|
})
|
}
|
|
//快速过滤
|
function get_FastQuery() {
|
var HBeginDate = $("#HBeginDate").val();//下达日期 开始日期
|
var HEndDate = $("#HEndDate").val();//结束日期
|
var HMaterNumber = $("#HMaterNumber").val();//物料代码
|
var HBillNo = $("#HBillNo").val(); //销售出库单号
|
var HBillNo1 = $("#HBillNo1").val(); //出门确认单号
|
var HProductName = $("#HProductName").val();//产品名称
|
var HProductModel = $("#HProductModel").val();//产品规格
|
|
var HProductType = $("#HProductType").val();//产品类型
|
|
//if (HBeginDate != "" && HEndDate != "") {
|
// sWhere += " and 日期 between ''" + HBeginDate + "'' and ''" + HEndDate + "'' ";
|
//} else {
|
// sWhere += " and 日期 between ''" + Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 1).setHours(7, 0, 0, 0), "yyyy-MM-dd hh:mm") + "'' and ''" + Format(new Date(new Date()).setHours(7, 0, 0, 0), "yyyy-MM-dd hh:mm") + "'' ";
|
//}
|
|
//if (HProcExchBillNo != "") {
|
// sWhere += " and 流转卡号 =''" + HProcExchBillNo + "''";
|
// HBeginDate = HBeginDate_u;
|
// HEndDate = HEndDate_u;
|
//}
|
|
//if (HBeginDate) {
|
// sWhere += " and CONVERT(varchar(100),出门确认日期, 20) >= ''" + HBeginDate + "''";
|
//}
|
//if (HEndDate) {
|
// sWhere += " and CONVERT(varchar(100),出门确认日期, 20) <= ''" + HEndDate + "''";
|
//}
|
|
if (HBillNo != "") {
|
sWhere += " and 销售出库单号=''" + HBillNo + "'' ";
|
}
|
|
if (HBillNo1 != "") {
|
sWhere += " and 出门确认单号=''" + HBillNo1 + "'' ";
|
}
|
|
if (HMaterNumber != "") {
|
sWhere += " and 物料代码=''" + HMaterNumber + "'' ";
|
}
|
|
if (HProductName != "") {
|
sWhere += " and 物料名称=''" + HProductName + "'' ";
|
}
|
|
if (HProductModel != "") {
|
sWhere += " and 规格型号=''" + HProductModel + "'' ";
|
}
|
|
if (HProductType) {
|
if (HProductType == "样品") {
|
sWhere += " and 产品类型 = ''样品''";
|
} else if (HProductType == "非样品") {
|
sWhere += " and 产品类型 <> ''样品''";
|
} else if (HProductType == "全部") {
|
|
}
|
}
|
|
//任意字段条件过滤 条件提取
|
var ColName = $("#ColName").val();//复选框
|
var Comparator = $("#Comparator").val()
|
var ColContent = $("#ColContent").val();
|
|
var ColName1 = $("#ColName1").val();//复选框
|
var Comparator1 = $("#Comparator1").val()
|
var ColContent1 = $("#ColContent1").val();
|
|
//var ColName2 = $("#ColName2").val();//复选框
|
//var Comparator2 = $("#Comparator2").val()
|
//var ColContent2 = $("#ColContent2").val();
|
|
//拼接任一字段过滤查询条件
|
var com = "";
|
if (ColName != 0 && Comparator != 0) {
|
switch (Comparator) {
|
case "7":
|
com = "like ''%" + ColContent + "%'' ";
|
break;
|
case "8":
|
com = "like ''%" + ColContent + "'' ";
|
break;
|
case "9":
|
com = "like ''" + ColContent + "%'' ";
|
break;
|
case "10":
|
com = "not like ''%" + ColContent + "%'' ";
|
break;
|
default:
|
com = "" + Comparator + " ''" + ColContent + "'' ";
|
break;
|
}
|
sWhere += " and " + ColName + " " + com;
|
}
|
if (ColName1 != 0 && Comparator1 != 0) {
|
var com1 = "";
|
switch (Comparator1) {
|
case "7":
|
com1 = "like ''%" + ColContent1 + "%'' ";
|
break;
|
case "8":
|
com1 = "like ''%" + ColContent1 + "'' ";
|
break;
|
case "9":
|
com1 = "like ''" + ColContent1 + "%'' ";
|
break;
|
case "10":
|
com1 = "not like ''%" + ColContent1 + "%'' ";
|
break;
|
default:
|
com1 = "" + Comparator1 + "''" + ColContent1 + "'' ";
|
break;
|
}
|
sWhere += " and " + ColName1 + " " + com1;
|
}
|
|
//if (ColName2 != 0 && Comparator2 != 0) {
|
// var com2 = "";
|
// switch (Comparator2) {
|
// case "7":
|
// com2 = " like ''%" + ColContent2 + "%'' ";
|
// break;
|
// case "8":
|
// com2 = " like ''%" + ColContent2 + "'' ";
|
// break;
|
// case "9":
|
// com2 = " like ''" + ColContent2 + "%'' ";
|
// break;
|
// case "10":
|
// com2 = " not like ''%" + ColContent2 + "%'' ";
|
// break;
|
// default:
|
// com2 = "" + Comparator2 + "''" + ColContent2 + "'' ";
|
// break;
|
// }
|
// sWhere += " and " + ColName2 + " " + com2;
|
//}
|
|
|
//根据用户过滤用户关联客户的记录
|
var sWhere_byUser = getSWhereByHUser();
|
sWhere_byUser = sWhere_byUser.replace(/'/g, "''");
|
sWhere += sWhere_byUser;
|
|
get_Display(sWhere);
|
//调用接口后清空sWhere缓存
|
sWhere = "";
|
}
|
|
//重置过滤条件
|
function set_ClearQuery() {
|
//初始化时间
|
laydate.render({
|
elem: '#HBeginDate',
|
type: 'datetime',
|
fullPanel: true
|
, format: 'yyyy-MM-dd HH:mm'
|
, value: Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 1).setHours(7, 0, 0, 0), "yyyy-MM-dd hh:mm")
|
});
|
laydate.render({
|
elem: '#HEndDate',
|
type: 'datetime',
|
fullPanel: true
|
, format: 'yyyy-MM-dd HH:mm'
|
, value: Format(new Date(new Date()).setHours(7, 0, 0, 0), "yyyy-MM-dd hh:mm")
|
});
|
$("#HMaterNumber").val("");
|
$("#HBillNo").val("");
|
$("#HProductName").val("");
|
$("#HProductModel").val("");
|
$("#ColContent").val("");
|
$("#ColName").val("0");
|
$("#Comparator").val("0");
|
|
$("#ColContent1").val("");
|
$("#ColName1").val("0");
|
$("#Comparator1").val("0");
|
|
//$("#ColContent2").val("");
|
//$("#ColName2").val("0");
|
//$("#Comparator2").val("0");
|
ColFilter();
|
sWhere = "";
|
}
|
|
//#region 导出Execel
|
function get_Export() {
|
var ModRightNameCheck = "Xs_OutDoorBillReport_ExportExcel";
|
|
//逻辑审核方法
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/LMES/getReportByModRightNameCheck", //方法所在页面和方法名
|
data: { "ModRightNameCheck": ModRightNameCheck, "user": sessionStorage["HUserName"] },
|
success: function (result) {
|
if (result.count == 1) {
|
table.exportFile(ins.config.id, option.data, "xls");
|
} else {
|
layer.alert("当前模块没有导出权限!", { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
//#endregion
|
|
//隐藏列设置
|
function get_HideColumn() {
|
var colName = "";
|
for (var i = 1; i < option.cols[0].length; i++) {
|
colName += option.cols[0][i]["title"] + ",";
|
}
|
|
colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI 进行编码
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "隐藏列设置" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["50%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ['../../基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//刷新表格数据
|
DisPlay_HideColumn();
|
//更新表格缓存的数据
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
|
//显示列数据
|
function DisPlay_HideColumn() {
|
$.ajax({
|
url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
|
type: "GET",
|
data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.data.length != 0) {
|
|
var dataCol = [];//数据库查询出的列数据
|
/*var titleData = [];//不需要显示的字段 可扩展*/
|
|
dataCol = data1.data[0].HGridString.split(',');
|
|
for (var i = 0; i < option.cols[0].length - 1; i++) {
|
if (i >= dataCol.length) {
|
continue;
|
}
|
|
if (dataCol[i]) {
|
var dataCols = dataCol[i].split('|');
|
}
|
//隐藏列
|
if (dataCols[1] == 1) {
|
option.cols[0][i + 1]["hide"] = true;
|
}
|
//设置内容字体大小
|
if (data1.data[0].HFontSize != 0) {
|
option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
|
} else {
|
option.cols[0][i + 1]["style"] = "font-size:100%";
|
}
|
//设置列宽
|
if (dataCols[3] > 0) {
|
option.cols[0][i + 1]["width"] = dataCols[3];
|
}
|
//显示列
|
if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
|
option.cols[0][i + 1]["hide"] = false;
|
}
|
//字体所在位置(左 居中 右)
|
switch (dataCols[2]) {
|
case "L":
|
option.cols[0][i + 1]["align"] = "left";
|
break;
|
case "M":
|
option.cols[0][i + 1]["align"] = "center";
|
break;
|
case "R":
|
option.cols[0][i + 1]["align"] = "right";
|
break;
|
}
|
}
|
|
//取消冻结列
|
for (var i = 1; i < option.cols[0].length - 1; i++) {
|
if (option.cols[0][i]["fixed"] != null) {
|
option.cols[0][i]["fixed"] = null;
|
}
|
else {
|
break;
|
}
|
}
|
//冻结列
|
if (data1.data[0].HFixCols != 0) {
|
for (var i = 0; i < data1.data[0].HFixCols; i++) {
|
if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
|
data1.data[0].HFixCols += 1;
|
}
|
option.cols[0][i + 1]["fixed"] = "left";
|
}
|
}
|
table.render(option);
|
} else {
|
table.render(option);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
})
|
}
|
|
//获取参数
|
function getUrlVars() {
|
var vars = [], hash;
|
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
for (var i = 0; i < hashes.length; i++) {
|
hash = hashes[i].split('=');
|
vars.push(hash[0]);
|
vars[hash[0]] = hash[1];
|
}
|
return vars;
|
}
|
|
//#region 根据用户获取用户关联客户的过滤条件
|
function getSWhereByHUser() {
|
var res = "";
|
$.ajax({
|
type: "GET",
|
async: false,
|
url: GetWEBURL() + "/Xs_SeOrderBill/getCusIDListByUser", //方法所在页面和方法名
|
data: { "CurUserID": sessionStorage["Czybm"], "CurUserName": sessionStorage["HUserName"] },
|
success: function (result) {
|
if (result.count == 1) {
|
res = result.data;
|
} else {
|
res = result.data;
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function (err) {
|
res = " and 1 = 0";
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
return res;
|
}
|
//#endregion
|
|
|
|
//#region 【过滤方案】
|
|
//获取当前用户的默认过滤方案
|
function get_DefaultModule() {
|
$.ajax({
|
url: GetWEBURL() + '/Xt_FastICScheme/Chooselist',
|
type: "GET",
|
async: false,
|
data: { "user": sessionStorage["Czybm"], "HModuleName": HModuleName, "HInterID": 0, "Type": "Default" },
|
success: function (data1) {
|
if (data1.count == 1) {
|
//当前用户设置有默认的过滤方案
|
var data = data1.data;
|
//当前选择的过滤方案
|
HInterID_Choose = data[0].hmainid;
|
//过滤方案内码
|
HInterID = data[0].hmainid
|
//过滤方案名称
|
HDefaultFilter = data[0].方案名称
|
//过滤方案的备注(方案信息描述)
|
var HRemark = data[0].备注
|
//显示出当前的默认过滤方案
|
document.getElementById("HFilterScheme_Now").style.display = "block";
|
document.getElementById('HFilterScheme_Now').innerHTML = "当前过滤方案:" + HDefaultFilter + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb"> ' + "(" + HRemark + ")" + '</span>';
|
//把过滤条件值回写到页面上
|
for (let i = 0; i < data.length; i++) {
|
$("#" + data[i].过滤字段ID).val(data[i].过滤值);
|
if (data[i].过滤标签类型 == 'SELECT') {
|
$("#" + data[i].过滤字段ID).find("option[value='" + data[i].过滤值 + "']").attr("selected", true);
|
}
|
}
|
//查询
|
|
get_FastQuery();
|
|
form.render("select");
|
} else {
|
//当前用户没有设置默认的过滤方案
|
//隐藏显示过滤方案的标签信息
|
document.getElementById("HFilterScheme_Now").style.display = "none";
|
//执行查询方法
|
//查询
|
get_FastQuery();
|
form.render("select");
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
|
//保存方案
|
function set_SaveScheme() {
|
var index = layer.open()
|
//判断用户是否点击了右上角的“叉号”关闭弹窗页面
|
var HIsClose_Manual = false;
|
//获取本页所有过滤条件对象(class中包含"ForFilteringSchemes"的元素)
|
var Filter = document.getElementsByClassName(HClassTag);
|
|
var HFilterIdList = "";//过滤条件
|
var HFilterIdLists = "";//拼接多个过滤条件
|
var HValue = "";//过滤值
|
var HElement_type = "";//过滤标签类型
|
|
for (var i = 0; i < Filter.length; i++) {
|
HFilterIdList = Filter[i].id; //过滤条件ID
|
HFilterIdLists += Filter[i].id + ","; //过滤条件ID(拼接)
|
HValue += $("#" + HFilterIdList).val() + ","; //过滤条件中输入的值
|
HElement_type += document.getElementById(HFilterIdList).tagName + ",";//通过标签id获取标签类型
|
}
|
|
//去除末尾逗号
|
HFilterIdLists = HFilterIdLists.substring(0, HFilterIdLists.length - 1);
|
HValue = HValue.substring(0, HValue.length - 1);
|
HElement_type = HElement_type.substring(0, HElement_type.length - 1);
|
|
//当前页面上没有选择过滤方案,进入新增方法
|
if (HDefaultFilter == "") {
|
layer.open({
|
type: 2
|
, area: ['40%', '80%']
|
, title: '过滤方案'
|
, shift: 0//弹出动画
|
, content: '../../系统管理/过滤方案设置/Xt_FastICScheme.html?OperationType=1&HModuleName=' + HModuleName + '&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type
|
, cancel: function () {
|
// 右上角关闭事件的逻辑
|
HIsClose_Manual = true;
|
}
|
, end: function () {
|
if (HIsClose_Manual != true) {
|
get_FastQuery();
|
//显示当前的过滤方案
|
document.getElementById("HFilterScheme_Now").style.display = "block";
|
document.getElementById('HFilterScheme_Now').innerHTML = "当前过滤方案:" + sessionStorage["HFilterSchemeName_" + sessionStorage["Czybm"]] + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb"> ' + "(" + sessionStorage["HFilterSchemeRemark_" + sessionStorage["Czybm"]] + ")" + '</span>';
|
}
|
}
|
})
|
layer.close(index)
|
} else {
|
//当前页面已有过滤方案,用户选择 新增或者编辑
|
layer.confirm('当前已选择过滤方案,是否修改?请选择对应操作', {
|
title: "操作提示",
|
icon: 0,
|
btn: ['新增方案', '保存修改当前方案', '取消']
|
}, function (index, layero) {
|
//新增
|
layer.open({
|
type: 2
|
, area: ['40%', '80%']
|
, title: '过滤方案'
|
, shift: 0//弹出动画
|
, content: '../../系统管理/过滤方案设置/Xt_FastICScheme.html?OperationType=1&HModuleName=' + HModuleName + '&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type
|
, end: function () {
|
get_FastQuery()
|
//显示当前的过滤方案
|
document.getElementById("HFilterScheme_Now").style.display = "block";
|
document.getElementById('HFilterScheme_Now').innerHTML = "当前过滤方案:" + sessionStorage["HFilterSchemeName_" + sessionStorage["Czybm"]] + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb"> ' + "(" + sessionStorage["HFilterSchemeRemark_" + sessionStorage["Czybm"]] + ")" + '</span>';
|
}
|
})
|
layer.close(index)
|
}, function (index) {
|
//编辑
|
var Filter_Edit = document.getElementsByClassName(HClassTag); //获取本页所有过滤条件对象(class中包含"ForFilteringSchemes"的元素)
|
HFilterIdList = "";
|
HFilterIdLists = "";
|
HValue = "";
|
HElement_type = "";
|
for (var i = 0; i < Filter_Edit.length; i++) {
|
HFilterIdList = Filter_Edit[i].id; //过滤条件ID
|
HFilterIdLists += Filter_Edit[i].id + ","; //过滤条件ID(拼接)
|
HValue += $("#" + HFilterIdList).val() + ","; //过滤条件中输入的值
|
HElement_type += document.getElementById(HFilterIdList).tagName + ",";//通过标签id获取标签类型
|
}
|
//去除末尾逗号
|
HFilterIdLists = HFilterIdLists.substring(0, HFilterIdLists.length - 1);
|
HValue = HValue.substring(0, HValue.length - 1);
|
HElement_type = HElement_type.substring(0, HElement_type.length - 1);
|
|
var sMainSub = HInterID_Choose + ';' + HFilterIdLists + ';' + HValue + ';' + HElement_type + ';' + sessionStorage["Czybm"] + ';' + 3;
|
|
//修改
|
$.ajax({
|
type: "POST",
|
url: GetWEBURL() + "/Xt_FastICScheme/save", //方法所在页面和方法名
|
async: true,
|
data: { "oMain": sMainSub },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) { // 说明验证成功了,
|
layer.msg(data.Message, { time: 1 * 1000, icon: 1 });
|
}
|
else {
|
|
}
|
layer.closeAll("loading");
|
},
|
error: function (err) {
|
|
|
}
|
});
|
layer.close(index)
|
}, function (index) {
|
//取消
|
layer.alert('取消')
|
layer.close(index)
|
});
|
}
|
|
}
|
|
//读取方案
|
function set_ReadScheme() {
|
var HIsClose_Manual = false;
|
var Filter = document.getElementsByClassName(HClassTag); //获取本页所有过滤条件对象(class中包含"ForFilteringSchemes"的元素)
|
|
var HFilterIdList = "";
|
var HFilterIdLists = "";
|
var HValue = "";
|
var HElement_type = "";
|
for (var i = 0; i < Filter.length; i++) {
|
HFilterIdList = Filter[i].id; //过滤条件ID
|
HFilterIdLists += Filter[i].id + ","; //过滤条件ID(拼接)
|
HValue += $("#" + HFilterIdList).val() + ","; //过滤条件中输入的值
|
HElement_type += document.getElementById(HFilterIdList).tagName + ",";//通过标签id获取标签类型
|
}
|
//去除末尾逗号
|
HFilterIdLists = HFilterIdLists.substring(0, HFilterIdLists.length - 1);
|
HValue = HValue.substring(0, HValue.length - 1);
|
HElement_type = HElement_type.substring(0, HElement_type.length - 1);
|
|
layer.open({
|
type: 2
|
, area: ['80%', '80%']
|
, title: '过滤方案列表'
|
, shift: 0//弹出动画
|
, content: '../../系统管理/过滤方案设置/Xt_FastICSchemeList.html?HType=Select&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type + '&HModuleName=' + HModuleName
|
, cancel: function () {
|
// 右上角关闭事件的逻辑
|
HIsClose_Manual = true;
|
}
|
, end: function () {
|
if (HIsClose_Manual != true) {
|
get_FastQuery()
|
form.render("select");
|
}
|
}
|
})
|
}
|
|
//#endregion
|
|
//#endregion
|
});
|
//#region 【过滤方案返回数据】
|
function HFilterScheme(obj) //返回过滤方案
|
{
|
var HInterID = obj[0].hmainid;
|
HInterID_Choose = obj[0].hmainid;
|
$.ajax({
|
url: GetWEBURL() + '/Xt_FastICScheme/Chooselist',
|
type: "GET",
|
data: { "user": sessionStorage["Czybm"], "HModuleName": HModuleName, "HInterID": HInterID, "Type": "Select" },
|
success: function (data1) {
|
if (data1.count == 1) {
|
var data = data1.data;
|
//赋值过滤方案名称
|
HDefaultFilter = data[0].方案名称
|
var HRemark = data[0].备注
|
//显示当前的过滤方案
|
document.getElementById("HFilterScheme_Now").style.display = "block";
|
document.getElementById('HFilterScheme_Now').innerHTML = "当前过滤方案:" + HDefaultFilter + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb"> ' + "(" + HRemark + ")" + '</span>';
|
HInterID = data[0].hmainid
|
//根据选择的过滤方案回填数据到列表过滤条件
|
for (let i = 0; i < data.length; i++) {
|
$("#" + data[i].过滤字段ID).val(data[i].过滤值);
|
if (data[i].过滤标签类型 == 'SELECT') {
|
$("#" + data[i].过滤字段ID).find("option[value='" + data[i].过滤值 + "']").attr("selected", true);
|
}
|
}
|
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
//#endregion
|
</script>
|
</body>
|
</html>
|