| | |
| | | <div class="layui-colla-item"> |
| | | <div class="layui-colla-title layui-inline"> |
| | | <div class="layui-inline"> |
| | | <span></span> |
| | | <span>æ´å¤</span> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | <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 type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit"><i class="layui-icon layui-icon-form"></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-colla-content" style="padding: 0px; margin-left: 6%;"> |
| | | |
| | | <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" lay-filter="ColName" style="width:190px;"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <select name="Comparator" id="Comparator" 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" value="" name="ColContent" id="ColContent"> |
| | | </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-getCheckData"><i class="layui-icon layui-icon-tips"></i>é¢è§</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit"><i class="layui-icon layui-icon-form"></i>ç¼è¾</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-reload"><i class="layui-icon layui-icon-refresh"></i>å·æ°</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-confirm" id="btn_confirm"><i class="layui-icon layui-icon-ok-circle"></i>确认</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-back" id="btn_back"><i class="layui-icon layui-icon-close-fill"></i>驳å</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-details"><i class="layui-icon layui-icon-form"></i>详æ
</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-generate"><i class="layui-icon layui-icon-file"></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="set_HideColumn"><i class="layui-icon layui-icon-form"></i>å设置</button> |
| | | </div> |
| | | </script> |
| | | </form> |
| | |
| | | , form = layui.form |
| | | , element = layui.element |
| | | , laypage = layui.laypage |
| | | , laydate = layui.laydate |
| | | , laydate = layui.laydate |
| | | var option = []; |
| | | var sWhere = ""; |
| | | var HModName = "Xt_SystemParameterList"; |
| | | //ä¸éè¦æ¾ç¤ºçåæ®µ 坿©å± |
| | | var titleData = ["HItemID","Hitemid"]; |
| | | |
| | | var option = { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | ,height: 'full-50' |
| | | , page: true |
| | | , cellMinWidth: 90 |
| | | , limit: 50 |
| | | , limits: [50, 500, 5000, 20000] |
| | | , cols: [[ |
| | | { field: 'Hitemid', title: 'Hitemid', sort: true, hide: true } |
| | | , { field: '模å大类', title: '模å大类' } |
| | | , { field: 'å
³é®ç ', title: 'å
³é®ç ' } |
| | | , { field: 'åæ°åç§°', title: 'åæ°åç§°' } |
| | | , { field: 'å¼', title: 'å¼' } |
| | | , { field: 'æ¯å¦å¯ç¼è¾', title: 'æ¯å¦å¯ç¼è¾' } |
| | | , { field: 'æè¿°', title: 'æè¿°' } |
| | | , { field: 'æ°æ®ç±»å', title: 'æ°æ®ç±»å' } |
| | | ]] |
| | | }; |
| | | //åå§åçé¢ |
| | | set_ClearBill(); |
| | | |
| | | var index = layer.load(0, { shade: false }); |
| | | //è¿å
¥é¡µé¢æ¾ç¤ºçç¼åå表 |
| | | $.ajax({ |
| | | //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum", |
| | | url: GetWEBURL() + '/Xt_SystemParameter/list', |
| | | type: "GET", |
| | | data: { "sWhere": sWhere }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | option.data = data1.data; |
| | | table.render(option); |
| | | layer.close(index); |
| | | } else { |
| | | layer.close(index); |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.close(index); |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | //#region 头工å
·æ äºä»¶ |
| | | table.on('toolbar(mainTable)', function (obj) { |
| | | switch (obj.event) { |
| | | //å设置 |
| | | case 'set_HideColumn': get_HideColumn(); |
| | | break; |
| | | }; |
| | | }); |
| | | //#endregion |
| | | |
| | | ////éç½®æé® |
| | | //form.on('submit(btnReSearch)', function (data) { |
| | | // $("#HName").val(""); |
| | | // $("#btnSearch").click(); |
| | | //}); |
| | | //#region åå§åçé¢ |
| | | function set_ClearBill() { |
| | | //åå§åè¡¨æ ¼ |
| | | set_InitGrid(); |
| | | //æ¥è¯¢ |
| | | get_Display(sWhere); |
| | | } |
| | | //#endregion |
| | | |
| | | //æ¥è¯¢æé® |
| | | form.on('submit(btnSearch)', function (data) { |
| | | var HName = $("#HName").val(); |
| | | if (HName) { |
| | | sWhere += " and åæ°åç§° like '%" + HName + "%'"; |
| | | } |
| | | //#region åå§åè¡¨æ ¼æ¹æ³ |
| | | function set_InitGrid() { |
| | | option = { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | , height: 'full-50' |
| | | , page: true |
| | | , cellMinWidth: 90 |
| | | , limit: 50 |
| | | , limits: [50, 500, 5000, 20000] |
| | | //, cols: [[ |
| | | // { field: 'Hitemid', title: 'Hitemid', sort: true, hide: true } |
| | | // , { field: '模å大类', title: '模å大类' } |
| | | // , { field: 'å
³é®ç ', title: 'å
³é®ç ' } |
| | | // , { field: 'åæ°åç§°', title: 'åæ°åç§°' } |
| | | // , { field: 'å¼', title: 'å¼' } |
| | | // , { field: 'æ¯å¦å¯ç¼è¾', title: 'æ¯å¦å¯ç¼è¾' } |
| | | // , { field: 'æè¿°', title: 'æè¿°' } |
| | | // , { field: 'æ°æ®ç±»å', title: 'æ°æ®ç±»å' } |
| | | //]] |
| | | }; |
| | | } |
| | | |
| | | //#region æ¥è¯¢ |
| | | function get_Display(sWhere) { |
| | | var ajaxLoad = layer.load(); |
| | | var index = layer.load(0, { shade: false }); |
| | | //è¿å
¥é¡µé¢æ¾ç¤ºçç¼åå表 |
| | | $.ajax({ |
| | | //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum", |
| | | url: GetWEBURL() + '/Xt_SystemParameter/list', |
| | |
| | | data: { "sWhere": sWhere }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | option.data = data1.data; |
| | | var data = []; |
| | | var col = []; |
| | | //ç»ç©ºçæ°ç»èµå¼ |
| | | for (var key in data1.list) { |
| | | data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType }); |
| | | } |
| | | //å¨å表左边添å å¾éæ¡ |
| | | col.push({ type: 'checkbox', fixed: 'left' }); |
| | | 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 { |
| | | switch (data[i].Type) { |
| | | //int |
| | | case 'DateTime': |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 }); |
| | | break; |
| | | default: |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //卿æ¾ç¤ºåå |
| | | option = { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | , cols: [col] |
| | | , data: data1.data |
| | | , height: 'full-80' |
| | | , page: true |
| | | , cellMinWidth: 90 |
| | | , limit: 50 |
| | | , limits: [50, 500, 5000, 20000] |
| | | } |
| | | table.render(option); |
| | | layer.alert("æ¥è¯¢æå", { icon: 1 }); |
| | | |
| | | //å·æ°è¡¨æ ¼æ°æ® |
| | | DisPlay_HideColumn(); |
| | | |
| | | layer.close(ajaxLoad); |
| | | if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") { |
| | | ColFilter(); |
| | | } |
| | | //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 }); |
| | | } |
| | | }); |
| | | layer.close(index); |
| | | } |
| | | |
| | | //éç½®æé® |
| | | form.on('submit(btnReSearch)', function (data) { |
| | | $("#HName").val(""); |
| | | $("#btnSearch").click(); |
| | | $("#ColContent").val(""); |
| | | $("#ColName").val("0"); |
| | | $("#Comparator").val("0"); |
| | | form.render('select'); |
| | | |
| | | sWhere = ""; |
| | | }); |
| | | |
| | | //#region å¿«éè¿æ»¤ |
| | | function get_FastQuery() { |
| | | var HName = $("#HName").val(); |
| | | var ColName = $("#ColName").val();//å¤éæ¡ |
| | | var Comparator = $("#Comparator").val() |
| | | var ColContent = $("#ColContent").val(); |
| | | |
| | | if (ColName != 0 && Comparator != 0) { |
| | | var com = ""; |
| | | switch (Comparator) { |
| | | case "7": |
| | | com = "like'%" + ColContent + "%'"; |
| | | break; |
| | | case "8": |
| | | com = "like'%" + ColContent + "'"; |
| | | break; |
| | | case "9": |
| | | com = "like'" + ColContent + "%'"; |
| | | break; |
| | | case "10": |
| | | com = "not like'%" + ColContent + "%'"; |
| | | break; |
| | | default: |
| | | com = "" + Comparator + "'" + ColContent + "'"; |
| | | break; |
| | | } |
| | | sWhere += " and " + ColName + " " + com; |
| | | } |
| | | if (HName) { |
| | | sWhere += " and åæ°åç§° like '%" + HName + "%'"; |
| | | } |
| | | get_Display(sWhere); |
| | | sWhere = "";//è°ç¨æ¥å£åæ¸
空sWhereç¼å |
| | | } |
| | | //#endregion |
| | | |
| | | //æ¥è¯¢æé® |
| | | form.on('submit(btnSearch)', function (data) { |
| | | get_FastQuery(); |
| | | }); |
| | | |
| | | //ä¿®æ¹æé® |
| | |
| | | }) |
| | | }); |
| | | |
| | | //#region éèå设置 |
| | | function get_HideColumn() { |
| | | var colName = ""; |
| | | var contentUrl = ""; |
| | | for (var i = 1; i < option.cols[0].length - 1; i++) { |
| | | colName += option.cols[0][i]["title"] + ","; |
| | | } |
| | | var urlStr = window.document.location.pathname;//è·åæä»¶è·¯å¾ |
| | | var urlLen = urlStr.split('/'); |
| | | for (var i = 0; i < urlLen.length - 4; i++) { |
| | | contentUrl += "../"; |
| | | } |
| | | colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI è¿è¡ç¼ç |
| | | |
| | | contentUrl += 'åºç¡èµæ/éèå设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName; |
| | | |
| | | layer.open({ |
| | | type: 2 |
| | | , skin: "layui-layer-rim" //å ä¸è¾¹æ¡ |
| | | , title: "éèå设置" //æ é¢ |
| | | , closeBtn: 1 //çªä½å³ä¸è§å
³é ç æ ·å¼ |
| | | , shift: 2 //å¼¹åºå¨ç» |
| | | , area: ["50%", "90%"] //çªä½å¤§å° |
| | | , maxmin: true //设置æå¤§æå°æé®æ¯å¦æ¾ç¤º |
| | | , content: [contentUrl, "yes"] |
| | | , btn: ["ç¡®å®", "åæ¶"] |
| | | , btn1: function (index, laero) { |
| | | //å·æ°è¡¨æ ¼æ°æ® |
| | | DisPlay_HideColumn(); |
| | | //æ´æ°è¡¨æ ¼ç¼åçæ°æ® |
| | | layer.close(index);//å
³éå¼¹çª |
| | | } |
| | | }) |
| | | } |
| | | //#endregion |
| | | //#region æ¾ç¤ºåæ°æ® |
| | | function DisPlay_HideColumn() { |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', |
| | | type: "GET", |
| | | data: { "HModName": HModName, "user": sessionStorage["HUserName"] }, |
| | | success: function (data1) { |
| | | if (data1.data.length != 0) { |
| | | |
| | | var dataCol = [];//æ°æ®åºæ¥è¯¢åºçåæ°æ® |
| | | //var titleData = ["åæ®ID", "HMouldID", "hsubid", "HManagerID", "æºå主å
ç ", "æºååå
ç "];//ä¸éè¦æ¾ç¤ºçåæ®µ 坿©å± |
| | | |
| | | dataCol = data1.data[0].HGridString.split(','); |
| | | |
| | | for (var i = 0; i < option.cols[0].length - 2; i++) { |
| | | var dataCols = dataCol[i].split('|'); |
| | | //éèå |
| | | if (dataCols[1] == 1) { |
| | | option.cols[0][i + 1]["hide"] = true; |
| | | } |
| | | //设置å宽 |
| | | if (dataCols[3] > 0) { |
| | | option.cols[0][i + 1]["width"] = dataCols[3]; |
| | | } |
| | | //设置å
容åä½å¤§å° |
| | | if (data1.data[0].HFontSize != 0) { |
| | | option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;"; |
| | | } else { |
| | | option.cols[0][i + 1]["style"] = "font-size:100%"; |
| | | } |
| | | //设置å宽 |
| | | //if (data1.data[0].HColumnWidth != 0) { |
| | | // option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;"; |
| | | //} else { |
| | | // option.cols[0][i + 1]["width"] = ""; |
| | | //} |
| | | //æ¾ç¤ºå |
| | | if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) { |
| | | option.cols[0][i + 1]["hide"] = false; |
| | | } |
| | | //å使å¨ä½ç½®(å·¦ å±
ä¸ å³) |
| | | switch (dataCols[2]) { |
| | | case "L": |
| | | option.cols[0][i + 1]["align"] = "left"; |
| | | break; |
| | | case "M": |
| | | option.cols[0][i + 1]["align"] = "center"; |
| | | break; |
| | | case "R": |
| | | option.cols[0][i + 1]["align"] = "right"; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | //åæ¶å»ç»å |
| | | for (var i = 1; i < option.cols[0].length - 1; i++) { |
| | | if (option.cols[0][i]["fixed"] != null) { |
| | | option.cols[0][i]["fixed"] = null; |
| | | } |
| | | else { |
| | | break; |
| | | } |
| | | } |
| | | //å»ç»å |
| | | if (data1.data[0].HFixCols != 0) { |
| | | for (var i = 0; i < data1.data[0].HFixCols; i++) { |
| | | if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) { |
| | | data1.data[0].HFixCols += 1; |
| | | } |
| | | option.cols[0][i + 1]["fixed"] = "left"; |
| | | } |
| | | } |
| | | table.render(option); |
| | | } else { |
| | | table.render(option); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }) |
| | | } |
| | | //#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].field + '</option>'; |
| | | } |
| | | } |
| | | $("#ColName").empty(); |
| | | $("#ColName").append(Organization); |
| | | form.render('select'); |
| | | } |
| | | //#endregion |
| | | |
| | | //laydate.render({ |
| | | // elem: '#HDate' |