| | |
| | | //#endregion |
| | | |
| | | //#region æ¾ç¤ºåæ°æ® |
| | | //function DisPlay_HideColumn() { |
| | | // $.ajax({ |
| | | // type: "GET", |
| | | // url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', |
| | | // async: false, |
| | | // data: { "HModName": HModName, "user": HMaker }, |
| | | // success: function (data1) { |
| | | // if (data1.data.length != 0) { |
| | | // var dataCol = [];//æ°æ®åºæ¥è¯¢åºçåæ°æ® |
| | | // dataCol = data1.data[0].HGridString.split(','); |
| | | |
| | | // for (var i = 0; i < option.cols[0].length - 2; i++) { |
| | | // if (dataCol[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 (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); |
| | | // ins = table.render(option); |
| | | // } else { |
| | | // table.render(option); |
| | | // ins = table.render(option); |
| | | // } |
| | | |
| | | // //å·æ°æé®æ¾ç¤º |
| | | // var btns = document.getElementsByTagName("button"); //è·åæ¬é¡µæææé®å¯¹è±¡ |
| | | // Display_HideButton(btns, HBillType, HModName, HMaker); |
| | | |
| | | // }, error: function () { |
| | | // layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | // } |
| | | // }) |
| | | //} |
| | | //#endregion |
| | | |
| | | //#region æ¾ç¤ºåæ°æ® |
| | | function DisPlay_HideColumn() { |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "HModName": HModName, "user": HMaker }, |
| | | data: { "HModName": HModName, "user": sessionStorage["HUserName"] }, |
| | | success: function (data1) { |
| | | if (data1.data.length != 0) { |
| | | var dataCol = [];//æ°æ®åºæ¥è¯¢åºçåæ°æ® |
| | | dataCol = data1.data[0].HGridString.split(','); |
| | | |
| | | for (var i = 0; i < option.cols[0].length - 2; i++) { |
| | | if (dataCol[i]) { |
| | | var dataCols = dataCol[i].split('|'); |
| | | } |
| | | var dataCol = [];//æ°æ®åºæ¥è¯¢åºçåæ°æ® |
| | | var newCols = [[]];//å¯¹åºæ°æ®åºå顺åºcol |
| | | newCols[0].push(option.cols[0][0]);//æ¾å
¥ç¬¬ä¸ä¸ªcheckbox |
| | | dataCol = data1.data[0].HGridString.split(','); |
| | | //åè®¾ç½®åæ°ä¸é¡µé¢åæ°æ¯å¦ä¸è´ |
| | | if (dataCol.length == option.cols[0].length - 1) { |
| | | //éå寻æ¾å设置对åºåæé¡ºåºæå
¥ |
| | | for (var j = 0; j < option.cols[0].length - 1; j++) { |
| | | for (var i = 0; i < option.cols[0].length - 1; i++) { |
| | | var dataCols = dataCol[j].split('|'); |
| | | //éæ©ä¸datacolsç¸åºåè¿è¡ä¿®æ¹ |
| | | if (option.cols[0][i + 1]["field"] == dataCols[5]) { |
| | | //éèå |
| | | if (dataCols[1] == 1) { |
| | | option.cols[0][i + 1]["hide"] = true; |
| | |
| | | if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) { |
| | | option.cols[0][i + 1]["hide"] = false; |
| | | } |
| | | //ç»è®¡å |
| | | if (dataCols[6] == 1) { |
| | | option.cols[0][i + 1]["totalRow"] = true; |
| | | } |
| | | //å使å¨ä½ç½®(å·¦ å±
ä¸ å³) |
| | | switch (dataCols[2]) { |
| | | case "L": |
| | |
| | | option.cols[0][i + 1]["align"] = "right"; |
| | | break; |
| | | } |
| | | //è®¾ç½®è¡¨æ ¼title屿§æ¾ç¤ºå«å |
| | | if (dataCols[4] != null && dataCols[4] != "") { |
| | | option.cols[0][i + 1]["title"] = dataCols[4]; |
| | | } |
| | | |
| | | newCols[0].push(option.cols[0][i + 1]); |
| | | } |
| | | } |
| | | } |
| | | //éå循ç¯å夿坹åºåæ°æ¯å¦ä¸è´ |
| | | if (dataCol.length == newCols[0].length - 1) { |
| | | option.cols = newCols; |
| | | //åæ¶å»ç»å |
| | | for (var i = 1; i < option.cols[0].length - 1; i++) { |
| | | if (option.cols[0][i]["fixed"] != null) { |
| | |
| | | option.cols[0][i + 1]["fixed"] = "left"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | table.render(option); |
| | | ins = table.render(option); |
| | | } else { |
| | | table.render(option); |
| | | ins = table.render(option); |
| | | } |
| | | |
| | | //å·æ°æé®æ¾ç¤º |
| | | var btns = document.getElementsByTagName("button"); //è·åæ¬é¡µæææé®å¯¹è±¡ |
| | | Display_HideButton(btns, HBillType, HModName, HMaker); |
| | | |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }) |
| | | } |
| | | //#endregion |
| | | |
| | | |
| | | //#endregion |
| | | |
| | |
| | | var colName = ""; |
| | | var contentUrl = ""; |
| | | for (var i = 1; i < option.cols[0].length; i++) { |
| | | colName += option.cols[0][i]["title"] + ","; |
| | | colName += option.cols[0][i]["field"] + ","; |
| | | } |
| | | var urlStr = window.document.location.pathname;//è·åæä»¶è·¯å¾ |
| | | var urlLen = urlStr.split('/'); |
| | |
| | | } |
| | | colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI è¿è¡ç¼ç |
| | | |
| | | contentUrl += 'åºç¡èµæ/éèå设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName; |
| | | contentUrl += 'åºç¡èµæ/éèå设置/Gy_GridView_Hide_New.html?HModName=' + HModName + '&colName=' + colName; |
| | | |
| | | layer.open({ |
| | | type: 2 |
| | |
| | | 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>'; |
| | | Organization += '<option style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].title + '</option>'; |
| | | } |
| | | } |
| | | $("#ColName").empty(); |
| | |
| | | }) |
| | | //#endregion |
| | | |
| | | table.on('sort(mainTable)', function (obj) { //注ï¼sort æ¯å·¥å
·æ¡äºä»¶åï¼test æ¯ table åå§å®¹å¨ç屿§ lay-filter="对åºçå¼" |
| | | table.reload('mainTable', { |
| | | initSort: obj //è®°å½åå§æåºï¼å¦æä¸è®¾çè¯ï¼å°æ æ³æ 记表头çæåºç¶æã layui 2.1.1 æ°å¢åæ° |
| | | , where: { //请æ±åæ°ï¼æ³¨æï¼è¿éé¢çåæ°å¯ä»»æå®ä¹ï¼å¹¶éä¸é¢åºå®çæ ¼å¼ï¼ |
| | | field: obj.field //æåºå段 卿¥å£ä½ä¸ºåæ°å段 field order |
| | | , order: obj.type //æåºæ¹å¼ 卿¥å£ä½ä¸ºåæ°å段 field order |
| | | } |
| | | }); |
| | | option.data = layui.table.cache["mainTable"]; |
| | | table.render(option); |
| | | //å·æ°æé®æ¾ç¤º |
| | | var btns = document.getElementsByTagName("button"); //è·åæ¬é¡µæææé®å¯¹è±¡ |
| | | Display_HideButton(btns, HBillType, HModName, HMaker); |
| | | }); |
| | | |
| | | ////#region æ¾ç¤ºåæ°æ® |
| | | //function DisPlay_HideColumn() { |
| | | // $.ajax({ |
| | | // type: "GET", |
| | | // url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', |
| | | // async: false, |
| | | // data: { "HModName": HModName, "user": HMaker }, |
| | | // success: function (data1) { |
| | | // if (data1.data.length != 0) { |
| | | // var dataCol = [];//æ°æ®åºæ¥è¯¢åºçåæ°æ® |
| | | // dataCol = data1.data[0].HGridString.split(','); |
| | | |
| | | // for (var i = 0; i < option.cols[0].length - 2; i++) { |
| | | // if (dataCol[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 (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); |
| | | // ins = table.render(option); |
| | | // } else { |
| | | // table.render(option); |
| | | // ins = table.render(option); |
| | | // } |
| | | |
| | | // //å·æ°æé®æ¾ç¤º |
| | | // var btns = document.getElementsByTagName("button"); //è·åæ¬é¡µæææé®å¯¹è±¡ |
| | | // Display_HideButton(btns, HBillType, HModName, HMaker); |
| | | |
| | | // }, error: function () { |
| | | // layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | // } |
| | | // }) |
| | | //} |
| | | ////#endregion |
| | | |
| | | //#region æ¾ç¤ºåæ°æ® |
| | | function DisPlay_HideColumn() { |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "HModName": HModName, "user": HMaker }, |
| | | data: { "HModName": HModName, "user": sessionStorage["HUserName"] }, |
| | | success: function (data1) { |
| | | if (data1.data.length != 0) { |
| | | var dataCol = [];//æ°æ®åºæ¥è¯¢åºçåæ°æ® |
| | | dataCol = data1.data[0].HGridString.split(','); |
| | | |
| | | for (var i = 0; i < option.cols[0].length - 2; i++) { |
| | | if (dataCol[i]) { |
| | | var dataCols = dataCol[i].split('|'); |
| | | } |
| | | var dataCol = [];//æ°æ®åºæ¥è¯¢åºçåæ°æ® |
| | | var newCols = [[]];//å¯¹åºæ°æ®åºå顺åºcol |
| | | newCols[0].push(option.cols[0][0]);//æ¾å
¥ç¬¬ä¸ä¸ªcheckbox |
| | | dataCol = data1.data[0].HGridString.split(','); |
| | | //åè®¾ç½®åæ°ä¸é¡µé¢åæ°æ¯å¦ä¸è´ |
| | | if (dataCol.length == option.cols[0].length - 1) { |
| | | //éå寻æ¾å设置对åºåæé¡ºåºæå
¥ |
| | | for (var j = 0; j < option.cols[0].length - 1; j++) { |
| | | for (var i = 0; i < option.cols[0].length - 1; i++) { |
| | | var dataCols = dataCol[j].split('|'); |
| | | //éæ©ä¸datacolsç¸åºåè¿è¡ä¿®æ¹ |
| | | if (option.cols[0][i + 1]["field"] == dataCols[5]) { |
| | | //éèå |
| | | if (dataCols[1] == 1) { |
| | | option.cols[0][i + 1]["hide"] = true; |
| | |
| | | if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) { |
| | | option.cols[0][i + 1]["hide"] = false; |
| | | } |
| | | //ç»è®¡å |
| | | if (dataCols[6] == 1) { |
| | | option.cols[0][i + 1]["totalRow"] = true; |
| | | } |
| | | //å使å¨ä½ç½®(å·¦ å±
ä¸ å³) |
| | | switch (dataCols[2]) { |
| | | case "L": |
| | |
| | | option.cols[0][i + 1]["align"] = "right"; |
| | | break; |
| | | } |
| | | //è®¾ç½®è¡¨æ ¼title屿§æ¾ç¤ºå«å |
| | | if (dataCols[4] != null && dataCols[4] != "") { |
| | | option.cols[0][i + 1]["title"] = dataCols[4]; |
| | | } |
| | | |
| | | newCols[0].push(option.cols[0][i + 1]); |
| | | } |
| | | } |
| | | } |
| | | //éå循ç¯å夿坹åºåæ°æ¯å¦ä¸è´ |
| | | if (dataCol.length == newCols[0].length - 1) { |
| | | option.cols = newCols; |
| | | //åæ¶å»ç»å |
| | | for (var i = 1; i < option.cols[0].length - 1; i++) { |
| | | if (option.cols[0][i]["fixed"] != null) { |
| | |
| | | option.cols[0][i + 1]["fixed"] = "left"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | table.render(option); |
| | | ins = table.render(option); |
| | | |
| | | } else { |
| | | table.render(option); |
| | | ins = table.render(option); |
| | | } |
| | | |
| | | } |
| | | //å·æ°æé®æ¾ç¤º |
| | | var btns = document.getElementsByTagName("button"); //è·åæ¬é¡µæææé®å¯¹è±¡ |
| | | Display_HideButton(btns, HBillType, HModName, HMaker); |
| | | |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | |
| | | } |
| | | colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI è¿è¡ç¼ç |
| | | |
| | | contentUrl += 'åºç¡èµæ/éèå设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName; |
| | | contentUrl += 'åºç¡èµæ/éèå设置/Gy_GridView_Hide_New.html?HModName=' + HModName + '&colName=' + colName; |
| | | |
| | | layer.open({ |
| | | type: 2 |
| | |
| | | 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 }); |
| | | 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 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 }); |
| | |
| | | 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 }); |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 140 }); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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>'; |
| | | Organization += '<option style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].title + '</option>'; |
| | | } |
| | | } |
| | | $("#ColName").empty(); |
| | |
| | | //éèå设置 |
| | | function get_HideColumn() { |
| | | var colName = ""; |
| | | for (var i = 1; i < option.cols[0].length - 1; i++) { |
| | | colName += option.cols[0][i]["title"] + ","; |
| | | for (var i = 1; i < option.cols[0].length; i++) { |
| | | colName += option.cols[0][i]["field"] + ","; |
| | | } |
| | | |
| | | colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI è¿è¡ç¼ç |
| | |
| | | , shift: 2 //å¼¹åºå¨ç» |
| | | , area: ["50%", "90%"] //çªä½å¤§å° |
| | | , maxmin: true //设置æå¤§æå°æé®æ¯å¦æ¾ç¤º |
| | | , content: ['../../åºç¡èµæ/éèå设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "yes"] |
| | | , content: ['../../åºç¡èµæ/éèå设置/Gy_GridView_Hide_New.html?HModName=' + HModName + '&colName=' + colName, "yes"] |
| | | , btn: ["ç¡®å®", "åæ¶"] |
| | | , btn1: function (index, laero) { |
| | | //å·æ°è¡¨æ ¼æ°æ® |
| | |
| | | } |
| | | |
| | | //æ¾ç¤ºåæ°æ® |
| | | //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 = [];//æ°æ®åºæ¥è¯¢åºçåæ°æ® |
| | | |
| | | |
| | | // 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); |
| | | // } |
| | | |
| | | // //å·æ°æé®æ¾ç¤º |
| | | // var btns = document.getElementsByTagName("button"); //è·åæ¬é¡µæææé®å¯¹è±¡ |
| | | // var HBillType = "æ¡ç 主档"; |
| | | // Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]); |
| | | |
| | | // }, error: function () { |
| | | // layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | // } |
| | | // }) |
| | | //} |
| | | |
| | | //#region æ¾ç¤ºåæ°æ® |
| | | function DisPlay_HideColumn() { |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "HModName": HModName, "user": sessionStorage["HUserName"] }, |
| | | success: function (data1) { |
| | | if (data1.data.length != 0) { |
| | | |
| | | |
| | | var dataCol = [];//æ°æ®åºæ¥è¯¢åºçåæ°æ® |
| | | |
| | | |
| | | var newCols = [[]];//å¯¹åºæ°æ®åºå顺åºcol |
| | | newCols[0].push(option.cols[0][0]);//æ¾å
¥ç¬¬ä¸ä¸ªcheckbox |
| | | dataCol = data1.data[0].HGridString.split(','); |
| | | |
| | | for (var i = 0; i < option.cols[0].length - 2; i++) { |
| | | var dataCols = dataCol[i].split('|'); |
| | | //åè®¾ç½®åæ°ä¸é¡µé¢åæ°æ¯å¦ä¸è´ |
| | | if (dataCol.length == option.cols[0].length - 1) { |
| | | //éå寻æ¾å设置对åºåæé¡ºåºæå
¥ |
| | | for (var j = 0; j < option.cols[0].length - 1; j++) { |
| | | for (var i = 0; i < option.cols[0].length - 1; i++) { |
| | | var dataCols = dataCol[j].split('|'); |
| | | //éæ©ä¸datacolsç¸åºåè¿è¡ä¿®æ¹ |
| | | if (option.cols[0][i + 1]["field"] == dataCols[5]) { |
| | | //éèå |
| | | if (dataCols[1] == 1) { |
| | | option.cols[0][i + 1]["hide"] = true; |
| | |
| | | } 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; |
| | | } |
| | | //ç»è®¡å |
| | | if (dataCols[6] == 1) { |
| | | option.cols[0][i + 1]["totalRow"] = true; |
| | | } |
| | | //å使å¨ä½ç½®(å·¦ å±
ä¸ å³) |
| | | switch (dataCols[2]) { |
| | |
| | | option.cols[0][i + 1]["align"] = "right"; |
| | | break; |
| | | } |
| | | //è®¾ç½®è¡¨æ ¼title屿§æ¾ç¤ºå«å |
| | | if (dataCols[4] != null && dataCols[4] != "") { |
| | | option.cols[0][i + 1]["title"] = dataCols[4]; |
| | | } |
| | | |
| | | newCols[0].push(option.cols[0][i + 1]); |
| | | } |
| | | } |
| | | } |
| | | //éå循ç¯å夿坹åºåæ°æ¯å¦ä¸è´ |
| | | if (dataCol.length == newCols[0].length - 1) { |
| | | option.cols = newCols; |
| | | //åæ¶å»ç»å |
| | | for (var i = 1; i < option.cols[0].length - 1; i++) { |
| | | if (option.cols[0][i]["fixed"] != null) { |
| | |
| | | option.cols[0][i + 1]["fixed"] = "left"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | table.render(option); |
| | | |
| | | } else { |
| | | table.render(option); |
| | | } |
| | | |
| | | } |
| | | //å·æ°æé®æ¾ç¤º |
| | | var btns = document.getElementsByTagName("button"); //è·åæ¬é¡µæææé®å¯¹è±¡ |
| | | var HBillType = "æ¡ç 主档"; |
| | | Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]); |
| | | |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }) |
| | | } |
| | | //#endregion |
| | | |
| | | //#region 导åºExecel |
| | | function get_Export() { |
| | |
| | | var colName = ""; |
| | | var contentUrl = ""; |
| | | for (var i = 1; i < option.cols[0].length; i++) { |
| | | colName += option.cols[0][i]["title"] + ","; |
| | | colName += option.cols[0][i]["field"] + ","; |
| | | } |
| | | var urlStr = window.document.location.pathname;//è·åæä»¶è·¯å¾ |
| | | var urlLen = urlStr.split('/'); |
| | |
| | | } |
| | | colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI è¿è¡ç¼ç |
| | | |
| | | contentUrl += 'åºç¡èµæ/éèå设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName; |
| | | contentUrl += 'åºç¡èµæ/éèå设置/Gy_GridView_Hide_New.html?HModName=' + HModName + '&colName=' + colName; |
| | | |
| | | layer.open({ |
| | | type: 2 |
| | |
| | | } |
| | | //#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", "æºå主å
ç ", "æºååå
ç "];//ä¸éè¦æ¾ç¤ºçåæ®µ 坿©å± |
| | | // //ä¸éè¦æ¾ç¤ºçåæ®µ 坿©å± |
| | | // var titleData = ["hmainid", "hentryid", "HEntryID", "HSourceID", "HMaterID", "HFirstCheckEmp", "HQCCheckItemID", "HUnitID", "HSampleSchemeID"]; |
| | | // dataCol = data1.data[0].HGridString.split(','); |
| | | |
| | | // for (var i = 0; i < option.cols[0].length - 1; i++) { |
| | | // if (dataCol[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); |
| | | // } |
| | | |
| | | // //å·æ°æé®æ¾ç¤º |
| | | // var btns = document.getElementsByTagName("button"); //è·åæ¬é¡µæææé®å¯¹è±¡ |
| | | // var HBillType = "7507"; |
| | | // Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]); |
| | | // }, error: function () { |
| | | // layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | // } |
| | | // }) |
| | | //} |
| | | //#endregion |
| | | |
| | | //#region æ¾ç¤ºåæ°æ® |
| | | function DisPlay_HideColumn() { |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "HModName": HModName, "user": sessionStorage["HUserName"] }, |
| | | success: function (data1) { |
| | | if (data1.data.length != 0) { |
| | | |
| | | var dataCol = [];//æ°æ®åºæ¥è¯¢åºçåæ°æ® |
| | | //var titleData = ["åæ®ID", "HMouldID", "hsubid", "HManagerID", "æºå主å
ç ", "æºååå
ç "];//ä¸éè¦æ¾ç¤ºçåæ®µ 坿©å± |
| | | //ä¸éè¦æ¾ç¤ºçåæ®µ 坿©å± |
| | | var titleData = ["hmainid", "hentryid", "HEntryID", "HSourceID", "HMaterID", "HFirstCheckEmp", "HQCCheckItemID", "HUnitID", "HSampleSchemeID"]; |
| | | var newCols = [[]];//å¯¹åºæ°æ®åºå顺åºcol |
| | | newCols[0].push(option.cols[0][0]);//æ¾å
¥ç¬¬ä¸ä¸ªcheckbox |
| | | dataCol = data1.data[0].HGridString.split(','); |
| | | |
| | | //åè®¾ç½®åæ°ä¸é¡µé¢åæ°æ¯å¦ä¸è´ |
| | | if (dataCol.length == option.cols[0].length - 1) { |
| | | //éå寻æ¾å设置对åºåæé¡ºåºæå
¥ |
| | | for (var j = 0; j < option.cols[0].length - 1; j++) { |
| | | for (var i = 0; i < option.cols[0].length - 1; i++) { |
| | | if (dataCol[i]) { |
| | | var dataCols = dataCol[i].split('|'); |
| | | } |
| | | var dataCols = dataCol[j].split('|'); |
| | | //éæ©ä¸datacolsç¸åºåè¿è¡ä¿®æ¹ |
| | | if (option.cols[0][i + 1]["field"] == dataCols[5]) { |
| | | //éèå |
| | | if (dataCols[1] == 1) { |
| | | option.cols[0][i + 1]["hide"] = true; |
| | |
| | | } 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; |
| | | } |
| | | //ç»è®¡å |
| | | if (dataCols[6] == 1) { |
| | | option.cols[0][i + 1]["totalRow"] = true; |
| | | } |
| | | //å使å¨ä½ç½®(å·¦ å±
ä¸ å³) |
| | | switch (dataCols[2]) { |
| | |
| | | option.cols[0][i + 1]["align"] = "right"; |
| | | break; |
| | | } |
| | | //è®¾ç½®è¡¨æ ¼title屿§æ¾ç¤ºå«å |
| | | if (dataCols[4] != null && dataCols[4] != "") { |
| | | option.cols[0][i + 1]["title"] = dataCols[4]; |
| | | } |
| | | |
| | | newCols[0].push(option.cols[0][i + 1]); |
| | | } |
| | | } |
| | | } |
| | | //éå循ç¯å夿坹åºåæ°æ¯å¦ä¸è´ |
| | | if (dataCol.length == newCols[0].length - 1) { |
| | | option.cols = newCols; |
| | | //åæ¶å»ç»å |
| | | for (var i = 1; i < option.cols[0].length - 1; i++) { |
| | | if (option.cols[0][i]["fixed"] != null) { |
| | |
| | | option.cols[0][i + 1]["fixed"] = "left"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | table.render(option); |
| | | |
| | | } else { |
| | | table.render(option); |
| | | } |
| | | |
| | | } |
| | | //å·æ°æé®æ¾ç¤º |
| | | var btns = document.getElementsByTagName("button"); //è·åæ¬é¡µæææé®å¯¹è±¡ |
| | | var HBillType = "7507"; |
| | |
| | | }) |
| | | } |
| | | //#endregion |
| | | |
| | | |
| | | //#region ä»»æåæ®µè¿æ»¤ï¼ååæ¾ç¤ºä¸ææ¡ |
| | | function ColFilter() { |
| | |
| | | |
| | | for (var i = 1; i < option.cols[0].length; i++) { |
| | | if (option.cols[0][i].hide != true && option.cols[0][i].field != HSelectedVal) { |
| | | Organization += '<option style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>'; |
| | | Organization += '<option style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].title + '</option>'; |
| | | } |
| | | } |
| | | $("#ColName1").empty(); |
| | |
| | | //å
³éå½åframe |
| | | layer.close(index); |
| | | //ä¿®æ¹ä¸ºååå·æ°çé¢ |
| | | window.location.reload(); |
| | | $("#btnSearch").trigger('click'); |
| | | }); |
| | | |
| | | } else { |