From ae825944a2eeb4741b45b989b97e72b0d4408142 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期二, 24 十二月 2024 10:20:54 +0800
Subject: [PATCH] 器具管理: 保养记录单,点检记录单,上模单,下模单,故障登记单,维修派工单,维修工单,维修验收单 将分页模式,改为 数据库分页。 目前的分页模式,加载数据一多就很慢,需要改为数据库分页模式提高性能 (数据库分页的功能, 杜贺和翁涛涛已编写好 案例, 物料列表 目前就是 数据库分页)
---
WebTM/views/模治具管理/模治具管理/Sc_MouldDotCheckBillList.html | 117 ++++++
WebTM/views/模治具管理/上模单/Sc_MouldLowerBillList.html | 122 +++++++
WebTM/views/模治具管理/器具维修派工单/Sc_MouldRepairSendWorkBillList.html | 121 ++++++
WebTM/views/模治具管理/模治具管理/Sc_MouldConkBookBillList.html | 130 ++++++
WebTM/views/模治具管理/上模单/Sc_MouldUpperBillList.html | 123 +++++++
WebTM/views/模治具管理/模治具管理/Sb_MouldRepairWorkBillList.html | 113 ++++++
WebTM/views/模治具管理/模治具管理/Sc_MouldMaintainBillList.html | 117 ++++++
WebTM/views/模治具管理/模治具管理/Sc_MouldRepairCheckBillList.html | 135 ++++++-
8 files changed, 913 insertions(+), 65 deletions(-)
diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\344\270\212\346\250\241\345\215\225/Sc_MouldLowerBillList.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\344\270\212\346\250\241\345\215\225/Sc_MouldLowerBillList.html"
index 550cfd8..349b1b9 100644
--- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\344\270\212\346\250\241\345\215\225/Sc_MouldLowerBillList.html"
+++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\344\270\212\346\250\241\345\215\225/Sc_MouldLowerBillList.html"
@@ -140,6 +140,7 @@
</div>
</div>
<table class="" id="mainTable" lay-filter="mainTable"></table>
+ <div id="page" style="position: relative; bottom: 0;"></div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="set_AddNew" lay-event="set_AddNew"><i class="layui-icon layui-icon-form"></i>鏂板</button>
@@ -194,6 +195,8 @@
var option = [];
var titleData = [];
var HModName = "Sc_MouldLowerBillList";
+ var page = 1;//鍒嗛〉鏁版嵁
+ var size = 50;
//#endregion
//#region 杩涘叆椤甸潰鍗冲姞杞�
@@ -289,7 +292,11 @@
//鏌ヨ
form.on('submit(btnSearch)', function (data) {
- get_FastQuery();
+ if (page != 1) {
+ $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+ } else {
+ get_FastQuery();
+ }
});
// 閲嶇疆鎸夐挳
@@ -304,6 +311,7 @@
//鍒濆鍖栨煡璇�
function set_ClearBill() {
+ set_InitGrid();
//鏌ヨ褰撳墠鐧诲綍鐢ㄦ埛鏈夋病鏈夊湪褰撳墠妯″潡璁剧疆榛樿杩囨护鏂规
get_DefaultModule();
$("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
@@ -402,11 +410,121 @@
sWhere += GetDataCols;
}
- get_Display(sWhere);
+ //get_Display(sWhere);
+ get_DisplayPage(sWhere);
sWhere = ""//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
GetDataCols = "";
}
+ //鍒濆鍖栬〃鏍�
+ function set_InitGrid() {
+ option = {
+ elem: '#mainTable'
+ , toolbar: '#toolbarDemo'
+ , height: 450
+ , page: false
+ , cellMinWidth: 90
+ , limit: 50
+ , limits: [50, 500, 5000, 20000]
+ }
+
+ optionPage = {
+ elem: 'page', //娉ㄦ剰锛岃繖閲岀殑 page 鏄� ID锛屼笉鐢ㄥ姞 # 鍙�
+ count: 10000, //鏁版嵁鎬绘暟锛屼粠鏈嶅姟绔緱鍒�
+ limit: 50,
+ limits: [50, 500, 5000, 50000],
+ layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
+ jump: function (obj, first) {
+
+ //棣栨涓嶆墽琛�
+ if (!first) {
+ //do something
+ page = obj.curr;
+ size = obj.limit;
+ get_FastQuery();
+ }
+ }
+ }
+ laypage.render(optionPage);
+ };
+
+ //鍒嗛〉鏌ヨ
+ function get_DisplayPage(sWhere) {
+ var ajaxLoad = layer.load();
+ $.ajax({
+ url: GetWEBURL() + '/Sc_MouldUpperBill/Sc_MouldLowerBillListPage',
+ type: "GET",
+ data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": page, "size": size },
+ success: function (data1) {
+ option.limit = size;//鏀瑰彉琛ㄦ牸椤靛ぇ灏�
+ if (data1.code == 1) {
+ optionPage.count = data1.count;//鏀瑰彉鍒楄〃鏁版嵁鎬绘暟
+ var data = [];
+ var col = [];
+ //缁欑┖鐨勬暟缁勮祴鍊�
+ for (var key in data1.list) {
+ //鍔ㄦ�佽幏鍙栧垪琛ㄦ墍鏈夊垪鍚�
+ data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
+ //鑾峰彇涓嶉渶瑕佹樉绀虹殑鍒楋紙H寮�澶寸殑鍒椾笉鏄剧ず锛�
+ var patrn = new RegExp(/^h/i);
+ if (patrn.test(data1.list[key].ColmCols)) {
+ titleData[key] = data1.list[key].ColmCols;
+ }
+ }
+ //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
+ 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: false, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 160 });
+ break;
+ case 'Decimal':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
+ break;
+ case 'Int32':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
+ break;
+ default:
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140 });
+ }
+ }
+ }
+
+ columns = col;
+ option.cols = [col];
+ option.data = data1.data;
+ option.totalRow = true;
+ laypage.render(optionPage);
+
+ //鍒锋柊琛ㄦ牸鏁版嵁
+ DisPlay_HideColumn();
+
+ layer.close(ajaxLoad);
+ if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
+ ColFilter();
+ }
+
+ //鍒锋柊鎸夐挳鏄剧ず
+ var btns = document.getElementsByTagName("button"); //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+ var HBillType = "3847";
+ Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
+
+ } else {
+ layer.close(ajaxLoad);
+ layer.alert(data1.code + data1.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.close(ajaxLoad);
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
+
//鏌ヨ
function get_Display(sWhere) {
var ajaxLoad = layer.load();
diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\344\270\212\346\250\241\345\215\225/Sc_MouldUpperBillList.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\344\270\212\346\250\241\345\215\225/Sc_MouldUpperBillList.html"
index 7dcf7e0..00c829d 100644
--- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\344\270\212\346\250\241\345\215\225/Sc_MouldUpperBillList.html"
+++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\344\270\212\346\250\241\345\215\225/Sc_MouldUpperBillList.html"
@@ -140,6 +140,7 @@
</div>
</div>
<table class="" id="mainTable" lay-filter="mainTable"></table>
+ <div id="page" style="position: relative; bottom: 0;"></div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="set_AddNew" lay-event="set_AddNew"><i class="layui-icon layui-icon-form"></i>鏂板</button>
@@ -194,6 +195,8 @@
var option = [];
var titleData = [];
var HModName = "Sc_MouldUpperBillList";
+ var page = 1;//鍒嗛〉鏁版嵁
+ var size = 50;
//#endregion
//#region 杩涘叆椤甸潰鍗冲姞杞�
@@ -289,7 +292,11 @@
//鏌ヨ
form.on('submit(btnSearch)', function (data) {
- get_FastQuery();
+ if (page != 1) {
+ $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+ } else {
+ get_FastQuery();
+ }
});
// 閲嶇疆鎸夐挳
@@ -304,12 +311,123 @@
//鍒濆鍖栨煡璇�
function set_ClearBill() {
+ set_InitGrid();
//鏌ヨ褰撳墠鐧诲綍鐢ㄦ埛鏈夋病鏈夊湪褰撳墠妯″潡璁剧疆榛樿杩囨护鏂规
get_DefaultModule();
$("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
$("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
//get_FastQuery();
}
+
+ //鍒濆鍖栬〃鏍�
+ function set_InitGrid() {
+ option = {
+ elem: '#mainTable'
+ , toolbar: '#toolbarDemo'
+ , height: 450
+ , page: false
+ , cellMinWidth: 90
+ , limit: 50
+ , limits: [50, 500, 5000, 20000]
+ }
+
+ optionPage = {
+ elem: 'page', //娉ㄦ剰锛岃繖閲岀殑 page 鏄� ID锛屼笉鐢ㄥ姞 # 鍙�
+ count: 10000, //鏁版嵁鎬绘暟锛屼粠鏈嶅姟绔緱鍒�
+ limit: 50,
+ limits: [50, 500, 5000, 50000],
+ layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
+ jump: function (obj, first) {
+
+ //棣栨涓嶆墽琛�
+ if (!first) {
+ //do something
+ page = obj.curr;
+ size = obj.limit;
+ get_FastQuery();
+ }
+ }
+ }
+ laypage.render(optionPage);
+ };
+
+ //鍒嗛〉鏌ヨ
+ function get_DisplayPage(sWhere) {
+ var ajaxLoad = layer.load();
+ $.ajax({
+ url: GetWEBURL() + '/Sc_MouldUpperBill/Sc_MouldUpperBillListPage',
+ type: "GET",
+ data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": page, "size": size },
+ success: function (data1) {
+ option.limit = size;//鏀瑰彉琛ㄦ牸椤靛ぇ灏�
+ if (data1.code == 1) {
+ optionPage.count = data1.count;//鏀瑰彉鍒楄〃鏁版嵁鎬绘暟
+ var data = [];
+ var col = [];
+ //缁欑┖鐨勬暟缁勮祴鍊�
+ for (var key in data1.list) {
+ //鍔ㄦ�佽幏鍙栧垪琛ㄦ墍鏈夊垪鍚�
+ data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
+ //鑾峰彇涓嶉渶瑕佹樉绀虹殑鍒楋紙H寮�澶寸殑鍒椾笉鏄剧ず锛�
+ var patrn = new RegExp(/^h/i);
+ if (patrn.test(data1.list[key].ColmCols)) {
+ titleData[key] = data1.list[key].ColmCols;
+ }
+ }
+ //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
+ 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: false, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 160 });
+ break;
+ case 'Decimal':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
+ break;
+ case 'Int32':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
+ break;
+ default:
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140 });
+ }
+ }
+ }
+
+ columns = col;
+ option.cols = [col];
+ option.data = data1.data;
+ option.totalRow = true;
+ laypage.render(optionPage);
+
+ //鍒锋柊琛ㄦ牸鏁版嵁
+ DisPlay_HideColumn();
+
+ layer.close(ajaxLoad);
+ if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
+ ColFilter();
+ }
+
+ //鍒锋柊鎸夐挳鏄剧ず
+ var btns = document.getElementsByTagName("button"); //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+ var HBillType = "3846";
+ Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
+
+ } else {
+ layer.close(ajaxLoad);
+ layer.alert(data1.code + data1.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.close(ajaxLoad);
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
+
//蹇�熻繃婊�
function get_FastQuery() {
@@ -402,7 +520,8 @@
sWhere += GetDataCols;
}
- get_Display(sWhere);
+ //get_Display(sWhere);
+ get_DisplayPage(sWhere);
sWhere = ""//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
GetDataCols = "";
}
diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\345\231\250\345\205\267\347\273\264\344\277\256\346\264\276\345\267\245\345\215\225/Sc_MouldRepairSendWorkBillList.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\345\231\250\345\205\267\347\273\264\344\277\256\346\264\276\345\267\245\345\215\225/Sc_MouldRepairSendWorkBillList.html"
index e041009..4f6cfa9 100644
--- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\345\231\250\345\205\267\347\273\264\344\277\256\346\264\276\345\267\245\345\215\225/Sc_MouldRepairSendWorkBillList.html"
+++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\345\231\250\345\205\267\347\273\264\344\277\256\346\264\276\345\267\245\345\215\225/Sc_MouldRepairSendWorkBillList.html"
@@ -186,6 +186,7 @@
</div>
</div>
<table class="" id="mainTable" lay-filter="mainTable"></table>
+ <div id="page" style="position: relative; bottom: 0;"></div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Add" id="btn-Add"><i class="layui-icon layui-icon-file-b"></i>鏂板</button>
@@ -229,7 +230,9 @@
var option = [];
var HBillType = "3843";
var HModName = "Sc_MouldRepairSendWorkBillList";
-
+ var titleData = [];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+ var page = 1;//鍒嗛〉鏁版嵁
+ var size = 50;
//#endregion
//#region 銆愬姩鎬佽幏鍙栨ā鍧楀悕绉般��
@@ -252,7 +255,11 @@
// 鏌ヨ鎸夐挳
form.on('submit(btnSearch)', function (data) {
- get_FastQuery();
+ if (page != 1) {
+ $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+ } else {
+ get_FastQuery();
+ }
});
//澶村伐鍏锋爮浜嬩欢
@@ -351,14 +358,15 @@
//#region 姝ら〉闈㈡墍鏈夌殑鏂规硶
// 鍒濆鍖栫晫闈�
function set_ClearBill() {
- //鍒濆鍖栬〃鏍�
- set_InitGrid();
- //鏌ヨ
- get_Display(sWhere);
//鍒濆鍖栨棩鏈�
//褰卞搷鍒板揩閫熻繃婊ょ殑鏌ヨ锛屾墍浠ュ厛娉ㄩ噴
$("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
$("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
+ //鍒濆鍖栬〃鏍�
+ set_InitGrid();
+ //鏌ヨ
+ //get_Display(sWhere);
+ get_FastQuery();
}
//鍒濆鍖栬〃鏍�
@@ -367,8 +375,7 @@
elem: '#mainTable'
, toolbar: '#toolbarDemo'
, height: 'full-50'
- , page: true
- , totalRow: true
+ , page: false
, cellMinWidth: 90
, limit: 50
, limits: [50, 500, 5000, 20000]
@@ -434,6 +441,101 @@
, { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡', width: 200, templet: "<div>{{d.浣滃簾鏃ユ湡 ==null ?'':layui.util.toDateString(d.浣滃簾鏃ユ湡, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
]]
};
+
+ optionPage = {
+ elem: 'page', //娉ㄦ剰锛岃繖閲岀殑 page 鏄� ID锛屼笉鐢ㄥ姞 # 鍙�
+ count: 10000, //鏁版嵁鎬绘暟锛屼粠鏈嶅姟绔緱鍒�
+ limit: 50,
+ limits: [50, 500, 5000, 50000],
+ layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
+ jump: function (obj, first) {
+
+ //棣栨涓嶆墽琛�
+ if (!first) {
+ //do something
+ page = obj.curr;
+ size = obj.limit;
+ get_FastQuery();
+ }
+ }
+ }
+ laypage.render(optionPage);
+ }
+
+
+ //鍒嗛〉鏌ヨ
+ function get_DisplayPage(sWhere) {
+ var ajaxLoad = layer.load();
+ $.ajax({
+ url: GetWEBURL() + '/Sc_MouldRepairSendWorkBill/GetMouldRepairSendWorkBillListPage',
+ type: "GET",
+ data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": page, "size": size },
+ success: function (data1) {
+ option.limit = size;//鏀瑰彉琛ㄦ牸椤靛ぇ灏�
+ if (data1.code == 1) {
+ optionPage.count = data1.count;//鏀瑰彉鍒楄〃鏁版嵁鎬绘暟
+ var data = [];
+ var col = [];
+ //缁欑┖鐨勬暟缁勮祴鍊�
+ for (var key in data1.list) {
+ //鍔ㄦ�佽幏鍙栧垪琛ㄦ墍鏈夊垪鍚�
+ data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
+ //鑾峰彇涓嶉渶瑕佹樉绀虹殑鍒楋紙H寮�澶寸殑鍒椾笉鏄剧ず锛�
+ var patrn = new RegExp(/^h/i);
+ if (patrn.test(data1.list[key].ColmCols)) {
+ titleData[key] = data1.list[key].ColmCols;
+ }
+ }
+ //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
+ 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: false, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 160 });
+ break;
+ case 'Decimal':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
+ break;
+ case 'Int32':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
+ break;
+ default:
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140 });
+ }
+ }
+ }
+
+ columns = col;
+ option.cols = [col];
+ option.data = data1.data;
+ option.totalRow = true;
+ laypage.render(optionPage);
+ table.render(option);
+ layer.close(ajaxLoad);
+
+ //鍒锋柊鎸夐挳鏄剧ず
+ var btns = document.getElementsByTagName("button"); //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+ Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
+
+
+ if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
+ ColFilter();
+ }
+
+ } else {
+ layer.close(ajaxLoad);
+ layer.alert(data1.code + data1.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.close(ajaxLoad);
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
}
//杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
@@ -606,7 +708,8 @@
// layer.alert("鎺ュ彛澶辨晥!", { icon: 5 });
// }
//});
- get_Display(sWhere);
+ //get_Display(sWhere);
+ get_DisplayPage(sWhere);
sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
}
diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sb_MouldRepairWorkBillList.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sb_MouldRepairWorkBillList.html"
index c7c1947..948375b 100644
--- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sb_MouldRepairWorkBillList.html"
+++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sb_MouldRepairWorkBillList.html"
@@ -190,6 +190,7 @@
</div>
</div>
</div>
+ <div id="page" style="position: relative; bottom: 0;"></div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-getCheckData"><i class="layui-icon layui-icon-tips"></i>棰勮</button>-->
@@ -214,7 +215,7 @@
<script type="text/html" id="xuhao1">
{{d.LAY_TABLE_INDEX+1}}
</script>
- </form>
+</form>
</div>
</div>
</div>
@@ -246,7 +247,9 @@
var option = [];
var HBillType = "3807";
var HModName = "Sb_MouldRepairWorkBillList";
- var titleData = ["hmainid","鍗曟嵁ID", "鍗曟嵁绫诲瀷", "HMouldID", "HEquipID", "HEmpID", "HManagerID", "HDeptID", "HSupID", "hsubid", "HRepairID", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�", "HBillType"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+ var titleData = ["hmainid", "鍗曟嵁ID", "鍗曟嵁绫诲瀷", "HMouldID", "HEquipID", "HEmpID", "HManagerID", "HDeptID", "HSupID", "hsubid", "HRepairID", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�", "HBillType"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+ var page = 1;//鍒嗛〉鏁版嵁
+ var size = 50;
//#endregion
//#region 銆愬姩鎬佽幏鍙栨ā鍧楀悕绉般��
@@ -361,7 +364,11 @@
// 鏌ヨ鎸夐挳
form.on('submit(btnSearch)', function (data) {
- get_FastQuery();
+ if (page != 1) {
+ $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+ } else {
+ get_FastQuery();
+ }
});
// 閲嶇疆鎸夐挳
@@ -394,7 +401,8 @@
//鍒濆鍖栬〃鏍�(瀛愯〃2)
set_InitGrid2();
//鏌ヨ
- get_Display(sWhere);
+ //get_Display(sWhere);
+ get_FastQuery();
}
//鍒濆鍖栬〃鏍�
@@ -405,8 +413,7 @@
, height: 'full-50'
, limit: 50
, limits: [50, 500, 5000, 20000]
- , page: true
- , totalRow: true
+ , page: false
, cellMinWidth: 90
, cols: [[
{ type: 'checkbox', fixed: 'left', totalRowText: '鍚堣琛�' }
@@ -475,6 +482,97 @@
, { field: 'HBillType', title: 'HBillType', width: 200, hide: true }
]]
};
+
+ optionPage = {
+ elem: 'page', //娉ㄦ剰锛岃繖閲岀殑 page 鏄� ID锛屼笉鐢ㄥ姞 # 鍙�
+ count: 10000, //鏁版嵁鎬绘暟锛屼粠鏈嶅姟绔緱鍒�
+ limit: 50,
+ limits: [50, 500, 5000, 50000],
+ layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
+ jump: function (obj, first) {
+
+ //棣栨涓嶆墽琛�
+ if (!first) {
+ //do something
+ page = obj.curr;
+ size = obj.limit;
+ get_FastQuery();
+ }
+ }
+ }
+ laypage.render(optionPage);
+ }
+
+ //鍒嗛〉鏌ヨ
+ function get_DisplayPage(sWhere) {
+ var ajaxLoad = layer.load();
+ $.ajax({
+ url: GetWEBURL() + '/Sb_MouldRepairWorkBill/GetMouldRepairWorkBillListPage',
+ type: "GET",
+ data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": page, "size": size },
+ success: function (data1) {
+ option.limit = size;//鏀瑰彉琛ㄦ牸椤靛ぇ灏�
+ if (data1.code == 1) {
+ optionPage.count = data1.count;//鏀瑰彉鍒楄〃鏁版嵁鎬绘暟
+ var data = [];
+ var col = [];
+ //缁欑┖鐨勬暟缁勮祴鍊�
+ for (var key in data1.list) {
+ //鍔ㄦ�佽幏鍙栧垪琛ㄦ墍鏈夊垪鍚�
+ data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
+ //鑾峰彇涓嶉渶瑕佹樉绀虹殑鍒楋紙H寮�澶寸殑鍒椾笉鏄剧ず锛�
+ var patrn = new RegExp(/^h/i);
+ if (patrn.test(data1.list[key].ColmCols)) {
+ titleData[key] = data1.list[key].ColmCols;
+ }
+ }
+ //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
+ 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: false, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 160 });
+ break;
+ case 'Decimal':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
+ break;
+ case 'Int32':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
+ break;
+ default:
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140 });
+ }
+ }
+ }
+
+ columns = col;
+ option.cols = [col];
+ option.data = data1.data;
+ option.totalRow = true;
+ laypage.render(optionPage);
+
+ //鍒锋柊琛ㄦ牸鏁版嵁
+ DisPlay_HideColumn();
+
+ layer.close(ajaxLoad);
+ if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
+ ColFilter();
+ }
+
+ } else {
+ layer.close(ajaxLoad);
+ layer.alert(data1.code + data1.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.close(ajaxLoad);
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
}
//鏌ヨ
@@ -902,7 +1000,8 @@
sWhere += " and 缁翠慨椤圭洰 like '%" + RepairItem + "%'";
}
- get_Display(sWhere);
+ //get_Display(sWhere);
+ get_DisplayPage(sWhere);
//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
sWhere = "";
}
diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_MouldConkBookBillList.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_MouldConkBookBillList.html"
index b6a5489..82386d4 100644
--- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_MouldConkBookBillList.html"
+++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_MouldConkBookBillList.html"
@@ -33,15 +33,15 @@
</div>
</div>
<!--<div class="layui-inline">
- <label class="layui-form-label">鍗曟嵁绫诲瀷</label>
- <div class="layui-input-block">
- <select name="HBillType" id="HBillType">
- <option value="">鎵�鏈�</option>
- <option value="ZHXJ">涓嬫灦鎵捐揣鍗�</option>
- <option value="ZHSJ">涓婃灦褰掕繕鍗�</option>
- </select>
- </div>
- </div>-->
+ <label class="layui-form-label">鍗曟嵁绫诲瀷</label>
+ <div class="layui-input-block">
+ <select name="HBillType" id="HBillType">
+ <option value="">鎵�鏈�</option>
+ <option value="ZHXJ">涓嬫灦鎵捐揣鍗�</option>
+ <option value="ZHSJ">涓婃灦褰掕繕鍗�</option>
+ </select>
+ </div>
+ </div>-->
<div class="layui-inline">
<label class="layui-form-label">鍗曟嵁鍙�</label>
<div class="layui-input-block">
@@ -162,6 +162,7 @@
</div>
</div>
<table class="" id="mainTable" lay-filter="mainTable"></table>
+ <div id="page" style="position: relative; bottom: 0;"></div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-getCheckData"><i class="layui-icon layui-icon-tips"></i>棰勮</button>-->
@@ -179,7 +180,7 @@
</div>
</script>
- </form>
+</form>
</div>
</div>
</div>
@@ -211,7 +212,9 @@
var option = [];
var HModName = "Sc_MouldConkBookBillList";
var HBillType = "3815";
- var titleData = ["hmainid","鍗曟嵁ID", "鍗曟嵁绫诲瀷", "hempid", "HConkTypeID", "HDeptID", "HMouldID", "hsubid", "HConkReasonID", "HManagerID", "琛ㄤ綋澶囨敞", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�","HEmpID","HBillType"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+ var titleData = ["hmainid", "鍗曟嵁ID", "鍗曟嵁绫诲瀷", "hempid", "HConkTypeID", "HDeptID", "HMouldID", "hsubid", "HConkReasonID", "HManagerID", "琛ㄤ綋澶囨敞", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�", "HEmpID", "HBillType"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+ var page = 1;//鍒嗛〉鏁版嵁
+ var size = 50;
//#endregion
//#region 杩涘叆椤甸潰鍗冲姞杞�
@@ -261,7 +264,11 @@
//鏌ヨ鎸夐挳
form.on('submit(btnSearch)', function (data) {//閫夋嫨浠撲綅
- get_FastQuery();
+ if (page != 1) {
+ $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+ } else {
+ get_FastQuery();
+ }
});
//閲嶇疆鎸夐挳
@@ -324,7 +331,8 @@
//鍒濆鍖栬〃鏍�
set_InitGrid();
//鏌ヨ
- get_Display(sWhere);
+ //get_Display(sWhere);
+ get_FastQuery();
}
//鍒濆鍖栬〃鏍�
@@ -333,7 +341,7 @@
elem: '#mainTable'
, toolbar: '#toolbarDemo'
, height: 'full-50'
- , page: true
+ , page: false
, cellMinWidth: 90
, limit: 50
, limits: [50, 500, 5000, 20000]
@@ -391,6 +399,25 @@
, { field: 'hbilltype', title: 'hbilltype', width: 200 }
]]
};
+
+ optionPage = {
+ elem: 'page', //娉ㄦ剰锛岃繖閲岀殑 page 鏄� ID锛屼笉鐢ㄥ姞 # 鍙�
+ count: 10000, //鏁版嵁鎬绘暟锛屼粠鏈嶅姟绔緱鍒�
+ limit: 50,
+ limits: [50, 500, 5000, 50000],
+ layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
+ jump: function (obj, first) {
+
+ //棣栨涓嶆墽琛�
+ if (!first) {
+ //do something
+ page = obj.curr;
+ size = obj.limit;
+ get_FastQuery();
+ }
+ }
+ }
+ laypage.render(optionPage);
}
//鏌ヨ
@@ -564,10 +591,83 @@
if (EndHCreateDate) {
sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + EndHCreateDate + "'";
}
- get_Display(sWhere);
+ //get_Display(sWhere);
+ get_DisplayPage(sWhere);
sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
}
+ //鍒嗛〉鏌ヨ
+ function get_DisplayPage(sWhere) {
+ var ajaxLoad = layer.load();
+ $.ajax({
+ url: GetWEBURL() + '/Sc_MouldConkBookBill/GetMouldConkBookBillListPage',
+ type: "GET",
+ data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": page, "size": size },
+ success: function (data1) {
+ option.limit = size;//鏀瑰彉琛ㄦ牸椤靛ぇ灏�
+ if (data1.code == 1) {
+ optionPage.count = data1.count;//鏀瑰彉鍒楄〃鏁版嵁鎬绘暟
+ var data = [];
+ var col = [];
+ //缁欑┖鐨勬暟缁勮祴鍊�
+ for (var key in data1.list) {
+ //鍔ㄦ�佽幏鍙栧垪琛ㄦ墍鏈夊垪鍚�
+ data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
+ //鑾峰彇涓嶉渶瑕佹樉绀虹殑鍒楋紙H寮�澶寸殑鍒椾笉鏄剧ず锛�
+ var patrn = new RegExp(/^h/i);
+ if (patrn.test(data1.list[key].ColmCols)) {
+ titleData[key] = data1.list[key].ColmCols;
+ }
+ }
+ //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
+ 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: false, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 160 });
+ break;
+ case 'Decimal':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
+ break;
+ case 'Int32':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
+ break;
+ default:
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140 });
+ }
+ }
+ }
+
+ columns = col;
+ option.cols = [col];
+ option.data = data1.data;
+ option.totalRow = true;
+ laypage.render(optionPage);
+
+ //鍒锋柊琛ㄦ牸鏁版嵁
+ DisPlay_HideColumn();
+
+ layer.close(ajaxLoad);
+ if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
+ ColFilter();
+ }
+
+ } else {
+ layer.close(ajaxLoad);
+ layer.alert(data1.code + data1.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.close(ajaxLoad);
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
+
//鏂板
function set_AddNew() {
//椤甸潰灞�-鑷畾涔�
diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_MouldDotCheckBillList.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_MouldDotCheckBillList.html"
index a6ceb04..ea0985b 100644
--- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_MouldDotCheckBillList.html"
+++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_MouldDotCheckBillList.html"
@@ -159,6 +159,7 @@
</div>
</div>
<table class="" id="mainTable" lay-filter="mainTable"></table>
+ <div id="page" style="position: relative; bottom: 0;"></div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Add" id="btn-Add"><i class="layui-icon layui-icon-add-1"></i>鏂板</button>
@@ -211,7 +212,10 @@
var option2 = [];
var HModName = "Sc_MouldDotCheckBillList";
var HBillType = "3821";
- var titleData = ["hmainid", "HPlanInterID", "HDotCheckItemID", "鍗曟嵁ID", "HMouldID", "hsubid", "HManagerID", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�", "HBillType", "HMouldDotCheckRuleID","HShiftsID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+ var titleData = ["hmainid", "HPlanInterID", "HDotCheckItemID", "鍗曟嵁ID", "HMouldID", "hsubid", "HManagerID", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�", "HBillType", "HMouldDotCheckRuleID", "HShiftsID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+
+ var page = 1;//鍒嗛〉鏁版嵁
+ var size = 50;
//#endregion
//#region 杩涘叆椤甸潰鍗冲姞杞�
@@ -228,9 +232,8 @@
//鍒濆鍖栬〃鏍�
set_InitGrid();
//鍔犺浇鏁版嵁鍒扮綉鏍�
- get_Display(sWhere);
- //鍒濆鍖栬〃鏍�
- DisPlay_HideColumn();
+ //get_Display(sWhere);
+ get_FastQuery();
//#endregion
//#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
@@ -343,7 +346,11 @@
}
//鏌ヨ鎸夐挳
form.on('submit(btnSearch)', function (data) {
- get_FastQuery();
+ if (page != 1) {
+ $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+ } else {
+ get_FastQuery();
+ }
});
//蹇�熻繃婊�
function get_FastQuery() {
@@ -443,7 +450,8 @@
sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + EndHCreateDate + "'";
}
- get_Display(sWhere);
+ get_DisplayPage(sWhere);
+ //get_Display(sWhere);
sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
}
//鍒濆鍖栬〃鏍�
@@ -452,7 +460,7 @@
elem: '#mainTable'
, toolbar: '#toolbarDemo'
, height: 450
- , page: true
+ , page: false
, cellMinWidth: 90
, limit: 50
, limits: [50, 500, 5000, 20000]
@@ -500,8 +508,103 @@
// , { field: 'hbilltype', title: 'hbilltype', width: 200 }
//]]
}
+
+ optionPage = {
+ elem: 'page', //娉ㄦ剰锛岃繖閲岀殑 page 鏄� ID锛屼笉鐢ㄥ姞 # 鍙�
+ count: 10000, //鏁版嵁鎬绘暟锛屼粠鏈嶅姟绔緱鍒�
+ limit: 50,
+ limits: [50, 500, 5000, 50000],
+ layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
+ jump: function (obj, first) {
+
+ //棣栨涓嶆墽琛�
+ if (!first) {
+ //do something
+ page = obj.curr;
+ size = obj.limit;
+ get_FastQuery();
+ }
+ }
+ }
+ laypage.render(optionPage);
};
+ //鍒嗛〉鏌ヨ
+ function get_DisplayPage(sWhere) {
+ var ajaxLoad = layer.load();
+ $.ajax({
+ url: GetWEBURL() + '/Sc_MouldDotCheckBill/GetMouldDotCheckBillListPage',
+ type: "GET",
+ data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": page, "size": size },
+ success: function (data1) {
+ option.limit = size;//鏀瑰彉琛ㄦ牸椤靛ぇ灏�
+ if (data1.code == 1) {
+ optionPage.count = data1.count;//鏀瑰彉鍒楄〃鏁版嵁鎬绘暟
+ var data = [];
+ var col = [];
+ //缁欑┖鐨勬暟缁勮祴鍊�
+ for (var key in data1.list) {
+ //鍔ㄦ�佽幏鍙栧垪琛ㄦ墍鏈夊垪鍚�
+ data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
+ //鑾峰彇涓嶉渶瑕佹樉绀虹殑鍒楋紙H寮�澶寸殑鍒椾笉鏄剧ず锛�
+ var patrn = new RegExp(/^h/i);
+ if (patrn.test(data1.list[key].ColmCols)) {
+ titleData[key] = data1.list[key].ColmCols;
+ }
+ }
+ //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
+ 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: false, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 160 });
+ break;
+ case 'Decimal':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
+ break;
+ case 'Int32':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
+ break;
+ default:
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140 });
+ }
+ }
+ }
+
+ columns = col;
+ option.cols = [col];
+ option.data = data1.data;
+ option.totalRow = true;
+ laypage.render(optionPage);
+ //鍒锋柊琛ㄦ牸鏁版嵁
+ DisPlay_HideColumn();
+
+ layer.close(ajaxLoad);
+
+ //鍒锋柊鎸夐挳鏄剧ず
+ var btns = document.getElementsByTagName("button"); //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+ Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
+ if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
+ ColFilter();
+ }
+
+ } else {
+ layer.close(ajaxLoad);
+ layer.alert(data1.code + data1.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.close(ajaxLoad);
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
+
+
//鏂板
function set_AddNew() {
layer.open({
diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_MouldMaintainBillList.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_MouldMaintainBillList.html"
index 0f0624c..33e6580 100644
--- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_MouldMaintainBillList.html"
+++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_MouldMaintainBillList.html"
@@ -177,6 +177,7 @@
</div>
</div>
</div>
+ <div id="page" style="position: relative; bottom: 0;"></div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Add" id="btn-Add"><i class="layui-icon layui-icon-add-1"></i>鏂板</button>
@@ -199,7 +200,7 @@
<script type="text/html" id="xuhao1">
{{d.LAY_TABLE_INDEX+1}}
</script>
- </form>
+</form>
</div>
</div>
</div>
@@ -238,6 +239,8 @@
var option2 = [];
var HModName = "Sc_MouldMaintainBillList";
var HBillType = "3819";
+ var page = 1;//鍒嗛〉鏁版嵁
+ var size = 50;
var titleData = ["hmainid","鍗曟嵁ID", "鍗曟嵁绫诲瀷", "HMouldID","HEmpID","HBillType"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
//#endregion
@@ -328,7 +331,11 @@
// 鏌ヨ鎸夐挳
form.on('submit(btnSearch)', function (data) {
- get_FastQuery();
+ if (page != 1) {
+ $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+ } else {
+ get_FastQuery();
+ }
});
// 閲嶇疆鎸夐挳
@@ -350,7 +357,8 @@
//鍒濆鍖栬〃鏍�(瀛愯〃)
set_InitGrid2();
//鏌ヨ
- get_Display(sWhere);
+ //get_Display(sWhere);
+ get_DisplayPage(sWhere);
}
@@ -360,7 +368,7 @@
elem: '#mainTable'
, toolbar: '#toolbarDemo'
, height: '400'
- , page: true
+ , page: false
, totalRow: true
, cellMinWidth: 90
, limit: 50
@@ -394,6 +402,25 @@
]]
};
table.render(option);
+
+ optionPage = {
+ elem: 'page', //娉ㄦ剰锛岃繖閲岀殑 page 鏄� ID锛屼笉鐢ㄥ姞 # 鍙�
+ count: 10000, //鏁版嵁鎬绘暟锛屼粠鏈嶅姟绔緱鍒�
+ limit: 50,
+ limits: [50, 500, 5000, 50000],
+ layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
+ jump: function (obj, first) {
+
+ //棣栨涓嶆墽琛�
+ if (!first) {
+ //do something
+ page = obj.curr;
+ size = obj.limit;
+ get_FastQuery();
+ }
+ }
+ }
+ laypage.render(optionPage);
//鍒锋柊鎸夐挳鏄剧ず
var btns = document.getElementsByTagName("button"); //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
@@ -578,6 +605,82 @@
});
}
+ //鍒嗛〉鏌ヨ
+ function get_DisplayPage(sWhere) {
+ var ajaxLoad = layer.load();
+ $.ajax({
+ url: GetWEBURL() + '/Sc_MouldMaintainBill/GetMouldMaintainBillListPage',
+ type: "GET",
+ data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": page, "size": size },
+ success: function (data1) {
+ option.limit = size;//鏀瑰彉琛ㄦ牸椤靛ぇ灏�
+ if (data1.code == 1) {
+ optionPage.count = data1.count;//鏀瑰彉鍒楄〃鏁版嵁鎬绘暟
+ var data = [];
+ var col = [];
+ //缁欑┖鐨勬暟缁勮祴鍊�
+ for (var key in data1.list) {
+ //鍔ㄦ�佽幏鍙栧垪琛ㄦ墍鏈夊垪鍚�
+ data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
+ //鑾峰彇涓嶉渶瑕佹樉绀虹殑鍒楋紙H寮�澶寸殑鍒椾笉鏄剧ず锛�
+ var patrn = new RegExp(/^h/i);
+ if (patrn.test(data1.list[key].ColmCols)) {
+ titleData[key] = data1.list[key].ColmCols;
+ }
+ }
+ //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
+ 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: false, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 160 });
+ break;
+ case 'Decimal':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
+ break;
+ case 'Int32':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
+ break;
+ default:
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140 });
+ }
+ }
+ }
+
+ columns = col;
+ option.cols = [col];
+ option.data = data1.data;
+ option.totalRow = true;
+ laypage.render(optionPage);
+ //鍒锋柊琛ㄦ牸鏁版嵁
+ DisPlay_HideColumn();
+
+ layer.close(ajaxLoad);
+
+ //鍒锋柊鎸夐挳鏄剧ず
+ var btns = document.getElementsByTagName("button"); //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+ Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
+
+ if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
+ ColFilter();
+ }
+
+ } else {
+ layer.close(ajaxLoad);
+ layer.alert(data1.code + data1.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.close(ajaxLoad);
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
+
//蹇�熻繃婊�
function get_FastQuery() {
var HBillType = $("#HBillType").val();//鍗曟嵁绫诲瀷
@@ -671,7 +774,8 @@
if (EndHCreateDate) {
sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + EndHCreateDate + "'";
}
- get_Display(sWhere);
+ get_DisplayPage(sWhere);
+ //get_Display(sWhere);
sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
}
@@ -694,7 +798,8 @@
$("#Comparator1").val("0");
form.render('select');
sWhere = "";
- get_Display(sWhere);
+ //get_Display(sWhere);
+ get_DisplayPage(sWhere);
}
//鏂板
diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_MouldRepairCheckBillList.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_MouldRepairCheckBillList.html"
index de943db..84b7ec9 100644
--- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_MouldRepairCheckBillList.html"
+++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_MouldRepairCheckBillList.html"
@@ -33,15 +33,15 @@
</div>
</div>
<!--<div class="layui-inline">
- <label class="layui-form-label">鍗曟嵁绫诲瀷</label>
- <div class="layui-input-block">
- <select name="HBillType" id="HBillType">
- <option value="">鎵�鏈�</option>
- <option value="ZHXJ">涓嬫灦鎵捐揣鍗�</option>
- <option value="ZHSJ">涓婃灦褰掕繕鍗�</option>
- </select>
- </div>
- </div>-->
+ <label class="layui-form-label">鍗曟嵁绫诲瀷</label>
+ <div class="layui-input-block">
+ <select name="HBillType" id="HBillType">
+ <option value="">鎵�鏈�</option>
+ <option value="ZHXJ">涓嬫灦鎵捐揣鍗�</option>
+ <option value="ZHSJ">涓婃灦褰掕繕鍗�</option>
+ </select>
+ </div>
+ </div>-->
<div class="layui-inline">
<label class="layui-form-label">鍗曟嵁鍙�</label>
<div class="layui-input-block">
@@ -156,6 +156,7 @@
</div>
</div>
<table class="" id="mainTable" lay-filter="mainTable"></table>
+ <div id="page" style="position: relative; bottom: 0;"></div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-getCheckData"><i class="layui-icon layui-icon-tips"></i>棰勮</button>-->
@@ -169,8 +170,6 @@
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-generate" id="btn-generate"><i class="layui-icon layui-icon-file"></i>鐢熸垚閫佽揣鍗�</button>
<button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-exit" id="btn-exit"><i class="layui-icon layui-icon-return"></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>
-
-
</div>
</script>
</form>
@@ -205,6 +204,9 @@
var option = [];
var HBillType = "3817";
var HModName = "Sc_MouldRepairCheckBillList";
+ var titleData = [];
+ var page = 1;//鍒嗛〉鏁版嵁
+ var size = 50;
//#endregion
//#region 杩涘叆椤甸潰鍗冲姞杞�
@@ -220,7 +222,8 @@
//鍒濆鍖栬〃鏍�
set_InitGrid();
//鍔犺浇鏁版嵁鍒扮綉鏍�
- get_Display(sWhere);
+ //get_Display(sWhere);
+ get_FastQuery();
//#endregion
@@ -268,7 +271,11 @@
});
//鏌ヨ鎸夐挳
form.on('submit(btnSearch)', function () {//閫夋嫨浠撲綅
- get_FastQuery();
+ if (page != 1) {
+ $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+ } else {
+ get_FastQuery();
+ }
});
//閲嶇疆鎸夐挳
form.on('submit(btnReSearch)', function () {
@@ -285,8 +292,7 @@
elem: '#mainTable'
, toolbar: '#toolbarDemo'
, height: 'full-50'
- , page: true
- , totalRow: true
+ , page: false
, cellMinWidth: 90
, limit: 50
, limits: [50, 500, 5000, 20000]
@@ -344,7 +350,100 @@
, { field: '瀛愯礋璐d汉', title: '瀛愯礋璐d汉', width: 200, sort: true }
]]
};
+
+ optionPage = {
+ elem: 'page', //娉ㄦ剰锛岃繖閲岀殑 page 鏄� ID锛屼笉鐢ㄥ姞 # 鍙�
+ count: 10000, //鏁版嵁鎬绘暟锛屼粠鏈嶅姟绔緱鍒�
+ limit: 50,
+ limits: [50, 500, 5000, 50000],
+ layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
+ jump: function (obj, first) {
+
+ //棣栨涓嶆墽琛�
+ if (!first) {
+ //do something
+ page = obj.curr;
+ size = obj.limit;
+ get_FastQuery();
+ }
+ }
+ }
+ laypage.render(optionPage);
};
+
+ //鍒嗛〉鏌ヨ
+ function get_DisplayPage(sWhere) {
+ var ajaxLoad = layer.load();
+ $.ajax({
+ url: GetWEBURL() + '/Sc_MouldRepairCheckBill/GetMouldRepairCheckBillListPage',
+ type: "GET",
+ data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": page, "size": size },
+ success: function (data1) {
+ option.limit = size;//鏀瑰彉琛ㄦ牸椤靛ぇ灏�
+ if (data1.code == 1) {
+ optionPage.count = data1.count;//鏀瑰彉鍒楄〃鏁版嵁鎬绘暟
+ var data = [];
+ var col = [];
+ //缁欑┖鐨勬暟缁勮祴鍊�
+ for (var key in data1.list) {
+ //鍔ㄦ�佽幏鍙栧垪琛ㄦ墍鏈夊垪鍚�
+ data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
+ //鑾峰彇涓嶉渶瑕佹樉绀虹殑鍒楋紙H寮�澶寸殑鍒椾笉鏄剧ず锛�
+ var patrn = new RegExp(/^h/i);
+ if (patrn.test(data1.list[key].ColmCols)) {
+ titleData[key] = data1.list[key].ColmCols;
+ }
+ }
+ //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
+ 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: false, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 160 });
+ break;
+ case 'Decimal':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
+ break;
+ case 'Int32':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
+ break;
+ default:
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140 });
+ }
+ }
+ }
+
+ columns = col;
+ option.cols = [col];
+ option.data = data1.data;
+ option.totalRow = true;
+ laypage.render(optionPage);
+ table.render(option);
+
+ //鍒锋柊鎸夐挳鏄剧ず
+ var btns = document.getElementsByTagName("button"); //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+ Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
+
+ if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
+ ColFilter();
+ }
+ layer.close(ajaxLoad);
+
+ } else {
+ layer.close(ajaxLoad);
+ layer.alert(data1.code + data1.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.close(ajaxLoad);
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
//鏌ヨ
function get_Display(sWhere) {
@@ -583,7 +682,8 @@
sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + EndHCreateDate + "'";
}
- get_Display(sWhere);
+ //get_Display(sWhere);
+ get_DisplayPage(sWhere);
sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
}
@@ -604,7 +704,8 @@
$("#Comparator1").val("0");
form.render('select');
sWhere = "";
- get_Display(sWhere);
+ //get_Display(sWhere);
+ get_DisplayPage(sWhere);
}
--
Gitblit v1.9.1