| WebTM/Properties/PublishProfiles/JFTM.pubxml.user | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebTM/WebTM.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebTM/views/系统管理/用户管理/Gy_UserEmployeeList.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebTM/views/系统管理/用户管理/Gy_UserEmployeeList_Edit.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
WebTM/Properties/PublishProfiles/JFTM.pubxml.user
@@ -18,10 +18,10 @@ <publishTime>01/28/2016 14:22:24</publishTime> </File> <File Include="bin/WebTM.dll"> <publishTime>01/31/2024 08:56:46</publishTime> <publishTime>01/31/2024 13:39:17</publishTime> </File> <File Include="bin/WebTM.pdb"> <publishTime>01/31/2024 08:56:46</publishTime> <publishTime>01/31/2024 13:39:17</publishTime> </File> <File Include="HtmlPage1.html"> <publishTime>04/11/2023 16:34:42</publishTime> @@ -4238,6 +4238,12 @@ <File Include="views/ç³»ç»ç®¡ç/ç¨æ·ç®¡ç/Gy_UserEmployee.html"> <publishTime>01/03/2024 12:55:26</publishTime> </File> <File Include="views/ç³»ç»ç®¡ç/ç¨æ·ç®¡ç/Gy_UserEmployeeList.html"> <publishTime>01/31/2024 13:40:46</publishTime> </File> <File Include="views/ç³»ç»ç®¡ç/ç¨æ·ç®¡ç/Gy_UserEmployeeList_Edit.html"> <publishTime>01/31/2024 14:04:59</publishTime> </File> <File Include="views/ç³»ç»ç®¡ç/ç¨æ·ç®¡ç/Gy_UserEmployee_Excel.html"> <publishTime>01/03/2024 12:55:26</publishTime> </File> WebTM/WebTM.csproj
@@ -402,6 +402,8 @@ <Content Include="views\ç³»ç»ç®¡ç\ç¨æ·ç®¡ç\Gy_UserByWorkStationList.html" /> <Content Include="views\ç³»ç»ç®¡ç\ç¨æ·ç®¡ç\Gy_UserCustomerList.html" /> <Content Include="views\ç³»ç»ç®¡ç\ç¨æ·ç®¡ç\Gy_UserCustomerList_Edit.html" /> <Content Include="views\ç³»ç»ç®¡ç\ç¨æ·ç®¡ç\Gy_UserEmployeeList.html" /> <Content Include="views\ç³»ç»ç®¡ç\ç¨æ·ç®¡ç\Gy_UserEmployeeList_Edit.html" /> <Content Include="views\ç³»ç»ç®¡ç\ç¨æ·ç®¡ç\Gy_UserGroupList.html" /> <Content Include="views\ç³»ç»ç®¡ç\ç¨æ·ç®¡ç\Gy_UserMaterList.html" /> <Content Include="views\ç³»ç»ç®¡ç\ç¨æ·ç®¡ç\Gy_UserStockRelation.html" /> WebTM/views/ϵͳ¹ÜÀí/Óû§¹ÜÀí/Gy_UserEmployeeList.html
New file @@ -0,0 +1,597 @@ <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>ç¨æ·å ³èèåç»´æ¤</title> <meta name="renderer" content="webkit"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all"> <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all"> <!--<script src="../../../layuiadmin/layui/layui.js"></script> <script src="../../../layuiadmin/layui/layui.js"></script> <script src="../../../layuiadmin/Scripts/json2.js"></script> <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script> <script src="../../../layuiadmin/Scripts/webConfig.js"></script>--> <script src="../../../layuiadmin/layui/layui.js"></script> <script src="../../../layuiadmin/Scripts/json2.js"></script> <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script> <script src="../../../layuiadmin/Scripts/webConfig.js"></script> <script src="../../../layuiadmin/PubCustom.js"></script> <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script> <script src="../../../layuiadmin/HideButton.js"></script> </head> <body> <div class="layui-fluid"> <div class="layui-col-md12"> <div class="layui-card" style="padding: 1px"> <div class="layui-card-body" style="padding: 1px;"> <form class="layui-form" action="" lay-filter="component-form-group"> <div class="layui-collapse"> <div class="layui-colla-item"> <div class="layui-colla-title layui-inline"> <div class="layui-inline"> <span>æ´å¤</span> </div> </div> <div class="layui-inline"> <label class="layui-form-label" style="width: 85px;">ç¨æ·ä»£ç </label> <div class="layui-input-block" style="margin-left: 120px;"> <input type="text" class="layui-input" name="HUserID" id="HUserID"> </div> </div> <div class="layui-inline"> <label class="layui-form-label" style="width: 85px;">ç¨æ·åç§°</label> <div class="layui-input-block" style="margin-left: 120px;"> <input type="text" class="layui-input" name="HUserName" id="HUserName"> </div> </div> <div class="layui-inline"> <label class="layui-form-label" style="width: 85px;">èå代ç </label> <div class="layui-input-block" style="margin-left: 120px;"> <input type="text" class="layui-input" name="HEmpNumber" id="HEmpNumber"> </div> </div> <div class="layui-inline"> <label class="layui-form-label" style="width: 85px;">èååç§°</label> <div class="layui-input-block" style="margin-left: 120px;"> <input type="text" class="layui-input" name="HEmpName" id="HEmpName"> </div> </div> <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 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="set_AddNew" id="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>æ°å¢</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill" id="set_ShowBill"><i class="layui-icon layui-icon-form"></i>ç¼è¾</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill" id="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>å é¤</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh" id="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>å·æ°</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit" id="get_Exit"><i class="layui-icon layui-icon-logout"></i>éåº</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn" id="set_HideColumn"><i class="layui-icon layui-icon-form"></i>å设置</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="HideButton" id="HideButton"><i class="layui-icon layui-icon-form"></i>æé®è®¾ç½®</button> </div> </script> </form> </div> </div> </div> </div> <script> layui.config({ base: '../../../layuiadmin/' //éæèµæºæå¨è·¯å¾ }).extend({ index: 'lib/index', //ä¸»å ¥å£æ¨¡å }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () { //#region å ¬ç¨åé var $ = layui.$ , admin = layui.admin , layer = layui.layer , table = layui.table , form = layui.form , element = layui.element , laypage = layui.laypage , laydate = layui.laydate var option = []; var sWhere = ""; var HModName = "Gy_UserEmployeeList"; //ä¸éè¦æ¾ç¤ºçåæ®µ 坿©å± var titleData = ["HItemID","HEmployeeID","HOrgID"]; //#endregion //#region è¿å ¥é¡µé¢å³å è½½ //åå§åçé¢ set_ClearBill(); //#endregion //#region 触åäºä»¶ï¼å æ¬form.on(){}æ ¼å¼çææç¹å»äºä»¶ãéæ©äºä»¶ç //#region å¤´å·¥å ·æ äºä»¶ table.on('toolbar(mainTable)', function (obj) { switch (obj.event) { //æ°å¢ case 'set_AddNew': set_AddNew(); break; //ç¼è¾ case 'set_ShowBill': set_ShowBill(); break; //å é¤ case 'set_DeleteBill': set_DeleteBill(); break; //å·æ° case 'get_Refresh': get_Refresh(); break; //éåºæé® case 'get_Exit': Pub_Close(2); break; //å设置 case 'set_HideColumn': get_HideColumn(); break; //æé®è®¾ç½® case 'HideButton': var btns = document.getElementsByTagName("button"); //è·åæ¬é¡µæææé®å¯¹è±¡ var HBillType = "Gy_UserEmployeeList"; get_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]); break; }; }); //#endregion //#region ç¹å»è¡éä¸é«äº® table.on('row(mainTable)', function (obj) { //éä¸è¡æ¹åé¢è² var flag = !obj.tr.find(':checkbox:first').prop('checked'); obj.tr.find(':checkbox').prop('checked', flag); if (flag) { obj.tr.find('.layui-form-checkbox').addClass('layui-form-checked'); //设置å¤éæ¡é䏿 ·å¼ $(obj.tr.selector).attr({ "style": "background:#ceedfa;color:black" });//æ¹åå½åtrèæ¯é¢è²ååä½é¢è² } else { obj.tr.find('.layui-form-checkbox').removeClass('layui-form-checked');//åæ¶å¤éæ¡é䏿 ·å¼ $(obj.tr.selector).attr({ "style": "background:" });//åæ¶å½åtré¢è² } //mainTable ä¸ºè¡¨æ ¼ID æ³¨ææ¤å¤å¦æID䏿£ç¡®å°å¯¼è´ä½ å¨çå¬å¤éæ¡æ¶è·åä¸å°ä½ éæ©çæ°æ®ï¼åé¢çåªæ¯æ·»å æå é¤é䏿ªé䏿 ·å¼ä»¥åè®¾ç½®èæ¯è²ï¼åä½é¢è² layui.each(table.cache.mainTable, function (i, l) { if (obj.tr.index() == l.LAY_TABLE_INDEX) { l.LAY_CHECKED = flag; } }); }) //#endregion //#region éç½®æé® form.on('submit(btnReSearch)', function (data) { set_ClearQuery(); }); //#endregion //#region æ¥è¯¢æé® form.on('submit(btnSearch)', function (data) { get_FastQuery(2); }); //#endregion //#endregion //#region æ¬é¡µé¢ææè¢«è°ç¨çæ¹æ³ //#region åå§åçé¢ function set_ClearBill() { //åå§åè¡¨æ ¼ set_InitGrid(); //æ¥è¯¢ get_FastQuery(1); //Organ(); } //#endregion //#region åå§åè¡¨æ ¼æ¹æ³ function set_InitGrid() { option = { elem: '#mainTable' , toolbar: '#toolbarDemo' , height: 'full-50' , page: true //, cellMinWidth: 90 , limit: 50 , limits: [50, 500, 5000, 50000] }; } //#endregion //#region æ¥è¯¢ function get_Display(sWhere) { var ajaxLoad = layer.load(); $.ajax({ url: GetWEBURL() + '/Xt_User/UserRelationEmployeelist', type: "GET", data: { "sWhere": sWhere, "user": sessionStorage["HUserName"]}, success: function (data1) { if (data1.count == 1) { 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:120 }); break; default: col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120 }); } } } option.cols = [col]; option.data = data1.data; table.render(option); //å·æ°æé®æ¾ç¤º var btns = document.getElementsByTagName("button"); //è·åæ¬é¡µæææé®å¯¹è±¡ var HBillType = "Gy_UserEmployeeList"; Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]); //å·æ°è¡¨æ ¼æ°æ® //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 }); } }); } //#endregion //#region å¿«éè¿æ»¤ function get_FastQuery(number) { var HUserID = $("#HUserID").val(); //ç¨æ·ä»£ç var HUserName = $("#HUserName").val();//ç¨æ·åç§° var HEmpNumber = $("#HEmpNumber").val();//客æ·ä»£ç var HEmpName = $("#HEmpName").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 (HUserID) { sWhere += " and ç¨æ·ä»£ç like '%" + HUserID + "%'"; } if (HUserName) { sWhere += " and ç¨æ·åç§° like '%" + HUserName + "%'"; } if (HEmpNumber) { sWhere += " and ç¨æ·ä»£ç like '%" + HEmpNumber + "%'"; } if (HEmpName) { sWhere += " and ç¨æ·åç§° like '%" + HEmpName + "%'"; } get_Display(sWhere); sWhere = "";//è°ç¨æ¥å£åæ¸ ç©ºsWhereç¼å } //#endregion //#region éç½®è¿æ»¤æ¡ä»¶æ¹æ³ function set_ClearQuery() { $("#HUserID").val(""); $("#HUserName").val(""); $("#HEmpNumber").val(""); $("#HEmpName").val(""); $("#ColContent").val(""); $("#ColName").val("0"); $("#Comparator").val("0"); form.render('select'); sWhere = ""; } //#endregion //#region æ°å¢ function set_AddNew() { layer.open({ type: 2 , skin: 'layui-layer-rim' //å ä¸è¾¹æ¡ , area: ['100%', '100%'] , title: 'ç¨æ·å ³èèå-æ°å¢' , shift: 0//å¼¹åºå¨ç» , content: '../../ç³»ç»ç®¡ç/ç¨æ·ç®¡ç/Gy_UserEmployeeList_Edit.html?OperationType=1&linterid=0&HSouceBillType=' ,btn: ['ç¡®å®'], end: function (index, layero, that) { //å·æ°é¡µé¢ $("#btnSearch").trigger('click'); } }) } //#endregion //#region ç¼è¾ function set_ShowBill() { var checkStatus = table.checkStatus('mainTable') , data = checkStatus.data; if (checkStatus.data.length === 1) { var linterid = data[0].HItemID.toString(); layer.open({ type: 2 , skin: 'layui-layer-rim' //å ä¸è¾¹æ¡ , area: ['100%', '100%'] , title: 'ç¨æ·å ³èèå-ç¼è¾' , shift: 0//å¼¹åºå¨ç» , content: '../../ç³»ç»ç®¡ç/ç¨æ·ç®¡ç/Gy_UserEmployeeList_Edit.html?OperationType=3&linterid=' + linterid , btn: ['ç¡®å®'], end: function (index, layero, that) { //å·æ°é¡µé¢ $("#btnSearch").trigger('click'); } }) } else { layer.msg('è¯·éæ©ä¸è¡æ°æ®ç¼è¾ï¼'); } } //#endregion //#region å é¤ function set_DeleteBill() { var checkStatus = table.checkStatus('mainTable') , data = checkStatus.data; if (checkStatus.data.length === 1) { var HInterID = data[0].HItemID.toString(); layer.confirm("确认è¦å é¤åï¼å é¤åä¸è½æ¢å¤", { title: "å é¤ç¡®è®¤" }, function (index) { var wait = layer.load(); //é»è¾å 餿¹æ³ $.ajax({ url: GetWEBURL() + '/Xt_User/UserRelationEmployeelist_Drop', type: "GET", data: { "HInterID": HInterID, "user": sessionStorage["HUserName"] }, success: function (result) { if (result.count == 1) { layer.msg(result.Message, { icon: 1 }, function () { // å¾å°frameç´¢å¼ var index = layer.getFrameIndex(window.name); //å ³éå½åframe layer.close(wait); //ä¿®æ¹ä¸ºååå·æ°çé¢ $("#btnSearch").trigger('click'); }); } else { layer.alert(result.code + result.Message, { icon: 5 }); layer.close(wait); } }, error: function () { layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); layer.close(wait); } }); }) } else { layer.msg('è¯·éæ©ä¸è¡æ°æ®å é¤ï¼'); } } //#endregion //#region å·æ° function get_Refresh() { $("#btnSearch").trigger('click'); } //#endregion //#region éèå设置 function get_HideColumn() { var colName = ""; var contentUrl = ""; for (var i = 1; i < option.cols[0].length; 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 - 1; 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 //#endregion }); //#endregion //以䏿¯layui模å </script> </body> </html> WebTM/views/ϵͳ¹ÜÀí/Óû§¹ÜÀí/Gy_UserEmployeeList_Edit.html
New file @@ -0,0 +1,697 @@ <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>ç¨æ·å ³èèåç»´æ¤_ç¼è¾</title> <meta name="renderer" content="webkit"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all"> <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all"> <script src="../../../layuiadmin/layui/layui.js"></script> <script src="../../../layuiadmin/layui/layui.js"></script> <script src="../../../layuiadmin/Scripts/json2.js"></script> <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script> <script src="../../../layuiadmin/Scripts/webConfig.js"></script> <script src="../../../layuiadmin/PubCustom.js"></script> <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script> <style type="text/css"> /* .layui-form-item .layui-inline { margin-right: 0; } html { background-color: white; color: white; } .layui-table-cell { overflow: visible !important; } td .layui-form-select { margin-top: -10px; margin-left: -15px; margin-right: -15px; }*/ </style> </head> <body> <div class="layui-fluid" style="padding: 0;"> <div class="layui-card" style="padding: 15px;"> <div class="layui-card-body" style="padding: 1px;"> <form class="layui-form" lay-filter="component-form-group" action=""> <div class="layui-card-header"> <div class="layui-btn-group"> <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_SaveBill">ä¿å</button> <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">éåº</button> </div> </div> <div class="layui-tab" lay-filter="tab-POStockInBill"> <div class="layui-tab-content"> <!--åºæ¬ä¿¡æ¯--> <div class="layui-tab-item layui-show"> <div class="layui-form-item" style="padding-top: 10px;"> <div class="layui-row"> <div class="layui-inline"> <label class="layui-form-label">ç¨æ·</label> <div class="layui-input-inline"> <input type="text" name="UserName" id="UserName" readonly class="layui-input" value="" style="float:left;width:150px;"> <input type="hidden" name="UserID" id="UserID" class="layui-input" value="" style="float:left;width:150px;"> <button type="button" lay-submit="" class="layui-btn" lay-filter="UserList" style="width:40px;"> <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i> </button> </div> </div> </div> </div> </div> </div> </div> <!--å表1--> <table class="layui-hide" 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-AddLine"><i class="layui-icon layui-icon-form"></i>å¢å ä¸è¡</button> <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-InsertLine"><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="btn-Up"><i class="layui-icon layui-icon-form"></i>ä¸ç§»</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Under"><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"> {{d.LAY_TABLE_INDEX+1}} </script> </form> </div> </div> </div> <script type="text/html" id="barDemo"> <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">å é¤</a> </script> <script> //#region æå 注é //#endregion layui.config({ base: '../../../layuiadmin/' //éæèµæºæå¨è·¯å¾ }).extend({ index: 'lib/index' //ä¸»å ¥å£æ¨¡å }).use(['index', 'form', 'laydate', 'table', 'element'], function () { //#region å ¬ç¨åé var $ = layui.$ , admin = layui.admin , layer = layui.layer , table = layui.table , form = layui.form , laydate = layui.laydate , element = layui.element; //å表渲æåæ° var option = {}; //模åå var HModName = "Gy_UserEmployeeList_Edit"; //è·å页é¢è·³è½¬åæ° var params = get_UrlVars(); var OperationType = params[params[0]]; //ä»åæ°ä¸è·å æ°æ®ç±»å 1æ·»å ä¿å 2å¤å¶ 3 ç¼è¾ var linterid = params[params[1]]; //ä»åæ°ä¸è·å åæ®å ç //#endregion //#region è¿å ¥é¡µé¢å³å è½½ //#region 夿æ¯å¦ç»å½ æªç»å½åè·³å°ç»å½é¡µ get_LoginIs(); //#endregion //#region å¤æå¹¶è®¾ç½®æä½ç±»åã页é¢åå§å if (OperationType == null || OperationType == 1) { //æ°å¢ //æ°å¢é¡µé¢åå§å Init_setAdd(); } else if (OperationType == 3) { //ç¼è¾ //å表åå§å set_InitGrid(); //å 载表ä½åè¡¨ä½æ°æ® RoadBillMain(linterid); } //#endregion //#region å设置ï¼å表1 DisPlay_HideColumn(); //#endregion //#endregion //#region 触åäºä»¶ï¼å æ¬form.on(){}æ ¼å¼çææç¹å»äºä»¶ãéæ©äºä»¶ç //#region å¼¹çªéæ©è§¦åäºä»¶ //#region éæ©ç¨æ·æé® form.on('submit(UserList)', function () { get_checkUser(); }); //#endregion //#endregion //#region 表头æé®è§¦åäºä»¶ //#region ä¿åæé® form.on('submit(set_SaveBill)', function (data) { if (AllowLoadData(data)) { set_AddNew(); } }); //#endregion //#region éåºæé® form.on('submit(Exit)', function () { if (params[1] != null) { Pub_Close(1); } else if (params[1] == null) { Pub_Close(2); } }) //#endregion //#endregion //#region å表ç¸å ³çå¬äºä»¶ //#region å表1ï¼å¤´å·¥å ·æ æé®è§¦åäºä»¶ table.on('toolbar(mainTable)', function (obj) { var checkStatus = table.checkStatus('mainTable') , data = checkStatus.data;; //æ°å¢è¡è¡¨æ ¼æ°æ® var NewRow = { "HItemID": "0", "HUserID": "", "HUserName": "", "HEmpID": "0", "HEmpNumber": "", "HEmpName": "", }; switch (obj.event) { //æ°å¢ä¸è¡ case 'btn-AddLine': btnAddLine(NewRow); break; //å¤å¶ä¸è¡ case 'btn-CopyLine': btnCopyLine(data); break; ////æå®ä½ç½®ä¸æå ¥ä¸è¡ //case 'btn-InsertLine': btnInsertLine(NewRow) // break; ////ä¸ç§» //case 'btn-Up': btn_up(); // break; ////ä¸ç§» //case 'btn-Under': btn_under(); // break; //å设置 case 'set_HideColumn': get_HideColumn(); break; } }); //#endregion //#region è¡å äºä»¶ table.on('tool(mainTable)', function (obj) { set_GridDelete(obj); //è¡å å é¤ set_GridCellCheck(obj); //è¡å å¿«æ·é®çé }); //#endregion //#endregion //#endregion //#region æ¬é¡µé¢ææè¢«è°ç¨çæ¹æ³ //#region 夿æ¯å¦ç»å½ æªç»å½åè·³å°ç»å½é¡µ function get_LoginIs() { if (sessionStorage.login != "login") { layer.confirm("ç»å½å¤±æï¼è¯·éæ°ç»å½ï¼", { icon: 4, skin: 'layui-layer-lan', title: "温馨æç¤º", closeBtn: 0, btn: ['éæ°ç»å½'] }, function () { window.location.href = "../../user/login.html"; }); } } //#endregion //#region å表1åå§å function set_InitGrid() { option = { elem: '#mainTable' , toolbar: '#toolbarDemo' , totalRow: true , limit: 500 , height: 500 , loading: false , cols: [[ //å表 { type: 'checkbox', totalRowText: 'å计è¡' } , { type: 'numbers', title: 'åºå·', width: 100, style: "background-color:#efefef4d;" } , { field: 'HItemID', title: 'HItemID', width: 150, hide: "true" } , { field: 'HUserID', title: 'ç¨æ·ä»£ç ', edit: "true", event: "HUser", width: 100 } , { field: 'HUserName', title: 'ç¨æ·åç§°', width: 150, style: "background-color:#efefef4d;" }//f7 , { field: 'HEmpID', title: 'HEmpID', width: 150, hide:"true" } , { field: 'HEmpNumber', title: 'èå代ç ', edit: "true", event: "HEmp", width: 100} , { field: 'HEmpName', title: 'èååç§°', width: 100, style: "background-color:#efefef4d;"} , { fixed: 'right', title: 'æä½', toolbar: '#barDemo', width: 70 } ]] } var rowdata = [{ "HItemID": "0", "HUserID": "", "HUserName": "", "HEmpID": "0", "HEmpNumber": "", "HEmpName": "", }]; option.data = rowdata; table.render(option); } //#endregion //#region æ°å¢é¡µé¢åå§å function Init_setAdd() { //设置æä½ç±»å为 æ°å¢ OperationType = 1; //åå§åå¹¶å设置ï¼å表1 set_InitGrid(); DisPlay_HideColumn(); } //#endregion //#region ç¼è¾é¡µé¢åå§å function RoadBillMain(linterid) { //æ¥è¯¢ç¨æ·å ³èå®¢æ·æ¯å¦åå¨ var ajaxLoad = layer.load(); $.ajax({ url: GetWEBURL() + "/Xt_User/UserRelationEmployeelist_EditInit", async: false, type: "GET", data: { "HItemID": linterid , "user": sessionStorage["HUserName"] }, success: function (result) { if (result.code == 1) { // 说æéªè¯æåäºï¼ var data = result.data[0]; //å表 èµå¼ var rowdata = []; for (var i = 0; i < result.data.length; i++) { rowdata.push( { "HItemID": result.data[i]["HItemID"], "HUserID": result.data[i]["ç¨æ·ä»£ç "], "HUserName": result.data[i]["ç¨æ·åç§°"], "HEmpID": result.data[i]["HEmployeeID"], "HEmpNumber": result.data[i]["èå代ç "], "HEmpName": result.data[i]["èååç§°"] } ); } option.data = rowdata; table.render(option); layer.close(ajaxLoad); } else { layer.close(ajaxLoad); layer.alert(result.msg, { icon: 5, btn: ['éåº'], time: 100000, offset: 't' }); } }, error: function () { layer.close(ajaxLoad); layer.alert("åçé误!", { icon: 5 }); } }); } //#endregion //#region å¼¹çªéæ©æ¹æ³ //#region ç¨æ·éæ©æ¹æ³ function get_checkUser() { //页é¢å±-èªå®ä¹ layer.open({ type: 2, skin: 'layui-layer-rim', //å ä¸è¾¹æ¡ title: 'ç¨æ·å表', closeBtn: 1, shift: 2, area: ['80%', '80%'], maxmin: true, content: ['../../PublicPage/PeopleInformation.html', 'yes'], btn: ['ç¡®å®', 'åæ¶'] , btn1: function (index, layero) { //æé®ãæé®ä¸ãçåè° var iframeWindow = window['layui-layer-iframe' + index] //è·åå¼¹æ¡é¡µé¢ var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//è·åtableçelem:"#test" if (checkStatus.data.length === 0) { return layer.msg('è¯·éæ©æ°æ®'); } $("#UserName").val(checkStatus.data[0].HName); $("#UserID").val(checkStatus.data[0].HNumber); layer.close(layer.index); //å®è·åçå§ç»æ¯ææ°å¼¹åºçæä¸ªå±ï¼å¼æ¯ç±layerå é¨å¨æéå¢è®¡ç®ç } }); } //#endregion //#endregion //#region ä¿å function set_AddNew() { var num = []; for (var i = 0; i < option.data.length; i++) { if (option.data[i] != "") { num.push(option.data[i]) } } //data.field.HOrgID = sessionStorage["OrganizationID"];//ç»ç» //var sMainStr = JSON.stringify(data.field); var sSubStr = JSON.stringify(num); var sMainSub = sSubStr + '&å' + sessionStorage["HUserName"] + '&å' + OperationType; var index = layer.load(); $.ajax({ type: "POST", url: GetWEBURL() + "/Xt_User/UserRelationEmployeelist_Save", async: true, data: { "sMainSub": sMainSub }, dataType: "json", success: function (data) { if (data.count == 1) { layer.close(index); layer.msg(data.Message); option.data = null; table.cache["mainTable"] = null; table.render(option); $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true); } else { layer.close(index); layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); } }, error: function (err) { layer.close(index); layer.msg("é误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); } }); } //#endregion //#region æ°æ®æ ¡éª function AllowLoadData(data) { //æ°å¼æ ¼å¼æ ¡éªå·¥å · var ref = /^\d+(\.\d+)?$/; //éè´æ°æ£åè¡¨è¾¾å¼ var temp = ""; //#region å表 æ°æ®æ£éª for (var i = 0; i < option.data.length; i++) { if (option.data[i]["HUserID"] == "") { layer.msg("第" + i + "è¡ï¼ç¨æ·ä»£ç æªéæ©ï¼"); return false; } if (option.data[i]["HEmpID"] == "0") { layer.msg("第" + i + "è¡ï¼èåæªéæ©ï¼"); return false; } } //#endregion //#region å表 å ³é®åé夿 ¡éª var num = []; for (var i = 0; i < option.data.length; i++) { temp = option.data[i]["HUserID"] + ";" + option.data[i]["HEmpID"]; if ($.inArray(temp, num) == -1) { num.push(temp); } else { layer.msg("第" + (i + 1) + "è¡,ç¨æ·ä»£ç ãèåéå¤!"); return false; } } //#endregion return true; } //#endregion //#region 卿«å°¾å¢å ä¸è¡ function btnAddLine(NewRow) { NewRow.HUserID = $("#UserID").val(); NewRow.HUserName = $("#UserName").val(); //table.cache["mainTable"].push(NewRow); //option.data = table.cache["mainTable"]; option.data = option.data == null ? [] : option.data; option.data.push(NewRow); table.render(option); //rows++; layer.msg('å¢å ä¸è¡æé®ï¼') } //#endregion //#region å¤å¶ä¸è¡ function btnCopyLine(data) { var copydata = JSON.stringify(data); if (data.length <= 0) { layer.msg("è¯·éæ©éè¦å¤å¶çä¸è¡ï¼"); } else if (data.length > 1) { layer.msg("åªè½éæ©å¤å¶ä¸è¡ï¼"); } else { var copydata2 = copydata.substring(1, copydata.length);//å»é¤é¦è¡å符'[' var copyrow = copydata2.substring(0, copydata2.length - 1);//å»é¤æ«å°¾å符']' table.cache["mainTable"].push(JSON.parse(copyrow));//å°å¤å¶çè¡å¼ºè½¬æjson追å å°è¡¨æ ¼ä¸ option.data = table.cache["mainTable"];//å°æ°æ®ç»å®å°dataä¸ //设置å¤å¶å¾å°çè®°å½çå®é ç§°é为0 option.data[option.data.length - 1].HWeight = "0"; table.render(option);//å°æ°æ®æ¸²æå°è¡¨æ ¼ä¸ } } //#endregion //#region è¡¨æ ¼è¡å äºä»¶å é¤ function set_GridDelete(obj) { var data = obj.data; var rowIndex = $(obj.tr).attr("data-index"); if (obj.event === 'del') { layer.confirm('ççå é¤è¡ä¹', function (index) { console.log("ç´¢å¼ä¸º:" + rowIndex); if (rowIndex === '0') { layer.msg('é¦è¡æ æ³å é¤ï¼ï¼ï¼'); } else { //obj.del(); //layer.close(index); var oldData = table.cache["mainTable"]; oldData.splice(obj.tr.data('index'), 1); option.data = oldData; table.render(option); layer.close(index); } }); } } //#endregion //#region è¡å å¿«æ·é®çé function set_GridCellCheck(obj) { $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) { if (event.key == "F7") { //ç¨æ· if (obj.event == "HUser") { layer.open({ type: 2, skin: 'layui-layer-rim', //å ä¸è¾¹æ¡ title: 'ç¨æ·å表', closeBtn: 1, shift: 2, area: ['80%', '80%'], maxmin: true, content: ['../../PublicPage/PeopleInformation.html', 'yes'], btn: ['ç¡®å®', 'åæ¶'] , btn1: function (index, layero) { //æé®ãæé®ä¸ãçåè° var iframeWindow = window['layui-layer-iframe' + index] //è·åå¼¹æ¡é¡µé¢ var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//è·åtableçelem:"#test" if (checkStatus.data.length === 0) { return layer.msg('è¯·éæ©æ°æ®'); } //æ´æ°è¡¨æ ¼ç¼åçæ°æ® obj.update({ "HUserID": checkStatus.data[0].HNumber , "HUserName": checkStatus.data[0].HName }) layer.close(layer.index); //å®è·åçå§ç»æ¯ææ°å¼¹åºçæä¸ªå±ï¼å¼æ¯ç±layerå é¨å¨æéå¢è®¡ç®ç } }); } //èå if (obj.event == "HEmp") { //页é¢å±-èªå®ä¹ //F7éæ©ä¾åºå layer.open({ type: 2, skin: 'layui-layer-rim', //å ä¸è¾¹æ¡ title: 'èåå表', closeBtn: 1, shift: 2, area: ['80%', '80%'], maxmin: true, content: ['../../åºç¡èµæ/å ¬ç¨åºç¡èµæ/Gy_EmployeeList.html?openType=2&HOrgID=' + sessionStorage["OrganizationID"], 'yes'], btn: ['ç¡®å®', 'åæ¶'] , btn1: function (index, layero) { //æé®ãæé®ä¸ãçåè° var iframeWindow = window['layui-layer-iframe' + index] //è·åå¼¹æ¡é¡µé¢ var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//è·åtableçelem:"#test" if (checkStatus.data.length === 0) { return layer.msg('è¯·éæ©æ°æ®'); } //åæ¥æ´æ°è¡¨æ ¼åç¼å对åºçå¼ obj.update({ HEmpID: checkStatus.data[0].HItemID, HEmpNumber: checkStatus.data[0].èå代ç , HEmpName: checkStatus.data[0].èååç§° }); layer.close(layer.index); //å®è·åçå§ç»æ¯ææ°å¼¹åºçæä¸ªå±ï¼å¼æ¯ç±layerå é¨å¨æéå¢è®¡ç®ç } }); } obj.event = ""; return false; } }) } //#endregion //#region å表1ï¼éèå设置 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 å表1ï¼æ¾ç¤ºåæ°æ® function DisPlay_HideColumn() { $.ajax({ url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', type: "GET", data: { "HModName": HModName, "user": sessionStorage["HUserName"] }, async: false, success: function (data1) { if (data1.data.length != 0) { var dataCol = [];//æ°æ®åºæ¥è¯¢åºçåæ°æ® var titleData = ["HItemID","HEmpID"];//ä¸éè¦æ¾ç¤ºçåæ®µ 坿©å± //titleData = []; 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 //#endregion //以䏿¯layui模å }); </script> </body> </html>