'use strict'; var fnPageInit = function () { var oAuditFlag = { 'N': 'common.NotAudit', 'Y': 'common.Audited', 'P': 'common.InAudit', 'A': 'common.AuditAgain', 'Z': 'common.ApplyforUpdateing', 'Q': 'common.NotPass' }, setStateDrop = function () { return g_api.ConnectLite(Service.com, ComFn.GetArguments, { OrgID: 'TE', ArgClassID: 'Area', LevelOfArgument: 1 }, function (res) { if (res.RESULT) { let saState = res.DATA.rel; if (saState.length > 0) { $('#State').append(createOptions(saState, 'id', 'text', true)).select2(); } } }); }, canDo = new CanDo({ sortField: 'CreateDate', sortOrder: 'desc', /** * 當前程式所有ID名稱集合 */ idKeys: ['OrgID', 'guid'], /** * Grid欄位設置(可以是 function) */ gridFields: [ { name: "RowIndex", title: 'common.RowNumber', type: "text", width: 50, align: "center", sorting: false }, { name: "CustomerCName", title: 'Customers_Upd.CustomerCName', type: "text", width: 200 }, { name: "CustomerEName", title: 'Customers_Upd.CustomerEName', type: "text", width: 200 }, { name: "CustomerShotCName", title: 'Customers_Upd.CustomerShotCName', type: "text", width: 100 }, { name: "CustomerNO", title: 'Customers_Upd.CustomerNO', type: "text", align: "center", width: 80 }, { name: "UniCode", title: 'Customers_Upd.UniCode', type: "text", align: "center", width: 80 }, { name: "Contactors", title: 'common.Contactor', type: "text", width: 120, itemTemplate: function (val, item) { var saContactors = JSON.parse(item.Contactors || '[]'), sContactors = ''; if (saContactors.length > 0) { sContactors = Enumerable.From(saContactors).Select("$.FullName").ToArray().join(','); } return sContactors; } }, { name: "Address", title: 'common.Address', type: "text", width: 230 }, { name: "CreateUserName", title: 'common.CreateUser', type: "text", width: 70 }, { name: "CreateDate", title: 'common.CreateDate', type: "text", width: 120, itemTemplate: function (val, item) { return newDate(val); } }, { name: "IsAudit", title: 'common.Audit_Status', type: "text", width: 80, align: "center", itemTemplate: function (val, item) { return i18next.t(oAuditFlag[val]); } }, { name: "Effective", title: 'common.Status', type: "text", width: 50, align: "center", itemTemplate: function (val, item) { return val === 'Y' ? i18next.t('common.Effective') : i18next.t('common.Invalid');// ╠common.Effective⇒有效╣ ╠common.Invalid⇒無效╣ } } ], /** * 打開要匯出的pop選擇匯出類別 */ getExcel: function (pargs) { layer.open({ type: 1, title: i18next.t('common.DownLoadDocuments'),// ╠common.DownLoadDocuments⇒下載文檔╣ area: ['200px', '280px'],//寬度 shade: 0.75,//遮罩 shadeClose: true, btn: [i18next.t('common.Cancel')],// ╠common.Cancel⇒取消╣ content: '\