<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8" />
|
<title>质量追溯查询报表</title>
|
<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/jquery-1.4.1.js"></script>
|
<script src="../../../layuiadmin/scripts/jquery-1.4.1.min.js"></script>
|
<script src="../../../layuiadmin/pubcustom.js"></script>
|
<script src="../../../layuiadmin/Scripts/webConfig.js"></script>
|
<script src="../../../layuiadmin/soulTable.slim.js"></script>
|
<script src="../../../layuiadmin/MESLanguage.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 id="BT_GD">更多</span>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" id="BT_HICMOBillNo">生产订单号</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="HICMOBillNo" id="HICMOBillNo" value="">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 76px;" id="BT_HBardCode">产品条码</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="HBardCode" id="HBardCode" value="">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" id="BT_HProcExchBillNo">流转卡号</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="HProcExchBillNo" id="HProcExchBillNo">
|
</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>
|
<!--<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="fy" id="fy" style="padding:0 5px">翻译</button>-->
|
<div class="layui-colla-content" style="padding: 0px; margin-left: 6%;">
|
<div class="layui-row" style="margin-top:10px;margin-left:5%;">
|
|
</div>
|
<div class="layui-row" style="margin-top: 10px; margin-bottom: 10px ">
|
<div class="layui-inline">
|
<label class="layui-form-label" id="BT_ColName">过滤</label>
|
<div class="layui-input-block">
|
<select name="ColName" id="ColName" lay-filter="ColName" style="width:190px;">
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<select name="Comparator" id="Comparator" 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" value="" name="ColContent" id="ColContent">
|
</div>
|
</div>
|
<div class="layui-row" style=" margin-top: 10px; margin-left: 70px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" id="BT_ColName1">过滤</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" class="ForFilteringSchemes" lay-filter="Comparator1" 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-left: 70px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" id="BT_ColName2">过滤</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" class="ForFilteringSchemes" lay-filter="Comparator2" 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>
|
<div class="layui-tab layui-tab-card">
|
<ul class="layui-tab-title">
|
<li class="layui-this">进出站记录</li>
|
<li>不良汇报记录</li>
|
<li>工艺参数记录</li>
|
<li>配件清单</li>
|
<li>返修记录</li>
|
<li>配件变更记录</li>
|
<!--<li>出入库记录</li>-->
|
</ul>
|
<div class="layui-tab-content">
|
<div class="layui-tab-item layui-show">
|
<!--进出站记录-->
|
<table class="layui-hide" id="mainTable2" lay-filter="mainTable2"></table>
|
</div>
|
<div class="layui-tab-item">
|
<!--不良汇报记录-->
|
<table class="layui-hide" id="mainTable5" lay-filter="mainTable5"></table>
|
</div>
|
<div class="layui-tab-item">
|
<!--工艺参数记录-->
|
<table class="layui-hide" id="mainTable7" lay-filter="mainTable7"></table>
|
</div>
|
<div class="layui-tab-item">
|
<!--配件清单-->
|
<table class="layui-hide" id="mainTable3" lay-filter="mainTable3"></table>
|
</div>
|
<div class="layui-tab-item">
|
<!--返修记录-->
|
<table class="layui-hide" id="mainTable6" lay-filter="mainTable6"></table>
|
</div>
|
<div class="layui-tab-item">
|
<!--配件变更记录-->
|
<table class="layui-hide" id="mainTable4" lay-filter="mainTable4"></table>
|
</div>
|
<div class="layui-tab-item">
|
<!--出入库记录-->
|
<table class="layui-hide" id="mainTable1" lay-filter="mainTable1"></table>
|
</div>
|
</div>
|
</div>
|
|
<script type="text/html" id="toolbarDemo1">
|
<div class="layui-btn-container">
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
|
</div>
|
</script>
|
<script type="text/html" id="toolbarDemo5">
|
<div class="layui-btn-container">
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn5"><i class="layui-icon layui-icon-form"></i>列设置</button>
|
</div>
|
</script>
|
</form>
|
</div>
|
</div>
|
</div>
|
</div>
|
</body>
|
</html>
|
<script>
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index', //主入口模块
|
}).use(['index', 'form', 'table', 'element', 'laypage', 'laydate','soulTable'], 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
|
, soulTable = layui.soulTable
|
var sWhere = "";
|
var option1 = [];
|
var option2 = [];
|
var option3 = [];
|
var option4 = [];
|
var option5 = [];
|
var option6 = [];
|
var option7 = [];
|
var HModName = "RetrospectiveQueryReport";
|
var titleData = ["HInterID", "HEntryID", "HBadReasonID", "HSourceInterID", "HSourceEntryID"];//子表不需要显示的字段 可扩展
|
|
//#endregion
|
|
//#region 进入页面即加载
|
|
|
//初始化界面
|
set_ClearBill();
|
|
//#endregion
|
|
//#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
|
|
// 头工具栏事件
|
table.on('toolbar(mainTable2)', function (obj) {
|
switch (obj.event) {
|
//列设置
|
case 'set_HideColumn': get_HideColumn();
|
break;
|
};
|
});
|
|
table.on('row(mainTable2)', function (obj) {
|
var HBardcode = obj.data["条码"];
|
get_Display3(HBardcode);//配件清单
|
get_Display6(HBardcode);//返修记录
|
get_Display7(HBardcode);//工艺参数
|
})
|
|
table.on('row(mainTable5)', function (obj) {
|
var HBardcode = obj.data["条码"];
|
get_Display3(HBardcode);//配件清单
|
get_Display6(HBardcode);//返修记录
|
get_Display7(HBardcode);//工艺参数
|
})
|
|
table.on('row(mainTable6)', function (obj) {
|
var HBardcode = obj.data["SN码"];
|
get_Display4(HBardcode);//配件变更记录
|
})
|
|
|
table.on('toolbar(mainTable5)', function (obj) {
|
switch (obj.event) {
|
//列设置
|
case 'set_HideColumn5': get_HideColumn5();
|
break;
|
};
|
});
|
|
//查询按钮
|
form.on('submit(btnSearch)', function (data) {//选择仓位
|
get_FastQuery();
|
});
|
|
//重置
|
form.on('submit(btnReSearch)', function (data) {
|
set_ClearQuery();
|
});
|
|
//#endregion
|
|
//#region 此页面所有的方法
|
|
// 初始化界面
|
function set_ClearBill() {
|
//查询
|
get_FastQuery();
|
|
//form.render('select');
|
}
|
|
// 进出站查询
|
function get_Display2(sWhere) {
|
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Cj_SingleStation/EntryAndExitRecords',
|
type: "GET",
|
async: false,
|
data: { "HBardCode": $("#HBardCode").val(), "HProcExchBillNo": $("#HProcExchBillNo").val(), "HICMOBillNo": $("#HICMOBillNo").val(), "sWhere": sWhere, "user": sessionStorage["HUserName"] },
|
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' });
|
col.push({ type: 'numbers', title: '序号' });
|
for (var i = 0; i < data.length; i++) {
|
// if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
|
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 ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 180 });
|
break;
|
case 'long':
|
case 'Int32':
|
case 'Int64':
|
case 'double':
|
case 'Decimal':
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
|
break;
|
default:
|
if (data[i].name == "照片路径") {
|
col.push({
|
field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 150, templet: function (e) {
|
var html = "";
|
if (e.工序名称 == "拍照" ) {
|
html = '<a style="color:#1E9FFF" href="" target="main_self_frame">' + e.照片路径+'</a>';
|
}
|
return html
|
}
|
});
|
} else {
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 150 });
|
}
|
}
|
}
|
}
|
|
//动态显示列名
|
option2 = {
|
elem: '#mainTable2'
|
, toolbar: '#toolbarDemo1'
|
, cols: [col]
|
, data: data1.data
|
, height: 800
|
, page: true
|
, totalRow: true
|
, cellMinWidth: 90
|
, limit: 50
|
, limits: [50, 500, 5000, 20000]
|
, done: function (res, curr, count) {
|
soulTable.render(this);
|
}
|
}
|
table.render(option2);
|
//if ($("#HBardCode").val() != "" && data1.data.length != 0) {
|
// $("#HICMOBillNo").val(data1.data[0]["生产订单号"]);
|
// $("#HProcExchBillNo").val(data1.data[0]["流转卡"]);
|
//}
|
|
|
//刷新表格数据
|
DisPlay_HideColumn();
|
|
if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
|
ColFilter();
|
}
|
|
layer.close(ajaxLoad);
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(get_MessageError(data1.code + data1.Message, sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert(get_MessageError("[0000-1-002]接口请求失败!", sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
});
|
}
|
|
//配件清单
|
function get_Display3(HBardcode) {
|
|
var sWhere = "'" + HBardcode + "'";
|
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Sc_AssemblyBill/AssemblyBillAndStationInBillList_SN',
|
type: "GET",
|
async: false,
|
data: { "sWhere": sWhere },
|
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' });
|
for (var i = 0; i < data.length; i++) {
|
// if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
|
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 ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 180 });
|
break;
|
case 'long':
|
case 'Int32':
|
case 'Int64':
|
case 'double':
|
case 'Decimal':
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
|
break;
|
default:
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 150 });
|
}
|
}
|
}
|
|
//动态显示列名
|
option3 = {
|
elem: '#mainTable3'
|
, toolbar: '#toolbarDemo3'
|
, cols: [col]
|
, data: data1.data
|
, height: 800
|
, page: true
|
, totalRow: true
|
, cellMinWidth: 90
|
, limit: 50
|
, limits: [50, 500, 5000, 20000]
|
, done: function (res, curr, count) {
|
soulTable.render(this);
|
}
|
}
|
table.render(option3);
|
layer.close(ajaxLoad);
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(get_MessageError(data1.code + data1.Message, sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert(get_MessageError("[0000-1-002]接口请求失败!", sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
});
|
}
|
|
//配件变更记录
|
function get_Display4(HBardcode) {
|
var sWhere = " and HMaterSN='" + HBardcode + "'";
|
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Cj_SingleStation/Sc_SourceLineRepairBillSub_MaterList',
|
type: "GET",
|
async: false,
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.count == 1) {
|
//动态显示列名
|
option4 = {
|
elem: '#mainTable4'
|
, toolbar: '#toolbarDemo4'
|
, cols: [[
|
{ type: 'checkbox', fixed: 'left' }
|
, { type: 'numbers', title: '序号' }
|
, { field: 'HICMOBillNo', title: '生产订单' }
|
, { field: 'HDate', title: '日期' }
|
, { field: 'HMaterNumber', title: '配件物料编码' }
|
, { field: 'HMaterName', title: '配件物料名称' }
|
, { field: 'HBarCode', title: '配件SN码' }
|
, { field: 'HMaterSN', title: '产品SN码' }
|
|
]]
|
, data: data1.data
|
, height: 800
|
, page: true
|
, totalRow: true
|
, cellMinWidth: 90
|
, limit: 50
|
, limits: [50, 500, 5000, 20000]
|
, done: function (res, curr, count) {
|
soulTable.render(this);
|
}
|
}
|
table.render(option4);
|
layer.close(ajaxLoad);
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(get_MessageError(data1.code + data1.Message, sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert(get_MessageError("[0000-1-002]接口请求失败!", sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
});
|
}
|
|
//不良汇报记录
|
function get_Display5(sWhere) {
|
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Cj_SingleStation/BadQueryReport',
|
type: "GET",
|
async: false,
|
data: { "HBardCode": $("#HBardCode").val(), "HProcExchBillNo": $("#HProcExchBillNo").val(), "HICMOBillNo": $("#HICMOBillNo").val(), "sWhere": sWhere, "user": sessionStorage["HUserName"] },
|
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' });
|
for (var i = 0; i < data.length; i++) {
|
// if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
|
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 ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 180 });
|
break;
|
case 'long':
|
case 'Int32':
|
case 'Int64':
|
case 'double':
|
case 'Decimal':
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
|
break;
|
default:
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 150 });
|
}
|
}
|
}
|
|
//动态显示列名
|
option = {
|
elem: '#mainTable5'
|
, toolbar: '#toolbarDemo5'
|
, cols: [col]
|
, data: data1.data
|
, height: 800
|
, page: true
|
, totalRow: true
|
, cellMinWidth: 90
|
, limit: 50
|
, limits: [50, 500, 5000, 20000]
|
, done: function (res, curr, count) {
|
soulTable.render(this);
|
}
|
}
|
table.render(option);
|
|
////刷新表格数据
|
//DisPlay_HideColumn();
|
|
//if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
|
// ColFilter();
|
//}
|
|
layer.close(ajaxLoad);
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(get_MessageError(data1.code + data1.Message, sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert(get_MessageError("[0000-1-002]接口请求失败!", sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
});
|
}
|
|
//返修记录
|
function get_Display6(HBardcode) {
|
|
var sWhere = " and SN码='" + HBardcode + "'";
|
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Cj_SingleStation/ProcessItemRepair',
|
type: "GET",
|
async: false,
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
|
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' });
|
for (var i = 0; i < data.length; i++) {
|
// if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
|
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 ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 180 });
|
break;
|
case 'long':
|
case 'Int32':
|
case 'Int64':
|
case 'double':
|
case 'Decimal':
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
|
break;
|
default:
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 150 });
|
}
|
}
|
}
|
|
//动态显示列名
|
option6 = {
|
elem: '#mainTable6'
|
, toolbar: '#toolbarDemo6'
|
, cols: [col]
|
, data: data1.data
|
, height: 800
|
, page: true
|
, totalRow: true
|
, cellMinWidth: 90
|
, limit: 50
|
, limits: [50, 500, 5000, 20000]
|
, done: function (res, curr, count) {
|
soulTable.render(this);
|
}
|
}
|
table.render(option6);
|
layer.close(ajaxLoad);
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(get_MessageError(data1.code + data1.Message, sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert(get_MessageError("[0000-1-002]接口请求失败!", sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
});
|
}
|
|
//工艺参数
|
function get_Display7(HBardcode) {
|
|
var sWhere = " and 条码='" + HBardcode + "'";
|
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Cj_SingleStation/ProcessParameters',
|
type: "GET",
|
async: false,
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
|
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' });
|
for (var i = 0; i < data.length; i++) {
|
// if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
|
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 ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 180 });
|
break;
|
case 'long':
|
case 'Int32':
|
case 'Int64':
|
case 'double':
|
case 'Decimal':
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
|
break;
|
default:
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 150 });
|
}
|
}
|
}
|
|
//动态显示列名
|
option7 = {
|
elem: '#mainTable7'
|
, toolbar: '#toolbarDemo7'
|
, cols: [col]
|
, data: data1.data
|
, height: 800
|
, page: true
|
, totalRow: true
|
, cellMinWidth: 90
|
, limit: 50
|
, limits: [50, 500, 5000, 20000]
|
, done: function (res, curr, count) {
|
soulTable.render(this);
|
}
|
}
|
table.render(option7);
|
layer.close(ajaxLoad);
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(get_MessageError(data1.code + data1.Message, sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert(get_MessageError("[0000-1-002]接口请求失败!", sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
});
|
}
|
|
// 快速过滤
|
function get_FastQuery() {
|
var HBardCode = $("#HBardCode").val();
|
|
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();
|
|
if (ColName != 0 && Comparator != 0) {
|
var com = "";
|
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 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;
|
// }
|
// com = " and (" + ColName + " " + com + ")";
|
//}
|
|
//sWhere += com;
|
|
if (HBardCode!="") {
|
sWhere += " order by 出站时间";
|
}
|
|
get_Display2(sWhere);
|
get_Display5(sWhere);
|
if (HBardCode != "") {
|
get_Display3(HBardCode);//配件清单
|
get_Display6(HBardCode);//返修记录
|
get_Display7(HBardCode);//工艺参数
|
get_Display4(HBardCode);//配件变更记录
|
}
|
|
sWhere = "";//调用接口后清空sWhere缓存
|
initFunction(1, HModName, sessionStorage["HTranSlate"]);
|
}
|
|
function set_ClearQuery() {
|
$("#HICMOBillNo").val("");
|
$("#HBardCode").val("");
|
$("#HProcExchBillNo").val("");
|
$("#ColContent1").val("");
|
$("#ColName1").val("0");
|
$("#Comparator1").val("0");
|
$("#ColContent2").val("");
|
$("#ColName2").val("0");
|
$("#Comparator2").val("0");
|
$("#ColContent").val("");
|
$("#ColName").val("0");
|
$("#Comparator").val("0");
|
form.render('select');
|
|
sWhere = "";
|
}
|
|
//隐藏列设置
|
function get_HideColumn() {
|
var colName = "";
|
var contentUrl = "";
|
for (var i = 1; i < option2.cols[0].length - 1; i++) {
|
colName += option2.cols[0][i]["title"] + ",";
|
}
|
var urlStr = window.document.location.pathname;//获取文件路径
|
var urlLen = urlStr.split('/');
|
for (var i = 0; i < urlLen.length - 4; i++) {
|
contentUrl += "../";
|
}
|
colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI 进行编码
|
|
contentUrl += '基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName;
|
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "隐藏列设置" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["50%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: [contentUrl, "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//刷新表格数据
|
DisPlay_HideColumn();
|
//更新表格缓存的数据
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
|
//显示列数据
|
function DisPlay_HideColumn() {
|
$.ajax({
|
url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
|
type: "GET",
|
async: false,
|
data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.data.length != 0) {
|
|
|
var dataCol = [];//数据库查询出的列数据
|
|
|
dataCol = data1.data[0].HGridString.split(',');
|
|
for (var i = 0; i < option2.cols[0].length - 2; i++) {
|
var dataCols = dataCol[i].split('|');
|
//隐藏列
|
if (dataCols[1] == 1) {
|
option2.cols[0][i + 1]["hide"] = true;
|
}
|
//设置列宽
|
if (dataCols[3] > 0) {
|
option2.cols[0][i + 1]["width"] = dataCols[3];
|
}
|
//设置内容字体大小
|
if (data1.data[0].HFontSize != 0) {
|
option2.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
|
} else {
|
option2.cols[0][i + 1]["style"] = "font-size:100%";
|
}
|
//设置列宽
|
//if (data1.data[0].HColumnWidth != 0) {
|
// option2.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
|
//} else {
|
// option2.cols[0][i + 1]["width"] = "";
|
//}
|
//显示列
|
if (dataCols[1] == 0 && $.inArray(option2.cols[0][i + 1]["title"], titleData) == -1) {
|
option2.cols[0][i + 1]["hide"] = false;
|
}
|
//字体所在位置(左 居中 右)
|
switch (dataCols[2]) {
|
case "L":
|
option2.cols[0][i + 1]["align"] = "left";
|
break;
|
case "M":
|
option2.cols[0][i + 1]["align"] = "center";
|
break;
|
case "R":
|
option2.cols[0][i + 1]["align"] = "right";
|
break;
|
}
|
}
|
|
//取消冻结列
|
for (var i = 1; i < option2.cols[0].length - 1; i++) {
|
if (option2.cols[0][i]["fixed"] != null) {
|
option2.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(option2.cols[0][i + 1]["title"], titleData) != -1) {
|
data1.data[0].HFixCols += 1;
|
}
|
option2.cols[0][i + 1]["fixed"] = "left";
|
}
|
}
|
table.render(option2);
|
} else {
|
table.render(option2);
|
}
|
}, error: function () {
|
layer.alert(get_MessageError("[0000-1-002]接口请求失败!", sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
})
|
}
|
|
// 列明显示下拉框
|
function ColFilter() {
|
var Organization = '<option value="0" selected="selected" ></option>';
|
for (var i = 2; i < option2.cols[0].length; i++) {
|
if (option2.cols[0][i].hide != true) {
|
Organization += '<option style="color:blue;" value="' + option2.cols[0][i].field + '">' + option2.cols[0][i].field + '</option>';
|
}
|
}
|
$("#ColName").empty();
|
$("#ColName").append(Organization); $("#ColName1").empty();
|
$("#ColName1").append(Organization); $("#ColName2").empty();
|
$("#ColName2").append(Organization);
|
form.render('select');
|
}
|
//#endregion
|
|
//以上是layui模块
|
});
|
|
|
|
|
</script>
|