You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1216 lines
62 KiB

2 years ago
  1. 'use strict';
  2. var sProgramId = getProgramId(),
  3. sQueryPrgId = 'Complaint_Qry',
  4. sEditPrgId = 'Complaint_Upd',
  5. sAction = getUrlParam('Action') || 'Add',
  6. sDataId = getUrlParam('Guid'),
  7. sCheckId = sDataId,
  8. fnPageInit = function () {
  9. var oCurData = { CheckFlows: [], HandleFlows: [], PayeeInfo: [] },
  10. oForm = $('#form_main'),
  11. saCheckOrder_Push = [],
  12. saUsers = [],
  13. sCurAuditFlowId = null,
  14. sCurHandleFlowId = null,
  15. sComplaintType = '',
  16. saExhibitionName = [],
  17. saComplaintSource = [],
  18. saCoopAgent = [],
  19. saGroupUnit = [],
  20. saCustomers = [],
  21. bGoNext = true,
  22. /**
  23. * 獲取當前審核人員
  24. * @param {Object} data 當前審核資料
  25. */
  26. fnGetCurAuditor = function (data) {
  27. var saCheckFlows = $.parseJSON(data.CheckFlows),
  28. saNewList = Enumerable.From(saCheckFlows).GroupBy("$.Order").ToArray(),
  29. bAuditor = false,
  30. bHandle = false,
  31. bAllAudit = false;
  32. if ('B,E'.indexOf(data.DataType) > -1) {//只有審核中或者待經辦的資料才可以出現審核區塊
  33. $.each(saNewList, function (idx, _data) {
  34. var sSignedWay = _data.source[0].SignedWay,
  35. iCount = Enumerable.From(_data.source).Where(function (e) { return (e.SignedDecision === 'Y' || e.SignedDecision === 'O'); }).Count(),
  36. sCurAuditor = Enumerable.From(_data.source).ToString(",", "$.SignedId");
  37. if ((('flow1,flow3'.indexOf(sSignedWay) > -1 && iCount === 0) || (sSignedWay === 'flow2' && iCount !== _data.source.length))) {
  38. if (sCurAuditor.indexOf(parent.UserID) > -1) {
  39. var oCurUser = Enumerable.From(_data.source).Where(function (e) { return e.SignedId === parent.UserID; }).First();
  40. if (sSignedWay === 'flow2' && iCount < _data.source.length - 1) {
  41. bGoNext = false;
  42. }
  43. if (!oCurUser.SignedDecision) {
  44. sCurAuditFlowId = oCurUser.FlowId;
  45. bAuditor = true;
  46. }
  47. }
  48. if (!bAllAudit) {//只要有需要審核的人,就不要檢核是否簽辦
  49. bAllAudit = true;
  50. }
  51. return false;
  52. }
  53. });
  54. if (!bAuditor && !bAllAudit) {//當沒有要審核的人員並且審核全部完成時才會檢核簽辦
  55. var saHandleFlows = $.parseJSON(data.HandleFlows),
  56. sCurAuditor = saHandleFlows[0].SignedId;
  57. if (saHandleFlows[0].SignedDecision !== 'Y' && sCurAuditor === parent.UserID) {
  58. sCurHandleFlowId = saHandleFlows[0].FlowId;
  59. bHandle = true;
  60. }
  61. }
  62. }
  63. return {
  64. IsAuditor: bAuditor,
  65. IsHandler: bHandle
  66. };
  67. },
  68. /**
  69. * 註冊加簽事件
  70. * @param {Number} _grididx 當前Gird 序號
  71. */
  72. fnRegisterAddFlows = function (_grididx) {
  73. $('.flowlink' + _grididx).on('click', function () {
  74. var oOption = {};
  75. oOption.SignedWay = $(this).data('id');
  76. oOption.Callback = function (data) {
  77. if (data.Users.length > 0) {
  78. var oFlow = {};
  79. if (data.FlowType === 'flow1') {
  80. $.each(data.Users, function (idx, user) {
  81. oFlow = {};
  82. oFlow.id = guid();
  83. oFlow.Order = saCheckOrder_Push.length + 1;
  84. oFlow.SignedWay = data.FlowType;
  85. oFlow.SignedMember = [{
  86. id: user.id,
  87. name: user.name,
  88. deptname: user.deptname,
  89. jobname: user.jobname
  90. }];
  91. saCheckOrder_Push.push(oFlow);
  92. });
  93. }
  94. else {
  95. var saSignedMembers = [];
  96. $.each(data.Users, function (idx, user) {
  97. saSignedMembers.push({
  98. id: user.id,
  99. name: user.name,
  100. deptname: user.deptname,
  101. jobname: user.jobname
  102. });
  103. });
  104. oFlow.id = guid();
  105. oFlow.Order = saCheckOrder_Push.length + 1;
  106. oFlow.SignedWay = data.FlowType;
  107. oFlow.SignedMember = saSignedMembers;
  108. saCheckOrder_Push.push(oFlow);
  109. }
  110. saCheckOrder_Push = releaseGridList(saCheckOrder_Push);
  111. $("#jsGrid" + _grididx).jsGrid("loadData");
  112. }
  113. };
  114. oPenUserListPop(oOption);
  115. });
  116. },
  117. /**
  118. * 獲取資料
  119. */
  120. fnGet = function () {
  121. return g_api.ConnectLite(sQueryPrgId, ComFn.GetOne,
  122. {
  123. Guid: sDataId
  124. },
  125. function (res) {
  126. if (res.RESULT) {
  127. var oRes = res.DATA.rel,
  128. saFlowsText = [],
  129. sDataType = '';
  130. if (oRes.DataType === 'C-O') {
  131. sDataType = '(' + i18next.t("common.HasReEdited") + ')';// ╠common.HasReEdited⇒已抽單╣
  132. }
  133. else if (oRes.DataType === 'D-O') {
  134. sDataType = '(' + i18next.t("common.HasReturned") + ')';// ╠common.HasReturned⇒已退件╣
  135. }
  136. else if (oRes.DataType === 'X') {
  137. sDataType = '(' + i18next.t("common.HasVoid") + ')';// ╠common.HasVoid⇒已作廢╣
  138. }
  139. //根據帳單狀態,移除抽單按鈕(扣除已經辦只能admin抽單)
  140. fnCheckReEdit(oRes.DataType, oRes.CreateUser);
  141. if (oRes.CreateUser !== parent.UserID) {
  142. $('#Toolbar_Copy').remove();
  143. }
  144. if ('B,Y'.indexOf(oRes.DataType) === -1) {
  145. $('#Toolbar_Void').remove();
  146. }
  147. var SuperAuditor = parent.SysSet.InvoiceApplySuperAuditor.indexOf(parent.UserID) > -1;
  148. var oCheck = fnGetCurAuditor(oRes);
  149. if (oCheck.IsAuditor) {
  150. $('#IsAuditor').show();
  151. }
  152. if (oCheck.IsHandler) {
  153. $('#IsHandler').show();
  154. }
  155. if (oCheck.IsAuditor || oCheck.IsHandler) {
  156. $('.submitdecision').click(function () {
  157. var sSubmitAction = $(this).data('id');
  158. fnSubmitDecision(sSubmitAction);
  159. });
  160. }
  161. //條件:經辦中、SuperAuditor、未經辦(最後一關)
  162. /* if ("B".indexOf(oRes.DataType) > -1 && SuperAuditor && !oCheck.IsHandler) {
  163. if (!oCheck.IsAuditor) {
  164. $('#SuperAuditor').show();
  165. $('.submitdecisionforall').click(function () {
  166. fnSubmitDecisionForAll();
  167. });
  168. }
  169. } */
  170. if (oRes.VoidReason) {
  171. $('#VoidReason').text(oRes.VoidReason);
  172. $('.VoidReason').show();
  173. }
  174. if (oRes.CrosssignTurn === 'N') {
  175. $('.crosssignturn').remove();
  176. }
  177. oCurData = oRes;
  178. console.log("data:", oCurData);
  179. oCurData.CheckOrder = $.parseJSON(oCurData.CheckOrder);
  180. oCurData.CheckFlows = $.parseJSON(oCurData.CheckFlows);
  181. oCurData.HandleFlows = $.parseJSON(oCurData.HandleFlows);
  182. setFormVal(oForm, oRes);
  183. $('#Applicant').text(oCurData.CreateUserName + '(' + oCurData.CreateUser + ') ' + oCurData.DepartmentName);
  184. $('.complaintTitle').text(oCurData.ComplaintTitle);
  185. switch(oCurData.ComplaintType){
  186. case "1":
  187. sComplaintType = "貨損";
  188. break;
  189. case "2":
  190. sComplaintType = "延誤";
  191. break;
  192. case "3":
  193. sComplaintType = "遺失";
  194. break;
  195. case "4":
  196. sComplaintType = "抱怨";
  197. break;
  198. }
  199. $('#ComplaintType').text(sComplaintType);
  200. $('#ComplaintNumber').text(oCurData.ComplaintNumber);
  201. saExhibitionName = Enumerable.From(saExhibitionName).Where(function (e) { return e.SN == oCurData.ExhibitionName; }).ToArray();
  202. $('#ExhibitionName').text(saExhibitionName[0].ExhibitioShotName_TW);
  203. saComplaintSource = Enumerable.From(saComplaintSource).Where(function (e) { return e.id == oCurData.ComplaintSource; }).ToArray();
  204. $('#ComplaintSource').text(saComplaintSource[0].text);
  205. if(oCurData.CoopAgent != "" && oCurData.CoopAgent != null){
  206. saCoopAgent = Enumerable.From(saCoopAgent).Where(function (e) { return e.guid == oCurData.CoopAgent; }).ToArray();
  207. $('#CoopAgent').text(saCoopAgent[0].CustomerShotCName);
  208. }
  209. if(oCurData.GroupUnit != "" && oCurData.GroupUnit != null){
  210. saGroupUnit = Enumerable.From(saGroupUnit).Where(function (e) { return e.guid == oCurData.GroupUnit; }).ToArray();
  211. $('#GroupUnit').text(saGroupUnit[0].CustomerShotCName);
  212. }
  213. saCustomers = Enumerable.From(saCustomers).Where(function (e) { return e.guid == oCurData.CustomerCName; }).ToArray();
  214. if(saCustomers.length > 0){
  215. $('#CustomerCName').text(saCustomers[0].CustomerCName);
  216. } else {
  217. $('#CustomerCName').text("");
  218. }
  219. $('#Department').text(oCurData.Department);
  220. $('#Complainant').text(oCurData.Complainant);
  221. $('#Jobtitle').text(oCurData.Jobtitle);
  222. $('#Telephone1').text(oCurData.Telephone1);
  223. $('#Telephone2').text(oCurData.Telephone2);
  224. $('#Email1').text(oCurData.Email1);
  225. $('#Email2').text(oCurData.Email2);
  226. $('#DataType').text(sDataType);
  227. $('#Payee').text(oCurData.PayeeName);
  228. $('#Handle_Person').text(oCurData.Handle_PersonName);// ╠common.Important_1⇒普通╣ ╠common.Important_2⇒重要╣ ╠common.Important_3⇒很重要╣
  229. $('#Important').text(oCurData.Important === '1' ? i18next.t("common.Important_1") : oCurData.Important === '2' ? i18next.t("common.Important_2") : i18next.t("common.Important_3"));
  230. $('#SignedNumber').text(oCurData.SignedNumber);
  231. $('#PaymentTime').val(newDate(oCurData.PaymentTime, true));
  232. $('[name="PaymentWay"]').each(function () {
  233. var radio = $(this).parents('.radio');
  234. if (!this.checked) {
  235. radio.next().remove();
  236. }
  237. else {
  238. radio.next().addClass('show-text');
  239. }
  240. radio.remove();
  241. });
  242. $.each(oCurData.CheckOrder, function (idx, order) {
  243. var sFlowType = i18next.t('common.' + order.SignedWay);
  244. if (order.SignedWay !== 'flow1') {
  245. saFlowsText.push(sFlowType + '(' + Enumerable.From(order.SignedMember).ToString(",", "$.name") + ')');
  246. }
  247. else {
  248. saFlowsText.push(Enumerable.From(order.SignedMember).ToString(",", "$.name"));
  249. }
  250. });
  251. $('#Recipient').text(saFlowsText.join('->'));
  252. fnGetFiles($('#AdditionalFiles'), oCurData.Guid, oCurData.RelationId, oCurData.ExFeild1, sProgramId);//加載附件
  253. fnUpload();//初始化上傳控件(審批與簽辦)
  254. fnRead();//如果是被通知的人,則修改為已閱讀狀態
  255. $("#jsGrid").jsGrid("loadData");
  256. $("#jsGrid1").jsGrid("loadData");
  257. $("#jsGrid2").jsGrid("loadData");
  258. $('[name="SignedDecision"]').click(function () {
  259. if (this.value === 'O') {
  260. $('#addotheraudit').slideDown();
  261. }
  262. else {
  263. $('#addotheraudit').slideUp();
  264. }
  265. });
  266. $('[name="HandleDecision"]').click(function () {
  267. if (this.value === 'O') {
  268. $('#addotherhandle').slideDown();
  269. }
  270. else {
  271. $('#addotherhandle').slideUp();
  272. }
  273. });
  274. }
  275. });
  276. },
  277. /**
  278. * 複製
  279. */
  280. fnCopy = function () {
  281. var data = oCurData;
  282. data = packParams(data);
  283. if (data.DataType === 'D-O') {
  284. data.RelationId = data.Guid;
  285. }
  286. else {
  287. delete data.RelationId;
  288. }
  289. //data.OrgID = parent.OrgID;
  290. data.Guid = guid();
  291. //data.SignedNumber = 'SerialNumber|' + parent.UserInfo.OrgID + '|IAP|MinYear|3|' + parent.UserInfo.ServiceCode + '|' + parent.UserInfo.ServiceCode;
  292. data.CheckFlows = fnCheckFlows(data, false, true, saUsers);
  293. data.HandleFlows = fnHandleFlows(data, saUsers);
  294. data.CheckOrder = JSON.stringify(data.CheckOrder);
  295. data.PayeeInfo = JSON.stringify(data.PayeeInfo);
  296. //data.RemittanceInformation = JSON.stringify(data.RemittanceInformation);
  297. data.DataType = 'A';
  298. data.IsHandled = 'N';
  299. //data.PayeeType = 'P';
  300. data.Inspectors = '';
  301. data.Reminders = '';
  302. data.VoidReason = '';
  303. data.Flows_Lock = data.Flows_Lock || 'N';
  304. data.Handle_Lock = data.Handle_Lock || 'N';
  305. data.ExhibitionNO = data.ExhibitionName;
  306. data.CustomerId = data.CustomerCName;
  307. delete data.RowIndex;
  308. delete data.ApplicantName;
  309. delete data.Handle_PersonName;
  310. delete data.DeptName;
  311. delete data.PaymentTime;
  312. delete data.PaymentType;
  313. delete data.CheckNumber;
  314. delete data.PayeeCode;
  315. delete data.CustomerNO;
  316. delete data.CreateUserName;
  317. delete data.ModifyUserName;
  318. if (!data.EffectTime) {
  319. delete data.EffectTime;
  320. }
  321. delete data.PayeeInfo;
  322. delete data.ExhibitionName;
  323. delete data.CustomerCName;
  324. delete data.ExhibitioShotName_TW;
  325. CallAjax(ComFn.W_Com, ComFn.GetAdd, {
  326. Params: {
  327. complaint: data
  328. }
  329. }, function (res) {
  330. if (res.d > 0) {
  331. showMsgAndGo(i18next.t("message.Copy_Success"), sEditPrgId, '?Action=Upd&Guid=' + data.Guid); // ╠message.Copy_Success⇒複製成功╣
  332. }
  333. else {
  334. showMsg(i18next.t("message.Copy_Failed"), 'error'); // ╠message.Copy_Failed⇒複製失敗╣
  335. }
  336. }, function () {
  337. showMsg(i18next.t("message.Copy_Failed"), 'error'); // ╠message.Copy_Failed⇒複製失敗╣
  338. });
  339. },
  340. /**
  341. * 資料作廢
  342. */
  343. fnVoid = function () {
  344. layer.open({
  345. type: 1,
  346. title: i18next.t('common.Toolbar_Void'),// ╠common.Toolbar_Void⇒作廢╣
  347. shade: 0.75,
  348. maxmin: true, //开启最大化最小化按钮
  349. area: ['500px', '250px'],
  350. content: '<div class="pop-box">\
  351. <textarea name="VoidContent" id="VoidContent" style="min-width:300px;" class="form-control" rows="5" cols="20"></textarea>\
  352. </div>',
  353. btn: [i18next.t('common.Confirm'), i18next.t('common.Cancel')],//╠common.Confirm⇒確定╣╠common.Cancel⇒取消╣
  354. success: function (layero, index) {
  355. },
  356. yes: function (index, layero) {
  357. var data = {
  358. DataType: 'X',
  359. VoidReason: $('#VoidContent').val()
  360. };
  361. if (!$('#VoidContent').val()) {
  362. showMsg(i18next.t("message.VoidReason_Required")); // ╠message.VoidReason_Required⇒請填寫作廢原因╣
  363. return false;
  364. }
  365. CallAjax(ComFn.W_Com, ComFn.GetUpd, {
  366. Params: {
  367. complaint: {
  368. values: data,
  369. keys: { Guid: sDataId }
  370. }
  371. }
  372. }, function (res) {
  373. if (res.d > 0) {
  374. DelTask(sDataId);
  375. showMsgAndGo(i18next.t('message.Void_Success'), sProgramId, '?Action=Upd&Guid=' + oCurData.Guid);// ╠message.Void_Success⇒作廢成功╣
  376. }
  377. else {
  378. showMsg(i18next.t('message.Void_Failed'), 'error'); // ╠message.Void_Failed⇒作廢失敗╣
  379. }
  380. });
  381. layer.close(index);
  382. }
  383. });
  384. },
  385. /**
  386. * 讀取
  387. */
  388. fnRead = function () {
  389. var bToUpd = false;
  390. $.each(oCurData.CheckFlows, function (idx, _data) {
  391. if (_data.SignedId === parent.UserID && _data.SignedWay === 'flow4' && _data.SignedDecision === 'T') {
  392. _data.SignedDecision = 'R';
  393. bToUpd = true;
  394. return false;
  395. }
  396. });
  397. if (bToUpd) {
  398. CallAjax(ComFn.W_Com, ComFn.GetUpd, {
  399. Params: {
  400. invoiceapplyinfo: {
  401. values: { CheckFlows: JSON.stringify(oCurData.CheckFlows) },
  402. keys: { Guid: sDataId }
  403. }
  404. }
  405. });
  406. }
  407. },
  408. /**
  409. * 抽單
  410. */
  411. fnReEdit = function () {
  412. var data = {};
  413. data.DataType = 'C-O';
  414. data = packParams(data, 'upd');
  415. CallAjax(ComFn.W_Com, ComFn.GetUpd, {
  416. Params: {
  417. complaint: {
  418. values: data,
  419. keys: { Guid: sDataId }
  420. }
  421. }
  422. }, function (res) {
  423. if (res.d > 0) {
  424. showMsg(i18next.t("message.ReEdit_Success"), 'success'); // ╠message.ReEdit_Success⇒抽單成功╣
  425. CallAjax(ComFn.W_Com, ComFn.GetUpd, {
  426. Params: {
  427. task: {
  428. values: { DataType: 'O' },
  429. keys: { SourceID: sDataId }
  430. }
  431. }
  432. });
  433. fnGet();
  434. }
  435. else {
  436. showMsg(i18next.t('message.ReEdit_Failed'), 'error'); // ╠message.ReEdit_Failed⇒抽單失敗╣
  437. }
  438. }, function () {
  439. showMsg(i18next.t('message.ReEdit_Failed'), 'error'); // ╠message.ReEdit_Failed⇒抽單失敗╣
  440. });
  441. },
  442. /*
  443. * 提交決定謙和所有人(該使用者之前)
  444. */
  445. fnSubmitDecisionForAll = function () {
  446. var data = getFormSerialize(oForm);
  447. g_api.ConnectLite(sEditPrgId, 'ComplaintAuditAll', {
  448. Guid: oCurData.Guid,
  449. AutoSignedDecision: data.AutoSignedDecision,
  450. AutoSignedOpinion: data.AutoSignedOpinion
  451. }, function (res) {
  452. var action = 'SubmitDecisionForAll'
  453. if (res.RESULT) {
  454. showMsgAndGo(i18next.t('message.' + action + '_Success'), sProgramId, '?Action=Upd&Guid=' + oCurData.Guid);// ╠message.Void_Success⇒作廢成功╣
  455. parent.msgs.server.pushTips(parent.fnReleaseUsers(res.DATA.rel));
  456. }
  457. else {
  458. showMsg(i18next.t('message.' + action + '_Failed') + '<br>' + res.MSG, 'error'); // ╠message.Signed_Failed⇒簽核失敗╣ ╠message.Handle_Failed⇒簽辦失敗╣
  459. }
  460. }, function () {
  461. showMsg(i18next.t('message.' + action + '_Failed'), 'error'); // ╠message.Signed_Failed⇒簽核失敗╣ ╠message.Handle_Failed⇒簽辦失敗╣
  462. });
  463. },
  464. /**
  465. * 提交決定
  466. * @param {String} action 簽核 or 經辦
  467. */
  468. fnSubmitDecision = function (action) {
  469. var data = getFormSerialize(oForm),
  470. saNewCheckFlows = clone(oCurData.CheckFlows),
  471. saNewHandleFlows = clone(oCurData.HandleFlows),
  472. saNewCheckOrderPush = clone(saCheckOrder_Push),
  473. saAdds = [],//加簽核順序
  474. saNextUsers = [],//下組簽核人員
  475. saTipsUsers = [],//需要通知的人員
  476. saNextSignedWays = [],//下組需要處理的動作
  477. iCurOder = 0,//當前順序
  478. sHandlePerson = "";//經辦人
  479. if (action === 'Signed') {
  480. if (data.SignedDecision === 'N' && !data.SignedOpinion) {
  481. showMsg(i18next.t("message.SignedOpinion_required")); // ╠message.SignedOpinion_required⇒請填寫簽核意見╣
  482. return false;
  483. }
  484. else if (data.SignedDecision === 'O' && saCheckOrder_Push.length === 0) {
  485. showMsg(i18next.t("message.CheckOrderPush_required")); // ╠message.CheckOrderPush_required⇒請選擇加簽人員╣
  486. return false;
  487. }
  488. var oCurFlow = Enumerable.From(oCurData.CheckFlows).Where(function (e) { return e.FlowId == sCurAuditFlowId; }).First(),
  489. oNewCurFlow = clone(oCurFlow);
  490. iCurOder = oCurFlow.Order;
  491. $.each(saNewCheckOrderPush, function (idx, _push) {
  492. _push.Order = idx + 1 + iCurOder;
  493. });
  494. $.each(saNewCheckFlows, function (idx, _flow) {
  495. if (sCurAuditFlowId === _flow.FlowId) {
  496. _flow.SignedDecision = data.SignedDecision;
  497. _flow.SignedOpinion = data.SignedOpinion;
  498. _flow.SignedDate = newDate();
  499. if (data.SignedDecision === 'O') {
  500. _flow.SignedPush = saCheckOrder_Push;
  501. }
  502. }
  503. if (data.SignedDecision === 'O' && _flow.Order > iCurOder) {
  504. _flow.Order = _flow.Order + saNewCheckOrderPush.length;
  505. if (data.NoreTurn) {//如果再回傳給自己的話排序再增加一個值
  506. _flow.Order++;
  507. }
  508. else {//如果加簽核流程最後一個是通知,並且原流程下一個也是通知的話就合併新舊排序
  509. if (saNewCheckFlows[saNewCheckOrderPush.length - 1].SignedWay === 'flow4' && saNewCheckFlows[iCurOder + 1].SignedWay === saNewCheckFlows[saNewCheckOrderPush.length - 1].SignedWay) {
  510. _flow.Order--;
  511. }
  512. }
  513. }
  514. });
  515. saAdds = fnCheckFlows({ CheckOrder: saNewCheckOrderPush }, false, false, saUsers);
  516. if (data.SignedDecision === 'O' && data.NoreTurn) {
  517. oNewCurFlow.Order = oNewCurFlow.Order + saNewCheckOrderPush.length + 1;
  518. oNewCurFlow.FlowId = guid();
  519. saAdds.push(oNewCurFlow);
  520. }
  521. }
  522. else {
  523. if (data.HandleDecision === 'O' && saCheckOrder_Push.length === 0) {
  524. showMsg(i18next.t("message.CheckOrderPush_required")); // ╠message.CheckOrderPush_required⇒請選擇加簽人員╣
  525. return false;
  526. }
  527. iCurOder = saNewCheckFlows[saNewCheckFlows.length - 1].Order;//如果是签辦的話當前順序就是原本流程的最大順序
  528. $.each(saNewHandleFlows, function (idx, _flow) {
  529. if (sCurHandleFlowId === _flow.FlowId) {
  530. _flow.SignedDecision = data.HandleDecision;
  531. _flow.SignedOpinion = data.HnadleOpinion;
  532. _flow.SignedDate = newDate();
  533. if (data.HandleDecision === 'O') {
  534. _flow.SignedPush = saCheckOrder_Push;
  535. }
  536. if (data.HandleDecision === 'Y') {
  537. _flow.SignedPush = null;
  538. }
  539. }
  540. });
  541. if (data.HandleDecision === 'O') {
  542. $.each(saNewCheckOrderPush, function (idx, _push) {
  543. _push.Order = idx + saNewCheckFlows[saNewCheckFlows.length - 1].Order + 1;
  544. });
  545. saAdds = fnCheckFlows({ CheckOrder: saNewCheckOrderPush }, false, false, saUsers);
  546. }
  547. }
  548. saNewCheckFlows = saNewCheckFlows.concat(saAdds);
  549. saNewCheckFlows = Enumerable.From(saNewCheckFlows).OrderBy("$.Order").ToArray();
  550. var _List = Enumerable.From(saNewCheckFlows).GroupBy("$.Order").ToArray();
  551. saNewCheckFlows = [];
  552. $.each(_List, function (idx, _list) {
  553. //找到要通知的人
  554. var sSignedWay = _list.source[0].SignedWay;
  555. var LastOne = iCurOder >= _List.length
  556. if (idx === iCurOder && !LastOne) {
  557. switch (sSignedWay) {
  558. case "flow1":
  559. case "flow2":
  560. case "flow3":
  561. {
  562. saNextUsers = Enumerable.From(_list.source).Select("$.SignedId").ToArray();
  563. saNextSignedWays.push(sSignedWay);
  564. }
  565. break;
  566. case "flow4":
  567. { //不能算通知到
  568. $.each(_list.source, function (i, _source) {
  569. _source.SignedDecision = 'T';
  570. _source.SignedDate = newDate();
  571. });
  572. saTipsUsers = Enumerable.From(_list.source).Select("$.SignedId").ToArray();
  573. saNextSignedWays.push(sSignedWay);
  574. ++iCurOder
  575. }
  576. break;
  577. default:
  578. break;
  579. }
  580. }
  581. saNewCheckFlows = saNewCheckFlows.concat(_list.source);
  582. });
  583. //Flow => Handle => END
  584. if (action != 'Handle') {
  585. var CheckNextUser = saNextUsers.length === 0;
  586. if (CheckNextUser && iCurOder === _List.length) {
  587. sHandlePerson = saNewHandleFlows[0].SignedId;
  588. saNextSignedWays.push("flow5");
  589. }
  590. }
  591. g_api.ConnectLite(sEditPrgId, 'ComplaintAudit', {
  592. Guid: oCurData.Guid,
  593. Action: action,
  594. GoNext: bGoNext ? 'Y' : 'N',
  595. HandlePerson: sHandlePerson,
  596. NextSignedWays: JSON.stringify(saNextSignedWays),
  597. NextUsers: JSON.stringify(saNextUsers),
  598. TipsUsers: JSON.stringify(saTipsUsers),
  599. CheckFlows: JSON.stringify(saNewCheckFlows),
  600. HandleFlows: JSON.stringify(saNewHandleFlows),
  601. SignedDecision: data.SignedDecision,
  602. HandleDecision: data.HandleDecision
  603. }, function (res) {
  604. if (res.RESULT) {
  605. showMsgAndGo(i18next.t('message.' + action + '_Success'), sProgramId, '?Action=Upd&Guid=' + oCurData.Guid);// ╠message.Void_Success⇒作廢成功╣
  606. parent.msgs.server.pushTips(parent.fnReleaseUsers(res.DATA.rel));
  607. }
  608. else {
  609. showMsg(i18next.t('message.' + action + '_Failed') + '<br>' + res.MSG, 'error'); // ╠message.Signed_Failed⇒簽核失敗╣ ╠message.Handle_Failed⇒簽辦失敗╣
  610. }
  611. }, function () {
  612. showMsg(i18next.t('message.' + action + '_Failed'), 'error'); // ╠message.Signed_Failed⇒簽核失敗╣ ╠message.Handle_Failed⇒簽辦失敗╣
  613. });
  614. },
  615. /**
  616. * 上傳附件
  617. * @param {Array} files 上傳的文件
  618. */
  619. fnUpload = function (files) {
  620. var option = {};
  621. option.input = $('#fileInput1');
  622. option.theme = 'dragdropbox';
  623. option.folder = 'Complaint';
  624. option.type = 'list';
  625. option.parentid = sCurAuditFlowId;
  626. if (files) {
  627. option.files = files;
  628. }
  629. fnUploadRegister(option);
  630. option.input = $('#fileInput2');
  631. option.parentid = sCurHandleFlowId;
  632. fnUploadRegister(option);
  633. },
  634. /**
  635. * 獲取客訴來源
  636. */
  637. setComplaintSourceDrop = function () {
  638. return g_api.ConnectLite(Service.com, ComFn.GetArguments, {
  639. OrgID: 'TE',
  640. ArgClassID: 'CRMComplaintSource'
  641. }, function (res) {
  642. if (res.RESULT) {
  643. saComplaintSource = res.DATA.rel;
  644. /* if (QueryData.length > 0) {
  645. $('#ComplaintSource').append(createOptions(QueryData, 'id', 'text', true));
  646. } */
  647. }
  648. });
  649. },
  650. /**
  651. * 獲取組團單位
  652. */
  653. fnSetGroupUnit = function () {
  654. g_api.ConnectLite('Complaint_Qry', 'GetGroupUnit', {}, function (res) {
  655. if (res.RESULT) {
  656. saGroupUnit = res.DATA.rel;
  657. /* var saList = res.DATA.rel;
  658. var sOptions = createOptions(saList, 'guid', 'CustomerShotCName');
  659. $('#GroupUnit').html(sOptions); */
  660. }
  661. });
  662. },
  663. /**
  664. * 獲取配合代理
  665. */
  666. fnSetCoopAgent = function () {
  667. g_api.ConnectLite('Complaint_Qry', 'GetCoopAgent', {}, function (res) {
  668. if (res.RESULT) {
  669. saCoopAgent = res.DATA.rel;
  670. /* var saList = res.DATA.rel;
  671. var sOptions = createOptions(saList, 'guid', 'CustomerShotCName');
  672. $('#CoopAgent').html(sOptions); */
  673. }
  674. });
  675. },
  676. /**
  677. * 獲取客戶名稱
  678. */
  679. fnSetCustomers = function () {
  680. g_api.ConnectLite('Complaint_Qry', 'GetCustomers', {}, function (res) {
  681. if (res.RESULT) {
  682. saCustomers = res.DATA.rel;
  683. /* var saList = res.DATA.rel;
  684. var sOptions = createOptions(saList, 'guid', 'CustomerCName');
  685. $('#CustomerCName').html(sOptions); */
  686. }
  687. });
  688. },
  689. /**
  690. * ToolBar 按鈕事件 function
  691. * @param {Object} inst 按鈕物件對象
  692. * @param {Object} e 事件對象
  693. */
  694. fnButtonHandler = function (inst, e) {
  695. var sId = inst.id;
  696. switch (sId) {
  697. case "Toolbar_Qry":
  698. break;
  699. case "Toolbar_Save":
  700. break;
  701. case "Toolbar_ReAdd":
  702. break;
  703. case "Toolbar_Clear":
  704. clearPageVal();
  705. break;
  706. case "Toolbar_Leave":
  707. pageLeave();
  708. break;
  709. case "Toolbar_Add":
  710. break;
  711. case "Toolbar_Upd":
  712. break;
  713. case "Toolbar_Copy":
  714. fnRefreshFlowsThenCopy(oCurData,fnCopy);
  715. break;
  716. case "Toolbar_Void":
  717. fnVoid();
  718. break;
  719. case "Toolbar_ReEdit":
  720. // ╠message.CheckReEdit⇒確定要抽單嗎?╣ ╠common.Tips⇒提示╣
  721. layer.confirm(i18next.t('message.CheckReEdit'), { icon: 3, title: i18next.t('common.Tips') }, function (index) {
  722. fnReEdit();
  723. layer.close(index);
  724. });
  725. break;
  726. case "Toolbar_Del": // ╠message.ConfirmToDelete⇒確定要刪除嗎 ?╣ ╠common.Tips⇒提示╣
  727. break;
  728. case "Toolbar_Print":
  729. fnPrePrint($(".panel-info"));
  730. break;
  731. default:
  732. alert("No handle '" + sId + "'");
  733. break;
  734. }
  735. },
  736. /*
  737. * 初始化 function
  738. */
  739. init = function () {
  740. var saCusBtns = null;
  741. if (sAction === 'Upd') {
  742. saCusBtns = [
  743. {
  744. id: 'Toolbar_ReEdit',
  745. value: 'common.ReEdit'// ╠common.ReEdit⇒抽單╣
  746. },
  747. {
  748. id: 'Toolbar_Copy',
  749. value: 'common.Toolbar_Copy'// ╠common.Toolbar_Copy⇒複製╣
  750. }];
  751. }
  752. commonInit({
  753. PrgId: sProgramId,
  754. ButtonHandler: fnButtonHandler,
  755. Buttons: saCusBtns,
  756. GoTop: true
  757. });
  758. $.whenArray([
  759. fnSetUserDrop([
  760. {
  761. CallBack: function (data) {
  762. saUsers = data;
  763. }
  764. }
  765. ]),
  766. setComplaintSourceDrop(),
  767. fnSetCoopAgent(),
  768. fnSetGroupUnit(),
  769. fnSetCustomers(),
  770. fnSetEpoDrop({
  771. CallBack: function (data) {
  772. saExhibitionName = data;
  773. /* var sOptionHtml_PrjCode = createOptions(data, 'ExhibitionCode', 'ExhibitioShotName_TW');
  774. $('#ExhibitionName').html(sOptionHtml_PrjCode); */
  775. }
  776. }),
  777. ]).done(function () {
  778. fnGet();
  779. });
  780. $("#jsGrid1").jsGrid({
  781. width: "100%",
  782. height: "auto",
  783. autoload: true,
  784. pageLoading: true,
  785. pageIndex: 1,
  786. pageSize: 10000,
  787. rowClass: function (item, itemIndex) {
  788. var sRowClass = '';
  789. if (oCurData.CheckFlows.length !== itemIndex + 1) {
  790. sRowClass = item.Line ? 'grid-cuscell first-cell' : 'grid-cuscell';
  791. }
  792. else {
  793. sRowClass = 'last-cell';
  794. }
  795. return sRowClass;
  796. },
  797. fields: [
  798. {
  799. type: "Icon", width: 50, align: "center",
  800. itemTemplate: function (val, item) {
  801. var oIcon = {
  802. flow2: '<img src="../../images/flow2_View.gif">',
  803. flow3: '<img src="../../images/flow3_View.gif">',
  804. flow4: '<img src="../../images/flow4.gif">'
  805. };
  806. return item.Icon ? oIcon[item.SignedWay] || '' : '';
  807. }
  808. },
  809. {
  810. name: "Order", title: 'common.Order', width: 50, align: "center",
  811. itemTemplate: function (val, item) {
  812. return val < 10 ? '0' + val : val;
  813. }
  814. },
  815. {
  816. name: "SignedMember", title: 'common.SignedMember', width: 150,
  817. itemTemplate: function (val, item) {
  818. return $('<a>', { html: item.Department + ' ' + item.Jobtitle + '<br>' + item.SignedMember + (item.ParentId == '0' ? '(' + i18next.t("common.AgentPerson") + ')' : '') });// ╠common.CheckReEdit⇒代理人╣
  819. }
  820. },
  821. {
  822. name: "SignedDecision", title: 'common.Decision', width: 100,
  823. itemTemplate: function (val, item) {
  824. var sVal = val;
  825. if (val === 'Y') {
  826. sVal = i18next.t("common.Agree");// ╠common.Agree⇒同意╣
  827. }
  828. else if (val === 'N') {
  829. sVal = i18next.t("common.NotAgree");// ╠common.NotAgree⇒不同意╣
  830. }
  831. else if (val === 'O') {
  832. sVal = i18next.t("common.AddOther");// ╠common.AddOther⇒先加簽╣
  833. }
  834. else if (val === 'T') {
  835. sVal = i18next.t("common.HasNotice");// ╠common.HasNotice⇒已通知╣
  836. }
  837. else if (val === 'R') {
  838. sVal = i18next.t("common.HasRead");// ╠common.HasRead⇒已閱讀╣
  839. }
  840. return $('<a>', { html: sVal });
  841. }
  842. },
  843. {
  844. name: "SignedOpinion", title: 'common.SignedOpinion', width: 450,
  845. itemTemplate: function (val, item) {
  846. var saVal = [],
  847. oDiv = $('<div>');
  848. if (item.SignedPush) {
  849. var saFlowsPush = item.SignedPush,
  850. saFlowsPushText = [],
  851. sFlowsPushText = '';
  852. $.each(saFlowsPush, function (idx, flow) {
  853. var sFlowType = i18next.t('common.' + flow.SignedWay);
  854. if (flow.SignedWay !== 'flow1') {
  855. saFlowsPushText.push(sFlowType + '(' + Enumerable.From(flow.SignedMember).ToString(",", "$.name") + ')');
  856. }
  857. else {
  858. saFlowsPushText.push(Enumerable.From(flow.SignedMember).ToString(",", "$.name"));
  859. }
  860. });
  861. sFlowsPushText = saFlowsPushText.join(' → ');
  862. saVal.push($('<a>', { html: sFlowsPushText }));
  863. saVal.push('<br />');
  864. }
  865. if (val) {
  866. saVal.push(val);
  867. saVal.push('<br />');
  868. }
  869. fnGetFiles(oDiv.append(saVal), item.FlowId);
  870. return oDiv;
  871. }
  872. },
  873. {
  874. name: "SignedDate", title: 'common.SignedDate', width: 120,
  875. itemTemplate: function (val, item) {
  876. return val;
  877. }
  878. }
  879. ],
  880. controller: {
  881. loadData: function (args) {
  882. return {
  883. data: oCurData.CheckFlows,
  884. itemsCount: oCurData.CheckFlows.length //data.length
  885. };
  886. }
  887. }
  888. });
  889. $("#jsGrid2").jsGrid({
  890. width: "100%",
  891. height: "auto",
  892. autoload: true,
  893. pageLoading: true,
  894. pageIndex: 1,
  895. pageSize: 10000,
  896. rowClass: function (item, itemIndex) {
  897. var sRowClass = '';
  898. if (oCurData.HandleFlows.length !== itemIndex + 1) {
  899. sRowClass = item.Line ? 'grid-cuscell first-cell' : 'grid-cuscell';
  900. }
  901. else {
  902. sRowClass = 'last-cell';
  903. }
  904. return sRowClass;
  905. },
  906. fields: [
  907. {
  908. name: "SignedMember", title: 'common.HandleMembers', width: 150,
  909. itemTemplate: function (val, item) {
  910. return $('<a>', { html: item.Department + ' ' + item.Jobtitle + '<br>' + item.SignedMember + (item.ParentId == '0' ? '(' + i18next.t("common.AgentPerson") + ')' : '') });// ╠common.CheckReEdit⇒代理人╣
  911. }
  912. },
  913. {
  914. name: "SignedDecision", title: 'common.Status', width: 100,
  915. itemTemplate: function (val, item) {
  916. var sVal = val;
  917. if (val === 'Y') {
  918. sVal = i18next.t("common.Hashandle");// ╠common.Hashandle⇒已經辦╣
  919. }
  920. else if (val === 'N') {
  921. sVal = i18next.t("common.Nothandle");// ╠common.Nothandle⇒未處理╣
  922. }
  923. else if (val === 'O') {
  924. sVal = i18next.t("common.AddOtherAudit");// ╠common.AddOtherAudit⇒轉呈其它主管審批╣
  925. }
  926. return $('<a>', { html: sVal });
  927. }
  928. },
  929. {
  930. name: "SignedOpinion", title: 'common.SignedOpinion', width: 450,
  931. itemTemplate: function (val, item) {
  932. var saVal = [],
  933. oDiv = $('<div>');
  934. if (item.SignedPush) {
  935. var saFlowsPush = item.SignedPush,
  936. saFlowsPushText = [],
  937. sFlowsPushText = '';
  938. $.each(saFlowsPush, function (idx, flow) {
  939. var sFlowType = i18next.t('common.' + flow.SignedWay);
  940. if (flow.SignedWay !== 'flow1') {
  941. saFlowsPushText.push(sFlowType + '(' + Enumerable.From(flow.SignedMember).ToString(",", "$.name") + ')');
  942. }
  943. else {
  944. saFlowsPushText.push(Enumerable.From(flow.SignedMember).ToString(",", "$.name"));
  945. }
  946. });
  947. sFlowsPushText = saFlowsPushText.join(' → ');
  948. saVal.push($('<a>', { html: sFlowsPushText }));
  949. saVal.push('<br />');
  950. }
  951. if (val) {
  952. saVal.push(val);
  953. saVal.push('<br />');
  954. }
  955. fnGetFiles(oDiv.append(saVal), item.FlowId);
  956. return oDiv;
  957. }
  958. },
  959. {
  960. name: "SignedDate", title: 'common.HandleDate', width: 120,
  961. itemTemplate: function (val, item) {
  962. return val;
  963. }
  964. }
  965. ],
  966. controller: {
  967. loadData: function (args) {
  968. return {
  969. data: oCurData.HandleFlows,
  970. itemsCount: oCurData.HandleFlows.length //data.length
  971. };
  972. }
  973. }
  974. });
  975. $.each([3, 4], function (idx, _grididx) {
  976. fnRegisterAddFlows(_grididx);
  977. $("#jsGrid" + _grididx).jsGrid({
  978. width: "100%",
  979. height: "auto",
  980. autoload: true,
  981. filtering: false,
  982. pageLoading: true,
  983. pageIndex: 1,
  984. pageSize: 10000,
  985. fields: [
  986. {
  987. name: "Order", title: 'common.Order', width: 50, align: "center",
  988. itemTemplate: function (val, item) {
  989. return val < 10 ? '0' + val : val;
  990. }
  991. },
  992. {
  993. name: "SignedWay", title: 'common.SignedWay', width: 120, align: "center",
  994. itemTemplate: function (val, item) {
  995. return i18next.t('common.' + val);
  996. }
  997. },
  998. {
  999. type: "Icon", width: 50, align: "center",
  1000. itemTemplate: function (val, item) {
  1001. var oIcon = {
  1002. flow1: '<img src="../../images/flow_check.gif">',
  1003. flow2: '<img src="../../images/flow_check.gif"><img src="../../images/flow_check.gif">',
  1004. flow3: '<img src="../../images/flow_check.gif"><img src="../../images/flow_nocheck.gif">',
  1005. flow4: '<img src="../../images/flow4.gif">'
  1006. },
  1007. sIcon = oIcon[item.SignedWay];
  1008. if (item.Order !== saCheckOrder_Push.length) {
  1009. sIcon += '<br><img src="../../images/flow_arrow.gif" style="vertical-align:top;">'
  1010. }
  1011. return sIcon;
  1012. }
  1013. },
  1014. {
  1015. name: "SignedMember", title: 'common.SignedMember', width: 500,
  1016. itemTemplate: function (val, item) {
  1017. return Enumerable.From(val).ToString(",", "$.name");
  1018. }
  1019. },
  1020. {
  1021. type: "control", title: 'common.Action', width: 200,
  1022. itemTemplate: function (val, item) {
  1023. var oBtns = [$('<div>', { class: 'fa-item col-sm-3' }).append($('<i>', {
  1024. class: 'glyphicon glyphicon-pencil',
  1025. title: i18next.t('common.Edit'),// ╠common.Edit⇒編輯╣
  1026. click: function () {
  1027. var oOption = {};
  1028. oOption.SignedWay = item.SignedWay;
  1029. oOption.SignedMember = item.SignedMember;
  1030. oOption.Callback = function (data) {
  1031. if (data.Users.length > 0) {
  1032. var oFlow = {};
  1033. if (data.FlowType === 'flow1') {
  1034. $.each(data.Users, function (idx, user) {
  1035. var oFlow = {};
  1036. oFlow.id = guid();
  1037. oFlow.Order = item.Order + idx;
  1038. oFlow.SignedWay = data.FlowType;
  1039. oFlow.SignedMember = [{
  1040. id: user.id,
  1041. name: user.name,
  1042. deptname: user.deptname,
  1043. jobname: user.jobname
  1044. }];
  1045. saCheckOrder_Push.insert(item.Order + idx, oFlow);
  1046. });
  1047. }
  1048. else {
  1049. var saSignedMembers = [];
  1050. $.each(data.Users, function (idx, user) {
  1051. saSignedMembers.push({
  1052. id: user.id,
  1053. name: user.name,
  1054. deptname: user.deptname,
  1055. jobname: user.jobname
  1056. });
  1057. });
  1058. oFlow.id = guid();
  1059. oFlow.Order = item.Order;
  1060. oFlow.SignedWay = data.FlowType;
  1061. oFlow.SignedMember = saSignedMembers;
  1062. saCheckOrder_Push.insert(item.Order, oFlow);
  1063. }
  1064. var iOrder = 1;
  1065. $.each(saCheckOrder_Push, function (idx, _data) {
  1066. if (item.id !== _data.id) {
  1067. _data.Order = iOrder;
  1068. iOrder++;
  1069. }
  1070. });
  1071. saCheckOrder_Push = Enumerable.From(saCheckOrder_Push).Where(function (e) { return e.id !== item.id; }).ToArray();
  1072. saCheckOrder_Push = releaseGridList(saCheckOrder_Push);
  1073. $("#jsGrid" + _grididx).jsGrid("loadData");
  1074. }
  1075. };
  1076. oPenUserListPop(oOption);
  1077. }
  1078. })),
  1079. $('<div>', { class: 'fa-item col-sm-3' }).append($('<i>', {
  1080. class: 'glyphicon glyphicon-trash',
  1081. title: i18next.t('common.Toolbar_Del'),// ╠common.Toolbar_Del⇒刪除╣
  1082. click: function () {
  1083. var saNewList = Enumerable.From(saCheckOrder_Push).Where(function (e) { return e.id !== item.id; }).ToArray();
  1084. saCheckOrder_Push = saNewList;
  1085. $.each(saCheckOrder_Push, function (idx, _data) {
  1086. _data.Order = idx + 1;
  1087. });
  1088. saCheckOrder_Push = releaseGridList(saCheckOrder_Push);
  1089. $("#jsGrid" + _grididx).jsGrid("loadData");
  1090. }
  1091. }))];
  1092. if (saCheckOrder_Push.length !== item.Order) {
  1093. oBtns.push($('<div>', { class: 'fa-item col-sm-3' }).append($('<i>', {
  1094. class: 'glyphicon glyphicon-arrow-down',
  1095. title: i18next.t('common.Down'),// ╠common.Down⇒下移╣
  1096. click: function () {
  1097. var sOrder = Enumerable.From(saCheckOrder_Push).Where(function (e) { return e.id === item.id; }).ToString('', '$.Order'),
  1098. iOrder = sOrder * 1;
  1099. $.each(saCheckOrder_Push, function (idx, _data) {
  1100. if (iOrder === _data.Order) {
  1101. _data.Order++;
  1102. }
  1103. else if ((iOrder + 1) === _data.Order) {
  1104. _data.Order--;
  1105. }
  1106. });
  1107. saCheckOrder_Push = releaseGridList(saCheckOrder_Push);
  1108. $("#jsGrid" + _grididx).jsGrid("loadData");
  1109. }
  1110. })));
  1111. }
  1112. else {
  1113. oBtns.push($('<div>', { class: 'fa-item col-sm-3' }));
  1114. }
  1115. if (1 !== item.Order) {
  1116. oBtns.push($('<div>', { class: 'fa-item col-sm-3' }).append($('<i>', {
  1117. class: 'glyphicon glyphicon-arrow-up',
  1118. title: i18next.t('common.Up'),// ╠common.Up⇒上移╣
  1119. click: function () {
  1120. var sOrder = Enumerable.From(saCheckOrder_Push).Where(function (e) { return e.id === item.id; }).ToString('', '$.Order'),
  1121. iOrder = sOrder * 1;
  1122. $.each(saCheckOrder_Push, function (idx, _data) {
  1123. if (iOrder === _data.Order) {
  1124. _data.Order--;
  1125. }
  1126. else if ((iOrder - 1) === _data.Order) {
  1127. _data.Order++;
  1128. }
  1129. });
  1130. saCheckOrder_Push = releaseGridList(saCheckOrder_Push);
  1131. $("#jsGrid" + _grididx).jsGrid("loadData");
  1132. }
  1133. })));
  1134. }
  1135. return oBtns;
  1136. }
  1137. }
  1138. ],
  1139. controller: {
  1140. loadData: function (args) {
  1141. return {
  1142. data: saCheckOrder_Push,
  1143. itemsCount: saCheckOrder_Push.length //data.length
  1144. };
  1145. }
  1146. }
  1147. });
  1148. });
  1149. };
  1150. init();
  1151. };
  1152. require(['base', 'jsgrid', 'jqprint', 'filer', 'common_eip', 'util'], fnPageInit);