From ebef191888d9d2c2a2e7a7f677189164e4eef0b3 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期二, 05 八月 2025 19:04:33 +0800
Subject: [PATCH] 车间委外接收单列表bug处理
---
WebTM/views/车间管理/报表分析/Kf_MaterOutEntryReport_Cloth.html | 724 +++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 537 insertions(+), 187 deletions(-)
diff --git "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\346\212\245\350\241\250\345\210\206\346\236\220/Kf_MaterOutEntryReport_Cloth.html" "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\346\212\245\350\241\250\345\210\206\346\236\220/Kf_MaterOutEntryReport_Cloth.html"
index 47374ee..98615ea 100644
--- "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\346\212\245\350\241\250\345\210\206\346\236\220/Kf_MaterOutEntryReport_Cloth.html"
+++ "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\346\212\245\350\241\250\345\210\206\346\236\220/Kf_MaterOutEntryReport_Cloth.html"
@@ -48,7 +48,7 @@
<div class="layui-form-item layui-inline">
<div class="layui-inline">
<div class="layui-input-inline">
- <input type="text" class="layui-input" id="HBeginDate" placeholder="yyyy-MM-dd HH:mm:ss">
+ <input type="text" class="layui-input " id="HBeginDate" placeholder="yyyy-MM-dd HH:mm:ss">
</div>
</div>
</div>
@@ -62,17 +62,17 @@
</div>
</div>
<!--<div class="layui-inline">
- <label class="layui-form-label">鏃ユ湡</label>
- <div class="layui-input-block">
- <input type="date" class="layui-input" 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" id="HEndDate" style="width:190px;">
- </div>
- </div>-->
+ <label class="layui-form-label">鏃ユ湡</label>
+ <div class="layui-input-block">
+ <input type="date" class="layui-input" 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" id="HEndDate" style="width:190px;">
+ </div>
+ </div>-->
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
</button>
@@ -88,31 +88,35 @@
<input type="checkbox" name="checkWRuku" id="checkWRuku" lay-skin="primary" lay-filter="checkWRuku" title="鏈笅鎺ㄥ強宸插叆搴�">
</div>
</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" style="padding: 0px; margin-left: 6%;">
<div class="layui-row" style="margin-top:10px;">
<!--鍏朵粬鏉′欢-->
<div class="layui-inline">
<label class="layui-form-label" style="width: 85px;">浜у搧浠g爜</label>
<div class="layui-input-block" style="margin-left: 120px;">
- <input type="text" class="layui-input" name="HMaterNumber" id="HMaterNumber">
+ <input type="text" class="layui-input ForFilteringSchemes" name="HMaterNumber" id="HMaterNumber">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" style="width: 85px;">鍗曟嵁鍙�</label>
<div class="layui-input-block" style="margin-left: 120px;">
- <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
+ <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" name="HProductName" id="HProductName">
+ <input type="text" class="layui-input ForFilteringSchemes" name="HProductName" id="HProductName">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" style="width: 85px;">瑙勬牸鍨嬪彿</label>
<div class="layui-input-block" style="margin-left: 120px;">
- <input type="text" class="layui-input" name="HProductModel" id="HProductModel">
+ <input type="text" class="layui-input ForFilteringSchemes" name="HProductModel" id="HProductModel">
</div>
</div>
</div>
@@ -120,12 +124,12 @@
<div class="layui-inline">
<label class="layui-form-label">杩囨护</label>
<div class="layui-input-block">
- <select name="ColName" id="ColName" lay-filter="ColName" style="width:190px;">
+ <select name="ColName" id="ColName" class="ForFilteringSchemes" lay-filter="ColName" style="width:190px;">
</select>
</div>
</div>
<div class="layui-inline">
- <select name="Comparator" id="Comparator" lay-filter="Comparator" style="width:190px;">
+ <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>
@@ -140,7 +144,61 @@
</select>
</div>
<div class="layui-inline">
- <input type="text" class="layui-input" value="" name="ColContent" id="ColContent">
+ <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>
@@ -149,8 +207,11 @@
<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="get_export" id="get_export"><i class="layui-icon layui-icon-export"></i>瀵煎嚭</button>
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>閫�鍑�</button>
<button type="button" class="layui-btn layui-btn-sm" lay-event="HideColumn"><i class="layui-icon layui-icon-form"></i>闅愯棌鍒楄缃�</button>
+ <button type="button" class="layui-btn layui-btn-sm" 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" lay-event="set_ReadScheme" id="set_ReadScheme"><i class="layui-icon layui-icon-set"></i>璇诲彇鏂规</button>
</div>
</script>
</form>
@@ -176,10 +237,24 @@
, laypage = layui.laypage
, laydate = layui.laydate
, util = layui.util
+ //#region 銆愯繃婊ゆ柟妗堛��
+
+ //杩囨护鏉′欢鐨刢lass绫�
+ var HClassTag = "ForFilteringSchemes";
+ //妯″潡鍚嶇О锛堜腑鏂囩増锛� 姣忎釜妯″潡椤甸潰閮介渶瑕佷慨鏀�
+ window.HModuleName = "鐧藉澂鍙戝竷鏄庣粏鎶ヨ〃";
+ //鏄惁宸茬粡閫夋嫨浜嗚繃婊ゆ柟妗堬紙鍏ㄥ眬鍙橀噺锛�
+ window.HDefaultFilter = "";
+ //閫夋嫨鐨勮繃婊ゆ柟妗堝唴鐮侊紙鍏ㄥ眬鍙橀噺锛�
+ window.HInterID_Choose = 0;
+
+ //#endregion
//鏌ヨ鏉′欢
var sWhere = "";
var option = [];
var HModName = "MaterOutEntryReport_Cloth";
+
+ var ins; //鐢ㄤ簬瀵煎嚭excel
var detailBar = 0; //鐢ㄤ簬姹囨�绘姤琛ㄦ煡鐪嬫槑缁嗘姤琛紝褰撲负0鏃舵樉绀烘槑缁嗘眹鎬绘姤琛ㄥ搴旀槑缁嗘姤琛ㄣ��
//#endregion
@@ -195,12 +270,22 @@
//澶村伐鍏锋爮浜嬩欢
table.on('toolbar(mainTable)', function (obj) {
switch (obj.event) {
+ //瀵煎嚭excel
+ case 'get_export':
+ get_Export();
+ break;
//閫�鍑�
case 'btn-exit': Pub_Close(2);
break;
//闅愯棌鍒楄缃�
case 'HideColumn':
get_HideColumn();
+ break;
+ //淇濆瓨鏂规
+ case 'set_SaveScheme': set_SaveScheme();
+ break;
+ //璇诲彇鏂规
+ case 'set_ReadScheme': set_ReadScheme();
break;
};
});
@@ -238,8 +323,8 @@
//鍒濆鍖栫晫闈�
function set_ClearBill() {
//鍒濆鍖栨椂闂�
- var HBeginDate = Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 1).setHours(8, 0, 0, 0), "yyyy-MM-dd hh");
- var HEndDate = Format(new Date(new Date()).setHours(8, 0, 0, 0), "yyyy-MM-dd hh");
+ var HBeginDate = Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 1).setHours(7, 0, 0, 0), "yyyy-MM-dd hh");
+ var HEndDate = Format(new Date(new Date()).setHours(7, 0, 0, 0), "yyyy-MM-dd hh");
laydate.render({
elem: '#HBeginDate',
type: 'datetime',
@@ -264,168 +349,52 @@
//鍔犺浇鏁版嵁鍒扮綉鏍�
get_FastQuery();
DisPlay_HideColumn();
+ //鏌ヨ褰撳墠鐧诲綍鐢ㄦ埛鏈夋病鏈夊湪褰撳墠妯″潡璁剧疆榛樿杩囨护鏂规
+ get_DefaultModule();
//ColFilter();
}
//鍒濆鍖栬〃鏍�
function set_InitGrid() {
- var HBeginDate = Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 1).setHours(8, 0, 0, 0), "yyyy-MM-dd hh") + ":00:00";//涓嬭揪鏃ユ湡 寮�濮嬫棩鏈�
- var HEndDate = Format(new Date(new Date()).setHours(8, 0, 0, 0), "yyyy-MM-dd hh") + ":00:00";//缁撴潫鏃ユ湡
-
- //var HBeginDate = $("#HBeginDate").val() + ":00:00" ;//涓嬭揪鏃ユ湡 寮�濮嬫棩鏈�
- //var HEndDate = $("#HEndDate").val()+":00:00";//缁撴潫鏃ユ湡
- var HMaterNumber = $("#HMaterNumber").val();//鐗╂枡浠g爜
- var HBillNo = $("#HBillNo").val(); //鍗曟嵁鍙�
- var HProductName = $("#HProductName").val();//浜у搧鍚嶇О
- var HProductModel = $("#HProductModel").val();//浜у搧瑙勬牸
-
- //浠绘剰瀛楁鏉′欢杩囨护 鏉′欢鎻愬彇
- var ColName = $("#ColName").val();//澶嶉�夋
- var Comparator = $("#Comparator").val()
- var ColContent = $("#ColContent").val();
-
- //鎷兼帴浠讳竴瀛楁杩囨护鏌ヨ鏉′欢
- var com = "";
- if (ColName != 0 && Comparator != 0) {
- 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;
+ option = {
+ elem: '#mainTable'
+ , toolbar: '#toolbarDemo'
+ , cellMinWidth: 120
+ , limit: Number.MAX_VALUE // 鏁版嵁琛ㄦ牸榛樿鍏ㄩ儴鏄剧ず
+ , totalRow: true
+ , height: 'full-70'
+ , cols: [[
+ { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣' }
+ , { field: '鏃ユ湡', title: '鏃ユ湡', width: 160 }
+ , { field: '浠诲姟鍗�', title: '浠诲姟鍗�', width: 160 }
+ , { field: '宸ュ簭娴佽浆鍗″彿', title: '宸ュ簭娴佽浆鍗″彿', width: 160 }
+ , { field: '浜у搧鍚嶇О', title: '浜у搧鍚嶇О', width: 160 }
+ , { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', width: 160 }
+ , { field: '褰撳墠宸ュ簭', title: '褰撳墠宸ュ簭', width: 160 }
+ , { field: '浠诲姟鏁伴噺', title: '浠诲姟鏁伴噺', totalRow: true, width: 160 }
+ , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', width: 200 }
+ , { field: '娴佽浆鍗℃暟閲�', title: '娴佽浆鍗℃暟閲�', width: 160, totalRow: true }
+ ]]
+ , done: function (res) {
+ //var count = 0;
+ //var OnlyID = -1;
+ //for (var i = 0; i < res.data.length; i++) {
+ // if (res.data[i]["鍞竴ID"] != OnlyID) {
+ // count += res.data[i]["鏁存壒"];
+ // OnlyID = res.data[i]["鍞竴ID"];
+ // }
+ //}
+ //var divArr = $(".layui-table-total div.layui-table-cell");
+ //$.each(divArr, function (index, item) {
+ // var _div = $(item);
+ // var content = _div.html();
+ // if (index == 9) {
+ // content = count;
+ // }
+ // _div.html(content);
+ //});
}
- com = " and (" + ColName + " " + com + ")";
- }
-
- sWhere = {
- HBeginDate: HBeginDate
- , HEndDate: HEndDate
- , HMaterNumber: HMaterNumber
- , HBillNo: HBillNo
- , HProductName: HProductName
- , HProductModel: HProductModel
- , RandomSearch: com
- }
- sWhere = JSON.stringify(sWhere);
-
-
- //鍔ㄦ�佸垪-缂撳瓨鍒楄〃
- $.ajax({
- url: GetWEBURL() + "/MaterOutEntryReport/MaterOutEntryReport_Cloth",
- type: "GET",
- async: false,
- data: { "sWhere": sWhere },
- //async: false,
- success: function (data1) {
-
- if (data1.count == 1) {
-
- var data = [];
- var col = [];
- //缁欑┖鐨勬暟缁勮祴鍊�
- for (var key in data1.list) {
- var width = data1.list[key].width * 23;
- if (width < 150) {
- width = 150;
- } else if (width > 300) {
- width = 300;
- }
- data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType});
- }
-
- //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
- col.push({ type: 'checkbox', fixed: 'left' });
- for (var i = 0; i < data.length; i++) {
- if ($.inArray(data[i].name, "") > -1) {
- col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒�
- }
- else if (data[i].ColName == '鐧藉澂鍙戝竷') {
- col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow:true });
- }
- else {
- switch (data[i].Type) {
- //int
- case 'DateTime':
- col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true });
- break;
- default:
- col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true });
- }
- }
- }
- option = {
- elem: '#mainTable'
- , toolbar: '#toolbarDemo'
- , cellMinWidth: 120
- , limit: Number.MAX_VALUE // 鏁版嵁琛ㄦ牸榛樿鍏ㄩ儴鏄剧ず
- , totalRow: true
- , height: 'full-70'
- , cols: [col]
- , data: data1.data
- };
- table.render(option);
- } else {
- option = {
- elem: '#mainTable'
- , toolbar: '#toolbarDemo'
- , cellMinWidth: 120
- , limit: Number.MAX_VALUE // 鏁版嵁琛ㄦ牸榛樿鍏ㄩ儴鏄剧ず
- , totalRow: true
- , height: 'full-70'
- , cols: [[
- { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣' }
- , { field: '鏃ユ湡', title: '鏃ユ湡', width: 160 }
- , { field: '浠诲姟鍗�', title: '浠诲姟鍗�', width: 160 }
- , { field: '宸ュ簭娴佽浆鍗″彿', title: '宸ュ簭娴佽浆鍗″彿', width: 160 }
- , { field: '浜у搧鍚嶇О', title: '浜у搧鍚嶇О', width: 160 }
- , { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', width: 160 }
- , { field: '褰撳墠宸ュ簭', title: '褰撳墠宸ュ簭', width: 160 }
- , { field: '浠诲姟鏁伴噺', title: '浠诲姟鏁伴噺', width: 160 }
- , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', width: 200 }
- , { field: '娴佽浆鍗℃暟閲�', title: '娴佽浆鍗℃暟閲�', width: 160, totalRow: true }
- ]]
- , done: function (res) {
- //var count = 0;
- //var OnlyID = -1;
- //for (var i = 0; i < res.data.length; i++) {
- // if (res.data[i]["鍞竴ID"] != OnlyID) {
- // count += res.data[i]["鏁存壒"];
- // OnlyID = res.data[i]["鍞竴ID"];
- // }
- //}
- //var divArr = $(".layui-table-total div.layui-table-cell");
- //$.each(divArr, function (index, item) {
- // var _div = $(item);
- // var content = _div.html();
- // if (index == 9) {
- // content = count;
- // }
- // _div.html(content);
- //});
- }
- };
- table.render(option);
- }
- },
- error: function (err) {
- layer.msg('閿欒' + err, {
- icon: 5,
- time: 20000
- }, function () {
- //do something
- });
- }
- })
+ };
}
//鍒楁槑鏄剧ず涓嬫媺妗�
@@ -438,6 +407,12 @@
}
$("#ColName").empty();
$("#ColName").append(Organization);
+
+ $("#ColName1").empty();
+ $("#ColName1").append(Organization);
+
+ $("#ColName2").empty();
+ $("#ColName2").append(Organization);
form.render('select');
}
@@ -448,9 +423,48 @@
$.ajax({
url: GetWEBURL() + '/MaterOutEntryReport/MaterOutEntryReport_Cloth',
type: "GET",
- data: { "sWhere": sWhere },
+ data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
success: function (data1) {
if (data1.count == 1) {
+ var totalArray = ["浠诲姟鏁伴噺", "鐧藉澂鍙戝竷", "娴佽浆鍗℃暟閲�"];
+ var data = [];
+ var col = [];
+ //缁欑┖鐨勬暟缁勮祴鍊�
+ for (var key in data1.list) {
+ var width = data1.list[key].width * 23;
+ if (width < 150) {
+ width = 150;
+ } else if (width > 300) {
+ width = 300;
+ }
+ data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
+ }
+
+ //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
+ col.push({ type: 'checkbox', fixed: 'left' });
+ for (var i = 0; i < data.length; i++) {
+ if ($.inArray(data[i].name, "") > -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].ColName == '鐧藉澂鍙戝竷') {
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true });
+ }
+ else {
+ switch (data[i].Type) {
+ //int
+ case 'DateTime':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true });
+ break;
+ default:
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true });
+ }
+ }
+ }
+
+
//璋冩暣鏃ユ湡鏍煎紡锛氭樉绀� 骞存湀鏃� 鍜� 鏃� 鍒�
for (var i = 0; i < data1.data.length; i++) {
if (data1.data[i].鏃ユ湡 != null) {
@@ -472,7 +486,7 @@
// }
// }
//}
- table.render(option);
+ ins = table.render(option);
//璁$畻鍚堣鍏枻鏁�
var sumHMaterOutQty = 0;
@@ -501,12 +515,12 @@
var HEndDate = $("#HEndDate").val();//缁撴潫鏃ユ湡
if (HBeginDate == '') {
- HBeginDate = Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 1).setHours(8, 0, 0, 0), "yyyy-MM-dd hh") + ":00:00";//涓嬭揪鏃ユ湡 寮�濮嬫棩鏈�
+ HBeginDate = Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 1).setHours(7, 0, 0, 0), "yyyy-MM-dd hh") + ":00:00";//涓嬭揪鏃ユ湡 寮�濮嬫棩鏈�
} else {
HBeginDate = $("#HBeginDate").val() + ":00:00";//涓嬭揪鏃ユ湡 寮�濮嬫棩鏈�
}
if (HEndDate == '') {
- HEndDate = Format(new Date(new Date()).setHours(8, 0, 0, 0), "yyyy-MM-dd hh") + ":00:00";//缁撴潫鏃ユ湡
+ HEndDate = Format(new Date(new Date()).setHours(7, 0, 0, 0), "yyyy-MM-dd hh") + ":00:00";//缁撴潫鏃ユ湡
} else {
HEndDate = $("#HEndDate").val() + ":00:00";//缁撴潫鏃ユ湡
}
@@ -523,9 +537,21 @@
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();
+
+
+
//鎷兼帴浠讳竴瀛楁杩囨护鏌ヨ鏉′欢
- var com = "";
+ var coms = "";
if (ColName != 0 && Comparator != 0) {
+ ColName = "[" + ColName + "]";
+ var com = "";
switch (Comparator) {
case "7":
com = "like ''%" + ColContent + "%''";
@@ -543,8 +569,54 @@
com = "" + Comparator + " ''" + ColContent + "''";
break;
}
- com = " and (" + ColName + " " + com + ")";
+ coms += " and (" + ColName + " " + com + ")";
}
+
+ if (ColName1 != 0 && Comparator1 != 0) {
+ ColName1 = "[" + ColName1 + "]";
+ 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;
+ }
+ coms += " and (" + ColName1 + " " + com1 + ")";
+ }
+
+ if (ColName2 != 0 && Comparator2 != 0) {
+ ColName2 = "[" + ColName2 + "]";
+ 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;
+ }
+ coms += " and (" + ColName2 + " " + com2 + ")";
+ }
var params = get_UrlVars();
if (params[params[0]] != null && detailBar == 0) {
@@ -569,7 +641,7 @@
, HBillNo: HBillNo
, HProductName: HProductName
, HProductModel: HProductModel
- , RandomSearch: com
+ , RandomSearch: coms
}
//set_InitGrid(JSON.stringify(sWhere));
@@ -581,8 +653,8 @@
//閲嶇疆杩囨护鏉′欢
function set_ClearQuery() {
//鍒濆鍖栨椂闂�
- var HBeginDate = Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 1).setHours(8, 0, 0, 0), "yyyy-MM-dd hh");
- var HEndDate = Format(new Date(new Date()).setHours(8, 0, 0, 0), "yyyy-MM-dd hh");
+ var HBeginDate = Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 1).setHours(7, 0, 0, 0), "yyyy-MM-dd hh");
+ var HEndDate = Format(new Date(new Date()).setHours(7, 0, 0, 0), "yyyy-MM-dd hh");
laydate.render({
elem: '#HBeginDate',
type: 'datetime',
@@ -607,11 +679,41 @@
$("#ColContent").val("");
$("#ColName").val("0");
$("#Comparator").val("0");
- //form.render()
+
+ $("#ColContent1").val("");
+ $("#ColName1").val("0");
+ $("#Comparator1").val("0");
+
+ $("#ColContent2").val("");
+ $("#ColName2").val("0");
+ $("#Comparator2").val("0");
+ form.render()
ColFilter();
sWhere = "";
}
+
+ //#region 瀵煎嚭Execel
+ function get_Export() {
+ var ModRightNameCheck = "Kf_MaterOutEntryReport_Cloth_ExportExcel";
+
+ //閫昏緫瀹℃牳鏂规硶
+ $.ajax({
+ type: "GET",
+ url: GetWEBURL() + "/LMES/getReportByModRightNameCheck", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+ data: { "ModRightNameCheck": ModRightNameCheck, "user": sessionStorage["HUserName"] },
+ success: function (result) {
+ if (result.count == 1) {
+ table.exportFile(ins.config.id, option.data, "xls");
+ } else {
+ layer.alert("褰撳墠妯″潡娌℃湁瀵煎嚭鏉冮檺!", { icon: 5 });
+ }
+ }, error: function () {
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
+ //#endregion
//闅愯棌鍒楄缃�
function get_HideColumn() {
@@ -721,7 +823,255 @@
//#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);
+ }
+ }
+ //鏌ヨ
+
+ 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 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>
\ No newline at end of file
--
Gitblit v1.9.1