formeditFL.js 130 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005
  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. NGR: false,
  296. NGRQ: false,
  297. HBCSYJ: 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. NGR: false,
  318. NGRQ: false,
  319. HBCSYJ: 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_HYJY",
  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_HYJY.ID,
  515. APPCODE: res.data.FW_HYJY.APPCODE,
  516. JJCD: res.data.FW_HYJY.JJCD == "" ? self.JJCD[0].CODE : res.data.FW_HYJY.JJCD,
  517. FWZH: res.data.FW_HYJY.FWZH,
  518. FWZH1: res.data.FW_HYJY.FWZH,
  519. XXGKSH: res.data.FW_HYJY.XXGKSH == "" ? self.XXGKSH[0].CODE : res.data.FW_HYJY.XXGKSH,
  520. SFXYJD: res.data.FW_HYJY.SFXYJD == "" ? self.SFXYJD[0].CODE : res.data.FW_HYJY.SFXYJD,
  521. BGSFHYJ: res.data.FW_HYJY.BGSFHYJ == "" ? self.BGSFHYJ[0].CODE : res.data.FW_HYJY.BGSFHYJ,
  522. NGR: res.data.FW_HYJY.NGR == "" ? self.userName : res.data.FW_HYJY.NGR,
  523. NGRQ: res.data.FW_HYJY.NGRQ == "" || res.data.FW_HYJY.NGRQ ? sp.format(sp.getLocalDate()) : sp.format(res.data.FW_HYJY.NGRQ),
  524. GWZL: res.data.FW_HYJY.GWZL == "" ? self.GWZL[0].CODE : res.data.FW_HYJY.GWZL,
  525. YF: res.data.FW_HYJY.YF,
  526. BT: res.data.FW_HYJY.BT,
  527. ZS: res.data.FW_HYJY.ZS,
  528. CS: res.data.FW_HYJY.CS,
  529. NGRUSERID: res.data.FW_HYJY.NGRUSERID == "" ? self.userId : res.data.FW_HYJY.NGRUSERID,
  530. NGRBM: res.data.FW_HYJY.NGRBM == "" ? self.userDpName : res.data.FW_HYJY.NGRBM,
  531. NGRBMID: res.data.FW_HYJY.NGRBMID == "" ? self.userDpCode : res.data.FW_HYJY.NGRBMID,
  532. USAGE: res.data.FW_HYJY.USAGE,
  533. MQFMARK: res.data.FW_HYJY.MQFMARK
  534. }
  535. self.readonly = {
  536. JJCD: res.data.FW_HYJY["JJCD.EREADONLY"] == "true",
  537. WLDQFL: res.data.FW_HYJY["WLDQFL.EREADONLY"] == "true",
  538. WLDSSL: res.data.FW_HYJY["WLDSSL.EREADONLY"] == "true",
  539. XXGKSH: res.data.FW_HYJY["XXGKSH.EREADONLY"] == "true",
  540. SFXYJD: res.data.FW_HYJY["SFXYJD.EREADONLY"] == "true",
  541. FLSH: res.data.FW_HYJY["FLSH.EREADONLY"] == "true",
  542. GPJZSC: res.data.FW_HYJY["GPJZSC.EREADONLY"] == "true",
  543. BGSFHYJ: res.data.FW_HYJY["BGSFHYJ.EREADONLY"] == "true",
  544. SX: res.data.FW_HYJY["SX.EREADONLY"] == "true",
  545. BMFZRYJ: res.data.FW_HYJY["BMFZRYJ.EREADONLY"] == "true",
  546. NGR: res.data.FW_HYJY["NGR.EREADONLY"] == "true",
  547. NGRQ: res.data.FW_HYJY["NGRQ.EREADONLY"] == "true",
  548. HBCSYJ: res.data.FW_HYJY["HBCSYJ.EREADONLY"] == "true",
  549. GWZL: res.data.FW_HYJY["GWZL.EREADONLY"] == "true",
  550. YF: res.data.FW_HYJY["YF.EREADONLY"] == "true",
  551. BT: res.data.FW_HYJY["BT.EREADONLY"] == "true",
  552. ZS: res.data.FW_HYJY["ZS.EREADONLY"] == "true",
  553. CS: res.data.FW_HYJY["CS.EREADONLY"] == "true",
  554. FWZH: res.data.FW_HYJY["FWZH.EREADONLY"] == "true",
  555. USAGE: res.data.FW_HYJY["USAGE.EREADONLY"] == "true"
  556. }
  557. self.show = {
  558. JJCD: res.data.FW_HYJY["JJCD.ESHOW"] == "true",
  559. WLDQFL: res.data.FW_HYJY["WLDQFL.ESHOW"] == "true",
  560. WLDSSL: res.data.FW_HYJY["WLDSSL.ESHOW"] == "true",
  561. XXGKSH: res.data.FW_HYJY["XXGKSH.ESHOW"] == "true",
  562. SFXYJD: res.data.FW_HYJY["SFXYJD.ESHOW"] == "true",
  563. FLSH: res.data.FW_HYJY["FLSH.ESHOW"] == "true",
  564. GPJZSC: res.data.FW_HYJY["GPJZSC.ESHOW"] == "true",
  565. BGSFHYJ: res.data.FW_HYJY["BGSFHYJ.ESHOW"] == "true",
  566. SX: res.data.FW_HYJY["SX.ESHOW"] == "true",
  567. BMFZRYJ: res.data.FW_HYJY["BMFZRYJ.ESHOW"] == "true",
  568. NGR: res.data.FW_HYJY["NGR.ESHOW"] == "true",
  569. NGRQ: res.data.FW_HYJY["NGRQ.ESHOW"] == "true",
  570. HBCSYJ: res.data.FW_HYJY["HBCSYJ.ESHOW"] == "true",
  571. GWZL: res.data.FW_HYJY["GWZL.ESHOW"] == "true",
  572. YF: res.data.FW_HYJY["YF.ESHOW"] == "true",
  573. BT: res.data.FW_HYJY["BT.ESHOW"] == "true",
  574. ZS: res.data.FW_HYJY["ZS.ESHOW"] == "true",
  575. CS: res.data.FW_HYJY["CS.ESHOW"] == "true",
  576. FWZH: res.data.FW_HYJY["FWZH.ESHOW"] == "true",
  577. USAGE: res.data.FW_HYJY["USAGE.ESHOW"] == "true"
  578. }
  579. self.selectUSAGEs = self.data.USAGE != "" && self.data.USAGE != null ? self.data.USAGE.split(",") : [];
  580. $.each(self.USAGE, function (index, item) {
  581. if (self.data.USAGE && self.data.USAGE.indexOf(item.CODE) != -1) {
  582. item.checked = true;
  583. }
  584. })
  585. $timeout(function () {
  586. $(".sp-checkbox-blue input[name=USAGE]").each(function () {
  587. if (self.data.USAGE.indexOf($(this).val()) != -1) {
  588. $(this).attr("checked", true);
  589. $(this).parent("label").addClass("chb-blue-checked");
  590. }
  591. })
  592. }, 0)
  593. if (self.data.ID == 0) {
  594. self.filedChange = true;
  595. } else {
  596. self.filedChange = false;
  597. }
  598. var buttonList = [{ CNAME: "转发", CODE: "array", data: [] }];
  599. res.data["FW_HYJY.FUNCLIST"].forEach(function (item) {
  600. if (item.BUTTONGROUP == "FORMITEM") {
  601. buttonList.push(item)
  602. } else {
  603. buttonList[0].data.push(item)
  604. }
  605. })
  606. if (buttonList[0].data.length == 0) {
  607. buttonList = buttonList.slice(1)
  608. } else if (buttonList[0].data.length == 1) {
  609. buttonList[0] = buttonList[0].data[0]
  610. }
  611. console.log(buttonList)
  612. self.buttonList = buttonList;//res.data["FW_HYJY.FUNCLIST"];
  613. if (self.lastrouteinfoid != 0) {
  614. self.getHB()
  615. }
  616. self.getOpinion1(0)
  617. self.getOther()
  618. self.getGLJ(0)
  619. self.getGCG(0)
  620. self.getCWG()
  621. self.getQZG()
  622. if (self.docmode == 'zihao' || self.data.FWZH1 != "") {
  623. self.getFWZH()
  624. }
  625. self.getMeetMsg()
  626. $interval(function () {
  627. self.getNumMeet()
  628. }, 2000)
  629. console.log(!self.hide('show','FWZH'))
  630. $timeout(function () {
  631. $(".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")
  632. var height1 = $(".formedit center").css("height"), height2 = 0;
  633. $(".auto").siblings().each(function () {
  634. height2 = height2 + $(this).outerHeight();
  635. })
  636. if (height1.slice(0, height1.length - 2) - height2 < 277) {
  637. $(".auto").css("height", 277);
  638. $(".formedit center").css("height", $(".formedit center").height() + (277 - (height1.slice(0, height1.length - 2) - height2)))
  639. } else {
  640. $(".auto").css("height", height1.slice(0, height1.length - 2) - height2);
  641. }
  642. }, 100)
  643. })
  644. }
  645. self.getFWZH = function () {
  646. var data = {
  647. flowid: sp.getUrlName("flowid"),
  648. code: "",
  649. cyear: self.data.FWZH == "" ? sp.currentYear() : self.data.FWZH.slice(self.data.FWZH.indexOf("〔") + 1, self.data.FWZH.indexOf("〕")),
  650. routeinfoidmark: self.routeinfoid,
  651. zihao: self.data.FWZH
  652. }
  653. $http.post(apiurljs.login + "g2app/fawen/queryZiHaoCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  654. .success(function (obj) {
  655. var res = strToJson(s4.decryptData_CBC(obj.data));
  656. self.FWZH = res.data.map(function (item) {
  657. return { CNAME: item.split("|")[0], CODE: item.split("|")[0], CNAMEMARK: item.split("|")[1] }
  658. });
  659. if (self.data.FWZH == "") { self.data.FWZH = self.FWZH[0].CODE }
  660. })
  661. }
  662. //生成左侧合并文件
  663. self.getHB = function () {
  664. if (self.data.MQFMARK == 1) {
  665. var data = {
  666. routeinfoid: self.routeinfoid
  667. }
  668. $http.post(apiurljs.login + "g2app/dataabase/mergeOFDByLastRouteinfoidWithCurrentRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  669. .success(function (obj) {
  670. var res = strToJson(s4.decryptData_CBC(obj.data));
  671. if (res.data != "") {
  672. let postData = {
  673. convertType: 570,
  674. fileUrl: res.data,
  675. isPrint: 1,
  676. isDownload: 1,
  677. };
  678. var postCfg_transfer = {
  679. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  680. transformRequest: function (data) {
  681. return $.param(data);
  682. }
  683. };
  684. $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
  685. .success(function (res) {
  686. self.LoadYZ = false;
  687. if (res.errorcode === 0) {
  688. 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 } };
  689. self.iframeLast = self.iframeList.length - 1;
  690. self.iframeShow = self.iframeList.length;
  691. self.iframeHide = self.iframeList.length - self.iframeShow;
  692. } else {
  693. sp.dialog(res.message);
  694. }
  695. });
  696. } else {
  697. var data = {
  698. routeinfoid: self.routeinfoid
  699. }
  700. $http.post(apiurljs.login + "g2app/dataabase/mergePDFByLastRouteinfoidWithCurrentRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  701. .success(function (obj) {
  702. var res = strToJson(s4.decryptData_CBC(obj.data));
  703. if (res.data != "") {
  704. let postData = {
  705. convertType: 20,
  706. fileUrl: res.data,
  707. isPrint: 1,
  708. isDownload: 1,
  709. };
  710. var postCfg_transfer = {
  711. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  712. transformRequest: function (data) {
  713. return $.param(data);
  714. }
  715. };
  716. $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
  717. .success(function (res) {
  718. self.LoadYZ = false;
  719. if (res.errorcode === 0) {
  720. 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 } };
  721. self.iframeLast = self.iframeList.length - 1;
  722. self.iframeShow = self.iframeList.length;
  723. self.iframeHide = self.iframeList.length - self.iframeShow;
  724. } else {
  725. sp.dialog(res.message);
  726. }
  727. });
  728. }
  729. })
  730. }
  731. })
  732. } else {
  733. var data = {
  734. routeinfoid: self.routeinfoid
  735. }
  736. $http.post(apiurljs.login + "g2app/dataabase/mergeFileByLastRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  737. .success(function (obj) {
  738. var res = strToJson(s4.decryptData_CBC(obj.data));
  739. if (res.data.result != "") {
  740. let postData = {
  741. convertType: res.data.mark == "ofd" ? 570 : 20,
  742. isDownload: 1,
  743. isPrint: 1,
  744. fileUrl: res.data.result
  745. };
  746. var postCfg_transfer = {
  747. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  748. transformRequest: function (data) {
  749. return $.param(data);
  750. }
  751. };
  752. $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
  753. .success(function (res) {
  754. if (res.errorcode === 0) {
  755. 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 } }];
  756. self.iframeLast = self.iframeList.length - 1;
  757. self.iframeShow = self.iframeList.length;
  758. self.iframeHide = self.iframeList.length - self.iframeShow;
  759. } else {
  760. sp.dialog(res.message);
  761. }
  762. });
  763. } else {
  764. var data = {
  765. routeinfoid: self.routeinfoid
  766. }
  767. $http.post(apiurljs.login + "g2app/dataabase/mergePDFByLastRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  768. .success(function (obj) {
  769. var res = strToJson(s4.decryptData_CBC(obj.data));
  770. if (res.data.result != "") {
  771. let postData = {
  772. convertType: res.data.mark == "ofd" ? 570 : 20,
  773. isDownload: 1,
  774. isPrint: 1,
  775. fileUrl: res.data.result
  776. };
  777. var postCfg_transfer = {
  778. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  779. transformRequest: function (data) {
  780. return $.param(data);
  781. }
  782. };
  783. $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
  784. .success(function (res) {
  785. if (res.errorcode === 0) {
  786. 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 } }];
  787. self.iframeLast = self.iframeList.length - 1;
  788. self.iframeShow = self.iframeList.length;
  789. self.iframeHide = self.iframeList.length - self.iframeShow;
  790. } else {
  791. sp.dialog(res.message);
  792. }
  793. });
  794. }
  795. })
  796. }
  797. })
  798. }
  799. }
  800. //获取关联文稿
  801. self.getGLJ = function (n) {
  802. var data = {
  803. dockind: "D01",
  804. routeinfoid: self.routeinfoid
  805. }
  806. $http.post(apiurljs.login + "g2app/fawenfilesrelate/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  807. .success(function (obj) {
  808. var res = strToJson(s4.decryptData_CBC(obj.data));
  809. self.guanlian = res.data;
  810. if (n == 0) {
  811. self.getGLFLOW()
  812. }
  813. if (n == 2) {
  814. self.editFile(self.guanlian[self.guanlian.length - 1], 2)
  815. }
  816. })
  817. }
  818. self.seeGLJ = function () {
  819. if ($(".formedit2").find("iframe").attr("src") == "") {
  820. if (self.guanlian[0].FILEURL.indexOf("files") > -1) {
  821. var set_filepath = apiurljs.yzFcscloud + "g2work/files/" + self.guanlian[0].FILEURL.slice(7);
  822. } else {
  823. var set_filepath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + self.guanlian[0].FILEURL;
  824. }
  825. var data = {
  826. method: 1,
  827. params: {
  828. userId: self.userName,
  829. fileId: "",
  830. fileName: "",
  831. filePath: "",
  832. userRight: self.dotype != 1 ? 1 : 0,
  833. callbackUrl: ""
  834. }
  835. };
  836. if (self.guanlian[0].FILEURL.indexOf("files") > -1) {
  837. data.params.fileId = self.guanlian[0].FILEURL.split("/")[2];
  838. data.params.fileName = self.guanlian[0].FILEURL.split("/")[3];
  839. data.params.filePath = apiurljs.yzFcscloud + "g2work/files/" + self.guanlian[0].FILEURL.slice(7);
  840. data.params.callbackUrl = apiurljs.login + "g2app/attachfiles/uploadFileAttach"
  841. } else {
  842. data.params.fileId = self.guanlian[0].ID;
  843. data.params.fileName = self.guanlian[0].FILENAMES;
  844. data.params.filePath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + self.guanlian[0].FILEURL;
  845. data.params.callbackUrl = apiurljs.login + "g2app/fawenfiles/uploadFile"
  846. }
  847. $.ajax({
  848. url: apiurljs.yzFileWo + "api.do",
  849. data: {
  850. jsonParams: encodeURIComponent(JSON.stringify(data))
  851. },
  852. type: "POST",
  853. dataType: "json",
  854. general: false,
  855. async: false,
  856. success: function (data) {
  857. if (data) {
  858. if (data.errorCode === "0") {
  859. let rst = data.result;
  860. if (rst && rst.urls) {
  861. var get_urls = rst.urls;
  862. if (typeof (get_urls) === "string") {
  863. $(".formedit2").find("iframe").attr("src", sp.ipChange(get_urls)).attr("data-id", self.guanlian[0].ID)
  864. }
  865. }
  866. }
  867. }
  868. },
  869. });
  870. }
  871. }
  872. //获取关联流程
  873. self.getGLFLOW = function () {
  874. var data = {
  875. userid: self.userId,
  876. routeinfoid: self.routeinfoid
  877. }
  878. $http.post(apiurljs.login + "g2work/routeinfo/queryDataRelatedFlow", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  879. .success(function (obj) {
  880. var res = strToJson(s4.decryptData_CBC(obj.data));
  881. res.data.FLOWIN.forEach(function (item) {
  882. item.type = "FLOWIN"
  883. })
  884. res.data.FLOWOUT.forEach(function (item) {
  885. item.type = "FLOWOUT"
  886. })
  887. self.glList = res.data.FLOWIN.concat(res.data.FLOWOUT);
  888. })
  889. }
  890. //获取意见(不上表)
  891. self.getOpinion1 = function (n) {
  892. self.HWFJ = [];
  893. var data = {
  894. cmanid: self.userId,
  895. routeinfoid: self.routeinfoid,
  896. routeid: "",//self.routeid,
  897. tableid: "FW_HYJY",
  898. colid: "",
  899. opiniontype: "",//self.opiniontype,
  900. orderbycol: "CDATE desc"
  901. }
  902. $http.post(apiurljs.login + "g2app/abase/queryDataOpinionWithRouteAttach", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  903. .success(function (obj) {
  904. var res = strToJson(s4.decryptData_CBC(obj.data));
  905. if (res.success == true) {
  906. for (var i in self.YJ) {
  907. if (typeof (self.YJ[i]) == "object") {
  908. self.YJ[i] = [];
  909. self.YJ[i + "STATUS"] = false;
  910. res.data.forEach(function (item) {
  911. item.CDATE = sp.datefmt("yyyy-MM-dd", item.CDATE);
  912. if (i == item.COLID) {
  913. self.YJ[i].push(item)
  914. if (item.ROUTEID == self.routeid) {
  915. self.data[i] = item.opinion;
  916. self.YJ[i + "STATUS"] = true;
  917. }
  918. }
  919. })
  920. }
  921. }
  922. self.YJ.nulla = res.data.filter(function (item) {
  923. return item.COLID == "";
  924. });
  925. self.YJ.nullaSTATUS = false;
  926. self.YJ.nulla.forEach(function (item) {
  927. item.CDATE = sp.datefmt("yyyy-MM-dd", item.CDATE);
  928. if (self.activeOpinion != null) {
  929. self.activeOpinion.FILEDATA = item.FILEDATA
  930. }
  931. })
  932. res.data.forEach(function (item) {
  933. item.FILEDATA.forEach(function (item1) {
  934. self.HWFJ.push(item1)
  935. })
  936. })
  937. //if (n == 1 && self.lastrouteinfoid != 0) {
  938. // self.getHB()
  939. //}
  940. } else {
  941. sp.dialog(res.message)
  942. }
  943. })
  944. }
  945. //获取附件和插件
  946. self.getOther = function () {
  947. var data = {
  948. tablename: "FILE_ATTACH",
  949. colums: "*",
  950. order: "ID asc",
  951. sqlwhere: { ROUTEINFOID: self.routeinfoid },
  952. sqlinwhere: "",
  953. sqllikewhere: ""
  954. }
  955. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  956. .success(function (obj) {
  957. var res = strToJson(s4.decryptData_CBC(obj.data));
  958. self.arrayFile1 = [];
  959. if (res.data.length > 0) {
  960. res.data.forEach(function (item) {
  961. if (item.ATTACHTYPE.indexOf("-正文") == -1) {
  962. self.arrayFile1.push(item)
  963. }
  964. })
  965. }
  966. })
  967. }
  968. //发文打开过程稿在线编辑
  969. self.getGCG = function (n) {
  970. var data = {
  971. dockind: "D01",
  972. routeinfoid: self.routeinfoid
  973. }
  974. $http.post(apiurljs.login + "g2app/fawenfiles/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  975. .success(function (obj) {
  976. var res = strToJson(s4.decryptData_CBC(obj.data));
  977. self.gaoTypeArrayFirst = res.data;
  978. self.gaoTypeArrayFirst.forEach(function (item) {
  979. if (item.FILENAMES.split(".").length == 1) {
  980. item.FILENAMES = item.FILENAMES + "." + item.FILEEXT
  981. }
  982. })
  983. if (self.gaoTypeArrayFirst.length > 0 && self.lastrouteinfoid == 0) {
  984. self.seeGCG()
  985. }
  986. if (n > 0) {
  987. self.editFile(self.gaoTypeArrayFirst[0], 1, "正文");
  988. }
  989. if (self.gaoTypeArrayFirst.length > 1) {
  990. var data = {
  991. id: self.gaoTypeArrayFirst[0].ID
  992. }
  993. $http.post(apiurljs.login + "g2app/fawenfiles/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  994. .success(function (obj) {
  995. var res = strToJson(s4.decryptData_CBC(obj.data));
  996. if (res.success) {
  997. self.getGCG(2)
  998. }
  999. });
  1000. }
  1001. })
  1002. }
  1003. self.seeGCG = function () {
  1004. if ($(".formedit1").find("iframe").attr("src") == "") {
  1005. if (self.gaoTypeArrayFirst[0].FILEURL.indexOf("files") > -1) {
  1006. var set_filepath = apiurljs.yzFcscloud + "g2work/files/" + self.gaoTypeArrayFirst[0].FILEURL.slice(7);
  1007. } else {
  1008. var set_filepath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + self.gaoTypeArrayFirst[0].FILEURL;
  1009. }
  1010. var data = {
  1011. method: 1,
  1012. params: {
  1013. userId: self.userName,
  1014. fileId: "",
  1015. fileName: "",
  1016. filePath: "",
  1017. userRight: self.dotype != 1 ? 1 : 0,
  1018. callbackUrl: ""
  1019. }
  1020. };
  1021. if (self.gaoTypeArrayFirst[0].FILEURL.indexOf("files") > -1) {
  1022. data.params.fileId = self.gaoTypeArrayFirst[0].FILEURL.split("/")[2];
  1023. data.params.fileName = self.gaoTypeArrayFirst[0].FILEURL.split("/")[3];
  1024. data.params.filePath = apiurljs.yzFcscloud + "g2work/files/" + self.gaoTypeArrayFirst[0].FILEURL.slice(7);
  1025. data.params.callbackUrl = apiurljs.login + "g2app/attachfiles/uploadFileAttach"
  1026. } else {
  1027. data.params.fileId = self.gaoTypeArrayFirst[0].ID;
  1028. data.params.fileName = self.gaoTypeArrayFirst[0].FILENAMES;
  1029. data.params.filePath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + self.gaoTypeArrayFirst[0].FILEURL;
  1030. data.params.callbackUrl = apiurljs.login + "g2app/fawenfiles/uploadFile"
  1031. }
  1032. $.ajax({
  1033. url: apiurljs.yzFileWo + "api.do",
  1034. data: {
  1035. jsonParams: encodeURIComponent(JSON.stringify(data))
  1036. },
  1037. type: "POST",
  1038. dataType: "json",
  1039. general: false,
  1040. async: false,
  1041. success: function (data) {
  1042. if (data) {
  1043. if (data.errorCode === "0") {
  1044. let rst = data.result;
  1045. if (rst && rst.urls) {
  1046. var get_urls = rst.urls;
  1047. if (typeof (get_urls) === "string") {
  1048. $(".formedit1").find("iframe").attr("src", sp.ipChange(get_urls)).attr("data-id", self.gaoTypeArrayFirst[0].ID)
  1049. }
  1050. }
  1051. }
  1052. }
  1053. },
  1054. });
  1055. }
  1056. }
  1057. //成文稿
  1058. self.getCWG = function () {
  1059. var data = {
  1060. dockind: "D02",
  1061. routeinfoid: self.routeinfoid
  1062. }
  1063. $http.post(apiurljs.login + "g2app/fawenfiles/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1064. .success(function (obj) {
  1065. var res = strToJson(s4.decryptData_CBC(obj.data));
  1066. self.gaoTypeArraySecond = res.data;
  1067. self.gaoTypeArraySecond.forEach(function (item) {
  1068. if (item.FILENAMES.split(".").length == 1) {
  1069. item.FILENAMES = item.FILENAMES + "." + item.FILEEXT
  1070. }
  1071. })
  1072. })
  1073. }
  1074. //签章稿
  1075. self.getQZG = function () {
  1076. var data = {
  1077. dockind: "D03",
  1078. routeinfoid: self.routeinfoid
  1079. }
  1080. $http.post(apiurljs.login + "g2app/fawenfiles/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1081. .success(function (obj) {
  1082. var res = strToJson(s4.decryptData_CBC(obj.data));
  1083. self.gaoTypeArrayThird = res.data;
  1084. self.gaoTypeArrayThird.forEach(function (item) {
  1085. if (item.FILENAMES.split(".").length == 1) {
  1086. item.FILENAMES = item.FILENAMES + "." + item.FILEEXT
  1087. }
  1088. })
  1089. })
  1090. }
  1091. //下载正文/终稿/签章
  1092. self.downloadWG = function (item) {
  1093. //window.open(apiurljs.login.split("glwork/")[0] + "glworkweb/" + item.FILEURL)
  1094. window.open(apiurljs.login + "g2work/gaizhangfiles/" + encodeURIComponent(self.data.BT) + "/" + item.FILENAMES)
  1095. }
  1096. //删除正文/终稿/签章
  1097. self.btnDeleteWG = function (obj, n) {
  1098. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  1099. var dialogBody = "<div class=\"sp-dialog-body\">删除后不可恢复,您确认要删除吗?</div>";
  1100. 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>";
  1101. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  1102. sp.openCenter(".sp-dialog");
  1103. ///取消按钮
  1104. $('.sp-closeDialog').click(function (event) {
  1105. sp.closeCenter(".sp-dialog");
  1106. event.preventDefault();
  1107. event.stopPropagation();
  1108. });
  1109. //post消息的id
  1110. $("#delDataTrue").click(function () {
  1111. var data = {
  1112. id: obj.ID
  1113. }
  1114. $http.post(apiurljs.login + "g2app/fawenfiles/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1115. .success(function (obj) {
  1116. var res = strToJson(s4.decryptData_CBC(obj.data));
  1117. sp.dialoghide();
  1118. if (res.success) {
  1119. if (n == 2) {
  1120. self.getCWG()
  1121. } else if (n == 3) {
  1122. self.getQZG()
  1123. }
  1124. } else {
  1125. sp.dialog("创建失败,请联系管理员!");
  1126. }
  1127. ///
  1128. });
  1129. });
  1130. };
  1131. //生成正文三种方式:空白模板,红头模板,上传本地文件
  1132. self.newMoBanFlag = false;
  1133. self.newMoBan1 = function () {
  1134. self.newMoBanFlag = true;
  1135. if (self.gaoTypeArrayFirst.length > 0) {
  1136. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  1137. var dialogBody = "<div class=\"sp-dialog-body\">您确定要覆盖正文吗?</div>";
  1138. 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>";
  1139. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  1140. sp.openCenter(".sp-dialog");
  1141. ///取消按钮
  1142. $('.sp-closeDialog').click(function (event) {
  1143. sp.closeCenter(".sp-dialog");
  1144. event.preventDefault();
  1145. event.stopPropagation();
  1146. });
  1147. //post消息的id
  1148. $("#delDataTrue").click(function () {
  1149. sp.closeCenter(".sp-dialog");
  1150. var data = {
  1151. id: self.gaoTypeArrayFirst[0].ID
  1152. }
  1153. $http.post(apiurljs.login + "g2app/fawenfiles/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1154. .success(function (obj) {
  1155. var res = strToJson(s4.decryptData_CBC(obj.data));
  1156. if (res.success) {
  1157. var data = {
  1158. dockind: "D01",
  1159. routeinfoid: self.routeinfoid,
  1160. gwtype: self.data.GWZL,
  1161. filekind: "DOCFILE"
  1162. }
  1163. $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1164. .success(function (obj) {
  1165. var res = strToJson(s4.decryptData_CBC(obj.data));
  1166. if (res.success) {
  1167. self.getGCG(1)
  1168. } else {
  1169. sp.dialog("创建失败,请联系管理员!");
  1170. }
  1171. });
  1172. } else {
  1173. sp.dialog("创建失败,请联系管理员!");
  1174. }
  1175. self.newMoBanFlag = false;
  1176. });
  1177. })
  1178. } else {
  1179. var data = {
  1180. dockind: "D01",
  1181. routeinfoid: self.routeinfoid,
  1182. gwtype: self.data.GWZL,
  1183. filekind: "DOCFILE"
  1184. }
  1185. $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1186. .success(function (obj) {
  1187. var res = strToJson(s4.decryptData_CBC(obj.data));
  1188. if (res.success) {
  1189. self.getGCG(1)
  1190. } else {
  1191. sp.dialog("创建失败,请联系管理员!");
  1192. }
  1193. self.newMoBanFlag = false;
  1194. });
  1195. }
  1196. }
  1197. self.newMoBan2 = function () {
  1198. self.newMoBanFlag = true;
  1199. if (self.gaoTypeArrayFirst.length > 0) {
  1200. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  1201. var dialogBody = "<div class=\"sp-dialog-body\">您确定要覆盖正文吗?</div>";
  1202. 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>";
  1203. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  1204. sp.openCenter(".sp-dialog");
  1205. ///取消按钮
  1206. $('.sp-closeDialog').click(function (event) {
  1207. sp.closeCenter(".sp-dialog");
  1208. event.preventDefault();
  1209. event.stopPropagation();
  1210. });
  1211. //post消息的id
  1212. $("#delDataTrue").click(function () {
  1213. sp.closeCenter(".sp-dialog");
  1214. var data = {
  1215. id: self.gaoTypeArrayFirst[0].ID
  1216. }
  1217. $http.post(apiurljs.login + "g2app/fawenfiles/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1218. .success(function (obj) {
  1219. var res = strToJson(s4.decryptData_CBC(obj.data));
  1220. if (res.success) {
  1221. var data = {
  1222. dockind: "D01",
  1223. routeinfoid: self.routeinfoid,
  1224. gwtype: self.data.GWZL,
  1225. filekind: "REDFILE"
  1226. }
  1227. $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1228. .success(function (obj) {
  1229. var res = strToJson(s4.decryptData_CBC(obj.data));
  1230. if (res.success) {
  1231. self.getGCG(1)
  1232. } else {
  1233. sp.dialog("创建失败,请联系管理员!");
  1234. }
  1235. });
  1236. } else {
  1237. sp.dialog("创建失败,请联系管理员!");
  1238. }
  1239. self.newMoBanFlag = false;
  1240. });
  1241. })
  1242. } else {
  1243. var data = {
  1244. dockind: "D01",
  1245. routeinfoid: self.routeinfoid,
  1246. gwtype: self.data.GWZL,
  1247. filekind: "REDFILE"
  1248. }
  1249. $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1250. .success(function (obj) {
  1251. var res = strToJson(s4.decryptData_CBC(obj.data));
  1252. if (res.success) {
  1253. self.getGCG(1)
  1254. } else {
  1255. sp.dialog("创建失败,请联系管理员!");
  1256. }
  1257. self.newMoBanFlag = false;
  1258. });
  1259. }
  1260. }
  1261. //判断页面字段是否只读readonly、是否隐藏show
  1262. self.hide = function (type, field) {
  1263. if (self.dotype == 0 && type == "readonly") {
  1264. return true;
  1265. } else {
  1266. if (self[type][field] == true) {
  1267. return true;
  1268. } else {
  1269. return false;
  1270. }
  1271. }
  1272. }
  1273. //右上角按钮调用方法
  1274. self.btnEvent = function (item) {
  1275. switch (item.CODE) {
  1276. case "SAVEITEM": self.btnSave(0); break;
  1277. case "PRINTITEM": self.btnPrint(); break;
  1278. case "PRINTITEMEXTEND": self.btnPrint1(); break;
  1279. case "SAVEOFD": self.toOFD(); break;
  1280. case "GAIZITEM": self.qianZ(); break;
  1281. case "MEETITEM": self.Meet(); break;
  1282. case "SENDLOG": self.RouteList(); break;
  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_HYJY",
  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_HYJY",
  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 = "moban24"
  1601. } else if (self.printFiled == 2) {
  1602. var templatefilename = "mobanoption"
  1603. } else {
  1604. var templatefilename = "moban24_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_HYJY",
  1611. printtype: self.printFiled,
  1612. printdate: "NGRQ"
  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. FLSH: false,
  1633. FLSHImg: false,
  1634. SX: false,
  1635. SXImg: false,
  1636. GPJZSC: false,
  1637. GPJZSCImg: false,
  1638. BMFZRYJ: false,
  1639. BMFZRYJImg: false,
  1640. HBCSYJ: false,
  1641. HBCSYJImg: false,
  1642. nulla: false
  1643. }
  1644. self.YJ = {
  1645. WLDQFL: [],
  1646. WLDQFLSTATUS: false,
  1647. WLDSSL: [],
  1648. WLDSSLSTATUS: false,
  1649. FLSH: [],
  1650. FLSHSTATUS: false,
  1651. SX: [],
  1652. SXSTATUS: false,
  1653. GPJZSC: [],
  1654. GPJZSCSTATUS: false,
  1655. BMFZRYJ: [],
  1656. BMFZRYJSTATUS: false,
  1657. HBCSYJ: [],
  1658. HBCSYJSTATUS: false,
  1659. nulla: [],
  1660. nullaSTATUS: false
  1661. }
  1662. //意见(下表)
  1663. self.openOptionList = function () {
  1664. if (self.routeinfoid == 0 && self.routeid == 0) {
  1665. sp.dialog("请先保存!")
  1666. return;
  1667. }
  1668. if (self.dotype == 0) {
  1669. return
  1670. }
  1671. if (self.opinion.nulla == true) {
  1672. return;
  1673. }
  1674. self.nulla = "";
  1675. self.opinion.nulla = true;
  1676. }
  1677. self.openOptionList1 = function () {
  1678. self.openOptionList()
  1679. self.activeOpinion = null;
  1680. self.showBottom = "opinion";
  1681. self.YJ.nulla.forEach(function (item) {
  1682. if (item.ROUTEID == self.routeid) {
  1683. self.activeOpinion = item;
  1684. self.nulla = item.OPINION;
  1685. }
  1686. })
  1687. }
  1688. self.closeOptionList = function () {
  1689. self.opinion.nulla = false;
  1690. self.activeOpinion = null;
  1691. $(".toggle").trigger("click")
  1692. }
  1693. self.submitOptionList = function () {
  1694. var data = {
  1695. cmanid: self.userId,
  1696. routeinfoid: self.routeinfoid,
  1697. routeid: self.routeid,
  1698. tableid: "FW_HYJY",
  1699. colid: "",
  1700. opiniontype: 99,
  1701. cresult: "",
  1702. opinion: self.nulla,
  1703. opinionimage: ""
  1704. }
  1705. $http.post(apiurljs.login + "g2app/abase/saveDataOpinion", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1706. .success(function (obj) {
  1707. var res = strToJson(s4.decryptData_CBC(obj.data));
  1708. if (res.success == true) {
  1709. self.getOpinion1(2);
  1710. self.opinion.nulla = false;
  1711. $(".toggle").trigger("click")
  1712. } else {
  1713. sp.dialog(res.message)
  1714. }
  1715. })
  1716. }
  1717. self.changeOptionList = function (item) {
  1718. self.showBottom = "opinion";
  1719. self.opinion.nulla = true;
  1720. self.nulla = item.OPINION;
  1721. self.activeOpinion = item;
  1722. $(".toggle").trigger("click")
  1723. }
  1724. //意见附件(下表)
  1725. self.uploading1 = false;
  1726. self.upload1 = function () {
  1727. $('#fileupload1').fileupload({
  1728. url: apiurljs.login + 'g2app/abase/UploadWholeFileWithRouteAttach',
  1729. dataType: 'json',
  1730. beforeSend: function (xhr, data) {
  1731. xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
  1732. xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=SYS_ROUTE_ATTACHLIST,userid=" + self.userId + ",routeinfoid=" + self.routeinfoid
  1733. + ",routeid=" + self.routeid + ",tableid=FW_HYJY,colid="));
  1734. },
  1735. // 上传完成后的执行逻辑
  1736. done: function (e, data) {
  1737. self.uploading1 = false;
  1738. self.getOpinion1(2)
  1739. }
  1740. })
  1741. }
  1742. //意见附件(下表)
  1743. self.uploading2 = false;
  1744. self.upload2 = function (str) {
  1745. $('#fileupload-' + str).fileupload({
  1746. url: apiurljs.login + 'g2app/abase/UploadWholeFileWithRouteAttach',
  1747. dataType: 'json',
  1748. beforeSend: function (xhr, data) {
  1749. xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
  1750. xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=SYS_ROUTE_ATTACHLIST,userid=" + self.userId + ",routeinfoid=" + self.routeinfoid
  1751. + ",routeid=" + self.routeid + ",tableid=FW_HYJY,colid=" + str));
  1752. },
  1753. // 上传完成后的执行逻辑
  1754. done: function (e, data) {
  1755. self.uploading1 = false;
  1756. self.getOpinion1(2)
  1757. }
  1758. })
  1759. }
  1760. //下载意见表附件
  1761. self.downLoadOption = function (item) {
  1762. window.open(apiurljs.login + "g2work/files/" + item.FILEPATH.slice(7))
  1763. }
  1764. //删除意见表附件
  1765. self.deleteOptionFile = function (file) {
  1766. var data = {
  1767. routeid: file.ROUTEID,
  1768. tableid: "FW_HYJY",
  1769. colid: file.COLID,
  1770. fileid: file.FILEID
  1771. };
  1772. $http.post(apiurljs.login + "g2app/abase/deleteDataOpinionWithRouteAttach", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1773. .success(function (obj) {
  1774. var res = strToJson(s4.decryptData_CBC(obj.data));
  1775. sp.dialoghide();
  1776. if (res.success) {
  1777. self.getOpinion1(2);
  1778. } else {
  1779. sp.dialog("删除失败,请联系管理员!");
  1780. }
  1781. });
  1782. }
  1783. //签写意见
  1784. self.openOpinion = function (str) {
  1785. if (self.routeinfoid == 0 && self.routeid == 0) {
  1786. sp.dialog("请先保存!")
  1787. return;
  1788. }
  1789. self.opinion[str] = true;
  1790. }
  1791. //修改意见
  1792. self.changeOpinion = function (str) {
  1793. self.data[str] = self.YJ[str][0].OPINION;
  1794. self.opinion[str] = true;
  1795. }
  1796. self.changeOpinionItem = function (str, item) {
  1797. if (item.OPINIONIMAGE != "") {
  1798. self.QianZi(str);
  1799. self.opinion[str + "Img"] = true;
  1800. }
  1801. self.data[str] = item.OPINION;
  1802. self.opinion[str] = true;
  1803. }
  1804. //提交意见
  1805. self.Sopinion = function (str) {
  1806. if (self.opinion[str + "Img"] == true) {
  1807. self.data[str] = $("#" + str + "QZ").find("canvas")[0].toDataURL();
  1808. } else {
  1809. self.data[str] = $("#" + str).val();
  1810. }
  1811. var data = {
  1812. cmanid: self.userId,
  1813. routeinfoid: self.routeinfoid,
  1814. routeid: self.routeid,
  1815. tableid: "FW_HYJY",
  1816. colid: str,
  1817. opiniontype: 0,
  1818. cresult: "",
  1819. opinion: self.opinion[str + "Img"] == false ? self.data[str] : "",
  1820. opinionimage: self.opinion[str + "Img"] == true ? self.data[str] : ""
  1821. }
  1822. $http.post(apiurljs.login + "g2app/abase/saveDataOpinion", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1823. .success(function (obj) {
  1824. var res = strToJson(s4.decryptData_CBC(obj.data));
  1825. if (res.success == true) {
  1826. self.getOpinion1(1);
  1827. self.opinion[str] = false;
  1828. self.opinion[str + "Img"] = false;
  1829. self.data[str] = "";
  1830. self.changeFiled(str)
  1831. } else {
  1832. sp.dialog(res.message)
  1833. }
  1834. })
  1835. }
  1836. //删除意见
  1837. self.Dopinion = function (str) {
  1838. var data = {
  1839. cmanid: self.userId,
  1840. routeid: self.routeid,
  1841. tableid: "FW_HYJY",
  1842. colid: str,
  1843. }
  1844. $http.post(apiurljs.login + "g2app/abase/deleteDataOpinion", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1845. .success(function (obj) {
  1846. var res = strToJson(s4.decryptData_CBC(obj.data));
  1847. if (res.success == true) {
  1848. self.getOpinion1(1);
  1849. self.nulla = "";
  1850. self.activeOpinion = null;
  1851. self.changeFiled(str)
  1852. } else {
  1853. sp.dialog(res.message)
  1854. }
  1855. })
  1856. }
  1857. self.phraseText = "";//添加常用语
  1858. self.phraseList = []//常用语列表
  1859. //获取常用语库
  1860. self.phrase = function (colid) {
  1861. sp.layer("#phrase");
  1862. self.colid = colid;
  1863. self.getPhrase();
  1864. }
  1865. //添加常用语到常用语库
  1866. self.Aphrase = function () {
  1867. if (self.phraseText == "") {
  1868. return;
  1869. }
  1870. var data = {
  1871. cmanid: self.userId,
  1872. tableid: "FW_HYJY",
  1873. colid: self.colid,
  1874. contents: self.phraseText
  1875. }
  1876. $http.post(apiurljs.login + "g2app/abase/insertDataPatterns", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1877. .success(function (obj) {
  1878. var res = strToJson(s4.decryptData_CBC(obj.data));
  1879. if (res.success == true) {
  1880. self.phraseText = "";
  1881. self.getPhrase();
  1882. } else {
  1883. sp.dialog(res.message)
  1884. }
  1885. })
  1886. }
  1887. //获取常用语库
  1888. self.getPhrase = function () {
  1889. var data = {
  1890. cmanid: self.userId,
  1891. tableid: "FW_HYJY",
  1892. colid: self.colid
  1893. }
  1894. $http.post(apiurljs.login + "g2app/abase/queryDataPatterns", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1895. .success(function (obj) {
  1896. var res = strToJson(s4.decryptData_CBC(obj.data));
  1897. self.phraseList = res.data;
  1898. self.phraseSelect = self.phraseList[0].CONTENTS;
  1899. })
  1900. }
  1901. //从常用语库删除
  1902. self.Dphrase = function () {
  1903. var id = null;
  1904. $.each(self.phraseList, function (index, item) {
  1905. if (item.CONTENTS == self.phraseSelect) {
  1906. id = item.ID;
  1907. }
  1908. })
  1909. var data = {
  1910. id: id
  1911. }
  1912. $http.post(apiurljs.login + "g2app/abase/deleteDataPatterns", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1913. .success(function (obj) {
  1914. var res = strToJson(s4.decryptData_CBC(obj.data));
  1915. self.getPhrase();
  1916. })
  1917. }
  1918. //常用语确认为意见
  1919. self.btnPhrase = function () {
  1920. if (!self.colid) {
  1921. self.nulla = self.phraseSelect;
  1922. } else {
  1923. self.data[self.colid] = self.phraseSelect;
  1924. }
  1925. sp.layerhide();
  1926. }
  1927. //签字—手写
  1928. self.QianZi = function (str) {
  1929. if (self.opinion[str + "Img"] == true) { return; }
  1930. self.opinion[str + "Img"] = true;
  1931. $timeout(function () {
  1932. new lineCanvas(str + "QZ")
  1933. }, 1)
  1934. }
  1935. //清除手写
  1936. self.canvasClear = function (str) {
  1937. var cxt = $("#" + str + "QZ").find("canvas")[0].getContext("2d");
  1938. cxt.clearRect(0, 0, $("#" + str + "QZ").find("canvas")[0].width, $("#" + str + "QZ").find("canvas")[0].height)
  1939. }
  1940. self.selectUSAGE = function (item) {
  1941. item.checked = !item.checked;
  1942. self.selectUSAGEs = [];
  1943. $.each(self.USAGE, function (index, item) {
  1944. if (item.checked == true) {
  1945. self.selectUSAGEs.push(item.CODE)
  1946. }
  1947. })
  1948. self.changeFiled('USAGE')
  1949. }
  1950. //发生修改
  1951. self.changeFiled = function (str) {
  1952. self.filedChange = true;
  1953. }
  1954. //转发
  1955. self.forward = function (obj) {
  1956. self.btnItem = obj;
  1957. if (self.filedChange == true) {
  1958. self.btnSave(1)
  1959. } else {
  1960. $("#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")
  1961. sp.layer("#forward")
  1962. }
  1963. }
  1964. //查看流转记录
  1965. self.RouteList = function () {
  1966. if (self.deviceType == "pad") {
  1967. window.location.href = "../../forward/modeler_read.html?" + self.SwenList[0].TEMPFORM.split("?")[1]
  1968. } else {
  1969. sp.openNewWindow("../../forward/modeler_read.html?" + self.SwenList[0].TEMPFORM.split("?")[1], "流程图")
  1970. }
  1971. }
  1972. self.showCol = function ($event, ele) {
  1973. $('.show-col').not(ele).hide();
  1974. $(ele).toggle("fast", function () {
  1975. $(ele).css('overflow-y', 'auto')
  1976. }).autoHide();
  1977. $event.stopPropagation();
  1978. }
  1979. self.iframeList = []
  1980. self.iframeLast = self.iframeList.length - 1;
  1981. self.iframeShow = self.iframeList.length;
  1982. self.iframeHide = self.iframeList.length - self.iframeShow;
  1983. //num为1时为附件表附件,为2时为文稿表附件
  1984. self.seeFile = function (obj, num, str) {
  1985. $('.show-col').hide();
  1986. if (!obj) {
  1987. sp.dialog("文件不存在!")
  1988. return
  1989. }
  1990. if (apiurljs.zhType.indexOf(obj.FILEEXT) == -1) {
  1991. sp.dialog("文件暂不支持在线预览,请点击下载查看!")
  1992. return
  1993. }
  1994. var n = 0;
  1995. self.iframeList.forEach(function (item) {
  1996. if (item.filename == obj.FILENAMES) {
  1997. n++
  1998. }
  1999. })
  2000. if (n == 0) {
  2001. var set_convertType = 0;
  2002. if (obj.FILEEXT == "doc") {
  2003. set_convertType = 0;
  2004. } else if (obj.FILEEXT == "pdf") {
  2005. set_convertType = 20;
  2006. } else if (obj.FILEEXT == "ofd") {
  2007. set_convertType = 570;
  2008. } else if ("png,jpg,jpeg,gif,bmp,jfif,svg,tif,tiff".indexOf(obj.FILEEXT) > -1) {
  2009. set_convertType = 23;
  2010. } else {
  2011. set_convertType = 0;
  2012. }
  2013. let postData = {
  2014. convertType: set_convertType,
  2015. isSignature: 1,
  2016. isPrint: 1,
  2017. 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
  2018. };
  2019. var postCfg_transfer = {
  2020. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  2021. transformRequest: function (data) {
  2022. return $.param(data);
  2023. }
  2024. };
  2025. $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
  2026. .success(function (res) {
  2027. if (res.errorcode === 0) {
  2028. if (num == 1) {
  2029. if (obj.FILEPATH) {
  2030. self.addItem(sp.ipChange(res.data.viewUrl), apiurljs.login + "g2work" + obj.FILEPATH, str, obj.FILENAMES, false)
  2031. } else {
  2032. self.addItem(sp.ipChange(res.data.viewUrl), apiurljs.login + "g2work/files2/inline/" + obj.FILEURL.slice(7), str, obj.FILENAMES, false)
  2033. }
  2034. } else {
  2035. self.addItem(sp.ipChange(res.data.viewUrl), apiurljs.login.split("glwork/")[0] + "glworkweb/" + obj.FILEURL, str, obj.FILENAMES, false)
  2036. }
  2037. } else {
  2038. sp.dialog(res.message);
  2039. }
  2040. });
  2041. }
  2042. }
  2043. self.seeZW = function () {
  2044. self.activeFormedit = 0;
  2045. if ($(".rightBox").outerWidth() == 15) {
  2046. showRightBox()
  2047. }
  2048. $("#rightList").css("margin-left", 0);
  2049. }
  2050. self.editFile = function (obj, n, str) {
  2051. if (self.newMoBanFlag == true) {
  2052. return
  2053. }
  2054. $('.show-col').hide();
  2055. if (!obj) {
  2056. sp.dialog("文件不存在!")
  2057. return
  2058. }
  2059. self.activeFormedit = n;
  2060. if ($(".rightBox").outerWidth() == 15) {
  2061. showRightBox()
  2062. }
  2063. if ($(".formedit" + n).find("iframe").attr("data-id") == obj.ID) {
  2064. if (self.iframeList.length == 0) {
  2065. if (n == 0) {
  2066. $("#rightList").css("margin-left", 0);
  2067. } else {
  2068. $("#rightList").css("margin-left", (n - 1) * $(".formedit1").width() * -1 - 10);
  2069. }
  2070. } else if (self.iframeHide == self.iframeList.length) {
  2071. if (n == 0) {
  2072. console.log(n)
  2073. $("#rightList").css("margin-left", 0);
  2074. } else {
  2075. $("#rightList").css("margin-left", (n - 1) * $(".formedit1").width() * -1 - 10);
  2076. }
  2077. } else {
  2078. $("#rightList").css("margin-left", n * $(".formedit").width() * -1);
  2079. }
  2080. } else {
  2081. if (obj.FILEURL.indexOf("files") > -1) {
  2082. var set_filepath = apiurljs.yzFcscloud + "g2work/files/" + obj.FILEURL.slice(7);
  2083. } else {
  2084. var set_filepath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + obj.FILEURL;
  2085. }
  2086. var data = {
  2087. method: 1,
  2088. params: {
  2089. userId: self.userName,
  2090. fileId: "",
  2091. fileName: "",
  2092. filePath: "",
  2093. userRight: self.dotype != 1 ? 1 : 0,
  2094. callbackUrl: ""
  2095. }
  2096. };
  2097. if (obj.FILEURL.indexOf("files") > -1) {
  2098. data.params.fileId = obj.FILEURL.split("/")[2];
  2099. data.params.fileName = obj.FILEURL.split("/")[3];
  2100. data.params.filePath = apiurljs.yzFcscloud + "g2work/files/" + obj.FILEURL.slice(7);
  2101. data.params.callbackUrl = apiurljs.login + "g2app/attachfiles/uploadFileAttach"
  2102. } else {
  2103. data.params.fileId = obj.ID;
  2104. data.params.fileName = obj.FILENAMES;
  2105. data.params.filePath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + obj.FILEURL;
  2106. data.params.callbackUrl = apiurljs.login + "g2app/fawenfiles/uploadFile"
  2107. }
  2108. $.ajax({
  2109. url: apiurljs.yzFileWo + "api.do",
  2110. data: {
  2111. jsonParams: encodeURIComponent(JSON.stringify(data))
  2112. },
  2113. type: "POST",
  2114. dataType: "json",
  2115. general: false,
  2116. async: false,
  2117. success: function (data) {
  2118. if (data) {
  2119. if (data.errorCode === "0") {
  2120. let rst = data.result;
  2121. if (rst && rst.urls) {
  2122. var get_urls = rst.urls;
  2123. if (typeof (get_urls) === "string") {
  2124. $(".formedit" + n).find("iframe").attr("src", sp.ipChange(get_urls)).attr("data-id", obj.ID)
  2125. if (self.iframeList.length == 0) {
  2126. if (n == 0) {
  2127. $("#rightList").css("margin-left", 0);
  2128. } else {
  2129. $("#rightList").css("margin-left", (n - 1) * $(".formedit1").width() * -1 - 10);
  2130. }
  2131. } else if (self.iframeHide == self.iframeList.length) {
  2132. if (n == 0) {
  2133. console.log(n)
  2134. $("#rightList").css("margin-left", 0);
  2135. } else {
  2136. $("#rightList").css("margin-left", (n - 1) * $(".formedit1").width() * -1 - 10);
  2137. }
  2138. } else {
  2139. $("#rightList").css("margin-left", n * $(".formedit").width() * -1);
  2140. }
  2141. }
  2142. }
  2143. }
  2144. }
  2145. },
  2146. })
  2147. }
  2148. }
  2149. self.btnSaveFile = function (id) {
  2150. var data = {
  2151. method: 2,
  2152. params: {
  2153. fileId: id
  2154. }
  2155. };
  2156. $.ajax({
  2157. url: apiurljs.yzFileWo + "api.do",
  2158. data: {
  2159. jsonParams: encodeURIComponent(JSON.stringify(data))
  2160. },
  2161. type: "POST",
  2162. dataType: "json",
  2163. general: false,
  2164. async: false,
  2165. success: function (data) {
  2166. if (data && data.errorCode === "0") {
  2167. sp.dialog("保存成功");
  2168. }
  2169. }
  2170. });
  2171. }
  2172. self.addItem = function (url, source, name, filename, edit, fileid) {
  2173. var n = 0;
  2174. self.iframeList.forEach(function (item) {
  2175. if (item.filename == filename && item.source == source) {
  2176. n++
  2177. }
  2178. })
  2179. if (n == 0) {
  2180. if (edit == false) {
  2181. self.iframeList.push({ id: self.iframeList.length + 1, title: name, filename: filename, url: $sce.trustAsResourceUrl(url), source: source, edit: edit, show: 1 })
  2182. } else {
  2183. self.iframeList.push({ id: self.iframeList.length + 1, title: name, filename: filename, url: $sce.trustAsResourceUrl(url), source: source, edit: edit, show: 1, fileid: fileid })
  2184. }
  2185. self.changeSize(1)
  2186. }
  2187. }
  2188. self.hideItem = function (n) {
  2189. self.iframeList[n].show = 2;
  2190. self.iframeList[n].boxStyle = { width: 0, float: "left" };
  2191. self.changeIframeSize()
  2192. }
  2193. self.showItem = function (n) {
  2194. self.iframeList[n].show = 1;
  2195. self.changeIframeSize()
  2196. }
  2197. self.changeIframeSize = function () {
  2198. if (self.iframeList.length == 0) {
  2199. } else {
  2200. var n = 0;
  2201. self.iframeList.forEach(function (item, index) {
  2202. if (item.show == 1) {
  2203. self.iframeLast = index;
  2204. }
  2205. if (item.show == 2) {
  2206. n = n + 1;
  2207. }
  2208. })
  2209. self.iframeHide = n;
  2210. self.iframeShow = self.iframeList.length - self.iframeHide;
  2211. for (var i = 0; i < self.iframeList.length; i++) {
  2212. if (self.iframeHide != self.iframeList.length) {
  2213. if (self.iframeList[i].show == 1) {
  2214. self.iframeList[i].boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2 / (self.iframeList.length - 1 - self.iframeHide)) }
  2215. self.iframeList[i].iframeStyle = { width: self.iframeList[i].boxStyle.width - 10 }
  2216. }
  2217. if ($(".rightBox").outerWidth() == 15) {
  2218. $(".leftBox").css("width", "calc(100% - 15px)");
  2219. $(".border-left-right").show()
  2220. $(".border-left-right").prev().show()
  2221. } else {
  2222. showRightBox()
  2223. }
  2224. } else {
  2225. self.iframeList[i].show = 2
  2226. self.iframeList[i].boxStyle = { width: 0, float: "left" };
  2227. self.seeGCG()
  2228. $(".leftBox").css("width", 36)
  2229. $(".border-left-right").hide()
  2230. $(".border-left-right").prev().hide()
  2231. $(".rightBox").css("width", "calc(100% - 36px)")
  2232. $("#rightList").show();
  2233. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2234. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2235. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2236. self.formeditSize()
  2237. var marginLeft = $("#rightList").css("margin-left")
  2238. if (marginLeft.slice(0, marginLeft.length - 2) == $(".formedit1").width() * -1 || marginLeft.slice(0, marginLeft.length - 2) == 0) {
  2239. } else {
  2240. $("#rightList").css("margin-left", $(".formedit1").width() * (self.activeFormedit - 1) * -1)
  2241. }
  2242. }
  2243. }
  2244. if (self.iframeShow == 1) {
  2245. self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) - 1 }
  2246. self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeLast].boxStyle.width - 10 }
  2247. } else {
  2248. self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2) - 1 }
  2249. self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeLast].boxStyle.width - 10 }
  2250. }
  2251. }
  2252. }
  2253. self.changeSize = function (n) {
  2254. if (self.iframeList.length == 0) {
  2255. $(".rightBox").show();
  2256. $("#rightList").show();
  2257. $(".rightBox").css("width", $(window).width())
  2258. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2259. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2260. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2261. self.formeditSize()
  2262. var marginLeft = $("#rightList").css("margin-left")
  2263. if (marginLeft.slice(0, marginLeft.length - 2) == $(".formedit1").width() * -1 || marginLeft.slice(0, marginLeft.length - 2) == 0) {
  2264. } else {
  2265. $("#rightList").css("margin-left", $(".formedit1").width() * (self.activeFormedit - 1) * -1)
  2266. }
  2267. } else {
  2268. if (n == 1 && $(".fa-angle-left").is(":hidden") == false) {
  2269. showRightBox()
  2270. }
  2271. $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2272. $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2273. $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2274. self.formeditSize()
  2275. var marginLeft = $("#rightList").css("margin-left")
  2276. if (marginLeft.slice(0, marginLeft.length - 2) == $(".formedit1").width() * -1 || marginLeft.slice(0, marginLeft.length - 2) == 0) {
  2277. } else {
  2278. $("#rightList").css("margin-left", $(".formedit1").width() * (self.activeFormedit - 1) * -1)
  2279. }
  2280. }
  2281. var num = 0;
  2282. self.iframeList.forEach(function (item, index) {
  2283. self.reSize(index)
  2284. if (item.show == 1) {
  2285. num = num + 1;
  2286. self.iframeLast = index;
  2287. }
  2288. })
  2289. self.iframeShow = num;
  2290. self.iframeHide = self.iframeList.length - self.iframeShow;
  2291. if (self.iframeList.length == 0) {
  2292. } else {
  2293. if (self.iframeShow == self.iframeList.length) {
  2294. self.iframeList.forEach(function (item) {
  2295. item.boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2 / (self.iframeList.length - 1 - self.iframeHide)) }
  2296. item.iframeStyle = { width: item.boxStyle.width - 10 }
  2297. })
  2298. self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc($(".leftBox").width() / (self.iframeShow == 1 ? 1 : 2)) - 1 }
  2299. self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeList.length - 1].boxStyle.width - 10 }
  2300. } else {
  2301. for (var i = 0; i < self.iframeList.length; i++) {
  2302. if (self.iframeHide != self.iframeList.length) {
  2303. if (self.iframeList[i].show == 1) {
  2304. self.iframeList[i].boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2 / (self.iframeList.length - 1 - self.iframeHide)) }
  2305. self.iframeList[i].iframeStyle = { width: self.iframeList[i].boxStyle.width - 10 }
  2306. }
  2307. if (n == 1) {
  2308. if ($(".rightBox").outerWidth() == 15) {
  2309. $(".leftBox").css("width", "calc(100% - 15px)");
  2310. $(".border-left-right").show()
  2311. $(".border-left-right").prev().show()
  2312. } else {
  2313. showRightBox()
  2314. }
  2315. }
  2316. } else {
  2317. self.iframeList[i].show = 2
  2318. self.iframeList[i].boxStyle = { width: 0, float: "left" };
  2319. self.seeGCG()
  2320. $(".leftBox").css("width", 36)
  2321. $(".border-left-right").hide()
  2322. $(".border-left-right").prev().hide()
  2323. $(".rightBox").css("width", "calc(100% - 36px)")
  2324. $("#rightList").show();
  2325. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2326. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2327. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2328. var marginLeft = $("#rightList").css("margin-left")
  2329. if (marginLeft.slice(0, marginLeft.length - 2) == $(".formedit1").width() * -1 || marginLeft.slice(0, marginLeft.length - 2) == 0) {
  2330. } else {
  2331. $("#rightList").css("margin-left", $(".formedit1").width() * (self.activeFormedit - 1) * -1)
  2332. }
  2333. }
  2334. }
  2335. if (self.iframeShow == 1) {
  2336. self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) - 1 }
  2337. self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeLast].boxStyle.width - 10 }
  2338. } else {
  2339. self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2) - 1 }
  2340. self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeLast].boxStyle.width - 10 }
  2341. }
  2342. }
  2343. }
  2344. }
  2345. self.openItem = function (obj) {
  2346. window.open(obj.url)
  2347. }
  2348. self.closeItem = function (n) {
  2349. self.iframeList.splice(n, 1)
  2350. self.changeSize(1)
  2351. }
  2352. self.reSize = function (n) {
  2353. $timeout(function () {
  2354. var leftbox = document.getElementsByClassName("iframe-item")[n];
  2355. var rightbox;
  2356. var line = document.getElementsByClassName("iframe-border-right")[n];
  2357. document.getElementsByClassName("iframe-border-right")[n].addEventListener("mousedown", function (event) {
  2358. for (var i = n + 1; i < self.iframeList.length; i++) {
  2359. if (self.iframeList[i].show == 1) {
  2360. rightbox = document.getElementsByClassName("iframe-item")[i];
  2361. break
  2362. }
  2363. }
  2364. $(".mousemove").show()
  2365. var leftboxW = leftbox.style.width.slice(0, leftbox.style.width.length - 2);
  2366. var rightboxW = rightbox.style.width.slice(0, rightbox.style.width.length - 2);
  2367. var x = event.pageX - (line.offsetLeft - leftboxW) - 10;
  2368. document.addEventListener("mousemove", boxMove)
  2369. function boxMove(event) {
  2370. if (leftboxW * 1 + (event.pageX - x) * 1 <= 36) {
  2371. //leftbox.children[0].style.display = "none"
  2372. self.hideItem(n)
  2373. } else if (rightboxW * 1 - (event.pageX - x) * 1 <= 5) {
  2374. //rightbox.children[0].style.display = "none"
  2375. self.hideItem(i)
  2376. } else {
  2377. leftbox.children[0].style.display = "block"
  2378. leftbox.style.width = leftboxW * 1 + (event.pageX - x) * 1 + "px";
  2379. leftbox.getElementsByTagName("iframe")[0].style.width = leftboxW * 1 + (event.pageX - x) * 1 + "px";
  2380. self.iframeList[n].boxStyle.width = leftboxW * 1 + (event.pageX - x) * 1;
  2381. self.iframeList[n].iframeStyle.width = leftboxW * 1 + (event.pageX - x) * 1 - 10;
  2382. rightbox.children[0].style.display = "block"
  2383. rightbox.style.width = rightboxW * 1 - (event.pageX - x) * 1 + "px";
  2384. rightbox.getElementsByTagName("iframe")[0].style.width = rightboxW * 1 - (event.pageX - x) * 1 - 10 + "px";
  2385. self.iframeList[i].boxStyle.width = rightboxW * 1 - (event.pageX - x) * 1;
  2386. self.iframeList[i].iframeStyle.width = rightboxW * 1 - (event.pageX - x) * 1 - 10;
  2387. }
  2388. }
  2389. document.addEventListener("mouseup", function () {
  2390. $(".mousemove").hide()
  2391. $scope.$apply();
  2392. document.removeEventListener("mousemove", boxMove)
  2393. })
  2394. })
  2395. }, 1)
  2396. }
  2397. self.reSizeLR = function (n) {
  2398. var leftbox = document.getElementsByClassName("page-item")[n - 1];
  2399. var rightbox = document.getElementsByClassName("page-item")[n];
  2400. var line = document.getElementsByClassName("left-right")[n - 1];
  2401. document.getElementsByClassName("left-right")[n - 1].addEventListener("mousedown", function (event) {
  2402. $(".mousemove").show()
  2403. var leftboxW = leftbox.clientWidth;
  2404. var rightboxW = rightbox.clientWidth;
  2405. var x = event.pageX - line.offsetLeft;
  2406. document.addEventListener("mousemove", boxMove)
  2407. function boxMove(event) {
  2408. if (leftboxW * 1 + (event.pageX - x) * 1 <= 200) {
  2409. } else if (rightboxW * 1 - (event.pageX - x) * 1 <= 200) {
  2410. } else {
  2411. leftbox.style.width = leftboxW * 1 + (event.pageX - x) * 1 + "px";
  2412. rightbox.style.width = rightboxW * 1 - (event.pageX - x) * 1 + "px";
  2413. $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2414. $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2415. $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2416. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2417. $scope.changeSize()
  2418. }
  2419. }
  2420. document.addEventListener("mouseup", function () {
  2421. $(".mousemove").hide()
  2422. document.removeEventListener("mousemove", boxMove)
  2423. })
  2424. })
  2425. }
  2426. /*右侧formedit折叠*/self.formeditList = [];
  2427. self.hideFormedit = function (num, title) {
  2428. $(".formedit" + num).hide();
  2429. $(".formedit" + num).siblings().css("width", $(".formedit" + num).width() - (self.iframeHide == self.iframeList.length ? 18 : 36));
  2430. self.formeditList.push({ index: num, title: title });
  2431. if (self.iframeHide == self.iframeList.length) {
  2432. if (self.formeditList.length == 2) {
  2433. $(".formedit" + num).siblings().each(function () {
  2434. if ($(this).is(":hidden") == false) {
  2435. if ($(this).is(":hidden") == false) {
  2436. $(this).width("calc(100% - 46px)")
  2437. }
  2438. }
  2439. })
  2440. }
  2441. self.seeGLJ()
  2442. } else {
  2443. if (self.formeditList.length == 2) {
  2444. $(".formedit" + num).siblings().each(function () {
  2445. if ($(this).is(":hidden") == false) {
  2446. if ($(this).is(":hidden") == false) {
  2447. $(this).width("calc(100% - 36px)")
  2448. }
  2449. }
  2450. })
  2451. }
  2452. if ($(".formedit1").find("iframe").attr("src") == "") {
  2453. self.seeGCG()
  2454. } else {
  2455. self.seeGLJ()
  2456. }
  2457. }
  2458. $("#rightList").css("margin-left", 0)
  2459. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2460. }
  2461. self.showFormedit = function (num, obj) {
  2462. $(".formedit" + obj.index).show();
  2463. self.formeditList.splice(num, 1);
  2464. if (self.iframeHide == self.iframeList.length) {
  2465. if (self.formeditList.length == 2) {
  2466. $(".formedit" + obj.index).width("calc(100% - 46px)")
  2467. $("#rightList").css("margin-left", 0)
  2468. } else if (self.formeditList.length == 1) {
  2469. $(".formedit" + obj.index).width(($(".rightBox").width() - 36) / 2)
  2470. $(".formedit" + obj.index).siblings().width(($(".rightBox").width() - 36) / 2)
  2471. $("#rightList").css("margin-left", 0)
  2472. } else {
  2473. $(".formedit" + obj.index).width($(".rightBox").width() / 2)
  2474. $(".formedit" + obj.index).siblings().width($(".rightBox").width() / 2)
  2475. $("#rightList").css("margin-left", obj.index == "" ? 0 : (obj.index - 1) * $(".formedit" + obj.index).width() * -1)
  2476. }
  2477. } else {
  2478. if (self.formeditList.length > 0) {
  2479. $(".formedit" + obj.index).width($(".rightBox").width() - 36)
  2480. $(".formedit" + obj.index).siblings().width($(".rightBox").width() - 36)
  2481. } else {
  2482. $(".formedit" + obj.index).width($(".rightBox").width())
  2483. $(".formedit" + obj.index).siblings().width($(".rightBox").width())
  2484. }
  2485. $("#rightList").css("margin-left", obj.index == "" ? 0 : obj.index * $(".formedit" + obj.index).width() * -1)
  2486. }
  2487. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2488. }
  2489. self.formeditSize = function () {
  2490. if (self.iframeHide == self.iframeList.length) {
  2491. if (self.formeditList.length == 2) {
  2492. $("#rightList").children().each(function () {
  2493. if ($(this).is(":hidden") == false) {
  2494. $(this).css("width", "calc(100% - 36px)")
  2495. }
  2496. })
  2497. } else if (self.formeditList.length == 1) {
  2498. $("#rightList").children().each(function () {
  2499. $(this).width(($(".rightBox").width() - 36) / 2)
  2500. })
  2501. }
  2502. } else {
  2503. if (self.formeditList.length > 0) {
  2504. $("#rightList").children().each(function () {
  2505. $(this).width($(".rightBox").width() - 36)
  2506. })
  2507. }
  2508. }
  2509. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2510. }
  2511. self.getMeetMsg = function () {
  2512. var data = {
  2513. routeid: self.routeid,
  2514. routeinfoid: self.routeinfoid
  2515. }
  2516. $http.post(apiurljs.login + "g2work/meetcoop/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  2517. .success(function (obj) {
  2518. var res = strToJson(s4.decryptData_CBC(obj.data));
  2519. self.meetList = res.data;
  2520. self.meetNum = 0;
  2521. self.meetList.forEach(function (item) {
  2522. self.meetNum++
  2523. item.FILES.forEach(function (item1) {
  2524. self.meetNum++
  2525. item1.WATCHLIMIT = sp.format(item1.WATCHLIMIT);
  2526. })
  2527. })
  2528. //self.getNumMeet()
  2529. })
  2530. }
  2531. self.getNumMeet = function () {
  2532. var data = {
  2533. routeinfoid: self.routeinfoid
  2534. }
  2535. $http.post(apiurljs.login + "g2work/meetcoop/queryDataListCount", data, postCfg)
  2536. .success(function (obj) {
  2537. var res = strToJson(s4.decryptData_CBC(obj.data));
  2538. if (res.data != self.meetNum) {
  2539. self.getMeetMsg()
  2540. }
  2541. })
  2542. }
  2543. self.Meeting = function () {
  2544. $http.post(apiurljs.login + "g2app/dataabase/getDpList", { data: s4.encryptData_CBC("") }, postCfg)
  2545. .success(function (obj) {
  2546. var res = strToJson(s4.decryptData_CBC(obj.data));
  2547. self.dpList = res.data;
  2548. self.dpList1 = [];
  2549. self.dpList.forEach(function (item) {
  2550. self.dpList1.push(item)
  2551. item.USER.forEach(function (item1) {
  2552. item1.show = true;
  2553. })
  2554. })
  2555. self.activeDep = 0;
  2556. self.userList = self.dpList1[0].USER;
  2557. self.meetUser = [];
  2558. sp.layer("#meet")
  2559. })
  2560. }
  2561. self.searchName = "";
  2562. self.searchPerson = function () {
  2563. self.dpList1 = [];
  2564. self.dpList.forEach(function (item) {
  2565. if (item.DEP.indexOf(self.searchName) > -1) {
  2566. self.dpList1.push(item)
  2567. }
  2568. })
  2569. self.activeDep = 0;
  2570. self.userList = self.dpList1[0].USER;
  2571. }
  2572. self.addmeet = function () {
  2573. self.dpList.forEach(function (item) {
  2574. item.USER.forEach(function (item1) {
  2575. if (item1.checked == true && item1.show == true) {
  2576. self.meetUser.push(item1);
  2577. item1.checked = false;
  2578. item1.show = false;
  2579. }
  2580. })
  2581. })
  2582. }
  2583. self.delmeet = function () {
  2584. self.meetUser.forEach(function (item) {
  2585. if (item.checked == true) {
  2586. item.checked = false;
  2587. item.show = true;
  2588. }
  2589. })
  2590. self.meetUser = self.meetUser.filter(function (item) {
  2591. return item.show == false;
  2592. })
  2593. }
  2594. self.joinMeet = function () {
  2595. var data = {
  2596. tablename: "FW_HYJY",
  2597. colums: "*",
  2598. order: "ID desc",
  2599. sqlwhere: { ROUTEINFOID: self.routeinfoid },
  2600. sqlinwhere: "",
  2601. sqllikewhere: ""
  2602. }
  2603. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  2604. .success(function (obj) {
  2605. var res = strToJson(s4.decryptData_CBC(obj.data));
  2606. var data1 = {
  2607. routeid: self.routeid,
  2608. routeinfoid: self.routeinfoid,
  2609. cman: self.userId,
  2610. cname: res.data[0].BT + "—共享沟通",
  2611. userids: self.meetUser.map(function (item) {
  2612. return item.USERID
  2613. }).join(",")
  2614. }
  2615. $http.post(apiurljs.login + "g2work/meetcoop/createMeetcoop", data1, postCfg)
  2616. .success(function (res1) {
  2617. sp.layerhide()
  2618. if (res1.success == true) {
  2619. self.getMeetMsg()
  2620. } else {
  2621. sp.dialog(res1.message)
  2622. }
  2623. })
  2624. })
  2625. }
  2626. self.updateCname = function (item) {
  2627. self.meeting = {
  2628. type: 1,
  2629. updateTitle: "修改会议标题",
  2630. meetid: item.MEETID,
  2631. cname: item.CNAME
  2632. }
  2633. sp.layer("#meetUpdate")
  2634. }
  2635. self.deleteMeet = function (meet) {
  2636. var data = {
  2637. meetid: meet.MEETID
  2638. }
  2639. $http.post(apiurljs.login + "g2work/meetcoop/deleteDataByID", data, postCfg)
  2640. .success(function (res) {
  2641. if (res.success == true) {
  2642. $.each(self.iframeList, function (index, item) {
  2643. $.each(meet.FILES, function (index1, item1) {
  2644. if (item.title == item1.WATCHLIMIT && item.source == item1.FILEURL) {
  2645. self.closeItem(index1)
  2646. }
  2647. })
  2648. })
  2649. self.getMeetMsg()
  2650. } else {
  2651. sp.dialog(res.message)
  2652. }
  2653. })
  2654. }
  2655. self.updateWatchlimit = function (item) {
  2656. self.meeting = {
  2657. type: 2,
  2658. updateTitle: "修改查看时限",
  2659. fileid: item.FILEID,
  2660. watchlimit: item.WATCHLIMIT
  2661. }
  2662. sp.layer("#meetUpdate")
  2663. }
  2664. self.deleteMFile = function (mfile) {
  2665. var data = {
  2666. fileid: mfile.MEETID
  2667. }
  2668. $http.post(apiurljs.login + "g2work/meetcoop/deleteDataFilesByFileID", data, postCfg)
  2669. .success(function (res) {
  2670. if (res.success == true) {
  2671. $.each(self.iframeList, function (index, item) {
  2672. if (item.title == mfile.WATCHLIMIT && item.source == mfile.FILEURL) {
  2673. self.closeItem(index)
  2674. }
  2675. })
  2676. self.getMeetMsg()
  2677. } else {
  2678. sp.dialog(res.message)
  2679. }
  2680. })
  2681. }
  2682. self.meetUpdate = function () {
  2683. if (self.meeting.type == 1) {
  2684. var data = {
  2685. meetid: self.meeting.meetid,
  2686. cname: self.meeting.cname
  2687. }
  2688. $http.post(apiurljs.login + "g2work/meetcoop/updateCnameByID", data, postCfg)
  2689. .success(function (res) {
  2690. sp.layerhide()
  2691. if (res.success == true) {
  2692. self.getMeetMsg()
  2693. } else {
  2694. sp.dialog(res.message)
  2695. }
  2696. })
  2697. } else {
  2698. var data = {
  2699. fileid: self.meeting.fileid,
  2700. watchlimit: self.meeting.watchlimit
  2701. }
  2702. $http.post(apiurljs.login + "g2work/meetcoop/updateWatchlimitByFileID", data, postCfg)
  2703. .success(function (res) {
  2704. sp.layerhide()
  2705. if (res.success == true) {
  2706. self.getMeetMsg()
  2707. } else {
  2708. sp.dialog(res.message)
  2709. }
  2710. })
  2711. }
  2712. }
  2713. ////头部关键字搜索---20230905
  2714. self.headBtnSearchKeyword = "";
  2715. self.headSearchResult = [];
  2716. self.headSearchResult_view = false;
  2717. self.headBtnSearch = function () {
  2718. if (sp.isval(self.headBtnSearchKeyword)) {
  2719. self.headSearchResult = [];
  2720. var data = {
  2721. "url": "/basic/api/StatSelect/selectCodeList",
  2722. "data": { "keyWord": self.headBtnSearchKeyword }
  2723. }
  2724. $http.post(apiurljs.login + "g2app/yizhangtu/selectCodeList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  2725. .success(function (obj) {
  2726. var res = strToJson(s4.decryptData_CBC(obj.data));
  2727. self.headSearchResult = res.data.build;
  2728. if (sp.isval(self.headSearchResult)) {
  2729. self.headSearchResult_view = true;
  2730. } else {
  2731. self.headSearchResult_view = false;
  2732. }
  2733. })
  2734. } else {
  2735. self.headSearchResult_view = false;
  2736. }
  2737. };
  2738. self.headKeywordPage = function (itemdata) {
  2739. var get_token = localStorage.getItem("main-token");
  2740. var set_url = apiurljs.onePic + "wholeProcessPage/?token=" + get_token + "&name=" + itemdata.name + "&type=" + itemdata.type + "&id=" + itemdata.id;
  2741. self.addItem(set_url, set_url, '一张图', false);
  2742. self.headSearchResult_view = false;
  2743. };
  2744. self.onePic = function () {
  2745. self.addItem(apiurljs.onePic + "wholeProcessPage/?token=" + localStorage.getItem("main-token"), apiurljs.onePic + "wholeProcessPage/?token=" + localStorage.getItem("main-token"), "地图搜索", false)
  2746. }
  2747. $scope.changeSize = function (n) {
  2748. self.changeSize(2)
  2749. if (n == 1) {
  2750. $scope.$apply();
  2751. }
  2752. }
  2753. $scope.openOptionList1 = function () {
  2754. $timeout(function () {
  2755. self.openOptionList1()
  2756. })
  2757. }
  2758. $scope.closeToggle = function () {
  2759. $timeout(function () {
  2760. self.opinion.nulla = false;
  2761. self.activeOpinion = null;
  2762. })
  2763. }
  2764. $scope.refreshGLJ = function (n) {
  2765. if (n == 1) {
  2766. self.getGLJ(2)
  2767. } else {
  2768. self.getGLFLOW()
  2769. }
  2770. }
  2771. //头部下滚冻结
  2772. $(function () {
  2773. //页面高度撑满
  2774. setTimeout(function () {
  2775. $(".rightBox").css("height", $(window).height() - 115)
  2776. $(".mousemove").css("top", 0).css("left", 0).css("width", $(window).width()).css("height", $(window).height() - 10)
  2777. if (self.lastrouteinfoid == 0) {
  2778. $(".rightBox").css("width", $(window).width())
  2779. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2780. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2781. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2782. } else {
  2783. $(".rightBox").css("width", "50%")
  2784. $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2785. $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2786. $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2787. }
  2788. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2789. }, 1)
  2790. $(window).resize(function () {
  2791. $(".rightBox").css("height", $(window).height() - 115)
  2792. $(".mousemove").css("top", 0).css("left", 0).css("width", $(window).width()).css("height", $(window).height() - 10)
  2793. if (self.iframeList.length == 0) {
  2794. $(".rightBox").css("width", $(window).width())
  2795. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2796. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2797. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2798. self.formeditSize()
  2799. } else if (self.iframeList.length > 0 && self.iframeHide == self.iframeList.length) {
  2800. $(".rightBox").css("width", "calc(100% - 36px)")
  2801. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2802. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2803. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2804. self.formeditSize()
  2805. } else {
  2806. $(".rightBox").css("width", "50%")
  2807. $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2808. $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2809. $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2810. self.formeditSize()
  2811. }
  2812. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2813. if (self.iframeList.length > 0) {
  2814. $("#iframeList").css("height", $(window).height() - 115)
  2815. if (self.iframeList.length == 1) {
  2816. self.iframeList[0].boxStyle = { width: $(".leftBox").width() }
  2817. self.iframeList[0].iframeStyle = { width: $(".leftBox").width() - 10 }
  2818. } else {
  2819. self.iframeList.forEach(function (item) {
  2820. item.boxStyle = { width: Math.trunc($(".leftBox").width() / 2 / (self.iframeList.length - 1)) }
  2821. item.iframeStyle = { width: item.boxStyle.width - 10 }
  2822. })
  2823. self.iframeList[self.iframeList.length - 1].boxStyle = { width: Math.trunc($(".leftBox").width() / 2) - 1 }
  2824. self.iframeList[self.iframeList.length - 1].iframeStyle = { width: self.iframeList[self.iframeList.length - 1].boxStyle.width - 10 }
  2825. }
  2826. $scope.$apply();
  2827. }
  2828. })
  2829. })
  2830. }])
  2831. app.directive("repeatFinish", function () {
  2832. return {
  2833. link: function (scope) {
  2834. if (scope.$last == true) {
  2835. $("#iframeList").css("height", $(window).height() - 115)
  2836. }
  2837. }
  2838. };
  2839. });
  2840. app.directive("spCheckboxBlueItem", function () {
  2841. return {
  2842. restrict: "A",
  2843. link: function (scope, elem, attrs) {
  2844. if (!scope == false) {
  2845. spng.funcheckbox(elem, "chb-blue", "chb-blue-checked"); //蓝色checkbox
  2846. }
  2847. }
  2848. }
  2849. });
  2850. app.filter('trustHtml', function ($sce) {
  2851. return function (input) {
  2852. return $sce.trustAsHtml(input.replace(/\n/g, '<br/>').replace(/\s/g, '&nbsp;'));
  2853. };
  2854. });
  2855. //canvas画布签字
  2856. function lineCanvas(obj) {
  2857. var self = this;
  2858. self.linewidth = 1;
  2859. self.color = "#000000";
  2860. self.background = "#ffffff";
  2861. self.canvas = document.createElement("canvas");
  2862. document.getElementById(obj).appendChild(self.canvas);
  2863. self.cxt = self.canvas.getContext("2d");
  2864. self.canvas.width = document.getElementById(obj).clientWidth;
  2865. self.canvas.height = document.getElementById(obj).scrollHeight;
  2866. self.cxt.fillStyle = self.background;
  2867. self.cxt.fillRect(0, 0, self.canvas.width, self.canvas.width);
  2868. self.cxt.strokeStyle = self.color;
  2869. self.cxt.lineWidth = self.linewidth;
  2870. self.cxt.lineCap = "round";
  2871. //开始绘制
  2872. self.canvas.addEventListener("mousedown", function (e) {
  2873. self.cxt.beginPath();
  2874. self.cxt.lineTo(e.pageX - $(".formedit .sp-page-center").offset().left - 52, e.pageY - document.getElementById(obj).offsetTop + $(".formedit").scrollTop() - 95);
  2875. self.canvas.addEventListener("mousemove", move)
  2876. }.bind(self), false);
  2877. //绘制中
  2878. function move() {
  2879. var e = window.event;
  2880. self.cxt.lineTo(e.pageX - $(".formedit .sp-page-center").offset().left - 52, e.pageY - document.getElementById(obj).offsetTop + $(".formedit").scrollTop() - 95);
  2881. self.cxt.stroke();
  2882. }
  2883. //结束绘制
  2884. self.canvas.addEventListener("mouseup", up)
  2885. function up() {
  2886. self.cxt.closePath();
  2887. self.canvas.removeEventListener("mousemove", move)
  2888. }
  2889. };
  2890. function showRightBox() {
  2891. $(".leftBox").css("width", "50%");
  2892. $(".rightBox").css("width", "50%")
  2893. $(".rightBox").show();
  2894. $("#rightList").show();
  2895. $(".border-left-right").show()
  2896. $(".border-left-right").prev().show()
  2897. $(".border-left-right").prev().find(".fa-angle-right").show()
  2898. $(".border-left-right").prev().find(".fa-angle-left").hide()
  2899. if ($("#rightList").prev().is(":hidden") == true) {
  2900. $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2901. $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2902. $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2903. } else {
  2904. $(".formedit").css("width", $(".rightBox").width() - 36).css("height", $(".rightBox").height())
  2905. $(".formedit1").css("width", $(".rightBox").width() - 36).css("height", $(".rightBox").height())
  2906. $(".formedit2").css("width", $(".rightBox").width() - 36).css("height", $(".rightBox").height())
  2907. }
  2908. angular.element(document.getElementById("app")).scope().changeSize(2)
  2909. }
  2910. function showRight(e) {
  2911. if ($(e).children(".fa-angle-left").is(":hidden")) {
  2912. $(".leftBox").css("width", "calc(100% - 15px)");
  2913. $(".rightBox").css("width", "15px");
  2914. $(e).siblings().hide()
  2915. $(e).children(".fa-angle-left").show()
  2916. $(e).children(".fa-angle-right").hide()
  2917. } else {
  2918. $(".leftBox").css("width", "50%");
  2919. $(".rightBox").css("width", "50%");
  2920. $(e).siblings().show()
  2921. $(e).children(".fa-angle-left").hide()
  2922. $(e).children(".fa-angle-right").show()
  2923. }
  2924. angular.element(document.getElementById("app")).scope().changeSize(1)
  2925. }
  2926. function showToggle(e) {
  2927. document.getElementById("selectDiv").style.top = e.style.top;
  2928. //document.getElementById("selectDiv").toggle();
  2929. $(e).children().toggle()
  2930. $(e).next().toggle()
  2931. }
  2932. function toggleYJL(e) {
  2933. if ($(e).children(".fa-angle-double-down").is(":hidden") == true) {
  2934. $(e).parent().css("height", 420)
  2935. angular.element(document.getElementById("app")).scope().openOptionList1()
  2936. } else {
  2937. $(e).parent().css("height", 10)
  2938. angular.element(document.getElementById("app")).scope().closeToggle()
  2939. }
  2940. $(e).children().toggle()
  2941. }
  2942. function toggleForm(e) {
  2943. $(e).children().toggle()
  2944. $(".toggleForm").toggle()
  2945. }
  2946. function refreshGLJ(n) {
  2947. angular.element(document.getElementById("app")).scope().refreshGLJ(n)
  2948. }
  2949. //文字不可被选中
  2950. document.body.onselectstart = function () {
  2951. return false;
  2952. }