| | |
| | | <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-normal">æ®éæ¡ç </button>--> |
| | | <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-box">å
å¤ç®±æ¡ç </button>--> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-add"><i class="layui-icon layui-icon-addition"></i>æå</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_HideColumn"><i class="layui-icon layui-icon-addition"></i>å设置</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-del"><i class="layui-icon layui-icon-subtraction"></i>å è¡</button> |
| | | </div> |
| | | </script> |
| | | </div> |
| | |
| | | <script src="../../layuiadmin/Scripts/general.js"></script> |
| | | <!--<script src="../../../../Scripts/jquery-1.8.2.js"></script>--> |
| | | <script> |
| | | var HModName = "SRM_BarCodeBill"; |
| | | function f_alert(sMsg) { |
| | | layer.alert(sMsg, { icon: 5 }); |
| | | //layer.open({ |
| | |
| | | // } |
| | | //}); |
| | | } |
| | | |
| | | var option = { |
| | | cols: [[ |
| | | { type: 'checkbox', fixed: 'left' } |
| | | , { field: 'HMaterID', title: 'ç©æID', width: 100, hide: true } |
| | | , { field: 'HMaterNumber', title: 'ç©æç¼ç ', width: 120 } |
| | | , { field: 'HOldMaterNumber', title: 'æ§ç©æç¼ç ', width: 120, hide: true } |
| | | , { field: 'HMaterShortNumber', title: 'ç©æä»£ç ', width: 120, hide: true } |
| | | , { field: 'HSubjoin', title: 'ç©æä»£ç ', width: 120, hide: true } |
| | | , { field: 'HMaterName', title: 'ç©æåç§°', width: 120 } |
| | | , { field: 'HMaterModel', title: 'è§æ ¼åå·', width: 120 } |
| | | , { field: 'HUnitName', title: '计éåä½', width: 100 } |
| | | , { field: 'HUnitNumber', title: '计éåä½ä»£ç ', width: 100, hide: true } |
| | | , { field: 'HUnitID', title: '计éåä½ID', width: 100, hide: true } |
| | | , { field: 'HDDQty', title: 'è®¢åæ°é', width: 100 } |
| | | , { field: 'HMrbQty', title: 'éææ°é', width: 100, hide: true } |
| | | , { field: 'HBarcodeCount', title: 'å·²çææ¡ç æ°é', width: 135 } |
| | | , { field: 'HNotBarcodeCount', title: 'å¯çææ¡ç æ°é', width: 135 } |
| | | , { field: 'HQty', title: 'æ¬æ¬¡çææ¡ç æ°é', width: 135, edit: 'text', event: "inputHQty" } |
| | | , { field: 'HMinQty', title: 'å
ç®±è£
ç®±æ°', width: 100, edit: 'text', event: "inputHMinQty" } |
| | | , { field: 'HBQty', title: 'å
ç®±æ°', width: 100 } |
| | | , { field: 'HWXQty', title: 'å¤ç®±è£
ç®±æ°', width: 100, edit: 'text', event: "inputHWXQty" } |
| | | , { field: 'HWBQty', title: 'å¤ç®±æ°', width: 100 } |
| | | , { field: 'HPrice', title: 'åä»·', width: 100, hide: true } |
| | | , { field: 'HMoney', title: 'éé¢', width: 100, hide: true } |
| | | , { field: 'HMTONO', title: '计åè·è¸ªåå·', width: 100, hide: true } |
| | | , { field: 'HBatchNo', title: 'æ¹å·', width: 100, edit: 'text' } |
| | | , { field: 'HBatchManager', title: 'å¯ç¨æ¹å·', width: 100, hide: true } |
| | | , { field: 'HISKFPERIOD', title: 'æ¯å¦å¯ç¨ä¿è´¨æ', width: 100, edit: 'text', hide: true } |
| | | , { field: 'HEXPUNIT', title: 'ä¿è´¨æåä½', width: 100, edit: 'text', hide: true } |
| | | , { field: 'HKFDate', title: 'çäº§æ¥æ', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }//, event: "chooseHKFDate" |
| | | , { field: 'HKFPeriod', title: 'ä¿è´¨æ', width: 100 }// |
| | | , { field: 'HKFDQDate', title: 'å°ææ¥æ', align: 'center', width: 150, data_field: 'HKFDQDate' }//, event: "chooseHKFDQDate" |
| | | , { field: 'HSupMaterNumber', title: 'ä¾åºåæå·', width: 100, edit: 'text' } |
| | | , { field: 'HSupBatchNo', title: 'ä¾åºåæ¹æ¬¡', width: 100, edit: 'text' } |
| | | //, { field: 'HBeginDate', title: 'çäº§æ¥æ', width: 120, data_field: 'HBeginDate', event: "chooseHBeginDate" } |
| | | //, { field: 'HEndDate', title: 'å¤±ææ¥æ', width: 120, data_field: 'HEndDate', event: "chooseHEndDate" } |
| | | //, { field: 'HDate', title: 'è¦æ±äº¤è´§æ¥æ', width: 150 } |
| | | , { field: 'HPOOrderInterID', title: 'éè´è®¢å主å
ç ', width: 150, hide: true } |
| | | , { field: 'HPOOrderEntryID', title: 'éè´è®¢ååå
ç ', width: 150, hide: true } |
| | | , { field: 'HPOOrderBillNo', title: 'éè´è®¢åå·', width: 200 } |
| | | , { field: 'HWWOrderInterID', title: 'å§å¤è®¢å主å
ç ', width: 150, hide: true } |
| | | , { field: 'HWWOrderEntryID', title: 'å§å¤è®¢ååå
ç ', width: 150, hide: true } |
| | | , { field: 'HWWOrderDetaiLID ', title: 'å§å¤è®¢åæç»å
ç ', width: 150, hide: true } |
| | | , { field: 'HWWOrderBillNo', title: 'å§å¤è®¢ååå·', width: 200, hide: true } |
| | | , { field: 'HSourceBillType', title: 'æºåç±»å', width: 100 } |
| | | , { field: 'HSourceBillNo', title: 'æºååå·', width: 200 } |
| | | , { field: 'HSourceEntryID', title: 'æºååå
ç ', width: 150, hide: true } |
| | | , { field: 'HSourceInterID', title: 'æºå主å
ç ', width: 150, hide: true } |
| | | , { field: 'HSupID', title: 'ä¾åºåID', width: 150, hide: true } |
| | | , { field: 'HSupName', title: 'ä¾åºååç§°', width: 150, hide: true } |
| | | , { field: 'HIsSplit', title: 'æ¯å¦æå', width: 150, hide: true } //0å¦ï¼1æ¯ |
| | | ]] |
| | | }; |
| | | function isPositiveIntegerTimes(x, y) { |
| | | if (x > y) { |
| | | var flag = x; |
| | |
| | | , where: { sMsg: linterid } |
| | | , cols: [[ |
| | | // , { field: 'HMTONO', title: '计åè·è¸ªåå·', width: 100, sort: true, fixed: true edit: 'text', hide: true } |
| | | , { field: 'HItemID', title: 'HItemID', width: 100, hide: true } |
| | | { field: 'HItemID', title: 'HItemID', width: 100, hide: true } |
| | | , { field: 'HMaterID', title: 'ç©æID', width: 100, hide: true } |
| | | , { field: 'HMaterNumber', title: 'ç©æä»£ç ', width: 200 } |
| | | , { field: 'HMaterName', title: 'ç©æåç§°', width: 200 } |
| | |
| | | //} |
| | | } |
| | | }); |
| | | |
| | | //è¿å
¥é¡µé¢æ¥è¯¢è¡¨ä½ç©æä¿¡æ¯ |
| | | layer.load(3) |
| | | table.render({ |
| | |
| | | , { field: 'HBarcodeCount', title: 'å·²çææ¡ç æ°é', width: 135 } |
| | | , { field: 'HNotBarcodeCount', title: 'å¯çææ¡ç æ°é', width: 135 } |
| | | , { field: 'HQty', title: 'æ¬æ¬¡çææ¡ç æ°é', width: 135, edit: 'text', event: "inputHQty" } |
| | | , { field: 'HMinQty', title: 'å
ç®±å
è£
æ°', width: 100, edit: 'text', event: "inputHMinQty" } |
| | | , { field: 'HMinQty', title: 'å
ç®±è£
ç®±æ°', width: 100, edit: 'text', event: "inputHMinQty" } |
| | | , { field: 'HBQty', title: 'å
ç®±æ°', width: 100 } |
| | | , { field: 'HWXQty', title: 'å¤ç®±å
è£
æ°', width: 100, edit: 'text', event: "inputHWXQty" } |
| | | , { field: 'HWXQty', title: 'å¤ç®±è£
ç®±æ°', width: 100, edit: 'text', event: "inputHWXQty" } |
| | | , { field: 'HWBQty', title: 'å¤ç®±æ°', width: 100 } |
| | | , { field: 'HPrice', title: 'åä»·', width: 100, hide: true } |
| | | , { field: 'HMoney', title: 'éé¢', width: 100, hide: true } |
| | |
| | | , { field: 'HSupID', title: 'ä¾åºåID', width: 150, hide: true } |
| | | , { field: 'HSupName', title: 'ä¾åºååç§°', width: 150, hide: true } |
| | | , { field: 'HIsSplit', title: 'æ¯å¦æå', width: 150, hide: true } //0å¦ï¼1æ¯ |
| | | |
| | | ]] |
| | | , done: function (res, curr, count) { |
| | | layer.closeAll("loading"); |
| | | } |
| | | }, |
| | | }); |
| | | |
| | | //头工å
·æ äºä»¶ |
| | | table.on('toolbar(mainTable)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | |
| | | }); |
| | | } |
| | | break; |
| | | case "btn-del": |
| | | var oldData = table.cache["mainTable"]; |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | |
| | | |
| | | var rows = ''; |
| | | for (var i = 0; i < data.length; i++) { |
| | | rows += data[i].HMaterID.toString() + ','; |
| | | } |
| | | rows = rows.substring(rows.length - 1, 0); |
| | | if (rows == "") { |
| | | layer.msg("è³å°éæ©ä¸è¡è®°å½ï¼") |
| | | |
| | | } |
| | | else { |
| | | layer.confirm('æ¯å¦ç¡®è®¤?', { icon: 3, title: 'æç¤º' }, function (index) { |
| | | |
| | | for (var i = 0; i < data.length; i++) { |
| | | for (var j = 0; j < oldData.length; j++) { |
| | | if (data[i].sorderid == oldData[j].sorderid) { |
| | | oldData.splice(j, 1); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | table.reload('mainTable', { |
| | | data: oldData |
| | | }); |
| | | layer.close(index); |
| | | }); |
| | | } |
| | | break; |
| | | case 'btn_HideColumn': |
| | | //éèå设置 |
| | | get_HideColumn(); |
| | | break; |
| | | //èªå®ä¹å¤´å·¥å
·æ |
| | | case 'btn-normal': |
| | | table.render({ |
| | |
| | | } |
| | | }); |
| | | break; |
| | | |
| | | |
| | | }; |
| | | }); |
| | | //çå¬è¡å·¥å
·äºä»¶ |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | //æ¾ç¤ºåæ°æ® |
| | | //éèå设置 |
| | | function get_HideColumn() { |
| | | var colName = ""; |
| | | for (var i = 1; i < option.cols[0].length - 1; i++) { |
| | | colName += option.cols[0][i]["title"] + ","; |
| | | } |
| | | |
| | | colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI è¿è¡ç¼ç |
| | | layer.open({ |
| | | type: 2 |
| | | , skin: "layui-layer-rim" //å ä¸è¾¹æ¡ |
| | | , title: "éèå设置" //æ é¢ |
| | | , closeBtn: 1 //çªä½å³ä¸è§å
³é ç æ ·å¼ |
| | | , shift: 2 //å¼¹åºå¨ç» |
| | | , area: ["50%", "90%"] //çªä½å¤§å° |
| | | , maxmin: true //设置æå¤§æå°æé®æ¯å¦æ¾ç¤º |
| | | , content: ['../åºç¡èµæ/éèå设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "yes"] |
| | | , btn: ["ç¡®å®", "åæ¶"] |
| | | , btn1: function (index, laero) { |
| | | //å·æ°è¡¨æ ¼æ°æ® |
| | | DisPlay_HideColumn(); |
| | | //æ´æ°è¡¨æ ¼ç¼åçæ°æ® |
| | | layer.close(index);//å
³éå¼¹çª |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //æ¾ç¤ºåæ°æ® |
| | | 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 < dataCol.length; i++) { |
| | | var dataCols = dataCol[i].split('|'); |
| | | //éèå |
| | | 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; |
| | | } |
| | | //éèid |
| | | //设置å宽 |
| | | if (dataCols[3] > 0) { |
| | | if (option.cols[0][i + 1]["field"] == 'ä¾åºå交æåå¤') { |
| | | option.cols[0][i + 1]["width"] = 120; |
| | | } else { |
| | | 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"] = ""; |
| | | //} |
| | | |
| | | //å使å¨ä½ç½®(å·¦ å±
ä¸ å³) |
| | | 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 }); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | table.on('edit(mainTable)', function (obj) { //注ï¼editæ¯åºå®äºä»¶åï¼testæ¯tableåå§å®¹å¨ç屿§ lay-filter="对åºçå¼" |
| | | var value = obj.value //å¾å°ä¿®æ¹åçå¼ |
| | | , data = obj.data //å¾å°æå¨è¡ææé®å¼ |