| | |
| | | <script src="../../../layuiadmin/Scripts/webConfig.js"></script> |
| | | <script src="../../../layuiadmin/PubCustom.js"></script> |
| | | <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script> |
| | | <script src="../../../layuiadmin/soulTable.slim.js"></script> |
| | | |
| | | </head> |
| | | <body> |
| | |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></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-inline"> |
| | | <label class="layui-form-label">åæ®å·</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HBillno2" id="HBillno2" style="width:190px;"> |
| | | </div> |
| | | </div> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnResCnz" id="btnReSearch" style="padding:0 5px">鿰忥</button> |
| | | |
| | | <div class="layui-colla-content"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">é¨é¨</label> |
| | |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></i>é¢è§</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></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> |
| | |
| | | base: '../../../layuiadmin/' //éæèµæºæå¨è·¯å¾ |
| | | }).extend({ |
| | | index: 'lib/index', //主å
¥å£æ¨¡å |
| | | }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () { |
| | | }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate','soulTable'], function () { |
| | | |
| | | //#region å
Œ
±åé |
| | | var $ = layui.$ |
| | |
| | | , element = layui.element |
| | | , laypage = layui.laypage |
| | | , laydate = layui.laydate |
| | | , soulTable = layui.soulTable |
| | | var sWhere = ""; |
| | | var option = []; |
| | | var HModName = "Sc_PPBomBillList"; |
| | | //#endregion |
| | | |
| | | //#region åå§åçé¢ |
| | | set_ClearBill(); |
| | | DisPlay_HideColumn(); |
| | | //#endregion |
| | | |
| | | //#region 触åäºä»¶ï¼å
æ¬form.on(){}æ ¼å¼çææç¹å»äºä»¶ãéæ©äºä»¶ç |
| | |
| | | set_ClearQuery(); |
| | | }); |
| | | |
| | | //鿰忥æé® |
| | | form.on('submit(btnResCnz)', function (data) { |
| | | set_ResCnz(); |
| | | }); |
| | | |
| | | //头工å
·æ äºä»¶ |
| | | table.on("toolbar(mainTable)", function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id);//è·åéä¸è¡ æ°æ® |
| | |
| | | //åå®¡æ ¸ |
| | | case "btn-DeAudit": set_DeAuditBill(); |
| | | break; |
| | | //æå° |
| | | case 'btn-print': |
| | | get_PrintReport(); |
| | | break; |
| | | //å设置 |
| | | case 'set_HideColumn': |
| | | get_HideColumn(); |
| | | break; |
| | | default: |
| | | break; |
| | | case 'btn-Add': |
| | | //页é¢å±-èªå®ä¹ |
| | | layer.open({ |
| | | type: 2, |
| | | skin: 'layui-layer-rim', //å ä¸è¾¹æ¡ |
| | | title: 'æ°å¢çäº§ç¨æå', |
| | | closeBtn: 1, |
| | | shift: 2, |
| | | area: ['100%', '100%'], |
| | | maxmin: true, |
| | | content: './Sc_PPBomBill.html?OperationType=1&linterid=0&HSouceBillType=0&closeType=1', |
| | | end: function () { |
| | | //å·æ°é¡µé¢, |
| | | location.reload(); |
| | | }, |
| | | success: function (layero, index) { |
| | | |
| | | } |
| | | }); |
| | | break; |
| | | case 'btn-Edit': |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | if (checkStatus.data.length === 1) { |
| | | var hID = data[0].hmainid.toString(); |
| | | //if (AllowLoadData(sSubStr) != false) {//é空éªè¯ |
| | | layer.open({ |
| | | type: 2 |
| | | , area: ['100%', '100%'] |
| | | , title: 'ç¼è¾æ¶æéç¥å' |
| | | , closeBtn: 1 |
| | | , shade: 0.6 //é®ç½©éæåº¦ |
| | | , maxmin: true //å
许å
¨å±æå°å |
| | | , anim: 0 //0-6çå¨ç»å½¢å¼ï¼-1ä¸å¼å¯ |
| | | , content: '../../éè´ç®¡ç/æ¶æéç¥å/Add_Edit_Cg_POInStockBillList.html?OperationType=3&linterid=' + hID + '&HSouceBillType=0&closeType=1' |
| | | , resize: false, |
| | | end: function () { |
| | | //å·æ°é¡µé¢, |
| | | location.reload(); |
| | | } |
| | | , cancel: function () { |
| | | //$(".layui-btn").removeClass("layui-btn-disabled"); |
| | | } |
| | | }) |
| | | |
| | | } else { |
| | | layer.msg('è¯·éæ©ä¸è¡æ°æ®ç¼è¾ï¼'); |
| | | } |
| | | break; |
| | | case 'btn-Delete': |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | if (checkStatus.data.length === 1) { |
| | | var InterID = data[0].hmainid.toString(); |
| | | //é»è¾å 餿¹æ³ |
| | | layer.confirm("确认è¦å é¤åï¼å é¤åä¸è½æ¢å¤", { title: "å é¤ç¡®è®¤" }, function (index) { |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "Sc_PPBomBill/DeltetPPBomBillBill", //æ¹æ³æå¨é¡µé¢åæ¹æ³å |
| | | data: { "HInterID": InterID }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () { |
| | | // å¾å°frameç´¢å¼ |
| | | var index = layer.getFrameIndex(window.name); |
| | | //å
³éå½åframe |
| | | layer.close(index); |
| | | //ä¿®æ¹ä¸ºååå·æ°çé¢ |
| | | window.location.reload(); |
| | | }); |
| | | |
| | | } else { |
| | | layer.alert(result.code + result.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | }) |
| | | } |
| | | else { |
| | | layer.msg('è¯·éæ©ä¸è¡æ°æ®å é¤ï¼'); |
| | | } |
| | | break; |
| | | } |
| | | }) |
| | |
| | | , height: 'full-50' |
| | | , page: true |
| | | , cellMinWidth: 90 |
| | | , totalRow: true |
| | | , limit: 50 |
| | | , limits: [50, 500, 5000, 20000] |
| | | , done: function (res, curr, count) { |
| | | soulTable.render(this); |
| | | } |
| | | , cols: [[ |
| | | { type:"checkbox",fixed:"left" } |
| | | ,{ field: 'hmainid', title: 'hmainid', sort: true, hide: true } |
| | | , { field: 'æ¥æ', title: 'æ¥æ', width: 150, templet: "<div>{{d.æ¥æ ==null ?'':layui.util.toDateString(d.æ¥æ, 'yyyy-MM-dd')}}</div>" } |
| | | , { field: 'åæ®å·', title: 'åæ®å·', width: 150 } |
| | | , { field: 'HDeptID', title: 'HDeptID', hide: true } |
| | | , { field: 'é¨é¨ä»£ç ', title: 'é¨é¨ä»£ç ', width: 150 } |
| | | , { field: 'é¨é¨', title: 'é¨é¨' } |
| | | , { field: 'HMaterID', title: 'HMaterID', hide: true } |
| | | , { field: '产å代ç ', title: '产å代ç ' } |
| | | , { field: '产ååç§°', title: '产ååç§°' } |
| | | , { field: '产åè§æ ¼', title: '产åè§æ ¼' } |
| | | , { field: 'æºååå·', title: 'æºååå·', width: 150 } |
| | | , { field: 'HUnitID', title: 'HUnitID', hide: true } |
| | | , { field: '主表计éåä½ä»£ç ', title: '主表计éåä½ä»£ç ' } |
| | | , { field: '主表计éåä½', title: '主表计éåä½' } |
| | | , { field: 'ç产æ°é', title: 'ç产æ°é' } |
| | | , { field: 'hsubid', title: 'hsubid', hide: true } |
| | | , { field: 'hmaterid2', title: 'hmaterid2', hide: true } |
| | | , { field: 'ç©æä»£ç ', title: 'ç©æä»£ç ' } |
| | | , { field: 'ç©æåç§°', title: 'ç©æåç§°', width: 150 } |
| | | , { field: 'è§æ ¼åå·', title: 'è§æ ¼åå·' } |
| | | , { field: 'hunitid2', title: 'hunitid2', hide: true } |
| | | , { field: '计éåä½ä»£ç ', title: '计éåä½ä»£ç ' } |
| | | , { field: '计éåä½', title: '计éåä½' } |
| | | , { field: 'æ°é', title: 'æ°é' } |
| | | , { field: 'æèç', title: 'æèç' } |
| | | , { field: 'HWHID', title: 'HWHID', hide: true } |
| | | , { field: 'ä»åºä»£ç ', title: 'ä»åºä»£ç ' } |
| | | , { field: 'ä»åº', title: 'ä»åº' } |
| | | , { field: 'HSPID', title: 'HSPID', hide: true } |
| | | , { field: 'ä»ä½ä»£ç ', title: 'ä»ä½ä»£ç ' } |
| | | , { field: 'ä»ä½', title: 'ä»ä½' } |
| | | , { field: 'ç产任å¡åå·', title: 'ç产任å¡åå·', width: 150 } |
| | | , { field: 'å¶å人', title: 'å¶å人' } |
| | | , { field: 'å¶åæ¥æ', title: 'å¶åæ¥æ', width: 150, templet: "<div>{{d.å¶åæ¥æ ==null ?'':layui.util.toDateString(d.å¶åæ¥æ, 'yyyy-MM-dd')}}</div>" } |
| | | , { field: 'å®¡æ ¸äºº', title: 'å®¡æ ¸äºº' } |
| | | , { field: 'å®¡æ ¸æ¥æ', title: 'å®¡æ ¸æ¥æ', width: 150, templet: "<div>{{d.å®¡æ ¸æ¥æ ==null ?'':layui.util.toDateString(d.å®¡æ ¸æ¥æ, 'yyyy-MM-dd')}}</div>" } |
| | | , { field: '计åè·è¸ªå·', title: '计åè·è¸ªå·' } |
| | | , { field: 'è®¡åæ¨¡å¼', title: 'è®¡åæ¨¡å¼' } |
| | | , { field: 'æ¥æ', title: 'æ¥æ', width: 150, templet: "<div>{{d.æ¥æ ==null ?'':layui.util.toDateString(d.æ¥æ, 'yyyy-MM-dd')}}</div>", sort: true } |
| | | , { field: 'åæ®å·', title: 'åæ®å·', width: 150, sort: true } |
| | | , { field: 'HDeptID', title: 'HDeptID', hide: true, sort: true } |
| | | , { field: 'é¨é¨ä»£ç ', title: 'é¨é¨ä»£ç ', width: 150, sort: true } |
| | | , { field: 'é¨é¨', title: 'é¨é¨', sort: true } |
| | | , { field: 'HMaterID', title: 'HMaterID', hide: true, sort: true } |
| | | , { field: '产å代ç ', title: '产å代ç ', sort: true } |
| | | , { field: '产ååç§°', title: '产ååç§°', sort: true } |
| | | , { field: '产åè§æ ¼', title: '产åè§æ ¼', sort: true } |
| | | , { field: 'æºååå·', title: 'æºååå·', width: 150, sort: true } |
| | | , { field: 'HUnitID', title: 'HUnitID', hide: true, sort: true } |
| | | , { field: '主表计éåä½ä»£ç ', title: '主表计éåä½ä»£ç ', sort: true } |
| | | , { field: '主表计éåä½', title: '主表计éåä½', sort: true } |
| | | , { field: 'ç产æ°é', title: 'ç产æ°é', sort: true, totalRow: true} |
| | | , { field: 'hsubid', title: 'hsubid', hide: true, sort: true } |
| | | , { field: 'hmaterid2', title: 'hmaterid2', hide: true, sort: true } |
| | | , { field: 'ç©æä»£ç ', title: 'ç©æä»£ç ', sort: true } |
| | | , { field: 'ç©æåç§°', title: 'ç©æåç§°', width: 150, sort: true } |
| | | , { field: 'è§æ ¼åå·', title: 'è§æ ¼åå·', sort: true } |
| | | , { field: 'hunitid2', title: 'hunitid2', hide: true, sort: true } |
| | | , { field: '计éåä½ä»£ç ', title: '计éåä½ä»£ç ', sort: true } |
| | | , { field: '计éåä½', title: '计éåä½', sort: true } |
| | | , { field: 'æ°é', title: 'æ°é', sort: true, totalRow: true} |
| | | , { field: 'æèç', title: 'æèç', sort: true, totalRow: true} |
| | | , { field: 'HWHID', title: 'HWHID', hide: true, sort: true } |
| | | , { field: 'ä»åºä»£ç ', title: 'ä»åºä»£ç ', sort: true } |
| | | , { field: 'ä»åº', title: 'ä»åº', sort: true } |
| | | , { field: 'HSPID', title: 'HSPID', hide: true, sort: true } |
| | | , { field: 'ä»ä½ä»£ç ', title: 'ä»ä½ä»£ç ', sort: true } |
| | | , { field: 'ä»ä½', title: 'ä»ä½', sort: true } |
| | | , { field: 'ç产任å¡åå·', title: 'ç产任å¡åå·', width: 150, sort: true } |
| | | , { field: 'å¶å人', title: 'å¶å人', sort: true } |
| | | , { field: 'å¶åæ¥æ', title: 'å¶åæ¥æ', width: 150, templet: "<div>{{d.å¶åæ¥æ ==null ?'':layui.util.toDateString(d.å¶åæ¥æ, 'yyyy-MM-dd')}}</div>", sort: true } |
| | | , { field: 'å®¡æ ¸äºº', title: 'å®¡æ ¸äºº', sort: true } |
| | | , { field: 'å®¡æ ¸æ¥æ', title: 'å®¡æ ¸æ¥æ', width: 150, templet: "<div>{{d.å®¡æ ¸æ¥æ ==null ?'':layui.util.toDateString(d.å®¡æ ¸æ¥æ, 'yyyy-MM-dd')}}</div>", sort: true } |
| | | , { field: '计åè·è¸ªå·', title: '计åè·è¸ªå·', sort: true } |
| | | , { field: 'è®¡åæ¨¡å¼', title: 'è®¡åæ¨¡å¼', sort: true } |
| | | ]] |
| | | }; |
| | | } |
| | |
| | | sWhere = ""; |
| | | } |
| | | |
| | | //鿰忥æé® |
| | | function set_ResCnz() { |
| | | var HBillno2 = $('#HBillno2').val(); |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Sc_PPBomBill/Sc_PPBomBillViewApi', |
| | | type: "GET", |
| | | data: { "BillNo": HBillno2, "BillType": 3720 }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () { |
| | | // å¾å°frameç´¢å¼ |
| | | var index = layer.getFrameIndex(window.name); |
| | | //å
³éå½åframe |
| | | layer.close(index); |
| | | //ä¿®æ¹ä¸ºååå·æ°çé¢ |
| | | window.location.reload(); |
| | | }); |
| | | |
| | | } else { |
| | | layer.alert(result.code + result.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.close(wait); |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //å®¡æ ¸ |
| | | function set_AuditBill() { |
| | | var CheckStatus = table.checkStatus("mainTable"); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | //æå° |
| | | function get_PrintReport() { |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | |
| | | if (checkStatus.data.length === 0) { |
| | | return layer.msg('è¯·éæ©æ°æ®æå°ï¼'); |
| | | } |
| | | else { |
| | | var hmainid = []; |
| | | for (var i = 0; i < checkStatus.data.length; i++) { |
| | | hmainid.push((data[i].hmainid * (10 ** 8)) + data[i].hsubid) |
| | | } |
| | | |
| | | layer.open({ |
| | | type: 2 |
| | | , area: ['50%', '50%'] |
| | | , title: 'æå°æ¨¡çéæ©' |
| | | , shade: 0.6 //é®ç½©éæåº¦ |
| | | , maxmin: false //å
许å
¨å±æå°å |
| | | , anim: 0 //0-6çå¨ç»å½¢å¼ï¼-1ä¸å¼å¯ |
| | | , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + hmainid.toString() + '&MyMsg=' + hmainid.toString() + '&Type=HPPBomBillList', 'yes'] |
| | | , resize: false |
| | | }) |
| | | } |
| | | } |
| | | |
| | | //éèå设置 |
| | | 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);//å
³éå¼¹çª |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //æ¾ç¤ºåæ°æ® |
| | | 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 = ["hmainid", "HDeptID", "HMaterID", "HUnitID", "hsubid", "hmaterid2", "hunitid2", "HWHID", "HSPID"];//ä¸éè¦æ¾ç¤ºçåæ®µ 坿©å± |
| | | |
| | | 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 |
| | | //以䏿¯layui模å |
| | | }); |