formeditFL.js 133 KB

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