<!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/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/HideButton.js"></script>
|
<script src="../../../layuiadmin/soulTable.slim.js"></script>
|
<script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
|
</head>
|
<body>
|
<div class="layui-fluid">
|
<div class="layui-col-md12">
|
<div class="layui-card" style="padding: 1px">
|
<div class="layui-card-body" style="padding: 1px;">
|
<form class="layui-form" action="" lay-filter="component-form-group">
|
<div class="layui-collapse">
|
<div class="layui-colla-item">
|
<div class="layui-colla-title layui-inline">
|
<div class="layui-inline">
|
<span>更多</span>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">日期间隔</label>
|
<div class="layui-input-block">
|
<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">开始日期</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">结束日期</label>
|
<div class="layui-input-block">
|
<input type="date" class="layui-input ForFilteringSchemes" id="HEndDate" style="width:190px;">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">单据号</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="WorkCenter" id="WorkCenter">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;padding: 9px 18px;">物料代码</label>
|
<div class="layui-input-block">
|
<input type="hidden" class="layui-input" lay-verify="HMaterID" name="HMaterID" id="HMaterID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<input type="text" class="layui-input" lay-verify="HMaterNumber" name="HMaterNumber" id="HMaterNumber" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHMaterID" id="btnHMaterID" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
<div class="layui-row" style="margin-top:5px;margin-left:82px;margin-bottom:5px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">生产订单组织</label>
|
<div class="layui-input-block" style="margin-left: 120px; width: 185px;">
|
<select name="HOrgID" id="HOrgID" lay-verify="HOrgID">
|
<!--动态渲染组织-->
|
</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; width: 185px;">
|
<select name="HProject" id="HProject" class=" ForFilteringSchemes" lay-verify="HProject">
|
<!--动态渲染组织-->
|
</select>
|
</div>
|
</div>
|
<button class="layui-btn layuiadmin-btn-order" style="display:none;" 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; display: none;">重置</button>
|
</div>
|
<div class="layui-row" style="margin-top:10px;margin-left:5%;">
|
<!--其他条件-->
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 76px;">物料名称</label>
|
<div class="layui-input-block" style="margin-left: 107px;">
|
<input type="text" class="layui-input" name="HMaterName" id="HMaterName">
|
</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" name="HModel" id="HModel">
|
</div>
|
</div>
|
</div>
|
<div class="layui-colla-content" style="padding: 0px; margin-left: 6%;">
|
|
<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="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">过滤</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">过滤</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">
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_AddNew" id="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>新增</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_AddNewSub" id="set_AddNewSub"><i class="layui-icon layui-icon-file-b"></i>新增子路线</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_ShowBill" id="set_ShowBill"><i class="layui-icon layui-icon-form"></i>编辑</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_Copy" id="set_Copy"><i class="layui-icon layui-icon-form"></i>复制</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_DeleteBill" id="set_DeleteBill"><i class="layui-icon layui-icon-delete"></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="get_Exit" id="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CheckBill" id="CheckBill"><i class="layui-icon layui-icon-form"></i>审核</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_AbandonCheck" id="AbandonCheck"><i class="layui-icon layui-icon-form"></i>反审核</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_startCheckBill" id="set_startCheckBill"><i class="layui-icon layui-icon-form"></i>发起审批</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="get_CheckFlowInfo" id="get_CheckFlowInfo"><i class="layui-icon layui-icon-form"></i>查看审批进度</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CheckBill_Flow" id="CheckBill_Flow"><i class="layui-icon layui-icon-form"></i>多级审核</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_AbandonCheck_Flow" id="AbandonCheck_Flow"><i class="layui-icon layui-icon-form"></i>多级反审核</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_RejectCheck_Flow" id="RejectCheck_Flow"><i class="layui-icon layui-icon-form"></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-ProcPriceRequestBills" id="btn-ProcPriceRequestBills"><i class="layui-icon layui-icon-delete"></i>多行下推(定额申请单)</button>
|
<!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></i>预览</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>打印</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-audit"><i class="layui-icon layui-icon-repeat"></i>审核</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Faudit"><i class="layui-icon layui-icon-refresh"></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="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="set_HideButton" id="set_HideButton"><i class="layui-icon layui-icon-form"></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 () {
|
|
//#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 = " 产品代码 = 'BX0002'";
|
var sWhere = "";
|
var option = [];
|
var page = 1;//分页数据
|
var size = 50;
|
var HBillType = 3301;
|
var ins; //用于导出excel
|
var HModName = "Gy_RoutingBillList";
|
var titleData = [];//不需要显示的字段 可扩展
|
//获取参数
|
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;
|
}
|
|
var HMaterID = "";
|
var HProID = 0;
|
var params = getUrlVars();
|
if (params[params[0]] != "undefined") {
|
HMaterID = params[params[0]]; //从参数中获取
|
HProID = params[params[1]]; //从参数中获取
|
}
|
//#endregion
|
|
//#region 进入页面即加载
|
|
//初始化表格
|
DisPlay_HideColumn();
|
//初始化界面
|
set_ClearBill();
|
|
//#endregion
|
|
//#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
|
|
//#region 头工具栏事件
|
table.on('toolbar(mainTable)', function (obj) {
|
switch (obj.event) {
|
//新增
|
case 'set_AddNew': set_AddNew();
|
break;
|
//新增子路线
|
case 'set_AddNewSub': set_AddNewSub();
|
break;
|
//编辑
|
case 'set_ShowBill': set_ShowBill();
|
break;
|
//多行下推
|
case 'btn-ProcPriceRequestBills': set_ProcPriceRequestBills();
|
break;
|
//删除
|
case 'set_DeleteBill': set_DeleteBill();
|
break;
|
//发起审批
|
case 'set_startCheckBill': set_startCheckBill();
|
break;
|
//查看审批进度
|
case 'get_CheckFlowInfo': get_CheckFlowInfo();
|
break;
|
//多级审核
|
case 'set_CheckBill_Flow': set_CheckBill_Flow(0);
|
break;
|
//多级反审核
|
case 'set_AbandonCheck_Flow': set_CheckBill_Flow(1);
|
break;
|
//驳回
|
case 'set_RejectCheck_Flow': set_RejectCheck_Flow();
|
break;
|
//复制
|
case 'set_Copy': set_Copy();
|
break;
|
//浏览
|
case 'get_PrintReport': get_PrintReport();
|
break;
|
//刷新
|
case 'get_Refresh': get_Refresh();
|
break;
|
//审核
|
case 'set_CheckBill': set_CheckBill(1);
|
break;
|
//反审核
|
case 'set_AbandonCheck': set_CheckBill(2);
|
break;
|
//关闭
|
case 'set_CloseBill': set_CloseBill(1);
|
break;
|
//反关闭
|
case 'set_CancelCloseBill': set_CloseBill(2);
|
break;
|
//退出按钮
|
case 'get_Exit': Pub_Close(2);
|
break;
|
//列设置
|
case 'set_HideColumn': get_HideColumn();
|
break;
|
//导出excel
|
case 'get_export':
|
get_Export();
|
break;
|
//按钮设置
|
case 'set_HideButton':
|
var btns = document.getElementsByTagName("button"); //获取本页所有按钮对象
|
get_HideButton(btns, "3301", HModName, sessionStorage["HUserName"]);
|
break;
|
};
|
});
|
|
//#endregion
|
|
//#region 查询按钮
|
form.on('submit(btnSearch)', function (data) {//选择仓位
|
|
get_FastQuery(2);
|
});
|
//#endregion
|
|
//物料
|
form.on('submit(btnHMaterID)', function (data) {//选择仓位
|
|
get_btnHMaterID();
|
});
|
|
//重置按钮
|
form.on('submit(btnReSearch)', function (data) {
|
|
set_ClearQuery();
|
});
|
//#endregion
|
|
//#region 此页面所有的方法
|
|
//获取组织
|
function Organ() {
|
//获取登录页组织列
|
$.ajax({
|
type: "get",
|
url: GetWEBURL() + "/Web/GetOrganizations",
|
success: function (result) {
|
var Organization = "";
|
if (result.count == 1) { // 说明验证成功了,
|
var data = result.data;
|
for (var i = 0; i < data.length; i++) {
|
Organization += '<option style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>';
|
}
|
$("#HOrgID").append(Organization);
|
$("#HOrgID").val(sessionStorage["OrganizationID"])
|
form.render('select');
|
}
|
layer.closeAll("loading");
|
}
|
})
|
}
|
|
//日期间隔下拉列表监听
|
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);
|
}
|
});
|
|
//#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();
|
Organ();
|
//查询
|
get_FastQuery(1);
|
//获取项目号
|
Get_HProject();
|
}
|
//#endregion
|
|
function set_InitGrid() {
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, height: 'full-150'
|
, page: false
|
, limit: 50
|
, done: function (res, curr, count) {
|
soulTable.render(this);
|
}
|
, cols: [[
|
{ type: 'checkbox', fixed: 'left' }
|
/* { field: 'hmainid', title: 'hmainid', width: 110 }*/
|
, { field: '单据号', title: '单据号', sort: true, width: 165 }
|
, { field: '工艺名称', title: '工艺名称', width: 170, sort: true }
|
, { field: '物料代码', title: '物料代码', width: 160, sort: true }
|
, { field: '物料名称', title: '物料名称', width: 160, sort: true }
|
, { field: '规格型号', title: '规格型号', width: 160, sort: true }
|
, { field: '计量单位代码', title: '计量单位代码', width: 115, sort: true }
|
, { field: '计量单位', title: '计量单位', sort: true }
|
, { field: '表头备注', title: '表头备注', sort: true }
|
, { field: '工序号', title: '工序号', sort: true }
|
, { field: '工序代码', title: '工序代码', sort: true }
|
, { field: '工序', title: '工序', sort: true }
|
, { field: '工作中心代码', title: '工作中心代码', width: 115, sort: true }
|
, { field: '工作中心名称', title: '工作中心名称', width: 115, sort: true }
|
, { field: '制单人', title: '制单人', sort: true }
|
, { field: '制单日期', title: '制单日期', width: 195, sort: true }
|
, { field: '审核人', title: '审核人', sort: true }
|
, { field: '审核日期', title: '审核日期', width: 180, sort: true }
|
, { field: '修改人', title: '修改人', sort: true }
|
, { field: '修改日期', title: '修改日期', width: 180, sort: true }
|
, { field: '默认工艺', title: '默认工艺', sort: true }
|
//, { field: '单据类型', title: '单据类型' }
|
////, { field: 'hmaterid', title: 'hmaterid', width: 165 }
|
//, { field: '组织', title: '组织' }
|
////, { field: 'hsubid', title: 'hsubid', width: 80 }
|
//, { field: '委外标记', title: '委外标记' }
|
////, { field: 'hprocid', title: 'hprocid', width: 105 }
|
////, { field: 'HSupID', title: 'HSupID', width: 105 }
|
//, { field: '供应商代码', title: '供应商代码' }
|
//, { field: '供应商', title: '供应商' }
|
////, { field: 'HCenterID', title: 'HCenterID', width: 105 }
|
//, { field: '时间单位', title: '时间单位' }
|
//, { field: '运行时间', title: '运行时间' }
|
//, { field: '加工数量', title: '加工数量' }
|
//, { field: '准备时间', title: '准备时间' }
|
//, { field: '排队时间', title: '排队时间' }
|
//, { field: '转移时间', title: '转移时间' }
|
//, { field: '良率', title: '良率' }
|
//, { field: '累计良率', title: '累计良率' }
|
//, { field: '表体备注', title: '表体备注' }
|
//, { field: '作废人', title: '作废人' }
|
//, { field: '作废日期', title: '作废日期' }
|
////, { field: 'HDayWorkQty', title: 'HDayWorkQty', width: 105 }
|
////, { field: 'HGroupID', title: 'HGroupID', width: 105 }
|
////, { field: 'HWorkerID', title: 'HWorkerID', width: 105 }
|
////, { field: 'HSourceID', title: 'HSourceID', width: 105 }
|
//, { field: '加工单价', title: '加工单价' }
|
////, { field: 'HNextProcFlag', title: 'HNextProcFlag', width: 105 }
|
//, { field: '下道流转工序', title: '下道流转工序', width: 150 }
|
//, { field: '流转工序', title: '流转工序' }
|
]]
|
};
|
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) {
|
//console.log(obj)
|
//obj包含了当前分页的所有参数,比如:
|
//console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。
|
//console.log(obj.limit); //得到每页显示的条数
|
|
//首次不执行
|
if (!first) {
|
//do something
|
page = obj.curr;
|
size = obj.limit;
|
get_FastQuery();
|
}
|
}
|
}
|
laypage.render(optionPage);
|
}
|
//#region 排序后选择
|
table.on('sort(mainTable)', function (obj) { //注:sort 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
|
table.reload('mainTable', {
|
initSort: obj //记录初始排序,如果不设的话,将无法标记表头的排序状态。 layui 2.1.1 新增参数
|
, where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
|
field: obj.field //排序字段 在接口作为参数字段 field order
|
, order: obj.type //排序方式 在接口作为参数字段 field order
|
}
|
});
|
option.data = layui.table.cache["mainTable"];
|
table.render(option);
|
});
|
//#endregion
|
|
//#region 点击行选中高亮
|
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_ClearQuery() {
|
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")); //结束日期
|
$("#WorkCenter").val("");//单据号
|
$("#HMaterID").val(0);//物料
|
$("#HMaterName").val("");//物料
|
$("#HMaterNumber").val("");//物料
|
$("#HModel").val("");//物料
|
$("#HOrderProcNO").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");
|
$("#HOrgID").val(sessionStorage["OrganizationID"]);
|
form.render('select');
|
$("#btnSearch").click();
|
sWhere = "";
|
}
|
//#endregion
|
|
|
//物料
|
function get_btnHMaterID() {
|
layer.open({
|
type: 2
|
, area: ['80%', '80%']
|
, title: '物料'
|
, shade: 0.6 //遮罩透明度
|
//, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../基础资料/公用基础资料/Gy_Material.html', '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('请选择数据');
|
}
|
$("#HMaterID").val(checkStatus.data[0].HItemID);
|
$("#HMaterName").val(checkStatus.data[0].物料名称);
|
$("#HMaterNumber").val(checkStatus.data[0].物料代码);
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
})
|
}
|
//#endregion 监听网格表体事件
|
table.on('tool(mainTable)', function (obj) {
|
var data = obj.data;
|
|
//单据号超链接
|
if (obj.event == '单据号') { //检查 obj.event 是否等于字符串 '单据号'。如果等于,则执行if循环
|
var linterid = data.hmainid.toString(); //声明变量linterid 为 data.hmainid
|
//if (AllowLoadData(sSubStr) != false) {//非空验证
|
layer.open({ //使用 layer的open打开弹出 层
|
type: 2 //表示弹出层的内容是一个 iframe
|
, area: ['100%', '100%']
|
, title: '编辑' //设置弹出层的名字和变量
|
, closeBtn: 1//显示关闭按钮
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: '../工艺路线/Gy_RoutingBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=3301' //设置 iframe 的 URL,URL 中包含了查询参数,来调用所需要的值
|
|
, resize: false, //是否允许用户调整弹出大小
|
end: function () { //当关闭时调用
|
get_FastQuery(table, option);
|
}
|
, cancel: function () { //点击取消时使用回调
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
}
|
});
|
//#endregion
|
//#region 查询
|
function get_Display(sWhere) {
|
//sWhere += " and HPRDORGID=" + sessionStorage["OrganizationID"] + " ";
|
if (HMaterID != "" && HMaterID != "undefined" && HMaterID != null) {
|
sWhere += " and HMaterID = " + HMaterID;
|
}
|
if (HProID != 0 && HProID != "undefined" && HProID != null) {
|
sWhere += " and HMainProcID = " + HProID;
|
}
|
var ajaxLoad = layer.load();
|
$.ajax({
|
//url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
|
url: GetWEBURL() + '/LEMS/MES_Gy_RoutingBillList_Json',
|
type: "GET",
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "HBillSubType":"3301" },
|
success: function (data1) {
|
if (data1.count == 1) {
|
var data = [];//列字段数据
|
var col = [];
|
var totalArray = [];
|
//给空的数组赋值
|
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++) {//遍历data数组重的数据
|
// if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
|
if ($.inArray(data[i].name, titleData) > -1) {//检查data【i】.name是否在数组中 //计算列
|
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 == "行关闭日期" ? "行关闭人" : data[i].name) + " ==''?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</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: 800
|
, page: true
|
, totalRow: true
|
, cellMinWidth: 90
|
, limit: 50
|
, limits: [50, 500, 5000, 20000]
|
, done: function (res, curr, count) {
|
soulTable.render(this);
|
}
|
}
|
|
//设置列表同一个单据只有第一条数据显示主表信息,其它记录只显示子表信息
|
//获取子表列数据
|
var colList = [];
|
for (var i = 0; i < option.cols[0].length; i++) {
|
colList.push(option.cols[0][i].field);
|
}
|
//设置数据
|
var result = data1.data;
|
var temp = "";
|
for (var i = 0; i < result.length; i++) {
|
if (temp != result[i]["单据号"]) {
|
temp = result[i]["单据号"];
|
} else {
|
var initIndex = $.inArray("单据号", colList);
|
var lastIndex = $.inArray("hsubid", colList);
|
for (var j = initIndex; j < lastIndex; j++) {
|
var fieldName = colList[j];
|
result[i][fieldName] = "";
|
}
|
}
|
}
|
|
|
option.data = result;
|
layer.close(ajaxLoad);
|
DisPlay_HideColumn();
|
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("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
//#endregion
|
|
//#region 快速过滤
|
function get_FastQuery(number) {
|
|
var HDate = $("#HBeginDate").val();//开始日期
|
var HDate1 = $("#HEndDate").val();//结束日期
|
var HOrgID = "";
|
var HOrderProcNO = $("#HOrderProcNO").val();//单据类型
|
//var HMaterID = $("#HMaterID").val();
|
var HMaterName = $("#HMaterName").val();
|
var HMaterNumber = $("#HMaterNumber").val();
|
var HModel = $("#HModel").val();
|
var WorkCenter = $("#WorkCenter").val();//单据号
|
var HProject = $("#HProject").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 = "" + Comparator + "''" + ColContent + "''";
|
break;
|
}
|
sWhere += " and " + ColName2 + " " + com2;
|
}
|
if (HDate) {
|
sWhere += " and CONVERT(varchar(100),日期, 23) >= ''" + HDate + "''";
|
}
|
if (HDate1) {
|
sWhere += " and CONVERT(varchar(100),日期, 23) <= ''" + HDate1 + "''";
|
}
|
if (HMaterID != "" && HMaterID != "undefined" && HMaterID != null) {
|
//从别的页面打开传入Hmaterid值,设置物料过滤
|
sWhere += " and HMaterID = " + HMaterID;
|
} else {
|
//不是从别的页面打开
|
var HMaterID2 = $("#HMaterID").val();
|
sWhere += (HMaterID2 == 0 ? "" : (" and HMaterID = " + HMaterID2));
|
}
|
if (HProID != 0 && HProID != "undefined" && HProID != null) {
|
sWhere += " and HMainProcID = " + HProID;
|
}
|
if (number == 1) {
|
HOrgID = sessionStorage["OrganizationID"];
|
}
|
else {
|
HOrgID = $("#HOrgID").val();//组织
|
}
|
|
if (HOrderProcNO) {
|
sWhere += " and 单据类型 like ''%" + HOrderProcNO + "%''";
|
}
|
if (HMaterName) {
|
sWhere += "and 物料名称 like ''%" + HMaterName + "%''";
|
}
|
if (HMaterNumber) {
|
sWhere += "and 物料代码 like ''%" + HMaterNumber + "%''";
|
}
|
if (HModel) {
|
sWhere += "and 规格型号 like ''%" + HModel + "%''";
|
}
|
if (WorkCenter) {
|
sWhere += " and 单据号 like ''%" + WorkCenter + "%''";
|
}
|
if (HOrgID) {
|
sWhere += " and HOrgID = ''" + HOrgID + "''";
|
}
|
if (number==2) {
|
if (HProject!='0') {
|
sWhere += " and 项目号 like ''%" + HProject + "%''";
|
}
|
}
|
|
sWhere += " and 工序代码 != ''9999'' and HBillSubType<>''SUB''"
|
get_DisplayPage(sWhere);
|
sWhere = "";//调用接口后清空sWhere缓存
|
}
|
//#endregion
|
|
//#region 分页查询
|
function get_DisplayPage(sWhere) {
|
var wait = layer.load();//遮罩
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Gy_RoutingBill/page',
|
type: "GET",
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": page, "size": size },
|
success: function (data1) {
|
option.limit = size;//改变表格页大小
|
if (data1.code == 1) {
|
optionPage.count = data1.count;//改变列表数据总数
|
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')}}</div>", width: 120 });
|
break;
|
default:
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120 });
|
}
|
}
|
}
|
|
|
option.cols = [col];
|
option.data = data1.data;
|
|
laypage.render(optionPage);
|
//刷新表格数据
|
DisPlay_HideColumn();
|
|
layer.close(ajaxLoad);
|
if ($("#ColName option").length < 1) {
|
ColFilter();
|
}
|
//layer.alert("查询成功", { icon: 1 });
|
} else {
|
//option.data = [[]]
|
//table.render(option);
|
layer.close(ajaxLoad);
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
//#endregion
|
|
//#region 新增
|
function set_AddNew() {
|
layer.open({
|
type: 2
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['100%', '100%']
|
, title: '工艺路线-新增'
|
, shift: 0//弹出动画
|
, content: '../工艺路线/Gy_RoutingBill.html?OperationType=1&linterid=&HSouceBillType=3301&linteridSub=-1'
|
, end: function () {
|
//刷新页面,
|
location.reload();
|
}
|
})
|
}
|
//#endregion
|
|
//添加子路线
|
function set_AddNewSub() {
|
layer.open({
|
type: 2
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['100%', '100%']
|
, title: '工艺路线-新增'
|
, shift: 0//弹出动画
|
, content: '../工艺路线/Gy_RoutingBill.html?OperationType=1&linterid=&HSouceBillType=SUB&linteridSub=-1'
|
, end: function () {
|
//刷新页面,
|
location.reload();
|
}
|
})
|
}
|
|
//#region 编辑
|
function set_ShowBill() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var linterid = data[0].HItemID;
|
//var linteridSub = data[0].hsubid;
|
|
//if (AllowLoadData(sSubStr) != false) {//非空验证
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '工艺路线-编辑'
|
, shift: 0//弹出动画
|
, content: '../工艺路线/Gy_RoutingBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=3301'
|
, end: function () {
|
//刷新页面,
|
location.reload();
|
}
|
})
|
} else {
|
layer.msg('请选择一行数据编辑!');
|
}
|
}
|
//#endregion
|
|
//#region 删除
|
function set_DeleteBill() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var hmainid = data[0].hmainid;
|
layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
|
var wait = layer.load();
|
//逻辑删除方法
|
$.ajax({
|
url: GetWEBURL() + '/LEMS/DeltetGy_RoutingBillSub',
|
type: "GET",
|
data: { "lngBillKey": hmainid, "user": sessionStorage["HUserName"], "HBillSubType": "3301" },
|
success: function (result) {
|
console.log('gouba' + result);
|
if (result.count == 1) {
|
layer.msg(result.Message, { icon: 1 }, function () {
|
// 得到frame索引
|
var index = layer.getFrameIndex(window.name);
|
//关闭当前frame
|
layer.close(wait);
|
//修改为功后刷新界面
|
window.location.reload();
|
});
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
layer.close(wait);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
layer.close(wait);
|
}
|
});
|
})
|
|
}
|
else {
|
layer.msg('请选择一行数据删除!');
|
}
|
|
}
|
//#endregion
|
|
//#region 获取项目号
|
function Get_HProject() {
|
//获取项目号
|
var HProjectList = '<option value="0" style="color:red;" selected></option>';
|
$.ajax({
|
type: "get",
|
url: GetWEBURL() + "/Gy_Material/Get_HProject",
|
async: false,
|
data: { "HOrgID": sessionStorage["OrganizationID"] },
|
success: function (result) {
|
if (result.count == 1) { // 说明验证成功了,
|
var data = result.data;
|
for (var i = 0; i < data.length; i++) {
|
HProjectList += '<option style="color:blue;" value="' + data[i].HName + '" >' + data[i].HName + '</option>';
|
}
|
$("#HProject").append(HProjectList);
|
form.render('select');
|
|
}
|
layer.closeAll("loading");
|
}
|
})
|
}
|
//#endregion
|
|
//#region 多行下推(采购入库单)
|
function set_ProcPriceRequestBills() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (data.length > 0) {
|
var dataArray = [];
|
for (var i = 0; i < data.length; i++) {
|
var temp = {
|
"hmainid": data[i].hmainid
|
, "hsubid": data[i].hsubid
|
}
|
dataArray.push(temp);
|
//if (data[i].状态 != "审核") {
|
// var err = "下推失败!单据【" + data[i].单据号 + "】的状态为“" + data[0].状态 + "”,不允许下推!";
|
// layer.alert(err, { icon: 5 });
|
// return;
|
//}
|
//if (data[i].行状态 != "") {
|
// var err = "下推失败!单据【" + data[i].单据号 + "】的状态为“" + data[0].行状态 + "”,不允许下推!";
|
// layer.alert(err, { icon: 5 });
|
// return;
|
//}
|
}
|
|
var datajson = {
|
"data": dataArray
|
};
|
var url = encodeURI('../../工资管理/定额申请/Pay_ProcPriceRequestBill.html?OperationType=4&linterid=0&HSouceBillType=3301&res=' + JSON.stringify(datajson))
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '工艺路线-多行下推定额申请单'
|
, shift: 0//弹出动画
|
, content: url
|
, btn: [],
|
// 按钮1 的回调
|
end: function (index, layero, that) {
|
//刷新页面
|
$("#btnSearch").trigger('click');
|
}
|
})
|
} else {
|
layer.msg('请选择数据下推!');
|
}
|
}
|
//#endregion
|
//复制
|
function set_Copy() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var linterid = data[0].HItemID;
|
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '工艺路线-编辑'
|
, shift: 0//弹出动画
|
, content: '../工艺路线/Gy_RoutingBill.html?OperationType=2&linterid=' + linterid + '&HSouceBillType=3301'
|
, end: function () {
|
//刷新页面,
|
location.reload();
|
}
|
})
|
} else {
|
layer.msg('请选择一行数据编辑!');
|
}
|
}
|
|
//#region 刷新
|
function get_Refresh() {
|
set_ClearQuery();
|
get_DisplayPage(sWhere);
|
}
|
|
//审核 [1 审核、2 反审核]
|
function set_CheckBill(num) {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
|
if (data.length == 1) {
|
layer.confirm("确认要审核吗?", function (index) {
|
var wait = layer.load();
|
var HInterID = data[0].hmainid;
|
$.ajax({
|
url: GetWEBURL() + '/Gy_RoutingBill/CheckGy_RoutingBill',
|
type: "GET",
|
data: { "HInterID": HInterID, "Type": num, "user": sessionStorage["HUserName"], "HBillSubType": "3301" },
|
success: function (result) {
|
if (result.count == 1) {
|
get_FastQuery();
|
layer.msg(result.Message, { icon: 1 });
|
layer.close(wait);
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
layer.close(wait);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
layer.close(wait);
|
}
|
});
|
})
|
} else {
|
layer.msg("请选择一条数据!");
|
}
|
}
|
|
|
//关闭 [1 关闭、2 反关闭]
|
function set_CloseBill(num) {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
|
if (data.length == 1) {
|
layer.confirm("确认要关闭吗?", function (index) {
|
var wait = layer.load();
|
var HInterID = data[0].hmainid;
|
$.ajax({
|
url: GetWEBURL() + '/Gy_RoutingBill/CloseGy_RoutingBill_1',
|
type: "GET",
|
data: { "HInterID": HInterID, "Type": num, "user": sessionStorage["HUserName"], "HBillSubType": ""},
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { icon: 1 });
|
layer.close(wait);
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
layer.close(wait);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
layer.close(wait);
|
}
|
});
|
})
|
}
|
else {
|
layer.msg("请选择一条数据!");
|
}
|
}
|
|
|
|
//#region 导出Execel
|
function get_Export() {
|
var ModRightNameCheck = "Gy_RoutingBillList_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
|
|
//#region 发起审批
|
function set_startCheckBill() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var InterID = data[0].hmainid.toString();
|
//逻辑审核方法
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Gy_Routing/StartCheckFlow", //方法所在页面和方法名
|
data: { "HInterID": InterID, "CurUserName": sessionStorage["HUserName"] },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
|
|
// 得到frame索引
|
var index = layer.getFrameIndex(window.name);
|
//关闭当前frame
|
layer.close(index);
|
$("#btnSearch").trigger('click');
|
});
|
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
//修改为功后刷新界面
|
$("#btnSearch").trigger('click');
|
}
|
else {
|
layer.msg('请选择一行数据审核!');
|
}
|
}
|
//#endregion
|
|
//#region 查看审批进度
|
function get_CheckFlowInfo() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var hID = data[0].hmainid.toString();
|
layer.open({
|
type: 2
|
, area: ['70%', '70%']
|
, title: '单据审批进度'
|
, closeBtn: 1
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: '../../系统管理/多级审批/审批进度/Xt_CheckFlowProgressList.html?linterid=' + hID + '&HSouceBillType=' + HBillType
|
, resize: false,
|
end: function () {
|
////修改为功后刷新界面
|
//if (get_needClose_Bar == 0) {
|
// $("#btnSearch").trigger('click');
|
//} else if (get_needClose_Bar == 1) {
|
// $("#get_needClose").trigger('click');
|
//}
|
}
|
, cancel: function () {
|
|
}
|
})
|
} else {
|
layer.msg('请选择一行数据查看!');
|
}
|
}
|
//#endregion
|
|
//#region 多级 反审核/审核数据
|
function set_CheckBill_Flow(num) {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var InterID = data[0].hmainid.toString();
|
//逻辑审核方法
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Gy_Routing/AuditFlow", //方法所在页面和方法名
|
data: { "HInterID": InterID, "IsAudit": num, "CurUserName": sessionStorage["HUserName"], "CurUserID": sessionStorage["Czybm"] },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
|
// 得到frame索引
|
var index = layer.getFrameIndex(window.name);
|
//关闭当前frame
|
layer.close(index);
|
//修改为功后刷新界面
|
$("#btnSearch").trigger('click');
|
});
|
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
else {
|
layer.msg('请选择一行数据审核!');
|
}
|
}
|
//#endregion
|
|
//#region 驳回
|
function set_RejectCheck_Flow(num) {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var InterID = data[0].hmainid.toString();
|
//逻辑审核方法
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Gy_Routing/RejectCheckFlow", //方法所在页面和方法名
|
data: { "HInterID": InterID, "CurUserID": sessionStorage["Czybm"] },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
|
// 得到frame索引
|
var index = layer.getFrameIndex(window.name);
|
//关闭当前frame
|
layer.close(index);
|
});
|
//修改为功后刷新界面
|
$("#btnSearch").trigger('click');
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
else {
|
layer.msg('请选择一行数据审核!');
|
}
|
}
|
//#endregion
|
|
//#endregion
|
//隐藏列设置
|
function get_HideColumn() {
|
var colName = "";
|
var contentUrl = "";
|
for (var i = 1; i < option.cols[0].length - 1; i++) {
|
colName += option.cols[0][i]["field"] + ",";
|
}
|
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 = [];//数据库查询出的列数据
|
var titleData = [];//不需要显示的字段 可扩展
|
|
dataCol = data1.data[0].HGridString.split(',');
|
|
for (var i = 0; i < option.cols[0].length - 2; i++) {
|
var dataCols = dataCol[i].split('|');
|
//隐藏列
|
if (dataCols[1] == 1) {
|
option.cols[0][i + 1]["hide"] = true;
|
}
|
//设置列宽
|
if (dataCols[3] > 0) {
|
option.cols[0][i + 1]["width"] = dataCols[3];
|
}
|
//设置内容字体大小
|
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 (data1.data[0].HColumnWidth != 0) {
|
// option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
|
//} else {
|
// option.cols[0][i + 1]["width"] = "";
|
//}
|
//显示列
|
if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
|
option.cols[0][i + 1]["hide"] = false;
|
}
|
//统计列
|
if (dataCols[6] == 1) {
|
option.cols[0][i + 1]["totalRow"] = true;
|
}
|
//字体所在位置(左 居中 右)
|
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;
|
}
|
//设置表格title属性显示别名
|
if (dataCols[4] != null && dataCols[4] != "") {
|
option.cols[0][i + 1]["title"] = dataCols[4];
|
}
|
}
|
|
//取消冻结列
|
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);
|
}
|
var btns = document.getElementsByTagName("button"); //获取本页所有按钮对象
|
Display_HideButton(btns, "3301", HModName, sessionStorage["HUserName"]);
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
})
|
}
|
//#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 列明显示下拉框
|
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].title + '</option>';
|
}
|
}
|
$("#ColName").empty();
|
$("#ColName").append(Organization); $("#ColName1").empty();
|
$("#ColName1").append(Organization); $("#ColName2").empty();
|
$("#ColName2").append(Organization);
|
form.render('select');
|
}
|
//#endregion
|
//#endregion
|
|
//以上是layui模块
|
});
|
|
//物料
|
function GetMaterValue(obj) {
|
$("#HMaterID").val(obj[0].HItemID);
|
$("#HMaterName").val(obj[0].物料名称);
|
$("#HMaterNumber").val(obj[0].物料代码);
|
}
|
|
|
</script>
|
|
</body>
|
</html>
|