formeditFL.js 132 KB

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