formeditFL.js 130 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011
  1. 'use strict';
  2. var app = angular.module('app', [
  3. ]);
  4. app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$interval", "$sce", function ($scope, $http, $timeout, $interval, $sce) {
  5. var self = this;
  6. var s4 = new SM4Util();
  7. self.userId = $.cookie("GlWorkPlatform-userid");
  8. self.userName = $.cookie("GlWorkPlatform-chineseName");
  9. self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
  10. self.routeid = sp.getUrlName("routeid");
  11. self.routeinfoid = sp.getUrlName("routeinfoid");
  12. self.lastrouteinfoid = sp.getUrlName("lastrouteinfoid");
  13. self.copyrightid = sp.getUrlName("copyrightid");
  14. self.directionid = sp.getUrlName("directionid");
  15. self.formeditid = sp.getUrlName("formeditid");
  16. self.mbid = sp.getUrlName("mbid");
  17. self.fjid = sp.getUrlName("fjid");
  18. self.docmode = sp.getUrlName("docmode");
  19. self.dotype = sp.getUrlName("dotype");
  20. self.gkbutton = sp.getUrlName("gkbutton")
  21. self.get_lastReturnPageno = sp.getUrlName("lastReturnPageno");
  22. self.get_lastReturnPage = sp.getUrlName("lastReturnPage");
  23. self.get_type = sp.getUrlName("type");
  24. self.return = "../list.html?lastReturnPageno=" + self.get_lastReturnPageno + "&type=" + self.get_type
  25. self.deviceType = localStorage.getItem("tjJxtGoldenlinkWork-deviceType");
  26. if (self.deviceType != "pad") {
  27. self.photo = $.cookie("GlWorkPlatform-photo").indexOf("AFrontEnd") > -1 ? "../../../" + $.cookie("GlWorkPlatform-photo") : $.cookie("GlWorkPlatform-photo");
  28. }
  29. var postCfg = {
  30. headers: {
  31. 'Content-Type': 'application/json',
  32. 'Authorization': "Bearer " + self.get_AccessToken
  33. }
  34. };
  35. self.FormTitle = $.cookie("GlWorkPlatform-SYSNAME");
  36. //初始化右上角按钮
  37. self.buttonList = []
  38. var uploadformat = strToJson(s4.decryptData_CBC(apiurljs.uploadformat)).data.map(function (item) {
  39. return item.CNAME
  40. })
  41. self.upload_zw = function () {
  42. self.newMoBanFlag = true;
  43. if (self.gaoTypeArrayFirst.length > 0) {
  44. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  45. var dialogBody = "<div class=\"sp-dialog-body\">您确定要覆盖正文吗?</div>";
  46. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  47. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  48. sp.openCenter(".sp-dialog");
  49. ///取消按钮
  50. $('.sp-closeDialog').click(function (event) {
  51. sp.closeCenter(".sp-dialog");
  52. event.preventDefault();
  53. event.stopPropagation();
  54. });
  55. //post消息的id
  56. $("#delDataTrue").click(function () {
  57. sp.closeCenter(".sp-dialog");
  58. $('#fileupload-zw').fileupload({
  59. url: apiurljs.login + 'g2app/fawenfiles/uploadFileWithForm',
  60. dataType: 'json',
  61. beforeSend: function (xhr, data) {
  62. xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
  63. xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=FAWEN_FILES,routeinfoid=" + self.routeinfoid + ",gwtype=" + self.data.GWZL + ",dockind=D01"));
  64. },
  65. add: function (e, data) {
  66. var num = 0;
  67. var acceptFileTypes = eval('/(' + apiurljs.zwType.join("|") + ')$/i')
  68. //文件类型判断
  69. $.each(data.originalFiles, function (index, item) {
  70. if (item['type'].length > 0 && !acceptFileTypes.test(item['name'])) {
  71. sp.dialog("您好,请上传" + apiurljs.zwType.join("/") + "格式的文件!");
  72. return;
  73. } else {
  74. num++
  75. }
  76. })
  77. if (num == data.originalFiles.length) {
  78. self.uploading_zw = true;
  79. data.submit();
  80. $scope.$apply();
  81. }
  82. },
  83. // 上传完成后的执行逻辑
  84. done: function (e, data) {
  85. self.uploading_zw = false;
  86. self.newMoBanFlag = false;
  87. self.getGCG(1)
  88. }
  89. })
  90. $timeout(function () {
  91. $("#fileupload-zw").trigger("click")
  92. }, 1)
  93. })
  94. } else {
  95. $('#fileupload-zw').fileupload({
  96. url: apiurljs.login + 'g2app/fawenfiles/uploadFileWithForm',
  97. dataType: 'json',
  98. beforeSend: function (xhr, data) {
  99. xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
  100. xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=FAWEN_FILES,routeinfoid=" + self.routeinfoid + ",gwtype=" + self.data.GWZL + ",dockind=D01"));
  101. },
  102. add: function (e, data) {
  103. var num = 0;
  104. var acceptFileTypes = eval('/(' + apiurljs.zwType.join("|") + ')$/i')
  105. //文件类型判断
  106. $.each(data.originalFiles, function (index, item) {
  107. if (item['type'].length > 0 && !acceptFileTypes.test(item['name'])) {
  108. sp.dialog("您好,请上传" + apiurljs.zwType.join("/") + "格式的文件!");
  109. return;
  110. } else {
  111. num++
  112. }
  113. })
  114. if (num == data.originalFiles.length) {
  115. self.uploading_zw = true;
  116. data.submit();
  117. $scope.$apply();
  118. }
  119. },
  120. // 上传完成后的执行逻辑
  121. done: function (e, data) {
  122. self.uploading_zw = false;
  123. self.newMoBanFlag = false;
  124. self.getGCG(1)
  125. }
  126. })
  127. $timeout(function () {
  128. $("#fileupload-zw").trigger("click")
  129. }, 1)
  130. }
  131. }
  132. //上层附件、业务参考、共享沟通组件
  133. self.uploading = false;
  134. self.upload = function () {
  135. $('#fileupload').fileupload({
  136. url: apiurljs.login + 'g2app/abase/uploadFileWithForm',
  137. dataType: 'json',
  138. beforeSend: function (xhr, data) {
  139. xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
  140. xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=FILE_ATTACH,routeinfoid=" + self.routeinfoid + ",ATTACHTYPE=审批件"));
  141. },
  142. add: function (e, data) {
  143. var num = 0;
  144. var acceptFileTypes = eval('/(' + uploadformat.join("|") + ')$/i')
  145. //文件类型判断
  146. $.each(data.originalFiles, function (index, item) {
  147. if (item['type'].length > 0 && !acceptFileTypes.test(item['name'])) {
  148. sp.dialog("您好,请上传" + uploadformat.join("/") + "格式的文件!");
  149. return;
  150. } else {
  151. num++
  152. }
  153. })
  154. if (num == data.originalFiles.length) {
  155. self.uploading = true;
  156. data.submit();
  157. $scope.$apply();
  158. }
  159. },
  160. // 上传完成后的执行逻辑
  161. done: function (e, data) {
  162. self.uploading = false;
  163. self.getOther()
  164. }
  165. })
  166. }
  167. self.downLoad = function (item) {
  168. window.open(apiurljs.login + "g2work/files/" + item.FILEURL.slice(7))
  169. }
  170. self.deleteFile = function (file) {
  171. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  172. var dialogBody = "<div class=\"sp-dialog-body\">删除后不可恢复,您确认要删除吗?</div>";
  173. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  174. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  175. sp.openCenter(".sp-dialog");
  176. ///取消按钮
  177. $('.sp-closeDialog').click(function (event) {
  178. sp.closeCenter(".sp-dialog");
  179. event.preventDefault();
  180. event.stopPropagation();
  181. });
  182. //post消息的id
  183. $("#delDataTrue").click(function () {
  184. var data = {
  185. tablename: "FILE_ATTACH",
  186. id: file.ID
  187. };
  188. $http.post(apiurljs.login + "g2app/dataabase/delDataById", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  189. .success(function (obj) {
  190. var res = strToJson(s4.decryptData_CBC(obj.data));
  191. sp.dialoghide();
  192. if (res.success) {
  193. $.each(self.iframeList, function (index, item) {
  194. if (item.title == file.FILENAMES && item.source == apiurljs.login + "g2work/files2/inline/" + file.FILEURL.slice(7)) {
  195. self.closeItem(index);
  196. return false;
  197. }
  198. })
  199. self.getOther();
  200. } else {
  201. sp.dialog("删除失败,请联系管理员!");
  202. }
  203. });
  204. });
  205. }
  206. self.creatFLOW = function (file) {
  207. var data = {
  208. copyrightid: self.copyrightid,
  209. directionid: self.directionid,
  210. routeinfoid: self.routeinfoid,
  211. userid: self.userId,
  212. relateid: file.ID
  213. }
  214. $http.post(apiurljs.login + "g2app/fawenfiles/createNewWorkFlowWithGwtype", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  215. .success(function (obj) {
  216. var res = strToJson(s4.decryptData_CBC(obj.data));
  217. sp.dialoghide();
  218. if (res.success) {
  219. self.getGLFLOW();
  220. } else {
  221. sp.dialog("删除失败,请联系管理员!");
  222. }
  223. });
  224. }
  225. self.deleteWG = function (file) {
  226. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  227. var dialogBody = "<div class=\"sp-dialog-body\">删除后不可恢复,您确认要删除吗?</div>";
  228. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  229. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  230. sp.openCenter(".sp-dialog");
  231. ///取消按钮
  232. $('.sp-closeDialog').click(function (event) {
  233. sp.closeCenter(".sp-dialog");
  234. event.preventDefault();
  235. event.stopPropagation();
  236. });
  237. //post消息的id
  238. $("#delDataTrue").click(function () {
  239. var data = {
  240. id: file.ID
  241. };
  242. $http.post(apiurljs.login + "g2app/fawenfilesrelate/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  243. .success(function (obj) {
  244. var res = strToJson(s4.decryptData_CBC(obj.data));
  245. sp.dialoghide();
  246. if (res.success) {
  247. $.each(self.iframeList, function (index, item) {
  248. if (item.title == file.FILENAMES && item.source == apiurljs.login.split("glwork/")[0] + "glworkweb/" + file.FILEURL) {
  249. self.closeItem(index);
  250. return false;
  251. }
  252. })
  253. self.getGLJ(1);
  254. } else {
  255. sp.dialog("删除失败,请联系管理员!");
  256. }
  257. });
  258. });
  259. }
  260. self.openGL = function (item) {
  261. var data = {
  262. tablename: "SYS_DESKTOP_PLUGIN_TODO",
  263. colums: "*",
  264. order: "SORTID",
  265. sqlwhere: "",
  266. sqlorwhere: "",
  267. sqlinwhere: "",
  268. sqllikewhere: { FLOWID: item.FLOWID }
  269. }
  270. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  271. .success(function (obj) {
  272. var res = strToJson(s4.decryptData_CBC(obj.data));
  273. sp.openNewWindow("../../" + res.data[0].FILEN.split("/")[1] + "/" + item.FILEN + "&flowid=" + item.FLOWID + "&dotype=1", item.TITLE)
  274. });
  275. }
  276. self.downLoaDWG = function (item) {
  277. if (item.FILEURL.indexOf("files") > -1) {
  278. window.open(apiurljs.login + "g2work/files/" + item.FILEURL.slice(7))
  279. } else {
  280. window.open(apiurljs.login.split("glwork/")[0] + "glworkweb/" + item.FILEURL)
  281. }
  282. }
  283. self.readonly = {
  284. JJCD: false,
  285. FWZH: false,
  286. WLDQFL: false,
  287. WLDSSL: false,
  288. XXGKSH: false,
  289. SFXYJD: false,
  290. FLSH: false,
  291. GPJZSC: false,
  292. BGSFHYJ: false,
  293. SX: false,
  294. BMFZRYJ: false,
  295. HBCSYJ: false,
  296. NGR: false,
  297. NGSJ: false,
  298. GWZL: false,
  299. YF: false,
  300. BT: false,
  301. ZS: false,
  302. CS: false,
  303. USAGE: false
  304. }
  305. self.show = {
  306. JJCD: false,
  307. FWZH: false,
  308. WLDQFL: false,
  309. WLDSSL: false,
  310. XXGKSH: false,
  311. SFXYJD: false,
  312. FLSH: false,
  313. GPJZSC: false,
  314. BGSFHYJ: false,
  315. SX: false,
  316. BMFZRYJ: false,
  317. HBCSYJ: false,
  318. NGR: false,
  319. NGSJ: false,
  320. GWZL: false,
  321. YF: false,
  322. BT: false,
  323. ZS: false,
  324. CS: false,
  325. USAGE: false
  326. }
  327. self.type = 1;
  328. self.getSwenList = function (n) {
  329. self.SwenList = [];
  330. var data = {
  331. directionid: self.directionid,
  332. userid: self.userId,
  333. routeinfoid: self.routeinfoid,
  334. routeid: self.routeid,
  335. formeditid: ""
  336. }
  337. $http.post(apiurljs.login + "g2app/abase/queryDataLink", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  338. .success(function (obj) {
  339. var res = strToJson(s4.decryptData_CBC(obj.data));
  340. if (self.copyrightid == "") {
  341. self.copyrightid = res.data.LINKS[0].COPYRIGHTID
  342. }
  343. $.each(res.data.LINKS, function (index, item) {
  344. item.TEMPFORM = item.TEMPFORM + "&flowid=" + sp.getUrlName("flowid")
  345. if (item.TEMPFORM.indexOf("?docmode") > 0) {
  346. if (item.TEMPFORM.indexOf("attachlist") > -1 || item.TEMPFORM.indexOf("fawenfile") > -1) {
  347. item.TEMPFORM = item.TEMPFORM + "&dotype=" + self.dotype + "&type=" + self.get_type + "&lastReturnPageno=" + self.get_lastReturnPageno + "&lastReturnPage=" + self.get_lastReturnPage;
  348. } else {
  349. item.TEMPFORM = "../" + item.TEMPFORM + "&dotype=" + self.dotype + "&type=" + self.get_type + "&lastReturnPageno=" + self.get_lastReturnPageno + "&lastReturnPage=" + self.get_lastReturnPage;
  350. }
  351. } else {
  352. item.TEMPFORM = "#";
  353. }
  354. self.SwenList.push(item)
  355. })
  356. self.SwenList.push({
  357. VNAME: "流程图",
  358. DIRECTIONID: self.SwenList[0].DIRECTIONID,
  359. TEMPFORM: "modeler_read.html?" + self.SwenList[0].TEMPFORM.split("?")[1]
  360. })
  361. if (n == 0) {
  362. self.getFLOW()
  363. } else {
  364. self.getData()
  365. }
  366. })
  367. }
  368. self.getSwenList(0)
  369. self.getFLOW = function () {
  370. var data = {
  371. copyrightid: self.copyrightid
  372. }
  373. $http.post(apiurljs.login + "g2work/flow/queryDataByCopyrightid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  374. .success(function (obj) {
  375. var res = strToJson(s4.decryptData_CBC(obj.data));
  376. self.flowTitle = res.data.CNAME;
  377. self.getJJCD()
  378. })
  379. }
  380. self.getJJCD = function () {
  381. var data = {
  382. ckey: "CODE_JJCD",
  383. routeinfoid: self.routeinfoid
  384. }
  385. $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  386. .success(function (obj) {
  387. var res = strToJson(s4.decryptData_CBC(obj.data));
  388. self.JJCD = res.data.CODE_JJCD;
  389. self.getXXGKSH()
  390. })
  391. }
  392. self.getXXGKSH = function () {
  393. var data = {
  394. ckey: "CODE_XXGKSH",
  395. routeinfoid: self.routeinfoid
  396. }
  397. $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  398. .success(function (obj) {
  399. var res = strToJson(s4.decryptData_CBC(obj.data));
  400. self.XXGKSH = res.data.CODE_XXGKSH;
  401. self.getGWZL()
  402. })
  403. }
  404. self.getGWZL = function () {
  405. var data = {
  406. tablename: "CODE_GWTYPE",
  407. colums: "ID,CODE,CNAME,FLOWID,DOCFILE,REDFILE",
  408. order: "SORTID desc",
  409. sqlwhere: {
  410. USEMARK: 1,
  411. FLOWID: sp.getUrlName("flowid")
  412. },
  413. sqlinwhere: "",
  414. sqllikewhere: ""
  415. }
  416. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  417. .success(function (obj) {
  418. var res = strToJson(s4.decryptData_CBC(obj.data));
  419. console.log(res.data)
  420. self.GWZL = res.data;
  421. self.getSFXYJD()
  422. })
  423. }
  424. self.getSFXYJD = function () {
  425. var data = {
  426. ckey: "CODE_SFXYJD",
  427. routeinfoid: self.routeinfoid
  428. }
  429. $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  430. .success(function (obj) {
  431. var res = strToJson(s4.decryptData_CBC(obj.data));
  432. self.SFXYJD = res.data.CODE_SFXYJD;
  433. self.getZDGKLM()
  434. })
  435. }
  436. self.getZDGKLM = function () {
  437. var data = {
  438. ckey: "CODE_ZDGKLM",
  439. routeinfoid: self.routeinfoid
  440. }
  441. $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  442. .success(function (obj) {
  443. var res = strToJson(s4.decryptData_CBC(obj.data));
  444. self.ZDGKLM = res.data.CODE_ZDGKLM;
  445. self.getZDGKZT()
  446. })
  447. }
  448. self.getZDGKZT = function () {
  449. var data = {
  450. ckey: "CODE_ZDGKZT",
  451. routeinfoid: self.routeinfoid
  452. }
  453. $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  454. .success(function (obj) {
  455. var res = strToJson(s4.decryptData_CBC(obj.data));
  456. self.ZDGKZT = res.data.CODE_ZDGKZT;
  457. self.getBGSFHYJ()
  458. })
  459. }
  460. self.getBGSFHYJ = function () {
  461. var data = {
  462. ckey: "CODE_BGSFHYJ",
  463. routeinfoid: self.routeinfoid
  464. }
  465. $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  466. .success(function (obj) {
  467. var res = strToJson(s4.decryptData_CBC(obj.data));
  468. self.BGSFHYJ = res.data.CODE_BGSFHYJ;
  469. self.getUSAGE()
  470. })
  471. }
  472. //标签
  473. self.getUSAGE = function () {
  474. var data = {
  475. ckey: "CODE_SHOUWENLABEL",
  476. routeinfoid: self.routeinfoid
  477. }
  478. $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  479. .success(function (obj) {
  480. var res = strToJson(s4.decryptData_CBC(obj.data));
  481. self.USAGE = res.data.CODE_SHOUWENLABEL;
  482. $.each(self.USAGE, function (index, item) {
  483. item.checked = false;
  484. })
  485. self.getDP()
  486. })
  487. }
  488. self.getDP = function () {
  489. var data = {
  490. userid: self.userId
  491. }
  492. $http.post(apiurljs.login + "g2app/richang/queryDpInfo", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  493. .success(function (obj) {
  494. var res = strToJson(s4.decryptData_CBC(obj.data));
  495. self.userDpName = res.data.length == 0 ? "" : res.data[0].SECTION;
  496. self.userDpCode = res.data.length == 0 ? "" : res.data[0].CODE;
  497. self.getData();
  498. })
  499. }
  500. //获取数据
  501. self.getData = function () {
  502. var data = {
  503. ckey: "FW_SPJ",
  504. id: 0,
  505. directionid: self.directionid,
  506. formeditid: self.formeditid,
  507. routeid: self.routeid,
  508. routeinfoid: self.routeinfoid
  509. }
  510. $http.post(apiurljs.login + "g2app/abase/queryData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  511. .success(function (obj) {
  512. var res = strToJson(s4.decryptData_CBC(obj.data));
  513. self.data = {
  514. ID: res.data.FW_SPJ.ID,
  515. APPCODE: res.data.FW_SPJ.APPCODE,
  516. JJCD: res.data.FW_SPJ.JJCD == "" ? self.JJCD[0].CODE : res.data.FW_SPJ.JJCD,
  517. FWZH: res.data.FW_SPJ.FWZH,
  518. FWZH1: res.data.FW_SPJ.FWZH,
  519. XXGKSH: res.data.FW_SPJ.XXGKSH == "" ? self.XXGKSH[0].CODE : res.data.FW_SPJ.XXGKSH,
  520. SFXYJD: res.data.FW_SPJ.SFXYJD == "" ? self.SFXYJD[0].CODE : res.data.FW_SPJ.SFXYJD,
  521. NGR: res.data.FW_SPJ.NGR == "" ? self.userName : res.data.FW_SPJ.NGR,
  522. NGSJ: res.data.FW_SPJ.NGSJ == "" || res.data.FW_SPJ.NGSJ ? sp.format(sp.getLocalDate()) : sp.format(res.data.FW_SPJ.NGSJ),
  523. GWZL: res.data.FW_SPJ.GWZL == "" ? self.GWZL[0].CODE : res.data.FW_SPJ.GWZL,
  524. YF: res.data.FW_SPJ.YF,
  525. BT: res.data.FW_SPJ.BT,
  526. ZS: res.data.FW_SPJ.ZS,
  527. CS: res.data.FW_SPJ.CS,
  528. NGRUSERID: res.data.FW_SPJ.NGRUSERID == "" ? self.userId : res.data.FW_SPJ.NGRUSERID,
  529. NGRBM: res.data.FW_SPJ.NGRBM == "" ? self.userDpName : res.data.FW_SPJ.NGRBM,
  530. NGRBMID: res.data.FW_SPJ.NGRBMID == "" ? self.userDpCode : res.data.FW_SPJ.NGRBMID,
  531. USAGE: res.data.FW_SPJ.USAGE ? res.data.FW_SPJ.USAGE : "",
  532. MQFMARK: res.data.FW_SPJ.MQFMARK
  533. }
  534. self.readonly = {
  535. JJCD: res.data.FW_SPJ["JJCD.EREADONLY"] == "true",
  536. WLDQFL: res.data.FW_SPJ["WLDQFL.EREADONLY"] == "true",
  537. WLDSSL: res.data.FW_SPJ["WLDSSL.EREADONLY"] == "true",
  538. XXGKSH: res.data.FW_SPJ["XXGKSH.EREADONLY"] == "true",
  539. SFXYJD: res.data.FW_SPJ["SFXYJD.EREADONLY"] == "true",
  540. FLSH: res.data.FW_SPJ["FLSH.EREADONLY"] == "true",
  541. GPJZSC: res.data.FW_SPJ["GPJZSC.EREADONLY"] == "true",
  542. BGSFHYJ: res.data.FW_SPJ["BGSFHYJ.EREADONLY"] == "true",
  543. SX: res.data.FW_SPJ["SX.EREADONLY"] == "true",
  544. BMFZRYJ: res.data.FW_SPJ["BMFZRYJ.EREADONLY"] == "true",
  545. HBCSYJ: res.data.FW_SPJ["HBCSYJ.EREADONLY"] == "true",
  546. NGR: res.data.FW_SPJ["NGR.EREADONLY"] == "true",
  547. NGSJ: res.data.FW_SPJ["NGSJ.EREADONLY"] == "true",
  548. GWZL: res.data.FW_SPJ["GWZL.EREADONLY"] == "true",
  549. YF: res.data.FW_SPJ["YF.EREADONLY"] == "true",
  550. BT: res.data.FW_SPJ["BT.EREADONLY"] == "true",
  551. ZS: res.data.FW_SPJ["ZS.EREADONLY"] == "true",
  552. CS: res.data.FW_SPJ["CS.EREADONLY"] == "true",
  553. FWZH: res.data.FW_SPJ["FWZH.EREADONLY"] == "true",
  554. USAGE: res.data.FW_SPJ["USAGE.EREADONLY"] == "true"
  555. }
  556. self.show = {
  557. JJCD: res.data.FW_SPJ["JJCD.ESHOW"] == "true",
  558. WLDQFL: res.data.FW_SPJ["WLDQFL.ESHOW"] == "true",
  559. WLDSSL: res.data.FW_SPJ["WLDSSL.ESHOW"] == "true",
  560. XXGKSH: res.data.FW_SPJ["XXGKSH.ESHOW"] == "true",
  561. SFXYJD: res.data.FW_SPJ["SFXYJD.ESHOW"] == "true",
  562. FLSH: res.data.FW_SPJ["FLSH.ESHOW"] == "true",
  563. GPJZSC: res.data.FW_SPJ["GPJZSC.ESHOW"] == "true",
  564. BGSFHYJ: res.data.FW_SPJ["BGSFHYJ.ESHOW"] == "true",
  565. SX: res.data.FW_SPJ["SX.ESHOW"] == "true",
  566. BMFZRYJ: res.data.FW_SPJ["BMFZRYJ.ESHOW"] == "true",
  567. HBCSYJ: res.data.FW_SPJ["HBCSYJ.ESHOW"] == "true",
  568. NGR: res.data.FW_SPJ["NGR.ESHOW"] == "true",
  569. NGSJ: res.data.FW_SPJ["NGSJ.ESHOW"] == "true",
  570. GWZL: res.data.FW_SPJ["GWZL.ESHOW"] == "true",
  571. YF: res.data.FW_SPJ["YF.ESHOW"] == "true",
  572. BT: res.data.FW_SPJ["BT.ESHOW"] == "true",
  573. ZS: res.data.FW_SPJ["ZS.ESHOW"] == "true",
  574. CS: res.data.FW_SPJ["CS.ESHOW"] == "true",
  575. FWZH: res.data.FW_SPJ["FWZH.ESHOW"] == "true",
  576. USAGE: res.data.FW_SPJ["USAGE.ESHOW"] == "true"
  577. }
  578. self.selectUSAGEs = self.data.USAGE != "" && self.data.USAGE != null ? self.data.USAGE.split(",") : [];
  579. $.each(self.USAGE, function (index, item) {
  580. if (self.data.USAGE.indexOf(item.CODE) != -1) {
  581. item.checked = true;
  582. }
  583. })
  584. $timeout(function () {
  585. $(".sp-checkbox-blue input[name=USAGE]").each(function () {
  586. if (self.data.USAGE.indexOf($(this).val()) != -1) {
  587. $(this).attr("checked", true);
  588. $(this).parent("label").addClass("chb-blue-checked");
  589. }
  590. })
  591. }, 0)
  592. if (self.data.ID == 0) {
  593. self.filedChange = true;
  594. } else {
  595. self.filedChange = false;
  596. }
  597. var buttonList = [{ CNAME: "转发", CODE: "array", data: [] }];
  598. res.data["FW_SPJ.FUNCLIST"].forEach(function (item) {
  599. if (item.BUTTONGROUP == "FORMITEM") {
  600. buttonList.push(item)
  601. } else {
  602. buttonList[0].data.push(item)
  603. }
  604. })
  605. if (buttonList[0].data.length == 0) {
  606. buttonList = buttonList.slice(1)
  607. } else if (buttonList[0].data.length == 1) {
  608. buttonList[0] = buttonList[0].data[0]
  609. }
  610. console.log(buttonList)
  611. self.buttonList = buttonList;//res.data["FW_SPJ.FUNCLIST"];
  612. if (self.lastrouteinfoid != 0) {
  613. self.getHB()
  614. }
  615. self.getOpinion1(0)
  616. self.getOther()
  617. self.getGLJ(0)
  618. self.getGCG(0)
  619. self.getCWG()
  620. self.getQZG()
  621. if (self.docmode == 'zihao' || self.data.FWZH1 != "") {
  622. self.getFWZH()
  623. }
  624. self.getMeetMsg()
  625. $interval(function () {
  626. self.getNumMeet()
  627. }, 2000)
  628. $timeout(function () {
  629. $(".formedit center").css("height", $(".formedit center").parent().next("div").height() - $(".formedit center").parent().next("div").children().eq(0).height()).css("line-height", $(".formedit center").next("div").height() / 6 + "px")
  630. var height1 = $(".formedit center").css("height"), height2 = 0;
  631. $(".auto").siblings().each(function () {
  632. height2 = height2 + $(this).outerHeight();
  633. })
  634. if (height1.slice(0, height1.length - 2) - height2 < 277) {
  635. $(".auto").css("height", 277);
  636. $(".formedit center").css("height", $(".formedit center").height() + (277 - (height1.slice(0, height1.length - 2) - height2)))
  637. } else {
  638. $(".auto").css("height", height1.slice(0, height1.length - 2) - height2);
  639. }
  640. }, 100)
  641. })
  642. }
  643. self.getFWZH = function () {
  644. var data = {
  645. flowid: sp.getUrlName("flowid"),
  646. code: "",
  647. cyear: self.data.FWZH == "" ? sp.currentYear() : self.data.FWZH.slice(self.data.FWZH.indexOf("〔") + 1, self.data.FWZH.indexOf("〕")),
  648. routeinfoidmark: self.routeinfoid,
  649. zihao: self.data.FWZH
  650. }
  651. $http.post(apiurljs.login + "g2app/fawen/queryZiHaoCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  652. .success(function (obj) {
  653. var res = strToJson(s4.decryptData_CBC(obj.data));
  654. self.FWZH = res.data.map(function (item) {
  655. return { CNAME: item.split("|")[0], CODE: item.split("|")[0], CNAMEMARK: item.split("|")[1] }
  656. });
  657. if (self.data.FWZH == "") { self.data.FWZH = self.FWZH[0].CODE }
  658. })
  659. }
  660. //生成左侧合并文件
  661. self.getHB = function () {
  662. if (self.data.MQFMARK == 1) {
  663. var data = {
  664. routeinfoid: self.routeinfoid
  665. }
  666. $http.post(apiurljs.login + "g2app/dataabase/mergeOFDByLastRouteinfoidWithCurrentRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  667. .success(function (obj) {
  668. var res = strToJson(s4.decryptData_CBC(obj.data));
  669. if (res.data != "") {
  670. let postData = {
  671. convertType: 570,
  672. fileUrl: res.data,
  673. isPrint: 1,
  674. isDownload: 1,
  675. };
  676. var postCfg_transfer = {
  677. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  678. transformRequest: function (data) {
  679. return $.param(data);
  680. }
  681. };
  682. $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
  683. .success(function (res) {
  684. self.LoadYZ = false;
  685. if (res.errorcode === 0) {
  686. self.iframeList[0] = { id: 1, title: "签报收文", filename: "文档", url: $sce.trustAsResourceUrl(sp.ipChange(res.data.viewUrl)), source: res.data.viewUrl, edit: false, show: 1, boxStyle: { width: $(".leftBox").width() }, iframeStyle: { width: $(".leftBox").width() - 10 } };
  687. self.iframeLast = self.iframeList.length - 1;
  688. self.iframeShow = self.iframeList.length;
  689. self.iframeHide = self.iframeList.length - self.iframeShow;
  690. } else {
  691. sp.dialog(res.message);
  692. }
  693. });
  694. } else {
  695. var data = {
  696. routeinfoid: self.routeinfoid
  697. }
  698. $http.post(apiurljs.login + "g2app/dataabase/mergePDFByLastRouteinfoidWithCurrentRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  699. .success(function (obj) {
  700. var res = strToJson(s4.decryptData_CBC(obj.data));
  701. if (res.data != "") {
  702. let postData = {
  703. convertType: 20,
  704. fileUrl: res.data,
  705. isPrint: 1,
  706. isDownload: 1,
  707. };
  708. var postCfg_transfer = {
  709. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  710. transformRequest: function (data) {
  711. return $.param(data);
  712. }
  713. };
  714. $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
  715. .success(function (res) {
  716. self.LoadYZ = false;
  717. if (res.errorcode === 0) {
  718. self.iframeList[0] = { id: 1, title: "签报收文", filename: "文档", url: $sce.trustAsResourceUrl(sp.ipChange(res.data.viewUrl)), source: res.data.viewUrl, edit: false, show: 1, boxStyle: { width: $(".leftBox").width() }, iframeStyle: { width: $(".leftBox").width() - 10 } };
  719. self.iframeLast = self.iframeList.length - 1;
  720. self.iframeShow = self.iframeList.length;
  721. self.iframeHide = self.iframeList.length - self.iframeShow;
  722. } else {
  723. sp.dialog(res.message);
  724. }
  725. });
  726. }
  727. })
  728. }
  729. })
  730. } else {
  731. var data = {
  732. routeinfoid: self.routeinfoid
  733. }
  734. $http.post(apiurljs.login + "g2app/dataabase/mergeFileByLastRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  735. .success(function (obj) {
  736. var res = strToJson(s4.decryptData_CBC(obj.data));
  737. if (res.data.result != "") {
  738. let postData = {
  739. convertType: res.data.mark == "ofd" ? 570 : 20,
  740. isDownload: 1,
  741. isPrint: 1,
  742. fileUrl: res.data.result
  743. };
  744. var postCfg_transfer = {
  745. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  746. transformRequest: function (data) {
  747. return $.param(data);
  748. }
  749. };
  750. $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
  751. .success(function (res) {
  752. if (res.errorcode === 0) {
  753. self.iframeList = [{ id: 1, title: "签报收文", filename: "文档", url: $sce.trustAsResourceUrl(sp.ipChange(res.data.viewUrl)), source: res.data.viewUrl, edit: false, show: 1, boxStyle: { width: $(".leftBox").width() }, iframeStyle: { width: $(".leftBox").width() - 10 } }];
  754. self.iframeLast = self.iframeList.length - 1;
  755. self.iframeShow = self.iframeList.length;
  756. self.iframeHide = self.iframeList.length - self.iframeShow;
  757. } else {
  758. sp.dialog(res.message);
  759. }
  760. });
  761. } else {
  762. var data = {
  763. routeinfoid: self.routeinfoid
  764. }
  765. $http.post(apiurljs.login + "g2app/dataabase/mergePDFByLastRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  766. .success(function (obj) {
  767. var res = strToJson(s4.decryptData_CBC(obj.data));
  768. if (res.data.result != "") {
  769. let postData = {
  770. convertType: res.data.mark == "ofd" ? 570 : 20,
  771. isDownload: 1,
  772. isPrint: 1,
  773. fileUrl: res.data.result
  774. };
  775. var postCfg_transfer = {
  776. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  777. transformRequest: function (data) {
  778. return $.param(data);
  779. }
  780. };
  781. $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
  782. .success(function (res) {
  783. if (res.errorcode === 0) {
  784. self.iframeList = [{ id: 1, title: "签报收文", filename: "文档", url: $sce.trustAsResourceUrl(sp.ipChange(res.data.viewUrl)), source: res.data.viewUrl, edit: false, show: 1, boxStyle: { width: $(".leftBox").width() }, iframeStyle: { width: $(".leftBox").width() - 10 } }];
  785. self.iframeLast = self.iframeList.length - 1;
  786. self.iframeShow = self.iframeList.length;
  787. self.iframeHide = self.iframeList.length - self.iframeShow;
  788. } else {
  789. sp.dialog(res.message);
  790. }
  791. });
  792. }
  793. })
  794. }
  795. })
  796. }
  797. }
  798. //获取关联文稿
  799. self.getGLJ = function (n) {
  800. var data = {
  801. dockind: "D01",
  802. routeinfoid: self.routeinfoid
  803. }
  804. $http.post(apiurljs.login + "g2app/fawenfilesrelate/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  805. .success(function (obj) {
  806. var res = strToJson(s4.decryptData_CBC(obj.data));
  807. self.guanlian = res.data;
  808. if (n == 0) {
  809. self.getGLFLOW()
  810. }
  811. if (n == 2) {
  812. self.editFile(self.guanlian[self.guanlian.length - 1], 2)
  813. }
  814. })
  815. }
  816. self.seeGLJ = function () {
  817. if ($(".formedit2").find("iframe").attr("src") == "") {
  818. if (self.guanlian[0].FILEURL.indexOf("files") > -1) {
  819. var set_filepath = apiurljs.yzFcscloud + "g2work/files/" + self.guanlian[0].FILEURL.slice(7);
  820. } else {
  821. var set_filepath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + self.guanlian[0].FILEURL;
  822. }
  823. var data = {
  824. method: 1,
  825. params: {
  826. userId: self.userName,
  827. fileId: "",
  828. fileName: "",
  829. filePath: "",
  830. userRight: self.dotype != 1 ? 1 : 0,
  831. callbackUrl: ""
  832. }
  833. };
  834. if (self.guanlian[0].FILEURL.indexOf("files") > -1) {
  835. data.params.fileId = self.guanlian[0].FILEURL.split("/")[2];
  836. data.params.fileName = self.guanlian[0].FILEURL.split("/")[3];
  837. data.params.filePath = apiurljs.yzFcscloud + "g2work/files/" + self.guanlian[0].FILEURL.slice(7);
  838. data.params.callbackUrl = apiurljs.login + "g2app/attachfiles/uploadFileAttach"
  839. } else {
  840. data.params.fileId = self.guanlian[0].ID;
  841. data.params.fileName = self.guanlian[0].FILENAMES;
  842. data.params.filePath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + self.guanlian[0].FILEURL;
  843. data.params.callbackUrl = apiurljs.login + "g2app/fawenfiles/uploadFile"
  844. }
  845. $.ajax({
  846. url: apiurljs.yzFileWo + "api.do",
  847. data: {
  848. jsonParams: encodeURIComponent(JSON.stringify(data))
  849. },
  850. type: "POST",
  851. dataType: "json",
  852. general: false,
  853. async: false,
  854. success: function (data) {
  855. if (data) {
  856. if (data.errorCode === "0") {
  857. let rst = data.result;
  858. if (rst && rst.urls) {
  859. var get_urls = rst.urls;
  860. if (typeof (get_urls) === "string") {
  861. $(".formedit2").find("iframe").attr("src", sp.ipChange(get_urls)).attr("data-id", self.guanlian[0].ID)
  862. }
  863. }
  864. }
  865. }
  866. },
  867. });
  868. }
  869. }
  870. //获取关联流程
  871. self.getGLFLOW = function () {
  872. var data = {
  873. userid: self.userId,
  874. routeinfoid: self.routeinfoid
  875. }
  876. $http.post(apiurljs.login + "g2work/routeinfo/queryDataRelatedFlow", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  877. .success(function (obj) {
  878. var res = strToJson(s4.decryptData_CBC(obj.data));
  879. res.data.FLOWIN.forEach(function (item) {
  880. item.type = "FLOWIN"
  881. })
  882. res.data.FLOWOUT.forEach(function (item) {
  883. item.type = "FLOWOUT"
  884. })
  885. self.glList = res.data.FLOWIN.concat(res.data.FLOWOUT);
  886. })
  887. }
  888. //获取意见(不上表)
  889. self.getOpinion1 = function (n) {
  890. self.HWFJ = [];
  891. var data = {
  892. cmanid: self.userId,
  893. routeinfoid: self.routeinfoid,
  894. routeid: "",//self.routeid,
  895. tableid: "FW_SPJ",
  896. colid: "",
  897. opiniontype: "",//self.opiniontype,
  898. orderbycol: "CDATE desc"
  899. }
  900. $http.post(apiurljs.login + "g2app/abase/queryDataOpinionWithRouteAttach", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  901. .success(function (obj) {
  902. var res = strToJson(s4.decryptData_CBC(obj.data));
  903. if (res.success == true) {
  904. for (var i in self.YJ) {
  905. if (typeof (self.YJ[i]) == "object") {
  906. self.YJ[i] = [];
  907. self.YJ[i + "STATUS"] = false;
  908. res.data.forEach(function (item) {
  909. item.CDATE = sp.datefmt("yyyy-MM-dd", item.CDATE);
  910. if (i == item.COLID) {
  911. self.YJ[i].push(item)
  912. if (item.ROUTEID == self.routeid) {
  913. self.data[i] = item.opinion;
  914. self.YJ[i + "STATUS"] = true;
  915. }
  916. }
  917. })
  918. }
  919. }
  920. self.YJ.nulla = res.data.filter(function (item) {
  921. return item.COLID == "";
  922. });
  923. self.YJ.nullaSTATUS = false;
  924. self.YJ.nulla.forEach(function (item) {
  925. item.CDATE = sp.datefmt("yyyy-MM-dd", item.CDATE);
  926. if (self.activeOpinion != null) {
  927. self.activeOpinion.FILEDATA = item.FILEDATA
  928. }
  929. })
  930. res.data.forEach(function (item) {
  931. item.FILEDATA.forEach(function (item1) {
  932. self.HWFJ.push(item1)
  933. })
  934. })
  935. //if (n == 1 && self.lastrouteinfoid != 0) {
  936. // self.getHB()
  937. //}
  938. } else {
  939. sp.dialog(res.message)
  940. }
  941. })
  942. }
  943. //获取附件和插件
  944. self.getOther = function () {
  945. if (self.routeinfoid == 0) { return }
  946. var data = {
  947. tablename: "FILE_ATTACH",
  948. colums: "*",
  949. order: "ID asc",
  950. sqlwhere: { ROUTEINFOID: self.routeinfoid },
  951. sqlinwhere: "",
  952. sqllikewhere: ""
  953. }
  954. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  955. .success(function (obj) {
  956. var res = strToJson(s4.decryptData_CBC(obj.data));
  957. self.arrayFile1 = [];
  958. if (res.data.length > 0) {
  959. res.data.forEach(function (item) {
  960. if (item.ATTACHTYPE.indexOf("-正文") == -1) {
  961. self.arrayFile1.push(item)
  962. }
  963. })
  964. }
  965. })
  966. }
  967. //发文打开过程稿在线编辑
  968. self.getGCG = function (n) {
  969. var data = {
  970. dockind: "D01",
  971. routeinfoid: self.routeinfoid
  972. }
  973. $http.post(apiurljs.login + "g2app/fawenfiles/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  974. .success(function (obj) {
  975. var res = strToJson(s4.decryptData_CBC(obj.data));
  976. self.gaoTypeArrayFirst = res.data;
  977. self.gaoTypeArrayFirst.forEach(function (item) {
  978. if (item.FILENAMES.split(".").length == 1) {
  979. item.FILENAMES = item.FILENAMES + "." + item.FILEEXT
  980. }
  981. })
  982. if (self.gaoTypeArrayFirst.length > 0 && self.lastrouteinfoid == 0) {
  983. self.seeGCG()
  984. }
  985. if (n > 0) {
  986. self.editFile(self.gaoTypeArrayFirst[0], 1, "正文");
  987. }
  988. if (self.gaoTypeArrayFirst.length > 1) {
  989. var data = {
  990. id: self.gaoTypeArrayFirst[0].ID
  991. }
  992. $http.post(apiurljs.login + "g2app/fawenfiles/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  993. .success(function (obj) {
  994. var res = strToJson(s4.decryptData_CBC(obj.data));
  995. if (res.success) {
  996. self.getGCG(2)
  997. }
  998. });
  999. }
  1000. })
  1001. }
  1002. self.seeGCG = function () {
  1003. if ($(".formedit1").find("iframe").attr("src") == "") {
  1004. if (self.gaoTypeArrayFirst[0].FILEURL.indexOf("files") > -1) {
  1005. var set_filepath = apiurljs.yzFcscloud + "g2work/files/" + self.gaoTypeArrayFirst[0].FILEURL.slice(7);
  1006. } else {
  1007. var set_filepath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + self.gaoTypeArrayFirst[0].FILEURL;
  1008. }
  1009. var data = {
  1010. method: 1,
  1011. params: {
  1012. userId: self.userName,
  1013. fileId: "",
  1014. fileName: "",
  1015. filePath: "",
  1016. userRight: self.dotype != 1 ? 1 : 0,
  1017. callbackUrl: ""
  1018. }
  1019. };
  1020. if (self.gaoTypeArrayFirst[0].FILEURL.indexOf("files") > -1) {
  1021. data.params.fileId = self.gaoTypeArrayFirst[0].FILEURL.split("/")[2];
  1022. data.params.fileName = self.gaoTypeArrayFirst[0].FILEURL.split("/")[3];
  1023. data.params.filePath = apiurljs.yzFcscloud + "g2work/files/" + self.gaoTypeArrayFirst[0].FILEURL.slice(7);
  1024. data.params.callbackUrl = apiurljs.login + "g2app/attachfiles/uploadFileAttach"
  1025. } else {
  1026. data.params.fileId = self.gaoTypeArrayFirst[0].ID;
  1027. data.params.fileName = self.gaoTypeArrayFirst[0].FILENAMES;
  1028. data.params.filePath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + self.gaoTypeArrayFirst[0].FILEURL;
  1029. data.params.callbackUrl = apiurljs.login + "g2app/fawenfiles/uploadFile"
  1030. }
  1031. $.ajax({
  1032. url: apiurljs.yzFileWo + "api.do",
  1033. data: {
  1034. jsonParams: encodeURIComponent(JSON.stringify(data))
  1035. },
  1036. type: "POST",
  1037. dataType: "json",
  1038. general: false,
  1039. async: false,
  1040. success: function (data) {
  1041. if (data) {
  1042. if (data.errorCode === "0") {
  1043. let rst = data.result;
  1044. if (rst && rst.urls) {
  1045. var get_urls = rst.urls;
  1046. if (typeof (get_urls) === "string") {
  1047. $(".formedit1").find("iframe").attr("src", sp.ipChange(get_urls)).attr("data-id", self.gaoTypeArrayFirst[0].ID)
  1048. }
  1049. }
  1050. }
  1051. }
  1052. },
  1053. });
  1054. }
  1055. }
  1056. //成文稿
  1057. self.getCWG = function () {
  1058. var data = {
  1059. dockind: "D02",
  1060. routeinfoid: self.routeinfoid
  1061. }
  1062. $http.post(apiurljs.login + "g2app/fawenfiles/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1063. .success(function (obj) {
  1064. var res = strToJson(s4.decryptData_CBC(obj.data));
  1065. self.gaoTypeArraySecond = res.data;
  1066. self.gaoTypeArraySecond.forEach(function (item) {
  1067. if (item.FILENAMES.split(".").length == 1) {
  1068. item.FILENAMES = item.FILENAMES + "." + item.FILEEXT
  1069. }
  1070. })
  1071. })
  1072. }
  1073. //签章稿
  1074. self.getQZG = function () {
  1075. var data = {
  1076. dockind: "D03",
  1077. routeinfoid: self.routeinfoid
  1078. }
  1079. $http.post(apiurljs.login + "g2app/fawenfiles/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1080. .success(function (obj) {
  1081. var res = strToJson(s4.decryptData_CBC(obj.data));
  1082. self.gaoTypeArrayThird = res.data;
  1083. self.gaoTypeArrayThird.forEach(function (item) {
  1084. if (item.FILENAMES.split(".").length == 1) {
  1085. item.FILENAMES = item.FILENAMES + "." + item.FILEEXT
  1086. }
  1087. })
  1088. })
  1089. }
  1090. //下载正文/终稿/签章
  1091. self.downloadWG = function (item) {
  1092. //window.open(apiurljs.login.split("glwork/")[0] + "glworkweb/" + item.FILEURL)
  1093. window.open(apiurljs.login + "g2work/gaizhangfiles/" + encodeURIComponent(self.data.BT) + "/" + item.FILENAMES)
  1094. }
  1095. //删除正文/终稿/签章
  1096. self.btnDeleteWG = function (obj, n) {
  1097. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  1098. var dialogBody = "<div class=\"sp-dialog-body\">删除后不可恢复,您确认要删除吗?</div>";
  1099. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  1100. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  1101. sp.openCenter(".sp-dialog");
  1102. ///取消按钮
  1103. $('.sp-closeDialog').click(function (event) {
  1104. sp.closeCenter(".sp-dialog");
  1105. event.preventDefault();
  1106. event.stopPropagation();
  1107. });
  1108. //post消息的id
  1109. $("#delDataTrue").click(function () {
  1110. var data = {
  1111. id: obj.ID
  1112. }
  1113. $http.post(apiurljs.login + "g2app/fawenfiles/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1114. .success(function (obj) {
  1115. var res = strToJson(s4.decryptData_CBC(obj.data));
  1116. sp.dialoghide();
  1117. if (res.success) {
  1118. if (n == 2) {
  1119. self.getCWG()
  1120. } else if (n == 3) {
  1121. self.getQZG()
  1122. }
  1123. } else {
  1124. sp.dialog("创建失败,请联系管理员!");
  1125. }
  1126. ///
  1127. });
  1128. });
  1129. };
  1130. //生成正文三种方式:空白模板,红头模板,上传本地文件
  1131. self.newMoBanFlag = false;
  1132. self.newMoBan1 = function () {
  1133. self.newMoBanFlag = true;
  1134. if (self.gaoTypeArrayFirst.length > 0) {
  1135. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  1136. var dialogBody = "<div class=\"sp-dialog-body\">您确定要覆盖正文吗?</div>";
  1137. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  1138. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  1139. sp.openCenter(".sp-dialog");
  1140. ///取消按钮
  1141. $('.sp-closeDialog').click(function (event) {
  1142. sp.closeCenter(".sp-dialog");
  1143. event.preventDefault();
  1144. event.stopPropagation();
  1145. });
  1146. //post消息的id
  1147. $("#delDataTrue").click(function () {
  1148. sp.closeCenter(".sp-dialog");
  1149. var data = {
  1150. id: self.gaoTypeArrayFirst[0].ID
  1151. }
  1152. $http.post(apiurljs.login + "g2app/fawenfiles/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1153. .success(function (obj) {
  1154. var res = strToJson(s4.decryptData_CBC(obj.data));
  1155. if (res.success) {
  1156. var data = {
  1157. dockind: "D01",
  1158. routeinfoid: self.routeinfoid,
  1159. gwtype: self.data.GWZL,
  1160. filekind: "DOCFILE"
  1161. }
  1162. $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1163. .success(function (obj) {
  1164. var res = strToJson(s4.decryptData_CBC(obj.data));
  1165. if (res.success) {
  1166. self.getGCG(1)
  1167. } else {
  1168. sp.dialog("创建失败,请联系管理员!");
  1169. }
  1170. });
  1171. } else {
  1172. sp.dialog("创建失败,请联系管理员!");
  1173. }
  1174. self.newMoBanFlag = false;
  1175. });
  1176. })
  1177. } else {
  1178. var data = {
  1179. dockind: "D01",
  1180. routeinfoid: self.routeinfoid,
  1181. gwtype: self.data.GWZL,
  1182. filekind: "DOCFILE"
  1183. }
  1184. $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1185. .success(function (obj) {
  1186. var res = strToJson(s4.decryptData_CBC(obj.data));
  1187. if (res.success) {
  1188. self.getGCG(1)
  1189. } else {
  1190. sp.dialog("创建失败,请联系管理员!");
  1191. }
  1192. self.newMoBanFlag = false;
  1193. });
  1194. }
  1195. }
  1196. self.newMoBan2 = function () {
  1197. self.newMoBanFlag = true;
  1198. if (self.gaoTypeArrayFirst.length > 0) {
  1199. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  1200. var dialogBody = "<div class=\"sp-dialog-body\">您确定要覆盖正文吗?</div>";
  1201. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  1202. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  1203. sp.openCenter(".sp-dialog");
  1204. ///取消按钮
  1205. $('.sp-closeDialog').click(function (event) {
  1206. sp.closeCenter(".sp-dialog");
  1207. event.preventDefault();
  1208. event.stopPropagation();
  1209. });
  1210. //post消息的id
  1211. $("#delDataTrue").click(function () {
  1212. sp.closeCenter(".sp-dialog");
  1213. var data = {
  1214. id: self.gaoTypeArrayFirst[0].ID
  1215. }
  1216. $http.post(apiurljs.login + "g2app/fawenfiles/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1217. .success(function (obj) {
  1218. var res = strToJson(s4.decryptData_CBC(obj.data));
  1219. if (res.success) {
  1220. var data = {
  1221. dockind: "D01",
  1222. routeinfoid: self.routeinfoid,
  1223. gwtype: self.data.GWZL,
  1224. filekind: "REDFILE"
  1225. }
  1226. $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1227. .success(function (obj) {
  1228. var res = strToJson(s4.decryptData_CBC(obj.data));
  1229. if (res.success) {
  1230. self.getGCG(1)
  1231. } else {
  1232. sp.dialog("创建失败,请联系管理员!");
  1233. }
  1234. });
  1235. } else {
  1236. sp.dialog("创建失败,请联系管理员!");
  1237. }
  1238. self.newMoBanFlag = false;
  1239. });
  1240. })
  1241. } else {
  1242. var data = {
  1243. dockind: "D01",
  1244. routeinfoid: self.routeinfoid,
  1245. gwtype: self.data.GWZL,
  1246. filekind: "REDFILE"
  1247. }
  1248. $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1249. .success(function (obj) {
  1250. var res = strToJson(s4.decryptData_CBC(obj.data));
  1251. if (res.success) {
  1252. self.getGCG(1)
  1253. } else {
  1254. sp.dialog("创建失败,请联系管理员!");
  1255. }
  1256. self.newMoBanFlag = false;
  1257. });
  1258. }
  1259. }
  1260. //判断页面字段是否只读readonly、是否隐藏show
  1261. self.hide = function (type, field) {
  1262. if (self.dotype == 0 && type == "readonly") {
  1263. return true;
  1264. } else {
  1265. if (self[type][field] == true) {
  1266. return true;
  1267. } else {
  1268. return false;
  1269. }
  1270. }
  1271. }
  1272. //右上角按钮调用方法
  1273. self.btnEvent = function (item) {
  1274. switch (item.CODE) {
  1275. case "SAVEITEM": self.btnSave(0); break;
  1276. case "PRINTITEM": self.btnPrint(); break;
  1277. case "PRINTITEMEXTEND": self.btnPrint1(); break;
  1278. case "SAVEOFD": self.toOFD(); break;
  1279. case "GAIZITEM": self.qianZ(); break;
  1280. case "MEETITEM": self.Meet(); break;
  1281. case "SENDLOG": self.RouteList(); break;
  1282. case "array": return;
  1283. default: self.forward(item); break;
  1284. }
  1285. }
  1286. //生成终稿
  1287. self.toOFD = function () {
  1288. if (self.gaoTypeArraySecond.length != 0) {
  1289. sp.dialog("请删除成文稿后,点击文件保存!")
  1290. $timeout(function () {
  1291. sp.dialoghide()
  1292. }, 1000)
  1293. return
  1294. }
  1295. var data = {
  1296. routeinfoid: self.routeinfoid,
  1297. gwtype: self.data.GWZL,
  1298. dockind: "D02"
  1299. }
  1300. $http.post(apiurljs.login + "g2app/fawenfiles/convertDataFinalOFDFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1301. .success(function (obj) {
  1302. var res = strToJson(s4.decryptData_CBC(obj.data));
  1303. if (res.success == true) {
  1304. self.getCWG()
  1305. }
  1306. })
  1307. }
  1308. //签章
  1309. self.qianZ = function () {
  1310. if (self.gaoTypeArrayThird.length != 0 || self.gaoTypeArraySecond.length != 0) {
  1311. sp.dialog("请删除成文稿和签章稿后,点击签章!")
  1312. $timeout(function () {
  1313. sp.dialoghide()
  1314. }, 1000)
  1315. return
  1316. }
  1317. var data = {
  1318. //srcpath: "/opt/TongWeb7.0/applications/glworkweb/UploadAttach/" + self.gaoTypeArraySecond[0].FILENAMES,
  1319. //outpath: "/opt/TongWeb7.0/applications/glworkweb/UploadAttach",
  1320. routeinfoid: self.routeinfoid,
  1321. gwtype: self.data.GWZL,
  1322. dockind: "D02"
  1323. }
  1324. //$http.post(apiurljs.login + "g2app/signature/getSignature", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1325. $http.post(apiurljs.login + "g2app/signature/convertDataFinalOFDFileAndgetSignature", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1326. .success(function (obj) {
  1327. var res = strToJson(s4.decryptData_CBC(obj.data));
  1328. if (res.success == true) {
  1329. sp.dialog("生成成功!")
  1330. self.getCWG()
  1331. self.getQZG()
  1332. }
  1333. })
  1334. }
  1335. //打开公文模板弹窗
  1336. self.openGLJ = function () {
  1337. $("#GLJWin").attr("src", "../../forward/GLJ.html?routeid=" + self.routeid + "&routeinfoid=" + self.routeinfoid + "&copyrightid=" + self.copyrightid + "&directionid=" + self.directionid + "&formeditid=" + self.formeditid + "&cookie=shouwenbg")
  1338. sp.layer("#GLJ")
  1339. }
  1340. self.tiaohao = function () {
  1341. var data = {
  1342. data: {
  1343. CYEAR: sp.currentYear(),
  1344. FLOWID: sp.getUrlName("flowid"),
  1345. ZIHAO: "",
  1346. CNAMEMARK: "",
  1347. ROUTEINFOIDMARK: self.routeinfoid,
  1348. THMARK: 1
  1349. }
  1350. }
  1351. self.FWZH.forEach(function (item) {
  1352. if (item.CODE == self.data.FWZH) {
  1353. data.data.ZIHAO = item.CODE;
  1354. data.data.CNAMEMARK = item.CNAMEMARK
  1355. }
  1356. })
  1357. $http.post(apiurljs.login + "g2app/fawen/saveZhanHaoByData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1358. .success(function (obj) {
  1359. var res = strToJson(s4.decryptData_CBC(obj.data));
  1360. if (res.success == true) {
  1361. var data1 = {
  1362. flowid: sp.getUrlName("flowid"),
  1363. code: self.data.NGRBMID,
  1364. cyear: self.data.FWZH == "" ? sp.currentYear() : self.data.FWZH.slice(self.data.FWZH.indexOf("〔") + 1, self.data.FWZH.indexOf("〕")),
  1365. routeinfoidmark: self.routeinfoid,
  1366. zihao: self.data.FWZH
  1367. }
  1368. $http.post(apiurljs.login + "g2app/fawen/queryZiHaoCode", { data: s4.encryptData_CBC(JSON.stringify(data1)) }, postCfg)
  1369. .success(function (obj1) {
  1370. var res1 = strToJson(s4.decryptData_CBC(obj1.data));
  1371. self.FWZH = res1.data.map(function (item) {
  1372. return { CNAME: item.split("|")[0], CODE: item.split("|")[0], CNAMEMARK: item.split("|")[1] }
  1373. });
  1374. self.data.FWZH = self.FWZH[0].CODE
  1375. self.btnSave(0)
  1376. })
  1377. } else {
  1378. sp.dialog(res.message)
  1379. }
  1380. })
  1381. }
  1382. self.tiaohaoR = function () {
  1383. var data = {
  1384. flowid: sp.getUrlName("flowid"),
  1385. cnamemark: "",
  1386. routeinfoidmark: self.routeinfoid,
  1387. cyear: sp.currentYear(),
  1388. zihao: self.data.FWZH
  1389. }
  1390. self.FWZH.forEach(function (item) {
  1391. if (item.CODE == self.data.FWZH) {
  1392. data.cnamemark = item.CNAMEMARK
  1393. }
  1394. })
  1395. $http.post(apiurljs.login + "g2app/fawen/initZiHaoByRouteinfoidmark", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1396. .success(function (obj) {
  1397. var res = strToJson(s4.decryptData_CBC(obj.data));
  1398. if (res.success == true) {
  1399. if (res.data == 0) {
  1400. sp.dialog("此件当前暂无占号记录!")
  1401. $timeout(function () {
  1402. sp.dialoghide()
  1403. }, 1500)
  1404. return
  1405. }
  1406. var data1 = {
  1407. flowid: sp.getUrlName("flowid"),
  1408. code: self.data.NGRBMID,
  1409. cyear: self.data.FWZH == "" ? sp.currentYear() : self.data.FWZH.slice(self.data.FWZH.indexOf("〔") + 1, self.data.FWZH.indexOf("〕")),
  1410. routeinfoidmark: self.routeinfoid,
  1411. zihao: ""
  1412. }
  1413. $http.post(apiurljs.login + "g2app/fawen/queryZiHaoCode", { data: s4.encryptData_CBC(JSON.stringify(data1)) }, postCfg)
  1414. .success(function (obj1) {
  1415. var res1 = strToJson(s4.decryptData_CBC(obj1.data));
  1416. self.FWZH = res1.data.map(function (item) {
  1417. return { CNAME: item.split("|")[0], CODE: item.split("|")[0], CNAMEMARK: item.split("|")[1] }
  1418. });
  1419. self.data.FWZH = self.FWZH[0].CODE
  1420. self.btnSave(0)
  1421. console.log(self.FWZH)
  1422. })
  1423. } else {
  1424. sp.dialog(res.message)
  1425. }
  1426. })
  1427. }
  1428. self.tiaohaoD = function () {
  1429. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  1430. var dialogBody = "<div class=\"sp-dialog-body\">您确定要清除吗?</div>";
  1431. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  1432. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  1433. sp.openCenter(".sp-dialog");
  1434. ///取消按钮
  1435. $('.sp-closeDialog').click(function (event) {
  1436. sp.closeCenter(".sp-dialog");
  1437. event.preventDefault();
  1438. event.stopPropagation();
  1439. });
  1440. //post消息的id
  1441. $("#delDataTrue").click(function () {
  1442. sp.closeCenter(".sp-dialog");
  1443. var data = {
  1444. routeinfoid: self.routeinfoid,
  1445. tablename: "FW_SPJ",
  1446. colfwname: "FWZH",
  1447. flowid: sp.getUrlName("flowid")
  1448. }
  1449. $http.post(apiurljs.login + "g2app/shouwen/deleteFWCodeByRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1450. .success(function (obj) {
  1451. var res = strToJson(s4.decryptData_CBC(obj.data));
  1452. if (res.success == true) {
  1453. var data1 = {
  1454. flowid: sp.getUrlName("flowid"),
  1455. code: self.data.NGRBMID,
  1456. cyear: self.data.FWZH == "" ? sp.currentYear() : self.data.FWZH.slice(self.data.FWZH.indexOf("〔") + 1, self.data.FWZH.indexOf("〕")),
  1457. routeinfoidmark: self.routeinfoid,
  1458. zihao: self.data.FWZH
  1459. }
  1460. $http.post(apiurljs.login + "g2app/fawen/queryZiHaoCode", { data: s4.encryptData_CBC(JSON.stringify(data1)) }, postCfg)
  1461. .success(function (obj1) {
  1462. var res1 = strToJson(s4.decryptData_CBC(obj1.data));
  1463. self.FWZH = res1.data.map(function (item) {
  1464. return { CNAME: item.split("|")[0], CODE: item.split("|")[0], CNAMEMARK: item.split("|")[1] }
  1465. });
  1466. self.data.FWZH = "";
  1467. self.data.FWZH1 = "";
  1468. })
  1469. }
  1470. })
  1471. })
  1472. }
  1473. //保存提交
  1474. self.btnSave = function (n) {
  1475. if (spngvld.submit(".formedit")) {
  1476. if (self.docmode == 'zihao' && self.data.FWZH != "") {
  1477. var data = {
  1478. data: {
  1479. CYEAR: sp.currentYear(),
  1480. FLOWID: sp.getUrlName("flowid"),
  1481. ZIHAO: "",
  1482. CNAMEMARK: "",
  1483. ROUTEINFOIDMARK: self.routeinfoid
  1484. }
  1485. }
  1486. self.FWZH.forEach(function (item) {
  1487. if (item.CODE == self.data.FWZH) {
  1488. data.data.ZIHAO = item.CODE;
  1489. data.data.CNAMEMARK = item.CNAMEMARK
  1490. }
  1491. })
  1492. $http.post(apiurljs.login + "g2app/fawen/saveWenHaoByData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1493. .success(function (obj) { })
  1494. }
  1495. var dataArray = [];
  1496. dataArray.push(self.data);
  1497. var data = {
  1498. ckey: "FW_SPJ",
  1499. id: self.data.ID,
  1500. routeid: self.routeid,
  1501. routeinfoid: self.routeinfoid,
  1502. routeinfotitle: self.data.BT.replace(/\n/g, '').replace(/\s/g, ''),//self.data.ZT,
  1503. directionid: self.directionid,
  1504. formeditid: self.formeditid,
  1505. data: JSON.stringify(dataArray)
  1506. }
  1507. $http.post(apiurljs.login + "g2app/abase/saveData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1508. .success(function (obj) {
  1509. var res = strToJson(s4.decryptData_CBC(obj.data));
  1510. if (res.code == 0) {
  1511. self.data.ID = res.data.ID;
  1512. self.routeid = res.data.ROUTEID;
  1513. self.routeinfoid = res.data.ROUTEINFOID;
  1514. // if (self.lastrouteinfoid == 0) {
  1515. // self.getHB()
  1516. // }
  1517. self.filedChange = false;
  1518. if (self.gaoTypeArrayFirst.length == 0) {
  1519. var data = {
  1520. dockind: "D01",
  1521. routeinfoid: self.routeinfoid,
  1522. gwtype: self.data.GWZL,
  1523. filekind: "DOCFILE"
  1524. }
  1525. $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1526. .success(function (obj) {
  1527. var res = strToJson(s4.decryptData_CBC(obj.data));
  1528. if (res.success) {
  1529. if (n == 0) {
  1530. sp.dialog("保存成功!");
  1531. $timeout(function () {
  1532. sp.dialoghide()
  1533. }, 1500)
  1534. self.getSwenList(1)
  1535. } else if (n == 1) {
  1536. self.forward(self.btnItem);
  1537. } else if (n == 2) {
  1538. self.sendAll();
  1539. } else if (n == 3) {
  1540. self.btnPrint();
  1541. } else if (n == 4) {
  1542. sp.layer("#print")
  1543. }
  1544. } else {
  1545. sp.dialog("文稿创建失败,请联系管理员!");
  1546. }
  1547. });
  1548. } else {
  1549. var YZdata = {
  1550. method: 2,
  1551. params: {
  1552. fileId: self.gaoTypeArrayFirst[0].ID
  1553. }
  1554. };
  1555. $.ajax({
  1556. url: apiurljs.yzFileWo + "api.do",
  1557. data: {
  1558. jsonParams: encodeURIComponent(JSON.stringify(YZdata))
  1559. },
  1560. type: "POST",
  1561. dataType: "json",
  1562. general: false,
  1563. async: false,
  1564. success: function (resp) {
  1565. if (n == 0) {
  1566. sp.dialog("保存成功!");
  1567. $timeout(function () {
  1568. sp.dialoghide()
  1569. }, 1500)
  1570. self.getSwenList(1)
  1571. } else if (n == 1) {
  1572. self.forward(self.btnItem);
  1573. } else if (n == 2) {
  1574. self.sendAll();
  1575. } else if (n == 3) {
  1576. self.btnPrint();
  1577. }else if (n == 4) {
  1578. sp.layer("#print")
  1579. }
  1580. }
  1581. });
  1582. }
  1583. } else {
  1584. sp.dialog(res.message)
  1585. }
  1586. })
  1587. }
  1588. }
  1589. /*综合打印*/
  1590. self.printFiled = 1;
  1591. self.btnPrint1 = function () {
  1592. if (self.filedChange == true) {
  1593. self.btnSave(4)
  1594. } else {
  1595. sp.layer("#print")
  1596. }
  1597. }
  1598. self.printSubmit = function () {
  1599. if (self.printFiled == 1) {
  1600. var templatefilename = "moban18"
  1601. } else if (self.printFiled == 2) {
  1602. var templatefilename = "mobanoption"
  1603. } else {
  1604. var templatefilename = "moban18_all"
  1605. }
  1606. var data = {
  1607. templatefilename: templatefilename + ".ftl",
  1608. outfilepath: "/tmp/审批件" + sp.datefmt('yyyyMMddHHmmss', sp.getLocalDate()) + ".wps",
  1609. routeinfoid: self.routeinfoid,
  1610. tablename: "FW_SPJ",
  1611. printtype: self.printFiled,
  1612. printdate: "NGSJ"
  1613. }
  1614. console.log(s4.encryptData_CBC(JSON.stringify(data)))
  1615. $http.post(apiurljs.login + "g2app/dataabase/PrintWordExtend", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1616. .success(function (obj) {
  1617. var res = strToJson(s4.decryptData_CBC(obj.data));
  1618. if (self.deviceType == "pad") {
  1619. window.location.href = "../../../printPreview.html?url=" + apiurljs.yzFcscloud + "g2work" + res.data[0].url
  1620. } else {
  1621. sp.openNewWindow("../../../printPreview.html?url=" + apiurljs.yzFcscloud + "g2work" + res.data[0].url, '打印预览')
  1622. }
  1623. })
  1624. sp.layerhide()
  1625. }
  1626. //签写意见编辑状态
  1627. self.opinion = {
  1628. WLDQFL: false,
  1629. WLDQFLImg: false,
  1630. WLDSSL: false,
  1631. WLDSSLImg: false,
  1632. GPJZSC: false,
  1633. GPJZSCImg: false,
  1634. BGSFHYJ: false,
  1635. BGSFHYJImg: false,
  1636. FLSH: false,
  1637. FLSHImg: false,
  1638. SX: false,
  1639. SXImg: false,
  1640. BMFZRYJ: false,
  1641. BMFZRYJImg: false,
  1642. HBCSYJ: false,
  1643. HBCSYJImg: false,
  1644. nulla: false
  1645. }
  1646. self.YJ = {
  1647. WLDQFL: [],
  1648. WLDQFLSTATUS: false,
  1649. WLDSSL: [],
  1650. WLDSSLSTATUS: false,
  1651. GPJZSC: [],
  1652. GPJZSCSTATUS: false,
  1653. BGSFHYJ: [],
  1654. BGSFHYJSTATUS: false,
  1655. FLSH: [],
  1656. FLSHSTATUS: false,
  1657. SX: [],
  1658. SXSTATUS: false,
  1659. BMFZRYJ: [],
  1660. BMFZRYJSTATUS: false,
  1661. HBCSYJ: [],
  1662. HBCSYJSTATUS: false,
  1663. nulla: [],
  1664. nullaSTATUS: false
  1665. }
  1666. //意见(下表)
  1667. self.openOptionList = function () {
  1668. if (self.routeinfoid == 0 && self.routeid == 0) {
  1669. sp.dialog("请先保存!")
  1670. return;
  1671. }
  1672. if (self.dotype == 0) {
  1673. return
  1674. }
  1675. if (self.opinion.nulla == true) {
  1676. return;
  1677. }
  1678. self.nulla = "";
  1679. self.opinion.nulla = true;
  1680. }
  1681. self.openOptionList1 = function () {
  1682. self.openOptionList()
  1683. self.activeOpinion = null;
  1684. self.showBottom = "opinion";
  1685. self.YJ.nulla.forEach(function (item) {
  1686. if (item.ROUTEID == self.routeid) {
  1687. self.activeOpinion = item;
  1688. self.nulla = item.OPINION;
  1689. }
  1690. })
  1691. }
  1692. self.closeOptionList = function () {
  1693. self.opinion.nulla = false;
  1694. self.activeOpinion = null;
  1695. $(".toggle").trigger("click")
  1696. }
  1697. self.submitOptionList = function () {
  1698. var data = {
  1699. cmanid: self.userId,
  1700. routeinfoid: self.routeinfoid,
  1701. routeid: self.routeid,
  1702. tableid: "FW_SPJ",
  1703. colid: "",
  1704. opiniontype: 99,
  1705. cresult: "",
  1706. opinion: self.nulla,
  1707. opinionimage: ""
  1708. }
  1709. $http.post(apiurljs.login + "g2app/abase/saveDataOpinion", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1710. .success(function (obj) {
  1711. var res = strToJson(s4.decryptData_CBC(obj.data));
  1712. if (res.success == true) {
  1713. self.getOpinion1(2);
  1714. self.opinion.nulla = false;
  1715. $(".toggle").trigger("click")
  1716. } else {
  1717. sp.dialog(res.message)
  1718. }
  1719. })
  1720. }
  1721. self.changeOptionList = function (item) {
  1722. self.showBottom = "opinion";
  1723. self.opinion.nulla = true;
  1724. self.nulla = item.OPINION;
  1725. self.activeOpinion = item;
  1726. $(".toggle").trigger("click")
  1727. }
  1728. //意见附件(下表)
  1729. self.uploading1 = false;
  1730. self.upload1 = function () {
  1731. $('#fileupload1').fileupload({
  1732. url: apiurljs.login + 'g2app/abase/UploadWholeFileWithRouteAttach',
  1733. dataType: 'json',
  1734. beforeSend: function (xhr, data) {
  1735. xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
  1736. xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=SYS_ROUTE_ATTACHLIST,userid=" + self.userId + ",routeinfoid=" + self.routeinfoid
  1737. + ",routeid=" + self.routeid + ",tableid=FW_SPJ,colid="));
  1738. },
  1739. // 上传完成后的执行逻辑
  1740. done: function (e, data) {
  1741. self.uploading1 = false;
  1742. self.getOpinion1(2)
  1743. }
  1744. })
  1745. }
  1746. //意见附件(下表)
  1747. self.uploading2 = false;
  1748. self.upload2 = function (str) {
  1749. $('#fileupload-' + str).fileupload({
  1750. url: apiurljs.login + 'g2app/abase/UploadWholeFileWithRouteAttach',
  1751. dataType: 'json',
  1752. beforeSend: function (xhr, data) {
  1753. xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
  1754. xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=SYS_ROUTE_ATTACHLIST,userid=" + self.userId + ",routeinfoid=" + self.routeinfoid
  1755. + ",routeid=" + self.routeid + ",tableid=FW_SPJ,colid=" + str));
  1756. },
  1757. // 上传完成后的执行逻辑
  1758. done: function (e, data) {
  1759. self.uploading1 = false;
  1760. self.getOpinion1(2)
  1761. }
  1762. })
  1763. }
  1764. //下载意见表附件
  1765. self.downLoadOption = function (item) {
  1766. window.open(apiurljs.login + "g2work/files/" + item.FILEPATH.slice(7))
  1767. }
  1768. //删除意见表附件
  1769. self.deleteOptionFile = function (file) {
  1770. var data = {
  1771. routeid: file.ROUTEID,
  1772. tableid: "FW_SPJ",
  1773. colid: file.COLID,
  1774. fileid: file.FILEID
  1775. };
  1776. $http.post(apiurljs.login + "g2app/abase/deleteDataOpinionWithRouteAttach", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1777. .success(function (obj) {
  1778. var res = strToJson(s4.decryptData_CBC(obj.data));
  1779. sp.dialoghide();
  1780. if (res.success) {
  1781. self.getOpinion1(2);
  1782. } else {
  1783. sp.dialog("删除失败,请联系管理员!");
  1784. }
  1785. });
  1786. }
  1787. //签写意见
  1788. self.openOpinion = function (str) {
  1789. if (self.routeinfoid == 0 && self.routeid == 0) {
  1790. sp.dialog("请先保存!")
  1791. return;
  1792. }
  1793. self.opinion[str] = true;
  1794. }
  1795. //修改意见
  1796. self.changeOpinion = function (str) {
  1797. self.data[str] = self.YJ[str][0].OPINION;
  1798. self.opinion[str] = true;
  1799. }
  1800. self.changeOpinionItem = function (str, item) {
  1801. if (item.OPINIONIMAGE != "") {
  1802. self.QianZi(str);
  1803. self.opinion[str + "Img"] = true;
  1804. }
  1805. self.data[str] = item.OPINION;
  1806. self.opinion[str] = true;
  1807. }
  1808. //提交意见
  1809. self.Sopinion = function (str) {
  1810. if (self.opinion[str + "Img"] == true) {
  1811. self.data[str] = $("#" + str + "QZ").find("canvas")[0].toDataURL();
  1812. } else {
  1813. self.data[str] = $("#" + str).val();
  1814. }
  1815. var data = {
  1816. cmanid: self.userId,
  1817. routeinfoid: self.routeinfoid,
  1818. routeid: self.routeid,
  1819. tableid: "FW_SPJ",
  1820. colid: str,
  1821. opiniontype: 0,
  1822. cresult: "",
  1823. opinion: self.opinion[str + "Img"] == false ? self.data[str] : "",
  1824. opinionimage: self.opinion[str + "Img"] == true ? self.data[str] : ""
  1825. }
  1826. $http.post(apiurljs.login + "g2app/abase/saveDataOpinion", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1827. .success(function (obj) {
  1828. var res = strToJson(s4.decryptData_CBC(obj.data));
  1829. if (res.success == true) {
  1830. self.getOpinion1(1);
  1831. self.opinion[str] = false;
  1832. self.opinion[str + "Img"] = false;
  1833. self.data[str] = "";
  1834. self.changeFiled(str)
  1835. } else {
  1836. sp.dialog(res.message)
  1837. }
  1838. })
  1839. }
  1840. //删除意见
  1841. self.Dopinion = function (str) {
  1842. var data = {
  1843. cmanid: self.userId,
  1844. routeid: self.routeid,
  1845. tableid: "FW_SPJ",
  1846. colid: str,
  1847. }
  1848. $http.post(apiurljs.login + "g2app/abase/deleteDataOpinion", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1849. .success(function (obj) {
  1850. var res = strToJson(s4.decryptData_CBC(obj.data));
  1851. if (res.success == true) {
  1852. self.getOpinion1(1);
  1853. self.nulla = "";
  1854. self.activeOpinion = null;
  1855. self.changeFiled(str)
  1856. } else {
  1857. sp.dialog(res.message)
  1858. }
  1859. })
  1860. }
  1861. self.phraseText = "";//添加常用语
  1862. self.phraseList = []//常用语列表
  1863. //获取常用语库
  1864. self.phrase = function (colid) {
  1865. sp.layer("#phrase");
  1866. self.colid = colid;
  1867. self.getPhrase();
  1868. }
  1869. //添加常用语到常用语库
  1870. self.Aphrase = function () {
  1871. if (self.phraseText == "") {
  1872. return;
  1873. }
  1874. var data = {
  1875. cmanid: self.userId,
  1876. tableid: "FW_SPJ",
  1877. colid: self.colid,
  1878. contents: self.phraseText
  1879. }
  1880. $http.post(apiurljs.login + "g2app/abase/insertDataPatterns", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1881. .success(function (obj) {
  1882. var res = strToJson(s4.decryptData_CBC(obj.data));
  1883. if (res.success == true) {
  1884. self.phraseText = "";
  1885. self.getPhrase();
  1886. } else {
  1887. sp.dialog(res.message)
  1888. }
  1889. })
  1890. }
  1891. //获取常用语库
  1892. self.getPhrase = function () {
  1893. var data = {
  1894. cmanid: self.userId,
  1895. tableid: "FW_SPJ",
  1896. colid: self.colid
  1897. }
  1898. $http.post(apiurljs.login + "g2app/abase/queryDataPatterns", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1899. .success(function (obj) {
  1900. var res = strToJson(s4.decryptData_CBC(obj.data));
  1901. self.phraseList = res.data;
  1902. self.phraseSelect = self.phraseList[0].CONTENTS;
  1903. })
  1904. }
  1905. //从常用语库删除
  1906. self.Dphrase = function () {
  1907. var id = null;
  1908. $.each(self.phraseList, function (index, item) {
  1909. if (item.CONTENTS == self.phraseSelect) {
  1910. id = item.ID;
  1911. }
  1912. })
  1913. var data = {
  1914. id: id
  1915. }
  1916. $http.post(apiurljs.login + "g2app/abase/deleteDataPatterns", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1917. .success(function (obj) {
  1918. var res = strToJson(s4.decryptData_CBC(obj.data));
  1919. self.getPhrase();
  1920. })
  1921. }
  1922. //常用语确认为意见
  1923. self.btnPhrase = function () {
  1924. if (!self.colid) {
  1925. self.nulla = self.phraseSelect;
  1926. } else {
  1927. self.data[self.colid] = self.phraseSelect;
  1928. }
  1929. sp.layerhide();
  1930. }
  1931. //签字—手写
  1932. self.QianZi = function (str) {
  1933. if (self.opinion[str + "Img"] == true) { return; }
  1934. self.opinion[str + "Img"] = true;
  1935. $timeout(function () {
  1936. new lineCanvas(str + "QZ")
  1937. }, 1)
  1938. }
  1939. //清除手写
  1940. self.canvasClear = function (str) {
  1941. var cxt = $("#" + str + "QZ").find("canvas")[0].getContext("2d");
  1942. cxt.clearRect(0, 0, $("#" + str + "QZ").find("canvas")[0].width, $("#" + str + "QZ").find("canvas")[0].height)
  1943. }
  1944. self.selectUSAGE = function (item) {
  1945. item.checked = !item.checked;
  1946. self.selectUSAGEs = [];
  1947. $.each(self.USAGE, function (index, item) {
  1948. if (item.checked == true) {
  1949. self.selectUSAGEs.push(item.CODE)
  1950. }
  1951. })
  1952. self.changeFiled('USAGE')
  1953. }
  1954. //发生修改
  1955. self.changeFiled = function (str) {
  1956. self.filedChange = true;
  1957. }
  1958. //转发
  1959. self.forward = function (obj) {
  1960. self.btnItem = obj;
  1961. if (self.filedChange == true) {
  1962. self.btnSave(1)
  1963. } else {
  1964. $("#forwardWin").attr("src", "../../forward/forward.html?routeid=" + self.routeid + "&routeinfoid=" + self.routeinfoid + "&copyrightid=" + self.copyrightid + "&directionid=" + self.directionid + "&formeditid=" + self.formeditid + "&codefuncbutton=" + obj.CODE + "&directionidtarget=" + obj.DIRECTIONIDTARGET + "&cookie=fawenbg")
  1965. sp.layer("#forward")
  1966. }
  1967. }
  1968. //查看流转记录
  1969. self.RouteList = function () {
  1970. if (self.deviceType == "pad") {
  1971. window.location.href = "../../forward/modeler_read.html?" + self.SwenList[0].TEMPFORM.split("?")[1]
  1972. } else {
  1973. sp.openNewWindow("../../forward/modeler_read.html?" + self.SwenList[0].TEMPFORM.split("?")[1], "流程图")
  1974. }
  1975. }
  1976. self.showCol = function ($event, ele) {
  1977. $('.show-col').not(ele).hide();
  1978. $(ele).toggle("fast", function () {
  1979. $(ele).css('overflow-y', 'auto')
  1980. }).autoHide();
  1981. $event.stopPropagation();
  1982. }
  1983. self.iframeList = []
  1984. self.iframeLast = self.iframeList.length - 1;
  1985. self.iframeShow = self.iframeList.length;
  1986. self.iframeHide = self.iframeList.length - self.iframeShow;
  1987. //num为1时为附件表附件,为2时为文稿表附件
  1988. self.seeFile = function (obj, num, str) {
  1989. $('.show-col').hide();
  1990. if (!obj) {
  1991. sp.dialog("文件不存在!")
  1992. return
  1993. }
  1994. if (apiurljs.zhType.indexOf(obj.FILEEXT) == -1) {
  1995. sp.dialog("文件暂不支持在线预览,请点击下载查看!")
  1996. return
  1997. }
  1998. var n = 0;
  1999. self.iframeList.forEach(function (item) {
  2000. if (item.filename == obj.FILENAMES) {
  2001. n++
  2002. }
  2003. })
  2004. if (n == 0) {
  2005. var set_convertType = 0;
  2006. if (obj.FILEEXT == "doc") {
  2007. set_convertType = 0;
  2008. } else if (obj.FILEEXT == "pdf") {
  2009. set_convertType = 20;
  2010. } else if (obj.FILEEXT == "ofd") {
  2011. set_convertType = 570;
  2012. } else if ("png,jpg,jpeg,gif,bmp,jfif,svg,tif,tiff".indexOf(obj.FILEEXT) > -1) {
  2013. set_convertType = 23;
  2014. } else {
  2015. set_convertType = 0;
  2016. }
  2017. let postData = {
  2018. convertType: set_convertType,
  2019. isSignature: 1,
  2020. isPrint: 1,
  2021. fileUrl: num == 1 ? (obj.FILEPATH ? apiurljs.yzFcscloud + "g2work" + obj.FILEPATH : apiurljs.yzFcscloud + "g2work/files2/inline/" + obj.FILEURL.slice(7)) : apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + obj.FILEURL
  2022. };
  2023. var postCfg_transfer = {
  2024. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  2025. transformRequest: function (data) {
  2026. return $.param(data);
  2027. }
  2028. };
  2029. $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
  2030. .success(function (res) {
  2031. if (res.errorcode === 0) {
  2032. if (num == 1) {
  2033. if (obj.FILEPATH) {
  2034. self.addItem(sp.ipChange(res.data.viewUrl), apiurljs.login + "g2work" + obj.FILEPATH, str, obj.FILENAMES, false)
  2035. } else {
  2036. self.addItem(sp.ipChange(res.data.viewUrl), apiurljs.login + "g2work/files2/inline/" + obj.FILEURL.slice(7), str, obj.FILENAMES, false)
  2037. }
  2038. } else {
  2039. self.addItem(sp.ipChange(res.data.viewUrl), apiurljs.login.split("glwork/")[0] + "glworkweb/" + obj.FILEURL, str, obj.FILENAMES, false)
  2040. }
  2041. } else {
  2042. sp.dialog(res.message);
  2043. }
  2044. });
  2045. }
  2046. }
  2047. self.seeZW = function () {
  2048. self.activeFormedit = 0;
  2049. if ($(".rightBox").outerWidth() == 15) {
  2050. showRightBox()
  2051. }
  2052. $("#rightList").css("margin-left", 0);
  2053. }
  2054. self.editFile = function (obj, n, str) {
  2055. if (self.newMoBanFlag == true) {
  2056. return
  2057. }
  2058. $('.show-col').hide();
  2059. if (!obj) {
  2060. sp.dialog("文件不存在!")
  2061. return
  2062. }
  2063. self.activeFormedit = n;
  2064. if ($(".rightBox").outerWidth() == 15) {
  2065. showRightBox()
  2066. }
  2067. if ($(".formedit" + n).find("iframe").attr("data-id") == obj.ID) {
  2068. if (self.iframeList.length == 0) {
  2069. if (n == 0) {
  2070. $("#rightList").css("margin-left", 0);
  2071. } else {
  2072. $("#rightList").css("margin-left", (n - 1) * $(".formedit1").width() * -1 - 10);
  2073. }
  2074. } else if (self.iframeHide == self.iframeList.length) {
  2075. if (n == 0) {
  2076. console.log(n)
  2077. $("#rightList").css("margin-left", 0);
  2078. } else {
  2079. $("#rightList").css("margin-left", (n - 1) * $(".formedit1").width() * -1 - 10);
  2080. }
  2081. } else {
  2082. $("#rightList").css("margin-left", n * $(".formedit").width() * -1);
  2083. }
  2084. } else {
  2085. if (obj.FILEURL.indexOf("files") > -1) {
  2086. var set_filepath = apiurljs.yzFcscloud + "g2work/files/" + obj.FILEURL.slice(7);
  2087. } else {
  2088. var set_filepath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + obj.FILEURL;
  2089. }
  2090. var data = {
  2091. method: 1,
  2092. params: {
  2093. userId: self.userName,
  2094. fileId: "",
  2095. fileName: "",
  2096. filePath: "",
  2097. userRight: self.dotype != 1 ? 1 : 0,
  2098. callbackUrl: ""
  2099. }
  2100. };
  2101. if (obj.FILEURL.indexOf("files") > -1) {
  2102. data.params.fileId = obj.FILEURL.split("/")[2];
  2103. data.params.fileName = obj.FILEURL.split("/")[3];
  2104. data.params.filePath = apiurljs.yzFcscloud + "g2work/files/" + obj.FILEURL.slice(7);
  2105. data.params.callbackUrl = apiurljs.login + "g2app/attachfiles/uploadFileAttach"
  2106. } else {
  2107. data.params.fileId = obj.ID;
  2108. data.params.fileName = obj.FILENAMES;
  2109. data.params.filePath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + obj.FILEURL;
  2110. data.params.callbackUrl = apiurljs.login + "g2app/fawenfiles/uploadFile"
  2111. }
  2112. $.ajax({
  2113. url: apiurljs.yzFileWo + "api.do",
  2114. data: {
  2115. jsonParams: encodeURIComponent(JSON.stringify(data))
  2116. },
  2117. type: "POST",
  2118. dataType: "json",
  2119. general: false,
  2120. async: false,
  2121. success: function (data) {
  2122. if (data) {
  2123. if (data.errorCode === "0") {
  2124. let rst = data.result;
  2125. if (rst && rst.urls) {
  2126. var get_urls = rst.urls;
  2127. if (typeof (get_urls) === "string") {
  2128. $(".formedit" + n).find("iframe").attr("src", sp.ipChange(get_urls)).attr("data-id", obj.ID)
  2129. if (self.iframeList.length == 0) {
  2130. if (n == 0) {
  2131. $("#rightList").css("margin-left", 0);
  2132. } else {
  2133. $("#rightList").css("margin-left", (n - 1) * $(".formedit1").width() * -1 - 10);
  2134. }
  2135. } else if (self.iframeHide == self.iframeList.length) {
  2136. if (n == 0) {
  2137. console.log(n)
  2138. $("#rightList").css("margin-left", 0);
  2139. } else {
  2140. $("#rightList").css("margin-left", (n - 1) * $(".formedit1").width() * -1 - 10);
  2141. }
  2142. } else {
  2143. $("#rightList").css("margin-left", n * $(".formedit").width() * -1);
  2144. }
  2145. }
  2146. }
  2147. }
  2148. }
  2149. },
  2150. })
  2151. }
  2152. }
  2153. self.btnSaveFile = function (id) {
  2154. var data = {
  2155. method: 2,
  2156. params: {
  2157. fileId: id
  2158. }
  2159. };
  2160. $.ajax({
  2161. url: apiurljs.yzFileWo + "api.do",
  2162. data: {
  2163. jsonParams: encodeURIComponent(JSON.stringify(data))
  2164. },
  2165. type: "POST",
  2166. dataType: "json",
  2167. general: false,
  2168. async: false,
  2169. success: function (data) {
  2170. if (data && data.errorCode === "0") {
  2171. sp.dialog("保存成功");
  2172. }
  2173. }
  2174. });
  2175. }
  2176. self.addItem = function (url, source, name, filename, edit, fileid) {
  2177. var n = 0;
  2178. self.iframeList.forEach(function (item) {
  2179. if (item.filename == filename && item.source == source) {
  2180. n++
  2181. }
  2182. })
  2183. if (n == 0) {
  2184. if (edit == false) {
  2185. self.iframeList.push({ id: self.iframeList.length + 1, title: name, filename: filename, url: $sce.trustAsResourceUrl(url), source: source, edit: edit, show: 1 })
  2186. } else {
  2187. self.iframeList.push({ id: self.iframeList.length + 1, title: name, filename: filename, url: $sce.trustAsResourceUrl(url), source: source, edit: edit, show: 1, fileid: fileid })
  2188. }
  2189. self.changeSize(1)
  2190. }
  2191. }
  2192. self.hideItem = function (n) {
  2193. self.iframeList[n].show = 2;
  2194. self.iframeList[n].boxStyle = { width: 0, float: "left" };
  2195. self.changeIframeSize()
  2196. }
  2197. self.showItem = function (n) {
  2198. self.iframeList[n].show = 1;
  2199. self.changeIframeSize()
  2200. }
  2201. self.changeIframeSize = function () {
  2202. if (self.iframeList.length == 0) {
  2203. } else {
  2204. var n = 0;
  2205. self.iframeList.forEach(function (item, index) {
  2206. if (item.show == 1) {
  2207. self.iframeLast = index;
  2208. }
  2209. if (item.show == 2) {
  2210. n = n + 1;
  2211. }
  2212. })
  2213. self.iframeHide = n;
  2214. self.iframeShow = self.iframeList.length - self.iframeHide;
  2215. for (var i = 0; i < self.iframeList.length; i++) {
  2216. if (self.iframeHide != self.iframeList.length) {
  2217. if (self.iframeList[i].show == 1) {
  2218. self.iframeList[i].boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2 / (self.iframeList.length - 1 - self.iframeHide)) }
  2219. self.iframeList[i].iframeStyle = { width: self.iframeList[i].boxStyle.width - 10 }
  2220. }
  2221. if ($(".rightBox").outerWidth() == 15) {
  2222. $(".leftBox").css("width", "calc(100% - 15px)");
  2223. $(".border-left-right").show()
  2224. $(".border-left-right").prev().show()
  2225. } else {
  2226. showRightBox()
  2227. }
  2228. } else {
  2229. self.iframeList[i].show = 2
  2230. self.iframeList[i].boxStyle = { width: 0, float: "left" };
  2231. self.seeGCG()
  2232. $(".leftBox").css("width", 36)
  2233. $(".border-left-right").hide()
  2234. $(".border-left-right").prev().hide()
  2235. $(".rightBox").css("width", "calc(100% - 36px)")
  2236. $("#rightList").show();
  2237. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2238. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2239. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2240. self.formeditSize()
  2241. var marginLeft = $("#rightList").css("margin-left")
  2242. if (marginLeft.slice(0, marginLeft.length - 2) == $(".formedit1").width() * -1 || marginLeft.slice(0, marginLeft.length - 2) == 0) {
  2243. } else {
  2244. $("#rightList").css("margin-left", $(".formedit1").width() * (self.activeFormedit - 1) * -1)
  2245. }
  2246. }
  2247. }
  2248. if (self.iframeShow == 1) {
  2249. self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) - 1 }
  2250. self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeLast].boxStyle.width - 10 }
  2251. } else {
  2252. self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2) - 1 }
  2253. self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeLast].boxStyle.width - 10 }
  2254. }
  2255. }
  2256. }
  2257. self.changeSize = function (n) {
  2258. if (self.iframeList.length == 0) {
  2259. $(".rightBox").show();
  2260. $("#rightList").show();
  2261. $(".rightBox").css("width", $(window).width())
  2262. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2263. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2264. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2265. self.formeditSize()
  2266. var marginLeft = $("#rightList").css("margin-left")
  2267. if (marginLeft.slice(0, marginLeft.length - 2) == $(".formedit1").width() * -1 || marginLeft.slice(0, marginLeft.length - 2) == 0) {
  2268. } else {
  2269. $("#rightList").css("margin-left", $(".formedit1").width() * (self.activeFormedit - 1) * -1)
  2270. }
  2271. } else {
  2272. if (n == 1 && $(".fa-angle-left").is(":hidden") == false) {
  2273. showRightBox()
  2274. }
  2275. $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2276. $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2277. $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2278. self.formeditSize()
  2279. var marginLeft = $("#rightList").css("margin-left")
  2280. if (marginLeft.slice(0, marginLeft.length - 2) == $(".formedit1").width() * -1 || marginLeft.slice(0, marginLeft.length - 2) == 0) {
  2281. } else {
  2282. $("#rightList").css("margin-left", $(".formedit1").width() * (self.activeFormedit - 1) * -1)
  2283. }
  2284. }
  2285. var num = 0;
  2286. self.iframeList.forEach(function (item, index) {
  2287. self.reSize(index)
  2288. if (item.show == 1) {
  2289. num = num + 1;
  2290. self.iframeLast = index;
  2291. }
  2292. })
  2293. self.iframeShow = num;
  2294. self.iframeHide = self.iframeList.length - self.iframeShow;
  2295. if (self.iframeList.length == 0) {
  2296. } else {
  2297. if (self.iframeShow == self.iframeList.length) {
  2298. self.iframeList.forEach(function (item) {
  2299. item.boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2 / (self.iframeList.length - 1 - self.iframeHide)) }
  2300. item.iframeStyle = { width: item.boxStyle.width - 10 }
  2301. })
  2302. self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc($(".leftBox").width() / (self.iframeShow == 1 ? 1 : 2)) - 1 }
  2303. self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeList.length - 1].boxStyle.width - 10 }
  2304. } else {
  2305. for (var i = 0; i < self.iframeList.length; i++) {
  2306. if (self.iframeHide != self.iframeList.length) {
  2307. if (self.iframeList[i].show == 1) {
  2308. self.iframeList[i].boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2 / (self.iframeList.length - 1 - self.iframeHide)) }
  2309. self.iframeList[i].iframeStyle = { width: self.iframeList[i].boxStyle.width - 10 }
  2310. }
  2311. if (n == 1) {
  2312. if ($(".rightBox").outerWidth() == 15) {
  2313. $(".leftBox").css("width", "calc(100% - 15px)");
  2314. $(".border-left-right").show()
  2315. $(".border-left-right").prev().show()
  2316. } else {
  2317. showRightBox()
  2318. }
  2319. }
  2320. } else {
  2321. self.iframeList[i].show = 2
  2322. self.iframeList[i].boxStyle = { width: 0, float: "left" };
  2323. self.seeGCG()
  2324. $(".leftBox").css("width", 36)
  2325. $(".border-left-right").hide()
  2326. $(".border-left-right").prev().hide()
  2327. $(".rightBox").css("width", "calc(100% - 36px)")
  2328. $("#rightList").show();
  2329. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2330. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2331. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2332. var marginLeft = $("#rightList").css("margin-left")
  2333. if (marginLeft.slice(0, marginLeft.length - 2) == $(".formedit1").width() * -1 || marginLeft.slice(0, marginLeft.length - 2) == 0) {
  2334. } else {
  2335. $("#rightList").css("margin-left", $(".formedit1").width() * (self.activeFormedit - 1) * -1)
  2336. }
  2337. }
  2338. }
  2339. if (self.iframeShow == 1) {
  2340. self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) - 1 }
  2341. self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeLast].boxStyle.width - 10 }
  2342. } else {
  2343. self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2) - 1 }
  2344. self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeLast].boxStyle.width - 10 }
  2345. }
  2346. }
  2347. }
  2348. }
  2349. self.openItem = function (obj) {
  2350. window.open(obj.url)
  2351. }
  2352. self.closeItem = function (n) {
  2353. self.iframeList.splice(n, 1)
  2354. self.changeSize(1)
  2355. }
  2356. self.reSize = function (n) {
  2357. $timeout(function () {
  2358. var leftbox = document.getElementsByClassName("iframe-item")[n];
  2359. var rightbox;
  2360. var line = document.getElementsByClassName("iframe-border-right")[n];
  2361. document.getElementsByClassName("iframe-border-right")[n].addEventListener("mousedown", function (event) {
  2362. for (var i = n + 1; i < self.iframeList.length; i++) {
  2363. if (self.iframeList[i].show == 1) {
  2364. rightbox = document.getElementsByClassName("iframe-item")[i];
  2365. break
  2366. }
  2367. }
  2368. $(".mousemove").show()
  2369. var leftboxW = leftbox.style.width.slice(0, leftbox.style.width.length - 2);
  2370. var rightboxW = rightbox.style.width.slice(0, rightbox.style.width.length - 2);
  2371. var x = event.pageX - (line.offsetLeft - leftboxW) - 10;
  2372. document.addEventListener("mousemove", boxMove)
  2373. function boxMove(event) {
  2374. if (leftboxW * 1 + (event.pageX - x) * 1 <= 36) {
  2375. //leftbox.children[0].style.display = "none"
  2376. self.hideItem(n)
  2377. } else if (rightboxW * 1 - (event.pageX - x) * 1 <= 5) {
  2378. //rightbox.children[0].style.display = "none"
  2379. self.hideItem(i)
  2380. } else {
  2381. leftbox.children[0].style.display = "block"
  2382. leftbox.style.width = leftboxW * 1 + (event.pageX - x) * 1 + "px";
  2383. leftbox.getElementsByTagName("iframe")[0].style.width = leftboxW * 1 + (event.pageX - x) * 1 + "px";
  2384. self.iframeList[n].boxStyle.width = leftboxW * 1 + (event.pageX - x) * 1;
  2385. self.iframeList[n].iframeStyle.width = leftboxW * 1 + (event.pageX - x) * 1 - 10;
  2386. rightbox.children[0].style.display = "block"
  2387. rightbox.style.width = rightboxW * 1 - (event.pageX - x) * 1 + "px";
  2388. rightbox.getElementsByTagName("iframe")[0].style.width = rightboxW * 1 - (event.pageX - x) * 1 - 10 + "px";
  2389. self.iframeList[i].boxStyle.width = rightboxW * 1 - (event.pageX - x) * 1;
  2390. self.iframeList[i].iframeStyle.width = rightboxW * 1 - (event.pageX - x) * 1 - 10;
  2391. }
  2392. }
  2393. document.addEventListener("mouseup", function () {
  2394. $(".mousemove").hide()
  2395. $scope.$apply();
  2396. document.removeEventListener("mousemove", boxMove)
  2397. })
  2398. })
  2399. }, 1)
  2400. }
  2401. self.reSizeLR = function (n) {
  2402. var leftbox = document.getElementsByClassName("page-item")[n - 1];
  2403. var rightbox = document.getElementsByClassName("page-item")[n];
  2404. var line = document.getElementsByClassName("left-right")[n - 1];
  2405. document.getElementsByClassName("left-right")[n - 1].addEventListener("mousedown", function (event) {
  2406. $(".mousemove").show()
  2407. var leftboxW = leftbox.clientWidth;
  2408. var rightboxW = rightbox.clientWidth;
  2409. var x = event.pageX - line.offsetLeft;
  2410. document.addEventListener("mousemove", boxMove)
  2411. function boxMove(event) {
  2412. if (leftboxW * 1 + (event.pageX - x) * 1 <= 200) {
  2413. } else if (rightboxW * 1 - (event.pageX - x) * 1 <= 200) {
  2414. } else {
  2415. leftbox.style.width = leftboxW * 1 + (event.pageX - x) * 1 + "px";
  2416. rightbox.style.width = rightboxW * 1 - (event.pageX - x) * 1 + "px";
  2417. $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2418. $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2419. $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2420. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2421. $scope.changeSize()
  2422. }
  2423. }
  2424. document.addEventListener("mouseup", function () {
  2425. $(".mousemove").hide()
  2426. document.removeEventListener("mousemove", boxMove)
  2427. })
  2428. })
  2429. }
  2430. /*右侧formedit折叠*/self.formeditList = [];
  2431. self.hideFormedit = function (num, title) {
  2432. $(".formedit" + num).hide();
  2433. $(".formedit" + num).siblings().css("width", $(".formedit" + num).width() - (self.iframeHide == self.iframeList.length ? 18 : 36));
  2434. self.formeditList.push({ index: num, title: title });
  2435. if (self.iframeHide == self.iframeList.length) {
  2436. if (self.formeditList.length == 2) {
  2437. $(".formedit" + num).siblings().each(function () {
  2438. if ($(this).is(":hidden") == false) {
  2439. if ($(this).is(":hidden") == false) {
  2440. $(this).width("calc(100% - 46px)")
  2441. }
  2442. }
  2443. })
  2444. }
  2445. self.seeGLJ()
  2446. } else {
  2447. if (self.formeditList.length == 2) {
  2448. $(".formedit" + num).siblings().each(function () {
  2449. if ($(this).is(":hidden") == false) {
  2450. if ($(this).is(":hidden") == false) {
  2451. $(this).width("calc(100% - 36px)")
  2452. }
  2453. }
  2454. })
  2455. }
  2456. if ($(".formedit1").find("iframe").attr("src") == "") {
  2457. self.seeGCG()
  2458. } else {
  2459. self.seeGLJ()
  2460. }
  2461. }
  2462. $("#rightList").css("margin-left", 0)
  2463. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2464. }
  2465. self.showFormedit = function (num, obj) {
  2466. $(".formedit" + obj.index).show();
  2467. self.formeditList.splice(num, 1);
  2468. if (self.iframeHide == self.iframeList.length) {
  2469. if (self.formeditList.length == 2) {
  2470. $(".formedit" + obj.index).width("calc(100% - 46px)")
  2471. $("#rightList").css("margin-left", 0)
  2472. } else if (self.formeditList.length == 1) {
  2473. $(".formedit" + obj.index).width(($(".rightBox").width() - 36) / 2)
  2474. $(".formedit" + obj.index).siblings().width(($(".rightBox").width() - 36) / 2)
  2475. $("#rightList").css("margin-left", 0)
  2476. } else {
  2477. $(".formedit" + obj.index).width($(".rightBox").width() / 2)
  2478. $(".formedit" + obj.index).siblings().width($(".rightBox").width() / 2)
  2479. $("#rightList").css("margin-left", obj.index == "" ? 0 : (obj.index - 1) * $(".formedit" + obj.index).width() * -1)
  2480. }
  2481. } else {
  2482. if (self.formeditList.length > 0) {
  2483. $(".formedit" + obj.index).width($(".rightBox").width() - 36)
  2484. $(".formedit" + obj.index).siblings().width($(".rightBox").width() - 36)
  2485. } else {
  2486. $(".formedit" + obj.index).width($(".rightBox").width())
  2487. $(".formedit" + obj.index).siblings().width($(".rightBox").width())
  2488. }
  2489. $("#rightList").css("margin-left", obj.index == "" ? 0 : obj.index * $(".formedit" + obj.index).width() * -1)
  2490. }
  2491. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2492. }
  2493. self.formeditSize = function () {
  2494. if (self.iframeHide == self.iframeList.length) {
  2495. if (self.formeditList.length == 2) {
  2496. $("#rightList").children().each(function () {
  2497. if ($(this).is(":hidden") == false) {
  2498. $(this).css("width", "calc(100% - 36px)")
  2499. }
  2500. })
  2501. } else if (self.formeditList.length == 1) {
  2502. $("#rightList").children().each(function () {
  2503. $(this).width(($(".rightBox").width() - 36) / 2)
  2504. })
  2505. }
  2506. } else {
  2507. if (self.formeditList.length > 0) {
  2508. $("#rightList").children().each(function () {
  2509. $(this).width($(".rightBox").width() - 36)
  2510. })
  2511. }
  2512. }
  2513. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2514. }
  2515. self.getMeetMsg = function () {
  2516. var data = {
  2517. routeid: self.routeid,
  2518. routeinfoid: self.routeinfoid
  2519. }
  2520. $http.post(apiurljs.login + "g2work/meetcoop/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  2521. .success(function (obj) {
  2522. var res = strToJson(s4.decryptData_CBC(obj.data));
  2523. self.meetList = res.data;
  2524. self.meetNum = 0;
  2525. self.meetList.forEach(function (item) {
  2526. self.meetNum++
  2527. item.FILES.forEach(function (item1) {
  2528. self.meetNum++
  2529. item1.WATCHLIMIT = sp.format(item1.WATCHLIMIT);
  2530. })
  2531. })
  2532. //self.getNumMeet()
  2533. })
  2534. }
  2535. self.getNumMeet = function () {
  2536. var data = {
  2537. routeinfoid: self.routeinfoid
  2538. }
  2539. $http.post(apiurljs.login + "g2work/meetcoop/queryDataListCount", data, postCfg)
  2540. .success(function (obj) {
  2541. var res = strToJson(s4.decryptData_CBC(obj.data));
  2542. if (res.data != self.meetNum) {
  2543. self.getMeetMsg()
  2544. }
  2545. })
  2546. }
  2547. self.Meeting = function () {
  2548. $http.post(apiurljs.login + "g2app/dataabase/getDpList", { data: s4.encryptData_CBC("") }, postCfg)
  2549. .success(function (obj) {
  2550. var res = strToJson(s4.decryptData_CBC(obj.data));
  2551. self.dpList = res.data;
  2552. self.dpList1 = [];
  2553. self.dpList.forEach(function (item) {
  2554. self.dpList1.push(item)
  2555. item.USER.forEach(function (item1) {
  2556. item1.show = true;
  2557. })
  2558. })
  2559. self.activeDep = 0;
  2560. self.userList = self.dpList1[0].USER;
  2561. self.meetUser = [];
  2562. sp.layer("#meet")
  2563. })
  2564. }
  2565. self.searchName = "";
  2566. self.searchPerson = function () {
  2567. self.dpList1 = [];
  2568. self.dpList.forEach(function (item) {
  2569. if (item.DEP.indexOf(self.searchName) > -1) {
  2570. self.dpList1.push(item)
  2571. }
  2572. })
  2573. self.activeDep = 0;
  2574. self.userList = self.dpList1[0].USER;
  2575. }
  2576. self.addmeet = function () {
  2577. self.dpList.forEach(function (item) {
  2578. item.USER.forEach(function (item1) {
  2579. if (item1.checked == true && item1.show == true) {
  2580. self.meetUser.push(item1);
  2581. item1.checked = false;
  2582. item1.show = false;
  2583. }
  2584. })
  2585. })
  2586. }
  2587. self.delmeet = function () {
  2588. self.meetUser.forEach(function (item) {
  2589. if (item.checked == true) {
  2590. item.checked = false;
  2591. item.show = true;
  2592. }
  2593. })
  2594. self.meetUser = self.meetUser.filter(function (item) {
  2595. return item.show == false;
  2596. })
  2597. }
  2598. self.joinMeet = function () {
  2599. var data = {
  2600. tablename: "FW_SPJ",
  2601. colums: "*",
  2602. order: "ID desc",
  2603. sqlwhere: { ROUTEINFOID: self.routeinfoid },
  2604. sqlinwhere: "",
  2605. sqllikewhere: ""
  2606. }
  2607. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  2608. .success(function (obj) {
  2609. var res = strToJson(s4.decryptData_CBC(obj.data));
  2610. var data1 = {
  2611. routeid: self.routeid,
  2612. routeinfoid: self.routeinfoid,
  2613. cman: self.userId,
  2614. cname: res.data[0].BT + "—共享沟通",
  2615. userids: self.meetUser.map(function (item) {
  2616. return item.USERID
  2617. }).join(",")
  2618. }
  2619. $http.post(apiurljs.login + "g2work/meetcoop/createMeetcoop", data1, postCfg)
  2620. .success(function (res1) {
  2621. sp.layerhide()
  2622. if (res1.success == true) {
  2623. self.getMeetMsg()
  2624. } else {
  2625. sp.dialog(res1.message)
  2626. }
  2627. })
  2628. })
  2629. }
  2630. self.updateCname = function (item) {
  2631. self.meeting = {
  2632. type: 1,
  2633. updateTitle: "修改会议标题",
  2634. meetid: item.MEETID,
  2635. cname: item.CNAME
  2636. }
  2637. sp.layer("#meetUpdate")
  2638. }
  2639. self.deleteMeet = function (meet) {
  2640. var data = {
  2641. meetid: meet.MEETID
  2642. }
  2643. $http.post(apiurljs.login + "g2work/meetcoop/deleteDataByID", data, postCfg)
  2644. .success(function (res) {
  2645. if (res.success == true) {
  2646. $.each(self.iframeList, function (index, item) {
  2647. $.each(meet.FILES, function (index1, item1) {
  2648. if (item.title == item1.WATCHLIMIT && item.source == item1.FILEURL) {
  2649. self.closeItem(index1)
  2650. }
  2651. })
  2652. })
  2653. self.getMeetMsg()
  2654. } else {
  2655. sp.dialog(res.message)
  2656. }
  2657. })
  2658. }
  2659. self.updateWatchlimit = function (item) {
  2660. self.meeting = {
  2661. type: 2,
  2662. updateTitle: "修改查看时限",
  2663. fileid: item.FILEID,
  2664. watchlimit: item.WATCHLIMIT
  2665. }
  2666. sp.layer("#meetUpdate")
  2667. }
  2668. self.deleteMFile = function (mfile) {
  2669. var data = {
  2670. fileid: mfile.MEETID
  2671. }
  2672. $http.post(apiurljs.login + "g2work/meetcoop/deleteDataFilesByFileID", data, postCfg)
  2673. .success(function (res) {
  2674. if (res.success == true) {
  2675. $.each(self.iframeList, function (index, item) {
  2676. if (item.title == mfile.WATCHLIMIT && item.source == mfile.FILEURL) {
  2677. self.closeItem(index)
  2678. }
  2679. })
  2680. self.getMeetMsg()
  2681. } else {
  2682. sp.dialog(res.message)
  2683. }
  2684. })
  2685. }
  2686. self.meetUpdate = function () {
  2687. if (self.meeting.type == 1) {
  2688. var data = {
  2689. meetid: self.meeting.meetid,
  2690. cname: self.meeting.cname
  2691. }
  2692. $http.post(apiurljs.login + "g2work/meetcoop/updateCnameByID", data, postCfg)
  2693. .success(function (res) {
  2694. sp.layerhide()
  2695. if (res.success == true) {
  2696. self.getMeetMsg()
  2697. } else {
  2698. sp.dialog(res.message)
  2699. }
  2700. })
  2701. } else {
  2702. var data = {
  2703. fileid: self.meeting.fileid,
  2704. watchlimit: self.meeting.watchlimit
  2705. }
  2706. $http.post(apiurljs.login + "g2work/meetcoop/updateWatchlimitByFileID", data, postCfg)
  2707. .success(function (res) {
  2708. sp.layerhide()
  2709. if (res.success == true) {
  2710. self.getMeetMsg()
  2711. } else {
  2712. sp.dialog(res.message)
  2713. }
  2714. })
  2715. }
  2716. }
  2717. ////头部关键字搜索---20230905
  2718. self.headBtnSearchKeyword = "";
  2719. self.headSearchResult = [];
  2720. self.headSearchResult_view = false;
  2721. self.headBtnSearch = function () {
  2722. if (sp.isval(self.headBtnSearchKeyword)) {
  2723. self.headSearchResult = [];
  2724. var data = {
  2725. "url": "/basic/api/StatSelect/selectCodeList",
  2726. "data": { "keyWord": self.headBtnSearchKeyword }
  2727. }
  2728. $http.post(apiurljs.login + "g2app/yizhangtu/selectCodeList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  2729. .success(function (obj) {
  2730. var res = strToJson(s4.decryptData_CBC(obj.data));
  2731. self.headSearchResult = res.data.build;
  2732. if (sp.isval(self.headSearchResult)) {
  2733. self.headSearchResult_view = true;
  2734. } else {
  2735. self.headSearchResult_view = false;
  2736. }
  2737. })
  2738. } else {
  2739. self.headSearchResult_view = false;
  2740. }
  2741. };
  2742. self.headKeywordPage = function (itemdata) {
  2743. var get_token = localStorage.getItem("main-token");
  2744. var set_url = apiurljs.onePic + "wholeProcessPage/?token=" + get_token + "&name=" + itemdata.name + "&type=" + itemdata.type + "&id=" + itemdata.id;
  2745. self.addItem(set_url, set_url, '一张图', false);
  2746. self.headSearchResult_view = false;
  2747. };
  2748. self.onePic = function () {
  2749. self.addItem(apiurljs.onePic + "wholeProcessPage/?token=" + localStorage.getItem("main-token"), apiurljs.onePic + "wholeProcessPage/?token=" + localStorage.getItem("main-token"), "地图搜索", false)
  2750. }
  2751. $scope.changeSize = function (n) {
  2752. self.changeSize(2)
  2753. if (n == 1) {
  2754. $scope.$apply();
  2755. }
  2756. }
  2757. $scope.openOptionList1 = function () {
  2758. $timeout(function () {
  2759. self.openOptionList1()
  2760. })
  2761. }
  2762. $scope.closeToggle = function () {
  2763. $timeout(function () {
  2764. self.opinion.nulla = false;
  2765. self.activeOpinion = null;
  2766. })
  2767. }
  2768. $scope.refreshGLJ = function (n) {
  2769. if (n == 1) {
  2770. self.getGLJ(2)
  2771. } else {
  2772. self.getGLFLOW()
  2773. }
  2774. }
  2775. //头部下滚冻结
  2776. $(function () {
  2777. //页面高度撑满
  2778. setTimeout(function () {
  2779. $(".rightBox").css("height", $(window).height() - 115)
  2780. $(".mousemove").css("top", 0).css("left", 0).css("width", $(window).width()).css("height", $(window).height() - 10)
  2781. if (self.lastrouteinfoid == 0) {
  2782. $(".rightBox").css("width", $(window).width())
  2783. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2784. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2785. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2786. } else {
  2787. $(".rightBox").css("width", "50%")
  2788. $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2789. $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2790. $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2791. }
  2792. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2793. }, 1)
  2794. $(window).resize(function () {
  2795. $(".rightBox").css("height", $(window).height() - 115)
  2796. $(".mousemove").css("top", 0).css("left", 0).css("width", $(window).width()).css("height", $(window).height() - 10)
  2797. if (self.iframeList.length == 0) {
  2798. $(".rightBox").css("width", $(window).width())
  2799. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2800. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2801. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2802. self.formeditSize()
  2803. } else if (self.iframeList.length > 0 && self.iframeHide == self.iframeList.length) {
  2804. $(".rightBox").css("width", "calc(100% - 36px)")
  2805. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2806. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2807. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2808. self.formeditSize()
  2809. } else {
  2810. $(".rightBox").css("width", "50%")
  2811. $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2812. $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2813. $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2814. self.formeditSize()
  2815. }
  2816. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2817. if (self.iframeList.length > 0) {
  2818. $("#iframeList").css("height", $(window).height() - 115)
  2819. if (self.iframeList.length == 1) {
  2820. self.iframeList[0].boxStyle = { width: $(".leftBox").width() }
  2821. self.iframeList[0].iframeStyle = { width: $(".leftBox").width() - 10 }
  2822. } else {
  2823. self.iframeList.forEach(function (item) {
  2824. item.boxStyle = { width: Math.trunc($(".leftBox").width() / 2 / (self.iframeList.length - 1)) }
  2825. item.iframeStyle = { width: item.boxStyle.width - 10 }
  2826. })
  2827. self.iframeList[self.iframeList.length - 1].boxStyle = { width: Math.trunc($(".leftBox").width() / 2) - 1 }
  2828. self.iframeList[self.iframeList.length - 1].iframeStyle = { width: self.iframeList[self.iframeList.length - 1].boxStyle.width - 10 }
  2829. }
  2830. $scope.$apply();
  2831. }
  2832. })
  2833. })
  2834. }])
  2835. app.directive("repeatFinish", function () {
  2836. return {
  2837. link: function (scope) {
  2838. if (scope.$last == true) {
  2839. $("#iframeList").css("height", $(window).height() - 115)
  2840. }
  2841. }
  2842. };
  2843. });
  2844. app.directive("spCheckboxBlueItem", function () {
  2845. return {
  2846. restrict: "A",
  2847. link: function (scope, elem, attrs) {
  2848. if (!scope == false) {
  2849. spng.funcheckbox(elem, "chb-blue", "chb-blue-checked"); //蓝色checkbox
  2850. }
  2851. }
  2852. }
  2853. });
  2854. app.filter('trustHtml', function ($sce) {
  2855. return function (input) {
  2856. return $sce.trustAsHtml(input.replace(/\n/g, '<br/>').replace(/\s/g, '&nbsp;'));
  2857. };
  2858. });
  2859. //canvas画布签字
  2860. function lineCanvas(obj) {
  2861. var self = this;
  2862. self.linewidth = 1;
  2863. self.color = "#000000";
  2864. self.background = "#ffffff";
  2865. self.canvas = document.createElement("canvas");
  2866. document.getElementById(obj).appendChild(self.canvas);
  2867. self.cxt = self.canvas.getContext("2d");
  2868. self.canvas.width = document.getElementById(obj).clientWidth;
  2869. self.canvas.height = document.getElementById(obj).scrollHeight;
  2870. self.cxt.fillStyle = self.background;
  2871. self.cxt.fillRect(0, 0, self.canvas.width, self.canvas.width);
  2872. self.cxt.strokeStyle = self.color;
  2873. self.cxt.lineWidth = self.linewidth;
  2874. self.cxt.lineCap = "round";
  2875. //开始绘制
  2876. self.canvas.addEventListener("mousedown", function (e) {
  2877. self.cxt.beginPath();
  2878. self.cxt.lineTo(e.pageX - $(".formedit .sp-page-center").offset().left - 52, e.pageY - document.getElementById(obj).offsetTop + $(".formedit").scrollTop() - 95);
  2879. self.canvas.addEventListener("mousemove", move)
  2880. }.bind(self), false);
  2881. //绘制中
  2882. function move() {
  2883. var e = window.event;
  2884. self.cxt.lineTo(e.pageX - $(".formedit .sp-page-center").offset().left - 52, e.pageY - document.getElementById(obj).offsetTop + $(".formedit").scrollTop() - 95);
  2885. self.cxt.stroke();
  2886. }
  2887. //结束绘制
  2888. self.canvas.addEventListener("mouseup", up)
  2889. function up() {
  2890. self.cxt.closePath();
  2891. self.canvas.removeEventListener("mousemove", move)
  2892. }
  2893. };
  2894. function showRightBox() {
  2895. $(".leftBox").css("width", "50%");
  2896. $(".rightBox").css("width", "50%")
  2897. $(".rightBox").show();
  2898. $("#rightList").show();
  2899. $(".border-left-right").show()
  2900. $(".border-left-right").prev().show()
  2901. $(".border-left-right").prev().find(".fa-angle-right").show()
  2902. $(".border-left-right").prev().find(".fa-angle-left").hide()
  2903. if ($("#rightList").prev().is(":hidden") == true) {
  2904. $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2905. $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2906. $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2907. } else {
  2908. $(".formedit").css("width", $(".rightBox").width() - 36).css("height", $(".rightBox").height())
  2909. $(".formedit1").css("width", $(".rightBox").width() - 36).css("height", $(".rightBox").height())
  2910. $(".formedit2").css("width", $(".rightBox").width() - 36).css("height", $(".rightBox").height())
  2911. }
  2912. angular.element(document.getElementById("app")).scope().changeSize(2)
  2913. }
  2914. function showRight(e) {
  2915. if ($(e).children(".fa-angle-left").is(":hidden")) {
  2916. $(".leftBox").css("width", "calc(100% - 15px)");
  2917. $(".rightBox").css("width", "15px");
  2918. $(e).siblings().hide()
  2919. $(e).children(".fa-angle-left").show()
  2920. $(e).children(".fa-angle-right").hide()
  2921. } else {
  2922. $(".leftBox").css("width", "50%");
  2923. $(".rightBox").css("width", "50%");
  2924. $(e).siblings().show()
  2925. $(e).children(".fa-angle-left").hide()
  2926. $(e).children(".fa-angle-right").show()
  2927. }
  2928. angular.element(document.getElementById("app")).scope().changeSize(1)
  2929. }
  2930. function showToggle(e) {
  2931. document.getElementById("selectDiv").style.top = e.style.top;
  2932. //document.getElementById("selectDiv").toggle();
  2933. $(e).children().toggle()
  2934. $(e).next().toggle()
  2935. }
  2936. function toggleYJL(e) {
  2937. if ($(e).children(".fa-angle-double-down").is(":hidden") == true) {
  2938. $(e).parent().css("height", 420)
  2939. angular.element(document.getElementById("app")).scope().openOptionList1()
  2940. } else {
  2941. $(e).parent().css("height", 10)
  2942. angular.element(document.getElementById("app")).scope().closeToggle()
  2943. }
  2944. $(e).children().toggle()
  2945. }
  2946. function toggleForm(e) {
  2947. $(e).children().toggle()
  2948. $(".toggleForm").toggle()
  2949. }
  2950. function refreshGLJ(n) {
  2951. angular.element(document.getElementById("app")).scope().refreshGLJ(n)
  2952. }
  2953. //文字不可被选中
  2954. document.body.onselectstart = function () {
  2955. return false;
  2956. }