<!DOCTYPE html>
|
<html>
|
<head>
|
<meta 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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
<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/soulTable.slim.js"></script>
|
<script src="../../../layuiadmin/PageTitle.js"></script>
|
</head>
|
<body>
|
|
<div class="layui-card layadmin-header">
|
<div class="layui-breadcrumb" lay-filter="breadcrumb">
|
<a lay-href="">主页</a>
|
<!--<a><cite>采购订单</cite></a>
|
<a><cite>采购订单表格</cite></a>
|
<a><cite>采购订单表格的重载</cite></a>-->
|
</div>
|
</div>
|
|
<div class="layui-fluid">
|
<div class="layui-row layui-col-space15">
|
<div class="layui-col-md12">
|
<div class="layui-card">
|
|
<div class="layui-card-body">
|
<!--<div class="test-table-reload-btn" style="margin-bottom: 10px;">-->
|
<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" style="width: 85px;">单据号</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HBillNo" id="HBillNo">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">开始日期</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HDate1" id="HDate1">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">结束日期</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HDate2" id="HDate2">
|
</div>
|
</div>
|
|
<div class="layui-inline">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="f_Query" id="f_Query">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
<!--显示当前过滤方案-->
|
<div class="layui-inline" style="margin-left:5px;">
|
<div style="text-align:center;font-size:15px;font-weight:bold;color:#fc9393" id="HFilterScheme_Now"></div>
|
</div>
|
<div class="layui-colla-content">
|
<!--第二排过滤-->
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">物料编码</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HNumber" id="HNumber">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">物料名称</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HName" id="HName">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">规格型号</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HModel" id="HModel">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">质检员</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HName1" id="HName1">
|
</div>
|
</div>
|
</div>
|
<!--第三排过滤-->
|
<div class="layui-row" style="margin-top:5px">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">检验项目</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HName2" id="HName2">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">生产名称</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HName3" id="HName3">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">工序流转卡</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HProcExchBillNo" id="HProcExchBillNo">
|
</div>
|
</div>
|
<div class="layui-inline" style="width: 85px;">
|
<label class="layui-form-label">判定结论</label>
|
<div class="layui-input-block" style="width:190px;">
|
<select name="HLastResult" id="HLastResult" lay-verify="HLastResult">
|
<option value=""></option>
|
<option value="合格">合格</option>
|
<option value="不合格">不合格</option>
|
</select>
|
</div>
|
</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" class="ForFilteringSchemes" lay-filter="ColName" style="width:190px;">
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<select name="Comparator" id="Comparator" class="ForFilteringSchemes" lay-filter="Comparator" style="width:190px;">
|
<option value="0" selected="selected"></option>
|
<option value="=">=</option>
|
<option value=">=">>=</option>
|
<option value=">">></option>
|
<option value="<="><=</option>
|
<option value="<"><</option>
|
<option value="<>"><></option>
|
<option value="7">包含</option>
|
<option value="8">左包含</option>
|
<option value="9">右包含</option>
|
<option value="10">不包含</option>
|
</select>
|
</div>
|
<div class="layui-inline" style="margin-left: 120px;">
|
<input type="text" class="layui-input ForFilteringSchemes" value="" name="ColContent" id="ColContent">
|
</div>
|
</div>
|
</div>
|
</div>
|
|
</div>
|
|
</form>
|
<!--</div>-->
|
</div>
|
<table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
|
<div class="layui-tab layui-tab-card">
|
<ul class="layui-tab-title">
|
<li class="layui-this">检测值</li>
|
</ul>
|
<div class="layui-tab-content">
|
<div class="layui-tab-item layui-show">
|
<!--检测值-->
|
<table class="layui-hide" id="mainTable_Value" lay-filter="mainTable_Value"></table>
|
</div>
|
</div>
|
</div>
|
<script type="text/html" id="toolbarDemo">
|
<div class="layui-btn-container">
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-Add" lay-event="btn-Add"><i class="layui-icon layui-icon-form"></i>新增</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-Edit" lay-event="btn-Edit"><i class="layui-icon layui-icon-form"></i>编辑</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-Delete" lay-event="btn-Delete"><i class="layui-icon layui-icon-form"></i>删除</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="set_HideColumn" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_HideButton" id="HideButton"><i class="layui-icon layui-icon-form"></i>按钮设置</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="get_Refresh" id="RefreshButton"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Audit" id="AuditButton"><i class="layui-icon layui-icon-radio"></i>审核</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-DeAudit" id="DeAuditButton"><i class="layui-icon layui-icon-circle"></i>反审核</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Close" id="btn-Close"><i class="layui-icon layui-icon-radio"></i>关闭</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-DeClose" id="btn-DeClose"><i class="layui-icon layui-icon-radio"></i>反关闭</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Drop" id="btn-Drop"><i class="layui-icon layui-icon-radio"></i>作废</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-DeDrop" id="btn-DeDrop"><i class="layui-icon layui-icon-radio"></i>反作废</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="get_Exit" id="ExitButton"><i class="layui-icon layui-icon-logout"></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>
|
</div>
|
</script>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<!--<script src="../../layuiadmin/layui/lay/modules/mobile/jquery-3.3.1.min.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/HideButton.js"></script>
|
<script>
|
var _cur_page = 1;
|
var sql = " ";
|
var titleData = ["hmainid", "hentryid", "HEntryID", "HSourceID", "HMaterID", "HFirstCheckEmp", "HQCCheckItemID", "HUnitID", "HSampleSchemeID"];
|
var checkobj = ""; //复选框
|
var trindex = ""; //默认选中行下标
|
//var options = document.getElementById('HStatus').children;
|
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;
|
}
|
|
|
|
function f_alert(sMsg) {
|
layer.alert(sMsg, { icon: 5 });
|
//layer.open({
|
// type: 1
|
// , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
|
// , id: 'layerDemo' //防止重复弹出
|
// , content: '<div style="padding: 20px 100px;">' + sMsg + '</div>'
|
// , shade: 0 //不显示遮罩
|
// , yes: function () {
|
// layer.closeAll();
|
// }
|
//});
|
}
|
var params = getUrlVars();
|
var type = params[params[0]];
|
//switch (type) {
|
// case "UnConfirm":
|
// options[1].selected = true;
|
// sql += " and 状态 like ^^%未确认%^^";
|
// //$("#HStatus").attr("disabled", true)
|
// break;
|
// case "ReConfirm":
|
// options[2].selected = true;
|
// sql += " and 状态 like ^^%已确认%^^";
|
// sql += " and 未关联数量 > 0";
|
// break;
|
// case "ReBack":
|
// options[3].selected = true;
|
// sql += " and 状态 like ^^%已驳回%^^";
|
// break;
|
//}
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'form', 'laydate', 'code', 'table', 'element', 'layer','soulTable'], function () {
|
var $ = layui.$
|
, admin = layui.admin
|
, layer = layui.layer
|
, laydate = layui.laydate
|
, table = layui.table
|
, form = layui.form
|
, soulTable = layui.soulTable
|
, element = layui.element;
|
|
//公用变量
|
var option = [];
|
var HModName = "QC_FirstPieceCheckBillList";
|
//不需要显示的字段 可扩展 (检测值)
|
var titleData_Value = [];
|
|
//#region 【动态获取模块名称】
|
var HModuleType = "7505";
|
//通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
|
var HPageTitle = get_PageTitle(HModuleType) == "" ? document.title : get_PageTitle(HModuleType);
|
//#endregion
|
|
//过滤条件的class类
|
var HClassTag = "ForFilteringSchemes";
|
//模块名称(中文版) 每个模块页面都需要修改
|
window.HModuleName = "首件检验单维护";
|
//是否已经选择了过滤方案(全局变量)
|
window.HDefaultFilter = "";
|
//选择的过滤方案内码(全局变量)
|
window.HInterID_Choose = 0;
|
|
//隐藏勾选字段
|
DisPlay_HideColumn();
|
//常规用法
|
laydate.render({
|
elem: '#HDate1'
|
});
|
laydate.render({
|
elem: '#HDate2'
|
});
|
//layui.code();
|
RoadHBillNo(sql);
|
//查询当前登录用户有没有在当前模块设置默认过滤方案
|
get_DefaultModule();
|
layer.load(3)
|
|
option = {
|
elem: '#mainTable'
|
, dateType: 'json'
|
, colFilterRecord: true//是否开启字段筛选的记忆功能
|
, data: []
|
// , url: GetWEBURL()+'GetPOOrderBill'
|
, toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
|
, defaultToolbar: ['filter', 'exports', 'print']
|
// , where: { msg: "", NowPage: 1, OnePage: 10 }
|
, cellMinWidth: 100
|
, limit: 50 //每页默认显示的数量
|
, limits: [50, 500, 5000, 20000]
|
, cols: [[
|
{ type: 'checkbox', fixed: 'left' }
|
, { field: 'hmainid', title: 'hmainid', sort: true, fixed: true, hide: true }
|
, { field: 'hsubid', title: 'hsubid', hide: true }
|
, { field: '日期', title: '日期', sort: true, width: 120 }
|
, { field: '单据号', title: '单据号', sort: true, width: 170 }
|
, { field: '表头备注 ', title: '表头备注', width: 105, 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: 160, sort: true }
|
, { field: '制单日期', title: '制单日期', width: 160, sort: true }
|
, { field: '审核人', title: '审核人', width: 160, sort: true }
|
, { field: '审核日期', title: '审核日期', width: 160, sort: true }
|
, { field: '修改人', title: '修改人', width: 160, sort: true }
|
, { field: '修改日期', title: '修改日期', width: 160, sort: true }
|
, { field: '关闭人', title: '关闭人', width: 160, sort: true }
|
, { field: '关闭日期', title: '关闭日期', width: 160, sort: true }
|
, { field: '作废人', title: '作废人', hide: true, width: 160, sort: true }
|
, { field: '作废日期 ', title: '作废日期', width: 215, sort: true }
|
, { field: '单据类型 ', title: '单据类型 ', width: 115, sort: true }
|
]]
|
//, skin: 'row' //表格风格
|
// , even: true
|
, page: true //是否显示分页
|
//, height: 500
|
, done: function (res, curr, count) {
|
_cur_page = curr;
|
layer.closeAll("loading");
|
}
|
}
|
//方法级渲染
|
table.render(option);
|
//头工具栏事件
|
table.on('toolbar(mainTable)', function (obj) {
|
var checkStatus = table.checkStatus(obj.config.id);
|
switch (obj.event) {
|
case 'btn-getCheckData':
|
var data = checkStatus.data;
|
layer.alert(JSON.stringify(data));
|
break;
|
case 'btn-Add':
|
set_AddNew();
|
break;
|
case 'btn-Edit':
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var hID = data[0].hmainid.toString();
|
//if (AllowLoadData(sSubStr) != false) {//非空验证
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '编辑' + HPageTitle
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: '../首件检验单/QC_Add_Edit_FirstPieceCheckBill.html?OperationType=3&hID=' + hID
|
, resize: false
|
, cancel: function () {
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
|
} else {
|
layer.msg('请选择一行数据编辑!');
|
}
|
|
break;
|
case 'btn-Delete':
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var InterID = data[0].hmainid.toString();
|
//逻辑删除方法
|
layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
|
var wait = layer.load();
|
$.ajax({
|
url: GetWEBURL() + 'DeltetQC_FirstPieceCheck',
|
type: "GET",
|
data: { "HInterID": InterID, "user": sessionStorage["HUserName"] },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { icon: 1 }, function () {
|
// 得到frame索引
|
var index = layer.getFrameIndex(window.name);
|
//关闭当前frame
|
layer.close(index);
|
//修改为功后刷新界面
|
window.location.reload();
|
});
|
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
layer.close(wait);
|
}, error: function () {
|
layer.close(wait);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
})
|
}
|
else {
|
layer.msg('请选择一行数据删除!');
|
}
|
break;
|
//列设置
|
case 'set_HideColumn':
|
get_HideColumn();
|
break;
|
//按钮设置
|
case 'set_HideButton':
|
var btns = document.getElementsByTagName("button"); //获取本页所有按钮对象
|
var HBillType = "7505";
|
get_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
|
break;
|
//刷新
|
case 'get_Refresh': get_Refresh();
|
break;
|
//退出按钮
|
case 'get_Exit': Pub_Close(2);
|
break;
|
//审核按钮
|
case 'btn-Audit':
|
set_CheckBill(0);
|
break;
|
//反审核按钮
|
case 'btn-DeAudit':
|
set_CheckBill(1);
|
break;
|
//关闭按钮 (1:关闭、2:反关闭)
|
case 'btn-Close':
|
set_CloseBill(1);
|
break;
|
//反关闭按钮
|
case 'btn-DeClose':
|
set_CloseBill(2);
|
break;
|
//作废按钮 (1:作废、2:反作废)
|
case 'btn-Drop':
|
set_DropBill(1);
|
break;
|
//反作废按钮
|
case 'btn-DeDrop':
|
set_DropBill(2);
|
break;
|
//保存方案
|
case 'set_SaveScheme': set_SaveScheme();
|
break;
|
//读取方案
|
case 'set_ReadScheme': set_ReadScheme();
|
break;
|
};
|
});
|
//刷新
|
function get_Refresh() {
|
$("#f_Query").trigger('click');
|
}
|
|
//#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_CheckBill(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() + "/QC_ValueTable/QC_FirstPieceCheckValue", //方法所在页面和方法名
|
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);
|
//修改为功后刷新界面
|
$("#f_Query").trigger('click');
|
});
|
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
else {
|
layer.msg('请选择一行数据审核!');
|
}
|
}
|
|
//#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() + "/QC_ValueTable/CloseQC_FirstPieceCheckBill", //方法所在页面和方法名
|
data: { "HInterID": InterID, "Type": num, "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);
|
//修改为功后刷新界面
|
$("#f_Query").trigger('click');
|
});
|
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
else {
|
layer.msg('请选择一行数据审核!');
|
}
|
}
|
|
//#region 反作废/作废数据
|
function set_DropBill(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() + "/QC_ValueTable/DropQC_FirstPieceCheckBills", //方法所在页面和方法名
|
data: { "HInterID": InterID, "Type": num, "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);
|
//修改为功后刷新界面
|
$("#f_Query").trigger('click');
|
});
|
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
else {
|
layer.msg('请选择一行数据审核!');
|
}
|
}
|
|
///加载显示数据
|
//function RoadHBillNo(sqlWhere) {
|
// where = sqlWhere;
|
// var index0 = layer.load();
|
// $.ajax({
|
// type: "get",
|
// url: GetWEBURL() +"/QC_Management/MES_QC_FirstPieceCheckBillList_Json",
|
// async: true,
|
// data: { "sqlWhere": sqlWhere, "user": sessionStorage["HUserName"] },//"HSupNo": sessionStorage["HUserName"],
|
// success: function (result) {
|
// if (result.count == 1) {
|
// ajaxReturnData = JSON.parse(JSON.stringify(result)).data;
|
// table.reload('mainTable', {
|
// data: ajaxReturnData
|
// , height: 'full-10'
|
// , page: {
|
// curr: _cur_page //必须从第 1 页开始
|
// }
|
// , loading: false
|
// , done: function (index, res) {
|
|
// }
|
// });
|
// layer.close(index0);
|
// } else {
|
// layer.close(index0);
|
// layer.alert(result.code + result.Message, { icon: 5 });
|
// }
|
|
// },
|
// error: function (result) {
|
// layer.close(index0);
|
// layer.alert("接口请求失败!", { icon: 5 });
|
// }
|
// });
|
//};
|
|
// 查询
|
function RoadHBillNo(sqlWhere) {
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/QC_FirstPieceCheckBill/QC_FirstPieceCheckBillList',
|
type: "GET",
|
data: { "sWhere": sqlWhere, "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.count == 1) {
|
layer.close(ajaxLoad);
|
|
var data = [];
|
var col = [];
|
//给空的数组赋值
|
for (var key in data1.list) {
|
data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
|
}
|
//在列表左边添加勾选框
|
col.push({ type: 'checkbox', fixed: 'left', totalRowText: '合计行'});
|
for (var i = 0; i < data.length; i++) {
|
if ($.inArray(data[i].name, titleData) > -1) {
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
|
}
|
else {
|
switch (data[i].Type) {
|
//int
|
case 'DateTime':
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
|
break;
|
case 'long':
|
case 'Int32':
|
case 'Int64':
|
case 'double':
|
case 'Decimal':
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
|
break;
|
default:
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
|
}
|
}
|
}
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, totalRow: true
|
, height: 'full-50'
|
, page: true //开启分页
|
, limit: 500
|
, limits: [500, 2000, 5000, 20000]
|
, cols: [col]
|
, data: data1.data
|
, done: function (res, curr, count) {
|
soulTable.render(this);
|
}
|
};
|
//初始化表格
|
DisPlay_HideColumn();
|
table.render(option);
|
|
if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
|
ColFilter();
|
}
|
//刷新按钮显示
|
var btns = document.getElementsByTagName("button"); //获取本页所有按钮对象
|
var HBillType = "7505";
|
Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
|
} else {
|
layer.close(ajaxLoad);
|
layer.msg(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
|
}
|
|
//点击主表带出从表数据
|
table.on('rowDouble(mainTable)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
|
//选中行改变颜色
|
check_row(obj);
|
|
var datas = obj.data; //获得当前行数据
|
HBillNo = datas["单据号"].toString();
|
var HInterID = datas.hmainid;
|
var HEntryID = datas.hsubid;
|
var wait = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/QC_ValueTable/getValueList',
|
type: "GET",
|
data: { "HInterID": HInterID, "HEntryID": HEntryID, "user": sessionStorage["HUserName"] },
|
async: false,
|
success: function (data1) {
|
if (data1.count == 1) {
|
var data = [];
|
var col = [];
|
//给空的数组赋值
|
for (var key in data1.list) {
|
data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
|
}
|
//在列表左边添加勾选框
|
col.push({ type: 'checkbox', fixed: 'left', totalRowText: '合计行'});
|
for (var i = 0; i < data.length; i++) {
|
// if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
|
if ($.inArray(data[i].name, titleData_Value) > -1) {
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
|
}
|
else {
|
switch (data[i].Type) {
|
//int
|
case 'DateTime':
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 200 });
|
break;
|
case 'long':
|
case 'Int32':
|
case 'Int64':
|
case 'double':
|
case 'Decimal':
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
|
break;
|
default:
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
|
}
|
}
|
}
|
|
//动态显示列名
|
option_Value = {
|
elem: '#mainTable_Value'
|
//, toolbar: '#toolbarDemo2'
|
, totalRow: true
|
, cols: [col]
|
, data: data1.data
|
, height: 550
|
, page: true
|
, cellMinWidth: 90
|
, limit: 50
|
, limits: [50, 500, 5000, 20000]
|
}
|
table.render(option_Value);
|
|
//刷新表格数据
|
//DisPlay_HideColumn();
|
|
layer.close(wait);
|
//layer.alert("查询成功", { icon: 1 });
|
} else {
|
option_Value = {
|
elem: '#mainTable_Value'
|
//, toolbar: '#toolbarDemo2'
|
, totalRow: true
|
, cols: []
|
, data: ""
|
, height: 550
|
, page: true
|
, cellMinWidth: 90
|
, limit: 50
|
, limits: [50, 500, 5000, 20000]
|
}
|
table.render(option_Value);
|
layer.close(wait);
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(wait);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
});
|
|
form.on('submit(f_Query)', function (data) {//查询
|
get_FastQuery();
|
});
|
|
//#region 快速过滤
|
function get_FastQuery() {
|
var sqlWhere = " and 1=1 ";
|
//if ($("#HStatus").val() != "")
|
// sqlWhere += " and 状态 like ^^%" + $("#HStatus").val() + "%^^";
|
var HBillNo = $("#HBillNo").val();//单据号
|
var HNumber = $("#HNumber").val();//物料编码
|
var HName = $("#HName").val();//物料名称
|
var HModel = $("#HModel").val();//规格型号
|
var HDate1 = $("#HDate1").val();//开始日期
|
var HDate2 = $("#HDate2").val();//结束日期
|
var HLastResult = $("#HLastResult").val();//判定结论
|
var HName1 = $("#HName1").val();//质检员名称
|
var HName2 = $("#HName2").val();//检验项目
|
var HName3 = $("#HName3").val();//生产资源名称
|
var HProcExchBillNo = $("#HProcExchBillNo").val();//工序流转卡
|
var ColName = $("#ColName").val();//复选框
|
var Comparator = $("#Comparator").val()
|
var ColContent = $("#ColContent").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 (HBillNo)
|
sqlWhere += " and 单据号 like '%" + HBillNo + "%'";
|
if (HNumber)
|
sqlWhere += " and 物料代码 like '%" + HNumber + "%'";
|
if (HName)
|
sqlWhere += " and 物料名称 like '%" + HName + "%'";
|
if (HModel)
|
sqlWhere += " and 规格型号 like '%" + HModel + "%'";
|
if (HLastResult)
|
sqlWhere += " and 判定结论 like '" + HLastResult + "%'";
|
if (HName1)
|
sqlWhere += " and 质检员名称 like '%" + HName1 + "%'";
|
if (HName2)
|
sqlWhere += " and 检验项目名称 like '%" + HName2 + "%'";
|
if (HName3)
|
sqlWhere += " and 生产资源名称 like '%" + HName3 + "%'";
|
if (HProcExchBillNo)
|
sqlWhere += " and 工序流转卡号 like '%" + HProcExchBillNo + "%'";
|
|
if (HDate1) {
|
sqlWhere += " and 日期 >= '" + HDate1 + "'";
|
}
|
if (HDate2) {
|
sqlWhere += " and 日期 <= '" + HDate2 + "'";
|
}
|
//if ($("#HISGenerate").val() != "") {
|
// if ($("#HISGenerate").val() == "是")
|
// {
|
// sqlWhere += " and 未关联数量 <= 0";
|
// }
|
// else if ($("#HISGenerate").val() == "否") {
|
// sqlWhere += " and 未关联数量 > 0";
|
// }
|
//}
|
//if ($("#HClStatus").val() != "")
|
// sqlWhere += " and 关闭状态 like ^^%" + $("#HClStatus").val() + "%^^";
|
//if ($("#HPURCHASEORGID").val() != "")
|
// sqlWhere += " and 采购组织 like ^^%" + $("#HPURCHASEORGID").val() + "%^^";
|
|
var Time = $("#Time").val();
|
var dd = new Date();
|
var dt;
|
switch (Time) {
|
case 1: dd = new Date(dd.setDate(dd.getDate() + 7));
|
case 2: dd = new Date(dd.setDate(dd.getDate() + 14));
|
case 3: dd = new Date(dd.setMonth(dd.getMonth() + 1));
|
case 4: dd = new Date(dd.setMonth(dd.getMonth() + 2));
|
case 5: dd = new Date(dd.setMonth(dd.getMonth() + 3));
|
case 6: dd = new Date(dd.setMonth(dd.getMonth() + 6));
|
case 7: dd = new Date(dd.setMonth(dd.getMonth() + 12));
|
default: dd = new Date(dd.setDate(dd.getDate()));
|
}
|
dt = dd.getFullYear().toString();
|
if (dd.getMonth() + 1 < 10) {
|
dt = dt + "-0" + (dd.getMonth() + 1).toString();
|
}
|
else {
|
dt = dt + "-0" + (dd.getMonth() + 1).toString();
|
}
|
if (dd.getDate() < 10) {
|
dt = dt + "-0" + dd.getDate().toString();
|
}
|
else {
|
dt = dt + "-" + dd.getDate().toString();
|
}
|
//if (Time != 8) {
|
// sqlWhere += " and 交货日期 <= ^^" + dt + "^^";
|
//}
|
sql = sqlWhere;
|
//从第一页开始
|
_cur_page = 1;
|
RoadHBillNo(sqlWhere);
|
}
|
|
//改变选中行颜色
|
function check_row(obj) {
|
if (checkobj != "") {
|
checkobj.tr.find('.layui-form-checkbox').removeClass('layui-form-checked');//取消复选框选中样式
|
checkobj.tr.find(':checkbox:first').prop('checked', false);//取消复选框选中样式
|
$(checkobj.tr.selector).attr({ "style": "background:" });//取消当前tr颜色
|
}
|
|
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背景颜色和字体颜色
|
checkobj = obj;
|
} 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;
|
}
|
});
|
}
|
|
//新增
|
function set_AddNew() {
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '新增' + HPageTitle,
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: './QC_Add_Edit_FirstPieceCheckBill.html?OperationType=1&linterid=&HSouceBillType=0&closeType=1',
|
end: function () {
|
//刷新页面,
|
//get_FastQuery(table, option);
|
},
|
success: function (layero, index) {
|
|
}
|
});
|
}
|
|
var $ = layui.$, active = {
|
f_Query: function () { //查询
|
|
},
|
f_Qrjq: function () { //接受
|
|
},
|
f_Bhjq: function () { //拒绝
|
|
},
|
//JSreload: function () {
|
// var demoReload = $('#test-table-demoReload');
|
// //执行重载
|
// table.JSreload('test-table-reload', {
|
// page: {
|
// curr: 1 //重新从第 1 页开始
|
// }
|
// , where: {
|
// key: {
|
// id: demoReload.val()
|
// }
|
// }
|
// });
|
//}
|
};
|
$('.test-table-reload-btn .layui-btn').on('click', function () {
|
var type = $(this).data('type');
|
active[type] ? active[type].call(this) : '';
|
});
|
|
//隐藏列设置
|
function get_HideColumn() {
|
var colName = "";
|
var contentUrl = "";
|
for (var i = 1; i < option.cols[0].length - 1; i++) {
|
colName += option.cols[0][i]["title"] + ",";
|
}
|
var urlStr = window.document.location.pathname;//获取文件路径
|
var urlLen = urlStr.split('/');
|
for (var i = 0; i < urlLen.length - 4; i++) {
|
contentUrl += "../";
|
}
|
colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI 进行编码
|
|
contentUrl += '基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName;
|
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "隐藏列设置" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["50%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: [contentUrl, "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//刷新表格数据
|
DisPlay_HideColumn();
|
//刷新页面,
|
location.reload();
|
//更新表格缓存的数据
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
|
//显示列数据
|
function DisPlay_HideColumn() {
|
$.ajax({
|
url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
|
type: "GET",
|
data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.data.length != 0) {
|
|
|
var dataCol = [];//数据库查询出的列数据
|
var titleData = ["hmainid", "hentryid", "HEntryID", "HSourceID", "HMaterID", "HFirstCheckEmp", "HQCCheckItemID", "HUnitID", "HSampleSchemeID"];//不需要显示的字段 可扩展
|
|
dataCol = data1.data[0].HGridString.split(',');
|
|
for (var i = 0; i < option.cols[0].length - 2; i++) {
|
if (dataCol[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;
|
}
|
//字体所在位置(左 居中 右)
|
switch (dataCols[2]) {
|
case "L":
|
option.cols[0][i + 1]["align"] = "left";
|
break;
|
case "M":
|
option.cols[0][i + 1]["align"] = "center";
|
break;
|
case "R":
|
option.cols[0][i + 1]["align"] = "right";
|
break;
|
}
|
}
|
|
//取消冻结列
|
for (var i = 1; i < option.cols[0].length - 1; i++) {
|
if (option.cols[0][i]["fixed"] != null) {
|
option.cols[0][i]["fixed"] = null;
|
}
|
else {
|
break;
|
}
|
}
|
//冻结列
|
if (data1.data[0].HFixCols != 0) {
|
for (var i = 0; i < data1.data[0].HFixCols; i++) {
|
if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
|
data1.data[0].HFixCols += 1;
|
}
|
option.cols[0][i + 1]["fixed"] = "left";
|
}
|
}
|
table.render(option);
|
} else {
|
table.render(option);
|
}
|
|
//刷新按钮显示
|
var btns = document.getElementsByTagName("button"); //获取本页所有按钮对象
|
var HBillType = "7505";
|
Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
})
|
}
|
|
//#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);
|
form.render('select');
|
}
|
|
//#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);
|
}
|
}
|
//执行查询方法
|
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>
|