1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148 |
- 'use strict';
- var app = angular.module('app', [
- ]);
- app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$interval", "$sce", function ($scope, $http, $timeout, $interval, $sce) {
- var self = this;
- var s4 = new SM4Util();
- self.userId = $.cookie("GlWorkPlatform-userid");
- self.userName = $.cookie("GlWorkPlatform-chineseName");
- self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
- self.routeid = sp.getUrlName("routeid");
- self.routeinfoid = sp.getUrlName("routeinfoid");
- self.lastrouteinfoid = sp.getUrlName("lastrouteinfoid");
- self.copyrightid = sp.getUrlName("copyrightid");
- self.directionid = sp.getUrlName("directionid");
- self.formeditid = sp.getUrlName("formeditid");
- self.mbid = sp.getUrlName("mbid");
- self.fjid = sp.getUrlName("fjid");
- self.docmode = sp.getUrlName("docmode");
- self.gkbutton = sp.getUrlName("gkbutton")
- self.dotype = sp.getUrlName("dotype");
- self.get_lastReturnPageno = sp.getUrlName("lastReturnPageno");
- self.get_lastReturnPage = sp.getUrlName("lastReturnPage");
- self.get_type = sp.getUrlName("type");
- self.return = "../list.html?lastReturnPageno=" + self.get_lastReturnPageno + "&type=" + self.get_type
- self.deviceType = localStorage.getItem("tjJxtGoldenlinkWork-deviceType");
- if (self.deviceType != "pad") {
- self.photo = $.cookie("GlWorkPlatform-photo").indexOf("AFrontEnd") > -1 ? "../../../" + $.cookie("GlWorkPlatform-photo") : $.cookie("GlWorkPlatform-photo");
- }
- var postCfg = {
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + self.get_AccessToken
- }
- };
- self.FormTitle = $.cookie("GlWorkPlatform-SYSNAME");
- //初始化右上角按钮
- self.buttonList = []
- var uploadformat = strToJson(s4.decryptData_CBC(apiurljs.uploadformat)).data.map(function (item) {
- return item.CNAME
- })
- self.upload_zw = function () {
- self.newMoBanFlag = true;
- if (self.gaoTypeArrayFirst.length > 0) {
- var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
- var dialogBody = "<div class=\"sp-dialog-body\">您确定要覆盖正文吗?</div>";
- 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>";
- $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
- sp.openCenter(".sp-dialog");
- ///取消按钮
- $('.sp-closeDialog').click(function (event) {
- sp.closeCenter(".sp-dialog");
- event.preventDefault();
- event.stopPropagation();
- });
- //post消息的id
- $("#delDataTrue").click(function () {
- sp.closeCenter(".sp-dialog");
- $('#fileupload-zw').fileupload({
- url: apiurljs.login + 'g2app/fawenfiles/uploadFileWithForm',
- dataType: 'json',
- beforeSend: function (xhr, data) {
- xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
- xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=FAWEN_FILES,routeinfoid=" + self.routeinfoid + ",gwtype=" + self.data.GWZL + ",dockind=D01"));
- },
- add: function (e, data) {
- var num = 0;
- var acceptFileTypes = eval('/(' + apiurljs.zwType.join("|") + ')$/i')
- //文件类型判断
- $.each(data.originalFiles, function (index, item) {
- if (item['type'].length > 0 && !acceptFileTypes.test(item['name'])) {
- sp.dialog("您好,请上传" + apiurljs.zwType.join("/") + "格式的文件!");
- return;
- } else {
- num++
- }
- })
- if (num == data.originalFiles.length) {
- self.uploading_zw = true;
- data.submit();
- $scope.$apply();
- }
- },
- // 上传完成后的执行逻辑
- done: function (e, data) {
- self.uploading_zw = false;
- self.newMoBanFlag = false;
- self.getGCG(1)
- }
- })
- $timeout(function () {
- $("#fileupload-zw").trigger("click")
- }, 1)
- })
- } else {
- $('#fileupload-zw').fileupload({
- url: apiurljs.login + 'g2app/fawenfiles/uploadFileWithForm',
- dataType: 'json',
- beforeSend: function (xhr, data) {
- xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
- xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=FAWEN_FILES,routeinfoid=" + self.routeinfoid + ",gwtype=" + self.data.GWZL + ",dockind=D01"));
- },
- add: function (e, data) {
- var num = 0;
- var acceptFileTypes = eval('/(' + apiurljs.zwType.join("|") + ')$/i')
- //文件类型判断
- $.each(data.originalFiles, function (index, item) {
- if (item['type'].length > 0 && !acceptFileTypes.test(item['name'])) {
- sp.dialog("您好,请上传" + apiurljs.zwType.join("/") + "格式的文件!");
- return;
- } else {
- num++
- }
- })
- if (num == data.originalFiles.length) {
- self.uploading_zw = true;
- data.submit();
- $scope.$apply();
- }
- },
- // 上传完成后的执行逻辑
- done: function (e, data) {
- self.uploading_zw = false;
- self.newMoBanFlag = false;
- self.getGCG(1)
- }
- })
- $timeout(function () {
- $("#fileupload-zw").trigger("click")
- }, 1)
- }
- }
- //上层附件、业务参考、共享沟通组件
- self.uploading = false;
- self.upload = function () {
- $('#fileupload').fileupload({
- url: apiurljs.login + 'g2app/abase/uploadFileWithForm',
- dataType: 'json',
- beforeSend: function (xhr, data) {
- xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
- //xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("copyrightid=" + self.copyrightid + ",directionid=" + self.directionid + ",formeditid=" + self.formeditid + ",routeinfoid=" + self.routeinfoid + ",routeid=" + self.routeid + ",tablename=FILE_ATTACH,ATTACHTYPE=专报,data=[{\"ZT\":\"" + self.data.ZT + "\"}]"));
- xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=FILE_ATTACH,routeinfoid=" + self.routeinfoid + ",ATTACHTYPE=党委正式文(上行文)"));
- },
- add: function (e, data) {
- var num = 0;
- var acceptFileTypes = eval('/(' + uploadformat.join("|") + ')$/i')
- //文件类型判断
- $.each(data.originalFiles, function (index, item) {
- if (item['type'].length > 0 && !acceptFileTypes.test(item['name'])) {
- sp.dialog("您好,请上传" + uploadformat.join("/") + "格式的文件!");
- return;
- } else {
- num++
- }
- })
- if (num == data.originalFiles.length) {
- self.uploading = true;
- data.submit();
- $scope.$apply();
- }
- },
- // 上传完成后的执行逻辑
- done: function (e, data) {
- self.uploading = false;
- self.getOther()
- }
- })
- }
- self.downLoad = function (item) {
- window.open(apiurljs.login + "g2work/files/" + item.FILEURL.slice(7))
- }
- self.deleteFile = function (file) {
- var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
- var dialogBody = "<div class=\"sp-dialog-body\">删除后不可恢复,您确认要删除吗?</div>";
- 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>";
- $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
- sp.openCenter(".sp-dialog");
- ///取消按钮
- $('.sp-closeDialog').click(function (event) {
- sp.closeCenter(".sp-dialog");
- event.preventDefault();
- event.stopPropagation();
- });
- //post消息的id
- $("#delDataTrue").click(function () {
- var data = {
- tablename: "FILE_ATTACH",
- id: file.ID
- };
- $http.post(apiurljs.login + "g2app/dataabase/delDataById", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- sp.dialoghide();
- if (res.success) {
- $.each(self.iframeList, function (index, item) {
- if (item.title == file.FILENAMES && item.source == apiurljs.login + "g2work/files2/inline/" + file.FILEURL.slice(7)) {
- self.closeItem(index);
- return false;
- }
- })
- self.getOther();
- } else {
- sp.dialog("删除失败,请联系管理员!");
- }
- });
- });
- }
- self.creatFLOW = function (file) {
- var data = {
- copyrightid: self.copyrightid,
- directionid: self.directionid,
- routeinfoid: self.routeinfoid,
- userid: self.userId,
- relateid: file.ID
- }
- $http.post(apiurljs.login + "g2app/fawenfiles/createNewWorkFlowWithGwtype", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- sp.dialoghide();
- if (res.success) {
- self.getGLFLOW();
- } else {
- sp.dialog("删除失败,请联系管理员!");
- }
- });
- }
- self.deleteWG = function (file) {
- var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
- var dialogBody = "<div class=\"sp-dialog-body\">删除后不可恢复,您确认要删除吗?</div>";
- 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>";
- $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
-
- sp.openCenter(".sp-dialog");
-
- ///取消按钮
- $('.sp-closeDialog').click(function (event) {
- sp.closeCenter(".sp-dialog");
- event.preventDefault();
- event.stopPropagation();
- });
- //post消息的id
- $("#delDataTrue").click(function () {
- var data = {
- id: file.ID
- };
- $http.post(apiurljs.login + "g2app/fawenfilesrelate/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- sp.dialoghide();
- if (res.success) {
- $.each(self.iframeList, function (index, item) {
- if (item.title == file.FILENAMES && item.source == apiurljs.login.split("glwork/")[0] + "glworkweb/" + file.FILEURL) {
- self.closeItem(index);
- return false;
- }
- })
- self.getGLJ(1);
- } else {
- sp.dialog("删除失败,请联系管理员!");
- }
- });
- });
- }
- self.openGL = function (item) {
- var data = {
- tablename: "SYS_DESKTOP_PLUGIN_TODO",
- colums: "*",
- order: "SORTID",
- sqlwhere: "",
- sqlorwhere: "",
- sqlinwhere: "",
- sqllikewhere: { FLOWID: item.FLOWID }
- }
- $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- sp.openNewWindow("../../" + res.data[0].FILEN.split("/")[1] + "/" + item.FILEN + "&flowid=" + item.FLOWID + "&dotype=1", item.TITLE)
- });
- }
- self.downLoaDWG = function (item) {
- if (item.FILEURL.indexOf("files") > -1) {
- window.open(apiurljs.login + "g2work/files/" + item.FILEURL.slice(7))
- } else {
- window.open(apiurljs.login.split("glwork/")[0] + "glworkweb/" + item.FILEURL)
- }
- }
- self.readonly = {
- JJLB: true,
- WZYFZTZSQ: true,
- FGLDYJ: true,
- ZBBMQCR: true,
- NGRQ: true,
- GWZL:true,
- ZBBMFZRSH:true,
- HGXSH:true,
- HQBMFZRSH:true,
- FWBT:true,
- FWZH:true,
- YF: true,
- BGSCHYJ: false,
- BGSFHYJ: true,
- ZTC: true,
- ZS:true,
- CS:true,
- USAGE: false
- }
- self.show = {
- JJLB: true,
- WZYFZTZSQ: true,
- FGLDYJ: true,
- ZBBMQCR: true,
- NGRQ: true,
- GWZL: true,
- ZBBMFZRSH: true,
- HGXSH: true,
- HQBMFZRSH: true,
- FWBT: true,
- FWZH: true,
- YF: true,
- BGSCHYJ: false,
- BGSFHYJ: true,
- ZTC: true,
- ZS: true,
- CS: true,
- USAGE: false
- }
- self.type = 1;
- self.getSwenList = function (n) {
- self.SwenList = [];
- var data = {
- directionid: self.directionid,
- userid: self.userId,
- routeinfoid: self.routeinfoid,
- routeid: self.routeid,
- formeditid: ""
- }
- $http.post(apiurljs.login + "g2app/abase/queryDataLink", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (self.copyrightid == "") {
- self.copyrightid = res.data.LINKS[0].COPYRIGHTID
- }
- $.each(res.data.LINKS, function (index, item) {
- item.TEMPFORM = item.TEMPFORM + "&flowid=" + sp.getUrlName("flowid")
- if (item.TEMPFORM.indexOf("?docmode") > 0) {
- if (item.TEMPFORM.indexOf("attachlist") > -1 || item.TEMPFORM.indexOf("fawenfile") > -1) {
- item.TEMPFORM = item.TEMPFORM + "&dotype=" + self.dotype + "&type=" + self.get_type + "&lastReturnPageno=" + self.get_lastReturnPageno + "&lastReturnPage=" + self.get_lastReturnPage;
- } else {
- item.TEMPFORM = "../" + item.TEMPFORM + "&dotype=" + self.dotype + "&type=" + self.get_type + "&lastReturnPageno=" + self.get_lastReturnPageno + "&lastReturnPage=" + self.get_lastReturnPage;
- }
- } else {
- item.TEMPFORM = "#";
- }
- self.SwenList.push(item)
- })
- self.SwenList.push({
- VNAME: "流程图",
- DIRECTIONID: self.SwenList[0].DIRECTIONID,
- TEMPFORM: "modeler_read.html?" + self.SwenList[0].TEMPFORM.split("?")[1]
- })
- if (n == 0) {
- self.getFLOW()
- } else {
- self.getData()
- }
- })
- }
- self.getSwenList(0)
- self.getFLOW = function () {
- var data = {
- copyrightid: self.copyrightid
- }
- $http.post(apiurljs.login + "g2work/flow/queryDataByCopyrightid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.flowTitle = res.data.CNAME;
- self.getJJLB()
- })
- }
- self.getJJLB = function () {
- var data = {
- ckey: "CODE_JJLB",
- routeinfoid: self.routeinfoid
- }
- $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.JJLB = res.data.CODE_JJLB;
- self.getGWZL()
- })
- }
- self.getGWZL = function () {
- var data = {
- tablename: "CODE_GWTYPE",
- colums: "ID,CODE,CNAME,FLOWID",
- order: "SORTID desc",
- sqlwhere: {
- USEMARK: 1,
- FLOWID: sp.getUrlName("flowid")
- },
- sqlinwhere: "",
- sqllikewhere: ""
- }
- $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- console.log(res.data)
- self.GWZL = res.data;
- self.getDpList()
- })
- }
-
- self.getDpList = function () {
- $http.post(apiurljs.login + "g2app/dataabase/getDpList", { data: s4.encryptData_CBC("") }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.dpList = res.data;
- self.dpList.forEach(function (item) {
- item.checked = false;
- item.USER.forEach(function (item1) {
- item1.checked = false;
- item1.USHOWNAME1 = item1.USHOWNAME.length > 3 ? item1.USHOWNAME.slice(0, 3) + "..." : item1.USHOWNAME;
- item1.USHOWNAME2 = item1.USHOWNAME.length > 10 ? item1.USHOWNAME.slice(0, 10) + "..." : item1.USHOWNAME
- })
- })
-
- self.AllChecked = { GKFW: false };
- self.UserLength = { GKFW: 0 };
- self.selectList = {};
-
- self.dpList.forEach(function (item) {
- item.checked = false;
- item.USER.forEach(function (item1) {
- self.UserLength.GKFW++
- })
- })
-
- self.UserList = {
- GKFW: JSON.parse(JSON.stringify(self.dpList))
- };
- self.getBGSFHYJ()
- })
- }
- self.getBGSFHYJ = function () {
- var data = {
- ckey: "CODE_BGSFHYJ",
- routeinfoid: self.routeinfoid
- }
- $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.BGSFHYJ = res.data.CODE_BGSFHYJ;
- self.getUSAGE()
- })
- }
- //标签
- self.getUSAGE = function () {
- var data = {
- ckey: "CODE_SHOUWENLABEL",
- routeinfoid: self.routeinfoid
- }
- $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.USAGE = res.data.CODE_SHOUWENLABEL;
- $.each(self.USAGE, function (index, item) {
- item.checked = false;
- })
- self.getDP()
- })
- }
- self.getDP = function () {
- var data = {
- userid: self.userId
- }
- $http.post(apiurljs.login + "g2app/richang/queryDpInfo", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.userDpName = res.data.length == 0 ? "" : res.data[0].SECTION;
- self.userDpCode = res.data.length == 0 ? "" : res.data[0].CODE;
- self.getData();
- })
- }
- //获取数据
- self.getData = function () {
- var data = {
- ckey: "FW_DWZSWSXW",
- id: 0,
- directionid: self.directionid,
- formeditid: self.formeditid,
- routeid: self.routeid,
- routeinfoid: self.routeinfoid
- }
- $http.post(apiurljs.login + "g2app/abase/queryData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.data = {
- ID: res.data.FW_DWZSWSXW.ID,
- APPCODE: res.data.FW_DWZSWSXW.APPCODE,
- JJLB: res.data.FW_DWZSWSXW.JJLB == "" ? self.JJLB[0].CODE : res.data.FW_DWZSWSXW.JJLB,
- GWZL: res.data.FW_DWZSWSXW.GWZL == "" ? self.GWZL[0].CODE : res.data.FW_DWZSWSXW.GWZL,
- ZBBMQCR: res.data.FW_DWZSWSXW.ZBBMQCR == "" ? self.userName : res.data.FW_DWZSWSXW.ZBBMQCR,
- BGSCHYJ: res.data.FW_DWZSWSXW.BGSCHYJ == "" ? self.BGSFHYJ[0].CODE : res.data.FW_DWZSWSXW.BGSCHYJ,
- BGSFHYJRY: res.data.FW_DWZSWSXW.BGSFHYJRY,
- BGSFHYJSJ: sp.format(res.data.FW_DWZSWSXW.BGSFHYJSJ),
- NGRQ: res.data.FW_DWZSWSXW.NGRQ == "" || res.data.FW_DWZSWSXW.NGRQ == null ? sp.format(sp.getLocalDate()) : sp.format(res.data.FW_DWZSWSXW.NGRQ),
- FWBT: res.data.FW_DWZSWSXW.FWBT,
- FWZH: res.data.FW_DWZSWSXW.FWZH,
- FWZH1: res.data.FW_DWZSWSXW.FWZH,
- YF: res.data.FW_DWZSWSXW.YF,
- ZTC: res.data.FW_DWZSWSXW.ZTC,
- ZS: res.data.FW_DWZSWSXW.ZS,
- CS: res.data.FW_DWZSWSXW.CS,
- NGRUSERID: res.data.FW_DWZSWSXW.NGRUSERID == "" ? self.userId : res.data.FW_DWZSWSXW.NGRUSERID,
- NGRBM: res.data.FW_DWZSWSXW.NGRBM == "" ? self.userDpName : res.data.FW_DWZSWSXW.NGRBM,
- NGRBMID: res.data.FW_DWZSWSXW.NGRBMID == "" ? self.userDpCode : res.data.FW_DWZSWSXW.NGRBMID,
- USAGE: res.data.FW_DWZSWSXW.USAGE ? res.data.FW_DWZSWSXW.USAGE : "",
- MQFMARK: res.data.FW_DWZSWSXW.MQFMARK
- }
- self.CHFHSJ = {
- BGSFHYJSJ: sp.format(res.data.FW_DWZSWSXW.BGSFHYJSJ)
- }
- self.readonly = {
- JJLB: res.data.FW_DWZSWSXW["JJLB.EREADONLY"] == "true",
- WZYFZTZSQ: res.data.FW_DWZSWSXW["WZYFZTZSQ.EREADONLY"] == "true",
- FGLDYJ: res.data.FW_DWZSWSXW["FGLDYJ.EREADONLY"] == "true",
- GWZL: res.data.FW_DWZSWSXW["GWZL.EREADONLY"] == "true",
- ZBBMQCR: res.data.FW_DWZSWSXW["ZBBMQCR.EREADONLY"] == "true",
- NGRQ: res.data.FW_DWZSWSXW["NGRQ.EREADONLY"] == "true",
- ZBBMFZRSH: res.data.FW_DWZSWSXW["ZBBMFZRSH.EREADONLY"] == "true",
- HGXSH: res.data.FW_DWZSWSXW["HGXSH.EREADONLY"] == "true",
- HQBMFZRSH: res.data.FW_DWZSWSXW["HQBMFZRSH.EREADONLY"] == "true",
- FWBT: res.data.FW_DWZSWSXW["FWBT.EREADONLY"] == "true",
- FWZH: res.data.FW_DWZSWSXW["FWZH.EREADONLY"] == "true",
- YF: res.data.FW_DWZSWSXW["YF.EREADONLY"] == "true",
- BGSCHYJ: res.data.FW_DWZSWSXW["BGSCHYJ.EREADONLY"] == "true",
- BGSFHYJ: res.data.FW_DWZSWSXW["BGSFHYJ.EREADONLY"] == "true",
- ZTC: res.data.FW_DWZSWSXW["ZTC.EREADONLY"] == "true",
- ZS: res.data.FW_DWZSWSXW["ZS.EREADONLY"] == "true",
- CS: res.data.FW_DWZSWSXW["CS.EREADONLY"] == "true",
- USAGE: res.data.FW_DWZSWSXW["USAGE.EREADONLY"] == "true"
- }
- self.show = {
- JJLB: res.data.FW_DWZSWSXW["JJLB.ESHOW"] == "true",
- WZYFZTZSQ: res.data.FW_DWZSWSXW["WZYFZTZSQ.ESHOW"] == "true",
- FGLDYJ: res.data.FW_DWZSWSXW["FGLDYJ.ESHOW"] == "true",
- GWZL: res.data.FW_DWZSWSXW["GWZL.ESHOW"] == "true",
- ZBBMQCR: res.data.FW_DWZSWSXW["ZBBMQCR.ESHOW"] == "true",
- NGRQ: res.data.FW_DWZSWSXW["NGRQ.ESHOW"] == "true",
- ZBBMFZRSH: res.data.FW_DWZSWSXW["ZBBMFZRSH.ESHOW"] == "true",
- HGXSH: res.data.FW_DWZSWSXW["HGXSH.ESHOW"] == "true",
- HQBMFZRSH: res.data.FW_DWZSWSXW["HQBMFZRSH.ESHOW"] == "true",
- FWBT: res.data.FW_DWZSWSXW["FWBT.ESHOW"] == "true",
- FWZH: res.data.FW_DWZSWSXW["FWZH.ESHOW"] == "true",
- YF: res.data.FW_DWZSWSXW["YF.ESHOW"] == "true",
- BGSCHYJ: res.data.FW_DWZSWSXW["BGSCHYJ.ESHOW"] == "true",
- BGSFHYJ: res.data.FW_DWZSWSXW["BGSFHYJ.ESHOW"] == "true",
- ZTC: res.data.FW_DWZSWSXW["ZTC.ESHOW"] == "true",
- ZS: res.data.FW_DWZSWSXW["ZS.ESHOW"] == "true",
- CS: res.data.FW_DWZSWSXW["CS.ESHOW"] == "true",
- USAGE: res.data.FW_DWZSWSXW["USAGE.ESHOW"] == "true"
- }
- self.selectUSAGEs = self.data.USAGE != "" && self.data.USAGE != null ? self.data.USAGE.split(",") : [];
- $.each(self.USAGE, function (index, item) {
- if (self.data.USAGE.indexOf(item.CODE) != -1) {
- item.checked = true;
- }
- })
- $timeout(function () {
- $(".sp-checkbox-blue input[name=USAGE]").each(function () {
- if (self.data.USAGE.indexOf($(this).val()) != -1) {
- $(this).attr("checked", true);
- $(this).parent("label").addClass("chb-blue-checked");
- }
- })
- }, 0)
- if (self.data.ID == 0) {
- self.filedChange = true;
- } else {
- self.filedChange = false;
- }
- var buttonList = [{ CNAME: "转发", CODE: "array", data: [] }];
- res.data["FW_DWZSWSXW.FUNCLIST"].forEach(function (item) {
- if (item.BUTTONGROUP == "FORMITEM") {
- buttonList.push(item)
- } else {
- buttonList[0].data.push(item)
- }
- })
- if (buttonList[0].data.length == 0) {
- buttonList = buttonList.slice(1)
- } else if (buttonList[0].data.length == 1) {
- buttonList[0] = buttonList[0].data[0]
- }
- console.log(buttonList)
- self.buttonList = buttonList;//res.data["FW_DWZSWSXW.FUNCLIST"];
- if (self.lastrouteinfoid != 0) {
- self.getHB()
- }
- self.getOpinion1(0)
- self.getOther()
- self.getGLJ(0)
- self.getGCG(0)
- self.getCWG()
- self.getQZG()
- //if (self.docmode == 'zihao' || self.data.FWZH1 != "") {
- // self.getFWZH()
- //}
- self.getMeetMsg()
- $interval(function () {
- self.getNumMeet()
- }, 2000)
- $timeout(function () {
- var height1 = $(".auto").parent().next("div").height(), height2 = 0;
- $(".auto").siblings().each(function () {
- height2 = height2 + $(this).outerHeight();
- })
- $(".auto").css("height", height1 - height2);
- }, 100)
- })
- }
- self.getFWZH = function () {
- var data = {
- flowid: sp.getUrlName("flowid"),
- code: "",
- cyear: self.data.FWZH == "" ? sp.currentYear() : self.data.FWZH.slice(self.data.FWZH.indexOf("〔") + 1, self.data.FWZH.indexOf("〕")),
- routeinfoidmark: self.routeinfoid,
- zihao: self.data.FWZH
- }
- $http.post(apiurljs.login + "g2app/fawen/queryZiHaoCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.FWZH = res.data.map(function (item) {
- return { CNAME: item.split("|")[0], CODE: item.split("|")[0], CNAMEMARK: item.split("|")[1] }
- });
- if (self.data.FWZH == "") { self.data.FWZH = self.FWZH[0].CODE }
- })
- }
- //生成左侧合并文件
- self.getHB = function () {
- if (self.data.MQFMARK == 1) {
- var data = {
- routeinfoid: self.routeinfoid
- }
- $http.post(apiurljs.login + "g2app/dataabase/mergeOFDByLastRouteinfoidWithCurrentRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.data != "") {
- let postData = {
- convertType: 570,
- fileUrl: res.data,
- isPrint: 1,
- isDownload: 1,
- };
- var postCfg_transfer = {
- headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
- transformRequest: function (data) {
- return $.param(data);
- }
- };
- $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
- .success(function (res) {
- self.LoadYZ = false;
- if (res.errorcode === 0) {
- 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 } };
- self.iframeLast = self.iframeList.length - 1;
- self.iframeShow = self.iframeList.length;
- self.iframeHide = self.iframeList.length - self.iframeShow;
- } else {
- sp.dialog(res.message);
- }
- });
- } else {
- var data = {
- routeinfoid: self.routeinfoid
- }
- $http.post(apiurljs.login + "g2app/dataabase/mergePDFByLastRouteinfoidWithCurrentRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.data != "") {
- let postData = {
- convertType: 20,
- fileUrl: res.data,
- isPrint: 1,
- isDownload: 1,
- };
- var postCfg_transfer = {
- headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
- transformRequest: function (data) {
- return $.param(data);
- }
- };
- $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
- .success(function (res) {
- self.LoadYZ = false;
- if (res.errorcode === 0) {
- 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 } };
- self.iframeLast = self.iframeList.length - 1;
- self.iframeShow = self.iframeList.length;
- self.iframeHide = self.iframeList.length - self.iframeShow;
- } else {
- sp.dialog(res.message);
- }
- });
- }
- })
- }
- })
- } else {
- var data = {
- routeinfoid: self.routeinfoid
- }
- $http.post(apiurljs.login + "g2app/dataabase/mergeFileByLastRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.data.result != "") {
- let postData = {
- convertType: res.data.mark == "ofd" ? 570 : 20,
- isDownload: 1,
- isPrint: 1,
- fileUrl: res.data.result
- };
- var postCfg_transfer = {
- headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
- transformRequest: function (data) {
- return $.param(data);
- }
- };
- $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
- .success(function (res) {
- if (res.errorcode === 0) {
- 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 } }];
- self.iframeLast = self.iframeList.length - 1;
- self.iframeShow = self.iframeList.length;
- self.iframeHide = self.iframeList.length - self.iframeShow;
- } else {
- sp.dialog(res.message);
- }
- });
- } else {
- var data = {
- routeinfoid: self.routeinfoid
- }
- $http.post(apiurljs.login + "g2app/dataabase/mergePDFByLastRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.data.result != "") {
- let postData = {
- convertType: res.data.mark == "ofd" ? 570 : 20,
- isDownload: 1,
- isPrint: 1,
- fileUrl: res.data.result
- };
- var postCfg_transfer = {
- headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
- transformRequest: function (data) {
- return $.param(data);
- }
- };
- $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
- .success(function (res) {
- if (res.errorcode === 0) {
- 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 } }];
- self.iframeLast = self.iframeList.length - 1;
- self.iframeShow = self.iframeList.length;
- self.iframeHide = self.iframeList.length - self.iframeShow;
- } else {
- sp.dialog(res.message);
- }
- });
- }
- })
- }
- })
- }
- }
- //获取关联文稿
- self.getGLJ = function (n) {
- var data = {
- dockind: "D01",
- routeinfoid: self.routeinfoid
- }
- $http.post(apiurljs.login + "g2app/fawenfilesrelate/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.guanlian = res.data;
- console.log(self.guanlian)
- if (n == 0) {
- self.getGLFLOW()
- }
- if (n == 2) {
- self.editFile(self.guanlian[self.guanlian.length - 1], 2)
- }
- })
- }
- self.seeGLJ = function () {
- if ($(".formedit2").find("iframe").attr("src") == "") {
- //if (self.guanlian[0].FILEURL.indexOf("files") > -1) {
- // var set_filepath = apiurljs.yzFcscloud + "g2work/files/" + self.guanlian[0].FILEURL.slice(7);
- //} else {
- // var set_filepath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + self.guanlian[0].FILEURL;
- //}
- //var data = {
- // method: 1,
- // params: {
- // userId: self.userName,
- // fileId: self.guanlian[0].ID,
- // fileName: self.guanlian[0].FILENAMES,
- // filePath: set_filepath,
- // userRight: self.dotype != 1 ? 1 : 0,
- // callbackUrl: apiurljs.login + "g2app/fawenfiles/uploadFile"
- // }
- //};
- var data = {
- method: 1,
- params: {
- userId: self.userName,
- fileId: "",//obj.ID,
- fileName: "",//obj.FILENAMES,
- filePath: "",// set_filepath,
- userRight: self.dotype != 1 ? 1 : 0,
- callbackUrl: ""// apiurljs.login + "g2app/fawenfiles/uploadFile"
- }
- };
- if (self.guanlian[0].FILEURL.indexOf("files") > -1) {
- data.params.fileId = self.guanlian[0].FILEURL.split("/")[2];
- data.params.fileName = self.guanlian[0].FILEURL.split("/")[3];
- data.params.filePath = apiurljs.yzFcscloud + "g2work/files/" + self.guanlian[0].FILEURL.slice(7);
- data.params.callbackUrl = apiurljs.login + "g2app/attachfiles/uploadFileAttach"
- } else {
- data.params.fileId = self.guanlian[0].ID;
- data.params.fileName = self.guanlian[0].FILENAMES;
- data.params.filePath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + self.guanlian[0].FILEURL;
- data.params.callbackUrl = apiurljs.login + "g2app/fawenfiles/uploadFile"
- }
- $.ajax({
- url: apiurljs.yzFileWo + "api.do",
- data: {
- jsonParams: encodeURIComponent(JSON.stringify(data))
- },
- type: "POST",
- dataType: "json",
- general: false,
- async: false,
- success: function (data) {
- if (data) {
- if (data.errorCode === "0") {
- let rst = data.result;
- if (rst && rst.urls) {
- var get_urls = rst.urls;
- if (typeof (get_urls) === "string") {
- $(".formedit2").find("iframe").attr("src", sp.ipChange(get_urls)).attr("data-id", self.guanlian[0].ID)
- }
- }
- }
- }
- },
- });
- }
- }
- self.getGLFLOW = function () {
- var data = {
- userid: self.userId,
- routeinfoid: self.routeinfoid
- }
- $http.post(apiurljs.login + "g2work/routeinfo/queryDataRelatedFlow", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- res.data.FLOWIN.forEach(function (item) {
- item.type = "FLOWIN"
- })
- res.data.FLOWOUT.forEach(function (item) {
- item.type = "FLOWOUT"
- })
- self.glList = res.data.FLOWIN.concat(res.data.FLOWOUT);
- console.log(self.glList)
- })
- }
- //获取意见(不上表)
- self.getOpinion1 = function (n) {
- self.HWFJ = [];
- var data = {
- cmanid: self.userId,
- routeinfoid: self.routeinfoid,
- routeid: "",//self.routeid,
- tableid: "FW_DWZSWSXW",
- colid: "",
- opiniontype: "",//self.opiniontype,
- orderbycol: "CDATE desc"
- }
- $http.post(apiurljs.login + "g2app/abase/queryDataOpinionWithRouteAttach", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success == true) {
- for (var i in self.YJ) {
- if (typeof (self.YJ[i]) == "object") {
- self.YJ[i] = [];
- self.YJ[i + "STATUS"] = false;
- res.data.forEach(function (item) {
- item.CDATE = sp.datefmt("yyyy-MM-dd", item.CDATE);
- if (i == item.COLID) {
- self.YJ[i].push(item)
- if (item.ROUTEID == self.routeid) {
- self.data[i] = item.opinion;
- self.YJ[i + "STATUS"] = true;
- }
- }
- })
- }
- }
- self.YJ.nulla = res.data.filter(function (item) {
- return item.COLID == "";
- });
- self.YJ.nullaSTATUS = false;
- self.YJ.nulla.forEach(function (item) {
- item.CDATE = sp.datefmt("yyyy-MM-dd", item.CDATE);
- if (self.activeOpinion != null) {
- self.activeOpinion.FILEDATA = item.FILEDATA
- }
- })
- res.data.forEach(function (item) {
- item.FILEDATA.forEach(function (item1) {
- self.HWFJ.push(item1)
- })
- })
- //if (n == 1 && self.lastrouteinfoid != 0) {
- // self.getHB()
- //}
- } else {
- sp.dialog(res.message)
- }
- })
- }
- //获取附件和插件
- self.getOther = function () {
- if (self.routeinfoid == 0) { return }
- var data = {
- tablename: "FILE_ATTACH",
- colums: "*",
- order: "ID asc",
- sqlwhere: { ROUTEINFOID: self.routeinfoid },
- sqlinwhere: "",
- sqllikewhere: ""
- }
- $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.arrayFile1 = [];
- if (res.data.length > 0) {
- res.data.forEach(function (item) {
- if (item.ATTACHTYPE.indexOf("-正文") == -1) {
- self.arrayFile1.push(item)
- }
- })
- }
- })
- }
- //发文打开过程稿在线编辑
- self.getGCG = function (n) {
- var data = {
- dockind: "D01",
- routeinfoid: self.routeinfoid
- }
- $http.post(apiurljs.login + "g2app/fawenfiles/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.gaoTypeArrayFirst = res.data;
- self.gaoTypeArrayFirst.forEach(function (item) {
- if (item.FILENAMES.split(".").length == 1) {
- item.FILENAMES = item.FILENAMES + "." + item.FILEEXT
- }
- })
- if (self.gaoTypeArrayFirst.length > 0 && self.lastrouteinfoid == 0) {
- self.seeGCG()
- }
- if (n > 0) {
- self.editFile(self.gaoTypeArrayFirst[0], 1, "正文");
- }
- if (self.gaoTypeArrayFirst.length > 1) {
- var data = {
- id: self.gaoTypeArrayFirst[0].ID
- }
- $http.post(apiurljs.login + "g2app/fawenfiles/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success) {
- self.getGCG(2)
- }
- });
- }
- })
- }
- self.seeGCG = function () {
- if ($(".formedit1").find("iframe").attr("src") == "") {
- var data = {
- method: 1,
- params: {
- userId: self.userName,
- fileId: "",//obj.ID,
- fileName: "",//obj.FILENAMES,
- filePath: "",// set_filepath,
- userRight: self.dotype != 1 ? 1 : 0,
- callbackUrl: ""// apiurljs.login + "g2app/fawenfiles/uploadFile"
- }
- };
- if (self.gaoTypeArrayFirst[0].FILEURL.indexOf("files") > -1) {
- data.params.fileId = self.gaoTypeArrayFirst[0].FILEURL.split("/")[2];
- data.params.fileName = self.gaoTypeArrayFirst[0].FILEURL.split("/")[3];
- data.params.filePath = apiurljs.yzFcscloud + "g2work/files/" + self.gaoTypeArrayFirst[0].FILEURL.slice(7);
- data.params.callbackUrl = apiurljs.login + "g2app/attachfiles/uploadFileAttach"
- } else {
- data.params.fileId = self.gaoTypeArrayFirst[0].ID;
- data.params.fileName = self.gaoTypeArrayFirst[0].FILENAMES;
- data.params.filePath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + self.gaoTypeArrayFirst[0].FILEURL;
- data.params.callbackUrl = apiurljs.login + "g2app/fawenfiles/uploadFile"
- }
- $.ajax({
- url: apiurljs.yzFileWo + "api.do",
- data: {
- jsonParams: encodeURIComponent(JSON.stringify(data))
- },
- type: "POST",
- dataType: "json",
- general: false,
- async: false,
- success: function (data) {
- if (data) {
- if (data.errorCode === "0") {
- let rst = data.result;
- if (rst && rst.urls) {
- var get_urls = rst.urls;
- if (typeof (get_urls) === "string") {
- $(".formedit1").find("iframe").attr("src", sp.ipChange(get_urls)).attr("data-id", self.gaoTypeArrayFirst[0].ID)
- }
- }
- }
- }
- },
- });
- }
- }
- //成文稿
- self.getCWG = function () {
- var data = {
- dockind: "D02",
- routeinfoid: self.routeinfoid
- }
- $http.post(apiurljs.login + "g2app/fawenfiles/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.gaoTypeArraySecond = res.data;
- self.gaoTypeArraySecond.forEach(function (item) {
- if (item.FILENAMES.split(".").length == 1) {
- item.FILENAMES = item.FILENAMES + "." + item.FILEEXT
- }
- })
- })
- }
- //签章稿
- self.getQZG = function () {
- var data = {
- dockind: "D03",
- routeinfoid: self.routeinfoid
- }
- $http.post(apiurljs.login + "g2app/fawenfiles/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.gaoTypeArrayThird = res.data;
- self.gaoTypeArrayThird.forEach(function (item) {
- if (item.FILENAMES.split(".").length == 1) {
- item.FILENAMES = item.FILENAMES + "." + item.FILEEXT
- }
- })
- })
- }
- //下载正文/终稿/签章
- self.downloadWG = function (item) {
- //window.open(apiurljs.login.split("glwork/")[0] + "glworkweb/" + item.FILEURL)
- window.open(apiurljs.login + "g2work/gaizhangfiles/" + encodeURIComponent(self.data.BT) + "/" + item.FILENAMES)
- }
- //删除正文/终稿/签章
- self.btnDeleteWG = function (obj, n) {
- var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
- var dialogBody = "<div class=\"sp-dialog-body\">删除后不可恢复,您确认要删除吗?</div>";
- 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>";
- $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
- sp.openCenter(".sp-dialog");
- ///取消按钮
- $('.sp-closeDialog').click(function (event) {
- sp.closeCenter(".sp-dialog");
- event.preventDefault();
- event.stopPropagation();
- });
- //post消息的id
- $("#delDataTrue").click(function () {
- var data = {
- id: obj.ID
- }
- $http.post(apiurljs.login + "g2app/fawenfiles/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- sp.dialoghide();
- if (res.success) {
- if (n == 2) {
- self.getCWG()
- } else if (n == 3) {
- self.getQZG()
- }
- } else {
- sp.dialog("创建失败,请联系管理员!");
- }
- ///
- });
- });
- };
- //生成正文三种方式:空白模板,红头模板,上传本地文件
- self.newMoBanFlag = false;
- self.newMoBan1 = function () {
- self.newMoBanFlag = true;
- if (self.gaoTypeArrayFirst.length > 0) {
- var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
- var dialogBody = "<div class=\"sp-dialog-body\">您确定要覆盖正文吗?</div>";
- 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>";
- $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
-
- sp.openCenter(".sp-dialog");
-
- ///取消按钮
- $('.sp-closeDialog').click(function (event) {
- sp.closeCenter(".sp-dialog");
- event.preventDefault();
- event.stopPropagation();
- });
- //post消息的id
- $("#delDataTrue").click(function () {
- sp.closeCenter(".sp-dialog");
- var data = {
- id: self.gaoTypeArrayFirst[0].ID
- }
- $http.post(apiurljs.login + "g2app/fawenfiles/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success) {
- var data = {
- dockind: "D01",
- routeinfoid: self.routeinfoid,
- gwtype: self.data.GWZL,
- filekind: "DOCFILE"
- }
- $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success) {
- self.getGCG(1)
- } else {
- sp.dialog("创建失败,请联系管理员!");
- }
- });
- } else {
- sp.dialog("创建失败,请联系管理员!");
- }
- self.newMoBanFlag = false;
- });
- })
- } else {
- var data = {
- dockind: "D01",
- routeinfoid: self.routeinfoid,
- gwtype: self.data.GWZL,
- filekind: "DOCFILE"
- }
- $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success) {
- self.getGCG(1)
- } else {
- sp.dialog("创建失败,请联系管理员!");
- }
- self.newMoBanFlag = false;
- });
- }
- }
- self.newMoBan2 = function () {
- self.newMoBanFlag = true;
- if (self.gaoTypeArrayFirst.length > 0) {
- var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
- var dialogBody = "<div class=\"sp-dialog-body\">您确定要覆盖正文吗?</div>";
- 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>";
- $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
-
- sp.openCenter(".sp-dialog");
-
- ///取消按钮
- $('.sp-closeDialog').click(function (event) {
- sp.closeCenter(".sp-dialog");
- event.preventDefault();
- event.stopPropagation();
- });
- //post消息的id
- $("#delDataTrue").click(function () {
- sp.closeCenter(".sp-dialog");
- var data = {
- id: self.gaoTypeArrayFirst[0].ID
- }
- $http.post(apiurljs.login + "g2app/fawenfiles/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success) {
- var data = {
- dockind: "D01",
- routeinfoid: self.routeinfoid,
- gwtype: self.data.GWZL,
- filekind: "REDFILE"
- }
- $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success) {
- self.getGCG(1)
- } else {
- sp.dialog("创建失败,请联系管理员!");
- }
- });
- } else {
- sp.dialog("创建失败,请联系管理员!");
- }
- self.newMoBanFlag = false;
- });
- })
- } else {
- var data = {
- dockind: "D01",
- routeinfoid: self.routeinfoid,
- gwtype: self.data.GWZL,
- filekind: "REDFILE"
- }
- $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success) {
- self.getGCG(1)
- } else {
- sp.dialog("创建失败,请联系管理员!");
- }
- self.newMoBanFlag = false;
- });
- }
- }
- //判断页面字段是否只读readonly、是否隐藏show
- self.hide = function (type, field) {
- if (self.dotype == 0 && type == "readonly") {
- return true;
- } else {
- if (self[type][field] == true) {
- return true;
- } else {
- return false;
- }
- }
- }
-
- //右上角按钮调用方法
- self.btnEvent = function (item) {
- switch (item.CODE) {
- case "SAVEITEM": self.btnSave(0); break;
- case "PRINTITEM": self.btnPrint(); break;
- case "PRINTITEMEXTEND": self.btnPrint1(); break;
- case "SAVEOFD": self.toOFD(); break;
- case "GAIZITEM": self.qianZ(); break;
- case "MEETITEM": self.Meet(); break;
- case "SENDLOG": self.RouteList(); break;
- case "PUBLICITEM": self.PUBLICITEM(); break;
- case "array": return; break;
- default: self.forward(item); break;
- }
- }
- //生成终稿
- self.toOFD = function () {
- if (self.gaoTypeArraySecond.length != 0) {
- sp.dialog("请删除成文稿后,点击文件保存!")
- $timeout(function () {
- sp.dialoghide()
- }, 1000)
- return
- }
- var data = {
- routeinfoid: self.routeinfoid,
- gwtype: self.data.GWZL,
- dockind: "D02"
- }
- $http.post(apiurljs.login + "g2app/fawenfiles/convertDataFinalOFDFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success == true) {
- self.getCWG()
- }
- })
- }
- //签章
- self.qianZ = function () {
- if (self.gaoTypeArrayThird.length != 0 || self.gaoTypeArraySecond.length != 0) {
- sp.dialog("请删除终稿、签章稿后,点击签章!")
- $timeout(function () {
- sp.dialoghide()
- }, 1000)
- return
- }
- var data = {
- //srcpath: "/opt/TongWeb7.0/applications/glworkweb/UploadAttach/" + self.gaoTypeArraySecond[0].FILENAMES,
- //outpath: "/opt/TongWeb7.0/applications/glworkweb/UploadAttach",
- routeinfoid: self.routeinfoid,
- gwtype: self.data.GWZL,
- dockind: "D02"
- }
- //$http.post(apiurljs.login + "g2app/signature/getSignature", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- $http.post(apiurljs.login + "g2app/signature/convertDataFinalOFDFileAndgetSignature", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success == true) {
- sp.dialog("生成成功!")
- self.getCWG()
- self.getQZG()
- }
- })
- }
-
- self.openGLJ = function () {
- $("#GLJWin").attr("src", "../../forward/GLJ.html?routeid=" + self.routeid + "&routeinfoid=" + self.routeinfoid + "©rightid=" + self.copyrightid + "&directionid=" + self.directionid + "&formeditid=" + self.formeditid + "&cookie=shouwenbg")
- sp.layer("#GLJ")
- }
- self.tiaohao = function () {
- var data = {
- data: {
- CYEAR: sp.currentYear(),
- FLOWID: sp.getUrlName("flowid"),
- ZIHAO: "",
- CNAMEMARK: "",
- ROUTEINFOIDMARK: self.routeinfoid,
- THMARK: 1
- }
- }
- self.FWZH.forEach(function (item) {
- if (item.CODE == self.data.FWZH) {
- data.data.ZIHAO = item.CODE;
- data.data.CNAMEMARK = item.CNAMEMARK
- }
- })
- $http.post(apiurljs.login + "g2app/fawen/saveZhanHaoByData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success == true) {
- var data1 = {
- flowid: sp.getUrlName("flowid"),
- code: self.data.NGRBMID,
- cyear: self.data.FWZH == "" ? sp.currentYear() : self.data.FWZH.slice(self.data.FWZH.indexOf("〔") + 1, self.data.FWZH.indexOf("〕")),
- routeinfoidmark: self.routeinfoid,
- zihao: self.data.FWZH
- }
- $http.post(apiurljs.login + "g2app/fawen/queryZiHaoCode", { data: s4.encryptData_CBC(JSON.stringify(data1)) }, postCfg)
- .success(function (obj1) {
- var res1 = strToJson(s4.decryptData_CBC(obj1.data));
- self.FWZH = res1.data.map(function (item) {
- return { CNAME: item.split("|")[0], CODE: item.split("|")[0], CNAMEMARK: item.split("|")[1] }
- });
- self.data.FWZH = self.FWZH[0].CODE
- self.btnSave(0)
- })
- } else {
- sp.dialog(res.message)
- }
- })
- }
- self.tiaohaoR = function () {
- var data = {
- flowid: sp.getUrlName("flowid"),
- cnamemark: "",
- routeinfoidmark: self.routeinfoid,
- cyear: sp.currentYear(),
- zihao: self.data.FWZH
- }
- self.FWZH.forEach(function (item) {
- if (item.CODE == self.data.FWZH) {
- data.cnamemark = item.CNAMEMARK
- }
- })
- $http.post(apiurljs.login + "g2app/fawen/initZiHaoByRouteinfoidmark", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success == true) {
- if (res.data == 0) {
- sp.dialog("此件当前暂无占号记录!")
- $timeout(function () {
- sp.dialoghide()
- }, 1500)
- return
- }
- var data1 = {
- flowid: sp.getUrlName("flowid"),
- code: self.data.NGRBMID,
- cyear: self.data.FWZH == "" ? sp.currentYear() : self.data.FWZH.slice(self.data.FWZH.indexOf("〔") + 1, self.data.FWZH.indexOf("〕")),
- routeinfoidmark: self.routeinfoid,
- zihao: ""
- }
- $http.post(apiurljs.login + "g2app/fawen/queryZiHaoCode", { data: s4.encryptData_CBC(JSON.stringify(data1)) }, postCfg)
- .success(function (obj1) {
- var res1 = strToJson(s4.decryptData_CBC(obj1.data));
- self.FWZH = res1.data.map(function (item) {
- return { CNAME: item.split("|")[0], CODE: item.split("|")[0], CNAMEMARK: item.split("|")[1] }
- });
- self.data.FWZH = self.FWZH[0].CODE
- self.btnSave(0)
- console.log(self.FWZH)
- })
- } else {
- sp.dialog(res.message)
- }
- })
- }
- self.tiaohaoD = function () {
- var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
- var dialogBody = "<div class=\"sp-dialog-body\">您确定要清除吗?</div>";
- 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>";
- $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
- sp.openCenter(".sp-dialog");
- ///取消按钮
- $('.sp-closeDialog').click(function (event) {
- sp.closeCenter(".sp-dialog");
- event.preventDefault();
- event.stopPropagation();
- });
- //post消息的id
- $("#delDataTrue").click(function () {
- sp.closeCenter(".sp-dialog");
- var data = {
- routeinfoid: self.routeinfoid,
- tablename: "FW_DWZSWSXW",
- colfwname: "FWZH",
- flowid: sp.getUrlName("flowid")
- }
- $http.post(apiurljs.login + "g2app/shouwen/deleteFWCodeByRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success == true) {
- var data1 = {
- flowid: sp.getUrlName("flowid"),
- code: self.data.NGRBMID,
- cyear: self.data.FWZH == "" ? sp.currentYear() : self.data.FWZH.slice(self.data.FWZH.indexOf("〔") + 1, self.data.FWZH.indexOf("〕")),
- routeinfoidmark: self.routeinfoid,
- zihao: self.data.FWZH
- }
- $http.post(apiurljs.login + "g2app/fawen/queryZiHaoCode", { data: s4.encryptData_CBC(JSON.stringify(data1)) }, postCfg)
- .success(function (obj1) {
- var res1 = strToJson(s4.decryptData_CBC(obj1.data));
- self.FWZH = res1.data.map(function (item) {
- return { CNAME: item.split("|")[0], CODE: item.split("|")[0], CNAMEMARK: item.split("|")[1] }
- });
- self.data.FWZH = "";
- self.data.FWZH1 = "";
- })
- }
- })
- })
- }
- //保存提交
- self.btnSave = function (n) {
- if (spngvld.submit(".formedit")) {
- //if (self.docmode == 'zihao') {
- // var data = {
- // data: {
- // CYEAR: sp.currentYear(),
- // FLOWID: sp.getUrlName("flowid"),
- // ZIHAO: "",
- // CNAMEMARK: "",
- // ROUTEINFOIDMARK: self.routeinfoid
- // }
- // }
- // self.FWZH.forEach(function (item) {
- // if (item.CODE == self.data.FWZH) {
- // data.data.ZIHAO = item.CODE;
- // data.data.CNAMEMARK = item.CNAMEMARK
- // }
- // })
- // $http.post(apiurljs.login + "g2app/fawen/saveWenHaoByData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- // .success(function (obj) { })
- //}
- var dataArray = [];
- dataArray.push(self.data);
- var data = {
- ckey: "FW_DWZSWSXW",
- id: self.data.ID,
- routeid: self.routeid,
- routeinfoid: self.routeinfoid,
- routeinfotitle: self.data.FWBT.replace(/\n/g, '').replace(/\s/g, ''),//self.data.ZT,
- directionid: self.directionid,
- formeditid: self.formeditid,
- data: JSON.stringify(dataArray)
- }
- $http.post(apiurljs.login + "g2app/abase/saveData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.code == 0) {
- self.data.ID = res.data.ID;
- self.routeid = res.data.ROUTEID;
- self.routeinfoid = res.data.ROUTEINFOID;
- self.filedChange = false;
- if (self.gaoTypeArrayFirst.length == 0) {
- var data = {
- dockind: "D01",
- routeinfoid: self.routeinfoid,
- gwtype: self.data.GWZL,
- filekind: "DOCFILE"
- }
- $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success) {
- if (n == 0) {
- sp.dialog("保存成功!");
- $timeout(function () {
- sp.dialoghide()
- }, 1500)
- self.getSwenList(1)
- } else if (n == 1) {
- self.forward(self.btnItem);
- } else if (n == 2) {
- self.sendAll();
- } else if (n == 3) {
- self.btnPrint();
- }else if (n == 4) {
- sp.layer("#print")
- }
- } else {
- sp.dialog("文稿创建失败,请联系管理员!");
- }
- });
- } else {
- var YZdata = {
- method: 2,
- params: {
- fileId: self.gaoTypeArrayFirst[0].ID
- }
- };
- $.ajax({
- url: apiurljs.yzFileWo + "api.do",
- data: {
- jsonParams: encodeURIComponent(JSON.stringify(YZdata))
- },
- type: "POST",
- dataType: "json",
- general: false,
- async: false,
- success: function (resp) {
- if (n == 0) {
- sp.dialog("保存成功!");
- $timeout(function () {
- sp.dialoghide()
- }, 1500)
- self.getSwenList(1)
- } else if (n == 1) {
- self.forward(self.btnItem);
- } else if (n == 2) {
- self.sendAll();
- } else if (n == 3) {
- self.btnPrint();
- }else if (n == 4) {
- sp.layer("#print")
- }
- }
- });
- }
- } else {
- sp.dialog(res.message)
- }
- })
- }
- }
- /*综合打印*/
- self.printFiled = 1;
- self.btnPrint1 = function () {
- if (self.filedChange == true) {
- self.btnSave(4)
- } else {
- sp.layer("#print")
- }
- }
- self.printSubmit = function () {
- if (self.printFiled == 1) {
- var templatefilename = "moban8"
- } else if (self.printFiled == 2) {
- var templatefilename = "mobanoption"
- } else {
- var templatefilename = "moban8_all"
- }
- var data = {
- templatefilename: templatefilename + ".ftl",
- outfilepath: "/tmp/党委正式文(上行文)" + sp.datefmt('yyyyMMddHHmmss', sp.getLocalDate()) + ".wps",
- routeinfoid: self.routeinfoid,
- tablename: "FW_DWZSWSXW",
- printtype: self.printFiled,
- printdate: "NGRQ,BGSFHYJSJ"
- }
- $http.post(apiurljs.login + "g2app/dataabase/PrintWordExtend", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- //window.open("../../../printPreview.html?url=" + apiurljs.login + "g2work" + res.data[0].url)
- if (self.deviceType == "pad") {
- window.location.href = "../../../printPreview.html?url=" + apiurljs.yzFcscloud + "g2work" + res.data[0].url
- } else {
- sp.openNewWindow("../../../printPreview.html?url=" + apiurljs.yzFcscloud + "g2work" + res.data[0].url, '打印预览')
- }
- })
- sp.layerhide()
- }
- //签写意见编辑状态
- self.opinion = {
- WZYFZTZSQ: false,
- WZYFZTZSQImg: false,
- FGLDYJ: false,
- FGLDYJImg: false,
- ZBBMFZRSH: false,
- ZBBMFZRSHImg: false,
- HGXSH: false,
- HGXSHImg: false,
- HQBMFZRSH: false,
- HQBMFZRSHImg: false,
- BGSFHYJ: false,
- BGSFHYJImg: false,
- nulla: false
- }
- self.YJ = {
- WZYFZTZSQ: [],
- WZYFZTZSQSTATUS: false,
- FGLDYJ: [],
- FGLDYJSTATUS: false,
- ZBBMFZRSH: [],
- ZBBMFZRSHSTATUS: false,
- HGXSH: [],
- HGXSHSTATUS: false,
- HQBMFZRSH: [],
- HQBMFZRSHSTATUS: false,
- BGSFHYJ: [],
- BGSFHYJSTATUS: false,
- nulla: [],
- nullaSTATUS: false
- }
- //意见(下表)
- self.openOptionList = function () {
- if (self.routeinfoid == 0 && self.routeid == 0) {
- sp.dialog("请先保存!")
- return;
- }
- if (self.dotype == 0) {
- return
- }
- if (self.opinion.nulla == true) {
- return;
- }
- self.nulla = "";
- self.opinion.nulla = true;
- }
- self.openOptionList1 = function () {
- self.openOptionList()
- self.activeOpinion = null;
- self.showBottom = "opinion";
- self.YJ.nulla.forEach(function (item) {
- if (item.ROUTEID == self.routeid) {
- self.activeOpinion = item;
- self.nulla = item.OPINION;
- }
- })
- }
- self.closeOptionList = function () {
- self.opinion.nulla = false;
- self.activeOpinion = null;
- $(".toggle").trigger("click")
- }
- self.submitOptionList = function () {
- var data = {
- cmanid: self.userId,
- routeinfoid: self.routeinfoid,
- routeid: self.routeid,
- tableid: "FW_DWZSWSXW",
- colid: "",
- opiniontype: 99,
- cresult: "",
- opinion: self.nulla,
- opinionimage: ""
- }
- $http.post(apiurljs.login + "g2app/abase/saveDataOpinion", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success == true) {
- self.getOpinion1(2);
- self.opinion.nulla = false;
- $(".toggle").trigger("click")
- } else {
- sp.dialog(res.message)
- }
- })
- }
- self.changeOptionList = function (item) {
- self.showBottom = "opinion";
- self.opinion.nulla = true;
- self.nulla = item.OPINION;
- self.activeOpinion = item;
- $(".toggle").trigger("click")
- }
- //意见附件(下表)
- self.uploading1 = false;
- self.upload1 = function () {
- $('#fileupload1').fileupload({
- url: apiurljs.login + 'g2app/abase/UploadWholeFileWithRouteAttach',
- dataType: 'json',
- beforeSend: function (xhr, data) {
- xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
- xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=SYS_ROUTE_ATTACHLIST,userid=" + self.userId + ",routeinfoid=" + self.routeinfoid
- + ",routeid=" + self.routeid + ",tableid=FW_DWZSWSXW,colid="));
- },
- // 上传完成后的执行逻辑
- done: function (e, data) {
- self.uploading1 = false;
- self.getOpinion1(2)
- }
- })
- }
- //意见附件(下表)
- self.uploading2 = false;
- self.upload2 = function (str) {
- $('#fileupload-' + str).fileupload({
- url: apiurljs.login + 'g2app/abase/UploadWholeFileWithRouteAttach',
- dataType: 'json',
- beforeSend: function (xhr, data) {
- xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
- xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=SYS_ROUTE_ATTACHLIST,userid=" + self.userId + ",routeinfoid=" + self.routeinfoid
- + ",routeid=" + self.routeid + ",tableid=FW_DWZSWSXW,colid=" + str));
- },
- // 上传完成后的执行逻辑
- done: function (e, data) {
- self.uploading1 = false;
- self.getOpinion1(2)
- }
- })
- }
- //下载意见表附件
- self.downLoadOption = function (item) {
- window.open(apiurljs.login + "g2work/files/" + item.FILEPATH.slice(7))
- }
- //删除意见表附件
- self.deleteOptionFile = function (file) {
- var data = {
- routeid: file.ROUTEID,
- tableid: "FW_DWZSWSXW",
- colid: file.COLID,
- fileid: file.FILEID
- };
- $http.post(apiurljs.login + "g2app/abase/deleteDataOpinionWithRouteAttach", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- sp.dialoghide();
- if (res.success) {
- self.getOpinion1(2);
- } else {
- sp.dialog("删除失败,请联系管理员!");
- }
- });
- }
- //签写意见
- self.openOpinion = function (str) {
- if (self.routeinfoid == 0 && self.routeid == 0) {
- sp.dialog("请先保存!")
- return;
- }
- self.opinion[str] = true;
- }
- //修改意见
- self.changeOpinion = function (str) {
- self.data[str] = self.YJ[str][0].OPINION;
- self.opinion[str] = true;
- }
- self.changeOpinionItem = function (str, item) {
- if (item.OPINIONIMAGE != "") {
- self.QianZi(str);
- self.opinion[str + "Img"] = true;
- }
- self.data[str] = item.OPINION;
- self.opinion[str] = true;
- }
- //提交意见
- self.Sopinion = function (str) {
- if (self.opinion[str + "Img"] == true) {
- self.data[str] = $("#" + str + "QZ").find("canvas")[0].toDataURL();
- } else {
- self.data[str] = $("#" + str).val();
- }
- var data = {
- cmanid: self.userId,
- routeinfoid: self.routeinfoid,
- routeid: self.routeid,
- tableid: "FW_DWZSWSXW",
- colid: str,
- opiniontype: 0,
- cresult: "",
- opinion: self.opinion[str + "Img"] == false ? self.data[str] : "",
- opinionimage: self.opinion[str + "Img"] == true ? self.data[str] : ""
- }
- $http.post(apiurljs.login + "g2app/abase/saveDataOpinion", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success == true) {
- self.getOpinion1(1);
- self.opinion[str] = false;
- self.opinion[str + "Img"] = false;
- self.data[str] = "";
- self.changeFiled(str)
- } else {
- sp.dialog(res.message)
- }
- })
- }
- //删除意见
- self.Dopinion = function (str) {
- var data = {
- cmanid: self.userId,
- routeid: self.routeid,
- tableid: "FW_DWZSWSXW",
- colid: str,
- }
- $http.post(apiurljs.login + "g2app/abase/deleteDataOpinion", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success == true) {
- self.getOpinion1();
- self.nulla = "";
- self.activeOpinion = null;
- self.changeFiled(str)
- } else {
- sp.dialog(res.message)
- }
- })
- }
- self.phraseText = "";//添加常用语
- self.phraseList = []//常用语列表
- //获取常用语库
- self.phrase = function (colid) {
- sp.layer("#phrase");
- self.colid = colid;
- self.getPhrase();
- }
- //添加常用语到常用语库
- self.Aphrase = function () {
- if (self.phraseText == "") {
- return;
- }
- var data = {
- cmanid: self.userId,
- tableid: "FW_DWZSWSXW",
- colid: self.colid,
- contents: self.phraseText
- }
- $http.post(apiurljs.login + "g2app/abase/insertDataPatterns", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success == true) {
- self.phraseText = "";
- self.getPhrase();
- } else {
- sp.dialog(res.message)
- }
- })
- }
- //获取常用语库
- self.getPhrase = function () {
- var data = {
- cmanid: self.userId,
- tableid: "FW_DWZSWSXW",
- colid: self.colid
- }
- $http.post(apiurljs.login + "g2app/abase/queryDataPatterns", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.phraseList = res.data;
- self.phraseSelect = self.phraseList[0].CONTENTS;
- })
- }
- //从常用语库删除
- self.Dphrase = function () {
- var id = null;
- $.each(self.phraseList, function (index, item) {
- if (item.CONTENTS == self.phraseSelect) {
- id = item.ID;
- }
- })
- var data = {
- id: id
- }
- $http.post(apiurljs.login + "g2app/abase/deleteDataPatterns", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.getPhrase();
- })
- }
- //常用语确认为意见
- self.btnPhrase = function () {
- if (!self.colid) {
- self.nulla = self.phraseSelect;
- } else {
- self.data[self.colid] = self.phraseSelect;
- }
- sp.layerhide();
- }
- //签字—手写
- self.QianZi = function (str) {
- if (self.opinion[str + "Img"] == true) { return; }
- self.opinion[str + "Img"] = true;
- $timeout(function () {
- new lineCanvas(str + "QZ")
- }, 1)
- }
- //清除手写
- self.canvasClear = function (str) {
- var cxt = $("#" + str + "QZ").find("canvas")[0].getContext("2d");
- cxt.clearRect(0, 0, $("#" + str + "QZ").find("canvas")[0].width, $("#" + str + "QZ").find("canvas")[0].height)
- }
- self.selectUSAGE = function (item) {
- item.checked = !item.checked;
- self.selectUSAGEs = [];
- $.each(self.USAGE, function (index, item) {
- if (item.checked == true) {
- self.selectUSAGEs.push(item.CODE)
- }
- })
- self.changeFiled('USAGE')
- }
- //发生修改
- self.changeFiled = function (str) {
- self.filedChange = true;
- //if (str == "BGSCHYJ" && (self.CHFHSJ.BGSFHYJSJ == "" || self.CHFHSJ.BGSFHYJSJ == null)) {
- // self.data.BGSFHYJSJ = sp.getLocalDate();
- //}
- if (str == "BGSCHYJ") {
- self.data.BGSFHYJSJ = sp.getLocalDate();
- }
- }
- //转发
- self.forward = function (obj) {
- self.btnItem = obj;
- if (self.filedChange == true) {
- self.btnSave(1)
- } else {
- $("#forwardWin").attr("src", "../../forward/forward.html?routeid=" + self.routeid + "&routeinfoid=" + self.routeinfoid + "©rightid=" + self.copyrightid + "&directionid=" + self.directionid + "&formeditid=" + self.formeditid + "&codefuncbutton=" + obj.CODE + "&directionidtarget=" + obj.DIRECTIONIDTARGET + "&cookie=fawendw")
- sp.layer("#forward")
- }
- }
-
- //查看流转记录
- self.RouteList = function () {
- if (self.deviceType == "pad") {
- window.location.href = "../../forward/modeler_read.html?" + self.SwenList[0].TEMPFORM.split("?")[1]
- } else {
- sp.openNewWindow("../../forward/modeler_read.html?" + self.SwenList[0].TEMPFORM.split("?")[1], "流程图")
- }
- }
- self.showCol = function ($event, ele) {
- $('.show-col').not(ele).hide();
- $(ele).toggle("fast", function () {
- $(ele).css('overflow-y', 'auto')
- }).autoHide();
- $event.stopPropagation();
- }
- self.iframeList = []
- self.iframeLast = self.iframeList.length - 1;
- self.iframeShow = self.iframeList.length;
- self.iframeHide = self.iframeList.length - self.iframeShow;
- //num为1时为附件表附件,为2时为文稿表附件
- self.seeFile = function (obj, num, str) {
- $('.show-col').hide();
- if (!obj) {
- sp.dialog("文件不存在!")
- return
- }
- if (apiurljs.zhType.indexOf(obj.FILEEXT) == -1) {
- sp.dialog("文件暂不支持在线预览,请点击下载查看!")
- return
- }
- var n = 0;
- self.iframeList.forEach(function (item) {
- if (item.filename == obj.FILENAMES) {
- n++
- }
- })
- if (n == 0) {
- var set_convertType = 0;
- if (obj.FILEEXT == "doc") {
- set_convertType = 0;
- } else if (obj.FILEEXT == "pdf") {
- set_convertType = 20;
- } else if (obj.FILEEXT == "ofd") {
- set_convertType = 570;
- } else if ("png,jpg,jpeg,gif,bmp,jfif,svg,tif,tiff".indexOf(obj.FILEEXT) > -1) {
- set_convertType = 23;
- } else {
- set_convertType = 0;
- }
- let postData = {
- convertType: set_convertType,
- isSignature: 1,
- isPrint: 1,
- 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
- };
- var postCfg_transfer = {
- headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
- transformRequest: function (data) {
- return $.param(data);
- }
- };
- $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
- .success(function (res) {
- if (res.errorcode === 0) {
- if (num == 1) {
- if (obj.FILEPATH) {
- self.addItem(sp.ipChange(res.data.viewUrl), apiurljs.login + "g2work" + obj.FILEPATH, str, obj.FILENAMES, false)
- } else {
- self.addItem(sp.ipChange(res.data.viewUrl), apiurljs.login + "g2work/files2/inline/" + obj.FILEURL.slice(7), str, obj.FILENAMES, false)
- }
- } else {
- self.addItem(sp.ipChange(res.data.viewUrl), apiurljs.login.split("glwork/")[0] + "glworkweb/" + obj.FILEURL, str, obj.FILENAMES, false)
- }
- } else {
- sp.dialog(res.message);
- }
- });
- }
- }
- self.seeZW = function () {
- self.activeFormedit = 0;
- if ($(".rightBox").outerWidth() == 15) {
- showRightBox()
- }
- $("#rightList").css("margin-left", 0);
- }
- self.editFile = function (obj, n, str) {
- if (self.newMoBanFlag == true) {
- return
- }
- $('.show-col').hide();
- if (!obj) {
- sp.dialog("文件不存在!")
- return
- }
- self.activeFormedit = n;
- if ($(".rightBox").outerWidth() == 15) {
- showRightBox()
- }
- if ($(".formedit" + n).find("iframe").attr("data-id") == obj.ID) {
- if (self.iframeList.length == 0) {
- if (n == 0) {
- $("#rightList").css("margin-left", 0);
- } else {
- $("#rightList").css("margin-left", (n - 1) * $(".formedit1").width() * -1 - 10);
- }
- } else if (self.iframeHide == self.iframeList.length) {
- if (n == 0) {
- console.log(n)
- $("#rightList").css("margin-left", 0);
- } else {
- $("#rightList").css("margin-left", (n - 1) * $(".formedit1").width() * -1 - 10);
- }
- } else {
- $("#rightList").css("margin-left", n * $(".formedit").width() * -1);
- }
- } else {
- var data = {
- method: 1,
- params: {
- userId: self.userName,
- fileId: "",//obj.ID,
- fileName: "",//obj.FILENAMES,
- filePath: "",// set_filepath,
- userRight: self.dotype != 1 ? 1 : 0,
- callbackUrl: ""// apiurljs.login + "g2app/fawenfiles/uploadFile"
- }
- };
- if (obj.FILEURL.indexOf("files") > -1) {
- data.params.fileId = obj.FILEURL.split("/")[2];
- data.params.fileName = obj.FILEURL.split("/")[3];
- data.params.filePath = apiurljs.yzFcscloud + "g2work/files/" + obj.FILEURL.slice(7);
- //var set_filepath = apiurljs.yzFcscloud + "g2work/files/" + obj.FILEURL.slice(7);
- data.params.callbackUrl = apiurljs.login + "g2app/attachfiles/uploadFileAttach"
- } else {
- data.params.fileId = obj.ID;
- data.params.fileName = obj.FILENAMES;
- data.params.filePath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + obj.FILEURL;
- //var set_filepath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + obj.FILEURL;
- data.params.callbackUrl = apiurljs.login + "g2app/fawenfiles/uploadFile"
- }
- $.ajax({
- url: apiurljs.yzFileWo + "api.do",
- data: {
- jsonParams: encodeURIComponent(JSON.stringify(data))
- },
- type: "POST",
- dataType: "json",
- general: false,
- async: false,
- success: function (data) {
- if (data) {
- if (data.errorCode === "0") {
- let rst = data.result;
- if (rst && rst.urls) {
- var get_urls = rst.urls;
- if (typeof (get_urls) === "string") {
- $(".formedit" + n).find("iframe").attr("src", sp.ipChange(get_urls)).attr("data-id", obj.ID)
- if (self.iframeList.length == 0) {
- if (n == 0) {
- $("#rightList").css("margin-left", 0);
- } else {
- $("#rightList").css("margin-left", (n - 1) * $(".formedit1").width() * -1 - 10);
- }
- } else if (self.iframeHide == self.iframeList.length) {
- if (n == 0) {
- console.log(n)
- $("#rightList").css("margin-left", 0);
- } else {
- $("#rightList").css("margin-left", (n - 1) * $(".formedit1").width() * -1 - 10);
- }
- } else {
- $("#rightList").css("margin-left", n * $(".formedit").width() * -1);
- }
- }
- }
- }
- }
- },
- })
- }
- }
- self.btnSaveFile = function (id) {
- var data = {
- method: 2,
- params: {
- fileId: id
- }
- };
- $.ajax({
- url: apiurljs.yzFileWo + "api.do",
- data: {
- jsonParams: encodeURIComponent(JSON.stringify(data))
- },
- type: "POST",
- dataType: "json",
- general: false,
- async: false,
- success: function (data) {
- if (data && data.errorCode === "0") {
- sp.dialog("保存成功");
- }
- }
- });
- }
- self.addItem = function (url, source, name, filename, edit, fileid) {
- var n = 0;
- self.iframeList.forEach(function (item) {
- if (item.filename == filename && item.source == source) {
- n++
- }
- })
- if (n == 0) {
- if (edit == false) {
- self.iframeList.push({ id: self.iframeList.length + 1, title: name, filename: filename, url: $sce.trustAsResourceUrl(url), source: source, edit: edit, show: 1 })
- } else {
- self.iframeList.push({ id: self.iframeList.length + 1, title: name, filename: filename, url: $sce.trustAsResourceUrl(url), source: source, edit: edit, show: 1, fileid: fileid })
- }
- self.changeSize(1)
- }
- }
- self.hideItem = function (n) {
- self.iframeList[n].show = 2;
- self.iframeList[n].boxStyle = { width: 0, float: "left" };
- self.changeIframeSize()
- }
- self.showItem = function (n) {
- self.iframeList[n].show = 1;
- self.changeIframeSize()
- }
- self.changeIframeSize = function () {
- if (self.iframeList.length == 0) {
- } else {
- var n = 0;
- self.iframeList.forEach(function (item, index) {
- if (item.show == 1) {
- self.iframeLast = index;
- }
- if (item.show == 2) {
- n = n + 1;
- }
- })
- self.iframeHide = n;
- self.iframeShow = self.iframeList.length - self.iframeHide;
- for (var i = 0; i < self.iframeList.length; i++) {
- if (self.iframeHide != self.iframeList.length) {
- if (self.iframeList[i].show == 1) {
- self.iframeList[i].boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2 / (self.iframeList.length - 1 - self.iframeHide)) }
- self.iframeList[i].iframeStyle = { width: self.iframeList[i].boxStyle.width - 10 }
- }
- if ($(".rightBox").outerWidth() == 15) {
- $(".leftBox").css("width", "calc(100% - 15px)");
- $(".border-left-right").show()
- $(".border-left-right").prev().show()
- } else {
- showRightBox()
- }
- } else {
- self.iframeList[i].show = 2
- self.iframeList[i].boxStyle = { width: 0, float: "left" };
- self.seeGCG()
- $(".leftBox").css("width", 36)
- $(".border-left-right").hide()
- $(".border-left-right").prev().hide()
- $(".rightBox").css("width", "calc(100% - 36px)")
- $("#rightList").show();
- $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- self.formeditSize()
- var marginLeft = $("#rightList").css("margin-left")
- if (marginLeft.slice(0, marginLeft.length - 2) == $(".formedit1").width() * -1 || marginLeft.slice(0, marginLeft.length - 2) == 0) {
- } else {
- $("#rightList").css("margin-left", $(".formedit1").width() * (self.activeFormedit - 1) * -1)
- }
- }
- }
- if (self.iframeShow == 1) {
- self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) - 1 }
- self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeLast].boxStyle.width - 10 }
- } else {
- self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2) - 1 }
- self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeLast].boxStyle.width - 10 }
- }
- }
- }
- self.changeSize = function (n) {
- if (self.iframeList.length == 0) {
- $(".rightBox").show();
- $("#rightList").show();
- $(".rightBox").css("width", $(window).width())
- $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- self.formeditSize()
- var marginLeft = $("#rightList").css("margin-left")
- if (marginLeft.slice(0, marginLeft.length - 2) == $(".formedit1").width() * -1 || marginLeft.slice(0, marginLeft.length - 2) == 0) {
- } else {
- $("#rightList").css("margin-left", $(".formedit1").width() * (self.activeFormedit - 1) * -1)
- }
- } else {
- if (n == 1 && $(".fa-angle-left").is(":hidden") == false) {
- showRightBox()
- }
- $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
- $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
- $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
- self.formeditSize()
- var marginLeft = $("#rightList").css("margin-left")
- if (marginLeft.slice(0, marginLeft.length - 2) == $(".formedit1").width() * -1 || marginLeft.slice(0, marginLeft.length - 2) == 0) {
- } else {
- $("#rightList").css("margin-left", $(".formedit1").width() * (self.activeFormedit - 1) * -1)
- }
- }
- var num = 0;
- self.iframeList.forEach(function (item, index) {
- self.reSize(index)
- if (item.show == 1) {
- num = num + 1;
- self.iframeLast = index;
- }
- })
- self.iframeShow = num;
- self.iframeHide = self.iframeList.length - self.iframeShow;
- if (self.iframeList.length == 0) {
- } else {
- if (self.iframeShow == self.iframeList.length) {
- self.iframeList.forEach(function (item) {
- item.boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2 / (self.iframeList.length - 1 - self.iframeHide)) }
- item.iframeStyle = { width: item.boxStyle.width - 10 }
- })
- self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc($(".leftBox").width() / (self.iframeShow == 1 ? 1 : 2)) - 1 }
- self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeList.length - 1].boxStyle.width - 10 }
- } else {
- for (var i = 0; i < self.iframeList.length; i++) {
- if (self.iframeHide != self.iframeList.length) {
- if (self.iframeList[i].show == 1) {
- self.iframeList[i].boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2 / (self.iframeList.length - 1 - self.iframeHide)) }
- self.iframeList[i].iframeStyle = { width: self.iframeList[i].boxStyle.width - 10 }
- }
- if (n == 1) {
- if ($(".rightBox").outerWidth() == 15) {
- $(".leftBox").css("width", "calc(100% - 15px)");
- $(".border-left-right").show()
- $(".border-left-right").prev().show()
- } else {
- showRightBox()
- }
- }
- } else {
- self.iframeList[i].show = 2
- self.iframeList[i].boxStyle = { width: 0, float: "left" };
- self.seeGCG()
- $(".leftBox").css("width", 36)
- $(".border-left-right").hide()
- $(".border-left-right").prev().hide()
- $(".rightBox").css("width", "calc(100% - 36px)")
- $("#rightList").show();
- $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- var marginLeft = $("#rightList").css("margin-left")
- if (marginLeft.slice(0, marginLeft.length - 2) == $(".formedit1").width() * -1 || marginLeft.slice(0, marginLeft.length - 2) == 0) {
- } else {
- $("#rightList").css("margin-left", $(".formedit1").width() * (self.activeFormedit - 1) * -1)
- }
- }
- }
- if (self.iframeShow == 1) {
- self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) - 1 }
- self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeLast].boxStyle.width - 10 }
- } else {
- self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2) - 1 }
- self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeLast].boxStyle.width - 10 }
- }
- }
- }
- }
- self.openItem = function (obj) {
- window.open(obj.url)
- }
- self.closeItem = function (n) {
- self.iframeList.splice(n, 1)
- self.changeSize(1)
- }
- self.reSize = function (n) {
- $timeout(function () {
- var leftbox = document.getElementsByClassName("iframe-item")[n];
- var rightbox;
- var line = document.getElementsByClassName("iframe-border-right")[n];
- document.getElementsByClassName("iframe-border-right")[n].addEventListener("mousedown", function (event) {
- for (var i = n + 1; i < self.iframeList.length; i++) {
- if (self.iframeList[i].show == 1) {
- rightbox = document.getElementsByClassName("iframe-item")[i];
- break
- }
- }
- $(".mousemove").show()
- var leftboxW = leftbox.style.width.slice(0, leftbox.style.width.length - 2);
- var rightboxW = rightbox.style.width.slice(0, rightbox.style.width.length - 2);
- var x = event.pageX - (line.offsetLeft - leftboxW) - 10;
- document.addEventListener("mousemove", boxMove)
- function boxMove(event) {
- if (leftboxW * 1 + (event.pageX - x) * 1 <= 36) {
- //leftbox.children[0].style.display = "none"
- self.hideItem(n)
- } else if (rightboxW * 1 - (event.pageX - x) * 1 <= 5) {
- //rightbox.children[0].style.display = "none"
- self.hideItem(i)
- } else {
- leftbox.children[0].style.display = "block"
- leftbox.style.width = leftboxW * 1 + (event.pageX - x) * 1 + "px";
- leftbox.getElementsByTagName("iframe")[0].style.width = leftboxW * 1 + (event.pageX - x) * 1 + "px";
- self.iframeList[n].boxStyle.width = leftboxW * 1 + (event.pageX - x) * 1;
- self.iframeList[n].iframeStyle.width = leftboxW * 1 + (event.pageX - x) * 1 - 10;
- rightbox.children[0].style.display = "block"
- rightbox.style.width = rightboxW * 1 - (event.pageX - x) * 1 + "px";
- rightbox.getElementsByTagName("iframe")[0].style.width = rightboxW * 1 - (event.pageX - x) * 1 - 10 + "px";
- self.iframeList[i].boxStyle.width = rightboxW * 1 - (event.pageX - x) * 1;
- self.iframeList[i].iframeStyle.width = rightboxW * 1 - (event.pageX - x) * 1 - 10;
- }
- }
- document.addEventListener("mouseup", function () {
- $(".mousemove").hide()
- $scope.$apply();
- document.removeEventListener("mousemove", boxMove)
- })
- })
- }, 1)
- }
- self.reSizeLR = function (n) {
- var leftbox = document.getElementsByClassName("page-item")[n - 1];
- var rightbox = document.getElementsByClassName("page-item")[n];
- var line = document.getElementsByClassName("left-right")[n - 1];
- document.getElementsByClassName("left-right")[n - 1].addEventListener("mousedown", function (event) {
- $(".mousemove").show()
- var leftboxW = leftbox.clientWidth;
- var rightboxW = rightbox.clientWidth;
- var x = event.pageX - line.offsetLeft;
- document.addEventListener("mousemove", boxMove)
- function boxMove(event) {
- if (leftboxW * 1 + (event.pageX - x) * 1 <= 200) {
- } else if (rightboxW * 1 - (event.pageX - x) * 1 <= 200) {
- } else {
- leftbox.style.width = leftboxW * 1 + (event.pageX - x) * 1 + "px";
- rightbox.style.width = rightboxW * 1 - (event.pageX - x) * 1 + "px";
- $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
- $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
- $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
- $(".toggle").parent().css("width", $(".formedit").width() - 12)
- $scope.changeSize()
- }
- }
- document.addEventListener("mouseup", function () {
- $(".mousemove").hide()
- document.removeEventListener("mousemove", boxMove)
- })
- })
- }
- /*右侧formedit折叠*/self.formeditList = [];
- self.hideFormedit = function (num, title) {
- $(".formedit" + num).hide();
- $(".formedit" + num).siblings().css("width", $(".formedit" + num).width() - (self.iframeHide == self.iframeList.length ? 18 : 36));
- self.formeditList.push({ index: num, title: title });
- if (self.iframeHide == self.iframeList.length) {
- if (self.formeditList.length == 2) {
- $(".formedit" + num).siblings().each(function () {
- if ($(this).is(":hidden") == false) {
- if ($(this).is(":hidden") == false) {
- $(this).width("calc(100% - 46px)")
- }
- }
- })
- }
- self.seeGLJ()
- } else {
- if (self.formeditList.length == 2) {
- $(".formedit" + num).siblings().each(function () {
- if ($(this).is(":hidden") == false) {
- if ($(this).is(":hidden") == false) {
- $(this).width("calc(100% - 36px)")
- }
- }
- })
- }
- if ($(".formedit1").find("iframe").attr("src") == "") {
- self.seeGCG()
- } else {
- self.seeGLJ()
- }
- }
- $("#rightList").css("margin-left", 0)
- $(".toggle").parent().css("width", $(".formedit").width() - 12)
- }
- self.showFormedit = function (num, obj) {
- $(".formedit" + obj.index).show();
- self.formeditList.splice(num, 1);
- if (self.iframeHide == self.iframeList.length) {
- if (self.formeditList.length == 2) {
- $(".formedit" + obj.index).width("calc(100% - 46px)")
- $("#rightList").css("margin-left", 0)
- } else if (self.formeditList.length == 1) {
- $(".formedit" + obj.index).width(($(".rightBox").width() - 36) / 2)
- $(".formedit" + obj.index).siblings().width(($(".rightBox").width() - 36) / 2)
- $("#rightList").css("margin-left", 0)
- } else {
- $(".formedit" + obj.index).width($(".rightBox").width() / 2)
- $(".formedit" + obj.index).siblings().width($(".rightBox").width() / 2)
- $("#rightList").css("margin-left", obj.index == "" ? 0 : (obj.index - 1) * $(".formedit" + obj.index).width() * -1)
- }
- } else {
- if (self.formeditList.length > 0) {
- $(".formedit" + obj.index).width($(".rightBox").width() - 36)
- $(".formedit" + obj.index).siblings().width($(".rightBox").width() - 36)
- } else {
- $(".formedit" + obj.index).width($(".rightBox").width())
- $(".formedit" + obj.index).siblings().width($(".rightBox").width())
- }
- $("#rightList").css("margin-left", obj.index == "" ? 0 : obj.index * $(".formedit" + obj.index).width() * -1)
- }
- $(".toggle").parent().css("width", $(".formedit").width() - 12)
- }
- self.formeditSize = function () {
- if (self.iframeHide == self.iframeList.length) {
- if (self.formeditList.length == 2) {
- $("#rightList").children().each(function () {
- if ($(this).is(":hidden") == false) {
- $(this).css("width", "calc(100% - 36px)")
- }
- })
- } else if (self.formeditList.length == 1) {
- $("#rightList").children().each(function () {
- $(this).width(($(".rightBox").width() - 36) / 2)
- })
- }
- } else {
- if (self.formeditList.length > 0) {
- $("#rightList").children().each(function () {
- $(this).width($(".rightBox").width() - 36)
- })
- }
- }
- $(".toggle").parent().css("width", $(".formedit").width() - 12)
- }
- self.getMeetMsg = function () {
- var data = {
- routeid: self.routeid,
- routeinfoid: self.routeinfoid
- }
- $http.post(apiurljs.login + "g2work/meetcoop/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.meetList = res.data;
- self.meetNum = 0;
- self.meetList.forEach(function (item) {
- self.meetNum++
- item.FILES.forEach(function (item1) {
- self.meetNum++
- item1.WATCHLIMIT = sp.format(item1.WATCHLIMIT);
- })
- })
- //self.getNumMeet()
- })
- }
- self.getNumMeet = function () {
- var data = {
- routeinfoid: self.routeinfoid
- }
- $http.post(apiurljs.login + "g2work/meetcoop/queryDataListCount", data, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.data != self.meetNum) {
- self.getMeetMsg()
- }
- })
- }
- self.Meeting = function () {
- $http.post(apiurljs.login + "g2app/dataabase/getDpList", { data: s4.encryptData_CBC("") }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.dpList = res.data;
- self.dpList1 = [];
- self.dpList.forEach(function (item) {
- self.dpList1.push(item)
- item.USER.forEach(function (item1) {
- item1.show = true;
- })
- })
- self.activeDep = 0;
- self.userList = self.dpList1[0].USER;
- self.meetUser = [];
- sp.layer("#meet")
- })
- }
- self.searchName = "";
- self.searchPerson = function () {
- self.dpList1 = [];
- self.dpList.forEach(function (item) {
- if (item.DEP.indexOf(self.searchName) > -1) {
- self.dpList1.push(item)
- }
- })
- self.activeDep = 0;
- self.userList = self.dpList1[0].USER;
- }
- self.addmeet = function () {
- self.dpList.forEach(function (item) {
- item.USER.forEach(function (item1) {
- if (item1.checked == true && item1.show == true) {
- self.meetUser.push(item1);
- item1.checked = false;
- item1.show = false;
- }
- })
- })
- }
- self.delmeet = function () {
- self.meetUser.forEach(function (item) {
- if (item.checked == true) {
- item.checked = false;
- item.show = true;
- }
- })
- self.meetUser = self.meetUser.filter(function (item) {
- return item.show == false;
- })
- }
- self.joinMeet = function () {
- var data = {
- tablename: "FW_DWZSWSXW",
- colums: "*",
- order: "ID desc",
- sqlwhere: { ROUTEINFOID: self.routeinfoid },
- sqlinwhere: "",
- sqllikewhere: ""
- }
- $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- var data1 = {
- routeid: self.routeid,
- routeinfoid: self.routeinfoid,
- cman: self.userId,
- cname: res.data[0].BT + "—共享沟通",
- userids: self.meetUser.map(function (item) {
- return item.USERID
- }).join(",")
- }
- $http.post(apiurljs.login + "g2work/meetcoop/createMeetcoop", data1, postCfg)
- .success(function (res1) {
- sp.layerhide()
- if (res1.success == true) {
- self.getMeetMsg()
- } else {
- sp.dialog(res1.message)
- }
- })
- })
- }
- self.updateCname = function (item) {
- self.meeting = {
- type: 1,
- updateTitle: "修改会议标题",
- meetid: item.MEETID,
- cname: item.CNAME
- }
- sp.layer("#meetUpdate")
- }
- self.deleteMeet = function (meet) {
- var data = {
- meetid: meet.MEETID
- }
- $http.post(apiurljs.login + "g2work/meetcoop/deleteDataByID", data, postCfg)
- .success(function (res) {
- if (res.success == true) {
- $.each(self.iframeList, function (index, item) {
- $.each(meet.FILES, function (index1, item1) {
- if (item.title == item1.WATCHLIMIT && item.source == item1.FILEURL) {
- self.closeItem(index1)
- }
- })
- })
- self.getMeetMsg()
- } else {
- sp.dialog(res.message)
- }
- })
- }
- self.updateWatchlimit = function (item) {
- self.meeting = {
- type: 2,
- updateTitle: "修改查看时限",
- fileid: item.FILEID,
- watchlimit: item.WATCHLIMIT
- }
- sp.layer("#meetUpdate")
- }
- self.deleteMFile = function (mfile) {
- var data = {
- fileid: mfile.MEETID
- }
- $http.post(apiurljs.login + "g2work/meetcoop/deleteDataFilesByFileID", data, postCfg)
- .success(function (res) {
- if (res.success == true) {
- $.each(self.iframeList, function (index, item) {
- if (item.title == mfile.WATCHLIMIT && item.source == mfile.FILEURL) {
- self.closeItem(index)
- }
- })
- self.getMeetMsg()
- } else {
- sp.dialog(res.message)
- }
- })
- }
- self.meetUpdate = function () {
- if (self.meeting.type == 1) {
- var data = {
- meetid: self.meeting.meetid,
- cname: self.meeting.cname
- }
- $http.post(apiurljs.login + "g2work/meetcoop/updateCnameByID", data, postCfg)
- .success(function (res) {
- sp.layerhide()
- if (res.success == true) {
- self.getMeetMsg()
- } else {
- sp.dialog(res.message)
- }
- })
- } else {
- var data = {
- fileid: self.meeting.fileid,
- watchlimit: self.meeting.watchlimit
- }
- $http.post(apiurljs.login + "g2work/meetcoop/updateWatchlimitByFileID", data, postCfg)
- .success(function (res) {
- sp.layerhide()
- if (res.success == true) {
- self.getMeetMsg()
- } else {
- sp.dialog(res.message)
- }
- })
- }
- }
-
- ////头部关键字搜索---20230905
- self.headBtnSearchKeyword = "";
- self.headSearchResult = [];
- self.headSearchResult_view = false;
- self.headBtnSearch = function () {
- if (sp.isval(self.headBtnSearchKeyword)) {
- self.headSearchResult = [];
- var data = {
- "url": "/basic/api/StatSelect/selectCodeList",
- "data": { "keyWord": self.headBtnSearchKeyword }
- }
- $http.post(apiurljs.login + "g2app/yizhangtu/selectCodeList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.headSearchResult = res.data.build;
- if (sp.isval(self.headSearchResult)) {
- self.headSearchResult_view = true;
- } else {
- self.headSearchResult_view = false;
- }
- })
- } else {
- self.headSearchResult_view = false;
- }
- };
- self.headKeywordPage = function (itemdata) {
- var get_token = localStorage.getItem("main-token");
- var set_url = apiurljs.onePic + "wholeProcessPage/?token=" + get_token + "&name=" + itemdata.name + "&type=" + itemdata.type + "&id=" + itemdata.id;
- self.addItem(set_url, set_url, '一张图', false);
- self.headSearchResult_view = false;
- };
- self.onePic = function () {
- self.addItem(apiurljs.onePic + "wholeProcessPage/?token=" + localStorage.getItem("main-token"), apiurljs.onePic + "wholeProcessPage/?token=" + localStorage.getItem("main-token"), "地图搜索", false)
- }
- //公开
- self.PUBLICITEM = function () {
- var data = {
- userid: self.userId
- }
- $http.post(apiurljs.login + "g2app/richang/queryDpInfo", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- var data1 = {
- tablename: "CODE_LM"
- }
- $http.post(apiurljs.login + "g2app/filepublishing/getTreeListByTablename", { data: s4.encryptData_CBC(JSON.stringify(data1)) }, postCfg)
- .success(function (obj1) {
- var res1 = strToJson(s4.decryptData_CBC(obj1.data));
- self.LM = res1.data[0].C_H_I_L_D_DATA;
- self.LM.forEach(function (item) {
- item.show = true;
- if (item.CNAME == "新闻动态" || item.CNAME == "通知公告" || (item.MKUSERID && item.MKUSERID.indexOf(self.userId) == -1)) {
- item.show = false;
- }
- item.C_H_I_L_D_DATA.forEach(function (item1) {
- item1.show = true;
- if (item1.MKUSERID && item1.MKUSERID.indexOf(self.userId) == -1) {
- item1.show = false;
- }
- })
- })
- self.filed = "GKFW";
- self.msgGK = {
- WJLY: "FW",
- FLOWID: "AA88",
- FORMROUTEINFOID: self.routeinfoid,
- FBUSERID: self.userId,
- FBNAME: self.userName,
- GKFW: "",
- LM: "P0103",
- LM1: "委发文件",
- FBRQ: sp.getLocalDate(),
- FBBM: res.data[0].SECTION,
- WJBT: self.data.FWBT
- }
- sp.layer("#PUBLICITEM")
- $("#PUBLICITEM .sp-page").eq(0).scrollTop(0);
- })
- })
- }
- self.showCol = function ($event, ele) {
- $('.detail-col').not(ele).hide();
- $(ele).toggle("slow").autoHide();
- $event.stopPropagation();
- }
- self.selectLM = function (item) {
- self.msgGK.LM = item.CODE
- self.msgGK.LM1 = item.CNAME
- console.log(self.msgGK)
- $(".detail-col").toggle("slow");
- }
- self.showSecond = function (obj, n) {
- self.LM1 = obj.C_H_I_L_D_DATA;
- $(".detail-col").eq(1).css("top", (n + 1) * 30 + n);
- $(".detail-col").eq(1).show().autoHide()
- }
- self.checkAllUser1 = function () {
- self.AllChecked[self.filed] = !self.AllChecked[self.filed];
- $.each(self.UserList[self.filed], function (index, item) {
- item.checked = self.AllChecked[self.filed];
- $.each(item.USER, function (index1, item1) {
- item1.checked = self.AllChecked[self.filed];
- })
- })
- self.submitGK(1)
- }
- self.checkUserItem1 = function (item) {
- item.checked = !item.checked;
- $.each(item.USER, function (index, item1) {
- item1.checked = item.checked;
- })
- var n = 0;
- $.each(self.UserList[self.filed], function (index, item) {
- if (item.checked == true) {
- n++
- }
- })
- if (n == self.UserList[self.filed].length) {
- self.AllChecked[self.filed] = true;
- } else {
- self.AllChecked[self.filed] = false;
- }
- self.submitGK(1)
- }
- self.checkUser1 = function (item) {
- item.checked = !item.checked;
- var n = [], all = 0;
- $.each(self.UserList[self.filed], function (x, y) {
- n.push(0);
- $.each(y.USER, function (x1, y1) {
- if (y1.checked == true) {
- n[x]++
- }
- })
- if (n[x] == y.USER.length && n[x] != 0) {
- y.checked = true;
- all++
- } else {
- y.checked = false;
- }
- })
- if (all == self.UserList[self.filed].length) {
- self.AllChecked[self.filed] = true;
- } else {
- self.AllChecked[self.filed] = false;
- }
- self.submitGK(1)
- }
- self.submitGK = function (n) {
- var AllCheckedLength = 0;
- self.selectList[self.filed] = [];
- $.each(self.UserList[self.filed], function (index, item) {
- $.each(item.USER, function (index1, item1) {
- if (item1.checked == true) {
- AllCheckedLength++;
- self.selectList[self.filed].push(item1)
- }
- })
- })
- self.msgGK[self.filed] = self.selectList[self.filed].map(function (item) {
- return item.USERID
- }).join(",")
- self.AllChecked[self.filed] = AllCheckedLength == self.UserLength[self.filed];
- if (n == 0) {
- sp.layerhide();
- var data = {
- tablename: "SX_FBLIST",
- data: {
- WJLY: self.msgGK.WJLY,
- FLOWID: self.msgGK.FLOWID,
- FORMROUTEINFOID: self.msgGK.FORMROUTEINFOID,
- FBUSERID: self.msgGK.FBUSERID,
- FBNAME: self.msgGK.FBNAME,
- GKFW: self.msgGK.GKFW,
- LM: self.msgGK.LM,
- FBRQ: self.msgGK.FBRQ,
- FBBM: self.msgGK.FBBM,
- WJBT: self.msgGK.WJBT
- }
- }
- $http.post(apiurljs.login + "g2app/dataabase/insertFormData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- sp.layerhide();
- if (res.success) {
- sp.dialog("操作成功!");
- $timeout(function () {
- sp.dialoghide();
- }, 1000)
- } else {
- sp.dialog(res.message);
- }
- })
- }
- }
- $scope.changeSize = function (n) {
- self.changeSize(2)
- if (n == 1) {
- $scope.$apply();
- }
- }
- $scope.openOptionList1 = function () {
- $timeout(function () {
- self.openOptionList1()
- })
- }
- $scope.closeToggle = function () {
- $timeout(function () {
- self.opinion.nulla = false;
- self.activeOpinion = null;
- })
- }
- $scope.refreshGLJ = function (n) {
- if (n == 1) {
- self.getGLJ(2)
- } else {
- self.getGLFLOW()
- }
- }
- //头部下滚冻结
- $(function () {
- //页面高度撑满
- setTimeout(function () {
- $(".rightBox").css("height", $(window).height() - 115)
- $(".mousemove").css("top", 0).css("left", 0).css("width", $(window).width()).css("height", $(window).height() - 10)
- if (self.lastrouteinfoid == 0) {
- $(".rightBox").css("width", $(window).width())
- $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- } else {
- $(".rightBox").css("width", "50%")
- $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
- $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
- $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
- }
- $(".toggle").parent().css("width", $(".formedit").width() - 12)
- }, 1)
- $(window).resize(function () {
- $(".rightBox").css("height", $(window).height() - 115)
- $(".mousemove").css("top", 0).css("left", 0).css("width", $(window).width()).css("height", $(window).height() - 10)
- if (self.iframeList.length == 0) {
- $(".rightBox").css("width", $(window).width())
- $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- self.formeditSize()
- } else if (self.iframeList.length > 0 && self.iframeHide == self.iframeList.length) {
- $(".rightBox").css("width", "calc(100% - 36px)")
- $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
- self.formeditSize()
- } else {
- $(".rightBox").css("width", "50%")
- $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
- $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
- $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
- self.formeditSize()
- }
- $(".toggle").parent().css("width", $(".formedit").width() - 12)
- if (self.iframeList.length > 0) {
- $("#iframeList").css("height", $(window).height() - 115)
- if (self.iframeList.length == 1) {
- self.iframeList[0].boxStyle = { width: $(".leftBox").width() }
- self.iframeList[0].iframeStyle = { width: $(".leftBox").width() - 10 }
- } else {
- self.iframeList.forEach(function (item) {
- item.boxStyle = { width: Math.trunc($(".leftBox").width() / 2 / (self.iframeList.length - 1)) }
- item.iframeStyle = { width: item.boxStyle.width - 10 }
- })
- self.iframeList[self.iframeList.length - 1].boxStyle = { width: Math.trunc($(".leftBox").width() / 2) - 1 }
- self.iframeList[self.iframeList.length - 1].iframeStyle = { width: self.iframeList[self.iframeList.length - 1].boxStyle.width - 10 }
- }
- $scope.$apply();
- }
- })
- })
- }])
- app.directive("repeatFinish", function () {
- return {
- link: function (scope) {
- if (scope.$last == true) {
- $("#iframeList").css("height", $(window).height() - 115)
- }
- }
- };
- });
- app.directive("spCheckboxBlueItem", function () {
- return {
- restrict: "A",
- link: function (scope, elem, attrs) {
- if (!scope == false) {
- spng.funcheckbox(elem, "chb-blue", "chb-blue-checked"); //蓝色checkbox
- }
- }
- }
- });
- app.filter('trustHtml', function ($sce) {
- return function (input) {
- return $sce.trustAsHtml(input.replace(/\n/g, '<br/>').replace(/\s/g, ' '));
- };
- });
- //canvas画布签字
- function lineCanvas(obj) {
- var self = this;
- self.linewidth = 1;
- self.color = "#000000";
- self.background = "#ffffff";
- self.canvas = document.createElement("canvas");
- document.getElementById(obj).appendChild(self.canvas);
- self.cxt = self.canvas.getContext("2d");
- self.canvas.width = document.getElementById(obj).clientWidth;
- self.canvas.height = document.getElementById(obj).scrollHeight;
- self.cxt.fillStyle = self.background;
- self.cxt.fillRect(0, 0, self.canvas.width, self.canvas.width);
- self.cxt.strokeStyle = self.color;
- self.cxt.lineWidth = self.linewidth;
- self.cxt.lineCap = "round";
- //开始绘制
- self.canvas.addEventListener("mousedown", function (e) {
- self.cxt.beginPath();
- self.cxt.lineTo(e.pageX - $(".formedit .sp-page-center").offset().left - 52, e.pageY - document.getElementById(obj).offsetTop + $(".formedit").scrollTop() - 95);
- self.canvas.addEventListener("mousemove", move)
- }.bind(self), false);
- //绘制中
- function move() {
- var e = window.event;
- self.cxt.lineTo(e.pageX - $(".formedit .sp-page-center").offset().left - 52, e.pageY - document.getElementById(obj).offsetTop + $(".formedit").scrollTop() - 95);
- self.cxt.stroke();
- }
- //结束绘制
- self.canvas.addEventListener("mouseup", up)
- function up() {
- self.cxt.closePath();
- self.canvas.removeEventListener("mousemove", move)
- }
- };
- function showRightBox() {
- $(".leftBox").css("width", "50%");
- $(".rightBox").css("width", "50%")
- $(".rightBox").show();
- $("#rightList").show();
- $(".border-left-right").show()
- $(".border-left-right").prev().show()
- $(".border-left-right").prev().find(".fa-angle-right").show()
- $(".border-left-right").prev().find(".fa-angle-left").hide()
- if ($("#rightList").prev().is(":hidden") == true) {
- $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
- $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
- $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
- } else {
- $(".formedit").css("width", $(".rightBox").width() - 36).css("height", $(".rightBox").height())
- $(".formedit1").css("width", $(".rightBox").width() - 36).css("height", $(".rightBox").height())
- $(".formedit2").css("width", $(".rightBox").width() - 36).css("height", $(".rightBox").height())
- }
- angular.element(document.getElementById("app")).scope().changeSize(2)
- }
- function showRight(e) {
- if ($(e).children(".fa-angle-left").is(":hidden")) {
- $(".leftBox").css("width", "calc(100% - 15px)");
- $(".rightBox").css("width", "15px");
- $(e).siblings().hide()
- $(e).children(".fa-angle-left").show()
- $(e).children(".fa-angle-right").hide()
- } else {
- $(".leftBox").css("width", "50%");
- $(".rightBox").css("width", "50%");
- $(e).siblings().show()
- $(e).children(".fa-angle-left").hide()
- $(e).children(".fa-angle-right").show()
- }
- angular.element(document.getElementById("app")).scope().changeSize(1)
- }
- function showToggle(e) {
- document.getElementById("selectDiv").style.top = e.style.top;
- //document.getElementById("selectDiv").toggle();
- $(e).children().toggle()
- $(e).next().toggle()
- }
- function toggleYJL(e) {
- if ($(e).children(".fa-angle-double-down").is(":hidden") == true) {
- $(e).parent().css("height", 420)
- angular.element(document.getElementById("app")).scope().openOptionList1()
- } else {
- $(e).parent().css("height", 10)
- angular.element(document.getElementById("app")).scope().closeToggle()
- }
- $(e).children().toggle()
- }
- function toggleForm(e) {
- $(e).children().toggle()
- $(".toggleForm").toggle()
- }
- function refreshGLJ(n) {
- angular.element(document.getElementById("app")).scope().refreshGLJ(n)
- }
- //文字不可被选中
- document.body.onselectstart = function () {
- return false;
- }
|