| | |
| | | </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="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>æ°å¢</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>ç¼è¾</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>ç¼è¾</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>å é¤</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>å·æ°</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Audit"><i class="layui-icon layui-icon-radio"></i>å®¡æ ¸</button> |
| | |
| | | |
| | | var option = []; |
| | | var sWhere = ""; |
| | | var page = 1;//åé¡µæ°æ® |
| | | var size = 50; |
| | | var HModName = "Sb_EquipBeginBillList"; |
| | | |
| | | //#region ã卿è·å模ååç§°ã |
| | |
| | | //#endregion |
| | | |
| | | //ä¸éè¦æ¾ç¤ºçåæ®µ 坿©å± |
| | | var titleData = ["HInterID", "HEquipID", "HEquipRelationID", "HBeginEmpID"]; |
| | | var titleData = ["HInterID", "HEquipID", "HEquipRelationID", "HBeginEmpID","sorderid"]; |
| | | //#endregion |
| | | |
| | | //#region ãè¿æ»¤æ¹æ¡ã |
| | |
| | | |
| | | //#region æ¥è¯¢æé® |
| | | form.on('submit(btnSearch)', function (data) { |
| | | get_FastQuery(); |
| | | if (page != 1) { |
| | | $("#page a:eq(1)").get(0).click();//ç¹å»å页æ 第ä¸é¡µ |
| | | } else { |
| | | get_FastQuery(); |
| | | } |
| | | }); |
| | | //#endregion |
| | | |
| | |
| | | set_InitGrid(); |
| | | |
| | | //æ¥è¯¢ |
| | | get_FastQuery(); |
| | | //get_FastQuery(); |
| | | //æ¥è¯¢å½åç»å½ç¨æ·ææ²¡æå¨å½å模å设置é»è®¤è¿æ»¤æ¹æ¡ |
| | | get_DefaultModule(); |
| | | $("#BenginHCreateDate").val(Format(new Date(new Date()-(1000 * 60 * 60 * 24 * 7)), "yyyy-MM-dd")); |
| | |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | , height: 'full-50' |
| | | , page: true |
| | | , page: false |
| | | , sort: true //éç¹1ï¼è¿éçsort表示 table表å¨å徿¥å£æ°æ®åï¼å¯¹é¡µé¢æ¸²æåçtableæ°æ®è¿è¡æåºãåæ¶ï¼è¿éçtrue ä¼å½±å页é¢sort ä¸ä¸å°ç®å¤´ç æ¾ç¤ºææ |
| | | , totalRow: true |
| | | , limit: 50 |
| | |
| | | soulTable.render(this); |
| | | } |
| | | }; |
| | | 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); |
| | | } |
| | | //#endregion |
| | | |
| | |
| | | } |
| | | }); |
| | | |
| | | } |
| | | //#endregion |
| | | |
| | | //#region å页æ¥è¯¢ |
| | | function get_DisplayPage(sWhere) { |
| | | var ajaxLoad = layer.load(); |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Sb_EquipBeginBill/getSb_EquipBeginBillListPage', |
| | | 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 ($("#ColName option").length < 1) { |
| | | ColFilter(); |
| | | } |
| | | |
| | | } else { |
| | | layer.close(ajaxLoad); |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.close(ajaxLoad); |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | //#endregion |
| | | |
| | |
| | | sWhere += " and CONVERT(varchar(100),æ¥æ, 23) <= '" + EndHCreateDate + "'"; |
| | | } |
| | | |
| | | get_Display(sWhere); |
| | | //get_Display(sWhere); |
| | | //æ°æ®åºå页æ¥è¯¢ |
| | | get_DisplayPage(sWhere); |
| | | sWhere = "";//è°ç¨æ¥å£åæ¸
空sWhereç¼å |
| | | } |
| | | //#endregion |
| | |
| | | //å½åç¨æ·æ²¡æè®¾ç½®é»è®¤çè¿æ»¤æ¹æ¡ |
| | | //éèæ¾ç¤ºè¿æ»¤æ¹æ¡çæ ç¾ä¿¡æ¯ |
| | | document.getElementById("HFilterScheme_Now").style.display = "none"; |
| | | //æ¥è¯¢ |
| | | get_FastQuery() |
| | | |
| | | } |
| | | }, error: function () { |