<!DOCTYPE html>
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
<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>
|
<script src="../../../layuiadmin/PageTitle.js"></script>
|
<script src="../../../layuiadmin/MESLanguage.js"></script>
|
<script src="../../../layuiadmin/HideButton_New.js"></script>
|
<script src="../../../layuiadmin/SetColumn.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_HStatus">状态</label>
|
<div class="layui-input-block">
|
<select id="HStatus" lay-filter="HStatus" style="width:190px;" class="ForFilteringSchemes">
|
<option value="-1" selected="selected">全部</option>
|
<option value="0">未审核</option>
|
<option value="1">已审核</option>
|
<option value="2">已关闭</option>
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" id="BT_HInitTimeCycle">日期间隔</label>
|
<div class="layui-input-block">
|
<select name="HInitTimeCycle" id="HInitTimeCycle" class="ForFilteringSchemes" lay-filter="HInitTimeCycle" style="width:190px;">
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" id="BT_HBeginDate">开始日期</label>
|
<div class="layui-input-block">
|
<input type="date" class="layui-input ForFilteringSchemes" id="HBeginDate" style="width:190px;">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" id="BT_HEndDate">结束日期</label>
|
<div class="layui-input-block">
|
<input type="date" class="layui-input ForFilteringSchemes" id="HEndDate" 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 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">
|
<div class="layui-row">
|
<div class="layui-inline">
|
<div class="layui-inline">
|
<span id="BT_QTTJ">其他条件></span>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;" id="BT_HWorkBillNo">任务单号</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HWorkBillNo" id="HWorkBillNo">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;" id="BT_HBillNo">单据号</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;" id="BT_HProcExchBillNo">工序流转卡号</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="工序流转卡号" id="工序流转卡号">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style=" margin-top: 10px; margin-left: 80px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;" id="BT_HNumber">产品代码</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HNumber" id="HNumber">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;" id="BT_HName">当前工序</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HName" id="HName">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" id="BT_HSourceName">生产资源</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HSourceName" id="HSourceName" class="layui-input ForFilteringSchemes" value="" style="float: left; width: 150px;">
|
<button type="button" class="layui-btn" lay-submit="" lay-filter="ProductionResources-BT" id="ProductionResources-BT" style="width: 40px; padding: 0 10px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style=" margin-top: 10px; margin-left: 80px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;" id="BT_HGroupName">生产班组</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HGroupName" id="HGroupName">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;" id="BT_HCenterName">工作中心</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HCenterName" id="HCenterName">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" id="BT_HDeptName">生产车间</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HDeptName" id="HDeptName" class="layui-input ForFilteringSchemes" value="" style="float: left; width: 150px;">
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="HDeptList" style="width:40px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style="margin-top:5px">
|
<div class="layui-inline">
|
<label class="layui-form-label" id="BT_ColName">过滤</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:5px">
|
<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" 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:5px">
|
<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" 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>
|
<table class="" id="mainTable" lay-filter="mainTable"></table>
|
<div id="page" style="position: relative; bottom: 0;"></div>
|
<script type="text/html" id="toolbarDemo">
|
<div class="layui-btn-container" id="toolbarDemo_ButtonSet">
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" 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" style="display:none;" lay-event="btn-Add" id="btn-Add"><i class="layui-icon layui-icon-add-1"></i>新增</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Edit" id="btn-Edit"><i class="layui-icon layui-icon-edit"></i>编辑</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Delete" id="btn-Delete"><i class="layui-icon layui-icon-delete"></i>删除</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Audit" id="btn-Audit"><i class="layui-icon layui-icon-radio"></i>审核</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-DeAudit" id="btn-DeAudit"><i class="layui-icon layui-icon-circle"></i>反审核</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CloseBill" id="set_CloseBill"><i class="layui-icon layui-icon-form"></i>关闭</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CancelCloseBill" id="set_CancelCloseBill"><i class="layui-icon layui-icon-form"></i>反关闭</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-FirstPieceCheck" id="btn-FirstPieceCheck"><i class="layui-icon layui-icon-form"></i>首检</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_HideColumn" id="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_HideButton" id="HideButton"><i class="layui-icon layui-icon-form"></i>按钮设置</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" 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" style="display:none;" lay-event="set_ReadScheme" id="set_ReadScheme"><i class="layui-icon layui-icon-set"></i>读取方案</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="get_Refresh" id="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Exit" id="btn-Exit"><i class="layui-icon layui-icon-logout"></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','soulTable'], function () {
|
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
|
, soulTable = layui.soulTable
|
|
var Organization = sessionStorage["Organization"];
|
//公用变量
|
var sWhere = "";
|
var option = [];
|
var page = 1;//分页数据
|
var size = 50;
|
|
var ins; //用于导出excel
|
var HModName = "Cj_StationInBillList";
|
var HBillType = "Cj_StationInBillList";
|
var set_HideButton_ID = "toolbarDemo_ButtonSet";//需要设置的按钮的父级节点的id
|
var titleData = ["hmainid", "HProcID", "HMaterID", "HEmpID", "HSourceID", "HGroupID", "HInterID", "HDeptID", "HProcExchInterID", "HProcExchEntryID", "HICMOInterID", "HICMOEntryID", "HICMOQty", "HRemark", "HBillType", "hsubid", "HBillStatus", "HBillSubType"];//不需要显示的字段 可扩展
|
|
//工序流转卡下查标记
|
var lookDownBar = 0; //(0:下查操作;1:直接查看)
|
var params = get_UrlVars(); //获取参数
|
|
//#region 【过滤方案】
|
|
//过滤条件的class类
|
var HClassTag = "ForFilteringSchemes";
|
//模块名称(中文版) 每个模块页面都需要修改
|
window.HModuleName = "工序进站接收单列表";
|
//是否已经选择了过滤方案(全局变量)
|
window.HDefaultFilter = "";
|
//选择的过滤方案内码(全局变量)
|
window.HInterID_Choose = 0;
|
|
//#endregion
|
|
//#region 【动态获取模块名称】
|
var HModuleType = "3790";
|
//通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
|
var HPageTitle = get_PageTitle(HModuleType) == "" ? document.title : get_PageTitle(HModuleType);
|
//#endregion
|
|
//初始化界面
|
set_ClearBill();
|
|
//重置按钮
|
form.on('submit(btnReSearch)', function (data) {
|
set_ClearQuery();
|
|
if (page != 1) {
|
$("#page a:eq(1)").get(0).click();//点击分页栏第一页
|
} else {
|
get_FastQuery();
|
}
|
});
|
|
//查询按钮
|
form.on('submit(btnSearch)', function (data) {
|
if (page != 1) {
|
$("#page a:eq(1)").get(0).click();//点击分页栏第一页
|
} else {
|
get_FastQuery();
|
}
|
//initFunction(1, HModName, sessionStorage["HTranSlate"]);
|
});
|
|
//日期间隔下拉列表监听
|
form.on('select(HInitTimeCycle)', function (data) {
|
var HInitTimeCycle = $("#HInitTimeCycle").val() * 1;
|
//若日期间隔不为 任意间隔,则禁用开始日期与结束日期的选择
|
if (HInitTimeCycle != -1) {
|
$('#HBeginDate').prop('disabled', true);
|
$('#HEndDate').prop('disabled', true);
|
|
$("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * HInitTimeCycle), "yyyy-MM-dd"));
|
$("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
|
|
//执行查询方法
|
get_FastQuery();
|
} else {
|
$('#HBeginDate').prop('disabled', false);
|
$('#HEndDate').prop('disabled', false);
|
}
|
});
|
|
|
//#region 选择生产车间按钮
|
form.on('submit(HDeptList)', function () {
|
get_checkDept();
|
});
|
//#endregion
|
|
//生产订单回车方法
|
$('#HWorkBillNo').on('keydown', function (event) {
|
var HWorkBillNo = $('#HWorkBillNo').val();
|
if (event.keyCode == 13) {
|
if (!HWorkBillNo) {
|
layer.msg(get_MessageError("[3790-1-001]任务单号不能为空!", sessionStorage["HTranSlate"]))
|
return;
|
}
|
$("#btnSearch").click();
|
}
|
});
|
//单据号回车方法
|
$('#HBillNo').on('keydown', function (event) {
|
var HBillNo = $('#HBillNo').val();
|
if (event.keyCode == 13) {
|
if (!HBillNo) {
|
layer.msg(get_MessageError("[0000-1-056]单据号不能为空!", sessionStorage["HTranSlate"]))
|
return;
|
}
|
$("#btnSearch").click();
|
}
|
});
|
//工序流转卡回车方法
|
$('#工序流转卡号').on('keydown', function (event) {
|
var HStepBillNo = $('#工序流转卡号').val();
|
if (event.keyCode == 13) {
|
if (!HStepBillNo) {
|
layer.msg(get_MessageError("[0000-1-057]工序流转卡号不能为空!", sessionStorage["HTranSlate"]))
|
return;
|
}
|
$("#btnSearch").click();
|
}
|
});
|
|
//行监听事件
|
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;
|
}
|
});
|
});
|
|
//头工具栏事件
|
table.on('toolbar(mainTable)', function (obj) {
|
switch (obj.event) {
|
//新增
|
case 'btn-Add': set_AddNew();
|
break;
|
//编辑
|
case 'btn-Edit': set_ShowBill();
|
break;
|
//删除
|
case 'btn-Delete': btn_Delete();
|
break;
|
//审核
|
case 'btn-Audit': set_CheckBill();
|
break;
|
//反审核
|
case 'btn-DeAudit': set_AbandonCheck();
|
break;
|
//关闭
|
case 'set_CloseBill': set_CloseBill(1);
|
break;
|
//反关闭
|
case 'set_CancelCloseBill': set_CloseBill(2);
|
break;
|
//首检
|
case 'btn-FirstPieceCheck': set_FirstPieceCheck();
|
break;
|
//刷新
|
case 'get_Refresh': get_Refresh();
|
break;
|
//退出
|
case 'btn-Exit': get_Exit();
|
break;
|
//导出excel
|
case 'get_export':
|
get_Export();
|
break;
|
//列设置
|
case 'set_HideColumn': get_HideColumn(HModName, sessionStorage["HUserName"], option, optionPage, get_FastQuery);
|
break;
|
//按钮设置
|
case 'set_HideButton':
|
get_HideButton(set_HideButton_ID, HBillType, HModName, sessionStorage["HUserName"]);
|
break;
|
//保存方案
|
case 'set_SaveScheme': set_SaveScheme();
|
break;
|
//读取方案
|
case 'set_ReadScheme': set_ReadScheme();
|
break;
|
};
|
});
|
|
|
//#region 本页面所有被调用的方法
|
|
//#region编辑前判断
|
function set_ShowBillJudge(data) {
|
var HBillNo = data[0].单据号;
|
var wait = layer.load();
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Cj_StationInBill/set_ShowBillJudge", //方法所在页面和方法名
|
data: { "HBillNo": HBillNo },
|
success: function (result) {
|
if (result.count == 1) {
|
//打开编辑页面
|
set_ShowBill_open(data);
|
} else {
|
layer.alert(result.Message, { icon: 5 });
|
}
|
layer.close(wait);
|
}, error: function () {
|
layer.close(wait);
|
layer.alert(get_MessageError("[0000-1-002]接口请求失败!", sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
});
|
}
|
//#endregion
|
|
//#region 打开编辑页面
|
function set_ShowBill_open(data) {
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '编辑' + HPageTitle
|
, shade: 0.6
|
, maxmin: false
|
, anim: 0
|
, content: ['Cj_StationInBill.html?OperationType=4&linterid=' + data[0].HInterID + '&HSouceBillType=&HBillNo=' + data[0].单据号, 'yes']
|
, resize: false
|
, cancel: function () {
|
btnIs();
|
}
|
, end: function () {
|
get_FastQuery(table, option);
|
}
|
})
|
}
|
//#endregion
|
|
//#endregion
|
|
//#region 初始化界面
|
function set_ClearBill() {
|
//初始化日期间隔、开始日期、结束日期
|
setSelect_HInitTimeCycle();
|
//若日期间隔不为 任意间隔,则禁用开始日期与结束日期的选择
|
var HInitTimeCycle = $("#HInitTimeCycle").val() * 1;
|
if (HInitTimeCycle != -1) {
|
$('#HBeginDate').prop('disabled', true);
|
$('#HEndDate').prop('disabled', true);
|
} else {
|
$('#HBeginDate').prop('disabled', false);
|
$('#HEndDate').prop('disabled', false);
|
}
|
$("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * HInitTimeCycle), "yyyy-MM-dd"));
|
$("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
|
//初始化表格
|
set_InitGrid();
|
//查询当前登录用户有没有在当前模块设置默认过滤方案
|
get_DefaultModule();
|
}
|
//#endregion
|
|
//初始化表格
|
function set_InitGrid() {
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, defaultToolbar: ['filter', 'exports', 'print']
|
, height: 'full-80'
|
, totalRow: true
|
, cellMinWidth: 90
|
, limit: 50
|
//, limits: [50, 500, 5000, 20000]
|
, cols: [[
|
{ type: 'checkbox', fixed: 'left' }
|
, { field: 'hmainid', title: 'hmainid', sort: true, hide: true }
|
, { field: '任务单', title: '任务单', width: 125, sort: true}
|
, { field: '单据号', title: '单据号', width: 190, sort: true}
|
, { field: '制单人', title: '制单人', sort: true}
|
, { field: '流转卡号', title: '工序流转卡号', width: 125, sort: true}
|
, { field: 'HProcID', title: 'HProcID', hide: true, sort: true}
|
, { field: '当前工序代码', title: '当前工序代码', width: 125, sort: true}
|
, { field: '当前工序', title: '当前工序', sort: true}
|
, { field: 'HMaterID', title: 'HMaterID', hide: true, sort: true}
|
, { field: '产品代码', title: '产品代码', sort: true}
|
, { field: '产品名称', title: '产品名称', width: 125, sort: true}
|
, { field: '规格型号', title: '规格型号', sort: true}
|
, {
|
field: '进站时间', title: '进站时间', width: 105, sort: true, templet: function (d) {
|
if (d.进站时间 == null) {
|
return "";
|
}
|
return util.toDateString(d.进站时间, "yyyy-MM-dd HH:mm:ss");
|
}
|
}
|
, { field: '接收数量', title: '进站接收数量', totalRow: true, sort: true}
|
, { field: 'HEmpID', title: 'HEmpID', hide: true, sort: true}
|
, { field: '操作员代码', title: '操作员代码', width: 125, sort: true}
|
, { field: '操作员', title: '操作员', sort: true}
|
, { field: 'HSourceID', title: 'HSourceID', hide: true, sort: true}
|
, { field: '生产资源代码', title: '生产资源代码', width: 125, sort: true}
|
, { field: '生产资源', title: '生产资源', sort: true}
|
, { field: 'HGroupID', title: 'HGroupID', hide: true, sort: true}
|
, { field: '生产班组代码', title: '生产班组代码', width: 125, sort: true}
|
, { field: '生产班组代码', title: '生产班组代码', width: 125, sort: true}
|
, { field: '生产班组', title: '生产班组', sort: true}
|
, { field: 'LOT数量', title: 'LOT数量', totalRow: true,sort: true}
|
]]
|
, text: {
|
none: '无数据'
|
}
|
};
|
|
optionPage = {
|
elem: 'page', //注意,这里的 page 是 ID,不用加 # 号
|
count: 10000, //数据总数,从服务端得到
|
limit: 50,
|
limits: [50, 500, 5000, 50000],
|
layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
|
jump: function (obj, first) {
|
|
//首次不执行
|
if (!first) {
|
//do something
|
console.log(obj)
|
page = obj.curr;
|
size = obj.limit;
|
get_FastQuery();
|
}
|
}
|
}
|
laypage.render(optionPage);
|
laypage.render(optionPage);
|
}
|
//#endregion 监听网格表体事件
|
table.on('tool(mainTable)', function (obj) {
|
var data = obj.data;
|
|
//单据号超链接
|
if (obj.event == '单据号') { //检查 obj.event 是否等于字符串 '单据号'。如果等于,则执行if循环
|
data = checkStatus.data; //声明变量linterid 为 data.hmainid
|
//if (AllowLoadData(sSubStr) != false) {//非空验证
|
layer.open({ //使用 layer的open打开弹出 层
|
type: 2 //表示弹出层的内容是一个 iframe
|
, area: ['100%', '100%']
|
, title: '编辑' + HPageTitle //设置弹出层的名字和变量
|
, closeBtn: 1//显示关闭按钮
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['Cj_StationInBill.html?OperationType=4&linterid=' + data[0].HInterID + '&HSouceBillType=&HBillNo=' + data[0].单据号, 'yes']//设置 iframe 的 URL,URL 中包含了查询参数,来调用所需要的值
|
|
, resize: false, //是否允许用户调整弹出大小
|
end: function () { //当关闭时调用
|
get_FastQuery(table, option);
|
}
|
, cancel: function () { //点击取消时使用回调
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
}
|
});
|
//#endregion
|
//加载网格
|
function get_Display(sWhere) {
|
//进入页面显示的缓存列表
|
var ajaxLoad = layer.load();
|
var wait = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Cj_StationInBill/get_Display',
|
type: "GET",
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "HBillSubType":"3790"},
|
success: function (data1) {
|
if (data1.count == 1) {
|
var totalArray = ["LOT数量", "接收数量", "流转卡数量"];
|
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 if ($.inArray(data[i].name, totalArray) > -1) {
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 });
|
} else if (data[i].name == '单据号') {
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: '单据号' });
|
}
|
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')}}</div>", width: 200 });
|
break;
|
default:
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
|
}
|
}
|
}
|
|
//动态显示列名
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, cols: [col]
|
, data: data1.data
|
, height: 'full-50'
|
, page: true
|
, totalRow: true
|
, cellMinWidth: 90
|
, limit: 50
|
, limits: [50, 500, 5000, 20000]
|
, done: function (res, curr, count) {
|
soulTable.render(this);
|
}
|
}
|
//刷新表格数据
|
DisPlay_HideColumn(HModName, sessionStorage["HUserName"], option, titleData)
|
laypage.render(optionPage);
|
ins = table.render(option);
|
//刷新按钮显示
|
Display_HideButton(set_HideButton_ID, HBillType, HModName, sessionStorage["HUserName"]);
|
layer.close(ajaxLoad);
|
if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
|
ColFilter();
|
}
|
//layer.alert("查询成功", { icon: 1 });
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert(get_MessageError("[0000-1-002]接口请求失败!", sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
});
|
layer.close(wait);
|
}
|
|
//#region 查询-分页
|
function get_DisplayPage(sWhere) {
|
var wait = layer.load();//遮罩
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Cj_StationInBill/get_Display_byPage',
|
type: "GET",
|
async:false,
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "Organization": Organization, "page": page, "size": size, "HBillSubType": "3790" },
|
success: function (data1) {
|
option.limit = size;//改变表格页大小
|
optionPage.count = data1.count;//改变列表数据总数
|
if (data1.count != 0) {
|
var totalArray = ["LOT数量", "接收数量", "流转卡数量"];
|
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 if ($.inArray(data[i].name, totalArray) > -1) {
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 });
|
} else if (data[i].name == '单据号') {
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: '单据号' });
|
}
|
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')}}</div>", width: 200 });
|
break;
|
default:
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
|
}
|
}
|
}
|
|
//动态显示列名
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, cols: [col]
|
, data: data1.data
|
, height: 'full-80'
|
//, page: true
|
, totalRow: true
|
, cellMinWidth: 90
|
, limit: 50
|
//, limits: [50, 500, 5000, 20000]
|
, done: function (res, curr, count) {
|
soulTable.render(this);
|
}
|
}
|
//刷新表格数据
|
DisPlay_HideColumn(HModName, sessionStorage["HUserName"], option, titleData)
|
laypage.render(optionPage);
|
ins = table.render(option);
|
//刷新按钮显示
|
Display_HideButton(set_HideButton_ID, HBillType, HModName, sessionStorage["HUserName"]);
|
layer.close(ajaxLoad);
|
if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
|
ColFilter();
|
}
|
//layer.alert("查询成功", { icon: 1 });
|
} else {
|
optionPage.count = data1.count;//改变列表数据总数
|
laypage.render(optionPage);
|
|
option.data = [];
|
//刷新表格数据
|
DisPlay_HideColumn(HModName, sessionStorage["HUserName"], option, titleData)
|
laypage.render(optionPage);
|
ins = table.render(option);
|
//刷新按钮显示
|
Display_HideButton(set_HideButton_ID, HBillType, HModName, sessionStorage["HUserName"]);
|
layer.close(ajaxLoad);
|
if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
|
ColFilter();
|
}
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert(get_MessageError("[0000-1-002]接口请求失败!", sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
});
|
layer.close(wait);
|
}
|
//#endregion
|
|
|
//快速过滤
|
function get_FastQuery() {
|
//判断是否为下查操作,若是则变更查询单号和时间过滤条件
|
if (typeof (params[params[0]]) != "undefined" && lookDownBar == 0) {
|
$("#工序流转卡号").val(params[params[0]]);
|
$("#HBeginDate").val("1990-01-01");
|
$("#HEndDate").val("2200-12-30");
|
lookDownBar = 1;
|
}
|
|
var HStatus = $("select[name='HStatus']").val();//状态
|
var 工序流转卡号 = $("#工序流转卡号").val();
|
var HWorkBillNo = $("#HWorkBillNo").val(); //任务单号
|
var HBillNo = $("#HBillNo").val(); //单据号
|
var HBeginDate = $("#HBeginDate").val();//开始日期
|
var HEndDate = $("#HEndDate").val();//结束日期
|
var HNumber = $("#HNumber").val(); //产品代码 即物料编码
|
var HName = $("#HName").val(); //当前工序
|
|
var HSourceName = $("#HSourceName").val(); //生产资源
|
var HGroupName = $("#HGroupName").val(); //生产班组
|
var HCenterName = $("#HCenterName").val(); //工作中心
|
var HDeptName = $("#HDeptName").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;
|
}
|
if (工序流转卡号) {
|
sWhere += " and 流转卡号 like '%" + 工序流转卡号 + "%'";
|
}
|
if (HBeginDate) {
|
sWhere += " and CONVERT(varchar(100),进站时间, 23) >= '" + HBeginDate + "'";
|
}
|
if (HEndDate) {
|
sWhere += " and CONVERT(varchar(100),进站时间, 23) <= '" + HEndDate + "'";
|
}
|
if (HWorkBillNo) {
|
sWhere += " and 任务单 like '%" + HWorkBillNo + "%'";
|
}
|
if (HBillNo) {
|
sWhere += " and 单据号 like '%" + HBillNo + "%'";
|
}
|
if (HNumber) {
|
sWhere += " and 产品代码 like '%" + HNumber + "%'";
|
}
|
if (HName) {
|
sWhere += " and 当前工序 like '%" + HName + "%'";
|
}
|
|
if (HSourceName) {
|
sWhere += " and 生产资源 like '%" + HSourceName + "%'";
|
}
|
if (HGroupName) {
|
sWhere += " and 生产班组 like '%" + HGroupName + "%'";
|
}
|
if (HCenterName) {
|
sWhere += " and 工作中心 like '%" + HCenterName + "%'";
|
}
|
if (HDeptName) {
|
sWhere += " and 生产车间 like '%" + HDeptName + "%'";
|
}
|
|
if (HStatus) {
|
switch (HStatus) {
|
case '-1': //全部
|
sWhere += "";
|
break;
|
case '0': //未审核
|
sWhere += " and 审核人=''";
|
break;
|
case '1': //已审核
|
sWhere += " and 审核人<>''";
|
break;
|
case '2': //已关闭
|
sWhere += " and 关闭人<>''";
|
default:
|
}
|
}
|
sWhere += " and HBillSubType<>'SUB'";
|
//get_Display(sWhere);
|
|
get_DisplayPage(sWhere);
|
|
sWhere = "";//调用接口后清空sWhere缓存
|
initFunction(1, HModName, sessionStorage["HTranSlate"]);
|
}
|
|
//重置过滤条件
|
function set_ClearQuery() {
|
$("#HWorkBillNo").val("");
|
$("#HBillNo").val("");
|
$("#工序流转卡号").val("");
|
$("#HNumber").val("");
|
$("#HName").val("");
|
|
$("#HSourceName").val();
|
$("#HGroupName").val();
|
$("#HCenterName").val();
|
$("#HDeptName").val();
|
var HInitTimeCycle = $("#HInitTimeCycle").val() * 1;
|
$("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * HInitTimeCycle), "yyyy-MM-dd"));
|
$("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
|
$("#HBillNo").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");
|
form.render('select');
|
|
sWhere = "";
|
}
|
|
//#region 生产车间选择页面
|
function get_checkDept() {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '生产车间列表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../Baseset/基础资料/Gy_DepartmentList.html?openType=2', 'yes']
|
, btn: ['确定', '取消']
|
, btn1: function (index, layero) {//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg(get_MessageError('[0000-1-020]请选择数据', sessionStorage["HTranSlate"]));
|
}
|
$("#HDeptName").val(checkStatus.data[0].HName);
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
}
|
//#endregion
|
|
//选择生产资源弹窗
|
form.on('submit(ProductionResources-BT)', function () {//生产资源
|
console.log($('#HProcNo').val())
|
layer.open({
|
type: 2
|
, area: ['80%', '80%']
|
, title: '生产资源'
|
, shade: 0.6 //遮罩透明度
|
//, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../Baseset/基础资料/Gy_GetProductionResourcesList.html?Htype=&openType=2', 'yes']
|
, resize: false
|
, cancel: function (index, layero) {
|
}
|
})
|
});
|
|
//编辑单据
|
function set_ShowBill() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
//打开编辑页面
|
set_ShowBill_open(data);
|
} else {
|
layer.msg(get_MessageError('[0000-1-001]请选择一行数据编辑!', sessionStorage["HTranSlate"]));
|
}
|
}
|
|
//删除单据
|
function btn_Delete() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
layer.confirm(get_MessageError('[0000-1-003]确定删除' + data[0].单据号 + '吗?', sessionStorage["HTranSlate"]), function (index) {
|
var ajaxLoad = layer.load();
|
//逻辑删除方法
|
$.ajax({
|
url: GetWEBURL() + '/Cj_StationInBill/del_StationInBill',
|
type: "GET",
|
data: { "HInterID": data[0].HInterID, "HDeleteMan": sessionStorage["HUserName"], "HBillSubType": "3790"},
|
success: function (result) {
|
if (result.count == 1) {
|
get_FastQuery();
|
layer.close(ajaxLoad);
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(get_MessageError(result.Message, sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert(get_MessageError("[0000-1-002]接口请求失败!", sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
});
|
layer.close(index);
|
});
|
} else {
|
layer.msg(get_MessageError('[0000-1-001]请选择一行数据编辑!', sessionStorage["HTranSlate"]));
|
}
|
}
|
|
//新增单据
|
function set_AddNew() {
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '新增' + HPageTitle
|
, shade: 0.6
|
, maxmin: false
|
, anim: 0
|
, content: ['Cj_StationInBill.html?OperationType=1&linterid=0&HSouceBillType=&HBillNo=0&closeType=1', 'yes']
|
, resize: false
|
, cancel: function () {
|
btnIs();
|
}
|
, end: function () {
|
get_FastQuery(table, option);
|
}
|
})
|
}
|
|
//首检
|
function set_FirstPieceCheck() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var linterid = data[0].HInterID.toString();
|
var OperationType = 2;
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '首件检验单-编辑'
|
, shade: 0.6
|
, maxmin: false
|
, anim: 0
|
, content: ['../../质量管理/首件检验单/QC_Add_Edit_FirstPieceCheckBill.html?OperationType=' + OperationType + '&linterid=' + linterid + '&HSouceBillType=3790&HICMOEntryID=0', 'yes']
|
, resize: false
|
, cancel: function () {
|
btnIs();
|
}
|
, end: function () {
|
get_FastQuery(table, option);
|
}
|
})
|
} else {
|
layer.msg(get_MessageError('[0000-1-001]请选择一行数据编辑!', sessionStorage["HTranSlate"]));
|
}
|
}
|
|
|
//#region 初始日期间隔 下拉列表
|
function setSelect_HInitTimeCycle() {
|
var valueList = [0, 1, 2, 3, 4, 5, 6, 29];
|
var titleList = ["今天", "近两天", "近三天", "近四天", "近五天", "近六天", "近七天", "近30天"];
|
|
var HInitTimeCycle_ArrayList = '<option value="-1" selected="selected" >任意间隔</option>';
|
for (var i = 0; i < valueList.length; i++) {
|
HInitTimeCycle_ArrayList += '<option style="color:blue;" value="' + valueList[i] + '">' + titleList[i] + '</option>';
|
}
|
|
$("#HInitTimeCycle").empty();
|
$("#HInitTimeCycle").append(HInitTimeCycle_ArrayList);
|
form.render('select');
|
|
$("#HInitTimeCycle").val("29");
|
}
|
//#endregion
|
|
//#region 导出Execel
|
function get_Export() {
|
var ModRightNameCheck = "Cj_StationInBillList_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(get_MessageError("[当前模块没有导出权限]当前模块没有导出权限!", sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert(get_MessageError("[0000-1-002]接口请求失败!", sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
});
|
}
|
//#endregion
|
|
|
//获取当前用户的默认过滤方案
|
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(get_MessageError("[0000-1-002]接口请求失败!", sessionStorage["HTranSlate"]), { 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);
|
|
var contentUrl = "";
|
var urlStr = window.document.location.pathname;//获取文件路径
|
var urlLen = urlStr.split('/');
|
for (var i = 0; i < urlLen.length - 4; i++) {
|
contentUrl += "../";
|
}
|
contentUrl += '系统管理/过滤方案设置/Xt_FastICScheme.html?OperationType=1&HModuleName=' + HModuleName + '&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type;
|
|
//当前页面上没有选择过滤方案,进入新增方法
|
if (HDefaultFilter == "") {
|
layer.open({
|
type: 2
|
, area: ['40%', '80%']
|
, title: '过滤方案'
|
, shift: 0//弹出动画
|
, content: contentUrl
|
, 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(get_MessageError('[0000-1-049]当前已选择过滤方案,是否修改?请选择对应操作', sessionStorage["HTranSlate"]), {
|
title: "操作提示",
|
icon: 0,
|
btn: [get_MessageError('[0000-1-052]新增方案', sessionStorage["HTranSlate"]), get_MessageError('[0000-1-053]保存修改当前方案', sessionStorage["HTranSlate"]), get_MessageError('[0000-1-054]取消', sessionStorage["HTranSlate"])]
|
}, function (index, layero) {
|
//新增
|
layer.open({
|
type: 2
|
, area: ['40%', '80%']
|
, title: '过滤方案'
|
, shift: 0//弹出动画
|
, content: contentUrl
|
, 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(get_MessageError(data.Message, sessionStorage["HTranSlate"]), { 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");
|
}
|
}
|
})
|
}
|
|
|
//退出
|
function get_Exit() {
|
Pub_Close(2);
|
}
|
|
//审核
|
function set_CheckBill() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var InterID = data[0].hmainid.toString();
|
//逻辑审核方法
|
var wait = layer.load();
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Cj_StationInBill/set_CheckBill", //方法所在页面和方法名
|
data: { "HInterID": InterID, "CurUserName": sessionStorage["HUserName"], "HBillSubType": "3790"},
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(get_MessageError(result.Message, sessionStorage["HTranSlate"]), { icon: 1 });
|
get_FastQuery(table, option);
|
} else {
|
layer.alert(get_MessageError(result.Message, sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
layer.close(wait);
|
}, error: function () {
|
layer.close(wait);
|
layer.alert(get_MessageError("[0000-1-002]接口请求失败!", sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
});
|
}
|
else {
|
layer.msg(get_MessageError("[0000-1-020]请选择一条数据!", sessionStorage["HTranSlate"]));
|
}
|
}
|
|
//反审核
|
function set_AbandonCheck() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var InterID = data[0].hmainid.toString();
|
//逻辑审核方法
|
var wait = layer.load();
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Cj_StationInBill/set_AbandonCheck", //方法所在页面和方法名
|
data: { "HInterID": InterID, "CurUserName": sessionStorage["HUserName"], "HBillSubType": "3790"},
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(get_MessageError(result.Message, sessionStorage["HTranSlate"]), { icon: 1 });
|
get_FastQuery(table, option);
|
} else {
|
layer.alert(get_MessageError(result.Message, sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
layer.close(wait);
|
}, error: function () {
|
layer.close(wait);
|
layer.alert(get_MessageError("[0000-1-002]接口请求失败!", sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
});
|
}
|
else {
|
layer.msg(get_MessageError("[0000-1-020]请选择一条数据!", sessionStorage["HTranSlate"]));
|
}
|
}
|
|
//关闭 [1 关闭、2 反关闭]
|
function set_CloseBill(num) {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
|
if (data.length == 1) {
|
layer.confirm(get_MessageError("[0000-1-031]确认要关闭吗?", sessionStorage["HTranSlate"]), function (index) {
|
var wait = layer.load();
|
var HInterID = data[0].hmainid;
|
$.ajax({
|
url: GetWEBURL() + '/Cj_StationInBill/CloseCj_StationInBill',
|
type: "GET",
|
data: { "HInterID": HInterID, "Type": num, "user": sessionStorage["HUserName"], "HBillSubType": "3790"},
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(get_MessageError(result.Message, sessionStorage["HTranSlate"]), { icon: 1 });
|
layer.close(wait);
|
get_FastQuery(table, option);
|
} else {
|
layer.alert(get_MessageError(result.code + result.Message, sessionStorage["HTranSlate"]), { icon: 5 });
|
layer.close(wait);
|
}
|
}, error: function () {
|
layer.alert(get_MessageError("[0000-1-002]接口请求失败!", sessionStorage["HTranSlate"]), { icon: 5 });
|
layer.close(wait);
|
}
|
});
|
})
|
}
|
else {
|
layer.msg(get_MessageError("[0000-1-020]请选择一条数据!", sessionStorage["HTranSlate"]));
|
}
|
}
|
|
//列明显示下拉框
|
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');
|
}
|
|
|
//以上是layui模块
|
});
|
|
//返回生产资源
|
function GetProductionResourcesValue(obj) {
|
$("#HSourceName").val(obj[0].生产资源);
|
}
|
|
|
//#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(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 });
|
}
|
});
|
}
|
//#endregion
|
|
|
</script>
|
|
</body>
|
</html>
|