<!DOCTYPE html>
|
<html>
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<title>采购订单查询</title>
|
<meta name="renderer" content="webkit">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
|
<script src="../../../layuiadmin/layui/layui.js"></script>
|
<script src="../../../layuiadmin/Scripts/json2.js"></script>
|
<script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
|
<script src="../../../layuiadmin/Scripts/webConfig.js"></script>
|
<script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
|
<script src="../../../layuiadmin/PubCustom.js"></script>
|
<script src="../../../layuiadmin/grwebapp.js"></script>
|
<script src="../../../layuiadmin/HideButton.js"></script>
|
<script src="../../../layuiadmin/soulTable.slim.js"></script>
|
<script src="../../../layuiadmin/PageTitle.js"></script>
|
<style type="text/css">
|
.layui-table-click {
|
background: #ceedfa;
|
color: black
|
}
|
</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">
|
<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 ForFilteringSchemes" name="HBillNo" id="HBillNo" style="width:190px;">
|
</div>
|
</div>
|
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
|
<!--显示当前过滤方案-->
|
<div class="layui-inline" style="margin-left:5px;">
|
<div style="text-align:center;font-size:15px;font-weight:bold;color:#fc9393" id="HFilterScheme_Now"></div>
|
</div>
|
<div class="layui-colla-content">
|
<div class="layui-row" style="margin-top:5px">
|
<div class="layui-inline">
|
<label class="layui-form-label">业务员</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HEmpName" id="HEmpName" 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-inline">
|
<label class="layui-form-label">单据号</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input ForFilteringSchemes" name="HBillno2" id="HBillno2" style="width:190px;">
|
</div>
|
</div>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnResCnz" id="btnReSearch" style="padding:0 5px">重新同步</button>
|
</div>
|
<div class="layui-inline">
|
<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">
|
<input type="text" class="layui-input ForFilteringSchemes" value="" name="ColContent" id="ColContent">
|
</div>
|
</div>
|
|
<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="ColName1" id="ColName1" class="ForFilteringSchemes" lay-filter="ColName1" style="width:190px;">
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<select name="Comparator1" id="Comparator1" lay-filter="Comparator1" class="ForFilteringSchemes" 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-bottom: 10px ">
|
<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" lay-filter="Comparator2" class="ForFilteringSchemes" style="width:190px;">
|
<option value="0" selected="selected"></option>
|
<option value="=">=</option>
|
<option value=">=">>=</option>
|
<option value=">">></option>
|
<option value="<="><=</option>
|
<option value="<"><</option>
|
<option value="<>"><></option>
|
<option value="7">包含</option>
|
<option value="8">左包含</option>
|
<option value="9">右包含</option>
|
<option value="10">不包含</option>
|
</select>
|
</div>
|
<div class="layui-inline">
|
<input type="text" class="layui-input ForFilteringSchemes" value="" name="ColContent2" id="ColContent2">
|
</div>
|
</div>
|
</div>
|
</div>
|
|
</div>
|
</div>
|
<table class="" id="mainTable" lay-filter="mainTable"></table>
|
<script type="text/html" id="toolbarDemo">
|
<div class="layui-btn-container">
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add" id="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="Edit"><i class="layui-icon layui-icon-form"></i>编辑</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete" id="Delete"><i class="layui-icon layui-icon-delete"></i>删除</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print" id="print"><i class="layui-icon layui-icon-print"></i>打印</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh" id="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="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" 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="btn-Drop" id="Drop"><i class="layui-icon layui-icon-radio"></i>作废</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeDrop" id="DeDrop"><i class="layui-icon layui-icon-radio"></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" lay-event="get_Exit" id="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_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>
|
<table class="" id="mainTableSub" lay-filter="mainTableSub"></table>
|
<script type="text/html" id="toolbarDemoSub">
|
<div class="layui-btn-container">
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CloseRow" id="set_CloseRow"><i class="layui-icon layui-icon-form"></i>行关闭</button>
|
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CancelCloseRow" id="set_CancelCloseRow"><i class="layui-icon layui-icon-form"></i>行反关闭</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumnSub" id="HideColumnSub"><i class="layui-icon layui-icon-form"></i>列设置</button>
|
</div>
|
</script>
|
</form>
|
</div>
|
</div>
|
</div>
|
</div>
|
<script type="text/javascript">
|
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 optionSub = [];
|
var HModName = "Cg_POOrderBillQuery";
|
var HModNameSub = "Cg_POOrderBillQuerySub";
|
var HBillType = "1102";
|
//#region 【动态获取模块名称】
|
var HModuleType = "1102";
|
//通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
|
var HPageTitle = get_PageTitle(HModuleType) == "" ? document.title : get_PageTitle(HModuleType);
|
//#endregion
|
|
////不需要显示的字段 可扩展
|
var titleData = [];
|
//#endregion
|
|
//#region 【过滤方案】
|
|
//过滤条件的class类
|
var HClassTag = "ForFilteringSchemes";
|
//模块名称(中文版) 每个模块页面都需要修改
|
window.HModuleName = "采购订单查询";
|
//是否已经选择了过滤方案(全局变量)
|
window.HDefaultFilter = "";
|
//选择的过滤方案内码(全局变量)
|
window.HInterID_Choose = 0;
|
|
//#endregion
|
|
//#region 进入页面既加载
|
set_ClearBill();
|
//#endregion
|
|
//#region 点击事件包括on form事件等
|
|
|
|
//头工具栏事件
|
table.on('toolbar(mainTable)', function (obj) {
|
switch (obj.event) {
|
//新增按钮
|
case 'btn-Add': set_AddNew();
|
break;
|
//编辑按钮
|
case 'btn-Edit': set_ShowBill();
|
break;
|
//删除按钮
|
case 'btn-Delete': set_DeleteBill();
|
break;
|
//浏览
|
case 'btn-view': get_ViewReport();
|
break;
|
//打印
|
case 'btn-print': get_PrintReport();
|
break;
|
//刷新
|
case 'get_Refresh': set_Refresh();
|
break;
|
//审核
|
case 'set_CheckBill': set_CheckBill(0);
|
break;
|
//反审核
|
case 'set_AbandonCheck': set_CheckBill(1);
|
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;
|
//关闭按钮 (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 'get_Exit': Pub_Close(2);
|
break;
|
//列设置
|
case 'set_HideColumn': get_HideColumn();
|
break;
|
//按钮设置
|
case 'set_HideButton':
|
var btns = document.getElementsByTagName("button"); //获取本页所有按钮对象
|
var HBillType = "1102";
|
get_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
|
break;
|
//保存方案
|
case 'set_SaveScheme': set_SaveScheme();
|
break;
|
//读取方案
|
case 'set_ReadScheme': set_ReadScheme();
|
break;
|
};
|
});
|
//子表工具栏事件
|
table.on('toolbar(mainTableSub)', function (obj) {
|
switch (obj.event) {
|
//行关闭
|
case 'set_CloseRow': set_CloseRow(0);
|
break;
|
//行反关闭
|
case 'set_CancelCloseRow': set_CloseRow(1);
|
break;
|
//列设置
|
case 'set_HideColumnSub': get_HideColumnSub();
|
break;
|
};
|
});
|
//表格点击事件
|
|
|
//重新同步按钮
|
form.on('submit(btnResCnz)', function (data) {
|
set_ResCnz();
|
});
|
|
//重置按钮
|
form.on('submit(btnReSearch)', function (data) {
|
set_ClearQuery();
|
});
|
|
table.on('tool(mainTable)' , function (obj) {
|
var data = obj.data;
|
if (obj.event == '单据号') {
|
var linterid = data.hmainid.toString();
|
//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: './Cg_POOrderBillEdit.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0&closeType=1'
|
, resize: false,
|
end: function () {
|
get_FastQuery(table, option);
|
}
|
, cancel: function () {
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
}
|
});
|
|
//查询按钮
|
form.on('submit(btnSearch)', function (data) {
|
get_FastQuery(table, option,2);
|
});
|
|
//日期间隔下拉列表监听
|
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();
|
//直接执行列表筛选 加载数据到网格
|
get_FastQuery(table, option,1)
|
|
//查询当前登录用户有没有在当前模块设置默认过滤方案
|
get_DefaultModule();
|
}
|
//初始化表格
|
function set_InitGrid() {
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, height: 'full-330'
|
, page: true
|
, totalRow: true
|
, cellMinWidth: 90
|
, limit: 50
|
, limits: [50, 500, 5000, 20000]
|
, cols: [[
|
{ type: 'checkbox', fixed: 'left', totalRowText: '合计' }
|
,{ field: 'hmainid', title: 'hmainid', sort: true, hide: true }
|
, { field: '日期', title: '日期', width: 120, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
|
, { field: '单据号', title: '单据号', width: 150, }
|
, { field: '状态', title: '状态', width: 100, sort: true }
|
, { field: 'HBillType', title: 'HBillType', hide: true, sort: true }
|
, { field: '行状态', title: '行状态', width: 125, sort: true }
|
, { field: '供应商', title: '供应商', width: 150 }
|
, { field: '业务员', title: '业务员', width: 100 }
|
//, { field: 'HBillType', title: 'HBillType', hide: true }
|
//, { field: 'HSupID', title: 'HSupID', hide: true }
|
//, { field: '业务状态', title: '业务状态', width: 100, hide: true }
|
, { field: '分配状态', title: '分配状态', width: 100 }
|
, { field: '发布状态', title: '发布状态', width: 100 }
|
, { field: '供应商协同状态', title: '供应商协同状态', width: 135 }/*物料代码,物料名称,规格型号,批号,数量,单位,源单单号*/
|
, { field: '反馈状态', title: '供应商反馈状态', width: 135 }
|
, { field: '物料编码', title: '物料编码', width: 120 }
|
, { field: '物料代码', title: '物料代码', width: 130 }
|
, { field: '旧物料编码', title: '旧物料编码', width: 130 }
|
, { field: '物料名称', title: '物料名称', width: 130 }
|
, { field: '数量', title: '订单数量', width: 100, totalRow: true }
|
, { field: '打印条码数量', title: '打印条码数量', width: 120, totalRow: true }
|
/* 安瑞新增字段 begin */
|
, { field: '可打印条码数量', title: '可打印条码数量', width: 120, totalRow: true}
|
/* 安瑞新增字段 end */
|
, { field: '关联数量', title: '已发货数量', width: 120, totalRow: true}
|
, { field: '未关联数量', title: '可发货数量', width: 120, totalRow: true}
|
/* 安瑞新增字段 begin */
|
, { field: '退料数量', title: '退料数量', width: 120, totalRow: true}
|
, { field: '实收数量', title: '实收数量', width: 120, totalRow: true}
|
, { field: '入库数量', title: '入库数量', width: 120, totalRow: true}
|
, { field: '剩余入库数量', title: '剩余入库数量', width: 120, totalRow: true}
|
, { field: '剩余收料数量', title: '剩余收料数量', width: 120, totalRow: true}
|
/* 安瑞新增字段 end */
|
, { field: '完成状态', title: '完成状态', width: 100 }
|
, { field: 'HUnitID', title: 'HUnitID', hide: true }
|
, { field: '规格型号', title: '规格型号', width: 100 }
|
//, { field: 'HUnitID', title: 'HUnitID', hide: true } 重复
|
, { field: '计量单位代码', title: '计量单位代码', width: 120 , hide: true }
|
, { field: '计量单位', title: '计量单位', width: 100 }
|
, { field: '批号', title: '批号', width: 100 }
|
, { field: '数量', title: '数量', width: 100, totalRow: true }
|
, { field: '源单单号', title: '源单单号', width: 100 }
|
//, { field: '供应商代码', title: '供应商代码', width: 120, hide: true}
|
//, { field: '业务员代码', title: '业务员代码', width: 100, hide: true}
|
//, { field: 'HPriority', title: 'HPriority', width: 100, hide: true }
|
, { field: '优先级', title: '优先级', width: 100 }
|
, { field: '交货地点', title: '交货地点', width: 100}
|
, { field: 'HPSStyleID', title: 'HPSStyleID', hide: true }
|
, { field: '采购方式代码', title: '采购方式代码', width: 120, hide: true }
|
, { field: '采购方式', title: '采购方式', width: 100}
|
, { field: 'HSSID', title: 'HSSID', hide: true }
|
, { field: '结算方式代码', title: '结算方式代码', width: 120}
|
, { field: '结算方式', title: '结算方式', width: 100}
|
, { field: '结算日期', title: '结算日期', width: 120, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.结算日期, 'yyyy-MM-dd')}}</div>" }
|
, { field: 'HCurID', title: 'HCurID', hide: true }
|
, { field: '币别代码', title: '币别代码', width: 100, hide: true }
|
, { field: '币别', title: '币别', width: 100}
|
, { field: '汇率', title: '汇率', width: 100}
|
, { field: 'HDeptID', title: 'HDeptID', hide: true }
|
, { field: '部门代码', title: '部门代码', width: 100, hide: true }
|
, { field: '部门', title: '部门', width: 100}
|
, { field: 'HManagerID', title: 'HManagerID', hide: true }
|
, { field: '主管代码', title: '主管代码', width: 100, hide: true }
|
, { field: '主管', title: '主管', width: 100}
|
, { field: 'HEmpID', title: 'HEmpID', hide: true }
|
, { field: '摘要', title: '摘要', width: 100 }
|
, { field: 'HWHID', title: '主表仓库ID', width: 120, hide: true}
|
, { field: '仓库', title: '主表仓库', width: 100, hide: true}
|
, { field: '表头备注', title: '表头备注', width: 100}
|
, { field: 'hsubid', title: 'hsubid', hide: true }
|
, { field: 'HMaterID', title: 'HMaterID', hide: true }
|
, { field: '单价', title: '单价', width: 100}
|
, { field: '金额', title: '金额', width: 100, totalRow: true }
|
, { field: '税率', title: '税率', width: 100}
|
, { field: '税额', title: '税额', width: 100}
|
, { field: '折扣率', title: '折扣率', width: 100}
|
, { field: '价税合计', title: '价税合计', width: 100}
|
, { field: '交货日期', title: '交货日期', width: 120, templet: "<div>{{d.交货日期 ==null ?'':layui.util.toDateString(d.交货日期, 'yyyy-MM-dd')}}</div>" }
|
, { field: '计划跟踪号', title: '计划跟踪号', width: 100}
|
, { field: '表体备注', title: '表体备注', width: 100}
|
, { field: '制单人', title: '制单人', width: 100}
|
, { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
|
, { field: '审核人', title: '审核人', width: 100}
|
, { field: '审核日期', title: '审核日期', width: 120, templet: "<div>{{d.审核日期 ==null ?'':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
|
, { field: '修改人', title: '修改人', width: 100}
|
, { field: '修改日期', title: '修改日期', width: 120, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
|
, { field: '关闭人', title: '关闭人', width: 100}
|
, { field: '关闭日期', title: '关闭日期', width: 120, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
|
, { field: '行关闭人', title: '行关闭人', width: 125, sort: true }
|
, { field: '行关闭日期', title: '行关闭日期', width: 200, templet: "<div>{{d.行关闭人 == ''?'':layui.util.toDateString(d.行关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
|
, { field: '作废人', title: '作废人', width: 100}
|
, { field: '作废日期', title: '作废日期', width: 120, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
|
|
]]
|
|
, done: function (res, curr, count) {
|
soulTable.render(this);
|
}
|
};
|
|
optionSub = {
|
elem: '#mainTableSub'
|
, toolbar: '#toolbarDemoSub'
|
, height: 'full-500'
|
, page: true
|
, totalRow: true
|
, cellMinWidth: 90
|
, limit: 50
|
, cols:[[]]
|
, limits: [50, 500, 5000, 20000]
|
, done: function (res, curr, count) {
|
soulTable.render(this);
|
}
|
};
|
table.render(optionSub)
|
}
|
//加载网格
|
function get_Display(sWhere) {
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Cg_POOrderBill/QueryList',
|
type: "GET",
|
data: { "sWhere": sWhere , "user": sessionStorage["HUserName"]},
|
success: function (data1) {
|
if (data1.count == 1) {
|
var data = [];//列字段数据
|
var col = [];
|
var totalArray = [];
|
titleData = [];
|
//给空的数组赋值
|
for (var key in data1.list) {
|
//动态获取列表所有列名
|
data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
|
//获取不需要显示的列(H开头的列不显示)
|
var patrn = new RegExp(/^h/i);
|
if (patrn.test(data1.list[key].ColmCols)) {
|
titleData[key] = data1.list[key].ColmCols;
|
}
|
}
|
//在列表左边添加勾选框
|
col.push({ type: 'radio', 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) > -1) {
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
|
}
|
else if ($.inArray(data[i].name, totalArray) > -1) { //计算列
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 });
|
} else if (data[i].name == '单据号') {//添加超链接
|
col.push({
|
field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: '单据号', templet: function (d) {
|
return '<span style="color: blue;">' + d.单据号 + '</span>'
|
}, style: 'cursor: pointer;'
|
});
|
} else if (data[i].name == '当前审核项目') {//添加超链接
|
col.push({
|
field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: '当前审核项目', templet: function (d) {
|
return '<span style="color: blue;">' + d.当前审核项目 + '</span>'
|
}, style: 'cursor: pointer;'
|
});
|
}else {
|
switch (data[i].Type) {
|
//int
|
case 'DateTime':
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{layui.util.toDateString(d." + (data[i].name != "日期" ? data[i].name + ", 'yyyy-MM-dd HH:mm:ss'" : data[i].name +", 'yyyy-MM-dd'")+")}}</div>", width: 200 });
|
break;
|
default:
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
|
}
|
}
|
}
|
|
option.cols = [col];
|
option.data = data1.data;
|
table.render(option);
|
|
//刷新表格数据
|
DisPlay_HideColumn();
|
|
|
if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
|
ColFilter();
|
}
|
layer.close(ajaxLoad);
|
//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 });
|
}
|
});
|
}
|
|
//查询子表数据
|
function get_DisplaySub(obj) {
|
var datas = obj; //获得当前行数据
|
var HMainID = datas.hmainid;
|
var wait = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Cg_POOrderBill/QuerySubList',
|
type: "GET",
|
data: { "hmainid": HMainID, "user": sessionStorage["HUserName"] },
|
async: false,
|
success: function (data1) {
|
if (data1.count == 1) {
|
var data = [];//列字段数据
|
var col = [];
|
var totalArray = ["数量", "关联数量", "未关联数量","入库数量", "金额"];
|
titleData = [];
|
//给空的数组赋值
|
for (var key in data1.list) {
|
//动态获取列表所有列名
|
data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
|
//获取不需要显示的列(H开头的列不显示)
|
var patrn = new RegExp(/^h/i);
|
if (patrn.test(data1.list[key].ColmCols)) {
|
titleData[key] = data1.list[key].ColmCols;
|
}
|
}
|
//在列表左边添加勾选框
|
col.push({ type: 'radio', 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) > -1) {
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
|
}
|
else if ($.inArray(data[i].name, totalArray) > -1) { //计算列
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 });
|
} else if (data[i].name == '单据号') {//添加超链接
|
col.push({
|
field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: '单据号', templet: function (d) {
|
return '<span style="color: blue;">' + d.单据号 + '</span>'
|
}, style: 'cursor: pointer;'
|
});
|
} else if (data[i].name == '当前审核项目') {//添加超链接
|
col.push({
|
field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: '当前审核项目', templet: function (d) {
|
return '<span style="color: blue;">' + d.当前审核项目 + '</span>'
|
}, style: 'cursor: pointer;'
|
});
|
} 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 });
|
}
|
}
|
}
|
|
optionSub.cols = [col];
|
optionSub.data = data1.data;
|
table.render(optionSub);
|
//刷新表格数据
|
DisPlay_HideColumnSub();
|
layer.close(wait);
|
//layer.alert("查询成功", { icon: 1 });
|
} else {
|
layer.close(wait);
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(wait);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
//新增
|
function set_AddNew() {
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '新增' + HPageTitle,
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: './Cg_POOrderBillEdit.html?OperationType=1&linterid=&HSouceBillType=0&closeType=1',
|
end: function () {
|
//刷新页面,
|
get_FastQuery(table, option);
|
},
|
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();
|
//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: './Cg_POOrderBillEdit.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0&closeType=1'
|
, resize: false,
|
end: function () {
|
get_FastQuery(table, option);
|
}
|
, cancel: function () {
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
} 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();
|
//逻辑删除方法
|
layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
|
|
/*if (data[0].状态 == "创建") {*/
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Cg_POOrderBill/DeltetCg_POOrderBill", //方法所在页面和方法名
|
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);
|
//修改为功后刷新界面
|
window.location.reload();
|
});
|
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
|
}, error: function () {
|
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
//} else {
|
// layer.msg('该条数据不是创建状态,无法删除!');
|
|
//}
|
|
})
|
}
|
else {
|
layer.msg('请选择一行数据删除!');
|
}
|
}
|
|
//打印
|
function get_PrintReport() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据打印!');
|
}
|
else {
|
|
var hmainid = data[0].hmainid.toString();
|
|
layer.open({
|
type: 2
|
, area: ['50%', '50%']
|
, title: '打印模版选择'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: false //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + hmainid.toString() + '&MyMsg=' + hmainid.toString() + '&Type=HPOOrderBillByID', 'yes']
|
, resize: false
|
})
|
}
|
}
|
|
//#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() + "/Cg_POOrderBill/AuditCg_POOrderBill", //方法所在页面和方法名
|
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
|
|
//#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() + "/Cg_POOrderBill/StartCheckFlow_POOrderBill", //方法所在页面和方法名
|
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);
|
//修改为功后刷新界面
|
if (get_needClose_Bar == 0) {
|
$("#btnSearch").trigger('click');
|
} else if (get_needClose_Bar == 1) {
|
$("#get_needClose").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() + "/Cg_POOrderBill/AuditCg_POOrderBill_Flow", //方法所在页面和方法名
|
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() + "/Cg_POOrderBill/RejectCheckFlow_POOrderBill", //方法所在页面和方法名
|
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
|
|
//#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() + "/Cg_POOrderBill/CloseCg_POOrderBill", //方法所在页面和方法名
|
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);
|
//修改为功后刷新界面
|
$("#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_CloseRow(num) {
|
var checkStatus = table.checkStatus('mainTableSub')
|
, data = checkStatus.data;
|
console.log(checkStatus)
|
if (checkStatus.data.length === 1) {
|
var InterID = data[0].hmainid.toString();
|
var hsubid = data[0].hsubid.toString();
|
//逻辑审核方法
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Cg_POOrderBill/CloseRowCg_POOrderBill", //方法所在页面和方法名
|
data: { "HInterID": InterID, "HEntryID": hsubid, "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);
|
//修改为功后刷新子表界面
|
$("tr.layui-table-click").trigger("click");
|
});
|
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
else {
|
layer.msg('请选择一行数据关闭!');
|
}
|
}
|
//#endregion
|
|
//#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() + "/Cg_POOrderBill/DropCg_POOrderBill", //方法所在页面和方法名
|
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);
|
//修改为功后刷新界面
|
$("#btnSearch").trigger('click');
|
});
|
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
else {
|
layer.msg('请选择一行数据审核!');
|
}
|
}
|
//#endregion
|
|
|
|
//快速过滤
|
function get_FastQuery(table, option,number) {
|
var HBeginDate = $("#HBeginDate").val();//开始日期
|
var HEndDate = $("#HEndDate").val();//结束日期
|
var HBillNo = $("#HBillNo").val(); //单据号
|
var HEmpName = $("#HEmpName").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 = "" + Comparator2 + "'" + ColContent2 + "'";
|
break;
|
}
|
sWhere += " and " + ColName2 + " " + com2;
|
}
|
|
if (HBeginDate) {
|
sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + HBeginDate + "'";
|
}
|
if (HEndDate) {
|
sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + HEndDate + "'";
|
}
|
if (HBillNo) {
|
sWhere += " and 单据号 like '%" + HBillNo + "%'";
|
}
|
if (HEmpName) {
|
sWhere += " and 业务员 like '%" + HEmpName + "%'";
|
}
|
if (HSupName) {
|
sWhere += " and 供应商 like '%" + HSupName + "%'";
|
|
}
|
|
|
sWhere += addSWhereByOpenType();
|
//添加查询条件,根据当前登录用户关联职员返回数据
|
//sWhere += " and HUserID =" + sessionStorage["Czybm"]
|
var index = layer.load(0);
|
get_Display(sWhere);
|
//调用接口后清空sWhere缓存
|
sWhere = "";
|
}
|
//重置过滤条件
|
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")); //结束日期
|
$("#HBillNo").val("");
|
$("#HEmpName").val("");
|
$("#HSupName").val("");
|
$("#HOrgID").val(sessionStorage["OrganizationID"]);
|
$("#ColContent").val("");
|
$("#ColName").val("0");
|
$("#Comparator").val("0");
|
|
$("#ColContent1").val("");
|
$("#ColName1").val("0");
|
$("#Comparator1").val("0");
|
|
$("#ColContent2").val("");
|
$("#ColName2").val("0");
|
$("#Comparator2").val("0");
|
|
$("select[name='HFeedback']").val("");
|
form.render('select');
|
sWhere = "";
|
get_Display(sWhere);
|
}
|
//重新同步按钮
|
function set_ResCnz() {
|
var HBillno2 = $('#HBillno2').val();
|
$.ajax({
|
url: GetWEBURL() + '/Cg_POOrderBill/Cg_POOrderBillViewApi',
|
type: "GET",
|
data: { "BillNo": HBillno2,"BillType":1102 },
|
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);
|
//修改为功后刷新界面
|
window.location.reload();
|
});
|
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(wait);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
|
//#endregion
|
//刷新
|
function set_Refresh() {
|
$("#btnSearch").click();
|
}
|
|
//#region 隐藏列设置
|
function get_HideColumn() {
|
var colName = "";
|
for (var i = 1; i < option.cols[0].length; i++) {
|
colName += option.cols[0][i]["field"] + ",";
|
}
|
|
colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI 进行编码
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "隐藏列设置" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["50%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ['../../基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//刷新表格数据
|
DisPlay_HideColumn();
|
//更新表格缓存的数据
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
//#endregion
|
//#region 显示列数据
|
function DisPlay_HideColumn() {
|
$.ajax({
|
url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
|
async: false,
|
type: "GET",
|
data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.data.length != 0) {
|
|
var dataCol = [];//数据库查询出的列数据
|
/*var titleData = ["hmainid", "HBillType", "HCusID", "HSSID", "HCurID", "HDeptID", "HManagerID", "HEmpID", "hsubid", "HMaterID", "HUnitID"];//不需要显示的字段 可扩展*/
|
|
dataCol = data1.data[0].HGridString.split(',');
|
|
for (var i = 0; i < option.cols[0].length - 1; i++) {
|
var dataCols = dataCol[i].split('|');
|
//隐藏列
|
if (dataCols[1] == 1) {
|
option.cols[0][i + 1]["hide"] = true;
|
}
|
//设置内容字体大小
|
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 (dataCols[3] > 0) {
|
option.cols[0][i + 1]["width"] = dataCols[3];
|
}
|
//显示列
|
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;
|
}
|
//设置表格title属性显示别名
|
if (dataCols[4] != null && dataCols[4] != "") {
|
option.cols[0][i + 1]["title"] = dataCols[4];
|
}
|
//统计列
|
if (dataCols[6] == 1) {
|
option.cols[0][i + 1]["totalRow"] = true;
|
}
|
|
}
|
|
//取消冻结列
|
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);
|
|
//刷新按钮显示
|
var btns = document.getElementsByTagName("button"); //获取本页所有按钮对象
|
Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
|
} else {
|
table.render(option);
|
|
//刷新按钮显示
|
var btns = document.getElementsByTagName("button"); //获取本页所有按钮对象
|
Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
})
|
}
|
//#endregion
|
|
//#region 子表隐藏列设置
|
function get_HideColumnSub() {
|
var colName = "";
|
for (var i = 1; i < optionSub.cols[0].length; i++) {
|
colName += optionSub.cols[0][i]["field"] + ",";
|
}
|
|
colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI 进行编码
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "隐藏列设置" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["50%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ['../../基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModNameSub + '&colName=' + colName, "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//刷新表格数据
|
DisPlay_HideColumnSub();
|
//更新表格缓存的数据
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
//#endregion
|
//#region 显示子表列数据
|
function DisPlay_HideColumnSub() {
|
$.ajax({
|
url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
|
async: false,
|
type: "GET",
|
data: { "HModName": HModNameSub, "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.data.length != 0) {
|
|
var dataCol = [];//数据库查询出的列数据
|
|
dataCol = data1.data[0].HGridString.split(',');
|
|
for (var i = 0; i < optionSub.cols[0].length - 1; i++) {
|
var dataCols = dataCol[i].split('|');
|
//隐藏列
|
if (dataCols[1] == 1) {
|
optionSub.cols[0][i + 1]["hide"] = true;
|
}
|
//设置内容字体大小
|
if (data1.data[0].HFontSize != 0) {
|
optionSub.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
|
} else {
|
optionSub.cols[0][i + 1]["style"] = "font-size:100%";
|
}
|
//设置列宽
|
if (dataCols[3] > 0) {
|
optionSub.cols[0][i + 1]["width"] = dataCols[3];
|
}
|
//显示列
|
if (dataCols[1] == 0 && $.inArray(optionSub.cols[0][i + 1]["title"], titleData) == -1) {
|
optionSub.cols[0][i + 1]["hide"] = false;
|
}
|
//字体所在位置(左 居中 右)
|
switch (dataCols[2]) {
|
case "L":
|
optionSub.cols[0][i + 1]["align"] = "left";
|
break;
|
case "M":
|
optionSub.cols[0][i + 1]["align"] = "center";
|
break;
|
case "R":
|
optionSub.cols[0][i + 1]["align"] = "right";
|
break;
|
}
|
//设置表格title属性显示别名
|
if (dataCols[4] != null && dataCols[4] != "") {
|
optionSub.cols[0][i + 1]["title"] = dataCols[4];
|
}
|
//统计列
|
if (dataCols[6] == 1) {
|
optionSub.cols[0][i + 1]["totalRow"] = true;
|
}
|
}
|
|
//取消冻结列
|
for (var i = 1; i < optionSub.cols[0].length - 1; i++) {
|
if (optionSub.cols[0][i]["fixed"] != null) {
|
optionSub.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(optionSub.cols[0][i + 1]["title"], titleData) != -1) {
|
data1.data[0].HFixCols += 1;
|
}
|
optionSub.cols[0][i + 1]["fixed"] = "left";
|
}
|
}
|
table.render(optionSub);
|
|
//刷新按钮显示
|
var btns = document.getElementsByTagName("button"); //获取本页所有按钮对象
|
Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
|
} else {
|
table.render(optionSub);
|
|
//刷新按钮显示
|
var btns = document.getElementsByTagName("button"); //获取本页所有按钮对象
|
Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
})
|
}
|
//#endregion
|
|
//#region 行点击事件
|
table.on('row(mainTable)', function (obj) {
|
//显示子表
|
get_DisplaySub(obj.data);
|
//判断是否已经被选中
|
if (obj.tr.find('.layui-form-radioed').length == 0) {
|
//触发单选框选中事件
|
obj.tr.find('i[class="layui-anim layui-icon"]').trigger("click");
|
}
|
|
|
})
|
//子表单选
|
table.on('row(mainTableSub)', function (obj) {
|
//判断是否已经被选中
|
if (obj.tr.find('.layui-form-radioed').length == 0) {
|
//触发单选框选中事件
|
obj.tr.find('i[class="layui-anim layui-icon"]').trigger("click");
|
}
|
})
|
//#endregion
|
|
|
//#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);
|
form.render('select');
|
$("#ColName1").empty();
|
$("#ColName1").append(Organization);
|
form.render('select');
|
$("#ColName2").empty();
|
$("#ColName2").append(Organization);
|
form.render('select');
|
}
|
//#endregion
|
|
//#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
|
|
|
//#region 获取参数
|
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;
|
}
|
//#endregion
|
|
//#region 判断是直接打开页面还是其它页面通过选择按钮打开,并显示相应数据
|
function addSWhereByOpenType() {
|
//获取参数
|
var params = getUrlVars();
|
var openType = params[params[0]]; //从参数中获取 打开方式 1直接打开 2其它页面通过选择按钮打开
|
var HOrgID = params[params[1]];
|
|
var addSWhere = "";
|
|
if (openType == 2) {
|
addSWhere = " and 状态 = '已审核' and 行状态 = '' and HOrgID = " + HOrgID;
|
}
|
return addSWhere;
|
}
|
//#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>
|