var i18next="undefined"==typeof i18next?parent.top.i18next:i18next,g_db={SupportLocalStorage:function(){"use strict";return typeof localStorage!="undefined"},SetItem:function(n,t){"use strict";var i=!1;return this.SupportLocalStorage()&&(localStorage.setItem(n,t),i=!0),i},GetItem:function(n){"use strict";var t=null;return this.SupportLocalStorage()&&(t=localStorage.getItem(n)),t},RemoveItem:function(n){"use strict";var t=!1;return this.SupportLocalStorage()&&(localStorage.removeItem(n),t=!0),t},GetDic:function(n){"use strict";var i=null,t;return this.SupportLocalStorage()&&(t=localStorage.getItem(n),null!==t&&(i=JSON.parse(t))),i},SetDic:function(n,t){"use strict";var i=!1;return this.SupportLocalStorage()&&(localStorage.setItem(n,JSON.stringify(t)),i=!0),i}},g_gd={webapilonginurl:"/api/Service/GetLogin",webapiurl:"/api/Cmd/GetData",projectname:"Eurotran",projectver:"Origtek",relpath:"",debugmode:window.location.host==="192.168.1.105",debugcolor:"#732C6B",IsEDU:g_db.GetItem("isedu")==="true"},g_ul={GetToken:function(){"use strict";return g_db.GetItem("token")},SetToken:function(n){"use strict";g_db.SetItem("token",n)},GetSignature:function(){"use strict";return g_db.GetItem("signature")},SetSignature:function(n){"use strict";g_db.SetItem("signature",n)},SetLang:function(n){"use strict";g_db.SetItem("lang",n)},GetLang:function(){"use strict";return g_db.GetItem("lang")},SetLoginMethod:function(n){"use strict";g_db.SetItem("LoginMethod",n)},GetLoginMethod:function(){"use strict";return g_db.GetItem("LoginMethod")},IsEDU:function(){"use strict";return g_db.GetItem("isedu")},TraceStackDump:function(){var e={},t={},o=[],n=null,u=0,i=0,f=0,r=null,s=!1;n=arguments;do{if(t={},t.name=n.callee.name,t.parameters=[],f=n.length,f>0)if(r=n["0"],typeof r=="object"&&r.hasOwnProperty("currentTarget"))s=!0,t.buttonclick=r.currentTarget.id;else for(i=0;i0&&o.push($.extend({},t)),n.callee.caller===null)break;n=n.callee.caller.arguments;u=u+1}while(s===!1);return e.stack=o,e}},g_api={ConnectLite:function(n,t,i,r,u,f,e){return window.IsWaiting=e,this.ConnectLiteWithoutToken(n,t,i,r,u,f)},ConnectService:function(n,t,i,r,u,f,e){return window.IsWaiting=e,this.ConnectWebLiteWithoutToken(n,t,i,r,u,f)},ConnectLiteWithoutToken:function(n,t,i,r,u,f){var o={},e={},s=g_ul.GetToken(),h=g_ul.GetLang(),c=g_ul.GetSignature();return e.ORIGID=g_db.GetItem("orgid"),e.USERID=g_db.GetItem("userid"),e.MODULE=n,e.TYPE=t,e.PROJECT=g_gd.projectname,e.PROJECTVER=g_gd.projectver,e.TRACEDUMP=null,i=i||{},g_db.GetItem("dblockDict")!==null&&(i.dblockDict=g_db.GetItem("dblockDict")),e.DATA=i,h!==null&&(e.LANG=h),s!==null&&(e.TOKEN=s),c!==null&&(e.SIGNATURE=c),e.CUSTOMDATA={},window.sProgramId&&(e.CUSTOMDATA.program_id=sProgramId),e.CUSTOMDATA.module_id="webapp",o.url=i.hasOwnProperty("url")?i.url:g_gd.webapiurl,o.successfunc=r,o.dicparameters=e,o.failfunc="function"==typeof u?u:function(n,t,i){alert("ConnectLite Fail jqXHR:"+n+" textStatus:"+t+" errorThrown:"+i)},o.useasync="boolean"==typeof f?f:!0,this.AjaxPost(o)},ConnectWebLiteWithoutToken:function(n,t,i,r,u,f){var o={},e={},s=g_ul.GetToken(),h=g_ul.GetLang(),c=g_ul.GetSignature();return e.ORIGID=g_db.GetItem("orgid"),e.USERID=g_db.GetItem("userid"),e.MODULE="",e.TYPE=t,e.PROJECT=g_gd.projectname,e.PROJECTVER=g_gd.projectver,e.TRACEDUMP=null,g_db.GetItem("dblockDict")!==null&&(i.dblockDict=g_db.GetItem("dblockDict")),e.DATA=i,h!==null&&(e.LANG=h),s!==null&&(e.TOKEN=s),c!==null&&(e.SIGNATURE=c),e.CUSTOMDATA={},window.sProgramId&&(e.CUSTOMDATA.program_id=sProgramId),e.CUSTOMDATA.module_id="webapp",o.url=getWebServiceUrl(n,t),o.successfunc=r,o.dicparameters=e,o.failfunc="function"==typeof u?u:function(n,t,i){alert("ConnectLite Fail jqXHR:"+n+" textStatus:"+t+" errorThrown:"+i)},o.useasync="boolean"==typeof f?f:!0,this.AjaxPost(o)},AjaxPost:function(n){"use strict";var t=$.extend({useasync:!0,successfunc:null,failfunc:null,alwaysfunc:null,url:null,dicparameters:null},n),i=function(n){n.RESULT===-1?layer.alert(i18next.t("message.TokenVerifyFailed"),{icon:0,title:i18next.t("common.Tips")},function(){window.top.location.href="/Page/login.html"}):t.successfunc&&t.successfunc(n)};return $.ajax({type:"POST",url:t.url,data:"="+btoa2(encodeURIComponent(JSON.stringify(t.dicparameters))),success:i,error:t.failfunc,beforeSend:function(n){var i=g_ul.GetToken(),r=$.now(),u=rndnum();n.setRequestHeader("orgid",t.dicparameters.ORIGID);n.setRequestHeader("userid",t.dicparameters.USERID);n.setRequestHeader("token",i);n.setRequestHeader("timestamp",r);n.setRequestHeader("nonce",u)},async:!0!==t.useasync?!1:!0}).always(t.alwaysfunc)}};(function(n,t,r){function o(){var n=location.origin+"/";return t.location.origin||(n=t.location.protocol+"//"+t.location.hostname+(t.location.port?":"+t.location.port:"")),n}function s(n){var t="",r=g_db.GetDic("programList")||[],u=Enumerable.From(r).Where(function(t){return t.ModuleID===n}).First(),i=function(n){var r=e(n);r.ParentID?i(r.ParentID):t=r.ModuleID};return i(u.ParentID),t}function e(n){var t=g_db.GetDic("programList")||[];return Enumerable.From(t).Where(function(t){return t.ModuleID==n&&t.FilePath=="#"}).First()}function h(){showWaiting(typeof IsWaiting=="string"?IsWaiting:undefined)}function c(){closeWaiting();setTimeout(function(){IsWaiting=null},3e3)}if(t.gServerUrl=t.location.origin||o(),t.ComTmp={PageTitle:"/Page/Pop/PageTitle.html"},t.ComFn={W_Com:"comw",W_Web:"web",GetUserList:"GetUserList",GetArguments:"GetArguments",GetSysSet:"GetSysSet",GetSerial:"GetSerialNumber",GetUpdateOrder:"UpdateOrderByValue",SendMail:"SendMail",GetExcel:"CreateExcel",GetList:"QueryList",GetOne:"QueryOne",GetPage:"QueryPage",GetPagePrc:"QueryPageByPrc",GetAdd:"Add",GetUpd:"Update",GetDel:"Delete",GetTran:"UpdateTran",GetCount:"QueryCount",CheckInvoiceNum:"CheckInvoiceNumber"},t.Service={cotrl:"/Controller.ashx",comw:"ComWebService",web:"WebService",com:"Common",opm:"OpmCom",eip:"EipCom",sys:"SysCom",auth:"Authorize"},t.bRequestStorage=!1,t.bLeavePage=!1,t.QueryPageidx=1,t.IsWaiting=null,t.onerror=function(n,t,i,r){console.log(t+" line:"+i+" colno:"+r+" "+n);parent.top.SysSet&&parent.top.SysSet.IsOpenMail==="Y"&&g_api.ConnectLite("Log","ErrorMessage",{ErrorSource:t,Errorlineno:i,Errorcolno:r,ErrorMessage:n},function(){})},t.transLang=function(t){i18next="undefined"==typeof i18next?parent.top.i18next:i18next;var i=t===undefined?n("[data-i18n]"):t.find("[data-i18n]"),r=t===undefined?n("[placeholderid]"):t.find("[placeholderid]");i.each(function(t,i){var u=n(i).attr("data-i18n"),r;u&&(r=i18next.t(u),i.nodeName=="INPUT"&&i.type=="button"?n(i).val(r):n(i).html(r))});r.each(function(t,i){var r=n(i).attr("placeholderid"),u;r&&(u=i18next.t(r),u!==r&&n(i).attr("placeholder",u))})},t.refreshLang=function(n){if(n&&n.length===0)return!1;transLang(n)},t.setLang=function(t,i,r){t&&(g_ul.SetLang(t),i18next="undefined"==typeof i18next?parent.top.i18next:i18next,n.getJSON(gServerUrl+"/Scripts/lang/"+(parent.top.OrgID||"TE")+"/"+t+".json?v=20180801",function(n){var u={};u[t]={translation:n};i18next.init({lng:t,resources:u,useLocalStorage:!1,localStorageExpirationTime:864e5},function(n,t){transLang(i);typeof r=="function"&&r(t)})}))},t.getLanguagePack=function(n){var t=g_ul.GetLang()||"en";return i18next.getResourceBundle(t,"translation").sMsgKey||n},t.getWebServiceUrl=function(n,t){var i="";switch(n){case"aspx":i=t;break;case"cotrl":i="/Controller.ashx?"+t;break;default:i="/WS/"+Service[n]+".asmx/"+t}return i},t.CallAjax=function(i,r,u,f,e,o,s,h){return t.IsWaiting=o===undefined||o===!0?!0:o===!1?null:o,n.ajax({type:"POST",async:s==undefined?!0:!1,url:getWebServiceUrl(i,r),data:JSON.stringify(u),contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){n.d==="-1"||n.d===-1?layer.alert(i18next.t("message.TokenVerifyFailed"),{icon:0,title:i18next.t("common.Tips")},function(){t.top.location.href="/Page/login.html"}):f&&f(n)},beforeSend:function(n){var t=g_db.GetItem("orgid"),i=g_db.GetItem("userid"),r=g_ul.GetToken();n.setRequestHeader("orgid",t);n.setRequestHeader("userid",i);n.setRequestHeader("token",r)},error:e||function(){},global:o===!1?!1:!0}).always(h)},t.CallAjaxCross=function(t,i,r,u,f,e,o){return IsWaiting=e?e:null,n.ajax({type:"POST",async:o==undefined?!0:!1,jsonpCallback:"Callback",url:getWebServiceUrl(t,i),data:r,dataType:"jsonp",success:u||function(){},beforeSend:function(n){var t=g_db.GetItem("orgid"),i=g_db.GetItem("userid"),r=g_ul.GetToken();n.setRequestHeader("orgid",t);n.setRequestHeader("userid",i);n.setRequestHeader("token",r)},error:f||function(n,t,i){console.log(i)},global:e==undefined||e==null?!1:!0})},t.showWaiting=function(i){n.blockUI({message:n('
'+(i||"Waiting...")+"<\/div>"),css:{"font-size":"36px",border:"0px","border-radius":"10px","background-color":"#FFF",padding:"15px 15px",opacity:.5,color:"orange",cursor:"wait","z-index":1000000001},baseZ:1e9});t.setTimeout(n.unblockUI,6e4)},t.closeWaiting=function(t){n(function(){t==undefined&&(t=100);setTimeout(n.unblockUI,t)})},t.Jsonremove=function(t,i,r){return n.grep(t,function(n){return n[i]!=r})},t.Jsonget=function(t,i,r){return n.grep(t,function(n){return n[i]==r})},t.Tostr=function(n){return JSON.stringify(n)},t.DownLoadFile=function(n,i){var r=gServerUrl+"/Controller.ashx";r+="?action=downfile&path="+n;i&&(r+="&filename="+i);t.location.href=r;closeWaiting()},t.EditFile=function(t,i){layer.open({type:1,title:i18next.t("common.EditFile"),shade:.75,maxmin:!0,area:["500px","350px"],content:'
<\/span> <\/div>
<\/div>