"use strict";var fnSetDeptDrop=function(n,t){var i={};return i.OrgID=parent.OrgID,i.DeptID=t||"",g_api.ConnectLite(Service.sys,"GetDepartmentList",i,function(t){if(t.RESULT){var i=t.DATA.rel;n.html(createOptions(i,"DepartmentID","AccountNameSort",!0))}})},fnSetDeptDropWithLimtedDeptId=function(n){var t={};return t.OrgID=parent.OrgID,t.DeptID="",g_api.ConnectLite(Service.sys,"GetDepartmentListNoVoid",t,function(t){if(t.RESULT){var i=t.DATA.rel,r=parent.UserInfo.DepartmentID,u=parent.UserInfo.roles.toLowerCase().indexOf("admin")>-1;u||(i=i.filter(n=>n.ParentDepartmentID===r||n.DepartmentID===r||n.DepartmentID1===r));n.html(createOptions(i,"DepartmentID","AccountNameSort",!0));u||$(n.selector+" option:first").remove()}})},fnSetUserDrop=function(n){var t=[];return $.each(n,function(n,i){i.Effective="";i.Action&&i.Action.toLowerCase()==="add"&&(i.Effective="Y");t.push(g_api.ConnectLite(Service.com,ComFn.GetUserList,{DepartmentID:i.DepartmentID||"",MemberID:i.MemberID||"",UserIDs:i.UserIDs||"",NotUserIDs:i.NotUserIDs||"",ServiceCode:i.ServiceCode||"",Effective:i.Effective||""},function(n){if(n.RESULT){var t=n.DATA.rel;i.Select&&(i.Select.html(createOptions(t,"MemberID","MemberName",i.ShowId||!1)),i.DefultVal&&i.Select.val(i.DefultVal),i.Select2&&i.Select.each(function(){$(this).select2();$(this).next().after($(this))}));i.CallBack&&typeof i.CallBack=="function"&&i.CallBack(t)}}))}),$.whenArray(t)},fnSetArgDrop=function(n){var t=[];return $.each(n,function(n,i){i.ArgClassID&&t.push(g_api.ConnectLite(Service.com,ComFn.GetArguments,{ArgClassID:i.ArgClassID,ParentID:i.ParentID||"",ArgIDs:i.Ids||"",LevelOfArgument:i.Level||-1,OrgID:i.OrgID||""},function(n){if(n.RESULT){var t=n.DATA.rel;if(i.Select){i.Select.html(createOptions(t,"id","text",i.ShowId||!1)).on("change",function(){i.OnChange&&typeof i.OnChange=="function"&&i.OnChange(this.value)});i.DefultVal&&i.Select.val(i.DefultVal);i.Select2&&i.Select.each(function(){$(this).select2();$(this).next().after($(this))})}i.CallBack&&typeof i.CallBack=="function"&&i.CallBack(t)}}))}),$.whenArray(t)},fnSetEpoDrop=function(n){return g_api.ConnectLite("Exhibition_Upd","GetExhibitions",{SN:n.SN||""},function(t){if(t.RESULT){var i=t.DATA.rel;n.Select&&(n.Select.html(createOptions(i,n.IdName||"SN",n.TextName||"ExhibitioFullName",n.ShowId||!1)),n.DefultVal&&n.Select.val(n.DefultVal),n.Select2&&n.Select.each(function(){$(this).select2();$(this).next().after($(this))}));n.CallBack&&typeof n.CallBack=="function"&&n.CallBack(i)}})},fnSetEpoDropWithExhibitionCode=function(n){return g_api.ConnectLite("BillsReport","GetProjects",{},function(t){if(t.RESULT){var i=t.DATA.rel;n.Select&&(n.Select.html(createOptions(i,n.IdName||"id",n.TextName||"text",n.ShowId||!1)),n.DefultVal&&n.Select.val(n.DefultVal),n.Select2&&n.Select.each(function(){$(this).select2();$(this).next().after($(this))}));n.CallBack&&typeof n.CallBack=="function"&&n.CallBack(i)}})},fnSetCustomerWithGuid=function(n){return g_api.ConnectLite(Service.sys,"GetCustomerlist",{},function(t){if(t.RESULT){var i=t.DATA.rel;n.Select&&(n.Select.html(createOptions(i,"id","text",n.ShowId||!1)),n.DefultVal&&n.Select.val(n.DefultVal),n.Select2&&n.Select.each(function(){$(this).select2();$(this).next().after($(this))}));n.CallBack&&typeof n.CallBack=="function"&&n.CallBack(i)}})},fnGetOfficeTempls=function(n){return g_api.ConnectLite(Service.com,"GetOfficeTempls",{TemplID:n.TemplID||""},function(t){if(t.RESULT){var i=t.DATA.rel;n.CallBack&&typeof n.CallBack=="function"&&n.CallBack(i)}})},oPenPops=function(n){var r=null,t=null,u="",i=[];$.each(n.SearchFields,function(t,r){var o=$("",{"class":"col-sm-2 w20p control-label"}),s=$("",{"data-i18n":r.i18nkey}),f=$("
",{"class":"col-sm-3"}),e;switch(r.type){case"text":$("",{type:"text",id:r.id,name:r.id,maxlength:"50","class":"form-control w100p"}).appendTo(f);break;case"select":$("",{id:r.id,name:r.id,"class":"form-control w100p",html:r.html}).appendTo(f)}i.push(o.append(s,":"));i.push(f);(i.length===4||n.SearchFields.length===t+1)&&(e=$("",{"class":"row popsrow"}),e.append(i),u+=e[0].outerHTML,i=[])});u+='