From 30a0bf0492307dd0b7fcd769015e3bcf909a63fa Mon Sep 17 00:00:00 2001 From: wtt <1985833171@qq.com> Date: 星期一, 06 一月 2025 10:37:41 +0800 Subject: [PATCH] 单据编辑里增加列设置功能; 器具处理出库单、器具报废入库单、器具直接调拨单 、器具采购入库单、器具领用出库单、器具领用退库单 --- WebTM/views/基础资料/隐藏列设置/Gy_GridView_Hide_New.html | 11 + WebTM/views/模治具管理/模治具仓库管理/Sc_MouldScrapOutBill.html | 14 ++ WebTM/views/模治具管理/模治具仓库管理/Sc_MouldProdOutBillEdit.html | 16 ++- WebTM/views/模治具管理/模治具仓库管理/Sc_MouldProdMoveBill.html | 21 ++- WebTM/views/模治具管理/模治具仓库管理/Sc_MouldProdInBillEdit.html | 14 ++ WebTM/views/模治具管理/模治具仓库管理/Sc_Add_MouldProdBackBillList.html | 15 ++ WebTM/layuiadmin/SetColumn.js | 138 +++++++++++++++++++++++++++ WebTM/views/模治具管理/模治具仓库管理/Sc_MouldScrapInBill.html | 18 ++- 8 files changed, 213 insertions(+), 34 deletions(-) diff --git a/WebTM/layuiadmin/SetColumn.js b/WebTM/layuiadmin/SetColumn.js index 2c354f5..7000cd1 100644 --- a/WebTM/layuiadmin/SetColumn.js +++ b/WebTM/layuiadmin/SetColumn.js @@ -183,3 +183,141 @@ }) } //#endregion + +//#region 闅愯棌鍒楄缃紪杈戦〉闈� +function get_HideColumnEdit(HModName,user,option,table) { + var colName = ""; + for (var i = 1; i < option.cols[0].length - 1; i++) { + colName += option.cols[0][i]["field"] + ","; + } + var colTitleName = ""; + for (var i = 1; i < option.cols[0].length - 1; i++) { + colTitleName += 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_New.html?HModName=' + HModName + '&colName=' + colName + '&colTitleName = ' + colTitleName, "yes"] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鍒锋柊琛ㄦ牸鏁版嵁 + DisPlay_HideColumnEdit(HModName, user, option,table); + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + layer.close(index);//鍏抽棴寮圭獥 + } + }) +} +//#endregion + +//#region 鏄剧ず鍒楁暟鎹紪杈戦〉闈� +function DisPlay_HideColumnEdit(HModName, user, option,table) { + $.ajax({ + url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', + type: "GET", + async: false, + data: { "HModName": HModName, "user": user }, + success: function (data1) { + if (data1.data.length != 0) { + var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁 + var titleData = []; + var newCols = [[]];//瀵瑰簲鏁版嵁搴撳垪椤哄簭col + newCols[0].push(option.cols[0][0]);//鏀惧叆绗竴涓猚heckbox + dataCol = data1.data[0].HGridString.split(','); + //鍒楄缃垪鏁颁笌椤甸潰鍒楁暟鏄惁涓�鑷�(鍘绘帀checkbox鍒楀拰鎿嶄綔鍒�) + if (dataCol.length == option.cols[0].length - 2) { + //閬嶅巻瀵绘壘鍒楄缃搴斿垪鎸夐『搴忔彃鍏� + for (var j = 0; j < option.cols[0].length - 2; j++) { + for (var i = 0; i < option.cols[0].length - 2; i++) { + var dataCols = dataCol[j].split('|'); + //閫夋嫨涓巇atacols鐩稿簲鍒楄繘琛屼慨鏀� + if (option.cols[0][i + 1]["field"] == dataCols[5]) { + //闅愯棌鍒� + 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; + } + //缁熻鍒� + if (dataCols[6] == 1) { + option.cols[0][i + 1]["totalRow"] = true; + } + //瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�) + 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; + } + //璁剧疆琛ㄦ牸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) { + newCols[0].push(option.cols[0][dataCol.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]["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"; + } + } + //璁剧疆鍒楁帓搴� + for (var i = 1; i < option.cols[0].length-1; i++) { + if (data1.data[0].HSortFlag == "鏄�") { + option.cols[0][i]["sort"] = true; + } + else { + option.cols[0][i]["sort"] = false; + } + } + } + } + table.render(option); + } else { + } + }, error: function () { + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }) +} +//#endregion diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\351\232\220\350\227\217\345\210\227\350\256\276\347\275\256/Gy_GridView_Hide_New.html" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\351\232\220\350\227\217\345\210\227\350\256\276\347\275\256/Gy_GridView_Hide_New.html" index 0c6e010..27d7dbe 100644 --- "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\351\232\220\350\227\217\345\210\227\350\256\276\347\275\256/Gy_GridView_Hide_New.html" +++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\351\232\220\350\227\217\345\210\227\350\256\276\347\275\256/Gy_GridView_Hide_New.html" @@ -150,7 +150,12 @@ var params = getUrlVars(); var HModName = params[params[0]]; //妯″潡鍚嶇О var colName = params[params[1]]; //鍒楀悕 + var colTitleName = params[params[2]]; //鍒楀埆鍚� + if (colTitleName == undefined) { + colTitleName = ""; + } colName = decodeURI(colName);//瀵筓RI 杩涜瑙g爜 + colTitleName = decodeURI(colTitleName); //鍒濆鍖栫晫闈� set_ClearBill(); @@ -341,7 +346,7 @@ for (var i = 0; i < colNames.length; i++) { var dataCols = dataCol[i].split('|'); var ColumnName_Other = dataCols[4] == dataCols[5] ? "" : dataCols[4]; - cols.push({ "ColumnName": colNames[i], "IsHide": dataCols[1] == 1 ? true : false, "Alignment": dataCols[2], "ColumnWidth": dataCols[3], "ColumnName_Other": ColumnName_Other, "ColumnName_real": dataCols[5], "IsTotalRow": dataCols[6] == 1 ? true : false }) + cols.push({ "ColumnName": colNames[i], "IsHide": dataCols[1] == 1 ? true : false, "Alignment": dataCols[2], "ColumnWidth": dataCols[3], "ColumnName_Other": ColumnName_Other, "IsTotalRow": dataCols[6] == 1 ? true : false }) } option.data = cols; table.render(option); @@ -361,9 +366,10 @@ form.render('select'); layer.close(ajaxLoad); } else { + var colTitleNames = colTitleName.split(','); //榛樿涓嶉�変腑 鏄剧ず瀛椾綋灞呭乏 琛ㄦ牸鐨勬暟鎹~鍏� for (var i = 0; i < colNames.length; i++) { - cols.push({ "ColumnName": colNames[i], "IsHide": false, "Alignment": "L", "ColumnWidth": 120, "IsTotalRow": false }) + cols.push({ "ColumnName": colNames[i], "IsHide": false, "Alignment": "L", "ColumnWidth": 120, "ColumnName_Other": colTitleNames[i], "IsTotalRow": false }) } option.data = cols; table.render(option); @@ -401,7 +407,6 @@ , { field: 'Alignment', title: '瀵归綈鏂瑰紡', width: 100, templet: '#Alignment' } , { field: 'ColumnWidth', title: '鍒楀', width: 100, edit: 'text' } , { field: 'ColumnName_Other', title: '鍒悕', width: 120, edit: 'text' } - , { field: 'ColumnName_real', title: '鍒悕瀵瑰簲鍒楀悕', width: 120, edit: 'text', hide: "true" } , { field: 'IsTotalRow', title: '鏄惁缁熻', width: 100, templet: '#IsTotalRow' } ]] }; diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_Add_MouldProdBackBillList.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_Add_MouldProdBackBillList.html" index f302b77..1d9e803 100644 --- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_Add_MouldProdBackBillList.html" +++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_Add_MouldProdBackBillList.html" @@ -176,6 +176,7 @@ <div class="layui-btn-container"> <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></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> <script type="text/html" id="xuhao"> @@ -198,6 +199,7 @@ <script src="../../../layuiadmin/PubCustom.js"></script> <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script> <script src="../../../layuiadmin/PageTitle.js"></script> + <script src="../../../layuiadmin/SetColumn.js"></script> <script> //鑾峰彇鍙傛暟 var params = get_UrlVars(); @@ -231,7 +233,7 @@ var option1 = []; var sWhere = ""; var sBillType = "3803"; - + var HModName = "Sc_MouldProdBackBillEdit"; //鍏ㄥ眬鍙橀噺 window.HSupType = $("#HSupTypeID").val(); //#endregion @@ -241,7 +243,7 @@ //閫氳繃鍗曟嵁绫诲瀷锛屼粠鏁版嵁搴撳姩鎬佽幏鍙栧崟鎹ā鍧楀懡鍚�,寮曠敤js鏂囦欢 PageTitle.js var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType); $("h1").html('<b>' + HPageTitle + '</b>'); - //#endregion + //#endregion //#region 杩涘叆椤甸潰鏃㈠姞杞� //鍒濆鍖栬〃鍗曟彃浠� @@ -249,6 +251,7 @@ //鍒濆鍖栬〃鏍� set_InitGrid(); set_CountGrid(); + DisPlay_HideColumnEdit(HModName, sessionStorage["HUserName"], option, table); //鍒ゆ柇鎿嶄綔绫诲瀷 if (OperationType == 1) {//鏃犳簮鏂板 set_AddFNew(); @@ -275,6 +278,10 @@ break; //澶嶅埗涓�琛� case 'btn-CopyLine': btnCopyLine(data); + break; + //鍒楄缃� + case 'set_HideColumn': + get_HideColumnEdit(HModName, sessionStorage["HUserName"], option, table); break; } }); @@ -677,7 +684,7 @@ function set_InitGrid() { columns = [ { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣琛�' } - , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe", width: 100 } + , { templet: '#xuhao', field: '搴忓彿', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe", width: 100 } , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true } , { field: 'HMaterCode', title: '鍣ㄥ叿浠g爜', edit: 'text', event: 'HMaterCode', width: 100 } , { field: 'HMaterName', title: '鍣ㄥ叿鍚嶇О', edit: 'text', width: 100 } @@ -894,7 +901,7 @@ if (obj.event === 'del') { layer.confirm('鐪熺殑鍒犻櫎琛屼箞', function (index) { console.log("绱㈠紩涓�:" + rowIndex); - if (rowIndex === '0') { + if (rowIndex === '0' && table.cache["mainTable"].length == 1) { layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�'); } else { //obj.del(); diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldProdInBillEdit.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldProdInBillEdit.html" index 0aa97a3..36924ce 100644 --- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldProdInBillEdit.html" +++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldProdInBillEdit.html" @@ -14,7 +14,7 @@ <script src="../../../layuiadmin/Scripts/webConfig.js"></script> <script src="../../../layuiadmin/PubCustom.js"></script> <script src="../../../layuiadmin/PageTitle.js"></script> - + <script src="../../../layuiadmin/SetColumn.js"></script> <style type="text/css"> /*begin 姝ゆ牱寮忕敤浜庢秷闄よ鍏冪礌涓竷灞�瀹藉害涓嶅鐨勯棶棰�*/ /*.layui-form-item .layui-inline { @@ -214,7 +214,7 @@ <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></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> <script type="text/html" id="xuhao"> @@ -261,6 +261,7 @@ var option1 = []; var sWhere = ""; var sBillType = "3801"; + var HModName = "Sc_MouldProdInBillEdit"; //鍏ㄥ眬鍙橀噺 window.HSupType = $("#HSupTypeID").val(); //#endregion @@ -280,6 +281,7 @@ //鍒濆鍖栬〃鏍� set_InitGrid(); set_CountGrid(); + DisPlay_HideColumnEdit(HModName, sessionStorage["HUserName"], option, table) //鍒ゆ柇鎿嶄綔绫诲瀷 if (OperationType == 1) {//鏃犳簮鏂板 set_AddFNew(); @@ -306,6 +308,10 @@ break; //澶嶅埗涓�琛� case 'btn-CopyLine': btnCopyLine(data); + break; + //鍒楄缃� + case 'set_HideColumn': + get_HideColumnEdit(HModName, sessionStorage["HUserName"], option, table); break; } }); @@ -757,7 +763,7 @@ function set_InitGrid() { columns = [ { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣琛�' } - , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe", width: 100 } + , { templet: '#xuhao', field:"搴忓彿", title: '搴忓彿', sort: true, fixed: 'left', event: "qwe", width: 100 } , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true } , { field: 'HMaterCode', title: '鍣ㄥ叿浠g爜', edit: 'text', event: 'HMaterCode', width: 100 } , { field: 'HMaterName', title: '鍣ㄥ叿鍚嶇О', edit: 'text', width: 100 } @@ -989,7 +995,7 @@ if (obj.event === 'del') { layer.confirm('鐪熺殑鍒犻櫎琛屼箞', function (index) { console.log("绱㈠紩涓�:" + rowIndex); - if (rowIndex === '0') { + if (rowIndex === '0' && table.cache["mainTable"].length == 1) { layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�'); } else { //obj.del(); diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldProdMoveBill.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldProdMoveBill.html" index 6b14222..cce6746 100644 --- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldProdMoveBill.html" +++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldProdMoveBill.html" @@ -169,7 +169,7 @@ <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></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> <script type="text/html" id="xuhao"> @@ -192,6 +192,7 @@ <script src="../../../layuiadmin/PubCustom.js"></script> <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script> <script src="../../../layuiadmin/PageTitle.js"></script> + <script src="../../../layuiadmin/SetColumn.js"></script> <script> layui.config({ base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� @@ -228,13 +229,13 @@ // icon: 4, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['閲嶆柊鐧诲綍'] // }, function () { window.location.href = "../../user/login.html"; }); //} - + var HModName = "Sc_MouldProdMoveBillEdit"; //#region 銆愬姩鎬佽幏鍙栨ā鍧楀悕绉般�� var HModuleType = "3814"; //閫氳繃鍗曟嵁绫诲瀷锛屼粠鏁版嵁搴撳姩鎬佽幏鍙栧崟鎹ā鍧楀懡鍚�,寮曠敤js鏂囦欢 PageTitle.js var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType); $("h1").html('<b>' + HPageTitle + '</b>'); - //#endregion + //#endregion var tableReload = table.reload; var option = { @@ -246,7 +247,7 @@ , page: true //寮�鍚垎椤� , cols: [[ //琛ㄥご { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣琛�' } - , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe", width: 100 } + , { templet: '#xuhao', field: '搴忓彿', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe", width: 100 } , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true } , { field: 'HMaterCode', title: '鍣ㄥ叿浠g爜', edit: 'text', event: 'HMaterCode', width: 100 } , { field: 'HMaterName', title: '鍣ㄥ叿鍚嶇О', edit: 'text', width: 100 } @@ -335,7 +336,7 @@ }); } - + DisPlay_HideColumnEdit(HModName, sessionStorage["HUserName"], option, table); //澶村伐鍏锋爮浜嬩欢 var rowid = 0; @@ -371,6 +372,10 @@ //layer.alert(copyrow); } break; + //鍒楄缃� + case 'set_HideColumn': + get_HideColumnEdit(HModName, sessionStorage["HUserName"], option, table); + break; } }); //琛屽唴浜嬩欢 @@ -380,7 +385,7 @@ if (obj.event === 'del') { layer.confirm('鐪熺殑鍒犻櫎琛屽悧锛�', function (index) { console.log("绱㈠紩涓�:" + rowIndex); - if (rowIndex === '0') { + if (rowIndex === '0' && table.cache["mainTable"].length == 1) { layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�'); } else { obj.del(); @@ -541,7 +546,7 @@ //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴 }, end: function () { - + if (typeof (OptionData) != "undefined" && OptionData != []) { var HStockStyle = $("#HStockStyle").val(); if (HStockStyle == "璺ㄧ粍缁囪皟鎷�") //false 鍚岀粍缁� true 璺ㄧ粍缁� { @@ -1413,7 +1418,7 @@ function GetGyStockPlace(obj) //浠撲綅 { OptionData = obj; - } + } function GetOrganization(obj) //缁勭粐 { OptionData = obj; diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldProdOutBillEdit.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldProdOutBillEdit.html" index 8fe19f2..ac75ae5 100644 --- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldProdOutBillEdit.html" +++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldProdOutBillEdit.html" @@ -182,7 +182,7 @@ <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></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> <script type="text/html" id="xuhao"> @@ -206,6 +206,7 @@ <script src="../../../layuiadmin/PubCustom.js"></script> <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script> <script src="../../../layuiadmin/PageTitle.js"></script> + <script src="../../../layuiadmin/SetColumn.js"></script> <script> var params = get_UrlVars(); if (typeof (params[params[0]]) == "undefined") { @@ -237,7 +238,7 @@ var option1 = []; var sWhere = ""; var sBillType = "3802"; - + var HModName = "Sc_MouldProdOutBillEdit"; //鍏ㄥ眬鍙橀噺 window.HSupType = $("#HSupTypeID").val(); //#endregion @@ -268,13 +269,14 @@ //閫氳繃鍗曟嵁绫诲瀷锛屼粠鏁版嵁搴撳姩鎬佽幏鍙栧崟鎹ā鍧楀懡鍚�,寮曠敤js鏂囦欢 PageTitle.js var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType); $("h1").html('<b>' + HPageTitle + '</b>'); - //#endregion + //#endregion //鍒濆鍖栬〃鍗曟彃浠� set_InitFrom(); //鍒濆鍖栬〃鏍� set_InitGrid(); set_CountGrid(); + DisPlay_HideColumnEdit(HModName, sessionStorage["HUserName"], option, table); //鍒ゆ柇鎿嶄綔绫诲瀷 if (OperationType == 1) {//鏃犳簮鏂板 set_AddFNew(); @@ -300,6 +302,10 @@ break; //澶嶅埗涓�琛� case 'btn-CopyLine': btnCopyLine(data); + break; + //鍒楄缃� + case 'set_HideColumn': + get_HideColumnEdit(HModName, sessionStorage["HUserName"], option, table); break; } }); @@ -700,7 +706,7 @@ function set_InitGrid() { columns = [ { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣琛�' } - , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe", width: 100 } + , { templet: '#xuhao', field:'搴忓彿', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe", width: 100 } , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true } , { field: 'HMaterCode', title: '鍣ㄥ叿浠g爜', edit: 'text', event: 'HMaterCode', width: 100 } , { field: 'HMaterName', title: '鍣ㄥ叿鍚嶇О', edit: 'text', width: 100 } @@ -917,7 +923,7 @@ if (obj.event === 'del') { layer.confirm('鐪熺殑鍒犻櫎琛屼箞', function (index) { console.log("绱㈠紩涓�:" + rowIndex); - if (rowIndex === '0') { + if (rowIndex === '0' && table.cache["mainTable"].length == 1) { layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�'); } else { //obj.del(); diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldScrapInBill.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldScrapInBill.html" index 5c616f4..ce4d67d 100644 --- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldScrapInBill.html" +++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldScrapInBill.html" @@ -192,7 +192,7 @@ <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></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> <script type="text/html" id="xuhao"> @@ -215,6 +215,7 @@ <script src="../../../layuiadmin/PubCustom.js"></script> <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script> <script src="../../../layuiadmin/PageTitle.js"></script> + <script src="../../../layuiadmin/SetColumn.js"></script> <script> //鑾峰彇鍙傛暟 var params = get_UrlVars(); @@ -246,7 +247,7 @@ var option1 = []; var sWhere = ""; var sBillType = "3831"; - + var HModName = "Sc_MouldScrapInBillEdit"; //鍏ㄥ眬鍙橀噺 window.HSupType = $("#HSupTypeID").val(); //TabRow = { "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HPropertyID": 0, "HPropertyCode": "", "HPropertyName": "", "HSecUnitID": 0, "HSecUnitCode": "", "HSecUnitName": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"],"HRemark": "" }; @@ -259,13 +260,14 @@ //閫氳繃鍗曟嵁绫诲瀷锛屼粠鏁版嵁搴撳姩鎬佽幏鍙栧崟鎹ā鍧楀懡鍚�,寮曠敤js鏂囦欢 PageTitle.js var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType); $("h1").html('<b>' + HPageTitle + '</b>'); - //#endregion + //#endregion //鍒濆鍖栬〃鍗曟彃浠� set_InitFrom(); //鍒濆鍖栬〃鏍� set_InitGrid(); set_CountGrid(); + DisPlay_HideColumnEdit(HModName, sessionStorage["HUserName"], option, table); //鍒ゆ柇鎿嶄綔绫诲瀷 if (OperationType == 1) {//鏃犳簮鏂板 set_AddFNew(); @@ -291,6 +293,10 @@ break; //澶嶅埗涓�琛� case 'btn-CopyLine': btnCopyLine(data); + break; + //鍒楄缃� + case 'set_HideColumn': + get_HideColumnEdit(HModName, sessionStorage["HUserName"], option, table); break; } }); @@ -744,7 +750,7 @@ function set_InitGrid() { columns = [ { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣琛�' } - , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe", width: 100 } + , { templet: '#xuhao', field: '搴忓彿', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe", width: 100 } , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true } , { field: 'HMaterCode', title: '鍣ㄥ叿浠g爜', edit: 'text', event: 'HMaterCode', width: 100 } , { field: 'HMaterName', title: '鍣ㄥ叿鍚嶇О', edit: 'text', width: 100 } @@ -967,7 +973,7 @@ if (obj.event === 'del') { layer.confirm('鐪熺殑鍒犻櫎琛屼箞', function (index) { console.log("绱㈠紩涓�:" + rowIndex); - if (rowIndex === '0') { + if (rowIndex === '0' && table.cache["mainTable"].length == 1) { layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�'); } else { //obj.del(); @@ -1480,7 +1486,7 @@ } else { $("#HDeptName").val(obj[0].閮ㄩ棬鍚嶇О); $("#HDeptID").val(obj[0].HItemID); - } + } } function GetHSupNameValue(obj) //寰�鏉ュ崟浣嶏紙渚涘簲鍟嗭級 diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldScrapOutBill.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldScrapOutBill.html" index 3aa5537..ffc858a 100644 --- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldScrapOutBill.html" +++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldScrapOutBill.html" @@ -181,7 +181,7 @@ <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></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> <script type="text/html" id="xuhao"> @@ -204,6 +204,7 @@ <script src="../../../layuiadmin/PubCustom.js"></script> <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script> <script src="../../../layuiadmin/PageTitle.js"></script> + <script src="../../../layuiadmin/SetColumn.js"></script> <script> //鑾峰彇椤甸潰璺宠浆鍙傛暟 var params = get_UrlVars(); @@ -234,7 +235,7 @@ , element = layui.element; var option; var sBillType = "3832"; - + var HModName = "Sc_MouldScrapOutBillEdit"; //鍏ㄥ眬鍙橀噺 window.HSupType = $("#HSupTypeID").val(); //var TabRow = { "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HPropertyID": 0, "HPropertyCode": "", "HPropertyName": "", "HSecUnitID": 0, "HSecUnitCode": "", "HSecUnitName": "", "HSecUnitRate": 0, "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "" } @@ -248,7 +249,7 @@ //閫氳繃鍗曟嵁绫诲瀷锛屼粠鏁版嵁搴撳姩鎬佽幏鍙栧崟鎹ā鍧楀懡鍚�,寮曠敤js鏂囦欢 PageTitle.js var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType); $("h1").html('<b>' + HPageTitle + '</b>'); - //#endregion + //#endregion //鍒濆鍖栬〃鍗曟彃浠� set_InitFrom(); @@ -256,6 +257,7 @@ //鍒濆鍖栬〃鏍� set_InitGrid(); set_CountGrid(); + DisPlay_HideColumnEdit(HModName, sessionStorage["HUserName"], option, table); //鍒ゆ柇鎿嶄綔绫诲瀷 if (OperationType == 1) {//鏃犳簮鍗� set_AddFNew(); @@ -511,6 +513,10 @@ //澶嶅埗涓�琛� case 'btn-CopyLine': btnCopyLine(data); break; + //鍒楄缃� + case 'set_HideColumn': + get_HideColumnEdit(HModName, sessionStorage["HUserName"], option, table); + break; } }); @@ -698,7 +704,7 @@ //琛ㄥご columns = [ { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣琛�' } - , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe", width: 100 } + , { templet: '#xuhao', field: '搴忓彿', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe", width: 100 } , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true } , { field: 'HMaterCode', title: '鍣ㄥ叿浠g爜', edit: 'text', event: 'HMaterCode', width: 100 } , { field: 'HMaterName', title: '鍣ㄥ叿鍚嶇О', edit: 'text', width: 100 } -- Gitblit v1.9.1