<!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/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/soulTable.slim.js"></script>
|
<script src="../../../layuiadmin/PageTitle.js"></script>
|
<script src="../../../layuiadmin/SetColumn.js"></script>
|
<script src="../../../layuiadmin/HideButton_New.js"></script>
|
<style type="text/css">
|
input.layui-input.layui-unselect {
|
padding-right: 0;
|
}
|
</style>
|
</head>
|
<body>
|
<div class="layui-fluid">
|
<div class="layui-col-md12">
|
<div class="layui-card" style="padding: 1px">
|
<div class="layui-card-body" style="padding: 1px;">
|
<form class="layui-form" action="" lay-filter="component-form-group">
|
<div class="layui-collapse">
|
<div class="layui-colla-item">
|
<div class="layui-colla-title layui-inline">
|
<div class="layui-inline">
|
<span>更多</span>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">开始日期</label>
|
<div class="layui-input-block">
|
<input type="date" class="layui-input ForFilteringSchemes" id="HBeginDate">
|
</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">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">单据号</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HBillNo" id="HBillNo">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">组织名称</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HStockOrgName" id="HStockOrgName" 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-inline">
|
<div class="layui-inline">
|
<span>其他条件></span>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">部门信息</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HDept" id="HDept" 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 ForFilteringSchemes" name="HMaterNumber" id="HMaterNumber" 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 ForFilteringSchemes" name="HModelNumber" id="HModelNumber" 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 ForFilteringSchemes" name="HWhName" id="HWhName" 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 ForFilteringSchemes" name="HSupName" id="HSupName" style="width:190px;">
|
</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="ColName" id="ColName" lay-filter="ColName" style="width:190px;" class="ForFilteringSchemes">
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<select name="Comparator" id="Comparator" lay-filter="Comparator" style="width: 190px;" class="ForFilteringSchemes">
|
<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" lay-filter="ColName1" style="width:190px;" class="ForFilteringSchemes">
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<select name="Comparator1" id="Comparator1" lay-filter="Comparator1" style="width:190px;" class="ForFilteringSchemes">
|
<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" lay-filter="ColName2" style="width:190px;" class="ForFilteringSchemes">
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<select name="Comparator2" id="Comparator2" lay-filter="Comparator2" style="width:190px;" class="ForFilteringSchemes">
|
<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" lay-event="btn-Add" id="btn-Add"><i class="layui-icon layui-icon-file-b"></i>新增</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit" id="btn-Edit"><i class="layui-icon layui-icon-form"></i>编辑</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view" id="btn-view"><i class="layui-icon layui-icon-tips"></i>预览</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print" id="btn-print"><i class="layui-icon layui-icon-print"></i>打印</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-audit" id="btn-audit"><i class="layui-icon layui-icon-repeat"></i>审核</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Faudit" id="btn-Faudit"><i class="layui-icon layui-icon-refresh"></i>反审核</button>
|
<button type="button" class="layui-btn layui-btn-sm" 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" lay-event="btn-Close" id="Close"><i class="layui-icon layui-icon-radio"></i>关闭</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeClose" id="DeClose"><i class="layui-icon layui-icon-radio"></i>反关闭</button>
|
<button type="button" class="layui-btn layui-btn-sm" 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" lay-event="set_HideColumn" id="HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
|
<button type="button" class="layui-btn layui-btn-sm" 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" lay-event="get_Exit" id="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
|
</div>
|
</script>
|
</form>
|
</div>
|
</div>
|
</div>
|
</div>
|
<script>
|
//获取页面跳转参数 //单据编辑状态: 1.无源单新增 2.有源单新增 3.编辑 4.浏览 5.变更
|
var params = get_UrlVars();
|
if (typeof (params[params[0]]) == "undefined") {
|
var OperationType = 1;//操作类型
|
}
|
|
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
|
, util = layui.util
|
, soulTable = layui.soulTable
|
//查询条件
|
var sWhere = "";
|
var option = [];
|
var optionPage = [];
|
var HModName = "Sc_MouldScrapOutBillList";
|
var HBillType = "3832";
|
var set_HideButton_ID = "toolbarDemo_ButtonSet";//需要设置的按钮的父级节点的id
|
|
//#region 【过滤方案】
|
|
//过滤条件的class类
|
var HClassTag = "ForFilteringSchemes";
|
//模块名称(中文版) 每个模块页面都需要修改
|
window.HModuleName = "器具处理出库单";
|
//是否已经选择了过滤方案(全局变量)
|
window.HDefaultFilter = "";
|
//选择的过滤方案内码(全局变量)
|
window.HInterID_Choose = 0;
|
//#endregion
|
|
//#endregion
|
|
//#region 进入页面即加载
|
//#region 【动态获取模块名称】
|
var HModuleType = "3832";
|
//通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
|
var HPageTitle = get_PageTitle(HModuleType) == "" ? document.title : get_PageTitle(HModuleType);
|
//#endregion
|
|
//判断操作类型
|
if (OperationType == 1) {//无源单
|
//报工平台报检申请查看列表
|
set_ClearBill();
|
}
|
|
else {
|
layer.alert("未知操作类型!", { icon: 5 });
|
}
|
//#endregion
|
|
//#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
|
|
//头工具栏事件
|
table.on('toolbar(mainTable)', function (obj) {
|
var checkStatus = table.checkStatus(obj.config.id);
|
switch (obj.event) {
|
|
//新增
|
case 'btn-Add': set_AddNew();
|
break;
|
//编辑
|
case 'btn-Edit': set_ShowBill();
|
break;
|
//预览
|
case 'btn-view': get_ViewReport();
|
break;
|
//打印
|
case 'btn-print': get_PrintReport();
|
break;
|
//审核
|
case 'btn-audit': get_Audit();
|
break;
|
//反审核
|
case 'btn-Faudit': get_FAudit();
|
break;
|
//删除
|
case 'btn-Delete': set_DeleteBill();
|
break;
|
//关闭按钮 (0:关闭、1:反关闭)
|
case 'btn-Close':
|
set_CloseBill(0);
|
break;
|
//反关闭按钮
|
case 'btn-DeClose':
|
set_CloseBill(1);
|
break;
|
//刷新
|
case 'get_Refresh': set_Refresh();
|
break;
|
//退出
|
case 'get_Exit': Pub_Close(2);
|
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 排序后选择
|
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);
|
//刷新按钮显示
|
Display_HideButton(set_HideButton_ID, HBillType, HModName, sessionStorage["HUserName"]);
|
});
|
//#endregion
|
|
//查询按钮
|
form.on('submit(btnSearch)', function (data) {//选择仓位
|
optionPage.curr = 1;
|
get_FastQuery();
|
});
|
|
//重置按钮
|
form.on('submit(btnReSearch)', function (data) {
|
$("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
|
$("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
|
$("#HBillNo").val("");
|
$("#HDept").val("");
|
$("#HMaterNumber").val("");
|
$("#HModelNumber").val("");
|
$("#HWhName").val("");
|
$("#HSupName").val("");
|
$("#HStockOrgName").val(""); $("#ColContent").val("");
|
$("#ColName").val("0");
|
$("#Comparator").val("0");
|
$("#ColContent2").val("");
|
$("#ColName2").val("0");
|
$("#Comparator2").val("0");
|
$("#ColContent1").val("");
|
$("#ColName1").val("0");
|
$("#Comparator1").val("0");
|
form.render('select');
|
sWhere = "";
|
optionPage.curr = 1;
|
get_FastQuery();
|
});
|
//输入框回车方法
|
$('input').on('keydown', function (event) {
|
if (event.keyCode == 13) {
|
get_FastQuery();
|
}
|
});
|
//#endregion
|
|
//#region 本页面所有被调用的方法
|
|
// 初始化界面
|
function set_ClearBill() {
|
$("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
|
$("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
|
//初始化表格
|
set_InitGrid();
|
//查询
|
get_FastQuery();
|
//初始化页大小
|
DisPlay_HideColumn_GetPageSize(HModName, sessionStorage["HUserName"], optionPage);
|
ColFilter();
|
//默认方案
|
get_DefaultModule()
|
}
|
|
//初始化表格
|
function set_InitGrid() {
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, height: 'full-50'
|
, page: false
|
, totalRow: true
|
, cellMinWidth: 120
|
, limit: 50
|
, limits: [50, 500, 5000, 20000]
|
, done: function (res, curr, count) {
|
soulTable.render(this);
|
}
|
, cols: [[
|
{ type: 'checkbox', fixed: 'left', totalRowText: '合计行' }
|
, { field: 'hmainid', title: '单据ID', hide: true, sort: true }
|
, { field: '日期', title: '日期', width: 160, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>", sort: true }
|
, { field: '单据号', title: '单据号', width: 160, sort: true }
|
, { field: '单据类型', title: '单据类型', width: 160, sort: true }
|
, { field: '物料代码', title: '物料代码', width: 110, sort: true }
|
, { field: 'HSupTypeID', title: 'HSupTypeID', width: 200, hide: true, sort: true }
|
, { field: '往来类型名称', title: '往来类型', width: 200, sort: true }
|
, { field: 'HSupID', title: 'HSupID', width: 200, hide: true, sort: true }
|
, { field: '往来单位', title: '往来单位', width: 200, sort: true }
|
, { field: 'HManagerID', title: 'HManagerID', width: 200, hide: true, sort: true }
|
, { field: '负责人代码', title: '负责人代码', width: 200, sort: true }
|
, { field: '负责人名称', title: '负责人名称', width: 200, sort: true }
|
, { field: 'HWHID', title: 'HWHID', width: 200, hide: true, sort: true }
|
, { field: '仓库代码', title: '仓库代码', width: 200, sort: true }
|
, { field: '仓库名称', title: '仓库名称', width: 200, sort: true }
|
, { field: 'HKeeperID', title: 'HKeeperID', width: 200, hide: true, sort: true }
|
, { field: '发货员代码', title: '发货员代码', width: 200, sort: true }
|
, { field: '发货员名称', title: '发货员名称', width: 200, sort: true }
|
, { field: '库存组织', title: '库存组织', width: 125, sort: true }
|
, { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true, sort: true }
|
, { field: '部门代码', title: '部门代码', width: 115, sort: true }
|
, { field: '部门名称', title: '部门名称', width: 200, sort: true }
|
, { field: '摘要', title: '摘要', width: 200, sort: true }
|
, { field: '内部单据号', title: '内部单据号', width: 115, sort: true }
|
, { field: '备注', title: '备注', width: 200, sort: true }
|
, { field: 'hsubid', title: 'hsubid', width: 200, hide: true, sort: true }
|
, { field: 'HMaterID', title: 'HMaterID', width: 200, hide: true, sort: true }
|
, { field: '模具代码', title: '器具代码', width: 200, sort: true }
|
, { field: '模具名称', title: '器具名称', width: 200, sort: true }
|
, { field: 'HPropertyID', title: 'HPropertyID', width: 200, hide: true, sort: true }
|
, { field: '辅助属性代码', title: '辅助属性代码', width: 200, sort: true }
|
, { field: '辅助属性名称', title: '辅助属性名称', width: 200, sort: true }
|
, { field: 'HSecUnitID', title: 'HSecUnitID', width: 200, hide: true, sort: true }
|
, { field: '辅助计量单位代码', title: '辅助计量单位代码', width: 200, sort: true }
|
, { field: '辅助计量单位名称', title: '辅助计量单位名称', width: 200, sort: true }
|
, { field: '换算率', title: '换算率', width: 200, sort: true }
|
, { field: '批次', title: '批次', width: 200, sort: true }
|
, { field: '实发数量', title: '实发数量', width: 200, sort: true, totalRow: true}
|
, { field: '单价', title: '单价', width: 200, sort: true, totalRow: true }
|
, { field: '金额', title: '金额', width: 200, sort: true, totalRow: true}
|
, { field: '设计寿命', title: '设计寿命', width: 200, sort: true }
|
, { field: '使用寿命', title: '使用寿命', width: 200, sort: true }
|
, { field: '剩余寿命', title: '剩余寿命', width: 200, sort: true }
|
, { field: 'HWHID1', title: 'HWHID1', width: 200, hide: true, sort: true }
|
, { field: '发货仓库代码', title: '发料仓库代码', width: 200, sort: true }
|
, { field: '发货仓库名称', title: '发料仓库名称', width: 200, sort: true }
|
, { field: 'HSPID', title: 'HSPID', width: 200, hide: true, sort: true }
|
, { field: '仓位代码', title: '仓位代码', width: 200, sort: true }
|
, { field: '仓位名称', title: '仓位名称', width: 200, sort: true }
|
, { field: '子备注', title: '子备注', width: 200, sort: true }
|
, { field: '制单人', title: '制单人', width: 200, sort: true }
|
, { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
|
, { field: '审核人', title: '审核人', width: 200, sort: true }
|
, { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
|
, { field: '修改人', title: '修改人', width: 200, sort: true }
|
, { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
|
, { field: '关闭人', title: '关闭人', width: 200, sort: true }
|
, { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
|
, { field: '作废人', title: '作废人', width: 200, sort: true }
|
, { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
|
, { field: '关联数量', title: '关联数量', width: 200, sort: true }
|
, { field: '行关闭人', title: '行关闭人', width: 200, sort: true }
|
, { field: '关闭类型', title: '关闭类型', width: 200, sort: true }
|
, { field: '源单主内码', title: '源单主内码', width: 200, hide: true, sort: true }
|
, { field: '源单子内码', title: '源单子内码', width: 200, hide: true, sort: true }
|
, { field: '源单单号', title: '源单单号', width: 200, sort: true }
|
, { field: '源单类型', title: '源单类型', width: 200, sort: true }
|
]]
|
};
|
optionPage = {
|
elem: 'page', //注意,这里的 page 是 ID,不用加 # 号
|
count: 10000, //数据总数,从服务端得到
|
limit: 50,
|
limits: [50, 500, 1000, 2000],
|
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
|
get_FastQuery();
|
}
|
}
|
}
|
laypage.render(optionPage);
|
}
|
|
//查询
|
function get_Display() {
|
var ajaxLoad = layer.load();
|
//进入页面显示的缓存列表
|
$.ajax({
|
url: GetWEBURL() + '/Sc_MouldScrapOutHouseBill/GetMouldScrapOutHouseBill',
|
type: "GET",
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "Organization": sessionStorage["Organization"] },
|
success: function (data1) {
|
if (data1.count == 1) {
|
option.data = data1.data;
|
table.render(option);
|
layer.close(ajaxLoad);
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
//分页查询
|
function get_DisplayPage() {
|
var ajaxLoad = layer.load();
|
//进入页面显示的缓存列表
|
$.ajax({
|
url: GetWEBURL() + '/Sc_MouldScrapOutHouseBill/page',
|
type: "GET",
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": optionPage.curr, "size": optionPage.limit },
|
success: function (data1) {
|
option.limit = optionPage.limit;//改变表格页大小
|
if (data1.code == 1) {
|
optionPage.count = data1.count;//改变列表数据总数
|
option.data = data1.data;
|
laypage.render(optionPage);
|
//列设置
|
DisPlay_HideColumn(HModName, sessionStorage["HUserName"], option);
|
//表格加载必需在按钮显示前
|
table.render(option);
|
//刷新按钮显示
|
Display_HideButton(set_HideButton_ID, HBillType, HModName, sessionStorage["HUserName"]);
|
layer.close(ajaxLoad);
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
// 快速过滤
|
function get_FastQuery() {
|
var HBeginDate = $("#HBeginDate").val();//开始日期
|
var HEndDate = $("#HEndDate").val();//结束日期
|
var HStockOrgName = $("#HStockOrgName").val(); //组织
|
var HBillNo = $("#HBillNo").val(); //单据号
|
var HDept = $("#HDept").val(); //部门信息
|
var HMaterNumber = $("#HMaterNumber").val(); //物料代码
|
var HModelNumber = $("#HModelNumber").val(); //器具代码
|
var HWhName = $("#HWhName").val(); //仓库名称
|
var HSupName = $("#HSupName").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 (HBeginDate) {
|
sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + HBeginDate + "'";
|
}
|
if (HEndDate) {
|
sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + HEndDate + "'";
|
}
|
if (HStockOrgName) {
|
sWhere += " and 库存组织 like '%" + HStockOrgName + "%'";
|
}
|
if (HBillNo) {
|
sWhere += " and 单据号 like '%" + HBillNo + "%'";
|
}
|
if (HDept) {
|
sWhere += " and 部门名称 like '%" + HDept + "%'";
|
}
|
if (HMaterNumber) {
|
sWhere += " and 物料代码 like '%" + HMaterNumber + "%'";
|
}
|
if (HModelNumber) {
|
sWhere += " and 模具代码 like '%" + HModelNumber + "%'";
|
}
|
if (HWhName) {
|
sWhere += " and 仓库名称 like '%" + HWhName + "%'";
|
}
|
if (HSupName) {
|
sWhere += " and 往来单位 like '%" + HSupName + "%'";
|
}
|
get_DisplayPage(sWhere);
|
//调用接口后清空sWhere缓存
|
sWhere = "";
|
}
|
//#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].field + '</option>';
|
}
|
}
|
$("#ColName").empty();
|
$("#ColName").append(Organization);
|
$("#ColName1").empty();
|
$("#ColName1").append(Organization);
|
$("#ColName2").empty();
|
$("#ColName2").append(Organization);
|
form.render('select');
|
}
|
//#endregion
|
//新增
|
function set_AddNew() {
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '新增' + HPageTitle,
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '../模治具仓库管理/Sc_MouldScrapOutBill.html?OperationType=1&linterid=&HSouceBillType=&closeType=1',
|
end: function () {
|
//刷新页面,
|
location.reload();
|
},
|
success: function (layero, index) {
|
|
}
|
});
|
}
|
|
//编辑
|
function set_ShowBill() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var linterid = data[0].hmainid.toString();
|
var HBillStatus = data[0].HBillStatus.toString();
|
if (HBillStatus >1) {
|
layer.msg('单据状态不为未审核状态,不允许编辑!');
|
return false;
|
}
|
//if (AllowLoadData(sSubStr) != false) {//非空验证
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '编辑' + HPageTitle
|
, closeBtn: 1
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: '../模治具仓库管理/Sc_MouldScrapOutBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=&closeType=1'
|
, resize: false,
|
end: function () {
|
//刷新页面,
|
location.reload();
|
}
|
, cancel: function () {
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
|
} else {
|
layer.msg('请选择一行数据编辑!');
|
}
|
}
|
//预览
|
function get_ViewReport() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
layer.open({
|
type: 2
|
, area: ['50%', '50%']
|
, title: '打印模版选择'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: false //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + data[0].hmainid.toString() + '&MyMsg=' + data[0].hmainid.toString() + '&Type=HMouldScrapOutBill', 'yes']
|
, resize: false
|
})
|
}
|
else {
|
layer.msg('请选择一行数据打印!');
|
}
|
}
|
|
//#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
|
|
//打印
|
function get_PrintReport() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
layer.open({
|
type: 2
|
, area: ['50%', '50%']
|
, title: '打印模版选择'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: false //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + data[0].hmainid.toString() + '&MyMsg=' + data[0].hmainid.toString() + '&Type=HMouldScrapOutBill', 'yes']
|
, resize: false
|
})
|
}
|
else {
|
layer.msg('请选择一行数据打印!');
|
}
|
}
|
//审核
|
function get_Audit() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var InterID = data[0].hmainid.toString();
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "Sc_MouldScrapOutHouseBill/AuditMouldScrapOutHouseBill", //方法所在页面和方法名
|
data: { "HInterID": InterID, "user": sessionStorage["HUserName"], "flag": 1 },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
|
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('请选择一行数据!');
|
}
|
}
|
//反审核
|
function get_FAudit() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var InterID = data[0].hmainid.toString();
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "Sc_MouldScrapOutHouseBill/AuditMouldScrapOutHouseBill", //方法所在页面和方法名
|
data: { "HInterID": InterID, "user": sessionStorage["HUserName"], "flag": 2 },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
|
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('请选择一行数据!');
|
}
|
}
|
//删除
|
function set_DeleteBill() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var InterID = data[0].hmainid.toString();
|
var HBillStatus = data[0].HBillStatus.toString();
|
//if (HBillStatus != "1") {
|
// layer.msg('单据状态不为未审核状态,不允许删除!');
|
// return false;
|
//}
|
//逻辑删除方法
|
layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "Sc_MouldScrapOutHouseBill/DeltetMouldScrapOutHouseBill", //方法所在页面和方法名
|
data: { "HInterID": InterID, "user": 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 });
|
}
|
});
|
})
|
}
|
else {
|
layer.msg('请选择一行数据删除!');
|
}
|
}
|
|
//刷新
|
function set_Refresh() {
|
$("#btnSearch").click();
|
}
|
|
//#region 反关闭/关闭数据
|
function set_CloseBill(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() + "/Sc_MouldScrapOutHouseBill/CloseSc_MouldScrapOutHouseBill", //方法所在页面和方法名
|
data: { "HInterID": InterID, "IsAudit": num, "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 });
|
}
|
});
|
}
|
else {
|
layer.msg('请选择一行数据关闭!');
|
}
|
}
|
//#endregion
|
|
////审核
|
//function set_CheckBill() {
|
// var checkStatus = table.checkStatus('mainTable')
|
// , data = checkStatus.data;
|
// if (checkStatus.data.length === 1) {
|
// var InterID = data[0].hmainid.toString();
|
// //逻辑审核方法
|
// $.ajax({
|
// type: "GET",
|
// url: GetWEBURL() + "/Sc_MouldScrapOutHouseBill/AuditMouldScrapOutList", //方法所在页面和方法名
|
// data: { "HInterID": InterID, "IsAudit": 0, "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 });
|
// }
|
// });
|
// }
|
// else {
|
// layer.msg('请选择一行数据审核!');
|
// }
|
//}
|
|
////反审核
|
//function set_AbandonCheck() {
|
// var checkStatus = table.checkStatus('mainTable')
|
// , data = checkStatus.data;
|
// if (checkStatus.data.length === 1) {
|
// var InterID = data[0].hmainid.toString();
|
// //逻辑审核方法
|
// $.ajax({
|
// type: "GET",
|
// url: GetWEBURL() + "/Sc_MouldScrapOutHouseBill/AuditMouldScrapOutList", //方法所在页面和方法名
|
// data: { "HInterID": InterID, "IsAudit": 1, "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 });
|
// }
|
// });
|
|
// }
|
// else {
|
// layer.msg('请选择一行数据反审核!');
|
// }
|
|
//}
|
//#region 【过滤方案】
|
|
//获取当前用户的默认过滤方案
|
function get_DefaultModule() {
|
$.ajax({
|
url: GetWEBURL() + '/Xt_FastICScheme/Chooselist',
|
type: "GET",
|
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);
|
}
|
}
|
|
//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);
|
//}
|
|
//执行查询方法
|
get_FastQuery()
|
form.render("select");
|
} else {
|
//当前用户没有设置默认的过滤方案
|
//隐藏显示过滤方案的标签信息
|
document.getElementById("HFilterScheme_Now").style.display = "none";
|
////执行查询方法
|
//get_FastQuery()
|
//form.render("select");
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
|
//保存方案
|
function set_SaveScheme() {
|
var index = layer.open()
|
//判断用户是否点击了右上角的“叉号”关闭弹窗页面
|
var HIsClose_Manual = false;
|
//获取本页所有过滤条件对象(class中包含"ForFilteringSchemes"的元素)
|
var Filter = document.getElementsByClassName(HClassTag);
|
|
var HFilterIdList = "";//过滤条件
|
var HFilterIdLists = "";//拼接多个过滤条件
|
var HValue = "";//过滤值
|
var HElement_type = "";//过滤标签类型
|
|
for (var i = 0; i < Filter.length; i++) {
|
HFilterIdList = Filter[i].id; //过滤条件ID
|
HFilterIdLists += Filter[i].id + ","; //过滤条件ID(拼接)
|
HValue += $("#" + HFilterIdList).val() + ","; //过滤条件中输入的值
|
HElement_type += document.getElementById(HFilterIdList).tagName + ",";//通过标签id获取标签类型
|
}
|
|
//去除末尾逗号
|
HFilterIdLists = HFilterIdLists.substring(0, HFilterIdLists.length - 1);
|
HValue = HValue.substring(0, HValue.length - 1);
|
HElement_type = HElement_type.substring(0, HElement_type.length - 1);
|
|
//当前页面上没有选择过滤方案,进入新增方法
|
if (HDefaultFilter == "") {
|
layer.open({
|
type: 2
|
, area: ['40%', '80%']
|
, title: '过滤方案'
|
, shift: 0//弹出动画
|
, content: '../../系统管理/过滤方案设置/Xt_FastICScheme.html?OperationType=1&HModuleName=' + HModuleName + '&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type
|
, cancel: function () {
|
// 右上角关闭事件的逻辑
|
HIsClose_Manual = true;
|
}
|
, end: function () {
|
if (HIsClose_Manual != true) {
|
get_FastQuery();
|
//显示当前的过滤方案
|
document.getElementById("HFilterScheme_Now").style.display = "block";
|
document.getElementById('HFilterScheme_Now').innerHTML = "当前过滤方案:" + sessionStorage["HFilterSchemeName_" + sessionStorage["Czybm"]] + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb"> ' + "(" + sessionStorage["HFilterSchemeRemark_" + sessionStorage["Czybm"]] + ")" + '</span>';
|
}
|
}
|
})
|
layer.close(index)
|
} else {
|
//当前页面已有过滤方案,用户选择 新增或者编辑
|
layer.confirm('当前已选择过滤方案,是否修改?请选择对应操作', {
|
title: "操作提示",
|
icon: 0,
|
btn: ['新增方案', '保存修改当前方案', '取消']
|
}, function (index, layero) {
|
//新增
|
layer.open({
|
type: 2
|
, area: ['40%', '80%']
|
, title: '过滤方案'
|
, shift: 0//弹出动画
|
, content: '../../系统管理/过滤方案设置/Xt_FastICScheme.html?OperationType=1&HModuleName=' + HModuleName + '&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type
|
, end: function () {
|
get_FastQuery()
|
//显示当前的过滤方案
|
document.getElementById("HFilterScheme_Now").style.display = "block";
|
document.getElementById('HFilterScheme_Now').innerHTML = "当前过滤方案:" + sessionStorage["HFilterSchemeName_" + sessionStorage["Czybm"]] + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb"> ' + "(" + sessionStorage["HFilterSchemeRemark_" + sessionStorage["Czybm"]] + ")" + '</span>';
|
}
|
})
|
layer.close(index)
|
}, function (index) {
|
//编辑
|
var Filter_Edit = document.getElementsByClassName(HClassTag); //获取本页所有过滤条件对象(class中包含"ForFilteringSchemes"的元素)
|
HFilterIdList = "";
|
HFilterIdLists = "";
|
HValue = "";
|
HElement_type = "";
|
for (var i = 0; i < Filter_Edit.length; i++) {
|
HFilterIdList = Filter_Edit[i].id; //过滤条件ID
|
HFilterIdLists += Filter_Edit[i].id + ","; //过滤条件ID(拼接)
|
HValue += $("#" + HFilterIdList).val() + ","; //过滤条件中输入的值
|
HElement_type += document.getElementById(HFilterIdList).tagName + ",";//通过标签id获取标签类型
|
}
|
//去除末尾逗号
|
HFilterIdLists = HFilterIdLists.substring(0, HFilterIdLists.length - 1);
|
HValue = HValue.substring(0, HValue.length - 1);
|
HElement_type = HElement_type.substring(0, HElement_type.length - 1);
|
|
var sMainSub = HInterID_Choose + ';' + HFilterIdLists + ';' + HValue + ';' + HElement_type + ';' + sessionStorage["Czybm"] + ';' + 3;
|
|
//修改
|
$.ajax({
|
type: "POST",
|
url: GetWEBURL() + "/Xt_FastICScheme/save", //方法所在页面和方法名
|
async: true,
|
data: { "oMain": sMainSub },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) { // 说明验证成功了,
|
layer.msg(data.Message, { time: 1 * 1000, icon: 1 });
|
}
|
else {
|
|
}
|
layer.closeAll("loading");
|
},
|
error: function (err) {
|
|
|
}
|
});
|
layer.close(index)
|
}, function (index) {
|
//取消
|
layer.alert('取消')
|
layer.close(index)
|
});
|
}
|
|
}
|
|
//读取方案
|
function set_ReadScheme() {
|
var HIsClose_Manual = false;
|
var Filter = document.getElementsByClassName(HClassTag); //获取本页所有过滤条件对象(class中包含"ForFilteringSchemes"的元素)
|
|
var HFilterIdList = "";
|
var HFilterIdLists = "";
|
var HValue = "";
|
var HElement_type = "";
|
for (var i = 0; i < Filter.length; i++) {
|
HFilterIdList = Filter[i].id; //过滤条件ID
|
HFilterIdLists += Filter[i].id + ","; //过滤条件ID(拼接)
|
HValue += $("#" + HFilterIdList).val() + ","; //过滤条件中输入的值
|
HElement_type += document.getElementById(HFilterIdList).tagName + ",";//通过标签id获取标签类型
|
}
|
//去除末尾逗号
|
HFilterIdLists = HFilterIdLists.substring(0, HFilterIdLists.length - 1);
|
HValue = HValue.substring(0, HValue.length - 1);
|
HElement_type = HElement_type.substring(0, HElement_type.length - 1);
|
|
layer.open({
|
type: 2
|
, area: ['80%', '80%']
|
, title: '过滤方案列表'
|
, shift: 0//弹出动画
|
, content: '../../系统管理/过滤方案设置/Xt_FastICSchemeList.html?HType=Select&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type + '&HModuleName=' + HModuleName
|
, cancel: function () {
|
// 右上角关闭事件的逻辑
|
HIsClose_Manual = true;
|
}
|
, end: function () {
|
if (HIsClose_Manual != true) {
|
get_FastQuery()
|
form.render("select");
|
}
|
}
|
})
|
}
|
|
//#endregion
|
|
//#endregion
|
|
//以上是layui模块
|
});
|
//#region 【过滤方案返回数据】
|
function HFilterScheme(obj) //返回过滤方案
|
{
|
var HInterID = obj[0].hmainid;
|
HInterID_Choose = obj[0].hmainid;
|
$.ajax({
|
url: GetWEBURL() + '/Xt_FastICScheme/Chooselist',
|
type: "GET",
|
data: { "user": sessionStorage["Czybm"], "HModuleName": HModuleName, "HInterID": HInterID, "Type": "Select" },
|
success: function (data1) {
|
if (data1.count == 1) {
|
var data = data1.data;
|
//赋值过滤方案名称
|
HDefaultFilter = data[0].方案名称
|
var HRemark = data[0].备注
|
//显示当前的过滤方案
|
document.getElementById("HFilterScheme_Now").style.display = "block";
|
document.getElementById('HFilterScheme_Now').innerHTML = "当前过滤方案:" + HDefaultFilter + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb"> ' + "(" + HRemark + ")" + '</span>';
|
HInterID = data[0].hmainid
|
//根据选择的过滤方案回填数据到列表过滤条件
|
for (let i = 0; i < data.length; i++) {
|
$("#" + data[i].过滤字段ID).val(data[i].过滤值);
|
if (data[i].过滤标签类型 == 'SELECT') {
|
$("#" + data[i].过滤字段ID).find("option[value='" + data[i].过滤值 + "']").attr("selected", true);
|
}
|
}
|
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
//#endregion
|
|
|
|
</script>
|
|
</body>
|
</html>
|