123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826 |
- '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.oadministrator = $.cookie("GlWorkPlatform-username") == "oadministrator"
- self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
- self.routeid = sp.getUrlName("routeid");
- self.routeinfoid = sp.getUrlName("routeinfoid");
- 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.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.arrayFile = null;
- self.arrayFile1 = [];
- self.uploading_zw = false;
- self.uploading = false;
- self.upload_zw = function () {
- $('#fileupload-zw').fileupload({
- url: apiurljs.login + (self.routeinfoid == 0 ? 'g2app/abase/uploadFileWithFormWithSaveRouteinfo' : 'g2app/abase/uploadFileWithFormAndGetPage'),//'g2app/abase/uploadFileWithForm'),
- dataType: 'json',
- beforeSend: function (xhr, data) {
- xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
- if (self.routeinfoid == 0) {
- 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=领导批示承办单-正文"));
- } else {
- 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_zw = true;
- data.submit();
- $scope.$apply();
- }
- },
- // 上传完成后的执行逻辑
- done: function (e, data) {
- self.uploading_zw = false;
- if (self.routeinfoid == 0) {
- var res = strToJson(s4.decryptData_CBC(data.result.data));
- self.data.ID = res.data2.ID;
- self.routeid = res.data2.ROUTEID;
- self.routeinfoid = res.data2.ROUTEINFOID;
- self.getSwenList(0)
- } else {
- self.getOther()
- }
- }
- })
- }
- self.upload = function () {
- $('#fileupload').fileupload({
- url: apiurljs.login + 'g2app/abase/uploadFileWithFormAndGetPage',//'g2app/abase/uploadFileWithForm',
- dataType: 'json',
- beforeSend: function (xhr, data) {
- xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
- 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.filename == 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.filename == 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 = {
- CPSX: false,
- JJCD: false,
- SWLB: false,
- SWBH: false,
- LWDW: false,
- LWWH: false,
- LWRQ: false,
- PSLD: false,
- BT: false,
- SZFNBYJ: false,
- SLDPS: false,
- BFSNBYJ: false,
- WLDPS: false,
- CBCSCLQK: false,
- ZDDB: false,
- CDCS: false,
- DBSX: false,
- ZBCS: false,
- SFBJ: false,
- BJQK: false,
- FGLDBJQR: false,
- BZ: false,
- NGR: false,
- ZBRQ: false,
- USAGE: false
- }
- self.show = {
- CPSX: false,
- JJCD: false,
- SWLB: false,
- SWBH: false,
- LWDW: false,
- LWWH: false,
- LWRQ: false,
- PSLD: false,
- BT: false,
- SZFNBYJ: false,
- SLDPS: false,
- BFSNBYJ: false,
- WLDPS: false,
- CBCSCLQK: false,
- ZDDB: false,
- CDCS: false,
- DBSX: false,
- ZBCS: false,
- SFBJ: false,
- BJQK: false,
- FGLDBJQR: false,
- BZ: false,
- NGR: false,
- ZBRQ: false,
- USAGE: false
- }
- 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("formeditZW.html") > -1) {
- self.Title = item.VNAME;
- }
- if (item.TEMPFORM.indexOf("?docmode") > 0) {
- 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.getJJQK()
- })
- }
- self.getJJQK = function () {
- var data = {
- ckey: "CODE_EMERGENCY",
- 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.JJCD = res.data.CODE_EMERGENCY;
- self.getSWLB()
- })
- }
- self.getSWLB = function () {
- var data = {
- ckey: "CODE_SWLB",
- 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.SWLB = res.data.CODE_SWLB;
- self.getZDDB()
- })
- }
- self.getZDDB = function () {
- var data = {
- ckey: "CODE_OVERSEE",
- 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.ZDDB = res.data.CODE_OVERSEE;
- self.getSFBJ()
- })
- }
- self.getSFBJ = function () {
- var data = {
- ckey: "CODE_SF",//"CODE_SFBJ",
- 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.SFBJ = res.data.CODE_SF;
- self.getFGLDBJQR()
- })
- }
- self.getFGLDBJQR = function () {
- var data = {
- ckey: "CODE_OPTION",
- 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.FGLDBJQR = res.data.CODE_OPTION;
- self.getDpList()
- })
- }
- self.getDpList = function () {
- var data = {
- unitid: "AA"
- }
- $http.post(apiurljs.login + "g2app/dataabase/querySectByCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.dpList = [];
- res.data.forEach(function (item) {
- if (item.CHILD_DATA.length == 0) {
- self.dpList.push(item)
- } else {
- item.CHILD_DATA.forEach(function (item1) {
- if (item1.CHILD_DATA.length == 0) {
- self.dpList.push(item1)
- } else {
- item1.CHILD_DATA.forEach(function (item2) {
- if (item2.CHILD_DATA.length == 0) {
- self.dpList.push(item2)
- }
- })
- }
- })
- }
- })
- self.dpList.forEach(function (item) {
- item.checked = false;
- })
- self.DpList = {
- ZBCS: JSON.parse(JSON.stringify(self.dpList)),
- CDCS: JSON.parse(JSON.stringify(self.dpList))
- }
- self.AllCheckedDp = {};
- self.DpLength = {};
- self.selectDpList = {};
- 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.getSWBH()
- })
- }
- self.getSWBH = function () {
- var data = {
- flowid: sp.getUrlName("flowid")
- }
- $http.post(apiurljs.login + "g2app/shouwen/querySWCodeByFlowid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.SWBH = res.data;
- self.getData()
- })
- }
- //获取数据
- self.getData = function () {
- var data = {
- ckey: "SW_LDPSCBD",
- 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.SW_LDPSCBD.ID,
- APPCODE: res.data.SW_LDPSCBD.APPCODE,
- CPSX: res.data.SW_LDPSCBD.CPSX,
- JJCD: res.data.SW_LDPSCBD.JJCD == "" ? self.JJCD[0].CODE : res.data.SW_LDPSCBD.JJCD,
- SWLB: res.data.SW_LDPSCBD.SWLB == "" ? self.SWLB[0].CODE : res.data.SW_LDPSCBD.SWLB,
- SWBH: res.data.SW_LDPSCBD.SWBH == "" ? self.SWBH.replace("|", "〔 ").replace("|", " 〕") + "号" : res.data.SW_LDPSCBD.SWBH,
- SWBH1: res.data.SW_LDPSCBD.SWBH,
- LWDW: res.data.SW_LDPSCBD.LWDW,
- LWWH: res.data.SW_LDPSCBD.LWWH == "" ? "〔 " + sp.currentYear() + " 〕号" : res.data.SW_LDPSCBD.LWWH,
- LWRQ: res.data.SW_LDPSCBD.LWRQ == "" || res.data.SW_LDPSCBD.LWRQ == null ? sp.format(sp.getLocalDate()) : sp.format(res.data.SW_LDPSCBD.LWRQ),
- PSLD: res.data.SW_LDPSCBD.PSLD,
- BT: res.data.SW_LDPSCBD.BT,
- SZFNBYJ: res.data.SW_LDPSCBD.SZFNBYJ,//1
- SLDPS: res.data.SW_LDPSCBD.SLDPS,//1
- SFDB: "C01",
- ZDDB: res.data.SW_LDPSCBD.ZDDB == "" ? self.ZDDB[1].CODE : res.data.SW_LDPSCBD.ZDDB,
- CDCS: res.data.SW_LDPSCBD.CDCS,
- DBSX: res.data.SW_LDPSCBD.DBSX == "" ? "" : sp.format(res.data.SW_LDPSCBD.DBSX),
- ZBCS: res.data.SW_LDPSCBD.ZBCS,
- ZBCSCODE: res.data.SW_LDPSCBD.ZBCSCODE,
- SFBJ: res.data.SW_LDPSCBD.SFBJ == "" ? self.SFBJ[0].CODE : res.data.SW_LDPSCBD.SFBJ,
- SFBJRQ: res.data.SW_LDPSCBD.SFBJRQ,
- BJUSERNAME: res.data.SW_LDPSCBD.BJUSERNAME,
- BJUSERID: res.data.SW_LDPSCBD.BJUSERID,
- BJQK: res.data.SW_LDPSCBD.BJQK,
- FGLDBJQR: res.data.SW_LDPSCBD.FGLDBJQR,
- BZ: res.data.SW_LDPSCBD.BZ,
- NGR: res.data.SW_LDPSCBD.NGR == "" ? self.userName : res.data.SW_LDPSCBD.NGR,
- ZBRQ: res.data.SW_LDPSCBD.ZBRQ == "" || res.data.SW_LDPSCBD.ZBRQ == null ? sp.format(sp.getLocalDate()) : sp.format(res.data.SW_LDPSCBD.ZBRQ),
- SWQXLX: res.data.SW_LDPSCBD.SWQXLX == "" ? res.data.SW_LDPSCBD.ZDDB != "C01" ? "办理" : "督办" : res.data.SW_LDPSCBD.SWQXLX,
- USAGE: res.data.SW_LDPSCBD.USAGE
- }
- self.readonly = {
- CPSX: res.data.SW_LDPSCBD["CPSX.EREADONLY"] == "true",
- JJCD: res.data.SW_LDPSCBD["JJCD.EREADONLY"] == "true",
- SWLB: res.data.SW_LDPSCBD["SWLB.EREADONLY"] == "true",
- SWBH: res.data.SW_LDPSCBD["SWBH.EREADONLY"] == "true",
- LWDW: res.data.SW_LDPSCBD["LWDW.EREADONLY"] == "true",
- LWWH: res.data.SW_LDPSCBD["LWWH.EREADONLY"] == "true",
- LWRQ: res.data.SW_LDPSCBD["LWRQ.EREADONLY"] == "true",
- PSLD: res.data.SW_LDPSCBD["PSLD.EREADONLY"] == "true",
- BT: res.data.SW_LDPSCBD["BT.EREADONLY"] == "true",
- SZFNBYJ: res.data.SW_LDPSCBD["SZFNBYJ.EREADONLY"] == "true",
- SLDPS: res.data.SW_LDPSCBD["SLDPS.EREADONLY"] == "true",
- BFSNBYJ: res.data.SW_LDPSCBD["BFSNBYJ.EREADONLY"] == "true",
- WLDPS: res.data.SW_LDPSCBD["WLDPS.EREADONLY"] == "true",
- CBCSCLQK: res.data.SW_LDPSCBD["CBCSCLQK.EREADONLY"] == "true",
- ZDDB: res.data.SW_LDPSCBD["ZDDB.EREADONLY"] == "true",
- CDCS: res.data.SW_LDPSCBD["CDCS.EREADONLY"] == "true",
- DBSX: res.data.SW_LDPSCBD["DBSX.EREADONLY"] == "true",
- ZBCS: res.data.SW_LDPSCBD["ZBCS.EREADONLY"] == "true",
- SFBJ: res.data.SW_LDPSCBD["SFBJ.EREADONLY"] == "true",
- BJQK: res.data.SW_LDPSCBD["BJQK.EREADONLY"] == "true",
- FGLDBJQR: res.data.SW_LDPSCBD["FGLDBJQR.EREADONLY"] == "true",
- BZ: res.data.SW_LDPSCBD["BZ.EREADONLY"] == "true",
- NGR: res.data.SW_LDPSCBD["NGR.EREADONLY"] == "true",
- ZBRQ: res.data.SW_LDPSCBD["ZBRQ.EREADONLY"] == "true",
- USAGE: res.data.SW_LDPSCBD["USAGE.EREADONLY"] == "true"
- }
- self.show = {
- CPSX: res.data.SW_LDPSCBD["CPSX.ESHOW"] == "true",
- JJCD: res.data.SW_LDPSCBD["JJCD.ESHOW"] == "true",
- SWLB: res.data.SW_LDPSCBD["SWLB.ESHOW"] == "true",
- SWBH: res.data.SW_LDPSCBD["SWBH.ESHOW"] == "true",
- LWDW: res.data.SW_LDPSCBD["LWDW.ESHOW"] == "true",
- LWWH: res.data.SW_LDPSCBD["LWWH.ESHOW"] == "true",
- LWRQ: res.data.SW_LDPSCBD["LWRQ.ESHOW"] == "true",
- PSLD: res.data.SW_LDPSCBD["PSLD.ESHOW"] == "true",
- BT: res.data.SW_LDPSCBD["BT.ESHOW"] == "true",
- SZFNBYJ: res.data.SW_LDPSCBD["SZFNBYJ.ESHOW"] == "true",
- SLDPS: res.data.SW_LDPSCBD["SLDPS.ESHOW"] == "true",
- BFSNBYJ: res.data.SW_LDPSCBD["BFSNBYJ.ESHOW"] == "true",
- WLDPS: res.data.SW_LDPSCBD["WLDPS.ESHOW"] == "true",
- CBCSCLQK: res.data.SW_LDPSCBD["CBCSCLQK.ESHOW"] == "true",
- ZDDB: res.data.SW_LDPSCBD["ZDDB.ESHOW"] == "true",
- CDCS: res.data.SW_LDPSCBD["CDCS.ESHOW"] == "true",
- DBSX: res.data.SW_LDPSCBD["DBSX.ESHOW"] == "true",
- ZBCS: res.data.SW_LDPSCBD["ZBCS.ESHOW"] == "true",
- SFBJ: res.data.SW_LDPSCBD["SFBJ.ESHOW"] == "true",
- BJQK: res.data.SW_LDPSCBD["BJQK.ESHOW"] == "true",
- FGLDBJQR: res.data.SW_LDPSCBD["FGLDBJQR.ESHOW"] == "true",
- BZ: res.data.SW_LDPSCBD["BZ.ESHOW"] == "true",
- NGR: res.data.SW_LDPSCBD["NGR.ESHOW"] == "true",
- ZBRQ: res.data.SW_LDPSCBD["ZBRQ.ESHOW"] == "true",
- USAGE: res.data.SW_LDPSCBD["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)
- self.filedChange = true;
- var buttonList = [{ CNAME: "转发", CODE: "array", data: [] }];
- res.data["SW_LDPSCBD.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["SW_LDPSCBD.FUNCLIST"];
- var n = {}, all = {};
- for (var i in self.DpList) {
- self.AllCheckedDp[i] = false;
- self.DpLength[i] = 0;
- self.selectDpList[i] = []
- all[i] = 0;
- $.each(self.DpList[i], function (index, item) {
- self.DpLength[i]++
- if (self.data.ZBCS.indexOf(item.SECTION) != -1 && i == "ZBCS") {
- all[i]++;
- item.checked = true;
- self.selectDpList[i].push(item);
- }
- if (self.data.CDCS.indexOf(item.SECTION) != -1 && i == "CDCS") {
- all[i]++;
- item.checked = true;
- self.selectDpList[i].push(item);
- }
- })
- if (all[i] == self.DpList[i].length) {
- self.AllCheckedDp[i] = true;
- } else {
- self.AllCheckedDp[i] = false;
- }
- }
- self.getOpinion1(0)
- self.getOther1(0)
- self.getOther()
- self.getGLJ(0)
- self.getMeetMsg()
- $interval(function () {
- self.getNumMeet()
- }, 2000)
- self.opinionList = [{
- name: "办公室拟办意见",
- col: "BFSNBYJ",
- show: !self.hide("show", "BFSNBYJ"),
- readonly: self.hide("readonly", "BFSNBYJ")
- }, {
- name: "委领导批示",
- col: "WLDPS",
- show: !self.hide("show", "WLDPS"),
- readonly: self.hide("readonly", "WLDPS")
- }, {
- name: "承办处室处理情况",
- col: "CBCSCLQK",
- show: !self.hide("show", "CBCSCLQK"),
- readonly: self.hide("readonly", "CBCSCLQK")
- }]
- self.opinionList1 = [];
- self.opinionList.forEach(function (item) {
- if (item.show == true) {
- self.opinionList1.push(item)
- }
- })
- if (self.opinionList1.length > 0) {
- self.opiniontype = self.opinionList1[0].col;
- }
- $timeout(function () {
- if ($(".toggleForm").prevAll().length == 1) {
- $(".toggleForm").prevAll().hide()
- }
- }, 5)
- })
- }
- //替换正文
- self.replaceZW = function () {
- console.log(self.arrayFile)
- 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: self.arrayFile.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.closeCenter(".sp-dialog");
- if (res.success) {
- $.each(self.iframeList, function (index, item) {
- if (item.title == "正文") {
- self.closeItem(index);
- }
- })
- $('#fileupload-zw').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("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_zw = true;
- data.submit();
- $scope.$apply();
- }
- },
- // 上传完成后的执行逻辑
- done: function (e, data) {
- self.uploading_zw = false;
- self.getOther1(1);
- }
- })
- $timeout(function () {
- $("#fileupload-zw").trigger("click")
- }, 1)
- } else {
- sp.dialog("操作失败,请联系管理员!");
- }
- });
- })
- }
- //生成左侧合并文件
- self.getHB = function () {
- self.reloafHB = true;
- var data = {
- routeinfoid: self.routeinfoid,
- tablename: "SW_LDPSCBD",
- templatefilename: "moban31.ftl",
- printdate: "",
- printtype: "1",
- attachtype: "领导批示承办单-正文",
- converttype: 67,
- flowtype: "shouwen",
- standardpage:30
- }
- //$http.post(apiurljs.login + "g2app/dataabase/mergeFormFileByRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- $http.post(apiurljs.login + "g2app/dataabase/mergeFileByRouteinfoidWithPage", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.reloafHB = false;
- self.mulu = res.data.mulu;
- if (res.data.result != "") {
- let postData = {
- convertType: res.data.mark == "ofd" ? 570 : 20,
- isDownload: 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[0].url = $sce.trustAsResourceUrl(sp.ipChange(res.data.viewUrl));
- self.iframeList[0].source = res.data.viewUrl;
- } else {
- sp.dialog(res.message);
- }
- });
- } else {
- var data = {
- routeinfoid: self.routeinfoid,
- tablename: "SW_LDPSCBD",
- templatefilename: "moban31.ftl",
- printdate: "",
- printtype: "1",
- attachtype: "领导批示承办单-正文",
- converttype: 31,
- flowtype: "shouwen"
- }
- $http.post(apiurljs.login + "g2app/dataabase/mergeOFDByRouteinfoidT", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj1) {
- var res1 = strToJson(s4.decryptData_CBC(obj1.data))
- if (res1.data != "") {
- let postData = {
- convertType: 20,
- isDownload: 1,
- fileUrl: res1.data
- };
- 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 (res1) {
- if (res1.errorcode === 0) {
- self.iframeList[0].url = $sce.trustAsResourceUrl(sp.ipChange(res1.data.viewUrl));
- self.iframeList[0].source = res1.data.viewUrl;
- } else {
- sp.dialog(res1.message);
- }
- });
- } else {
- sp.dialog("文件合并失败!")
- }
- })
- }
- })
- }
- self.getHB()
- self.showML = function ($event, ele) {
- $('.show-col').not(ele).hide();
- $(ele).toggle("fast", function () {
- $(ele).css('overflow-y', 'auto')
- }).autoHide();
- $event.stopPropagation();
- }
- self.showHB = function (obj) {
- console.log(obj)
- if (obj.result) {
- var set_convertType = 0;
- if (obj.mark == "doc") {
- set_convertType = 0;
- } else if (obj.mark == "pdf") {
- set_convertType = 20;
- } else if (obj.mark == "ofd") {
- set_convertType = 570;
- } else {
- set_convertType = 0;
- }
- let postData = {
- convertType: set_convertType,
- isSignature: 1,
- isDownload: 1,
- isPrint: obj.mark == "xls" || obj.mark == "xlsx" || obj.mark == "et" ? 0 : 1,
- fileUrl: obj.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, { timeout: 1 })
- .success(function(res){
- if (res.errorcode === 0) {
- self.addItem(sp.ipChange(res.data.viewUrl), obj.result, "正文", "合并文档", false)
- } else {
- sp.dialog(res.message);
- }
- })
- } else {
- sp.dialog("转换失败")
- }
- }
- //获取关联文稿
- 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;
- if (n == 0) {
- self.getGLFLOW()
- }
- if (n == 2) {
- self.editFile(self.guanlian[self.guanlian.length - 1], 2)
- }
- })
- }
- //获取关联流程
- 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);
- })
- }
- //获取意见(不上表)//n为0不调用合并函数,1调用合并函数
- self.getOpinion1 = function (n) {
- self.YJFJ = [];
- var data = {
- cmanid: self.userId,
- routeinfoid: self.routeinfoid,
- routeid: "",//self.routeid,
- tableid: "SW_LDPSCBD",
- 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] = [];
- 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.YJFJ.push(item1)
- })
- })
- if (n == 1) {
- self.getHB()
- }
- } else {
- sp.dialog(res.message)
- }
- })
- }
- //获取正文
- self.getOther1 = function (n) {
- var data = {
- tablename: "FILE_ATTACH",
- colums: "*",
- order: "ID asc",
- sqlwhere: { ROUTEINFOID: self.routeinfoid },
- sqlinwhere: "",
- sqllikewhere: { ATTACHTYPE: "-正文" }
- }
- $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));
- if (res.data.length > 0) {
- res.data.forEach(function (item) {
- if (item.ATTACHTYPE.indexOf("-正文") > -1) {
- self.arrayFile = item;
- }
- })
- if (n > 0) {
- self.seeFile(self.arrayFile, 1, '正文')
- }
- }
- })
- }
- //获取附件
- 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)
- }
- })
- }
- })
- }
- //判断页面字段是否只读readonly、是否隐藏show;(readonly)true-只读 false-可编辑;(show)true-隐藏 false-可见
- 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 "MEETITEM": self.Meet(); break;
- case "SENDLOG": self.RouteList(); break;
- case "array": return; break;
- default: self.forward(item); break;
- }
- }
- //打开公文模板弹窗
- 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.openDpList = function (str) {
- if (self.hide("readonly", str) == true) {
- return
- } else {
- self.filed = str;
- //self.AllCheckedDp = false;
- sp.layer("#DpList")
- $("#DpList .sp-page").eq(0).scrollTop(0);
- }
- }
- self.checkAllDp = function () {
- self.AllCheckedDp[self.filed] = !self.AllCheckedDp[self.filed];
- $.each(self.DpList[self.filed], function (index, item) {
- item.checked = self.AllCheckedDp[self.filed];
- })
- self.submitDpList(1)
- }
- self.checkDpItem = function (item) {
- item.checked = !item.checked;
- var n = 0;
- $.each(self.DpList[self.filed], function (index, item) {
- if (item.checked == true) {
- n++
- }
- })
- if (n == self.DpList[self.filed].length) {
- self.AllCheckedDp[self.filed] = true;
- } else {
- self.AllCheckedDp[self.filed] = false;
- }
- self.submitDpList(1)
- }
- self.submitDpList = function (n) {
- var AllCheckedLength1 = 0;
- self.selectDpList[self.filed] = [];
- $.each(self.DpList[self.filed], function (index, item) {
- if (item.checked == true) {
- AllCheckedLength1++;
- self.selectDpList[self.filed].push(item)
- }
- })
- self.data[self.filed] = self.selectDpList[self.filed].map(function (item) {
- return item.SECTION
- }).join(",")
- if (self.filed == "ZBCS") {
- self.data.ZBCSCODE = self.selectDpList[self.filed].map(function (item) {
- return item.CODE
- }).join(",")
- self.data.CDCS =self.data.CDCS==""? self.data.ZBCS:self.data.CDCS;
- }
- self.AllCheckedDp[self.filed] = AllCheckedLength1 == self.DpLength[self.filed];
- self.changeFiled(self.filed)
- if (n == 0) {
- sp.layerhide();
- }
- }
- self.openLWDW = function () {
- var data = {
- tablename: "CODE_LWDWLABEL"
- }
- //$http.post(apiurljs.login + "g2app/shouwen/getTreeListByTablename", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- $http.post(apiurljs.login + "g2app/shouwen/getTreeListByTablename", data, postCfg)
- .success(function (obj) {
- //var res = strToJson(s4.decryptData_CBC(obj.data));
- var res = obj;
- self.getMenuBtnList(res.data);
- self.LWDW = res.data[0].C_H_I_L_D_DATA;
- self.LWDW.forEach(function (item) {
- item.show = true;
- item.C_H_I_L_D_DATA.forEach(function (item1) {
- item1.checked = false;
- if (item1.CNAME == self.data.LWDW) {
- item1.checked = true;
- }
- })
- })
- sp.layer("#openLWDW")
- })
- .error(function (XMLHttpRequest, textStatus, errorThrown) {
- self.treeData = [];
- })
- }
- self.checkItem = function (obj) {
- self.LWDW.forEach(function (item) {
- item.C_H_I_L_D_DATA.forEach(function (item1) {
- item1.checked = false;
- if (item1.ID == obj.ID) {
- item1.checked=true
- }
- })
- })
- }
- self.submitLWDW = function () {
- self.LWDW.forEach(function (item) {
- item.C_H_I_L_D_DATA.forEach(function (item1) {
- if (item1.checked == true) {
- self.data.LWDW = item1.CNAME;
- }
- })
- })
- self.changeFiled('LWDW')
- sp.layerhide();
- }
- self.setLWDW = function (n) {
- var data = {
- tablename: "CODE_LWDWLABEL"
- }
- //$http.post(apiurljs.login + "g2app/shouwen/getTreeListByTablename", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- $http.post(apiurljs.login + "g2app/shouwen/getTreeListByTablename", data, postCfg)
- .success(function (obj) {
- //var res = strToJson(s4.decryptData_CBC(obj.data));
- var res = obj;
- self.getMenuBtnList(res.data);
- self.treeData = res.data;
- $timeout(function () {
- self.nowNodeCode = self.treeData[0].CODE;
- self.nowNodeName = self.treeData[0].CNAME;
- self.nowNodeID = self.treeData[0].ID;
- self.treeData[0].checked = true;
- if (n == 0) {
- sp.layer("#setLWDW")
- }
- })
- })
- .error(function (XMLHttpRequest, textStatus, errorThrown) {
- self.treeData = [];
- })
- }
- self.getMenuBtnList = function (data) {
- data.forEach(function (item) {
- item.checked = false;
- item.C_H_I_L_D_DATA_L = data.length;
- if (sp.isval(item.C_H_I_L_D_DATA) && item.C_H_I_L_D_DATA.length > 0) {
- self.getMenuBtnList(item.C_H_I_L_D_DATA);
- } else {
- item.C_H_I_L_D_DATA = [];
- }
- })
- }
- self.itemNode = {
- level: "",
- id: "",
- name: "",
- code: "",
- child_title: ""
- }
- self.rightFlag = 0;
- //添加目录树形非一级
- self.itemAdd = function ($item) {
- self.itemNode.level = $item.LEVELS;
- self.itemNode.id = 0;
- self.itemNode.name = $item.CNAME;
- self.itemNode.code = $item.CODE;
- self.itemNode.child_title = "";
- self.rightFlag = 1;
- console.log(self.itemNode)
- };
- //修改目录
- self.itemEdit = function ($item) {
- self.itemNode.level = $item.LEVELS;
- self.itemNode.id = $item.ID;
- self.itemNode.name = $item.CNAME;
- self.itemNode.code = $item.CODE;
- self.itemNode.child_title = $item.CNAME;
- self.rightFlag = 1;
- console.log(self.itemNode)
- };
- //删除底稿
- self.itemDelete = function ($item) {
- var data = {
- "id": $item.ID,
- "tablename": "CODE_LWDWLABEL",
- "parentid": $item.PARENTID,
- "formtablename": ""
- }
- $http.post(apiurljs.login + "g2app/dataabase/delNode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success) {
- self.setLWDW(1);
- self.btnCancal();
- } else {
- sp.dialog(res.message);
- }
- })
- }
- self.btnSetTitle = function () {
- if (self.itemNode.id != 0) {
- if (spngvld.submit("#LWDW")) {
- let postData = {
- id: self.itemNode.id,
- tablename: "CODE_LWDWLABEL",
- data: {
- CNAME: self.itemNode.level == 2 ? self.itemNode.name : self.itemNode.child_title
- }
- }
- $http.post(apiurljs.login + "g2app/dataabase/upFormData", { data: s4.encryptData_CBC(JSON.stringify(postData)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success) {
- self.setLWDW(1);
- self.btnCancal();
- } else {
- sp.dialog(res.message);
- }
- })
- .error(function (XMLHttpRequest, textStatus, errorThrown) {
- })
- }
- } else {
- if (spngvld.submit("#LWDW")) {
- let postData = {
- tablename: "CODE_LWDWLABEL",
- code: self.itemNode.code,
- levels: self.itemNode.level,
- cname: self.itemNode.level == 1 ? self.itemNode.name : self.itemNode.child_title,
- userid: self.userId
- }
- $http.post(apiurljs.login + "g2app/shouwen/TreeAdd", { data: s4.encryptData_CBC(JSON.stringify(postData)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- if (res.success) {
- self.setLWDW(1);
- self.btnCancal();
- } else {
- sp.dialog(res.message);
- }
- })
- .error(function (XMLHttpRequest, textStatus, errorThrown) {
- })
- }
- }
- }
- self.btnCancal = function () {
- self.itemNode = {
- level: "",
- id: "",
- name: "",
- code: "",
- child_title: ""
- }
- self.rightFlag = 0;
- }
-
- //保存提交
- self.btnSave = function (n) {
- if (self.repeat == true) {
- return
- }
- if (spngvld.submit(".formedit")) {
- if (self.data.DBSX == "") {
- sp.dialog("督办时限不能为空!已为您设为来文日期后15天!")
- self.data.DBSX = sp.getNextDate(self.data.LWRQ, 15);
- return
- }
- if (self.data.SWBH1 == "") {
- var postData = {
- swcode: self.SWBH,
- cuserid: self.userId,
- flowid: "AA18"
- }
- $http.post(apiurljs.login + "g2app/shouwen/saveSWCodeBySWCode", { data: s4.encryptData_CBC(JSON.stringify(postData)) }, postCfg)
- .success(function (obj1) {
- var res1 = strToJson(s4.decryptData_CBC(obj1.data));
- if (res1.success) {
- if (res1.data == "-1") {
- sp.dialog("保存失败!");
- return;
- }
- var dataArray = [];
- self.data.USAGE = self.selectUSAGEs.join(",")
- dataArray.push(self.data);
- var data = {
- ckey: "SW_LDPSCBD",
- id: self.data.ID,
- routeid: self.routeid,
- routeinfoid: self.routeinfoid,
- routeinfotitle: self.data.BT.replace(/\n/g, '').replace(/\s/g, ''),//self.data.BT,
- 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.getHB()
- self.filedChange = false;
- if (n == 0) {
- if (res1.data != self.SWBH.split("|")[2]) {
- sp.dialog("收文编号已改变!")
- } else {
- 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)
- }
- })
- } else {
- sp.dialog(res1.message)
- }
- })
- } else {
- var dataArray = [];
- self.data.USAGE = self.selectUSAGEs.join(",")
- dataArray.push(self.data);
- var data = {
- ckey: "SW_LDPSCBD",
- id: self.data.ID,
- routeid: self.routeid,
- routeinfoid: self.routeinfoid,
- routeinfotitle: self.data.BT.replace(/\n/g, '').replace(/\s/g, ''),//self.data.BT,
- 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.getHB()
- self.filedChange = false;
- 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.btnPrint = function () {
- if (self.filedChange == true) {
- self.btnSave(3)
- } else {
- // 创建隐藏的可下载链接
- var eleLink = document.createElement('a');
- eleLink.download = "";
- eleLink.style.display = 'none';
- eleLink.href = apiurljs.login + "g2app/shouwen/PrintWord?data=" + encodeURIComponent(s4.encryptData_CBC("templatefilename=moban33.ftl&tablename=SW_LDPSCBD&outfilepath=/tmp/行政公文.wps&printdate=LWRQ,DBSX,ZBRQ&routeinfoid=" + self.routeinfoid));
- // 触发点击
- document.body.appendChild(eleLink);
- eleLink.click();
- // 然后移除
- document.body.removeChild(eleLink);
- }
- }
- /*综合打印*/
- self.printFiled = 1;
- self.btnPrint1 = function () {
- if (self.filedChange == true) {
- self.btnSave(4)
- } else {
- sp.layer("#print")
- }
- }
- self.printSubmit = function () {
- if (self.printFiled == 4) {
- if (self.deviceType == "pad") {
- window.location.href = "../../../printPreview.html?url=" + apiurljs.yzFcscloud + "g2work/files2/inline/" + self.arrayFile.FILEURL.slice(7)
- } else {
- sp.openNewWindow("../../../printPreview.html?url=" + apiurljs.yzFcscloud + "g2work/files2/inline/" + self.arrayFile.FILEURL.slice(7), '打印预览')
- }
- sp.layerhide()
- return
- }
- if (self.printFiled == 1) {
- var templatefilename = "moban31"
- } else if (self.printFiled == 2) {
- var templatefilename = "mobanoption"
- } else {
- var templatefilename = "moban31_all"
- }
- var data = {
- templatefilename: templatefilename + ".ftl",
- outfilepath: "/tmp/领导批示承办单" + sp.datefmt('yyyyMMddHHmmss', sp.getLocalDate()) + ".wps",
- routeinfoid: self.routeinfoid,
- tablename: "SW_LDPSCBD",
- printtype: self.printFiled,
- printdate: "LWRQ,DBSX,ZBRQ"
- }
- $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));
- 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 = {
- BFSNBYJ: false,
- BFSNBYJImg: false,
- WLDPS: false,
- WLDPSImg: false,
- CBCSCLQK: false,
- CBCSCLQKImg: false,
- nulla: false
- }
- self.YJ = {
- BFSNBYJ: [],
- BFSNBYJSTATUS: false,
- WLDPS: [],
- WLDPSSTATUS: false,
- CBCSCLQK: [],
- CBCSCLQKSTATUS: 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: "SW_LDPSCBD",
- 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;
- }
- //意见附件(上表)
- self.uploading1 = false;
- self.upload1 = 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=SW_LDPSCBD,colid=" + str));
- },
- // 上传完成后的执行逻辑
- done: function (e, data) {
- self.uploading1 = false;
- self.getOpinion1(2)
- }
- })
- }
- //意见附件(下表)
- self.uploading2 = false;
- self.upload2 = function (str) {
- $('#fileupload2').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=SW_LDPSCBD,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: "SW_LDPSCBD",
- 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.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: "SW_LDPSCBD",
- 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: "SW_LDPSCBD",
- 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(1);
- self.nulla = "";
- self.activeOpinion = null;
- self.changeFiled(str)
- } else {
- sp.dialog(res.message)
- }
- })
- }
- self.changeOpinion=function(){
- self.changeYJ=null
- self.YJ.BFSNBYJ.forEach(function(item){
- if(item.USERID=="edcdd69f-f8ec-2089-9b89-406391247be8"&&item.CMAN=="edcdd69f-f8ec-2089-9b89-406391247be8"){
- self.changeYJ=item;
- self.changeYJ.OLDOPINION = item.OPINION;
- }
- })
- self.opinionList.forEach(function(item){
- if(item.col=="BFSNBYJ"){
- self.changeYJ.OPINIONCOL=item.name
- }
- })
- sp.layer("#changeYJ")
- }
- self.submitOption = function () {
- var data = {
- cuserid: self.userId,
- userid: self.changeYJ.CMAN,
- routeid: self.changeYJ.ROUTEID,
- routeinfoid: self.changeYJ.ROUTEINFOID,
- colid: self.changeYJ.COLID,
- tableid: self.changeYJ.TABLEID,
- oldopinion: self.changeYJ.OLDOPINION,
- opinion: self.changeYJ.OPINION
- }
- $http.post(apiurljs.login + "g2app/dataabase/addSysRouteOpinionRecode", { 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.changeFiled("BFSNBYJ")
- sp.layerhide()
- }
- })
- }
- 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: "SW_LDPSCBD",
- 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: "SW_LDPSCBD",
- 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 (self.data.FGLDBJQR == "C01") {
- self.data.SFBJRQ = sp.getLocalDate();
- self.data.BJUSERID = self.userId;
- self.data.BJUSERNAME = self.userName;
- } else {
- self.data.SFBJRQ = "";
- self.data.BJUSERID = "";
- self.data.BJUSERNAME = "";
- }
- if (self.data.ZDDB != "C01") {
- self.data.SWQXLX = "办理";
- } else {
- self.data.SWQXLX = "督办";
- }
- if(str == "DBSX"){
- let objDate = new Date()
- let DBSXDate = new Date(self.data.DBSX)
- let dif_t = DBSXDate.getTime() - objDate.getTime();
- let Day_dif_t = dif_t/(1000*60*60*24)
- if(Day_dif_t>10){
- self.data.CPSX = sp.getNextDate(self.data.DBSX, -2);
- }else{
- self.data.CPSX = sp.getNextDate(self.data.DBSX, -1);
- }
-
- }
- }
- //验证是否重复
- self.repeat = false;
- self.verify = function (str) {
- if (self.data[str] == "") { return; }
- var data = {
- tablename: "SW_LDPSCBD",
- colums: "*",
- order: "ID desc",
- sqlwhere: {},
- sqlinwhere: "",
- sqllikewhere: ""
- }
- data.sqlwhere[str] = self.data[str]
- $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));
- if (res.data.length > 0 && self.data.ID != res.data[0].ID) {
- self.repeat = true;
- sp.dialog("标题已存在,请修改后重试!")
- } else {
- self.repeat = false;
- }
- })
- }
- //转发
- 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=shouwenbg")
- 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).not("#ziliao").hide();
- $(ele).toggle("fast", function () {
- $(ele).css('overflow-y', 'auto')
- }).autoHide();
- $event.stopPropagation();
- }
-
- self.iframeList = [
- { id: 1, title: "收文", filename: "文档", url: "", source: "", 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;
- //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
- }
- if ($(".rightBox .fa-angle-left").is(":hidden")) {
- $(".leftBox").css("width", "calc(100% - 15px)");
- $(".rightBox").css("width", "15px");
- $(".rightBox").children().eq(0).siblings().hide()
- $(".rightBox .fa-angle-left").show()
- $(".rightBox .fa-angle-right").hide()
- }
- 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,
- isDownload: 1,
- fileUrl: num == 1 ? 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) {
- 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.editFile = function (obj, str) {
- $('.show-col').hide();
- var n = 0;
- self.iframeList.forEach(function (item) {
- if (item.title == obj.FILENAMES) {
- n++
- }
- })
- if (n == 0) {
- if (obj.FILEURL.indexOf("files") > -1) {
- var set_filepath = apiurljs.yzFcscloud + "g2work/files/" + obj.FILEURL.slice(7);
- } else {
- var set_filepath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + obj.FILEURL;
- }
- var data = {
- method: 1,
- params: {
- userId: self.userName,
- fileId: "",
- fileName: "",
- filePath: "",
- userRight: self.dotype != 1 ? 1 : 0,
- callbackUrl: ""
- }
- };
- 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);
- 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;
- 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") {
- $timeout(function () {
- self.addItem(sp.ipChange(get_urls), apiurljs.login.split("glwork/")[0] + "glworkweb/" + obj.FILEURL, str, true, obj.ID)
- })
- }
- }
- }
- }
- },
- });
- }
- }
- 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()
- }
- }
- 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" };
- $(".leftBox").css("width", 36)
- $(".border-left-right").hide()
- $(".border-left-right").prev().hide()
- $(".rightBox").css("width", "calc(100% - 36px)")
- $(".rightBox").children().show();
- $(".left-right").hide();
- $(".left-right").prev().hide()
- }
- }
- 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 (n == 1 && $(".fa-angle-left").is(":hidden") == false) {
- showRightBox()
- }
- 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" };
- $(".leftBox").css("width", 36)
- $(".border-left-right").hide()
- $(".border-left-right").prev().hide()
- $(".rightBox").css("width", "calc(100% - 36px)")
- $(".rightBox").children().show();
- $(".left-right").hide();
- $(".left-right").prev().hide()
- }
- }
- 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()
- }
- 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) {
- self.hideItem(n)
- } else if (rightboxW * 1 - (event.pageX - x) * 1 <= 5) {
- 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)
- $scope.changeSize()
- 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";
- $scope.changeSize()
- }
- }
- document.addEventListener("mouseup", function () {
- $(".mousemove").hide()
- document.removeEventListener("mousemove", boxMove)
- })
- })
- }
- 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: "SW_LDPSCBD",
- 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)) {
- if (self.dtslPlaceholder == "地图搜索") {
- 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));
- console.log('map', res.data);
- self.headSearchResult = res.data.build;
- if (sp.isval(self.headSearchResult) && sp.isval(self.headBtnSearchKeyword)) {
- self.headSearchResult_view = true;
- } else {
- self.headSearchResult_view = false;
- }
- })
- } else if (self.dtslPlaceholder == "查企业") {
- } else if (self.dtslPlaceholder == "查项目") {
- }
- } else {
- self.headSearchResult_view = false;
- }
- };
- self.headBtnSearchhc = function(e){
- if(e.keyCode==13){
- if(self.headSearchResult.length>0&&self.dtslPlaceholder == "地图搜索"){
- self.headKeywordPage(self.headSearchResult[0])
- }else if(self.dtslPlaceholder == "查企业"){
- let set_url = `http://10.149.1.35:8003/#/drms/know-application/enterprise-search/SearchResult?hideTitle=true&hideMenus=true&name=${self.headBtnSearchKeyword}&type=company&token=${localStorage.getItem("main-token")}`
- sp.addTabNav("dtsscqy", "查企业", set_url);
- }else if(self.dtslPlaceholder == "查项目"){
- let set_url = `http://10.149.1.35:8003/#/drms/know-application/enterprise-search/SearchResult?hideTitle=true&hideMenus=true&name=${self.headBtnSearchKeyword}&type=project&token=${localStorage.getItem("main-token")}`
- sp.addTabNav("dtsscxm", "查项目", set_url);
- }
- self.headBtnSearchKeyword = ""
- }
- }
- self.headKeywordPage = function (itemdata) {
- if(self.dtslPlaceholder == "地图搜索"){
- 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 + "";
- sp.addTabNav(itemdata.id, '一张图', set_url);
- }else if(self.dtslPlaceholder == "查企业"){
- let set_url = `http://10.149.1.35:8003/#/drms/know-application/enterprise-search/company-detail?hideTitle=true&hideMenus=true&name=${itemdata.name}&id=${itemdata.id}&type=company&token=${localStorage.getItem("main-token")}`
- sp.addTabNav(itemdata.id, itemdata.name, set_url);
- }else if(self.dtslPlaceholder == "查项目"){
- let set_url = `http://10.149.1.35:8003/#/drms/know-application/enterprise-search/project-detail?hideTitle=true&hideMenus=true&name=${itemdata.name}&id=${itemdata.id}&type=project&token=${localStorage.getItem("main-token")}`
- sp.addTabNav(itemdata.id, itemdata.name, set_url);
- }
- self.headSearchResult_view = false;
- self.headBtnSearchKeyword = ""
- };
- self.onePic = function () {
- self.addItem(apiurljs.onePic + "wholeProcessPage?token=" + localStorage.getItem("main-token"), apiurljs.onePic + "wholeProcessPage?token=" + localStorage.getItem("main-token"), "地图搜索", "地图搜索", false)
- if(self.dtslPlaceholder == "地图搜索"){
- self.addItem(apiurljs.onePic + "wholeProcessPage?token=" + localStorage.getItem("main-token"), apiurljs.onePic + "wholeProcessPage?token=" + localStorage.getItem("main-token"), "地图搜索", "地图搜索", false)
- }else{
- self.headBtnSearchhc({keyCode:13})
- }
- }
- self.deptAppList = []
- window.deptClick_FJSKECMADWDSCBNHX = function(deptId,deptName){
- self.deptAppListTitle = deptName
- if(deptId){
- self.deptAppList = []
- sp.layer("#dept-app-list")
- var dptCfg = {
- headers: {
- 'Content-Type': 'application/json',
- 'Access-Token': localStorage.getItem("main-token"),
- }
- };
- $http.get(
- apiurljs.dpt+"auth/system/app-list-divisions?deptId="+deptId,
- dptCfg
- ).success(function (obj) {
- console.log(obj.result)
- self.deptAppList = obj.result
- })
- }
- }
- self.goApp = function(obj){
- sp.layerhide()
- if (obj.indexUrl.indexOf("?") > -1) {
- self.addItem(obj.indexUrl+'&token='+ + localStorage.getItem("main-token"), obj.indexUrl+'&token='+ + localStorage.getItem("main-token"), obj.appName, obj.appName, false)
- } else {
- self.addItem(obj.indexUrl+'&token='+ + localStorage.getItem("main-token"), obj.indexUrl+'&token='+ + localStorage.getItem("main-token"), obj.appName, obj.appName, false)
- }
- }
- self.dtslPlaceholder = "地图搜索"
- self.ZhcxMapList = ['地图搜索']//'查房屋','查从业人员','查项目','查企业',
- self.getZhcxMaoList = function(){
- var dptCfg = {
- headers: {
- 'Content-Type': 'application/json',
- 'Access-Token': localStorage.getItem("main-token"),
- }
- };
- $http.get(
- apiurljs.dpt+"auth/system/app-list-outer?portalShow=1&type=oa",
- dptCfg
- ).success(function (obj) {
- if(obj.result&&obj.result.length>0){
- let appBkList = obj.result
- for(let i=0;i<appBkList.length;i++){
- let appList = appBkList[i].appList
- if(appList&&appList.length>0){
- appList.forEach(function(appItem){
- if(appItem.appCode =='xmqyxx'){
- self.ZhcxMapList.unshift('查项目')
- self.ZhcxMapList.unshift('查企业')
- self.dtslPlaceholder = "查企业"
- }
- })
- }
- }
- }
- })
- }
-
- self.getZhcxMaoList()
- //综合查询移入
- self.zhxcOnclick = function(){
- let el_zhcxList = document.getElementById("zhcx-map-list")
- if(el_zhcxList.style.display == 'block'){
- el_zhcxList.style.display = 'none'
- }else{
- el_zhcxList.style.display = 'block'
- }
- }
- self.zhxcOnmouseenter = function(){
- let el_zhcxList = document.getElementById("zhcx-map-list")
- el_zhcxList.style.display = 'block'
- }
- self.zhxcOnmouseleave = function () {
- let el_zhcxList = document.getElementById("zhcx-map-list")
- el_zhcxList.style.display = 'none';
- }
- self.zhcxMapClick = function(item){
- if(item != self.dtslPlaceholder){
- self.headSearchResult_view = false;
- self.headBtnSearchKeyword = ""
- self.dtslPlaceholder = item
- }
- }
-
- $scope.changeSize = function () {
- self.changeSize()
- $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)
- }, 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) {
- $("#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('treeView', [function () {
- return {
- restrict: 'EA',
- templateUrl: '/treeView.html',
- scope: {
- treeData: '=',///声明数据
- textField: '@',
- itemAdd: '&', ///声明新增变量
- itemEdit: '&',///声明修改变量
- itemCheck: '&',///声明修改变量
- itemDelete: '&',///声明修改变量
- itemUp: '&',
- itemDown: '&'
- },
- controller: ['$scope', function ($scope) {
- $scope.itemExpended = function (item, $event) {
- item.$$isExpend = !item.$$isExpend;
- $event.stopPropagation();
- };
- ///展开折叠图标设置
- $scope.getItemIcon = function (item) {
- var isEnd = $scope.isEnd(item);
- if (isEnd) {
- return 'fa fa-paper-plane-o';
- }
- return item.$$isExpend ? 'fa fa-plus-square-o' : 'fa fa-minus-square-o';
- };
- ///判断是否是最后一级菜单
- $scope.isEnd = function (item) {
- return !item.C_H_I_L_D_DATA || !item.C_H_I_L_D_DATA.length;
- };
- ///事件调用返回
- $scope.warpCallback = function (callback, item, $index, $event) {
- ($scope[callback] || angular.noop)({
- $item: item,
- $index: $index,
- $event: $event
- });
- };
- }]
- };
- }]);
- 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").offset().left - 12, e.pageY - document.getElementById(obj).offsetTop + $(".formedit").scrollTop() - 60);
- self.canvas.addEventListener("mousemove", move)
- }.bind(self), false);
- //绘制中
- function move() {
- var e = window.event;
- self.cxt.lineTo(e.pageX - $(".formedit").offset().left - 12, e.pageY - document.getElementById(obj).offsetTop + $(".formedit").scrollTop() - 60);
- self.cxt.stroke();
- }
- //结束绘制
- self.canvas.addEventListener("mouseup", up)
- function up() {
- self.cxt.closePath();
- self.canvas.removeEventListener("mousemove", move)
- }
- };
- function showRightBox() {
- $(".leftBox").css("width", "70%");
- $(".rightBox").css("width", "30%")
- $(".rightBox").show();
- $(".rightBox").children().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()
- angular.element(document.getElementById("app")).scope().changeSize()
- }
- 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()
- }
- 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;
- }
|