fzdetail.js 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. 'use strict';
  2. var app = angular.module('app', [
  3. ]);
  4. app.controller("formeditCtrl", ["$scope", "$http", "$timeout", '$sce', function ($scope, $http, $timeout, $sce) {
  5. var self = this;
  6. var s4 = new SM4Util();
  7. self.userId = $.cookie("GlWorkPlatform-userid");
  8. self.userName = $.cookie("GlWorkPlatform-chineseName");
  9. self.userCName = $.cookie("GlWorkPlatform-chineseName");
  10. self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
  11. self.routeinfoid = sp.getUrlName("routeinfoid");
  12. self.type = sp.getUrlName("type");
  13. self.get_lastReturn = sp.getUrlName("lastReturn");
  14. self.get_lastReturnPageno = sp.getUrlName("lastReturnPageno");
  15. self.return = self.get_lastReturn + ".html?type=" + self.type + "&lastReturnPageno=" + self.get_lastReturnPageno
  16. var postCfg = {
  17. headers: {
  18. 'Content-Type': 'application/json',
  19. 'Authorization': "Bearer " + self.get_AccessToken
  20. }
  21. };
  22. self.select = {};
  23. self.getLeft = function () {
  24. self.selectActive = "";
  25. var data = {
  26. routeinfoid: self.routeinfoid,
  27. tablename: "PAGELEMENT"
  28. }
  29. $http.post(apiurljs.login + "g2app/DangAn/queryDataByTablename", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  30. .success(function (obj) {
  31. var res = strToJson(s4.decryptData_CBC(obj.data));
  32. self.detail = {
  33. PACKAGEID: res.data.PACKAGEID ? res.data.PACKAGEID : "",
  34. PACKAGETYPE: res.data.PACKAGETYPE ? res.data.PACKAGETYPE : "",
  35. CREATOR: res.data.CREATOR ? res.data.CREATOR : "",
  36. CREATDATE: res.data.CREATDATE ? sp.format(res.data.CREATDATE) : "",
  37. CREATENVIR: res.data.CREATENVIR ? res.data.CREATENVIR : "",
  38. STORAGELOC: res.data.STORAGELOC ? res.data.STORAGELOC : "",
  39. PACKAGEDES: res.data.PACKAGEDES ? res.data.PACKAGEDES : ""
  40. };
  41. var data = {
  42. tablename: "DOCELEMENT_ZL",
  43. routeinfoid: res.data.ROUTEINFOIDLIST,
  44. columns: "ROUTEINFOID,DOCTITLE"
  45. }
  46. $http.post(apiurljs.login + "g2app/DangAn/queryColumnByRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  47. .success(function (obj) {
  48. var res = strToJson(s4.decryptData_CBC(obj.data));
  49. if (res.success == true) {
  50. self.leftList = res.data;
  51. self.getData(self.leftList[0].ROUTEINFOID, 0, 0)
  52. } else {
  53. sp.dialog(res.message)
  54. }
  55. })
  56. })
  57. }
  58. self.getData = function (routeinfoid, num, n) {
  59. var time1 = sp.getLocalDate1();
  60. self.selectActive = num;
  61. var data = {
  62. routeinfoid: routeinfoid,
  63. tablename: "DOCELEMENT_ZL"
  64. }
  65. $http.post(apiurljs.login + "g2app/DangAn/queryDataByTablename", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  66. .success(function (obj) {
  67. var res = strToJson(s4.decryptData_CBC(obj.data));
  68. self.data = {
  69. ARCHCODE: res.data.ARCHCODE ? res.data.ARCHCODE : "",
  70. ARCHYEAR: res.data.ARCHYEAR ? res.data.ARCHYEAR : "",
  71. ORGANIZATIONMA: res.data.ORGANIZATIONMA ? res.data.ORGANIZATIONMA : "",
  72. DOCUMENTID: res.data.DOCUMENTID ? res.data.DOCUMENTID : "",
  73. DANGANML: res.data.DANGANML ? res.data.DANGANML : "",
  74. DOCUMENTTYPE: res.data.DOCUMENTTYPE ? res.data.DOCUMENTTYPE : "",
  75. SERIALNUM: res.data.SERIALNUM ? res.data.SERIALNUM : "",
  76. MIJIQIXIAN: res.data.MIJIQIXIAN ? res.data.MIJIQIXIAN : "",
  77. EMERGENCYDEGREE: res.data.EMERGENCYDEGREE ? res.data.EMERGENCYDEGREE : "",
  78. DOCISSUERID: res.data.DOCISSUERID ? res.data.DOCISSUERID : "",
  79. DOCISSUEDNUM: res.data.DOCISSUEDNUM ? res.data.DOCISSUEDNUM : "",
  80. SIGNER: res.data.SIGNER ? res.data.SIGNER : "",
  81. DOCTITLE: res.data.DOCTITLE ? res.data.DOCTITLE : "",
  82. MAINDPT: res.data.MAINDPT ? res.data.MAINDPT : "",
  83. DOCISSUEDDATE: res.data.DOCISSUEDDATE ? sp.format(res.data.DOCISSUEDDATE) : "",
  84. ATTACHMENT: res.data.ATTACHMENT ? res.data.ATTACHMENT : "",
  85. ISSUINGAGENCY: res.data.ISSUINGAGENCY ? res.data.ISSUINGAGENCY : "",
  86. ANNOTATION: res.data.ANNOTATION ? res.data.ANNOTATION : "",
  87. CCDPT: res.data.CCDPT ? res.data.CCDPT : "",
  88. PRINTSENDDPT: res.data.PRINTSENDDPT ? res.data.PRINTSENDDPT : "",
  89. PRINTDATE: res.data.PRINTDATE ? sp.format(res.data.PRINTDATE) : "",
  90. RELEASELEVEL: res.data.RELEASELEVEL ? res.data.RELEASELEVEL : "",
  91. }
  92. })
  93. self.getAttachList(routeinfoid)
  94. }
  95. self.getAttachList = function (routeinfoid) {
  96. var data = {
  97. routeinfoid: routeinfoid
  98. }
  99. $http.post(apiurljs.login + "g2app/DangAn/getAttachList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  100. .success(function (obj) {
  101. var res = strToJson(s4.decryptData_CBC(obj.data));
  102. self.list = res.data;
  103. $.each(self.list, function (index, item) {
  104. item.SIZE = item.FILESIZE >= 104857.6 ? (item.FILESIZE / 1048576).toFixed(2) + "MB" : (item.FILESIZE / 1024).toFixed(2) + "KB";
  105. })
  106. })
  107. }
  108. self.getLeft()
  109. self.download = function () {
  110. var data = {
  111. tablename: "FILETRANSFER",
  112. routeinfoid: self.routeinfoid,
  113. columns: "FILEURL"
  114. }
  115. $http.post(apiurljs.login + "g2app/DangAn/queryColumnByRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  116. .success(function (obj) {
  117. var res = strToJson(s4.decryptData_CBC(obj.data));
  118. if (res.success == true) {
  119. window.open(apiurljs.login + "g2app/DangAn/downloadZipFile" + res.data[0].FILEURL)
  120. } else {
  121. sp.dialog(res.message)
  122. }
  123. })
  124. }
  125. }])