formeditFL.js 142 KB

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