tree.vue 222 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066
  1. <template>
  2. <div style="height: 100%">
  3. <basic-container v-show="showType == 1">
  4. <el-row class="titlerow">
  5. <el-col>
  6. <div style="position: relative">
  7. <span style="float: left; margin-top: 15px; color: white">{{
  8. projectName
  9. }}</span>
  10. <el-button
  11. size="medium"
  12. icon="el-icon-help"
  13. style="margin-right: 10px"
  14. @click="fileTitleHandle"
  15. >文件题名(全局)
  16. </el-button>
  17. <el-dropdown style="margin-right: 10px" @command ="handleBasicClick" v-if="wbsType == 2">
  18. <el-button size="medium">
  19. 基础数据管理<i class="el-icon-arrow-down el-icon--right"></i>
  20. </el-button>
  21. <el-dropdown-menu slot="dropdown">
  22. <el-dropdown-item command="code">编号管理</el-dropdown-item>
  23. <el-dropdown-item command="rule">规范参数配置</el-dropdown-item>
  24. </el-dropdown-menu>
  25. </el-dropdown>
  26. <!-- 同步按钮 -->
  27. <el-button
  28. size="medium"
  29. style="margin-right: 10px"
  30. @click="proSyncbtn"
  31. >项目数据同步
  32. </el-button>
  33. <el-button
  34. size="medium"
  35. style="margin-right: 10px"
  36. icon="el-icon-s-data"
  37. @click="SyncbtnProGress"
  38. >同步进度
  39. </el-button>
  40. <el-button
  41. size="medium"
  42. icon="el-icon-s-grid"
  43. @click="eleFormulaHandle"
  44. v-if="leftType == 5"
  45. >表单设置
  46. </el-button>
  47. <el-button
  48. size="medium"
  49. icon="el-icon-s-grid"
  50. @click="eleHandle"
  51. v-else
  52. >元素设置
  53. </el-button>
  54. <el-button size="medium" icon="el-icon-help" @click="nodeInfoHandle"
  55. >节点参数设置
  56. </el-button>
  57. <el-button
  58. style="margin-top: 10px"
  59. size="medium"
  60. icon="el-icon-price-tag"
  61. @click="independent"
  62. >独立表单库
  63. </el-button>
  64. <el-button
  65. style="margin-top: 10px"
  66. size="medium"
  67. icon="el-icon-time"
  68. @click="archiveTimeClick"
  69. >归档文件时间设置
  70. </el-button>
  71. </div>
  72. </el-col>
  73. </el-row>
  74. <el-row :gutter="20" style="padding: 10px;height: calc(100vh - 200px);">
  75. <el-col :span="8" style="height: 100%">
  76. <div class="h-100p flex flex-d-c">
  77. 工程节点信息
  78. <div
  79. class="flex"
  80. style="align-items: center; justify-content: space-between;margin-top: 10px;margin-bottom: 10px"
  81. >
  82. <div style="flex:1;margin-right: 5px;">
  83. <el-input placeholder="请输入" v-model="filterText" class="w-100p" size="mini" v-if="isNodeType" clearable>
  84. <el-select v-model="searchType" slot="prepend" placeholder="请选择" v-if="isNodeType" style="width: 70px">
  85. <el-option label="节点" value="1"></el-option>
  86. <el-option label="表名" value="2"></el-option>
  87. </el-select>
  88. </el-input>
  89. <el-input placeholder="请输入" v-model="filterText1" class="w-100p" size="mini" v-else clearable>
  90. </el-input>
  91. </div>
  92. <el-button type="primary" @click="searchTreeClick" v-if="isNodeType" size="mini"
  93. >搜索</el-button
  94. >
  95. <el-button type="primary" @click="searchTreeClick1" v-else size="mini"
  96. >搜索</el-button
  97. >
  98. <el-tooltip content="查询工序节点无内业资料类型" placement="top">
  99. <el-button type="success" @click="filterSearchClick" v-if="isNodeType&&!filterByType" size="mini">筛选</el-button>
  100. <el-button type="success" @click="filterSearchClickCancel" v-if="isNodeType&&filterByType" size="mini">取消筛选</el-button>
  101. </el-tooltip>
  102. <el-button
  103. v-if="isNodeType"
  104. style="margin-right: 10px"
  105. size="mini"
  106. icon="el-icon-set-up"
  107. @click="changeType(false)"
  108. type="primary"
  109. >切换表单
  110. </el-button>
  111. <el-button
  112. v-else
  113. style="margin-right: 10px"
  114. size="mini"
  115. icon="el-icon-set-up"
  116. @click="changeType(true)"
  117. type="warning"
  118. >切换节点
  119. </el-button>
  120. </div>
  121. <div class="flex1 ov-hidden" v-if=isNodeType>
  122. <el-scrollbar class="h-100p" v-if="isShowTree">
  123. <div v-loading="treeLoad">
  124. <el-tree
  125. class="filter-tree"
  126. lazy
  127. :load="loadNode"
  128. @node-click="getNodeDetail"
  129. :props="defaultProps"
  130. :expand-on-click-node="false"
  131. highlight-current
  132. node-key="id"
  133. ref="tree"
  134. :default-expanded-keys="defaultExpandedKeys"
  135. v-show="!isSearch"
  136. >
  137. <span
  138. class="custom-tree-node"
  139. :class="data.moreShow ? 'show' : ''"
  140. slot-scope="{ node, data }"
  141. @mouseleave="mouseout(data)"
  142. >
  143. <div class="pd-r-20">
  144. {{ node.label }}
  145. <div class="normal-black">
  146. <div>
  147. <el-link :underline="false">
  148. <i
  149. class="el-icon-menu"
  150. @click.stop="showMenu($event, data, node)"
  151. v-if="node.level != 1"
  152. ></i>
  153. </el-link>
  154. <!-- 因右键自定义菜单事件需要获取当前点击的位置,所以此处绑定动态样式来控制菜单实时跟踪鼠标右键点击位置 -->
  155. <ul
  156. v-show="menuvisible"
  157. :style="{
  158. left: menuleft + 'px',
  159. top: menutop + 'px',
  160. }"
  161. class="contextmenu"
  162. >
  163. <li
  164. v-for="item in menusData"
  165. :key="item"
  166. @click="menuClick($event, item, data,node)"
  167. >
  168. <i :class="item.icon"></i>
  169. <el-tooltip
  170. class="item"
  171. effect="light"
  172. :content="item.content"
  173. placement="right-start"
  174. >
  175. <span>{{ item.label }}</span>
  176. </el-tooltip>
  177. </li>
  178. </ul>
  179. </div>
  180. </div>
  181. </div>
  182. </span>
  183. </el-tree>
  184. <el-tree
  185. :load="searchtreeLoad"
  186. :data="searchTreeData"
  187. @node-click="getNodeDetail"
  188. :props="defaultProps"
  189. :expand-on-click-node="false"
  190. highlight-current
  191. node-key="id"
  192. v-show="isSearch"
  193. default-expand-all
  194. >
  195. <span
  196. class="custom-tree-node"
  197. :class="data.moreShow ? 'show' : ''"
  198. slot-scope="{ node, data }"
  199. @mouseleave="mouseout(data)"
  200. >
  201. <div class="pd-r-20">
  202. {{ node.label }}
  203. <div class="normal-black">
  204. <div>
  205. <el-link :underline="false">
  206. <i
  207. class="el-icon-menu"
  208. @click="showMenu($event, data, node)"
  209. v-if="node.level != 1"
  210. ></i>
  211. </el-link>
  212. <ul
  213. v-show="menuvisible"
  214. :style="{
  215. left: menuleft + 'px',
  216. top: menutop + 'px',
  217. }"
  218. class="contextmenu"
  219. >
  220. <li
  221. v-for="item in menusData"
  222. :key="item"
  223. @click="menuClick($event, item, data,node)"
  224. >
  225. <i :class="item.icon"></i>{{ item.label }}
  226. </li>
  227. </ul>
  228. </div>
  229. </div>
  230. </div>
  231. </span>
  232. </el-tree>
  233. </div>
  234. </el-scrollbar>
  235. </div>
  236. <div v-else class="flex1 ov-hidden">
  237. <el-scrollbar >
  238. <el-tree
  239. :default-expanded-keys="defaultExpandedKeysType"
  240. ref="treeByType"
  241. class="filter-tree"
  242. lazy
  243. :load="loadNodeByType"
  244. :props="defaultPropsByType"
  245. :expand-on-click-node="false"
  246. highlight-current
  247. node-key="id"
  248. @node-click="getNodeDetailByType"
  249. @node-expand="handleNodeExpand"
  250. @node-collapse="handleNodeCollapse"
  251. >
  252. <span class="custom-tree-node" slot-scope="{ node, data }">
  253. <div class="pd-r-20">
  254. {{ node.label }}
  255. </div>
  256. </span>
  257. </el-tree>
  258. </el-scrollbar>
  259. </div>
  260. </div>
  261. </el-col>
  262. <el-col :span="16" class="h-100p flex flex-d-c">
  263. <template v-if="leftType == 5">
  264. <div class="mg-b-10" v-if='isNodeType'>节点信息</div>
  265. <div v-if="isNodeType">
  266. <el-table :data="tableData" border style="width: 100%" v-if="wbsType!==2">
  267. <el-table-column
  268. align="center"
  269. prop="nodeName"
  270. label="当前节点"
  271. ></el-table-column>
  272. <el-table-column
  273. align="center"
  274. prop="nodeType"
  275. :formatter="formatCat"
  276. label="节点类型"
  277. width="180"
  278. ></el-table-column>
  279. <el-table-column
  280. align="center"
  281. prop="majorDataType"
  282. :formatter="formMajorType"
  283. label="内业资料类型"
  284. ></el-table-column>
  285. <el-table-column
  286. align="center"
  287. prop="isAddConceal"
  288. label="新增时是否隐藏"
  289. >
  290. <template slot-scope="scope">{{ scope.row.isAddConceal ===1?'是':'否' }}</template>
  291. </el-table-column>
  292. <el-table-column
  293. align="center"
  294. prop="updateUserName"
  295. label="修改人"
  296. ></el-table-column>
  297. <el-table-column
  298. align="center"
  299. prop="updateTime"
  300. label="修改时间"
  301. ></el-table-column>
  302. <el-table-column label="操作" width="150" >
  303. <template slot-scope="scope">
  304. <el-link
  305. size="mini"
  306. type="primary"
  307. class="mg-r-10"
  308. @click="editNodeHandle"
  309. >编辑
  310. </el-link>
  311. <el-link
  312. size="mini"
  313. type="primary"
  314. >节点编辑台账
  315. </el-link>
  316. </template>
  317. </el-table-column>
  318. </el-table>
  319. <el-table :data="tableData" border style="width: 100%" v-else>
  320. <el-table-column
  321. align="center"
  322. prop="nodeName"
  323. label="当前节点"
  324. ></el-table-column>
  325. <el-table-column
  326. align="center"
  327. prop="nodeType"
  328. :formatter="formatCat"
  329. label="节点类型"
  330. width="180"
  331. ></el-table-column>
  332. <el-table-column
  333. align="center"
  334. prop="uniqueCode"
  335. label="参数掩码"
  336. ></el-table-column>
  337. <el-table-column
  338. <el-table-column label="操作" width="150" >
  339. <template slot-scope="scope">
  340. <el-link
  341. size="mini"
  342. type="primary"
  343. class="mg-r-10"
  344. @click="editNodeHandle"
  345. >编辑
  346. </el-link>
  347. <el-link
  348. size="mini"
  349. type="primary"
  350. >节点编辑台账
  351. </el-link>
  352. </template>
  353. </el-table-column>
  354. </el-table>
  355. </div>
  356. <div class="flex jc-sb">
  357. <p>
  358. <span>当前项目信息表</span>
  359. <el-button
  360. type="text"
  361. style="margin-left: 10px"
  362. icon="el-icon-edit-outline"
  363. class="text-icon"
  364. @click="editEditElementForm"
  365. ></el-button>
  366. <el-button
  367. v-if="isNodeType"
  368. type="text"
  369. icon="el-icon-sort"
  370. class="text-icon"
  371. @click="privateTableSort()"
  372. ></el-button>
  373. </p>
  374. <div class="mg-t-10"></div>
  375. </div>
  376. <div style="flex: 1; position: relative; height: calc(100vh - 260px);overflow-y: auto;" v-loading="tableListByTypeLoad">
  377. <!-- 施工方分类 -->
  378. <template v-if="isNodeType">
  379. <template v-if="tableListByType.length > 0">
  380. <div class="category-section" v-for="(item, index) in tableListByType" :key="index">
  381. <div class="category-header">{{item.title}}</div>
  382. <el-table
  383. :data="item.list"
  384. border
  385. style="width: 100%"
  386. >
  387. <el-table-column
  388. align="center"
  389. prop="tableName"
  390. label="表单名称"
  391. ></el-table-column>
  392. <el-table-column
  393. v-if="leftType===5"
  394. align="center"
  395. prop="elementTotal"
  396. width="80"
  397. label="字段总量"
  398. ></el-table-column>
  399. <el-table-column
  400. align="center"
  401. prop="tableType"
  402. :formatter="formatTableType"
  403. label="表单类型"
  404. ></el-table-column>
  405. <el-table-column
  406. align="center"
  407. prop="fillRate"
  408. label="填报率"
  409. ></el-table-column>
  410. <el-table-column
  411. label="是否关联清表"
  412. prop="isLinkTable"
  413. align="center"
  414. v-if="leftType===4"
  415. >
  416. <template slot-scope="scope">
  417. <span v-if="scope.row.isLinkTable == 2">是</span>
  418. <span v-else>否</span>
  419. </template>
  420. </el-table-column>
  421. <el-table-column
  422. align="center"
  423. prop="tableOwner"
  424. :formatter="formatOwner"
  425. label="所属方"
  426. ></el-table-column>
  427. <el-table-column label="操作" align="center" width="500" v-if="leftType == 4">
  428. <template slot-scope="scope">
  429. <el-link type="primary" @click="Associationlist(scope)"
  430. >关联清表
  431. </el-link>
  432. <el-link
  433. class="mg-l-10"
  434. type="primary"
  435. :disabled="
  436. scope.row.excelId == -1 || scope.row.excelId == null
  437. "
  438. @click="
  439. rightClick(
  440. scope.row.pkeyId,
  441. scope.row.excelId,
  442. scope.row.id,
  443. scope.row.initTableName,
  444. scope.row.initTableId
  445. )
  446. "
  447. >编辑元素
  448. </el-link>
  449. <el-link
  450. class="mg-l-10"
  451. type="primary"
  452. :disabled="
  453. scope.row.excelId == -1 || scope.row.excelId == null
  454. "
  455. @click="adjustExcel(scope.row.pkeyId, scope.row.excelId)"
  456. >调整表单
  457. </el-link>
  458. <el-link
  459. class="mg-l-10"
  460. type="primary"
  461. @click="handleEditFormula(scope.$index, scope.row)"
  462. >编辑元素公式
  463. </el-link>
  464. <el-link
  465. class="mg-l-10"
  466. type="danger"
  467. @click="handleDelete(scope.$index, scope.row)"
  468. >删除表单
  469. </el-link>
  470. </template>
  471. </el-table-column>
  472. <el-table-column label="操作" align="center" width="500" v-if="leftType == 5">
  473. <template slot-scope="scope">
  474. <el-button
  475. size="mini"
  476. @click="handlePreview(scope.$index, scope.row)"
  477. >预览
  478. </el-button>
  479. <el-button
  480. size="mini"
  481. @click="handleEdit(scope.$index, scope.row)"
  482. >编辑
  483. </el-button>
  484. <el-button
  485. size="mini"
  486. type="success"
  487. v-throttle="3000"
  488. v-show="scope.row.status == 0"
  489. @click="hideMD(scope.row)"
  490. >取消隐藏
  491. </el-button>
  492. <el-button
  493. size="mini"
  494. type="primary"
  495. v-throttle="3000"
  496. v-show="scope.row.status == 1"
  497. @click="hideMD(scope.row)"
  498. >隐藏表单
  499. </el-button>
  500. <el-button
  501. v-if="isNodeType"
  502. size="mini"
  503. type="danger"
  504. @click="handleDelete(scope.$index, scope.row)"
  505. >删除
  506. </el-button>
  507. </template>
  508. </el-table-column>
  509. </el-table>
  510. </div>
  511. </template>
  512. <el-empty description="暂无数据" v-else ></el-empty>
  513. </template>
  514. <template v-else>
  515. <el-table
  516. :data="formData"
  517. border
  518. height="100%"
  519. style="width: 100%; position: absolute"
  520. >
  521. <el-table-column
  522. align="center"
  523. prop="tableName"
  524. label="表单名称"
  525. ></el-table-column>
  526. <el-table-column
  527. align="center"
  528. prop="tableType"
  529. :formatter="formatTableType"
  530. label="表单类型"
  531. ></el-table-column>
  532. <el-table-column
  533. align="center"
  534. prop="fillRate"
  535. label="填报率"
  536. ></el-table-column>
  537. <el-table-column
  538. label="是否关联清表"
  539. prop="isLinkTable"
  540. align="center"
  541. >
  542. <template slot-scope="scope">
  543. <span v-if="scope.row.isLinkTable == 2">是</span>
  544. <span v-else>否</span>
  545. </template>
  546. </el-table-column>
  547. <el-table-column
  548. align="center"
  549. prop="tableOwner"
  550. :formatter="formatOwner"
  551. label="所属方"
  552. ></el-table-column>
  553. <el-table-column label="操作" align="center" >
  554. <template slot-scope="scope">
  555. <el-button
  556. size="mini"
  557. @click="handlePreview(scope.$index, scope.row)"
  558. >预览
  559. </el-button>
  560. <el-button
  561. size="mini"
  562. @click="handleEdit(scope.$index, scope.row)"
  563. >编辑
  564. </el-button>
  565. </template>
  566. </el-table-column>
  567. </el-table>
  568. </template>
  569. </div>
  570. </template>
  571. <template v-if="leftType == 4&&isNodeType" >
  572. <div style="flex: 1; position: relative; height: calc(100vh - 260px);overflow-y: auto;">
  573. <!-- 施工方分类 -->
  574. <template v-if="tableListByType.length > 0">
  575. <div class="category-section" v-for="(item, index) in tableListByType" :key="index">
  576. <div class="category-header">{{item.title}}</div>
  577. <el-table
  578. :data="item.list"
  579. border
  580. style="width: 100%"
  581. >
  582. <el-table-column
  583. align="center"
  584. prop="tableName"
  585. label="表单名称"
  586. ></el-table-column>
  587. <el-table-column
  588. v-if="leftType===5"
  589. align="center"
  590. prop="elementTotal"
  591. width="80"
  592. label="字段总量"
  593. ></el-table-column>
  594. <el-table-column
  595. align="center"
  596. prop="tableType"
  597. :formatter="formatTableType"
  598. label="表单类型"
  599. ></el-table-column>
  600. <el-table-column
  601. align="center"
  602. prop="fillRate"
  603. label="填报率"
  604. ></el-table-column>
  605. <el-table-column
  606. label="是否关联清表"
  607. prop="isLinkTable"
  608. align="center"
  609. v-if="leftType===4"
  610. >
  611. <template slot-scope="scope">
  612. <span v-if="scope.row.isLinkTable == 2">是</span>
  613. <span v-else>否</span>
  614. </template>
  615. </el-table-column>
  616. <el-table-column
  617. align="center"
  618. prop="tableOwner"
  619. :formatter="formatOwner"
  620. label="所属方"
  621. ></el-table-column>
  622. <el-table-column label="操作" align="center" width="500" v-if="leftType == 4">
  623. <template slot-scope="scope">
  624. <el-link type="primary" @click="Associationlist(scope)"
  625. >关联清表
  626. </el-link>
  627. <el-link
  628. class="mg-l-10"
  629. type="primary"
  630. :disabled="
  631. scope.row.excelId == -1 || scope.row.excelId == null
  632. "
  633. @click="
  634. rightClick(
  635. scope.row.pkeyId,
  636. scope.row.excelId,
  637. scope.row.id,
  638. scope.row.initTableName,
  639. scope.row.initTableId
  640. )
  641. "
  642. >编辑元素
  643. </el-link>
  644. <el-link
  645. class="mg-l-10"
  646. type="primary"
  647. :disabled="
  648. scope.row.excelId == -1 || scope.row.excelId == null
  649. "
  650. @click="adjustExcel(scope.row.pkeyId, scope.row.excelId)"
  651. >调整表单
  652. </el-link>
  653. <el-link
  654. class="mg-l-10"
  655. type="primary"
  656. @click="handleEditFormula(scope.$index, scope.row)"
  657. >编辑元素公式
  658. </el-link>
  659. <el-dropdown @command="handleCommand($event,scope.row)" v-if="isNodeType">
  660. <el-button type="text" class="mg-l-10">
  661. 表单同步<i class="el-icon-arrow-down el-icon--right"></i>
  662. </el-button>
  663. <el-dropdown-menu slot="dropdown">
  664. <el-dropdown-item command="a">同步到项目下所有表单</el-dropdown-item>
  665. <el-dropdown-item command="b">同步其他表单配置</el-dropdown-item>
  666. </el-dropdown-menu>
  667. </el-dropdown>
  668. <el-link
  669. class="mg-l-10"
  670. type="danger"
  671. @click="handleDelete(scope.$index, scope.row)"
  672. >删除表单
  673. </el-link>
  674. </template>
  675. </el-table-column>
  676. <el-table-column label="操作" align="center" width="500" v-if="leftType == 5">
  677. <template slot-scope="scope">
  678. <el-button
  679. size="mini"
  680. @click="handlePreview(scope.$index, scope.row)"
  681. >预览
  682. </el-button>
  683. <el-button
  684. size="mini"
  685. @click="handleEdit(scope.$index, scope.row)"
  686. >编辑
  687. </el-button>
  688. <el-button
  689. size="mini"
  690. type="success"
  691. v-throttle="3000"
  692. v-show="scope.row.status == 0"
  693. @click="hideMD(scope.row)"
  694. >取消隐藏
  695. </el-button>
  696. <el-button
  697. size="mini"
  698. type="primary"
  699. v-throttle="3000"
  700. v-show="scope.row.status == 1"
  701. @click="hideMD(scope.row)"
  702. >隐藏表单
  703. </el-button>
  704. <el-button
  705. v-if="isNodeType"
  706. size="mini"
  707. type="danger"
  708. @click="handleDelete(scope.$index, scope.row)"
  709. >删除
  710. </el-button>
  711. </template>
  712. </el-table-column>
  713. </el-table>
  714. </div>
  715. </template>
  716. <el-empty description="暂无数据" v-else></el-empty>
  717. </div>
  718. </template>
  719. <template v-if="leftType == 4&&!isNodeType" >
  720. <el-table
  721. :data="formData"
  722. border
  723. height="100%"
  724. >
  725. <el-table-column
  726. align="center"
  727. prop="tableName"
  728. label="表单名称"
  729. ></el-table-column>
  730. <el-table-column
  731. align="center"
  732. prop="tableType"
  733. :formatter="formatTableType"
  734. label="表单类型"
  735. ></el-table-column>
  736. <el-table-column
  737. align="center"
  738. prop="fillRate"
  739. label="填报率"
  740. ></el-table-column>
  741. <el-table-column
  742. label="是否关联清表"
  743. prop="isLinkTable"
  744. align="center"
  745. >
  746. <template slot-scope="scope">
  747. <span v-if="scope.row.isLinkTable == 2">是</span>
  748. <span v-else>否</span>
  749. </template>
  750. </el-table-column>
  751. <el-table-column
  752. align="center"
  753. prop="tableOwner"
  754. :formatter="formatOwner"
  755. label="所属方"
  756. ></el-table-column>
  757. <el-table-column label="操作" align="center" width="250">
  758. <template slot-scope="scope">
  759. <el-link type="primary" @click="Associationlist(scope)"
  760. >关联清表
  761. </el-link>
  762. <el-link
  763. class="mg-l-10"
  764. type="primary"
  765. :disabled="
  766. scope.row.excelId == -1 || scope.row.excelId == null
  767. "
  768. @click="
  769. rightClick(
  770. scope.row.pkeyId,
  771. scope.row.excelId,
  772. scope.row.id,
  773. scope.row.initTableName,
  774. scope.row.initTableId
  775. )
  776. "
  777. >编辑元素
  778. </el-link>
  779. <el-link
  780. class="mg-l-10"
  781. type="primary"
  782. :disabled="
  783. scope.row.excelId == -1 || scope.row.excelId == null
  784. "
  785. @click="adjustExcel(scope.row.pkeyId, scope.row.excelId)"
  786. >调整表单
  787. </el-link>
  788. </template>
  789. </el-table-column>
  790. </el-table>
  791. </template>
  792. </el-col>
  793. </el-row>
  794. </basic-container>
  795. <el-row class="h-100p" v-show="showType == 2">
  796. <el-col :span="6" class="h-100p">
  797. <basic-container>
  798. <el-scrollbar class="h-100p">
  799. <el-tree
  800. class="filter-tree"
  801. lazy
  802. :data="typeTreeData"
  803. :load="typeTreeLoadNode"
  804. @node-click="getTypeTreeDetail"
  805. :props="defaultProps"
  806. :expand-on-click-node="false"
  807. highlight-current
  808. node-key="id"
  809. >
  810. </el-tree>
  811. </el-scrollbar>
  812. </basic-container>
  813. </el-col>
  814. <el-col :span="18" class="h-100p">
  815. <basic-container>
  816. <div class="flex h-100p flex-d-c">
  817. <div style="flex: 1; position: relative">
  818. <el-table
  819. :data="formData"
  820. border
  821. height="100%"
  822. style="width: 100%; position: absolute"
  823. >
  824. <el-table-column
  825. align="center"
  826. prop="tableName"
  827. label="表单名称"
  828. ></el-table-column>
  829. <el-table-column
  830. align="center"
  831. prop="tableType"
  832. :formatter="formatTableType"
  833. label="表单类型"
  834. ></el-table-column>
  835. <el-table-column
  836. align="center"
  837. prop="fillRate"
  838. label="填报率"
  839. ></el-table-column>
  840. <el-table-column
  841. label="是否关联清表"
  842. prop="isLinkTable"
  843. align="center"
  844. >
  845. <template slot-scope="scope">
  846. <span v-if="scope.row.isLinkTable == 2">是</span>
  847. <span v-else>否</span>
  848. </template>
  849. </el-table-column>
  850. <el-table-column
  851. align="center"
  852. prop="tableOwner"
  853. :formatter="formatOwner"
  854. label="所属方"
  855. ></el-table-column>
  856. <el-table-column label="操作" align="center">
  857. <template slot-scope="scope">
  858. <el-link type="primary" @click="Associationlist(scope)"
  859. >关联清表
  860. </el-link>
  861. <el-link
  862. class="mg-l-10"
  863. type="primary"
  864. :disabled="
  865. scope.row.excelId == -1 || scope.row.excelId == null
  866. "
  867. @click="
  868. rightClick(
  869. scope.row.pkeyId,
  870. scope.row.excelId,
  871. scope.row.id,
  872. scope.row.initTableName,
  873. scope.row.initTableId
  874. )
  875. "
  876. >编辑元素
  877. </el-link>
  878. <el-link
  879. class="mg-l-10"
  880. type="primary"
  881. :disabled="
  882. scope.row.excelId == -1 || scope.row.excelId == null
  883. "
  884. @click="adjustExcel(scope.row.pkeyId, scope.row.excelId)"
  885. >调整表单
  886. </el-link>
  887. <el-link
  888. class="mg-l-10"
  889. type="primary"
  890. @click="handleEditFormula(scope.$index, scope.row)"
  891. >编辑元素公式
  892. </el-link>
  893. <el-link
  894. class="mg-l-10"
  895. type="danger"
  896. @click="handleDelete(scope.$index, scope.row)"
  897. >删除表单
  898. </el-link>
  899. </template>
  900. </el-table-column>
  901. </el-table>
  902. </div>
  903. <div class="mg-t-10 flex jc-sb">
  904. <div></div>
  905. <el-button size="medium" @click="showType = 1"
  906. >返回WBS树
  907. </el-button>
  908. </div>
  909. </div>
  910. </basic-container>
  911. </el-col>
  912. </el-row>
  913. <!-- 编辑元素表单信息 -->
  914. <el-dialog
  915. title="编辑元素表单信息"
  916. :visible.sync="editElementFormTag"
  917. width="60%"
  918. :modal-append-to-body="false"
  919. >
  920. <div v-if="!isNodeType">
  921. <el-table :data="formDatass" border style="width: 100%">
  922. <el-table-column prop="tableName" label="表名">
  923. <template slot-scope="scope">
  924. <el-input
  925. v-model="scope.row.tableName"
  926. placeholder="请输入表名称"
  927. ></el-input>
  928. </template>
  929. </el-table-column>
  930. <el-table-column prop="tableType" label="表类型">
  931. <template slot-scope="scope">
  932. <el-select v-model="scope.row.tableType" placeholder="请选择">
  933. <el-option
  934. v-for="(item, key) in tableTypelist"
  935. :key="key"
  936. :label="item.dictValue"
  937. :value="item.dictKey"
  938. >
  939. </el-option>
  940. </el-select>
  941. </template>
  942. </el-table-column>
  943. <el-table-column prop="tableOwner" label="所属方">
  944. <template slot-scope="scope">
  945. <el-select v-model="scope.row.tableOwner" placeholder="请选择">
  946. <el-option
  947. v-for="(item, key) in ownerTypeList"
  948. :key="key"
  949. :label="item.dictValue"
  950. :value="item.dictKey"
  951. >
  952. </el-option>
  953. </el-select>
  954. </template>
  955. </el-table-column>
  956. <el-table-column prop="fillRate" label="填报率">
  957. <template slot-scope="scope">
  958. <el-input
  959. v-model="scope.row.fillRate"
  960. placeholder="请输入填报率"
  961. ></el-input>
  962. </template>
  963. </el-table-column>
  964. <el-table-column prop="nodeType" label="节点类型" v-if="wbsType == 5">
  965. <template slot-scope="scope">
  966. <el-select v-model="scope.row.nodeType" placeholder="请选择" >
  967. <el-option
  968. v-for="item in nodeTypelist"
  969. :key="item.id"
  970. :label="item.dictValue"
  971. :value="item.dictKey"
  972. ></el-option>
  973. </el-select>
  974. </template>
  975. </el-table-column>
  976. </el-table>
  977. </div>
  978. <div v-else>
  979. <div class="category-section" v-for="(item, index) in formDatass" :key="index">
  980. <div class="category-header">{{item.title}}</div>
  981. <el-table
  982. :data="item.list"
  983. border
  984. style="width: 100%"
  985. >
  986. <el-table-column prop="tableName" label="表名">
  987. <template slot-scope="scope">
  988. <el-input
  989. v-model="scope.row.tableName"
  990. placeholder="请输入表名称"
  991. ></el-input>
  992. </template>
  993. </el-table-column>
  994. <el-table-column prop="tableType" label="表类型">
  995. <template slot-scope="scope">
  996. <el-select v-model="scope.row.tableType" placeholder="请选择">
  997. <el-option
  998. v-for="(item, key) in tableTypelist"
  999. :key="key"
  1000. :label="item.dictValue"
  1001. :value="item.dictKey"
  1002. >
  1003. </el-option>
  1004. </el-select>
  1005. </template>
  1006. </el-table-column>
  1007. <el-table-column prop="tableOwner" label="所属方">
  1008. <template slot-scope="scope">
  1009. <el-select v-model="scope.row.tableOwner" placeholder="请选择">
  1010. <el-option
  1011. v-for="(item, key) in ownerTypeList"
  1012. :key="key"
  1013. :label="item.dictValue"
  1014. :value="item.dictKey"
  1015. >
  1016. </el-option>
  1017. </el-select>
  1018. </template>
  1019. </el-table-column>
  1020. <el-table-column prop="fillRate" label="填报率">
  1021. <template slot-scope="scope">
  1022. <el-input
  1023. v-model="scope.row.fillRate"
  1024. placeholder="请输入填报率"
  1025. ></el-input>
  1026. </template>
  1027. </el-table-column>
  1028. <el-table-column prop="nodeType" label="节点类型" v-if="wbsType == 5">
  1029. <template slot-scope="scope">
  1030. <el-select v-model="scope.row.nodeType" placeholder="请选择" >
  1031. <el-option
  1032. v-for="item in nodeTypelist"
  1033. :key="item.id"
  1034. :label="item.dictValue"
  1035. :value="item.dictKey"
  1036. ></el-option>
  1037. </el-select>
  1038. </template>
  1039. </el-table-column>
  1040. </el-table>
  1041. </div>
  1042. </div>
  1043. <span slot="footer" class="dialog-footer">
  1044. <el-button @click="editElementFormTag = false">取 消</el-button>
  1045. <el-button
  1046. type="primary"
  1047. @click="editeditElementFormMF()"
  1048. :loading="editeditElementFormMFLoading"
  1049. >确 定</el-button
  1050. >
  1051. </span>
  1052. </el-dialog>
  1053. <!-- 调整表单模板 -->
  1054. <div v-if="excelHtml" class="excelHtml">
  1055. <dynamicExcel
  1056. @remove="removeExcel"
  1057. v-if="excelHtml"
  1058. :pkeyId="GLExcelFrom.id"
  1059. :excelId="GLExcelFrom.excelId"
  1060. />
  1061. </div>
  1062. <el-dialog
  1063. title="调整排序"
  1064. :visible.sync="sortTag"
  1065. width="50%"
  1066. append-to-body
  1067. >
  1068. <ManualSorting v-if="sortTag2" @bianhua="bianhua()" :sort="sort" />
  1069. <span slot="footer" class="dialog-footer">
  1070. <el-button @click="(sortTag = false), (sortTag2 = false)"
  1071. >取 消</el-button
  1072. >
  1073. <el-button type="primary" @click="editSort()" v-loading="sureSortload"
  1074. >确 定</el-button
  1075. >
  1076. </span>
  1077. </el-dialog>
  1078. <!-- 元素表排序 -->
  1079. <tableSortByType
  1080. ref="tableSortRef"
  1081. title="表单排序"
  1082. :sortProLoad="sortProLoad"
  1083. @confirm="editPrivateSort"
  1084. />
  1085. <!-- 关联清表 -->
  1086. <el-dialog
  1087. title="关联清表"
  1088. class="excelBox"
  1089. :visible.sync="GLExcel"
  1090. width="500px"
  1091. modal-append-to-body
  1092. append-to-body
  1093. @close="GLExcelMD"
  1094. >
  1095. <div>
  1096. <el-select
  1097. style="width: 400px"
  1098. v-model="GLExcelFrom.name"
  1099. placeholder="请选择"
  1100. @change="changetherr()"
  1101. >
  1102. <el-option
  1103. v-for="(item, key) in GLExcelData"
  1104. :key="key"
  1105. :label="item.name"
  1106. :value="item.id"
  1107. >
  1108. </el-option>
  1109. </el-select>
  1110. <el-scrollbar style="margin-top: 20px; height: 50vh">
  1111. <el-input
  1112. style="width: 400px"
  1113. v-model.trim="GLExcelFrom.search"
  1114. placeholder="请输入需要选择的内容"
  1115. ></el-input>
  1116. <el-tree
  1117. :filter-node-method="filterNode222"
  1118. ref="tree"
  1119. class="filter-tree"
  1120. style="margin-top: 10px"
  1121. :props="GLExcelProps"
  1122. :data="exceldata"
  1123. node-key="id"
  1124. accordion
  1125. show-checkbox
  1126. @check="checkchange"
  1127. v-loading="GLExcelLoading"
  1128. >
  1129. </el-tree>
  1130. </el-scrollbar>
  1131. </div>
  1132. <span
  1133. slot="footer"
  1134. class="dialog-footer"
  1135. style="display: flex; justify-content: center; align-items: center"
  1136. >
  1137. <el-button @click="GLExcelMD()">取 消</el-button>
  1138. <el-button
  1139. style="margin-left: 30px"
  1140. type="primary"
  1141. v-throttle="2000"
  1142. @click="saveLinkTab()"
  1143. >确 定</el-button
  1144. >
  1145. </span>
  1146. </el-dialog>
  1147. <!-- 节点详情 -->
  1148. <el-dialog
  1149. :title="dialogTitle"
  1150. :visible.sync="dialogVisible"
  1151. width="50%"
  1152. append-to-body
  1153. :close-on-click-modal="false"
  1154. @closed="saveNodeLoading = false"
  1155. >
  1156. <el-form
  1157. ref="nodeDetail"
  1158. :model="nodeDetail"
  1159. :rules="rules"
  1160. label-width="140px"
  1161. >
  1162. <el-form-item label="节点名称" prop="nodeName">
  1163. <div class="flex">
  1164. <el-input v-model="nodeDetail.nodeName"></el-input>
  1165. <el-button class="mg-l-10" type="primary" @click="aliasShow"
  1166. >添加别名
  1167. </el-button>
  1168. </div>
  1169. </el-form-item>
  1170. <el-form-item label="上级节点">
  1171. <el-input v-model="nodeDetail.parentName" disabled></el-input>
  1172. </el-form-item>
  1173. <el-form-item label="节点类型" prop="nodeType">
  1174. <el-select
  1175. v-model="nodeDetail.nodeType"
  1176. placeholder="请选择"
  1177. class="w-100p"
  1178. @change="nodeTypeChange"
  1179. clearable
  1180. >
  1181. <el-option
  1182. v-for="item in nodeTypelist"
  1183. :key="item.id"
  1184. :label="item.dictValue"
  1185. :value="item.dictKey"
  1186. ></el-option>
  1187. </el-select>
  1188. </el-form-item>
  1189. <el-form-item label="划分编号" v-if="wbsType !== 2 && wbsType !== 5">
  1190. <el-input v-model="nodeDetail.partitionCode"></el-input>
  1191. </el-form-item>
  1192. <!-- <el-form-item label="唯一编码" v-if="wbsType !== 5">
  1193. <el-input v-model="nodeDetail.uniqueCode"></el-input>
  1194. </el-form-item> -->
  1195. <el-form-item label="参数掩码" v-if="wbsType !== 5">
  1196. <el-input v-model="nodeDetail.uniqueCode" placeholder="可填写分部评定权值/试验编号配置"></el-input>
  1197. </el-form-item>
  1198. <template v-if="nodeDetail.nodeType == 6">
  1199. <el-form-item label="含附件类型" >
  1200. <el-select
  1201. v-model="nodeDetail.tableFileType"
  1202. placeholder="请选择"
  1203. class="w-100p"
  1204. clearable
  1205. multiple
  1206. >
  1207. <el-option
  1208. v-for="item in tableFileTypeList"
  1209. :key="item.id"
  1210. :label="item.dictValue"
  1211. :value="item.dictKey"
  1212. ></el-option>
  1213. </el-select>
  1214. </el-form-item>
  1215. <el-form-item label="是否有混凝土">
  1216. <el-radio-group v-model="nodeDetail.isConcrete" size="small">
  1217. <el-radio :label="0" border>无</el-radio>
  1218. <el-radio :label="1" border>有</el-radio>
  1219. </el-radio-group>
  1220. </el-form-item>
  1221. <el-form-item label="是否试验节点">
  1222. <el-radio-group v-model="nodeDetail.isExpernode" size="small">
  1223. <el-radio :label="0" border>否</el-radio>
  1224. <el-radio :label="1" border>是</el-radio>
  1225. </el-radio-group>
  1226. </el-form-item>
  1227. </template>
  1228. <el-form-item
  1229. label="内业资料类型"
  1230. prop="majorDataType"
  1231. v-if="wbsType !== 2 && wbsType !== 5"
  1232. >
  1233. <el-select
  1234. v-model="nodeDetail.majorDataType"
  1235. placeholder="请选择"
  1236. class="w-100p"
  1237. clearable
  1238. >
  1239. <el-option
  1240. v-for="item in majorDataTypeList"
  1241. :key="item.id"
  1242. :label="item.dictValue"
  1243. :value="item.dictKey"
  1244. ></el-option>
  1245. </el-select>
  1246. </el-form-item>
  1247. <el-form-item label="标准分类">
  1248. <el-select
  1249. v-model="nodeDetail.className"
  1250. placeholder="请选择"
  1251. class="w-100p"
  1252. @change="changeStandType"
  1253. clearable
  1254. >
  1255. <el-option
  1256. v-for="item in standardTypeOptions"
  1257. :key="item.id"
  1258. :label="item.dictValue"
  1259. :value="item.dictKey"
  1260. ></el-option>
  1261. </el-select>
  1262. </el-form-item>
  1263. <el-form-item label="单元名称">
  1264. <el-select
  1265. v-model="nodeDetail.unitName"
  1266. placeholder="请选择"
  1267. class="w-100p"
  1268. clearable
  1269. >
  1270. <el-option
  1271. v-for="item in unitOptions"
  1272. :key="item.id"
  1273. :label="item.dictValue"
  1274. :value="item.dictKey"
  1275. ></el-option>
  1276. </el-select>
  1277. </el-form-item>
  1278. <el-form-item
  1279. label="是否新增中隐藏"
  1280. prop="isAddConceal"
  1281. v-if="wbsType !== 2 && wbsType !== 5"
  1282. >
  1283. <el-radio-group v-model="nodeDetail.isAddConceal" size="small">
  1284. <el-radio :label="1" border>是</el-radio>
  1285. <el-radio :label="0" border>否</el-radio>
  1286. </el-radio-group>
  1287. </el-form-item>
  1288. <el-form-item
  1289. label="勾选相关联试验"
  1290. prop="mixRatioTestIds"
  1291. v-if="wbsType === 2 && nodeDetail.nodeType === 53"
  1292. >
  1293. <div
  1294. style="position: relative; height: 300px; border: 1px solid #dddfe6"
  1295. >
  1296. <el-scrollbar class="h-100p">
  1297. <div v-loading="testTreeLoad">
  1298. <el-tree
  1299. class="filter-tree"
  1300. :data="testTreeData"
  1301. :props="defaultProps"
  1302. :expand-on-click-node="false"
  1303. highlight-current
  1304. node-key="id"
  1305. ref="treeall"
  1306. show-checkbox
  1307. :default-checked-keys="mixRatioTestIds"
  1308. @check="TestTreeCheckChange"
  1309. />
  1310. </div>
  1311. </el-scrollbar>
  1312. </div>
  1313. </el-form-item>
  1314. </el-form>
  1315. <span slot="footer" class="dialog-footer">
  1316. <el-button @click="dialogVisible = false">取 消</el-button>
  1317. <el-button type="primary" @click="saveNode" :loading="saveNodeLoading"
  1318. >确 定</el-button
  1319. >
  1320. </span>
  1321. </el-dialog>
  1322. <!-- 创建新的元素表 -->
  1323. <el-dialog
  1324. title="创建新的元素表"
  1325. :visible.sync="eleVisible"
  1326. width="80%"
  1327. append-to-body
  1328. :close-on-click-modal="false"
  1329. >
  1330. <el-form
  1331. ref="eleDialog"
  1332. :model="eleForm"
  1333. :rules="eleRules"
  1334. label-width="110px"
  1335. >
  1336. <el-form-item label="表名" prop="nodeName">
  1337. <el-input v-model="eleForm.nodeName"></el-input>
  1338. </el-form-item>
  1339. <el-row>
  1340. <el-col :span="12">
  1341. <el-form-item label="表类型" prop="tableType">
  1342. <el-select
  1343. v-model="eleForm.tableType"
  1344. placeholder="请选择"
  1345. class="w-100p"
  1346. >
  1347. <el-option
  1348. v-for="item in tableTypelist"
  1349. :key="item.id"
  1350. :label="item.dictValue"
  1351. :value="item.dictKey"
  1352. ></el-option>
  1353. </el-select>
  1354. </el-form-item>
  1355. </el-col>
  1356. <el-col :span="12">
  1357. <el-form-item label="所属方" prop="tableOwner">
  1358. <el-select
  1359. v-model="eleForm.tableOwner"
  1360. placeholder="请选择"
  1361. class="w-100p"
  1362. >
  1363. <el-option
  1364. v-for="item in ownerTypeList"
  1365. :key="item.id"
  1366. :label="item.dictValue"
  1367. :value="item.dictKey"
  1368. ></el-option>
  1369. </el-select>
  1370. </el-form-item>
  1371. </el-col>
  1372. </el-row>
  1373. </el-form>
  1374. <div class="flex jc-sb">
  1375. <div></div>
  1376. <div>
  1377. <el-link type="primary" @click="importVisible = true"
  1378. >快捷导入
  1379. </el-link>
  1380. <el-link type="primary" class="mg-l-20" @click="downloadTmp"
  1381. >下载导入模版
  1382. </el-link>
  1383. </div>
  1384. </div>
  1385. <div class="border-grey">
  1386. <p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
  1387. <el-table
  1388. :data="eleForm.elementList"
  1389. border
  1390. style="width: 100%"
  1391. height="400px"
  1392. >
  1393. <el-table-column
  1394. align="center"
  1395. type="index"
  1396. width="50"
  1397. ></el-table-column>
  1398. <el-table-column align="center" prop="eName" label="字段名称">
  1399. <template slot-scope="scope">
  1400. <el-input
  1401. v-model="scope.row.eName"
  1402. size="small"
  1403. placeholder="请输入内容"
  1404. ></el-input>
  1405. </template>
  1406. </el-table-column>
  1407. <el-table-column
  1408. align="center"
  1409. prop="eType"
  1410. label="数据类型"
  1411. width="120"
  1412. >
  1413. <template slot-scope="scope">
  1414. <el-select
  1415. v-model="scope.row.eType"
  1416. size="small"
  1417. placeholder="请选择"
  1418. >
  1419. <el-option
  1420. v-for="item in dataTypeList"
  1421. :key="item.id"
  1422. :label="item.dictValue"
  1423. :value="item.dictKey"
  1424. ></el-option>
  1425. </el-select>
  1426. </template>
  1427. </el-table-column>
  1428. <el-table-column
  1429. align="center"
  1430. prop="eLength"
  1431. label="长度"
  1432. width="120"
  1433. >
  1434. <template slot-scope="scope">
  1435. <el-input
  1436. v-model="scope.row.eLength"
  1437. size="small"
  1438. placeholder="请输入内容"
  1439. :disabled="scope.row.eType == 4"
  1440. ></el-input>
  1441. </template>
  1442. </el-table-column>
  1443. <el-table-column
  1444. align="center"
  1445. prop="eAllowDeviation"
  1446. label="允许偏差值"
  1447. >
  1448. <template slot-scope="scope">
  1449. <div class="flex">
  1450. <el-select
  1451. v-model="scope.row.allow"
  1452. size="small"
  1453. placeholder="请选择"
  1454. style="width: 120px"
  1455. >
  1456. <el-option :key="1" label="≥" value="≥"></el-option>
  1457. <el-option :key="2" label="≤" value="≤"></el-option>
  1458. <el-option :key="3" label="±" value="±"></el-option>
  1459. <el-option :key="4" label="【】" value="【】"></el-option>
  1460. </el-select>
  1461. <el-input
  1462. v-model="scope.row.deviation"
  1463. size="small"
  1464. placeholder="请输入内容"
  1465. ></el-input>
  1466. </div>
  1467. </template>
  1468. </el-table-column>
  1469. <el-table-column
  1470. align="center"
  1471. prop="eInspectionMethod"
  1472. label="检查方法和频率"
  1473. >
  1474. <template slot-scope="scope">
  1475. <el-input
  1476. v-model="scope.row.eInspectionMethod"
  1477. size="small"
  1478. placeholder="请输入内容"
  1479. ></el-input>
  1480. </template>
  1481. </el-table-column>
  1482. <el-table-column align="center" label="操作" width="80">
  1483. <template slot="header">
  1484. <el-button
  1485. @click="addEleRow(eleForm.elementList)"
  1486. type="text"
  1487. icon="el-icon-circle-plus-outline"
  1488. class="text-icon"
  1489. ></el-button>
  1490. </template>
  1491. <template slot-scope="scope">
  1492. <el-button
  1493. icon="el-icon-remove-outline"
  1494. type="text"
  1495. @click="delEleRow(scope.$index, eleForm.elementList)"
  1496. class="text-icon text-icon-danger"
  1497. ></el-button>
  1498. </template>
  1499. </el-table-column>
  1500. </el-table>
  1501. </div>
  1502. <span slot="footer" class="dialog-footer">
  1503. <el-button @click="eleVisible = false">取 消</el-button>
  1504. <el-button type="primary" @click="saveFormAndElementHandle"
  1505. >保 存</el-button
  1506. >
  1507. </span>
  1508. </el-dialog>
  1509. <!-- 模板导入 -->
  1510. <el-dialog
  1511. title="模版导入"
  1512. :visible.sync="importVisible"
  1513. width="50%"
  1514. append-to-body
  1515. :close-on-click-modal="false"
  1516. >
  1517. <p>
  1518. 提示:必须按照系统要求的模版格式上传,否则系统识别无效
  1519. <el-link type="primary" @click="downloadTmp">下载导入模版</el-link>
  1520. </p>
  1521. <div>
  1522. <el-button size="small" type="primary" @click="fileClick2"
  1523. >本地上传
  1524. </el-button>
  1525. <input
  1526. @change="tmpImport"
  1527. type="file"
  1528. hidden
  1529. ref="file2"
  1530. accept=".xls, .xlsx"
  1531. />
  1532. </div>
  1533. <el-table :data="tempList" border style="width: 100%">
  1534. <el-table-column align="center" prop="eName" label="字段信息">
  1535. </el-table-column>
  1536. <el-table-column
  1537. align="center"
  1538. prop="eType"
  1539. label="数据类型"
  1540. width="120"
  1541. >
  1542. </el-table-column>
  1543. <el-table-column align="center" prop="eLength" label="长度" width="120">
  1544. </el-table-column>
  1545. <el-table-column
  1546. align="center"
  1547. prop="eAllowDeviation"
  1548. label="允许偏差值"
  1549. >
  1550. </el-table-column>
  1551. <el-table-column
  1552. align="center"
  1553. prop="eInspectionMethod"
  1554. label="检查方法和频率"
  1555. >
  1556. </el-table-column>
  1557. </el-table>
  1558. <span slot="footer" class="dialog-footer">
  1559. <el-button @click="importVisible = false">取 消</el-button>
  1560. <el-button type="primary" @click="importHandle">确 定</el-button>
  1561. </span>
  1562. </el-dialog>
  1563. <!-- 预览元素 -->
  1564. <el-dialog
  1565. :title="(curEleTable.tableName ? curEleTable.tableName : '') + ''"
  1566. :visible.sync="editEleVisible"
  1567. width="80%"
  1568. append-to-body
  1569. :close-on-click-modal="false"
  1570. >
  1571. <!-- <p class="font-c-warning">编辑元素信息(请谨慎操作)</p> -->
  1572. <el-table :data="editEleList" border style="width: 100%" height="400px">
  1573. <el-table-column
  1574. align="center"
  1575. type="index"
  1576. width="50"
  1577. ></el-table-column>
  1578. <el-table-column align="center" prop="eName" label="字段信息">
  1579. </el-table-column>
  1580. <el-table-column
  1581. align="center"
  1582. prop="eType"
  1583. label="数据类型"
  1584. width="120"
  1585. :formatter="eTypeFormatter"
  1586. >
  1587. </el-table-column>
  1588. <el-table-column align="center" prop="eLength" label="长度" width="120">
  1589. </el-table-column>
  1590. <el-table-column
  1591. align="center"
  1592. prop="eAllowDeviation"
  1593. label="允许偏差值"
  1594. >
  1595. </el-table-column>
  1596. <el-table-column
  1597. align="center"
  1598. prop="eInspectionMethod"
  1599. label="检查方法和频率"
  1600. >
  1601. </el-table-column>
  1602. </el-table>
  1603. <span slot="footer" class="dialog-footer">
  1604. <el-button @click="editEleVisible = false">取 消</el-button>
  1605. <!-- <el-button
  1606. type="primary"
  1607. @click="saveEles"
  1608. >确 定</el-button> -->
  1609. </span>
  1610. </el-dialog>
  1611. <!-- 元素公式 -->
  1612. <el-dialog
  1613. :title="
  1614. (curEleTable.tableName ? curEleTable.tableName : '') + ' 元素公式'
  1615. "
  1616. :visible.sync="editEleFormulaVisible"
  1617. width="800px"
  1618. append-to-body
  1619. :close-on-click-modal="false"
  1620. >
  1621. <div class="flex mg-b-10">
  1622. <el-input
  1623. v-model="formulaInput"
  1624. placeholder="请输入名称"
  1625. size="samll"
  1626. clearable
  1627. @clear="searchFormulaName"
  1628. ></el-input>
  1629. <el-button type="info" class="mg-l-10" @click="searchFormulaName"
  1630. >搜索
  1631. </el-button>
  1632. </div>
  1633. <el-table
  1634. :data="editEleListFilter"
  1635. border
  1636. style="width: 100%"
  1637. height="400px"
  1638. >
  1639. <el-table-column align="center" prop="eName" label="字段信息">
  1640. </el-table-column>
  1641. <el-table-column align="center" label="操作" width="200">
  1642. <template slot-scope="scope">
  1643. <el-link
  1644. :type="scope.row.globalFormula == 1 ? 'warning' : 'primary'"
  1645. @click="toFormulaEdit(scope.row, 10)"
  1646. >全局公式
  1647. </el-link>
  1648. <el-link
  1649. v-show="scope.row.hasPartFormula"
  1650. class="mg-l-10"
  1651. :type="scope.row.isSaveFormula == 1 ? 'warning' : 'primary'"
  1652. @click="toFormulaEdit(scope.row, 20)"
  1653. >节点公式
  1654. </el-link>
  1655. <!-- <el-link
  1656. class="mg-l-10"
  1657. type="danger"
  1658. @click="delEleRowHandle(scope.$index,editEleListFilter)"
  1659. >删除</el-link> -->
  1660. </template>
  1661. </el-table-column>
  1662. </el-table>
  1663. </el-dialog>
  1664. <!-- 导入划分 -->
  1665. <el-dialog
  1666. title="导入划分"
  1667. :visible.sync="importTemplateVisible"
  1668. width="800px"
  1669. append-to-body
  1670. :close-on-click-modal="false"
  1671. >
  1672. <div v-loading="importLoading">
  1673. <div>
  1674. <el-link type="primary" @click="handleDownload">下载导入模版</el-link>
  1675. </div>
  1676. <div class="mg-t-20">
  1677. <el-button type="primary" @click="fileClick">选择文件</el-button>
  1678. <span v-if="upFile" class="mg-l-20">{{ upFile.name }}</span>
  1679. <input
  1680. @change="fileChange"
  1681. type="file"
  1682. hidden
  1683. ref="file"
  1684. accept=".xls, .xlsx"
  1685. />
  1686. </div>
  1687. <div v-if="!upFile">当前还未选择文件,请选择需要导入的文件</div>
  1688. </div>
  1689. <span slot="footer" class="dialog-footer">
  1690. <el-button @click="importTemplateVisible = false">取 消</el-button>
  1691. <el-button
  1692. type="primary"
  1693. @click="importTemplateHandle"
  1694. :loading="importLoading"
  1695. >导 入</el-button
  1696. >
  1697. </span>
  1698. </el-dialog>
  1699. <!-- 节点参数 -->
  1700. <el-dialog
  1701. title="节点参数"
  1702. :visible.sync="nodeInfoVisible"
  1703. width="800px"
  1704. append-to-body
  1705. class="jiedian"
  1706. :close-on-click-modal="false"
  1707. :show-close="false"
  1708. @close="closenodeInfoVisible"
  1709. >
  1710. <div>
  1711. <el-button
  1712. type="text"
  1713. icon="el-icon-s-operation"
  1714. class="right-btn"
  1715. @click="setNodeParameters()"
  1716. ></el-button>
  1717. <div class="flexEnd">
  1718. <i
  1719. class="el-icon-circle-plus marbottom10"
  1720. @click="addNodeInfoTable()"
  1721. style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
  1722. ></i>
  1723. <i
  1724. class="el-icon-refresh-right marbottom10"
  1725. @click="refreshnfoTable()"
  1726. style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
  1727. ></i>
  1728. </div>
  1729. <el-table
  1730. :data="nodeInfoTable"
  1731. border
  1732. style="width: 100%"
  1733. height="400"
  1734. v-loading="nodeInfoTableLoad"
  1735. >
  1736. <el-table-column align="center" prop="name" label="参数名称">
  1737. <template slot-scope="scope">
  1738. <el-select
  1739. v-model="scope.row.k"
  1740. placeholder="请选择"
  1741. class="w-100p"
  1742. >
  1743. <el-option
  1744. v-for="item in namelist"
  1745. :key="item.k"
  1746. :label="item.name"
  1747. :value="item.k"
  1748. ></el-option>
  1749. </el-select>
  1750. </template>
  1751. </el-table-column>
  1752. <el-table-column align="center" prop="value" label="参数值设置">
  1753. <template slot-scope="scope">
  1754. <el-input v-model="scope.row.v"></el-input>
  1755. </template>
  1756. </el-table-column>
  1757. <el-table-column align="center" prop="describe" label="描述">
  1758. <template slot-scope="scope">
  1759. <el-input v-model="scope.row.remark"></el-input>
  1760. </template>
  1761. </el-table-column>
  1762. <el-table-column label="操作" width="120" align="center">
  1763. <template slot-scope="scope">
  1764. <el-button
  1765. type="text"
  1766. size="small"
  1767. class="text-icon-primary"
  1768. @click="linkEle(scope.row)"
  1769. >关联元素
  1770. </el-button>
  1771. <el-button
  1772. type="text"
  1773. size="small"
  1774. class="text-icon-danger"
  1775. @click="delNodeInfoss(scope.$index, scope.row)"
  1776. >删除
  1777. </el-button>
  1778. </template>
  1779. </el-table-column>
  1780. </el-table>
  1781. </div>
  1782. <span slot="footer" class="dialog-footer">
  1783. <el-button @click="nodeInfoVisible = false">取 消</el-button>
  1784. <el-button
  1785. type="primary"
  1786. @click="nodeInfoSave()"
  1787. :loading="nodeInfoSaveload"
  1788. >保 存</el-button
  1789. >
  1790. </span>
  1791. </el-dialog>
  1792. <!-- 设置参数名称 -->
  1793. <el-dialog
  1794. title="设置参数名称"
  1795. :visible.sync="infoNameVisible"
  1796. width="800px"
  1797. append-to-body
  1798. class="jiedian"
  1799. :close-on-click-modal="false"
  1800. >
  1801. <div>
  1802. <div class="flexEnd">
  1803. <i
  1804. class="el-icon-circle-plus marbottom10"
  1805. @click="setParameterName()"
  1806. style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
  1807. ></i>
  1808. </div>
  1809. <el-table :data="namelists" border style="width: 100%" height="400">
  1810. <el-table-column align="center" prop="name" label="参数名称">
  1811. <template slot-scope="scope">
  1812. <el-input v-model="scope.row.name"></el-input>
  1813. </template>
  1814. </el-table-column>
  1815. <el-table-column align="center" prop="key" label="参数值KEY">
  1816. <template slot-scope="scope">
  1817. <el-input v-model="scope.row.k"></el-input>
  1818. </template>
  1819. </el-table-column>
  1820. <el-table-column align="center" prop="describe" label="描述">
  1821. <template slot-scope="scope">
  1822. <el-input v-model="scope.row.remark"></el-input>
  1823. </template>
  1824. </el-table-column>
  1825. <el-table-column label="操作" width="120" align="center">
  1826. <template slot-scope="scope">
  1827. <el-button
  1828. type="text"
  1829. size="small"
  1830. class="text-icon-danger"
  1831. @click="delNodeInfo(scope.$index, scope.row)"
  1832. >删除
  1833. </el-button>
  1834. </template>
  1835. </el-table-column>
  1836. </el-table>
  1837. </div>
  1838. <span slot="footer" class="dialog-footer">
  1839. <el-button @click="addParameterName()">保 存</el-button>
  1840. <el-button @click="closeParameter()">关 闭</el-button>
  1841. </span>
  1842. </el-dialog>
  1843. <el-dialog
  1844. title="别名"
  1845. :visible.sync="aliasVisible"
  1846. width="600px"
  1847. append-to-body
  1848. :close-on-click-modal="false"
  1849. >
  1850. <div>
  1851. <div class="flex">
  1852. <el-input
  1853. v-model="aliasInput"
  1854. placeholder="请输入节点别名"
  1855. ></el-input>
  1856. <el-button class="mg-l-20" type="primary" @click="addAlias"
  1857. >添加
  1858. </el-button>
  1859. </div>
  1860. <div class="flex" style="flex-wrap: wrap">
  1861. <div class="mg-t-10" v-for="(tag, index) in aliasArr" :key="index">
  1862. <el-tag closable @close="delAlias(index)">
  1863. {{ tag }}
  1864. </el-tag>
  1865. <span v-if="index != aliasArr.length - 1">、</span>
  1866. </div>
  1867. </div>
  1868. </div>
  1869. <span slot="footer" class="dialog-footer">
  1870. <el-button @click="aliasVisible = false">取 消</el-button>
  1871. <el-button type="primary" @click="saveAliasHandle">确 定</el-button>
  1872. </span>
  1873. </el-dialog>
  1874. <!-- 节点公式 -->
  1875. <el-dialog
  1876. :title="
  1877. (curEleTable.tableName ? curEleTable.tableName : '') +
  1878. ' 元素公式(元素库)'
  1879. "
  1880. :visible.sync="formulaCompVisible"
  1881. fullscreen
  1882. append-to-body
  1883. class="full-dialog"
  1884. @close="closeformulaComp"
  1885. >
  1886. <FormulaEdit
  1887. :istableType="!isNodeType"
  1888. :fromcurNode="curTreeData"
  1889. :projectid="projectid"
  1890. :wbsid="id"
  1891. :nodeid="curTreeData.id"
  1892. :eleid="formulaCurRow.id"
  1893. :globaltype="formulaCurRow.globaltype"
  1894. :iswbstype="0"
  1895. @hideDialog="formulaCompVisible = false"
  1896. v-if="formulaCompVisible"
  1897. ></FormulaEdit>
  1898. </el-dialog>
  1899. <!-- 全局公式 -->
  1900. <el-dialog
  1901. title=""
  1902. :visible.sync="formulaCompVisible1"
  1903. fullscreen
  1904. append-to-body
  1905. class="full-dialog"
  1906. @close="closeformulaComp1"
  1907. >
  1908. <FormulaEditone
  1909. :wbsid="id"
  1910. :nodeid="curTreeData.id"
  1911. :eleid="formulaCurRow.id"
  1912. :elementType="formulaCurRow.elementType"
  1913. :projectid="projectid"
  1914. :tableType="istableType"
  1915. :globaltype="formulaCurRow.globaltype"
  1916. @hideDialog="formulaCompVisible1 = false"
  1917. :fromcurNode="curEleTable"
  1918. :iswbstype="0"
  1919. v-if="formulaCompVisible1"
  1920. >
  1921. </FormulaEditone>
  1922. </el-dialog>
  1923. <!-- 编辑元素 -->
  1924. <el-dialog
  1925. title=" "
  1926. :visible.sync="editElementVisible"
  1927. fullscreen
  1928. append-to-body
  1929. class="full-dialog"
  1930. >
  1931. <EditElement
  1932. :editElementQuery="curTreeData"
  1933. :pkeyId="editElementQuery.pkeyId"
  1934. :excelId="editElementQuery.excelId"
  1935. :id="editElementQuery.id"
  1936. :initTableName="editElementQuery.initTableName"
  1937. :pid="editElementQuery.pid"
  1938. :wbsid="editElementQuery.wbsid"
  1939. :initTableId="editElementQuery.initTableId"
  1940. :nodeid="editElementQuery.nodeid"
  1941. @hideDialog="hideEditElementVisible"
  1942. @adjustExcel="adjustExcel"
  1943. v-if="editElementVisible"
  1944. ></EditElement>
  1945. </el-dialog>
  1946. <el-dialog
  1947. title="节点参数设置-关联元素"
  1948. :visible.sync="linkEleVisible"
  1949. width="800px"
  1950. append-to-body
  1951. class="jiedian"
  1952. :close-on-click-modal="false"
  1953. >
  1954. <div>
  1955. <el-table
  1956. :data="linkEleTableList"
  1957. border
  1958. style="width: 100%"
  1959. height="400"
  1960. >
  1961. <el-table-column align="center" prop="tableName" label="元素表名">
  1962. </el-table-column>
  1963. <el-table-column
  1964. align="center"
  1965. prop="elementName"
  1966. label="关联元素字段"
  1967. >
  1968. </el-table-column>
  1969. <el-table-column label="操作" width="160" align="center">
  1970. <template slot-scope="scope">
  1971. <el-button
  1972. v-if="!scope.row.mappingId"
  1973. type="text"
  1974. size="small"
  1975. class="text-icon-primary"
  1976. @click="tolinkEle(scope.row)"
  1977. >选择元素
  1978. </el-button>
  1979. <el-button
  1980. v-if="!!scope.row.mappingId"
  1981. type="text"
  1982. size="small"
  1983. class="text-icon-danger"
  1984. @click="delLink(scope.row)"
  1985. >删除关联
  1986. </el-button>
  1987. </template>
  1988. </el-table-column>
  1989. </el-table>
  1990. </div>
  1991. <span slot="footer" class="dialog-footer">
  1992. <!-- <el-button @click="saveLinks">保 存</el-button> -->
  1993. <el-button @click="linkEleVisible = false">关 闭</el-button>
  1994. </span>
  1995. </el-dialog>
  1996. <el-dialog
  1997. title="选择关联元素"
  1998. :visible.sync="linkCheckVisible"
  1999. width="600px"
  2000. append-to-body
  2001. class="jiedian"
  2002. :close-on-click-modal="false"
  2003. >
  2004. <div>
  2005. <div class="flex mg-b-20">
  2006. <el-input
  2007. v-model="linkEleKey"
  2008. placeholder="请输入元素关键字搜索"
  2009. ></el-input>
  2010. <el-link class="mg-l-20" :underline="false">
  2011. <i
  2012. class="el-icon-search"
  2013. style="font-size: 20px"
  2014. @click="searchEle"
  2015. ></i>
  2016. </el-link>
  2017. </div>
  2018. <el-table :data="linkEleList" border style="width: 100%" height="400">
  2019. <el-table-column align="center" prop="eName" label="元素名">
  2020. </el-table-column>
  2021. <el-table-column label="操作" width="55">
  2022. <template slot-scope="scope">
  2023. <el-checkbox
  2024. v-model="scope.row.checked"
  2025. @change="(value) => linkEleCheck(value, scope.$index)"
  2026. ></el-checkbox>
  2027. </template>
  2028. </el-table-column>
  2029. </el-table>
  2030. </div>
  2031. <span slot="footer" class="dialog-footer">
  2032. <el-button @click="saveLinkEle">保 存</el-button>
  2033. <el-button @click="linkCheckVisible = false">关 闭</el-button>
  2034. </span>
  2035. </el-dialog>
  2036. <!-- 关联节点 -->
  2037. <el-dialog
  2038. title="关联节点"
  2039. :visible="isLinkNodes"
  2040. append-to-body
  2041. center
  2042. destroy-on-close
  2043. custom-class="hc-link-nodes-dialog"
  2044. @close="linkNodesClose"
  2045. >
  2046. <el-tree
  2047. ref="tree2"
  2048. class="hc-link-nodes-tree"
  2049. lazy
  2050. :load="loadNode"
  2051. :props="defaultProps"
  2052. show-checkbox
  2053. check-strictly
  2054. :default-checked-keys="checkedLinkNodesKeys"
  2055. highlight-current
  2056. node-key="primaryKeyId"
  2057. />
  2058. <span slot="footer" class="dialog-footer">
  2059. <el-button @click="linkNodesClose">取 消</el-button>
  2060. <el-button
  2061. type="primary"
  2062. @click="linkNodesSave"
  2063. v-loading="linkNodesLoad"
  2064. >确 定</el-button
  2065. >
  2066. </span>
  2067. </el-dialog>
  2068. <!-- 编辑 -->
  2069. <el-dialog
  2070. :title="(curEleTable.tableName ? curEleTable.tableName : '') + ''"
  2071. :visible.sync="editDialogShow"
  2072. width="80%"
  2073. append-to-body
  2074. :close-on-click-modal="false"
  2075. >
  2076. <p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
  2077. <div style="display: flex; margin-bottom: 10px">
  2078. <el-input
  2079. placeholder="请输入你想编辑的元素名称"
  2080. v-model="searchinput"
  2081. :size="size"
  2082. clearable
  2083. @clear="clearsearchinput"
  2084. >
  2085. </el-input>
  2086. <el-button
  2087. type="primary"
  2088. icon="el-icon-search"
  2089. size="small"
  2090. @click="searchinputChange"
  2091. >搜索</el-button
  2092. >
  2093. </div>
  2094. <el-table
  2095. :data="editTable"
  2096. border
  2097. style="width: 100%"
  2098. height="400px"
  2099. v-loading="editEleTableloading"
  2100. >
  2101. <el-table-column
  2102. align="center"
  2103. type="index"
  2104. width="50"
  2105. ></el-table-column>
  2106. <el-table-column align="center" prop="eName" label="元素名称">
  2107. <template slot="header">
  2108. <i class="required"></i>
  2109. <span>元素名称</span>
  2110. </template>
  2111. <template slot-scope="scope">
  2112. <el-input
  2113. v-model="scope.row.eName"
  2114. size="small"
  2115. placeholder="请输入内容"
  2116. ></el-input>
  2117. </template>
  2118. </el-table-column>
  2119. <el-table-column align="center" prop="dynamicDict" label="动态字典">
  2120. <template slot="header">
  2121. <span>动态字典</span>
  2122. </template>
  2123. <template slot-scope="scope">
  2124. <el-select
  2125. v-model="scope.row.dynamicDict"
  2126. filterable
  2127. size="small"
  2128. placeholder="请选择"
  2129. >
  2130. <el-option
  2131. v-for="item in dynamicDictList"
  2132. :key="item.id"
  2133. :label="item.dictValue"
  2134. :value="item.dictKey"
  2135. ></el-option>
  2136. </el-select>
  2137. </template>
  2138. </el-table-column>
  2139. </el-table>
  2140. <span slot="footer" class="dialog-footer">
  2141. <el-button @click="editDialogShow = false">取 消</el-button>
  2142. <el-button type="primary" @click="saveEles" :loading="saveLoading"
  2143. >确 定</el-button
  2144. >
  2145. </span>
  2146. </el-dialog>
  2147. <!-- 文件题名全局配置 -->
  2148. <el-dialog
  2149. title="文件题名全局配置"
  2150. :visible.sync="fileTitleVisible"
  2151. width="60%"
  2152. append-to-body
  2153. :close-on-click-modal="false"
  2154. >
  2155. <div class="flexEnd">
  2156. <i
  2157. class="el-icon-circle-plus "
  2158. style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
  2159. @click="addRow"
  2160. ></i>
  2161. <i
  2162. class="el-icon-refresh "
  2163. style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
  2164. @click="refreshRow"
  2165. ></i>
  2166. </div>
  2167. <el-table
  2168. :data="fileTableData"
  2169. style="width: 100%;height: 500px;"
  2170. align="center"
  2171. v-loading="fileTableLoading"
  2172. >
  2173. <el-table-column
  2174. label="文件题名规则"
  2175. prop="roleNameVal">
  2176. <template #default="scope">
  2177. <el-select
  2178. :id="selectDiv"
  2179. v-if="scope.row.isEdit"
  2180. v-model="scope.row.ruleName"
  2181. multiple
  2182. placeholder="请选择"
  2183. style="width: 240px"
  2184. @change="changeRoleName($event,scope.row,scope.index)"
  2185. >
  2186. <el-option
  2187. v-for="item in nodeTypelist1"
  2188. :key="item.id"
  2189. :label="item.dictValue"
  2190. :value="item.dictKey"
  2191. ></el-option>
  2192. </el-select>
  2193. <span v-else>
  2194. <el-tag v-for="(item,index) in scope.row.roleNameVal" style="margin-right: 2px;" :key="index">{{ item }}</el-tag>
  2195. </span>
  2196. </template>
  2197. </el-table-column>
  2198. <el-table-column
  2199. label="文件题名范围"
  2200. prop="ruleSizeVal"
  2201. >
  2202. <template #default="scope">
  2203. <div v-if="isShowSize">
  2204. <span v-if="scope.row.type===1" :class="{'orange': scope.row.isEdit}" @click="chooseFile(scope.$index, scope.row)">所有节点</span>
  2205. <div v-else>
  2206. <el-link type="warning" @click="chooseFile(scope.$index, scope.row)" v-if="!scope.row.ruleSizeVal">选择题名范围</el-link>
  2207. <span v-else @click="chooseFile(scope.$index, scope.row)" :class="{'orange': scope.row.isEdit}">{{ scope.row.ruleSizeVal }}</span>
  2208. </div>
  2209. </div>
  2210. </template>
  2211. </el-table-column>
  2212. <el-table-column
  2213. label="操作"
  2214. width="150px"
  2215. >
  2216. <template slot-scope="scope">
  2217. <el-link
  2218. v-if="!scope.row.isEdit"
  2219. type="primary"
  2220. class="mg-r-10"
  2221. @click="editRow(scope.$index, scope.row)">编辑</el-link>
  2222. <el-link
  2223. v-else
  2224. type="primary"
  2225. class="mg-r-10"
  2226. @click="saveRow(scope.$index, scope.row)">保存</el-link>
  2227. <el-link
  2228. @click="delRow(scope.$index, scope.row)"
  2229. type="danger"
  2230. >删除</el-link>
  2231. </template>
  2232. </el-table-column>
  2233. </el-table>
  2234. <template #footer>
  2235. <div class="dialog-footer">
  2236. <el-button @click="fileTitleVisible=false">取消</el-button>
  2237. <el-button type="primary" @click="batchsaveFileSize" :loading="saveFileLoading">
  2238. 保存
  2239. </el-button>
  2240. </div>
  2241. </template>
  2242. </el-dialog>
  2243. <!-- 选择题名范围i -->
  2244. <el-dialog
  2245. :visible.sync="chooseFileVisible"
  2246. title="选择题名范围"
  2247. width="500"
  2248. align-center
  2249. append-to-body
  2250. >
  2251. <el-form label-position="left" label-width="80px" :model="fileTitleModel" :rules="fileTitleRules" ref="fileTitleRef">
  2252. <el-form-item label="题名范围" prop="type">
  2253. <el-radio v-model="fileTitleModel.type" :label="1" @input="changeRadio">所有节点</el-radio><br/>
  2254. <el-radio v-model="fileTitleModel.type" :label="2" @input="changeRadio">部分节点</el-radio>
  2255. <div v-if="fileTitleModel.type==2" class="warning-text">请选择节点</div>
  2256. <el-scrollbar class="h-100p" style="height: 400px;" v-if="fileTitleModel.type==2" v-loading="fileTreeLoading">
  2257. <el-tree
  2258. :data="fileTreeData"
  2259. :props="filedefaultProps"
  2260. :expand-on-click-node="false"
  2261. highlight-current
  2262. node-key="id"
  2263. show-checkbox
  2264. @check="checkFileSize"
  2265. :default-checked-keys="deCheckTreeKeys"
  2266. >
  2267. </el-tree>
  2268. </el-scrollbar>
  2269. </el-form-item>
  2270. </el-form>
  2271. <template #footer>
  2272. <div class="dialog-footer">
  2273. <el-button @click="chooseFileVisible=false">取消</el-button>
  2274. <el-button type="primary" @click="saveFileSize">
  2275. 保存
  2276. </el-button>
  2277. </div>
  2278. </template>
  2279. </el-dialog>
  2280. <!-- 项目数据同步 -->
  2281. <el-dialog
  2282. :visible.sync="proSyncTag"
  2283. width="80%"
  2284. append-to-body
  2285. @close=closeProSyncTag
  2286. >
  2287. <span slot="title" class="dialog-title">
  2288. <div class="dialog-title-text">项目数据同步</div>
  2289. <span class="dialog-title-tip">重新同步项目下所有配置,不保留独有配置,慎重同步!!!</span>
  2290. </span>
  2291. <div class="sync-container">
  2292. <el-card class="box-card-1" :style="{ width: isShowLeft ? '40%' : '0%' }">
  2293. <el-scrollbar style="height: 100%;">
  2294. <div v-loading="treeLoad">
  2295. <el-tree
  2296. class="filter-tree"
  2297. lazy
  2298. :load="loadNode"
  2299. show-checkbox
  2300. :props="defaultProps"
  2301. :expand-on-click-node="false"
  2302. highlight-current
  2303. node-key="primaryKeyId"
  2304. @check="handleCheckChange"
  2305. @check-change="handleCheckChange1"
  2306. ref="syncProTree"
  2307. >
  2308. </el-tree>
  2309. </div>
  2310. </el-scrollbar>
  2311. </el-card>
  2312. <el-card class="box-card-2">
  2313. <el-form ref="syncForm" :model="syncForm" label-position="top">
  2314. <el-form-item label="同步范围" v-if="!isShowTable">
  2315. <el-radio-group v-model="syncForm.range">
  2316. <el-radio
  2317. v-for="item in rangeOptions"
  2318. :key="item.id"
  2319. :label="item.dictKey"
  2320. >{{ item.dictValue}}</el-radio>
  2321. </el-radio-group>
  2322. </el-form-item>
  2323. <el-form-item label="同步类型" prop="type">
  2324. <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
  2325. <div style="margin: 15px 0;"></div>
  2326. <el-checkbox-group v-model="syncForm.type" @change="handleCheckedTypeChange">
  2327. <el-checkbox v-for="item in typeOptions" :label="item.dictKey" :key="item.id">{{ item.dictValue}}</el-checkbox>
  2328. </el-checkbox-group>
  2329. </el-form-item>
  2330. <!-- <el-form-item label="选择同步范围(节点状态)" prop="contractRange" v-if="syncForm.range==='2'">
  2331. <el-checkbox-group v-model="syncForm.contractRange">
  2332. <el-checkbox label="全选" name="1"></el-checkbox>
  2333. <el-checkbox v-for="(item,index) in checkIdList" :label="item.dictKey" :key="item.id">{{ item.dictValue}}</el-checkbox>
  2334. </el-checkbox-group>
  2335. </el-form-item> -->
  2336. <el-form-item label="选择同步范围(节点状态)" prop="contractRange" v-if="syncForm.range==='2'">
  2337. <el-checkbox :indeterminate="isIndeterminate1" v-model="checkAll1" @change="handleCheckAllChange1">全选</el-checkbox>
  2338. <div style="margin: 15px 0;"></div>
  2339. <el-checkbox-group v-model="syncForm.contractRange" @change="handleCheckedTypeChange1">
  2340. <el-checkbox v-for="item in checkIdList" :label="item.dictKey" :key="item.id">{{ item.dictValue}}</el-checkbox>
  2341. </el-checkbox-group>
  2342. </el-form-item>
  2343. <el-form-item label="选择同步源" prop="templateId" v-else>
  2344. <el-select v-model="syncForm.templateId" placeholder="请选择同步源" style="width: 100%;" size="small" @change="changeTemplateId">
  2345. <el-option
  2346. v-for="item in templateIdList"
  2347. :key="item.id"
  2348. :label="item.name"
  2349. :value="item.id">
  2350. </el-option>
  2351. </el-select>
  2352. </el-form-item>
  2353. </el-form>
  2354. <div class="table-box" v-if="isShowTable">
  2355. <h4 style="margin-left: 4px;">表单预览</h4>
  2356. <el-table
  2357. size="small"
  2358. ref="proTable"
  2359. :data="preTableData"
  2360. stripe
  2361. style="width: 100%"
  2362. max-height="300"
  2363. @selection-change="handleSelectionChange"
  2364. >
  2365. <el-table-column
  2366. type="selection"
  2367. width="55">
  2368. </el-table-column>
  2369. <el-table-column
  2370. prop="tableName"
  2371. label="表单名称"
  2372. width="180">
  2373. </el-table-column>
  2374. <el-table-column
  2375. prop="tableType"
  2376. :formatter="formatTableType"
  2377. label="表单类型"
  2378. width="180">
  2379. </el-table-column>
  2380. <el-table-column
  2381. prop="tableOwner"
  2382. :formatter="formatOwner"
  2383. label="所属方">
  2384. </el-table-column>
  2385. </el-table>
  2386. </div>
  2387. </el-card>
  2388. </div>
  2389. <span slot="footer" class="dialog-footer">
  2390. <el-button @click="closeProSyncTag">取 消</el-button>
  2391. <el-button type="primary" @click="saveProTag" :loading="saveProTagLoading">确 定</el-button>
  2392. </span>
  2393. </el-dialog>
  2394. <!-- 同步队列 -->
  2395. <el-dialog
  2396. title="同步队列"
  2397. :visible.sync="syncListDialog"
  2398. width="40%"
  2399. append-to-body
  2400. :close-on-click-modal="false"
  2401. @close="closeSyncListTag"
  2402. custom-class="sync-queue-dialog"
  2403. >
  2404. <!-- 有同步任务时显示 -->
  2405. <div v-if="syncListDataNew && syncListDataNew.length > 0" class="sync-list">
  2406. <div
  2407. v-for="(item, index) in syncListDataNew"
  2408. :key="index"
  2409. class="sync-item"
  2410. >
  2411. <!-- 同步方信息和状态 -->
  2412. <div class="sync-header">
  2413. <span class="sync-party">{{ item.nodeName }}</span>
  2414. <span class="sync-status">{{ item.rangeName }}</span>
  2415. </div>
  2416. <div class="progress-status">
  2417. <div class="progress-reason-text">
  2418. <span>{{ item.errorMsg }}</span>
  2419. </div>
  2420. <div class="progress-status-text">
  2421. <el-tag
  2422. size="small"
  2423. :type="{'2': 'success', '3': 'danger', '1': 'warning'}[item.status]"
  2424. >
  2425. {{ {'2': '完成', '3': '失败', '1': '同步中', '0': '等待'}[item.status] }}
  2426. </el-tag>
  2427. </div>
  2428. </div>
  2429. <!-- 进度条 -->
  2430. <div class="progress-container">
  2431. <div class="progress-text">
  2432. <div class="progress-text-btn">
  2433. <div>同步进度</div>
  2434. </div>
  2435. <div>
  2436. <el-button type="text" icon="el-icon-refresh" style="color:orange"></el-button>
  2437. <el-button type="text" icon="el-icon-delete" style="color:red"></el-button>
  2438. </div>
  2439. </div>
  2440. <div>
  2441. <el-progress
  2442. class="custom-progress"
  2443. :percentage="item.progress"
  2444. text-color="#2550A2"
  2445. color="#2550A2"
  2446. stroke-width="20"
  2447. stroke-linecap="round"
  2448. ></el-progress>
  2449. </div>
  2450. </div>
  2451. <!-- 统计数据 -->
  2452. <div class="sync-stats" style="display: flex;">
  2453. <div class="stat-item">
  2454. <div class="stat-label">已同步</div>
  2455. <div class="stat-value synced">{{ item.nodeNumEnd }}</div>
  2456. </div>
  2457. <div class="stat-item">
  2458. <div class="stat-label">剩余</div>
  2459. <div class="stat-value remaining">{{ item.surplusCount }}</div>
  2460. </div>
  2461. </div>
  2462. </div>
  2463. </div>
  2464. <!-- 无同步任务时显示 -->
  2465. <div v-else class="no-data">
  2466. <div class="no-data-icon">
  2467. <i class="el-icon-information"></i>
  2468. </div>
  2469. <div class="no-data-text">暂无同步任务...</div>
  2470. </div>
  2471. <!-- 底部按钮 -->
  2472. <div slot="footer" class="dialog-footer">
  2473. <el-button
  2474. type="primary"
  2475. @click="closeSyncListTag"
  2476. class="confirm-btn"
  2477. round
  2478. >
  2479. 好的,我已知晓
  2480. </el-button>
  2481. </div>
  2482. </el-dialog>
  2483. <!-- 同步表单其他配置 -->
  2484. <el-dialog
  2485. title="同步表单其他配置"
  2486. :visible.sync="syncTableDialog"
  2487. width="70%"
  2488. append-to-body
  2489. :close-on-click-modal="false"
  2490. >
  2491. <div class="sync-container">
  2492. <el-card class="box-card-1" :style="{ width: isShowLeft ? '40%' : '0%' }">
  2493. <el-scrollbar style="height: 100%;">
  2494. <div >
  2495. <el-tree
  2496. class="filter-tree"
  2497. lazy
  2498. :load="loadNode"
  2499. @node-click="handleNodeClick"
  2500. :default-expanded-keys="defaultExpandedKeys"
  2501. :props="defaultProps"
  2502. :expand-on-click-node="false"
  2503. highlight-current
  2504. node-key="primaryKeyId"
  2505. >
  2506. </el-tree>
  2507. </div>
  2508. </el-scrollbar>
  2509. </el-card>
  2510. <el-card class="box-card-2">
  2511. <div class="table-box">
  2512. <h4 style="margin-left: 4px;">表单预览</h4>
  2513. <el-table
  2514. size="small"
  2515. ref="proTable1"
  2516. :data="preTableData1"
  2517. stripe
  2518. style="width: 100%"
  2519. max-height="300"
  2520. @selection-change="handleSelectionChange1"
  2521. >
  2522. <el-table-column
  2523. type="selection"
  2524. width="55">
  2525. </el-table-column>
  2526. <el-table-column
  2527. prop="tableName"
  2528. label="表单名称"
  2529. width="180">
  2530. </el-table-column>
  2531. <el-table-column
  2532. prop="tableType"
  2533. :formatter="formatTableType"
  2534. label="表单类型"
  2535. width="180">
  2536. </el-table-column>
  2537. <el-table-column
  2538. prop="tableOwner"
  2539. :formatter="formatOwner"
  2540. label="所属方">
  2541. </el-table-column>
  2542. </el-table>
  2543. </div>
  2544. </el-card>
  2545. </div>
  2546. <span slot="footer" class="dialog-footer">
  2547. <el-button @click="syncTableDialog = false">取 消</el-button>
  2548. <el-button type="primary" @click="saveTableSync" :loading="saveTableSyncLoad">确 定</el-button>
  2549. </span>
  2550. </el-dialog>
  2551. <!-- 编号设置弹窗 -->
  2552. <CodeSet ref="codeSetRef" ></CodeSet>
  2553. <!-- 筛选弹窗 -->
  2554. <el-dialog
  2555. title="筛选"
  2556. :visible.sync="filterDialog"
  2557. width="25%"
  2558. append-to-body
  2559. :close-on-click-modal="false"
  2560. @close="handleCancel"
  2561. class="project-dialog"
  2562. >
  2563. <div class="filter-dialog">
  2564. <el-form ref="filterForm" :model="filterForm" label-width="120px">
  2565. <el-form-item label="节点类型">
  2566. <el-select v-model="filterForm.nodeType" placeholder="请选择节点类型" clearable>
  2567. <el-option
  2568. v-for="item in nodeTypelist"
  2569. :key="item.dictKey"
  2570. :label="item.dictValue"
  2571. :value="item.dictKey"
  2572. />
  2573. </el-select>
  2574. </el-form-item>
  2575. <template v-if="wbsType!==2">
  2576. <el-form-item label="内业资料类型">
  2577. <el-select v-model="filterForm.majorDataType" placeholder="请选择内业资料类型" clearable>
  2578. <el-option
  2579. v-for="item in majorDataTypeList"
  2580. :key="item.dictKey"
  2581. :label="item.dictValue"
  2582. :value="item.dictKey"
  2583. />
  2584. </el-select>
  2585. </el-form-item>
  2586. <el-form-item label="标准分类">
  2587. <el-select v-model="filterForm.className" placeholder="请选择标准分类" clearable>
  2588. <el-option
  2589. v-for="item in standardTypeOptions"
  2590. :key="item.value"
  2591. :label="item.dictValue"
  2592. :value="item.dictKey"
  2593. />
  2594. </el-select>
  2595. </el-form-item>
  2596. <el-form-item label="单元名称">
  2597. <el-select v-model="filterForm.unitName" placeholder="请选择单元名称" clearable>
  2598. <el-option
  2599. v-for="item in unitOptions"
  2600. :key="item.value"
  2601. :label="item.label"
  2602. :value="item.value"
  2603. />
  2604. </el-select>
  2605. </el-form-item>
  2606. <el-form-item
  2607. label="是否新增中隐藏"
  2608. >
  2609. <el-radio-group v-model="filterForm.isAddConceal" size="small">
  2610. <el-radio :label="1" border>是</el-radio>
  2611. <el-radio :label="0" border>否</el-radio>
  2612. </el-radio-group>
  2613. </el-form-item>
  2614. </template>
  2615. <template v-else>
  2616. <el-form-item label="参数掩码">
  2617. <el-input
  2618. v-model="filterForm.uniqueCode"
  2619. size="small"
  2620. placeholder="请输入内容"
  2621. ></el-input>
  2622. </el-form-item>
  2623. </template>
  2624. </el-form>
  2625. <div slot="footer" class="dialog-footer">
  2626. <el-button @click="handleCancel" size="small">取 消</el-button>
  2627. <el-button type="primary" @click="handleConfirm" size="small">筛 选</el-button>
  2628. </div>
  2629. </div>
  2630. </el-dialog>
  2631. </div>
  2632. </template>
  2633. <script>
  2634. import ManualSorting from "@/components/WbsTree/ManualSorting";
  2635. import dynamicExcel from "./treeTemplate/dynamicExcel.vue";
  2636. import FormulaEdit from "@/views/formula/edit.vue";
  2637. import FormulaEditone from "@/views/formula/edit1.vue";
  2638. import EditElement from "@/views/manager/projectinfo/editElement/editElement.vue";
  2639. import CodeSet from "./codeSet.vue";
  2640. import {
  2641. saveFormAndElement,
  2642. selectFormElements,
  2643. importWbsTree,
  2644. findWbsTreePrivateSameLevel,
  2645. wbsTreePrivateSort,
  2646. parameters,
  2647. saveOrUpdateBatch,
  2648. keymap,
  2649. updateBatchNodeTableInfo2,
  2650. updateStatus,
  2651. getParamElements,
  2652. specifiedParamElements,
  2653. delParamElements,
  2654. selectPrivateFormElements,
  2655. syncCurrentFormInProject,
  2656. getQueryValueByType,
  2657. getQueryValueByNodeType,
  2658. getTreeByType,
  2659. } from "@/api/manager/wbstree";
  2660. import {
  2661. saveElement,
  2662. remove as removeElement,
  2663. updateBatchElements,
  2664. getTemplate,
  2665. importWbsElement,
  2666. querySyncRecord
  2667. } from "@/api/manager/wbsformelement";
  2668. import {
  2669. getLazytree,
  2670. getDetail,
  2671. update,
  2672. findNodeTableByCondition as selectByNodeTable,
  2673. removeTableByCondition as removeTableById,
  2674. removePrivateTreeNode,
  2675. wbsTreePrivateTableSort,
  2676. privateSubmitFullName,
  2677. syncNodeParam,
  2678. syncProjecteVisa,
  2679. syncNodeTable,
  2680. syncNodeinfo,
  2681. tabTypeLazyTree,
  2682. syncContractTabSort,
  2683. linkNodeTree,
  2684. getLinekNodeTreelist,getNameRule,getTitleRange,saveOrUpdateNameRule,deletedNameRule,delTabInfoAll,getGroupNodeTables
  2685. } from "@/api/manager/wbsprivate";
  2686. import { findProjectTree as getAlltree } from "@/api/manager/projectinfo";
  2687. import { refrehPram } from "@/api/manager/wbstree";
  2688. import { getList as getAttchFromOriginalName } from "@/api/resource/attach";
  2689. import { getDictionary, getChildList } from "@/api/system/dict";
  2690. import { mapGetters } from "vuex";
  2691. import {
  2692. getList,
  2693. tabLazytreeAll,
  2694. saveLinkTab,
  2695. getExcelHtml,
  2696. } from "@/api/exctab/excelmodel";
  2697. import { getStore, setStore } from "@/util/store";
  2698. import { getTempProject,addSync,getNodeStatus,getById } from "@/api/manager/ledger";
  2699. import { selectByNodeTable as findNodeTableByCondition1 } from "@/api/manager/wbstree";
  2700. import { getDictionaryBiz } from "@/api/other";
  2701. import tableSortByType from './tableSortByType'
  2702. export default {
  2703. data() {
  2704. var checkMajorDataType = (rule, value, callback) => {
  2705. //console.log(this.nodeDetail.nodeType)
  2706. //console.log(this.nodeDetail.majorDataType)
  2707. if (this.nodeDetail.nodeType == 6) {
  2708. if (!this.nodeDetail.majorDataType) {
  2709. callback(new Error("工序节点必须选择内业资料类型"));
  2710. }
  2711. }
  2712. callback();
  2713. };
  2714. return {
  2715. isNodeType:true,
  2716. filterByType: false,
  2717. isRestoringSelection: false,
  2718. expandedKeysType: [],
  2719. defaultExpandedKeysType: [],
  2720. currentNodeKey: null, // 保存当前选中的节点key
  2721. fromcurNode: {},
  2722. formDatass: [],
  2723. editElementFormTag: false,
  2724. editeditElementFormMFLoading: false,
  2725. jiedianId: "",
  2726. //#region
  2727. sortTag: false,
  2728. sortTag2: false,
  2729. sureSortload: false,
  2730. surePrivateSortload: false,
  2731. sort: [],
  2732. //#endregion
  2733. //#region 关联清表
  2734. loading: false,
  2735. GLExcel: false,
  2736. GLExcelFrom: {
  2737. id: "",
  2738. name: "",
  2739. search: "", //搜素框舒服的值
  2740. ids: "",
  2741. excelId: "",
  2742. initTableName: "",
  2743. initTableId: "",
  2744. },
  2745. GLExcelData: [], //
  2746. GLExcelProps: {
  2747. label: "name",
  2748. children: "children",
  2749. disabled: "hasChildren",
  2750. isLeaf: function (data) {
  2751. let tag = false;
  2752. if (!data.hasChildren) {
  2753. tag = true;
  2754. }
  2755. if (data.isExistForm == 1) {
  2756. tag = true;
  2757. }
  2758. return tag;
  2759. },
  2760. },
  2761. exceldata: [], //清表模板
  2762. GLExcelLoading: false,
  2763. //#endregion
  2764. //#region 调整表单
  2765. adjustmentExcel: "",
  2766. excelHtml: false,
  2767. //#endregion
  2768. //#region
  2769. id: "",
  2770. projectid: "",
  2771. filterText: "",
  2772. filterText1: "",
  2773. isShowTree1:true,
  2774. treeData: [],
  2775. searchType: "1",
  2776. isSearch: false,
  2777. searchTreeData: [],
  2778. searchtreeLoad: false,
  2779. treeLoad: false,
  2780. isShowTree: true,
  2781. menuShow: false,
  2782. defaultProps: {
  2783. children: "children",
  2784. label: "title",
  2785. isLeaf: function (data) {
  2786. //console.log(data, !data.hasChildren, data.isExistForm);
  2787. let tag = false;
  2788. if (!data.hasChildren) {
  2789. tag = true;
  2790. }
  2791. /*if (data.isExistForm == 1) {
  2792. tag = true;
  2793. }*/
  2794. if (data.nodeType >= 6 && data.nodeType <= 13) {
  2795. tag = true;
  2796. }
  2797. //中间交工。开工报告、质量评定)
  2798. if (
  2799. data.majorDataType == 1 ||
  2800. data.majorDataType == 2 ||
  2801. data.majorDataType == 3
  2802. ) {
  2803. tag = true;
  2804. }
  2805. return tag;
  2806. // return !data.hasChildren || (data.isExistForm == 1);
  2807. },
  2808. },
  2809. defaultPropsByType:{
  2810. children: 'children',
  2811. label: 'title',
  2812. isLeaf:function (data) {
  2813. return !data.hasChildren
  2814. }
  2815. },
  2816. leftType: 5,
  2817. curTreeData: {},
  2818. curTreeNode: {},
  2819. tableData: [],
  2820. nodeDetail: {},
  2821. formData: [],
  2822. editType: 1,
  2823. dialogVisible: false,
  2824. saveNodeLoading: false,
  2825. nodeTypelist1: [],
  2826. majorDataTypeList: [],
  2827. rules: {
  2828. nodeName: [
  2829. { required: true, message: "请输入节点名称", trigger: "blur" },
  2830. ],
  2831. nodeType: [
  2832. { required: true, message: "请选择节点类型", trigger: "change" },
  2833. ],
  2834. majorDataType: [{ validator: checkMajorDataType, trigger: "change" }],
  2835. isAddConceal: [
  2836. {
  2837. required: true,
  2838. message: "请选择是否新增中隐藏",
  2839. trigger: "change",
  2840. },
  2841. ],
  2842. },
  2843. eleVisible: false,
  2844. tableTypelist: [],
  2845. dataTypeList: [],
  2846. ownerTypeList: [],
  2847. eleForm: {
  2848. elementList: [],
  2849. },
  2850. eleRules: {
  2851. nodeName: [
  2852. { required: true, message: "请输入表名称", trigger: "blur" },
  2853. ],
  2854. tableType: [
  2855. { required: true, message: "请选择表类型", trigger: "change" },
  2856. ],
  2857. tableOwner: [
  2858. { required: true, message: "请选择所属方", trigger: "change" },
  2859. ],
  2860. },
  2861. importVisible: false,
  2862. tempList: [],
  2863. curEleTable: {},
  2864. istableType: true,
  2865. editEleVisible: false,
  2866. editEleList: [],
  2867. eleReg: /(≥|≤|±|【】)?([^≥≤±【】]*)/,
  2868. editEleFormulaVisible: false,
  2869. isMeter: false,
  2870. formulaInput: "",
  2871. editEleListFilter: [],
  2872. editEleListAll: [],
  2873. tableFileTypeList:[],
  2874. importTemplateVisible: false,
  2875. fileUrl: "",
  2876. upFile: null,
  2877. importLoading: false,
  2878. nodeInfoVisible: false,
  2879. nodeInfoTable: [],
  2880. nodeInfoTableLoad: false,
  2881. namelist: [],
  2882. namelists: [],
  2883. delids: [],
  2884. infoNameVisible: false,
  2885. excelSortTag: false,
  2886. excelSortTag2: false,
  2887. tableSortList: [],
  2888. sortTableList: [],
  2889. sortProLoad:false,
  2890. //#endregion
  2891. defaultExpandedKeys: [],
  2892. expandName: this.$route.fullPath,
  2893. aliasVisible: false, //别名
  2894. aliasInput: "",
  2895. aliasArr: [],
  2896. formulaCompVisible: false, //公式弹框
  2897. formulaCompVisible1: false,
  2898. formulaCurRow: {}, //当前元素
  2899. editElementVisible: false, //编辑元素弹框
  2900. editElementQuery: {
  2901. pkeyId: "",
  2902. excelId: "",
  2903. id: "",
  2904. initTableName: "",
  2905. initTableId: "",
  2906. pid: "",
  2907. wbsid: "",
  2908. nodeid: "",
  2909. }, //传参
  2910. syncBtnLoad: false,
  2911. syncElectricLoad: false,
  2912. showType: 1,
  2913. typeTreeData: [],
  2914. testTreeLoad: false,
  2915. testTreeData: [],
  2916. mixRatioTestIds: [],
  2917. //节点参数,关联元素
  2918. curParam: {}, //当前节点参数
  2919. linkEleVisible: false,
  2920. linkEleTableList: [], //元素表数组
  2921. curLinkEleTable: {}, //当前元素表
  2922. linkCheckVisible: false, //关联弹框
  2923. linkEleList: [], //元素数组
  2924. linkEleKey: "", //搜索关键字
  2925. menusData: [
  2926. // {icon: 'el-icon-s-promotion', label: '新增节点', key: "add"},
  2927. {
  2928. icon: "el-icon-s-promotion",
  2929. label: "编辑节点",
  2930. key: "edit",
  2931. content: "编辑节点",
  2932. },
  2933. {
  2934. icon: "el-icon-upload",
  2935. label: "后管数据同步",
  2936. key: "sync1",
  2937. content: "后管数据同步",
  2938. },
  2939. {
  2940. icon: "el-icon-upload",
  2941. label: "同步到合同段",
  2942. key: "sync3",
  2943. content: "同步到合同段",
  2944. },
  2945. {
  2946. icon: "el-icon-sort",
  2947. label: "调整排序",
  2948. key: "sort",
  2949. content: "调整排序",
  2950. },
  2951. {
  2952. icon: "el-icon-s-promotion",
  2953. label: "删除节点",
  2954. key: "del",
  2955. content: "删除节点",
  2956. },
  2957. ], //树组件操作菜单
  2958. menuvisible: false,
  2959. menuleft: 20,
  2960. menutop: 0,
  2961. //同步菜单按钮
  2962. menuoptions: [
  2963. {
  2964. value: "jdSync",
  2965. label: "节点参数同步",
  2966. load: false,
  2967. },
  2968. {
  2969. value: "dqSync",
  2970. label: "电签同步",
  2971. load: false,
  2972. },
  2973. {
  2974. value: "gsSync",
  2975. label: "公式同步",
  2976. load: false,
  2977. },
  2978. // {
  2979. // value: "zdSync",
  2980. // label: "字典同步",
  2981. // load: false,
  2982. // },
  2983. ],
  2984. menuvalue: "",
  2985. isshowSyncbtn: false,
  2986. projectName: "",
  2987. nodeInfoSaveload: false,
  2988. handlesyncLoad: false, //表单同步
  2989. isLinkNodes: false,
  2990. linkNodesLoad: false,
  2991. checkedLinkNodesKeys: [],
  2992. rowPkeyId: "",
  2993. nodesCheck: [],
  2994. standardTypeOptions: [], //标准分类
  2995. unitOptions: [], //单位名称
  2996. editDialogShow: false, //编辑元素
  2997. searchinput: "",
  2998. editTable: [],
  2999. editEleTableloading: false,
  3000. dynamicDictList: [],
  3001. saveLoading: false,
  3002. fileTitleVisible:false,
  3003. deCheckTreeKeys:[],
  3004. fileTableData:[
  3005. ],
  3006. fileTitleRef:null,
  3007. fileTitleModel:{
  3008. type:'',
  3009. },
  3010. fileTreeLoading:false,
  3011. fileTreeData:[],
  3012. filedefaultProps:{
  3013. children: 'children',
  3014. label: 'nodeName',
  3015. disabled:function (data) {
  3016. return data.status===11 ;
  3017. },
  3018. },
  3019. fileTitleRules:{
  3020. type: [
  3021. { required: true, message: '请选择题名范围', trigger: 'blur' },
  3022. ],
  3023. },
  3024. fileTableLoading:false,
  3025. chooseFileVisible:false,
  3026. chooseFileRow: {},
  3027. chooseFileIndex: -1,
  3028. isShowSize:true,
  3029. selectDiv:Math.random(),
  3030. saveFileLoading:false,
  3031. proSyncTag:false,
  3032. rangeOptions:[],
  3033. typeOptions:[],
  3034. checkAll: false,
  3035. checkAll1: false,
  3036. isIndeterminate: false,
  3037. isIndeterminate1: false,
  3038. syncForm:{
  3039. range:'',
  3040. rangeName:'',
  3041. type:[],
  3042. typeName:'',
  3043. templateId:'',
  3044. templateName:'',
  3045. contractRange:[],
  3046. contractRangeName:'',
  3047. formIds:''
  3048. },
  3049. preTableData:[],
  3050. multipleSelection: [],
  3051. checkIdList:[
  3052. ],
  3053. isShowLeft:false,
  3054. isShowTable:false,
  3055. templateIdList:[],//同步源
  3056. saveProTagLoading:false,
  3057. syncTableDialog:false,
  3058. preTableData1:[],
  3059. formIds:'',
  3060. saveTableSyncLoad:false,
  3061. checkRow:null,
  3062. syncListDialog:false,
  3063. refreshLoading:false,
  3064. syncListData:{
  3065. nodeNum:'',//同步节点数量
  3066. nodeNumEnd:''//已同步数量
  3067. },
  3068. syncListDataNew:[],
  3069. isAdd:'',
  3070. refreshLoading1:false,
  3071. codeDialog:false,
  3072. codeSetRef: null,
  3073. typeTem:'',
  3074. isShowTree1:true,
  3075. cachedNodes: new Map(), // 缓存已加载的节点数据
  3076. filterDialog:false,
  3077. filterForm: {
  3078. nodeType: '',
  3079. majorDataType: '',
  3080. className: '',
  3081. unitName: '',
  3082. isAddConceal:''
  3083. },
  3084. tableListByType:[],
  3085. tableListByTypeLoad:false
  3086. };
  3087. },
  3088. computed: {
  3089. ...mapGetters(["userInfo"]),
  3090. },
  3091. created() {
  3092. this.init();
  3093. // 尝试恢复之前选中的节点
  3094. // // 尝试恢复之前的状态
  3095. // this.restoreTreeState();
  3096. // 从本地存储恢复展开的keys
  3097. // const savedExpandedKeys = JSON.parse(localStorage.getItem('treeExpandedKeys') || '[]');
  3098. // this.defaultExpandedKeysType = savedExpandedKeys;
  3099. },
  3100. methods: {
  3101. //#region
  3102. changeType(val){
  3103. console.log(val,'val');
  3104. this.isNodeType=val
  3105. this.formData=[]
  3106. localStorage.setItem('isNodeType',val);
  3107. this.filterText1=''
  3108. },
  3109. init() {
  3110. //this.id = this.$route.query.wbsid;
  3111. //this.projectid = this.$route.query.pid;
  3112. const { wbsid, pid, type } = this.$route.query;
  3113. this.id = wbsid;
  3114. this.projectid = pid;
  3115. this.wbsType = type ? Number(type) : 1;
  3116. this.getNodeTypelistData()
  3117. this.getNodeTypelist();
  3118. this.getTableTypelist();
  3119. this.getDataTypelist();
  3120. this.getOwnerTypelist();
  3121. this.getStandardTypeOptions();
  3122. this.getMajorDataTypeList();
  3123. this.getTableFileTypeList();
  3124. this.defaultExpandedKeys = getStore({ name: this.expandName });
  3125. this.projectName = this.$route.query.projectName;
  3126. },
  3127. loadNode(node, resolve) {
  3128. let pid = 0;
  3129. if (node.level != 0) {
  3130. pid = node.data.id;
  3131. }
  3132. const type = this.wbsType;
  3133. getLazytree(this.id, pid, this.userInfo.tenant_id, this.projectid, {
  3134. wbsType: type,
  3135. }).then((res) => {
  3136. let arr = [];
  3137. if (Array.isArray(res.data.data)) {
  3138. arr = res.data.data;
  3139. }
  3140. return resolve(arr);
  3141. });
  3142. },
  3143. // 在 loadNodeByType 中恢复选中状态
  3144. loadNodeByType(node, resolve) {
  3145. // 如果有缓存且不是根节点,直接返回缓存
  3146. if (node.level !== 0 && this.cachedNodes.has(node.data.id)) {
  3147. return resolve(this.cachedNodes.get(node.data.id));
  3148. }
  3149. let pid = 12345678910;
  3150. if (node.level != 0) {
  3151. pid = node.data.id;
  3152. }
  3153. getTreeByType({
  3154. parentId: pid,
  3155. projectId: this.projectid,
  3156. current: 1,
  3157. size: 1000,
  3158. titleName: this.filterText1
  3159. }).then((res) => {
  3160. let arr = [];
  3161. if (Array.isArray(res.data.data['records'])) {
  3162. arr = res.data.data['records'];
  3163. }
  3164. resolve(arr);
  3165. // 恢复选中状态
  3166. this.$nextTick(() => {
  3167. if (this.currentNodeKey) {
  3168. this.$refs.treeByType.setCurrentKey(this.currentNodeKey);
  3169. }
  3170. });
  3171. }).catch(error => {
  3172. console.error('加载树节点失败:', error);
  3173. resolve([]);
  3174. });
  3175. },
  3176. saveTreeState() {
  3177. const tree = this.$refs.treeByType;
  3178. if (!tree) return;
  3179. // 保存当前选中节点
  3180. this.currentNodeKey = tree.getCurrentKey();
  3181. // 保存所有展开节点
  3182. this.defaultExpandedKeysType = [];
  3183. const traverse = (node) => {
  3184. if (node.expanded && node.data) {
  3185. this.defaultExpandedKeysType.push(node.data.id);
  3186. }
  3187. if (node.childNodes) {
  3188. node.childNodes.forEach(traverse);
  3189. }
  3190. };
  3191. traverse(tree.store.root);
  3192. },
  3193. // 节点展开时保存状态
  3194. handleNodeExpand(data) {
  3195. if (!this.defaultExpandedKeysType.includes(data.id)) {
  3196. this.defaultExpandedKeysType.push(data.id);
  3197. }
  3198. },
  3199. // 节点折叠时更新状态
  3200. handleNodeCollapse(data) {
  3201. const index = this.defaultExpandedKeysType.indexOf(data.id);
  3202. if (index > -1) {
  3203. this.defaultExpandedKeysType.splice(index, 1);
  3204. }
  3205. },
  3206. getNodeDetail(data, node) {
  3207. console.log("getNodeDetail", data);
  3208. let parentName = "";
  3209. if (node.parent.data) {
  3210. parentName = node.parent.data.title;
  3211. }
  3212. this.curTreeData = data;
  3213. this.curTreeNode = node;
  3214. this.curTreeData.parentName = parentName;
  3215. getDetail(data.id, this.id, this.projectid).then((res) => {
  3216. res.data.data.parentName = parentName;
  3217. let tableObj=res.data.data;
  3218. tableObj.primaryKeyId=data.primaryKeyId
  3219. this.tableData = [res.data.data];
  3220. this.nodeDetail = Object.assign({}, res.data.data);
  3221. const { tableFileType } = this.nodeDetail;
  3222. this.nodeDetail.tableFileType = tableFileType&&tableFileType.length>0 ? tableFileType.split(",") : [];
  3223. });
  3224. this.updateNodeTable();
  3225. // this.nodeTypeChange(data.nodeType)
  3226. //获取节点展开路径
  3227. this.getExpandedKeys(node);
  3228. },
  3229. getNodeDetailByType(data, node) {
  3230. console.log(data, 'data');
  3231. // 保存当前选中的节点
  3232. this.currentNodeKey = data.id;
  3233. this.curTreeData = data;
  3234. this.curTreeNode = node;
  3235. data.tableName = data.title;
  3236. this.formData = [data];
  3237. // 只存储node对象中的必要信息,避免循环引用
  3238. const nodeInfo = {
  3239. id: node.data.id,
  3240. label: node.label,
  3241. level: node.level,
  3242. isLeaf: node.isLeaf,
  3243. expanded: node.expanded,
  3244. // 其他你需要的属性
  3245. };
  3246. localStorage.setItem('lastDataNode', JSON.stringify(nodeInfo));
  3247. },
  3248. saveNode() {
  3249. const type = this.wbsType;
  3250. this.$refs["nodeDetail"].validate((valid) => {
  3251. if (valid) {
  3252. if (type === 2 && this.nodeDetail.nodeType === 53) {
  3253. if (mixRatioTestIds) {
  3254. if (this.editType == 1) {
  3255. this.addNode();
  3256. } else if (this.editType == 2) {
  3257. this.updateNode();
  3258. }
  3259. } else {
  3260. this.$message({
  3261. type: "error",
  3262. message: "请先选择节点",
  3263. });
  3264. return false;
  3265. }
  3266. } else {
  3267. if (this.editType == 1) {
  3268. this.addNode();
  3269. } else if (this.editType == 2) {
  3270. this.updateNode();
  3271. }
  3272. }
  3273. } else {
  3274. console.log("error submit!!");
  3275. return false;
  3276. }
  3277. });
  3278. },
  3279. addNode() {
  3280. this.saveNodeLoading = true;
  3281. const { tableFileType } = this.nodeDetail;
  3282. this.nodeDetail.tableFileType = tableFileType&&tableFileType.length>0 ? tableFileType.join(",") : "";
  3283. update(this.nodeDetail).then(() => {
  3284. this.updateTreeNewNode();
  3285. this.dialogVisible = false;
  3286. this.$message({
  3287. type: "success",
  3288. message: "新增成功!",
  3289. });
  3290. });
  3291. },
  3292. updateNode() {
  3293. const { tableFileType } = this.nodeDetail;
  3294. this.nodeDetail.tableFileType = tableFileType&&tableFileType.length>0 ? tableFileType.join(",") : "";
  3295. update(this.nodeDetail).then(() => {
  3296. let node = this.tableData[0];
  3297. node.nodeName = this.nodeDetail.nodeName;
  3298. node.nodeType = this.nodeDetail.nodeType;
  3299. this.curTreeData.title = this.nodeDetail.nodeName;
  3300. this.dialogVisible = false;
  3301. this.$message({
  3302. type: "success",
  3303. message: "修改成功!",
  3304. });
  3305. });
  3306. this.getNodeDetail(this.curTreeData, this.curTreeNode);
  3307. },
  3308. toSplit(val) {
  3309. return val ? String(val).split(",") : "";
  3310. },
  3311. setLeftType(type, data, node) {
  3312. this.jiedianId = data.id;
  3313. this.getNodeTypelistData()
  3314. if (type == 4 || type == 5) {
  3315. this.leftType = type;
  3316. }
  3317. this.curTreeData = data;
  3318. this.curTreeNode = node;
  3319. this.$refs.tree.setCurrentKey(data.id);
  3320. if (type == 1 || type == 2) {
  3321. this.getMajorDataTypeList();
  3322. this.dialogVisible = true;
  3323. this.editType = type;
  3324. }
  3325. getDetail(data.id, this.id, this.projectid).then((res) => {
  3326. let parentName = "";
  3327. if (node.parent.data) {
  3328. parentName = node.parent.data.title;
  3329. }
  3330. res.data.data.parentName = parentName;
  3331. this.tableData = [res.data.data];
  3332. if (type == 1) {
  3333. this.nodeDetail = {
  3334. parentId: res.data.data.id,
  3335. parentName: parentName,
  3336. projectId: res.data.data.projectId,
  3337. };
  3338. } else {
  3339. this.nodeDetail = Object.assign({}, res.data.data);
  3340. this.mixRatioTestIds = this.toSplit(res.data.data.mixRatioTestIds);
  3341. }
  3342. this.nodeDetail.type = 1; // '1'节点 '2'表单
  3343. this.nodeDetail.wbsId = this.id;
  3344. this.nodeDetail.tenantId = this.userInfo.tenant_id;
  3345. this.changeStandType(this.nodeDetail.className);
  3346. });
  3347. if (this.leftType == 4) {
  3348. selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
  3349. if (res.data.data.length) {
  3350. this.formData = res.data.data;
  3351. } else {
  3352. this.formData = [];
  3353. }
  3354. });
  3355. }
  3356. //获取节点展开路径
  3357. this.getExpandedKeys(node);
  3358. },
  3359. showFormElement() {
  3360. if (!this.nodeDetail.id) {
  3361. this.$message({
  3362. type: "warning",
  3363. message: "请先选择在哪个节点下创建表",
  3364. });
  3365. return;
  3366. }
  3367. this.eleVisible = true;
  3368. },
  3369. addEleRow(list) {
  3370. list.push({});
  3371. },
  3372. delEleRow(index, list) {
  3373. list.splice(index, 1);
  3374. },
  3375. saveFormAndElementHandle() {
  3376. this.$refs["eleDialog"].validate((valid) => {
  3377. if (valid) {
  3378. this.eleForm.wbsId = this.id;
  3379. this.eleForm.tenantId = this.userInfo.tenant_id;
  3380. this.eleForm.nodeType = -1;
  3381. this.eleForm.type = 2; // '1'节点 '2'表单
  3382. this.eleForm.parentId = this.nodeDetail.id;
  3383. this.eleForm.elementList.forEach((element) => {
  3384. element.eAllowDeviation =
  3385. (element.allow ? element.allow : "") +
  3386. (element.deviation ? element.deviation : "");
  3387. if (element.eType == 4) {
  3388. element.eLength = 0;
  3389. }
  3390. });
  3391. saveFormAndElement(this.eleForm).then(() => {
  3392. //console.log(res)
  3393. this.updateTreeNewNode();
  3394. this.updateNodeTable();
  3395. this.eleVisible = false;
  3396. this.$message({
  3397. type: "success",
  3398. message: "新增成功!",
  3399. });
  3400. });
  3401. } else {
  3402. console.log("error submit!!");
  3403. return false;
  3404. }
  3405. });
  3406. },
  3407. updateTreeNewNode() {
  3408. getLazytree(
  3409. this.id,
  3410. this.nodeDetail.parentId,
  3411. this.userInfo.tenant_id,
  3412. this.projectid
  3413. ).then((res) => {
  3414. this.$refs.tree.updateKeyChildren(
  3415. this.nodeDetail.parentId,
  3416. res.data.data
  3417. );
  3418. });
  3419. },
  3420. updateNodeTable() {
  3421. if(this.isNodeType){
  3422. if(!this.curTreeData.id){
  3423. return
  3424. }
  3425. this.tableListByTypeLoad=true
  3426. getGroupNodeTables(
  3427. {
  3428. parentId: this.curTreeData.id,
  3429. projectId: this.projectid,
  3430. wbsId: this.id
  3431. }
  3432. ).then(
  3433. (res) => {
  3434. this.tableListByTypeLoad=false
  3435. if (res.data.data && res.data.data.length) {
  3436. this.tableListByType = res.data.data;
  3437. // this.formData = res.data.data;
  3438. // this.formData.forEach((ele) => {
  3439. // ele.nodeType = Number(ele.nodeType);
  3440. // });
  3441. } else {
  3442. this.tableListByType = [];
  3443. }
  3444. }
  3445. );
  3446. }else{
  3447. console.log(8888888);
  3448. this.reloadEntireTree();
  3449. }
  3450. },
  3451. async reloadEntireTree() {
  3452. this.isNodeType = false;
  3453. // 1. 获取树组件引用和当前选中节点
  3454. const tree = this.$refs.treeByType;
  3455. if (!tree) return;
  3456. const currentKey = tree.getCurrentKey();
  3457. const currentPath = [];
  3458. // 2. 收集当前选中节点的路径和所有展开节点
  3459. const allExpandedNodes = [];
  3460. const traverseTree = (node) => {
  3461. if (node.expanded && node.level > 0) {
  3462. allExpandedNodes.push({
  3463. id: node.data.id,
  3464. node: node
  3465. });
  3466. }
  3467. if (node.childNodes) {
  3468. node.childNodes.forEach(traverseTree);
  3469. }
  3470. };
  3471. traverseTree(tree.store.root);
  3472. // 3. 获取选中节点的完整路径
  3473. if (currentKey) {
  3474. const currentNode = tree.getNode(currentKey);
  3475. if (currentNode) {
  3476. let parent = currentNode.parent;
  3477. while (parent && parent.level > 0) {
  3478. currentPath.unshift(parent.data.id);
  3479. parent = parent.parent;
  3480. }
  3481. currentPath.push(currentKey); // 包含当前节点本身
  3482. }
  3483. }
  3484. // 4. 清空缓存
  3485. this.cachedNodes.clear();
  3486. // 5. 强制重新加载当前路径上的所有节点
  3487. for (const nodeId of currentPath) {
  3488. const node = tree.getNode(nodeId);
  3489. if (node) {
  3490. node.loaded = false; // 标记为需要重新加载
  3491. // 从缓存中移除
  3492. this.cachedNodes.delete(nodeId);
  3493. }
  3494. }
  3495. // 6. 关闭所有非当前路径的展开节点
  3496. allExpandedNodes.forEach(({id, node}) => {
  3497. if (!currentPath.includes(id)) {
  3498. node.expanded = false;
  3499. node.loaded = false; // 标记为需要重新加载
  3500. this.cachedNodes.delete(id);
  3501. }
  3502. });
  3503. // 7. 重新加载根节点
  3504. const rootNode = tree.store.root;
  3505. const rootId = rootNode.childNodes[0].data.id || 'root';
  3506. await this.$nextTick();
  3507. tree.updateKeyChildren(rootId, []);
  3508. const root = tree.getNode(rootId);
  3509. if (root) {
  3510. root.loaded = false;
  3511. root.expand();
  3512. }
  3513. // 8. 等待树重新加载完成
  3514. await new Promise(resolve => {
  3515. const checkLoaded = () => {
  3516. if (root.loaded) {
  3517. resolve();
  3518. } else {
  3519. setTimeout(checkLoaded, 50);
  3520. }
  3521. };
  3522. checkLoaded();
  3523. });
  3524. // 9. 重新展开当前路径
  3525. this.defaultExpandedKeysType = [...currentPath];
  3526. for (const nodeId of currentPath) {
  3527. const node = tree.getNode(nodeId);
  3528. if (node && !node.expanded) {
  3529. node.expand();
  3530. // 等待节点加载
  3531. await new Promise(resolve => {
  3532. const checkNodeLoaded = () => {
  3533. if (node.loaded) {
  3534. resolve();
  3535. } else {
  3536. setTimeout(checkNodeLoaded, 50);
  3537. }
  3538. };
  3539. checkNodeLoaded();
  3540. });
  3541. }
  3542. }
  3543. // 10. 恢复选中状态
  3544. if (currentKey) {
  3545. // 检查节点是否仍然存在
  3546. const currentNode = tree.getNode(currentKey);
  3547. if (currentNode) {
  3548. tree.setCurrentKey(currentKey);
  3549. this.currentNodeData = currentNode.data;
  3550. this.formData = [{
  3551. ...this.currentNodeData,
  3552. tableName: this.currentNodeData.title
  3553. }];
  3554. } else {
  3555. // 节点已被删除
  3556. this.currentNodeKey = null;
  3557. this.currentNodeData = null;
  3558. this.formData = [];
  3559. // this.$message.warning('当前选中节点已被删除');
  3560. }
  3561. }
  3562. },
  3563. // 关闭所有非路径上的展开节点
  3564. closeOtherExpandedNodes(tree, keepOpenPath) {
  3565. const closeNodes = (node) => {
  3566. if (node.expanded && node.level > 0) {
  3567. const nodeId = node.data.id;
  3568. // 如果节点不在需要保持展开的路径中,则关闭它
  3569. if (!keepOpenPath.includes(nodeId)) {
  3570. node.expanded = false;
  3571. }
  3572. }
  3573. if (node.childNodes) {
  3574. node.childNodes.forEach(closeNodes);
  3575. }
  3576. };
  3577. // 从根节点开始遍历
  3578. closeNodes(tree.store.root);
  3579. },
  3580. deleNode(data, node) {
  3581. let pid = data.primaryKeyId ? data.primaryKeyId : data.pKeyId;
  3582. this.$confirm(
  3583. "此操作将删除节点【" + data.title + "】, 是否继续?",
  3584. "提示",
  3585. {
  3586. confirmButtonText: "确定",
  3587. cancelButtonText: "取消",
  3588. type: "warning",
  3589. }
  3590. )
  3591. .then(() => {
  3592. removePrivateTreeNode(pid).then(() => {
  3593. this.$refs.tree.remove(node);
  3594. this.$message({
  3595. type: "success",
  3596. message: "删除成功!",
  3597. });
  3598. });
  3599. })
  3600. .catch(() => {});
  3601. },
  3602. // 重新加载整棵树
  3603. importHandle() {},
  3604. handlePreview(index, row) {
  3605. this.curEleTable = row;
  3606. if(!this.curEleTable.initTableId){
  3607. this.$message({ type: "warning", message: '请先关联清表' })
  3608. return
  3609. }
  3610. selectPrivateFormElements(this.curEleTable.initTableId).then((res) => {
  3611. res.data.data.forEach((element) => {
  3612. this.eleReg.exec(element.eAllowDeviation);
  3613. element.allow = RegExp.$1 ? RegExp.$1 : "";
  3614. element.deviation = RegExp.$2 ? RegExp.$2 : "";
  3615. });
  3616. this.editEleList = res.data.data;
  3617. });
  3618. this.editEleVisible = true;
  3619. },
  3620. //关联节点
  3621. handleLinkNodes(index, row) {
  3622. this.rowPkeyId = row.pkeyId;
  3623. this.linkNodesLoad = false;
  3624. this.isLinkNodes = true;
  3625. getLinekNodeTreelist(row.pkeyId)
  3626. .then(({ data }) => {
  3627. const res = data.data;
  3628. if (res instanceof Array) {
  3629. this.checkedLinkNodesKeys = res;
  3630. } else {
  3631. this.checkedLinkNodesKeys = [];
  3632. }
  3633. })
  3634. .catch(() => {
  3635. this.checkedLinkNodesKeys = [];
  3636. });
  3637. },
  3638. //确定关联
  3639. linkNodesSave() {
  3640. const keys = this.$refs.tree2.getCheckedKeys();
  3641. // if (keys.length <= 0) {
  3642. // this.$message({
  3643. // type: "warning",
  3644. // message: "请先勾选节点",
  3645. // });
  3646. // return;
  3647. // }
  3648. const pkeyId = this.rowPkeyId;
  3649. this.linkNodesLoad = true;
  3650. linkNodeTree(keys.length >0?keys.join(","):'', pkeyId)
  3651. .then(() => {
  3652. this.$message({
  3653. type: "success",
  3654. message: "关联成功!",
  3655. });
  3656. this.linkNodesLoad = false;
  3657. this.linkNodesClose();
  3658. })
  3659. .catch(() => {
  3660. this.linkNodesLoad = false;
  3661. });
  3662. },
  3663. //关闭关联弹窗
  3664. linkNodesClose() {
  3665. this.isLinkNodes = false;
  3666. this.linkNodesLoad = false;
  3667. this.checkedLinkNodesKeys = [];
  3668. this.nodesCheck = [];
  3669. this.rowPkeyId = "";
  3670. },
  3671. handleDelete(index, row) {
  3672. this.$confirm("是否删除 " + row.tableName + " ?", "删除元素表", {
  3673. distinguishCancelAndClose: true,
  3674. confirmButtonText: "删除",
  3675. cancelButtonText: "取消",
  3676. }).then(() => {
  3677. if(this.isNodeType){
  3678. removeTableById(row.id, this.projectid, this.id).then(() => {
  3679. this.formData.splice(index, 1);
  3680. this.$message({
  3681. type: "success",
  3682. message: "删除成功!",
  3683. });
  3684. });
  3685. }else{
  3686. delTabInfoAll(row.pkeyId).then(() => {
  3687. this.formData.splice(index, 1);
  3688. this.$message({
  3689. type: "success",
  3690. message: "删除成功!",
  3691. });
  3692. });
  3693. }
  3694. });
  3695. },
  3696. async hideMD(row) {
  3697. //隐藏按钮
  3698. const code = await this.updateStatus(row.pkeyId, row.status);
  3699. if (code == 200) {
  3700. if (row.status == 0) {
  3701. row.status = 1;
  3702. } else {
  3703. row.status = 0;
  3704. }
  3705. }
  3706. },
  3707. async updateStatus(pKeyId, status) {
  3708. //隐藏功能激活
  3709. const { data: res } = await updateStatus({ pKeyId });
  3710. if (res.code == 200) {
  3711. this.$message({
  3712. type: "success",
  3713. message: status == 1 ? "隐藏成功" : "激活成功",
  3714. });
  3715. }
  3716. return res.code;
  3717. },
  3718. handleEditFormula(index, row) {
  3719. this.curEleTable = row;
  3720. selectFormElements(this.curEleTable.pkeyId, { type: 0 }).then((res) => {
  3721. this.editEleListFilter = res.data.data;
  3722. this.editEleListAll = [].concat(this.editEleListFilter);
  3723. });
  3724. this.editEleFormulaVisible = true;
  3725. },
  3726. //表单同步
  3727. handlesync(index, row) {
  3728. },
  3729. //搜索 筛选
  3730. searchFormulaName() {
  3731. this.editEleListFilter = this.editEleListAll.filter((ele) => {
  3732. return ele.eName.indexOf(this.formulaInput) > -1;
  3733. });
  3734. },
  3735. saveNewEle(row) {
  3736. row.eAllowDeviation =
  3737. (row.allow ? row.allow : "") + (row.deviation ? row.deviation : "");
  3738. row.fId = this.curEleTable.initTableId;
  3739. row.initTableName = this.curEleTable.initTableName;
  3740. if (row.eType == 4) {
  3741. row.eLength = 0;
  3742. }
  3743. saveElement(row).then((res) => {
  3744. if (res.data.data) {
  3745. this.$set(row, "id", res.data.data.id);
  3746. this.$set(row, "ekey", res.data.data.ekey);
  3747. this.$message({
  3748. type: "success",
  3749. message: "保存成功!",
  3750. });
  3751. }
  3752. });
  3753. },
  3754. delEleRowHandle(index, list) {
  3755. let row = list[index];
  3756. if (row.id) {
  3757. //有id需要请求删除
  3758. this.$confirm("是否确认删除?", "删除元素", {
  3759. distinguishCancelAndClose: true,
  3760. confirmButtonText: "删除",
  3761. cancelButtonText: "取消",
  3762. }).then(() => {
  3763. removeElement(row.id, this.curEleTable.initTableName, row.ekey).then(
  3764. () => {
  3765. list.splice(index, 1);
  3766. }
  3767. );
  3768. });
  3769. } else {
  3770. list.splice(index, 1);
  3771. }
  3772. },
  3773. nodeTypeChange(val) {
  3774. console.log(333333333);
  3775. if (val === 53) {
  3776. // if (this.testTreeData.length > 0) {
  3777. // return;
  3778. // }
  3779. this.testTreeLoad = true;
  3780. // getAlltreeTrial(this.projectid, this.id, this.curTreeData.primaryKeyId).then((res) => {
  3781. // this.testTreeLoad = false;
  3782. // console.log(res.data.data,'data');
  3783. // let trialdata=res.data.data
  3784. // if(trialdata&&trialdata.allTree){
  3785. // this.testTreeData = trialdata.allTree[0];
  3786. // if(trialdata.allStatusIds.length>0){
  3787. // //设置勾选相关联试验全选
  3788. // this.mixRatioTestIds =trialdata.allStatusIds[0];
  3789. // }
  3790. // }
  3791. // });
  3792. let pid = this.curTreeData.primaryKeyId
  3793. ? this.curTreeData.primaryKeyId
  3794. : this.curTreeData.pKeyId;
  3795. getAlltree(this.projectid, this.id, pid).then((res) => {
  3796. this.testTreeLoad = false;
  3797. console.log(res.data.data, "data");
  3798. this.testTreeData = res.data.data;
  3799. });
  3800. }
  3801. },
  3802. //根据逗号联合
  3803. toJoin(arr) {
  3804. return arr ? arr.join() : "";
  3805. },
  3806. TestTreeCheckChange(_, { checkedKeys, halfCheckedKeys }) {
  3807. // const newarr = [...checkedKeys, ...halfCheckedKeys];
  3808. const newarr = [...checkedKeys];
  3809. this.nodeDetail.mixRatioTestIds = this.toJoin(newarr);
  3810. },
  3811. // filterChange() {
  3812. // if (this.treeData.length > 0) {
  3813. // this.$refs.treeall.filter(this.filterText);
  3814. // return;
  3815. // }
  3816. // this.treeLoad = true;
  3817. // getAlltree(this.projectid, this.id).then((res) => {
  3818. // this.treeLoad = false;
  3819. // this.treeData = res.data.data;
  3820. // console.log(res.data.data,'res.data.data');
  3821. // this.$nextTick(() => {
  3822. // this.$refs.treeall.filter(this.filterText);
  3823. // });
  3824. // });
  3825. // },
  3826. //搜索树
  3827. //搜索树
  3828. searchTreeClick() {
  3829. if (this.filterText.length > 0) {
  3830. this.isSearch = true;
  3831. this.searchtreeLoad = true;
  3832. getQueryValueByType({
  3833. queryValue: this.filterText,
  3834. type: this.searchType,
  3835. wbsId: this.id,
  3836. projectId: this.projectid,
  3837. }).then((res) => {
  3838. let arr = [];
  3839. if (Array.isArray(res.data.data)) {
  3840. arr = res.data.data;
  3841. this.searchTreeData = arr;
  3842. } else {
  3843. this.searchTreeData = [];
  3844. }
  3845. });
  3846. } else {
  3847. this.isSearch = false;
  3848. }
  3849. this.searchtreeLoad = false;
  3850. },
  3851. searchTreeClick1() {
  3852. if(!this.curTreeData.hasChildren){
  3853. this.$message.warning('请先选择一个父节点');
  3854. return;
  3855. }
  3856. // if (!this.filterText1.trim()) {
  3857. // this.$message.warning('请输入搜索内容');
  3858. // return;
  3859. // }
  3860. // 保存当前状态
  3861. // 保存当前状态
  3862. this.saveTreeState();
  3863. // 清空缓存
  3864. this.cachedNodes.clear();
  3865. // 重新加载选中节点及其子节点
  3866. this.reloadSelectedNode();
  3867. },
  3868. // 清空搜索
  3869. clearSearch1() {
  3870. this.filterText1 = '';
  3871. this.searchTreeClick1();
  3872. },
  3873. // 重新加载选中节点
  3874. async reloadSelectedNode() {
  3875. const tree = this.$refs.treeByType;
  3876. if (!tree || !this.currentNodeKey) return;
  3877. // 获取当前节点
  3878. const currentNode = tree.getNode(this.currentNodeKey);
  3879. if (!currentNode) return;
  3880. // 标记为未加载,强制重新加载
  3881. currentNode.loaded = false;
  3882. currentNode.expand(); // 这会触发loadNodeByType
  3883. // 恢复状态
  3884. await this.$nextTick();
  3885. tree.setCurrentKey(this.currentNodeKey);
  3886. },
  3887. // 重新加载树
  3888. reloadTree() {
  3889. const tree = this.$refs.treeByType;
  3890. if (!tree) return;
  3891. // 清空根节点
  3892. const rootNode = tree.store.root;
  3893. const rootId = rootNode.childNodes[0].data.id || 'root';
  3894. tree.updateKeyChildren(rootId, []);
  3895. // 强制重新加载根节点
  3896. const root = tree.getNode(rootId);
  3897. if (root) {
  3898. root.loaded = false;
  3899. root.expand();
  3900. }
  3901. // 恢复状态
  3902. this.$nextTick(() => {
  3903. if (this.currentNodeKey) {
  3904. tree.setCurrentKey(this.currentNodeKey);
  3905. }
  3906. });
  3907. },
  3908. // 刷新树数据
  3909. filterSearchClick(){
  3910. this.filterDialog=true;
  3911. },
  3912. filterSearchClickCancel(){
  3913. this.filterByType=false
  3914. this.searchTreeClick()
  3915. },
  3916. handleCancel() {
  3917. this.filterByType=false
  3918. this.filterDialog = false;
  3919. },
  3920. handleConfirm() {
  3921. this.isSearch = true;
  3922. this.searchtreeLoad = true;
  3923. getQueryValueByNodeType({
  3924. ...this.filterForm,
  3925. queryValue: this.filterText,
  3926. wbsId: this.id,
  3927. projectId: this.projectid,
  3928. }).then((res) => {
  3929. this.filterByType=true
  3930. let arr = [];
  3931. if (Array.isArray(res.data.data)) {
  3932. arr = res.data.data;
  3933. this.searchTreeData = arr;
  3934. } else {
  3935. this.searchTreeData = [];
  3936. }
  3937. });
  3938. this.searchtreeLoad = false;
  3939. this.filterDialog = false;
  3940. },
  3941. clearSearch() {
  3942. this.isSearch = false;
  3943. },
  3944. importTemplate(data) {
  3945. this.importTemplateVisible = true;
  3946. this.curTreeData = data;
  3947. if (!this.fileUrl) {
  3948. getAttchFromOriginalName(1, 20, {
  3949. originalName: "WBS划分模板.xls",
  3950. }).then((res) => {
  3951. if (res.data.data.records.length) {
  3952. this.fileUrl = res.data.data.records[0].link;
  3953. } else {
  3954. this.fileUrl = "";
  3955. }
  3956. });
  3957. }
  3958. },
  3959. importTemplateHandle() {
  3960. if (!this.upFile) {
  3961. this.$message({
  3962. type: "warning",
  3963. message: "请先选择文件再进行导入",
  3964. });
  3965. return;
  3966. }
  3967. let forms = new FormData();
  3968. forms.append("excelFile", this.upFile);
  3969. let wbsTreeFu = {
  3970. wbsId: this.id,
  3971. parentId: this.curTreeData.id,
  3972. // ancestors:'0,'+this.curTreeData.id,
  3973. };
  3974. let json = JSON.stringify(wbsTreeFu);
  3975. let blob = new Blob([json], { type: "application/json" });
  3976. forms.append("wbsTreeFu", blob);
  3977. this.importLoading = true;
  3978. importWbsTree(forms)
  3979. .then(() => {
  3980. //this.$router.go(0)
  3981. let node = this.$refs.tree.getNode(this.curTreeData.id);
  3982. node.isLeaf = false;
  3983. this.importTemplateVisible = false;
  3984. this.upFile = null;
  3985. })
  3986. .finally(() => {
  3987. this.importLoading = false;
  3988. });
  3989. },
  3990. handleDownload() {
  3991. if (this.fileUrl) {
  3992. window.open(this.fileUrl);
  3993. } else {
  3994. this.$message({
  3995. type: "warning",
  3996. message: "请先在附件管理上传【WBS划分模板.xls】文件",
  3997. });
  3998. }
  3999. },
  4000. fileClick() {
  4001. this.$refs.file.click();
  4002. },
  4003. fileChange(e) {
  4004. const file = e.target.files[0];
  4005. if (!file) {
  4006. // 如果用户没有选择图片,只是点了文件上传这个按钮
  4007. return;
  4008. }
  4009. //console.log(file)
  4010. this.upFile = file;
  4011. },
  4012. editNodeInfo(index, row) {
  4013. this.$set(row, "isEdit", true);
  4014. },
  4015. saveNodeInfoHandle(index, row) {
  4016. row.isEdit = false;
  4017. },
  4018. downloadTmp() {
  4019. getTemplate().then((res) => {
  4020. //console.log(res)
  4021. let blob = new Blob([res.data], {
  4022. type: "application/vnd.ms-excel",
  4023. });
  4024. //console.log(blob)
  4025. let filename = Date.parse(new Date()) + ".xls";
  4026. if (window.navigator.msSaveOrOpenBlob) {
  4027. // 兼容IE10
  4028. window.navigator.msSaveBlob(blob, filename);
  4029. } else {
  4030. // 兼容chrome/firefox
  4031. let aTag = document.createElement("a");
  4032. aTag.download = Date.parse(new Date()) + ".xls";
  4033. aTag.href = window.URL.createObjectURL(blob);
  4034. aTag.click();
  4035. URL.revokeObjectURL(aTag.href);
  4036. }
  4037. });
  4038. },
  4039. fileClick2() {
  4040. this.$refs.file2.click();
  4041. },
  4042. tmpImport(e) {
  4043. const file = e.target.files[0];
  4044. const formData = new FormData();
  4045. formData.append("file", file);
  4046. //console.log(file.name)
  4047. importWbsElement(formData)
  4048. .then((res) => {
  4049. res.data.data.forEach((element) => {
  4050. element.eName = element.elementName;
  4051. element.eLength = element.elementLength;
  4052. element.eType = Number(element.elementType);
  4053. element.eAllowDeviation = element.elementAllowDeviation;
  4054. element.eInspectionMethod = element.elementInspectionMethod;
  4055. this.eleReg.exec(element.eAllowDeviation);
  4056. // console.log(RegExp.$1)
  4057. // console.log(RegExp.$2)
  4058. element.allow = RegExp.$1 ? RegExp.$1 : "";
  4059. element.deviation = RegExp.$2 ? RegExp.$2 : "";
  4060. });
  4061. this.eleForm.elementList = res.data.data;
  4062. this.importVisible = false;
  4063. })
  4064. .finally(() => {
  4065. e.target.value = "";
  4066. });
  4067. },
  4068. visiblechange(value, data) {
  4069. this.$set(data, "moreShow", value);
  4070. },
  4071. bianhua2() {
  4072. this.excelSortTag2 = false;
  4073. this.$nextTick(() => {
  4074. this.excelSortTag2 = true;
  4075. });
  4076. },
  4077. //私有树的元素表修改排序
  4078. privateTableSort() {
  4079. if (!this.curTreeData.id) {
  4080. this.$message({
  4081. type: "warning",
  4082. message: "请先选择需要排序的节点",
  4083. });
  4084. return;
  4085. }
  4086. this.tableSortList = this.formData.map((form, index) => {
  4087. return {
  4088. sort: index + 1,
  4089. nodeName: form.tableName,
  4090. pkeyId: form.pkeyId,
  4091. };
  4092. });
  4093. // this.excelSortTag = true;
  4094. // this.excelSortTag2 = true;
  4095. this.sortTableList = JSON.parse(JSON.stringify(this.tableListByType));
  4096. this.$nextTick(() => {
  4097. this.$refs.tableSortRef.show(this.sortTableList);
  4098. });
  4099. },
  4100. editPrivateSort(listArr) {
  4101. console.log(listArr,'list');
  4102. let finalList=[]
  4103. listArr.forEach(item=>{
  4104. finalList.push(...item.list)
  4105. })
  4106. this.sortProLoad = true;
  4107. wbsTreePrivateTableSort(finalList).then(() => {
  4108. this.sortProLoad = false;
  4109. this.$message({
  4110. type: "success",
  4111. message: "排序成功!",
  4112. });
  4113. this.updateNodeTable();
  4114. }).finally(()=>{
  4115. this.sortProLoad = false;
  4116. });
  4117. },
  4118. //解析元素数据类型
  4119. eTypeFormatter(row) {
  4120. let text = "";
  4121. for (let i = 0; i < this.dataTypeList.length; i++) {
  4122. if (this.dataTypeList[i].dictKey == row.eType) {
  4123. text = this.dataTypeList[i].dictValue;
  4124. break;
  4125. }
  4126. }
  4127. return text;
  4128. },
  4129. //跳转到公式配置页面
  4130. toFormulaEdit(row, type) {
  4131. this.curEleTable.hasPartFormula = row.hasPartFormula;
  4132. this.formulaCurRow = row;
  4133. this.formulaCurRow.globaltype = type;
  4134. if (type === 10) {
  4135. this.formulaCompVisible1 = true;
  4136. this.formulaCurRow.elementType = false;
  4137. this.istableType = true;
  4138. } else {
  4139. this.formulaCompVisible = true;
  4140. }
  4141. },
  4142. //关闭公式弹窗
  4143. closeformulaComp() {
  4144. console.log("关闭");
  4145. selectFormElements(this.curEleTable.pkeyId, { type: 0 }).then((res) => {
  4146. this.editEleListFilter = res.data.data;
  4147. this.editEleListAll = [].concat(this.editEleListFilter);
  4148. });
  4149. },
  4150. //关闭公式弹窗
  4151. closeformulaComp1() {
  4152. console.log("关闭");
  4153. selectFormElements(this.curEleTable.pkeyId, { type: 0 }).then((res) => {
  4154. this.editEleListFilter = res.data.data;
  4155. this.editEleListAll = [].concat(this.editEleListFilter);
  4156. });
  4157. },
  4158. getNodeTypelist() {
  4159. let code = "name_rule";
  4160. getDictionary({
  4161. code,
  4162. }).then((res) => {
  4163. this.nodeTypelist1 = res.data.data;
  4164. });
  4165. },
  4166. getNodeTypelistData() {
  4167. const type = this.wbsType;
  4168. let code = "";
  4169. if (type === 5) {
  4170. code = "lar_node_type"; //征拆
  4171. } else if (type === 2) {
  4172. code = "trial_node_type"; //试验
  4173. } else if (type === 3) {
  4174. code = "meter_node_type"; //计量
  4175. } else {
  4176. {
  4177. code = "wbs_node_type"; //质检
  4178. }
  4179. }
  4180. getDictionary({
  4181. code,
  4182. }).then((res) => {
  4183. this.nodeTypelist = res.data.data;
  4184. res.data.data.forEach((element) => {
  4185. element.dictKey = Number(element.dictKey);
  4186. });
  4187. this.nodeTypelist = res.data.data;
  4188. });
  4189. },
  4190. getMajorDataTypeList() {
  4191. // if (this.majorDataTypeList.length > 1) {
  4192. // return;
  4193. // }
  4194. getDictionary({
  4195. code: "major_data_type",
  4196. }).then((res) => {
  4197. res.data.data.forEach((element) => {
  4198. element.dictKey = Number(element.dictKey);
  4199. });
  4200. // this.majorDataTypeList = res.data.data;
  4201. this.majorDataTypeList = res.data.data.filter(
  4202. (item) => item.dictKey != 0
  4203. );
  4204. });
  4205. },
  4206. getTableFileTypeList(){
  4207. if (this.tableFileTypeList.length > 1) {
  4208. return;
  4209. }
  4210. getDictionaryBiz({
  4211. code: "table_file_type",
  4212. }).then((res) => {
  4213. res.data.data.forEach((element) => {
  4214. element.dictKey =element.dictKey
  4215. });
  4216. this.tableFileTypeList = res.data.data;
  4217. });
  4218. },
  4219. getTableTypelist() {
  4220. const type = this.wbsType;
  4221. if (this.tableTypelist.length > 1) {
  4222. return;
  4223. }
  4224. let code = "";
  4225. if (type === 5) {
  4226. code = "table_type"; //征拆
  4227. } else if (type === 2) {
  4228. code = "trial_table_type"; //试验
  4229. } else {
  4230. code = "table_type"; //质检
  4231. }
  4232. getDictionary({
  4233. // code: "table_type",
  4234. // code: type === 2 ? "trial_table_type" : "table_type",
  4235. code,
  4236. }).then((res) => {
  4237. res.data.data.forEach((element) => {
  4238. element.dictKey = Number(element.dictKey);
  4239. });
  4240. this.tableTypelist = res.data.data;
  4241. });
  4242. },
  4243. getDataTypelist() {
  4244. if (this.dataTypeList.length > 1) {
  4245. return;
  4246. }
  4247. getDictionary({
  4248. code: "data_type",
  4249. }).then((res) => {
  4250. res.data.data.forEach((element) => {
  4251. element.dictKey = Number(element.dictKey);
  4252. });
  4253. this.dataTypeList = res.data.data;
  4254. });
  4255. },
  4256. getOwnerTypelist() {
  4257. if (this.ownerTypeList.length > 1) {
  4258. return;
  4259. }
  4260. getDictionary({
  4261. code: "owner_type",
  4262. }).then((res) => {
  4263. res.data.data.forEach((element) => {
  4264. element.dictKey = Number(element.dictKey);
  4265. });
  4266. this.ownerTypeList = res.data.data;
  4267. });
  4268. },
  4269. getStandardTypeOptions() {
  4270. getDictionary({
  4271. code: "classification",
  4272. }).then((res) => {
  4273. res.data.data.forEach((element) => {
  4274. element.dictKey = Number(element.dictKey);
  4275. });
  4276. // 定义要过滤的 dictKey 值
  4277. const targetKeys = [1, 2, 3, 4, 5];
  4278. // 过滤数组
  4279. const filteredOptions = res.data.data.filter((item) =>
  4280. targetKeys.includes(item.dictKey)
  4281. );
  4282. this.standardTypeOptions = filteredOptions;
  4283. });
  4284. },
  4285. changeStandType(val) {
  4286. let parentId = "";
  4287. this.standardTypeOptions.forEach((item) => {
  4288. if (item.dictKey == val) {
  4289. parentId = item.id; // 找到匹配项,提取 parentId
  4290. }
  4291. });
  4292. getChildList(1, 10000, parentId).then((res) => {
  4293. res.data.data.forEach((element) => {
  4294. element.dictKey = Number(element.dictKey);
  4295. });
  4296. this.unitOptions = res.data.data;
  4297. this.unitOptions = this.unitOptions.filter(
  4298. (item) => item.dictKey != -1
  4299. );
  4300. });
  4301. },
  4302. formatCat(row, column, cellValue) {
  4303. for (let i = 0; i < this.nodeTypelist.length; i++) {
  4304. if (this.nodeTypelist[i].dictKey == cellValue) {
  4305. return this.nodeTypelist[i].dictValue;
  4306. }
  4307. }
  4308. return cellValue;
  4309. //console.log(cellValue)
  4310. },
  4311. formatTableType(row, column, cellValue) {
  4312. for (let i = 0; i < this.tableTypelist.length; i++) {
  4313. if (this.tableTypelist[i].dictKey == cellValue) {
  4314. return this.tableTypelist[i].dictValue;
  4315. }
  4316. }
  4317. return cellValue;
  4318. //console.log(cellValue)
  4319. },
  4320. formatOwner(row, column, cellValue) {
  4321. for (let i = 0; i < this.ownerTypeList.length; i++) {
  4322. if (this.ownerTypeList[i].dictKey == cellValue) {
  4323. return this.ownerTypeList[i].dictValue;
  4324. }
  4325. }
  4326. return cellValue;
  4327. //console.log(cellValue)
  4328. },
  4329. formatdataType(row, column, cellValue) {
  4330. for (let i = 0; i < this.dataTypeList.length; i++) {
  4331. if (this.dataTypeList[i].dictKey == cellValue) {
  4332. return this.dataTypeList[i].dictValue;
  4333. }
  4334. }
  4335. return cellValue;
  4336. },
  4337. formMajorType(row, column, cellValue) {
  4338. for (let i = 0; i < this.majorDataTypeList.length; i++) {
  4339. if (this.majorDataTypeList[i].dictKey == cellValue) {
  4340. return this.majorDataTypeList[i].dictValue;
  4341. }
  4342. }
  4343. return cellValue;
  4344. },
  4345. // filterNode(value, data) {
  4346. // if (!value) return true;
  4347. // return data.title.indexOf(value) !== -1;
  4348. // },
  4349. getReturnNode(node, _array, value) {
  4350. let isPass =
  4351. node.data && node.data.title && node.data.title.indexOf(value) !== -1;
  4352. isPass ? _array.push(isPass) : "";
  4353. if (!isPass && node.level != 1 && node.parent) {
  4354. this.getReturnNode(node.parent, _array, value);
  4355. }
  4356. },
  4357. filterNode(value, data, node) {
  4358. if (!value) {
  4359. return true;
  4360. }
  4361. let level = node.level;
  4362. let _array = []; //这里使用数组存储 只是为了存储值。
  4363. this.getReturnNode(node, _array, value);
  4364. let result = false;
  4365. _array.forEach((item) => {
  4366. result = result || item;
  4367. });
  4368. return result;
  4369. },
  4370. //#endregion
  4371. //#region wbs私有树排序
  4372. async sortpai(data) {
  4373. console.log(data);
  4374. await this.findWbsTreePrivateSameLevel({
  4375. parentId: data.parentId,
  4376. projectId: this.projectid,
  4377. wbsId: this.id,
  4378. });
  4379. this.sortTag = true;
  4380. this.sortTag2 = true;
  4381. },
  4382. editSort() {
  4383. this.wbsTreePrivateSort();
  4384. },
  4385. bianhua() {
  4386. this.sortTag2 = false;
  4387. this.$nextTick(() => {
  4388. this.sortTag2 = true;
  4389. });
  4390. },
  4391. async wbsTreePrivateSort() {
  4392. this.sureSortload = true;
  4393. //wbs私有树节点手动排序
  4394. const { data: res } = await wbsTreePrivateSort(this.sort);
  4395. console.log(res);
  4396. if (res.code == 200) {
  4397. this.sortTag = false;
  4398. this.sortTag2 = false;
  4399. this.$message({
  4400. type: "success",
  4401. message: "排序成功!",
  4402. });
  4403. this.sureSortload = false;
  4404. this.isShowTree = false;
  4405. setTimeout(() => {
  4406. this.isShowTree = true;
  4407. }, 100);
  4408. // window.location.reload();
  4409. // this.getLazytreessss();
  4410. }
  4411. },
  4412. async findWbsTreePrivateSameLevel(da) {
  4413. //wbs私有树同级节点接口
  4414. const { data: res } = await findWbsTreePrivateSameLevel(da);
  4415. if (res.code == 200) {
  4416. this.sort = res.data;
  4417. }
  4418. },
  4419. async getLazytreessss() {
  4420. const type = this.wbsType;
  4421. const { data: res } = await getLazytree(
  4422. this.id,
  4423. 0,
  4424. this.userInfo.tenant_id,
  4425. this.projectid,
  4426. { wbsType: type }
  4427. );
  4428. console.log(res);
  4429. if (res.code == 200) {
  4430. this.treeData = res.data;
  4431. }
  4432. },
  4433. //#endregion
  4434. //#region 关联清表
  4435. async getList(da) {
  4436. //获取清表模板信息
  4437. const { data: res } = await getList(da);
  4438. console.log(res);
  4439. if (res.code === 200 && res.msg === "操作成功") {
  4440. this.GLExcelData = res.data.records;
  4441. }
  4442. },
  4443. async tabLazytreeAll() {
  4444. //清表树信息
  4445. this.GLExcelLoading = true;
  4446. const { data: res } = await tabLazytreeAll({
  4447. modeId: this.GLExcelFrom.name,
  4448. name: this.GLExcelFrom.search,
  4449. });
  4450. this.GLExcelLoading = false;
  4451. console.log(res);
  4452. if (res.code === 200 && res.msg === "操作成功") {
  4453. this.exceldata = res.data;
  4454. }
  4455. },
  4456. Associationlist(scope) {
  4457. //关联清表点击事件
  4458. console.log(scope.row);
  4459. this.GLExcel = true;
  4460. this.getList({
  4461. current: 1,
  4462. size: 100000,
  4463. parentId: 0,
  4464. });
  4465. this.GLExcelFrom.name = scope.row.modeId;
  4466. setTimeout(() => {
  4467. this.$refs.tree.setCheckedKeys([scope.row.excelId]);
  4468. }, 2000);
  4469. this.GLExcelFrom.initTableId = scope.row.initTableId;
  4470. this.GLExcelFrom.id = scope.row.pkeyId;
  4471. this.GLExcelFrom.excelId = scope.row.excelId;
  4472. this.GLExcelFrom.ids = scope.row.id;
  4473. this.GLExcelFrom.initTableName = scope.row.initTableName;
  4474. this.GLExcelFrom.pkeyId = scope.row.pkeyId;
  4475. },
  4476. changetherr() {
  4477. //清表类型选择框change事件
  4478. if (this.GLExcelFrom.name != "") {
  4479. this.GLExcelFrom.search = "";
  4480. this.tabLazytreeAll();
  4481. }
  4482. },
  4483. GLExcelMD() {
  4484. //弹框关闭事件
  4485. this.GLExcelFrom.name = "";
  4486. this.GLExcelFrom.search = "";
  4487. this.GLExcelFrom.id = "";
  4488. this.exceldata = [];
  4489. this.$refs.tree.setCheckedKeys([]);
  4490. this.GLExcel = false;
  4491. },
  4492. checkchange(data) {
  4493. //节点选中回调
  4494. if (this.$refs.tree.getCheckedNodes().length === 0) {
  4495. this.$refs.tree.setCheckedKeys([]);
  4496. } else if (this.$refs.tree.getCheckedNodes().length >= 1) {
  4497. this.$refs.tree.setCheckedKeys([data.id]);
  4498. }
  4499. },
  4500. async saveLinkTab() {
  4501. // 保存按钮
  4502. let checkNodes = this.$refs.tree.getCheckedNodes();
  4503. if (checkNodes.length > 0) {
  4504. let node = checkNodes[checkNodes.length - 1];
  4505. if (node.fileType != 3) {
  4506. this.$message({
  4507. type: "warning",
  4508. message: "请先上传Excel表",
  4509. });
  4510. return;
  4511. }
  4512. try {
  4513. const { data: res } = await saveLinkTab({
  4514. exceTabId: node.id,
  4515. tabId: this.GLExcelFrom.id,
  4516. updateAll:this.isNodeType? false:true,
  4517. });
  4518. if (res.code === 200) {
  4519. this.$message({
  4520. type: "success",
  4521. message: "关联清表成功",
  4522. });
  4523. // 保存原始的pkeyId
  4524. const originalPkeyId = this.GLExcelFrom.pkeyId;
  4525. if (this.isNodeType) {
  4526. // 加载节点类型的数据
  4527. const response = await selectByNodeTable(this.curTreeData.id, this.projectid, this.id);
  4528. if (response.data.data && response.data.data.length) {
  4529. this.formData = response.data.data;
  4530. // 查找并更新initTableId
  4531. const matchedItem = this.formData.find(ele => ele.pkeyId === originalPkeyId);
  4532. if (matchedItem) {
  4533. this.GLExcelFrom.initTableId = matchedItem.initTableId;
  4534. }
  4535. // 调用rightClick方法
  4536. this.rightClick(
  4537. this.GLExcelFrom.id,
  4538. this.GLExcelFrom.excelId,
  4539. this.GLExcelFrom.ids,
  4540. this.GLExcelFrom.initTableName,
  4541. this.GLExcelFrom.initTableId
  4542. );
  4543. } else {
  4544. this.formData = [];
  4545. }
  4546. } else {
  4547. // 非节点类型,重新加载整个树
  4548. await this.reloadEntireTree();
  4549. }
  4550. this.GLExcel = false;
  4551. }
  4552. } catch (error) {
  4553. console.error("关联清表失败:", error);
  4554. this.$message({
  4555. type: "error",
  4556. message: "关联清表失败",
  4557. });
  4558. }
  4559. } else {
  4560. this.$message({
  4561. type: "warning",
  4562. message: "请先设置清表",
  4563. });
  4564. }
  4565. },
  4566. getReturnNode2(node, _array, value) {
  4567. let isPass =
  4568. node.data && node.data.name && node.data.name.indexOf(value) !== -1;
  4569. isPass ? _array.push(isPass) : "";
  4570. if (!isPass && node.level != 1 && node.parent) {
  4571. this.getReturnNode2(node.parent, _array, value);
  4572. }
  4573. },
  4574. filterNode222(value, data, node) {
  4575. if (!value) {
  4576. return true;
  4577. }
  4578. let level = node.level;
  4579. let _array = []; //这里使用数组存储 只是为了存储值。
  4580. this.getReturnNode2(node, _array, value);
  4581. let result = false;
  4582. _array.forEach((item) => {
  4583. result = result || item;
  4584. });
  4585. return result;
  4586. },
  4587. //#endregion
  4588. //#region 节点参数
  4589. nodeInfo(data) {
  4590. //节点参数按钮
  4591. this.keymap();
  4592. //console.log(data)
  4593. let pid = data.primaryKeyId ? data.primaryKeyId : data.pKeyId;
  4594. this.jiedianId = pid;
  4595. this.parameters(pid);
  4596. this.nodeInfoVisible = true;
  4597. },
  4598. closenodeInfoVisible() {
  4599. this.nodeInfoTable = [];
  4600. this.nodeInfoVisible = false;
  4601. },
  4602. addNodeInfoTable() {
  4603. //添加节点参数数据
  4604. this.nodeInfoTable.unshift({
  4605. k: "",
  4606. v: "",
  4607. remark: "",
  4608. nodeId: this.jiedianId,
  4609. type: 1,
  4610. });
  4611. console.log(this.nodeInfoTable);
  4612. },
  4613. refreshnfoTable() {
  4614. //刷新表格
  4615. let prams = {
  4616. nodeId: this.jiedianId,
  4617. type: 1,
  4618. projectId: this.projectid,
  4619. };
  4620. this.nodeInfoTableLoad = true;
  4621. refrehPram(prams).then((res) => {
  4622. this.nodeInfoTableLoad = false;
  4623. if (res.data.code == 200) {
  4624. this.$message.success("刷新成功");
  4625. }
  4626. });
  4627. },
  4628. delNodeInfo(key, obj) {
  4629. this.delids.push(obj.id);
  4630. //设置参数名称中的删除按钮
  4631. this.namelists.splice(key, 1);
  4632. },
  4633. delNodeInfoss(key, obj) {
  4634. this.delids.push(obj.id);
  4635. //节点参数
  4636. this.nodeInfoTable.splice(key, 1);
  4637. },
  4638. setNodeParameters() {
  4639. //打开设置节点参数弹框按钮
  4640. this.infoNameVisible = true;
  4641. this.namelists = [...this.namelist];
  4642. },
  4643. async setParameterName() {
  4644. //设置参数名称中添加节点参数按钮
  4645. // wbsId: this.jiedianId
  4646. this.namelists.unshift({
  4647. name: "",
  4648. remark: "",
  4649. k: "",
  4650. type: 0,
  4651. nodeId: this.jiedianId,
  4652. });
  4653. },
  4654. async nodeInfoSave() {
  4655. //节点参数弹框保存按钮
  4656. if (this.nodeInfoTable) {
  4657. // if (this.nodeInfoTable.length == 0) {
  4658. // await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,type:1,delIds:this.delids,wps:[
  4659. // {
  4660. // nodeId: this.jiedianId,
  4661. // type: -1,
  4662. // },
  4663. // ]});
  4664. // this.nodeInfoVisible = false;
  4665. // this.delIds=[];
  4666. // this.$message({
  4667. // type: "success",
  4668. // message: "保存参数节点成功!",
  4669. // });
  4670. // return;
  4671. // }
  4672. console.log(this.namelist);
  4673. let tag = true;
  4674. this.nodeInfoTable.forEach((val) => {
  4675. if (!val.k | !val.v) {
  4676. return (tag = false);
  4677. }
  4678. //if (!val.name) {
  4679. for (let i = 0; i < this.namelist.length; i++) {
  4680. if (this.namelist[i].k == val.k) {
  4681. val.name = this.namelist[i].name;
  4682. return;
  4683. }
  4684. }
  4685. //}
  4686. });
  4687. if (tag) {
  4688. this.nodeInfoSaveload = true;
  4689. await this.saveOrUpdateBatch({
  4690. scopeType: 10,
  4691. projectId: this.projectid,
  4692. nodeId: this.jiedianId,
  4693. wps: this.nodeInfoTable,
  4694. type: 1,
  4695. delIds: this.delids,
  4696. });
  4697. this.delIds = [];
  4698. this.$message({
  4699. type: "success",
  4700. message: "设置参数节点成功!",
  4701. });
  4702. this.nodeInfoSaveload = false;
  4703. this.parameters(this.jiedianId);
  4704. // this.nodeInfoVisible = false;
  4705. } else {
  4706. this.$message({
  4707. type: "error",
  4708. message: "请填写所有的参数名称和参数值!",
  4709. });
  4710. }
  4711. } else {
  4712. this.$message({
  4713. type: "error",
  4714. message: "请先设置参数节点!",
  4715. });
  4716. }
  4717. },
  4718. async addParameterName() {
  4719. //设置参数名称中的保存按钮
  4720. if (this.namelists.length) {
  4721. let tag = true;
  4722. this.namelists.forEach((val) => {
  4723. if (!val.name || !val.k) {
  4724. return (tag = false);
  4725. }
  4726. });
  4727. if (tag) {
  4728. await this.saveOrUpdateBatch({
  4729. scopeType: 10,
  4730. projectId: this.projectid,
  4731. nodeId: this.jiedianId,
  4732. wps: this.namelists,
  4733. type: 0,
  4734. delIds: this.delids,
  4735. }); //保存设置参数
  4736. this.infoNameVisible = false;
  4737. this.delIds = [];
  4738. this.keymap();
  4739. } else {
  4740. this.$message({
  4741. type: "error",
  4742. message: "请填写所有的参数名称和参数值KEY!",
  4743. });
  4744. }
  4745. } else {
  4746. this.$message({
  4747. type: "warning",
  4748. message: "请先添加参数",
  4749. });
  4750. }
  4751. },
  4752. closeParameter() {
  4753. //设置参数名称,关闭按钮
  4754. this.namelists = [];
  4755. this.infoNameVisible = false;
  4756. },
  4757. async parameters(wbsId) {
  4758. //获取接待你参数列表
  4759. const { data: res } = await parameters({ wbsId });
  4760. console.log(res);
  4761. if (res.code == 200) {
  4762. if (Array.isArray(res.data)) {
  4763. this.nodeInfoTable = res.data;
  4764. }
  4765. }
  4766. },
  4767. async saveOrUpdateBatch(da) {
  4768. //保存
  4769. const { data: res } = await saveOrUpdateBatch(da);
  4770. this.delids = [];
  4771. console.log(res);
  4772. },
  4773. async keymap() {
  4774. //节点参数枚举
  4775. const { data: res } = await keymap();
  4776. console.log(res);
  4777. if (res.code == 200) {
  4778. this.namelist = res.data;
  4779. }
  4780. },
  4781. //#endregion
  4782. //#region 调整表单
  4783. adjustExcel(pkeyId, excelId) {
  4784. //调整表单
  4785. this.GLExcelFrom.id = pkeyId;
  4786. this.GLExcelFrom.excelId = excelId;
  4787. this.getExcelHtml(pkeyId);
  4788. },
  4789. async getExcelHtml(pkeyId) {
  4790. const { data: res } = await getExcelHtml({ pkeyId });
  4791. console.log(res);
  4792. if (res.code === 200) {
  4793. localStorage.setItem("excelHtml", res.data);
  4794. this.adjustmentExcel = res.data;
  4795. this.excelHtml = true;
  4796. }
  4797. },
  4798. removeExcel() {
  4799. this.excelHtml = false;
  4800. },
  4801. //#endregion
  4802. //#region 编辑元素
  4803. async rightClick(pkeyId, excelId, id, initTableName, initTableId) {
  4804. await this.getExcelHtml2(pkeyId);
  4805. this.editElementQuery.pkeyId = pkeyId;
  4806. this.editElementQuery.excelId = excelId;
  4807. this.editElementQuery.id = id;
  4808. this.editElementQuery.initTableName = initTableName;
  4809. this.editElementQuery.initTableId = initTableId;
  4810. this.editElementQuery.pid = this.$route.query.pid;
  4811. this.editElementQuery.wbsid = this.$route.query.wbsid;
  4812. this.editElementQuery.nodeid = this.curTreeData.id;
  4813. this.editElementVisible = true;
  4814. },
  4815. hideEditElementVisible() {
  4816. this.editElementVisible = false;
  4817. // this.updateNodeTable();
  4818. if(this.isNodeType){
  4819. this.updateNodeTable();
  4820. }
  4821. },
  4822. async getExcelHtml2(pkeyId) {
  4823. const { data: res } = await getExcelHtml({ pkeyId });
  4824. console.log(res);
  4825. if (res.code === 200) {
  4826. localStorage.setItem("editElement", res.data);
  4827. }
  4828. },
  4829. //#endregion
  4830. //#region 元素表单信息
  4831. editEditElementForm() {
  4832. if(this.isNodeType){
  4833. this.formDatass = JSON.parse(JSON.stringify(this.tableListByType));
  4834. this.formDatass.forEach((ele)=>{
  4835. const listArr=ele.list
  4836. listArr.forEach((ele)=>{
  4837. ele.tableType=Number(ele.tableType)
  4838. ele.tableOwner=Number(ele.tableOwner)
  4839. })
  4840. })
  4841. this.editElementFormTag = true;
  4842. return
  4843. }
  4844. //标记元素
  4845. if (this.formData.length) {
  4846. let da = [];
  4847. this.formDatass = [...this.formData];
  4848. this.formDatass.forEach((val) => {
  4849. da.push({
  4850. tableType: val.tableType - 0,
  4851. tableOwner: val.tableOwner - 0,
  4852. pkeyId: val.pkeyId,
  4853. tableName: val.tableName,
  4854. fillRate: val.fillRate,
  4855. nodeType: val.nodeType - 0,
  4856. });
  4857. });
  4858. this.formDatass = da;
  4859. this.editElementFormTag = true;
  4860. }else{
  4861. this.$message({
  4862. type: "warning",
  4863. message: "当前列表无数据!",
  4864. });
  4865. }
  4866. },
  4867. editeditElementFormMF() {
  4868. //保存按钮
  4869. let da = [];
  4870. let tag = true;
  4871. console.log( this.formDatass,' this.formDatass');
  4872. if(!this.isNodeType){
  4873. this.formDatass.forEach((val) => {
  4874. if (!val.tableName || !val.tableType || !val.tableOwner) {
  4875. tag = false;
  4876. return;
  4877. } else {
  4878. da.push({
  4879. pkeyId: val.pkeyId,
  4880. nodeName: val.tableName,
  4881. tableType: val.tableType,
  4882. tableOwner: val.tableOwner,
  4883. fillRate: val.fillRate,
  4884. nodeType: val.nodeType,
  4885. });
  4886. }
  4887. });
  4888. }else{
  4889. this.formDatass.forEach((ele)=>{
  4890. const listArr=ele.list
  4891. listArr.forEach((ele)=>{
  4892. if (!ele.tableName || !ele.tableType || !ele.tableOwner) {
  4893. tag = false;
  4894. return;
  4895. } else {
  4896. da.push({
  4897. pkeyId: ele.pkeyId,
  4898. nodeName: ele.tableName,
  4899. tableType: ele.tableType,
  4900. tableOwner: ele.tableOwner,
  4901. fillRate: ele.fillRate,
  4902. });
  4903. }
  4904. })
  4905. })
  4906. }
  4907. if (tag) {
  4908. this.updateBatchNodeTableInfo2(da);
  4909. } else {
  4910. this.$message({
  4911. type: "success",
  4912. message: "请填写完整元素表单的所有信息!",
  4913. });
  4914. }
  4915. },
  4916. async updateBatchNodeTableInfo2(da) {
  4917. this.editeditElementFormMFLoading = true;
  4918. //共有编辑元素
  4919. const { data: res } = await updateBatchNodeTableInfo2(da);
  4920. if (res.code == 200) {
  4921. this.editElementFormTag = false;
  4922. this.updateNodeTable();
  4923. this.editeditElementFormMFLoading = false;
  4924. }
  4925. this.editeditElementFormMFLoading = false;
  4926. },
  4927. //#endregion
  4928. //获取节点展开路径
  4929. getExpandedKeys(node) {
  4930. //console.log(node)
  4931. let expandedKeys = [];
  4932. while (node.parent) {
  4933. expandedKeys.push(node.data.id);
  4934. node = node.parent;
  4935. }
  4936. setStore({
  4937. name: this.expandName,
  4938. content: expandedKeys,
  4939. type: true, //sessionStorage
  4940. });
  4941. //console.log(expandedKeys)
  4942. },
  4943. //触发节点参数
  4944. nodeInfoHandle() {
  4945. if (!this.curTreeData.id) {
  4946. this.$message({
  4947. type: "warning",
  4948. message: "请先选择节点",
  4949. });
  4950. return;
  4951. }
  4952. this.nodeInfo(this.curTreeData);
  4953. },
  4954. eleFormulaHandle() {
  4955. if (!this.curTreeData.id || !this.curTreeNode.id) {
  4956. this.$message({
  4957. type: "warning",
  4958. message: "请先选择节点",
  4959. });
  4960. return;
  4961. }
  4962. this.setLeftType(4, this.curTreeData, this.curTreeNode);
  4963. // this.showType = 2;
  4964. },
  4965. editNodeHandle() {
  4966. console.log(this.curTreeData, "this.curTreeData.id ");
  4967. if (!this.curTreeData.id || !this.curTreeNode.id) {
  4968. this.$message({
  4969. type: "warning",
  4970. message: "请先选择节点",
  4971. });
  4972. return;
  4973. }
  4974. this.mixRatioTestIds = [];
  4975. // this.nodeTypeChange(53);
  4976. this.nodeTypeChange(this.curTreeData.nodeType);
  4977. this.dialogTitle = "编辑节点";
  4978. this.setLeftType(2, this.curTreeData, this.curTreeNode);
  4979. },
  4980. addNodeHandle() {
  4981. if (!this.curTreeData.id || !this.curTreeNode.id) {
  4982. this.$message({
  4983. type: "warning",
  4984. message: "请先选择节点",
  4985. });
  4986. return;
  4987. }
  4988. this.mixRatioTestIds = [];
  4989. // this.nodeTypeChange(53);
  4990. this.nodeTypeChange(this.curTreeData.nodeType);
  4991. this.dialogTitle = "新增节点";
  4992. this.setLeftType(1, this.curTreeData, this.curTreeNode);
  4993. },
  4994. copyNodeHandle() {
  4995. if (!this.curTreeData.id || !this.curTreeNode.id) {
  4996. this.$message({
  4997. type: "warning",
  4998. message: "请先选择节点",
  4999. });
  5000. return;
  5001. }
  5002. },
  5003. delNodeHandle() {
  5004. if (!this.curTreeData.id || !this.curTreeNode.id) {
  5005. this.$message({
  5006. type: "warning",
  5007. message: "请先选择节点",
  5008. });
  5009. return;
  5010. }
  5011. if (this.curTreeNode.level == 1) {
  5012. this.$message({
  5013. type: "warning",
  5014. message: "当前节点无法删除",
  5015. });
  5016. return;
  5017. }
  5018. this.deleNode(this.curTreeData, this.curTreeNode);
  5019. },
  5020. eleHandle() {
  5021. if (!this.curTreeData.id || !this.curTreeNode.id) {
  5022. this.$message({
  5023. type: "warning",
  5024. message: "请先选择节点",
  5025. });
  5026. return;
  5027. }
  5028. this.setLeftType(5, this.curTreeData, this.curTreeNode);
  5029. },
  5030. syncInfoHandle(item) {
  5031. if (this.curTreeData.primaryKeyId || this.curTreeData.pKeyId) {
  5032. this.$confirm("是否同步节点参数?", "提示", {
  5033. confirmButtonText: "确定",
  5034. cancelButtonText: "取消",
  5035. type: "warning",
  5036. }).then(() => {
  5037. this.syncBtnLoad = true;
  5038. this.menuoptions.forEach((ele) => {
  5039. if (item.value == ele.value) {
  5040. ele.load = true;
  5041. }
  5042. });
  5043. let pid = this.curTreeData.primaryKeyId
  5044. ? this.curTreeData.primaryKeyId
  5045. : this.curTreeData.pKeyId;
  5046. syncNodeParam(this.projectid, pid)
  5047. .then(() => {
  5048. this.$message({
  5049. type: "success",
  5050. message: "同步成功!",
  5051. });
  5052. })
  5053. .finally(() => {
  5054. this.syncBtnLoad = false;
  5055. this.menuoptions.forEach((ele) => {
  5056. if (item.value == ele.value) {
  5057. ele.load = false;
  5058. }
  5059. });
  5060. });
  5061. });
  5062. } else {
  5063. this.$message.warning("请先选择左侧节点");
  5064. }
  5065. },
  5066. //显示别名弹窗
  5067. aliasShow() {
  5068. this.aliasVisible = true;
  5069. if (this.nodeDetail.fullName) {
  5070. this.aliasArr = this.nodeDetail.fullName.split(",");
  5071. } else {
  5072. this.aliasArr = [];
  5073. }
  5074. this.aliasInput = "";
  5075. },
  5076. addAlias() {
  5077. if (this.aliasInput) {
  5078. this.aliasArr.push(this.aliasInput);
  5079. this.aliasInput = "";
  5080. }
  5081. },
  5082. delAlias(index) {
  5083. this.aliasArr.splice(index, 1);
  5084. },
  5085. saveAliasHandle() {
  5086. this.nodeDetail.fullName = this.aliasArr.join(",");
  5087. if (this.editType == 1) {
  5088. //新增
  5089. this.aliasVisible = false;
  5090. } else if (this.editType == 2) {
  5091. //编辑 私有
  5092. privateSubmitFullName(
  5093. this.nodeDetail.pKeyId,
  5094. this.nodeDetail.fullName
  5095. ).then(() => {
  5096. this.$message({
  5097. type: "success",
  5098. message: "保存成功",
  5099. });
  5100. this.aliasVisible = false;
  5101. });
  5102. }
  5103. },
  5104. async syncNodeTableHandle(data) {
  5105. this.isAdd=''
  5106. console.log('后管数据同步',data);
  5107. this.curTreeData=data
  5108. this.isShowLeft=false
  5109. // await this.getNodeStatusData()
  5110. if(this.syncListDialog){
  5111. return
  5112. }
  5113. this.syncForm.range='1'
  5114. this.proSyncTag=true
  5115. if(this.$refs.syncProTree){
  5116. this.$refs.syncProTree.setCheckedKeys([])
  5117. }
  5118. if(this.$refs.proTable){
  5119. this.$refs.proTable.clearSelection()
  5120. }
  5121. this.isShowTable=true
  5122. this.getTypeOptions()
  5123. this.getRangeOptions()
  5124. this.getCheckIdList()
  5125. let pid=data.primaryKeyId?data.primaryKeyId:data.pKeyId
  5126. this.getTempProjectList(pid)
  5127. },
  5128. syncProjectHandle(data) {
  5129. this.$confirm("是否同步节点【" + data.title + "】到合同段?", "提示", {
  5130. confirmButtonText: "确定",
  5131. cancelButtonText: "取消",
  5132. type: "warning",
  5133. }).then(() => {
  5134. let notify = this.$notify({
  5135. title: "提示",
  5136. message: "节点数据同步中...",
  5137. duration: 0,
  5138. });
  5139. let pid = data.primaryKeyId ? data.primaryKeyId : data.pKeyId;
  5140. syncNodeinfo(pid)
  5141. .then(() => {
  5142. this.updateNodeTable();
  5143. this.$message({
  5144. type: "success",
  5145. message: "同步成功",
  5146. });
  5147. })
  5148. .catch(() => {
  5149. this.$message({
  5150. type: "error",
  5151. message: "同步失败",
  5152. });
  5153. })
  5154. .finally(() => {
  5155. notify.close();
  5156. });
  5157. });
  5158. },
  5159. //同步元素表单排序到合同段
  5160. async syncSortHandle(data) {
  5161. console.log('同步到合同');
  5162. this.isShowLeft=false
  5163. this.curTreeData=data
  5164. if(this.syncListDialog){
  5165. return
  5166. }
  5167. // await this.getNodeStatusData()
  5168. this.syncForm.range='2'
  5169. this.proSyncTag=true
  5170. this.isShowTable=true
  5171. this.getTypeOptions()
  5172. this.getRangeOptions()
  5173. this.getCheckIdList()
  5174. selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
  5175. if (res.data.data.length>0) {
  5176. this.preTableData = res.data.data;
  5177. } else {
  5178. this.preTableData = [];
  5179. }
  5180. });
  5181. },
  5182. typeTreeLoadNode(node, resolve) {
  5183. let pid = 0;
  5184. if (node.level != 0) {
  5185. pid = node.data.id;
  5186. }
  5187. tabTypeLazyTree(pid, this.projectid).then((res) => {
  5188. let arr = [];
  5189. if (Array.isArray(res.data.data)) {
  5190. arr = res.data.data;
  5191. }
  5192. return resolve(arr);
  5193. });
  5194. },
  5195. getTypeTreeDetail() {},
  5196. independent() {
  5197. this.$router.push({
  5198. path: "/project/independent",
  5199. query: {
  5200. pid: this.projectid,
  5201. wbsid: this.$route.query.wbsid,
  5202. wbsType: this.wbsType,
  5203. },
  5204. });
  5205. },
  5206. archiveTimeClick() {
  5207. this.$router.push({
  5208. path: "/project/archiveTime",
  5209. query: { pid: this.projectid, wbsid: this.$route.query.wbsid },
  5210. });
  5211. },
  5212. syncElectric(item) {
  5213. if (this.curTreeData.primaryKeyId || this.curTreeData.pKeyId) {
  5214. console.log("同步电签默认信息");
  5215. this.$confirm("是否同步电签默认信息?", "提示", {
  5216. confirmButtonText: "确定",
  5217. cancelButtonText: "取消",
  5218. type: "warning",
  5219. }).then(() => {
  5220. this.syncElectricLoad = true;
  5221. this.menuoptions.forEach((ele) => {
  5222. if (item.value == ele.value) {
  5223. ele.load = true;
  5224. }
  5225. });
  5226. let pid = this.curTreeData.primaryKeyId
  5227. ? this.curTreeData.primaryKeyId
  5228. : this.curTreeData.pKeyId;
  5229. syncProjecteVisa(this.projectid, pid)
  5230. .then(() => {
  5231. this.$message({
  5232. type: "success",
  5233. message: "同步成功!",
  5234. });
  5235. })
  5236. .finally(() => {
  5237. this.syncElectricLoad = false;
  5238. this.menuoptions.forEach((ele) => {
  5239. if (item.value == ele.value) {
  5240. ele.load = false;
  5241. }
  5242. });
  5243. });
  5244. });
  5245. } else {
  5246. this.$message.warning("请先选择左侧节点");
  5247. }
  5248. },
  5249. //节点参数 关联元素
  5250. linkEle(row) {
  5251. console.log(row, "row");
  5252. if (!row.id) {
  5253. this.$message.warning("请先保存数据,再点击关联元素");
  5254. } else {
  5255. this.linkEleVisible = true;
  5256. this.curParam = row;
  5257. getParamElements({
  5258. nodeId: this.curTreeData.id,
  5259. projectId: this.projectid,
  5260. paramId: row.id,
  5261. scopeType: 10,
  5262. }).then((res) => {
  5263. if (res.data.data.length) {
  5264. this.linkEleTableList = res.data.data;
  5265. } else {
  5266. this.linkEleTableList = [];
  5267. }
  5268. });
  5269. }
  5270. },
  5271. //关联元素弹框
  5272. tolinkEle(row) {
  5273. this.curLinkEleTable = row;
  5274. this.linkCheckVisible = true;
  5275. let pid = this.curTreeData.primaryKeyId
  5276. ? this.curTreeData.primaryKeyId
  5277. : this.curTreeData.pKeyId;
  5278. selectFormElements(row.id, { type: 3, nodeId: pid }).then((res) => {
  5279. res.data.data.forEach((ele) => {
  5280. ele.checked = false;
  5281. ele.show = true;
  5282. });
  5283. this.linkEleList = res.data.data;
  5284. this.linkEleListAll = [].concat(this.linkEleList);
  5285. });
  5286. },
  5287. //删除关联
  5288. delLink(data) {
  5289. this.$confirm("删除关联, 是否继续?", "提示", {
  5290. confirmButtonText: "确定",
  5291. cancelButtonText: "取消",
  5292. type: "warning",
  5293. })
  5294. .then(() => {
  5295. console.log(data);
  5296. delParamElements(data).then(() => {
  5297. this.$message({
  5298. type: "success",
  5299. message: "删除成功!",
  5300. });
  5301. getParamElements({
  5302. nodeId: this.curTreeData.id,
  5303. projectId: this.projectid,
  5304. paramId: this.curParam.id,
  5305. scopeType: 10,
  5306. }).then((res) => {
  5307. if (res.data.data.length) {
  5308. this.linkEleTableList = res.data.data;
  5309. } else {
  5310. this.linkEleTableList = [];
  5311. }
  5312. });
  5313. });
  5314. })
  5315. .catch(() => {});
  5316. },
  5317. //筛选元素
  5318. searchEle() {
  5319. this.linkEleList = this.linkEleListAll.filter((ele) => {
  5320. return ele.eName.indexOf(this.linkEleKey) > -1;
  5321. });
  5322. },
  5323. linkEleCheck(value, index) {
  5324. //console.log(value)
  5325. if (value) {
  5326. this.linkEleList.forEach((ele, i) => {
  5327. if (i != index) {
  5328. ele.checked = false;
  5329. }
  5330. });
  5331. }
  5332. },
  5333. //关联元素
  5334. saveLinkEle() {
  5335. let target = {};
  5336. this.linkEleList.forEach((e) => {
  5337. if (e.checked == true) {
  5338. target = { elementId: e.id, paramId: this.curParam.id };
  5339. }
  5340. });
  5341. if (JSON.stringify(target) !== "{}") {
  5342. specifiedParamElements(target).then((data) => {
  5343. this.linkCheckVisible = false;
  5344. getParamElements({
  5345. nodeId: this.curTreeData.id,
  5346. projectId: this.projectid,
  5347. paramId: this.curParam.id,
  5348. scopeType: 10,
  5349. }).then((res) => {
  5350. if (res.data.data.length) {
  5351. this.linkEleTableList = res.data.data;
  5352. } else {
  5353. this.linkEleTableList = [];
  5354. }
  5355. });
  5356. });
  5357. } else {
  5358. this.$message.warning("请先选择关联元素");
  5359. }
  5360. },
  5361. //树形控件菜单相关方法
  5362. mouseout() {
  5363. this.menuvisible = false;
  5364. },
  5365. //展示菜单
  5366. showMenu(e, data, node) {
  5367. e.preventDefault();
  5368. console.log(e, "e");
  5369. var x = e.pageX; //这个应该是相对于整个浏览器页面的x坐标,左上角为坐标原点(0,0)
  5370. var y = e.pageY; //这个应该是相对于整个浏览器页面的y坐标,左上角为坐标原点(0,0)
  5371. this.menutop = y;
  5372. this.menuleft = x;
  5373. this.menuvisible = true;
  5374. },
  5375. menuClick(e, item, data,node) {
  5376. this.curTreeData = data; //当前节点数据
  5377. this.curTreeNode = node; //当前节点数据
  5378. e.preventDefault();
  5379. if (item.key === "sort") {
  5380. this.sortpai(data);
  5381. } else if (item.key === "sync1") {
  5382. this.syncNodeTableHandle(data);
  5383. } //
  5384. else if (item.key === "sync3") {
  5385. this.syncSortHandle(data);
  5386. } else if (item.key === "add") {
  5387. this.addNodeHandle();
  5388. } else if (item.key === "edit") {
  5389. this.editNodeHandle();
  5390. } else if (item.key === "del") {
  5391. this.delNodeHandle();
  5392. } else if (item.value === "jdSync") {
  5393. this.syncInfoHandle(item);
  5394. } else if (item.value === "gsSync") {
  5395. this.$message({
  5396. type: "info",
  5397. message: "暂无相关接口!",
  5398. });
  5399. } else if (item.value === "dqSync") {
  5400. this.syncElectric(item);
  5401. }
  5402. },
  5403. //展示数据同步下拉框
  5404. showSyncbtn() {
  5405. this.isshowSyncbtn = !this.isshowSyncbtn;
  5406. },
  5407. getDictTypelist() {
  5408. if (this.dynamicDictList.length > 1) {
  5409. return;
  5410. }
  5411. getDictionary({
  5412. code: "land_field_dict",
  5413. }).then((res) => {
  5414. res.data.data.forEach((element) => {
  5415. element.dictKey = Number(element.dictKey);
  5416. });
  5417. this.dynamicDictList = res.data.data;
  5418. const filteredList = this.dynamicDictList.filter(
  5419. (item) => item.dictKey === 600 || item.dictKey === 0
  5420. );
  5421. this.dynamicDictList = filteredList;
  5422. });
  5423. },
  5424. getSelectFormElements(id) {
  5425. this.editEleTableloading = true;
  5426. let finalId=this.isNodeType?this.curEleTable.pkeyId:this.curEleTable.id
  5427. selectFormElements(finalId, {
  5428. type: 0,
  5429. search: this.searchinput,
  5430. }).then((res) => {
  5431. this.editEleTableloading = false;
  5432. this.editTable = res.data.data;
  5433. });
  5434. },
  5435. //编辑
  5436. handleEdit(index, row) {
  5437. this.curEleTable = row;
  5438. this.getSelectFormElements();
  5439. this.editDialogShow = true;
  5440. this.getDictTypelist();
  5441. },
  5442. //编辑元素信息(请谨慎操作)
  5443. clearsearchinput() {
  5444. this.getSelectFormElements();
  5445. },
  5446. searchinputChange() {
  5447. this.getSelectFormElements();
  5448. },
  5449. saveEles() {
  5450. if (this.editTable.length > 0) {
  5451. console.log( this.curEleTable,' this.curEleTable');
  5452. this.saveLoading = true;
  5453. updateBatchElements(
  5454. this.editTable,
  5455. this.curEleTable.initTableName
  5456. ).then(() => {
  5457. this.saveLoading = false;
  5458. this.editDialogShow = false;
  5459. this.updateNodeTable();
  5460. this.$message({
  5461. type: "success",
  5462. message: "保存成功!",
  5463. });
  5464. });
  5465. } else {
  5466. this.editDialogShow = false;
  5467. this.updateNodeTable();
  5468. this.$message({
  5469. type: "success",
  5470. message: "保存成功!",
  5471. });
  5472. }
  5473. },
  5474. //文件题名(全局按钮)
  5475. fileTitleHandle(){
  5476. this.getFileTableData()
  5477. this.fileTitleVisible = true;
  5478. },
  5479. changeRadio(val){
  5480. console.log(val,'val');
  5481. const fileItem = this.fileTableData[this.chooseFileIndex];
  5482. this.$set(fileItem, 'type', val);
  5483. },
  5484. //获取文件题名规则
  5485. getFileTableData(){
  5486. this.fileTableLoading=true
  5487. getNameRule(
  5488. { projectId:this.projectid}
  5489. ).then((res) => {
  5490. this.fileTableLoading=false
  5491. if(res.data.data){
  5492. this.fileTableData = res.data.data;
  5493. this.fileTableData.forEach((element) => {
  5494. element.roleNameVal = element.nameRule.split(",");
  5495. element.ruleName=element.nameVaule.split("-")
  5496. if(element.type===2){
  5497. const list=element.list
  5498. let arr=[]
  5499. let arrId=[]
  5500. list.forEach((ele) => {
  5501. arr.push(ele.nodeName)
  5502. arrId.push(ele.nodeId)
  5503. });
  5504. element.ruleSizeVal = arr.join('、');
  5505. element.ruleSizeValId=arrId
  5506. }else{
  5507. element.ruleSizeVal=''
  5508. element.ruleSizeValId=''
  5509. }
  5510. });
  5511. }else{
  5512. this.fileTableData =[]
  5513. }
  5514. });
  5515. },
  5516. //获取文件题名范围
  5517. getTitleRangeData(row){
  5518. this.fileTreeLoading=true
  5519. getTitleRange(
  5520. { projectId:this.projectid,
  5521. nameId:row.nameId,
  5522. wbsType:this.wbsType
  5523. }
  5524. ).then((res) => {
  5525. this.fileTreeLoading=false
  5526. if(res.data.data){
  5527. this.fileTreeData = res.data.data;
  5528. // this.deCheckTreeKeys = this.fileTreeData.filter(node => node.status === 11).map(node => node.id);
  5529. }else{
  5530. this.fileTreeData =[]
  5531. }
  5532. });
  5533. },
  5534. //选择题名范围
  5535. chooseFile(index,row){
  5536. const {ruleName}=row
  5537. if(ruleName&&ruleName.length>0){
  5538. this.chooseFileVisible = true;
  5539. this.chooseFileIndex= index;
  5540. this.deCheckTreeKeys=row.ruleSizeValId
  5541. this.getTitleRangeData(row)
  5542. }else{
  5543. this.$message.warning('请先选择文件题名规则');
  5544. }
  5545. },
  5546. checkFileSize(data,{checkedNodes,checkedKeys}){
  5547. let checkedTitles = checkedNodes.map(node => node.nodeName).join('、');
  5548. this.fileTableData[this.chooseFileIndex].isEdit1=false
  5549. const fileItem = this.fileTableData[this.chooseFileIndex];
  5550. this.$set(fileItem, 'ruleSizeVal', checkedTitles);
  5551. this.$set(fileItem, 'ruleSizeValId', checkedKeys);
  5552. this.deCheckTreeKeys=checkedKeys
  5553. },
  5554. getCheckedNodes (treeData, checkedKeys) {
  5555. let result = []
  5556. treeData.forEach(node => {
  5557. if (checkedKeys&&checkedKeys.includes(node.id)) {
  5558. result.push(node)
  5559. }
  5560. if (node.children) {
  5561. result = result.concat(getCheckedNodes(node.children, checkedKeys))
  5562. }
  5563. })
  5564. return result
  5565. },
  5566. saveFileSize(){
  5567. // const checkedNodes = this.getCheckedNodes(this.fileTreeData, this.deCheckTreeKeys).filter(node => node.status !== 11)
  5568. const checkedNodes = this.getCheckedNodes(this.fileTreeData, this.deCheckTreeKeys)
  5569. this.fileTableData[this.chooseFileIndex].ruleSizeValId = checkedNodes.map(node => node.id)
  5570. this.fileTableData[this.chooseFileIndex].ruleSizeVal = checkedNodes.map(node => node.nodeName).join('、')
  5571. this.chooseFileVisible = false;
  5572. this.isShowSize=false
  5573. setTimeout(()=>{
  5574. this.isShowSize=true
  5575. },100)
  5576. },
  5577. editRow(index,row){
  5578. console.log(row,'row');
  5579. this.$set(row, "isEdit", true);
  5580. this.$set(row, "isEdit1", true);
  5581. this.fileTitleModel.type=row.type
  5582. },
  5583. //保存文件题名
  5584. saveRow(index,row){
  5585. if(row.ruleName.length<1){
  5586. this.$message.warning('请选择文件题名规则')
  5587. return
  5588. }
  5589. if(!row.type){
  5590. this.$message.warning('请选择文件题名范围')
  5591. return
  5592. }
  5593. this.$set(row, "isEdit", false);
  5594. this.$set(row, "isEdit1", false)
  5595. const ruleName=row.ruleName.join('-')
  5596. let ruleSizeVal=''
  5597. if(row.type==1){
  5598. ruleSizeVal=''
  5599. }else{
  5600. ruleSizeVal=row.ruleSizeValId.join(',')
  5601. }
  5602. let nameRuleDtos={
  5603. nameId:row.nameId,
  5604. nameRule:ruleName,
  5605. nodeId:ruleSizeVal,
  5606. projectId:this.projectid,
  5607. type:this.fileTitleModel.type
  5608. }
  5609. saveOrUpdateNameRule(
  5610. [nameRuleDtos]
  5611. ).then((res) => {
  5612. if(res.data.code==200){
  5613. this.$message.success(res.data.msg)
  5614. this.getFileTableData()
  5615. }else{
  5616. this.$message.error(res.data.msg)
  5617. }
  5618. });
  5619. },
  5620. changeRoleName(data,row){
  5621. const originalData=this.nodeTypelist
  5622. const dictKeyToDictValueMap = originalData.reduce((acc, item) => {
  5623. acc[item.dictKey] = item.dictValue;
  5624. return acc;
  5625. }, {});
  5626. const result = data.map(dictKey => dictKeyToDictValueMap[dictKey]);
  5627. this.$set(row, "roleNameVal", result);
  5628. this.selectDiv=Math.random()
  5629. },
  5630. addRow(){
  5631. this.fileTableData.unshift({isEdit:true,isEdit1:true,})
  5632. this.fileTitleModel.type=''
  5633. },
  5634. refreshRow(){
  5635. this.getFileTableData()
  5636. },
  5637. delRow(index,row){
  5638. if(!row.nameId){
  5639. this.fileTableData.splice(index,1)
  5640. }else{
  5641. this.$confirm("确定将选择数据删除?", {
  5642. confirmButtonText: "确定",
  5643. cancelButtonText: "取消",
  5644. type: "warning"
  5645. })
  5646. .then(() => {
  5647. return deletedNameRule(
  5648. {nameId:row.nameId}
  5649. ).then((res) => {
  5650. if(res.data.code==200){
  5651. this.$message.success(res.data.msg)
  5652. this.getFileTableData()
  5653. }else{
  5654. this.$message.error(res.data.msg)
  5655. }
  5656. });
  5657. });
  5658. }
  5659. },
  5660. batchsaveFileSize(){
  5661. let isCansave=true
  5662. let saveArr=[]
  5663. this.fileTableData.forEach((ele)=>{
  5664. if(ele.ruleName.length<1||!ele.type){
  5665. this.$message.warning('请先完善相关信息')
  5666. isCansave=false
  5667. return
  5668. }
  5669. let ruleSizeVal=''
  5670. if(ele.type==1){
  5671. ruleSizeVal=''
  5672. }else{
  5673. ruleSizeVal=ele.ruleSizeValId.join(',')
  5674. }
  5675. const ruleName=ele.ruleName.join('-')
  5676. saveArr.push({
  5677. nameId:ele.nameId||'',
  5678. nameRule:ruleName,
  5679. nodeId:ruleSizeVal,
  5680. projectId:this.projectid,
  5681. type:ele.type
  5682. })
  5683. })
  5684. if(!isCansave){
  5685. return
  5686. }
  5687. this.saveFileLoading=true
  5688. saveOrUpdateNameRule(
  5689. saveArr
  5690. ).then((res) => {
  5691. this.saveFileLoading=false
  5692. if(res.data.code==200){
  5693. this.$message.success(res.data.msg)
  5694. this.getFileTableData()
  5695. }else{
  5696. this.$message.error(res.data.msg)
  5697. }
  5698. });
  5699. },
  5700. async proSyncbtn(){
  5701. console.log('项目数据同步');
  5702. this.isAdd=''
  5703. this.getTypeOptions()
  5704. this.getRangeOptions()
  5705. this.getCheckIdList()
  5706. this.proSyncTag=true
  5707. if(this.$refs.syncProTree){
  5708. this.$refs.syncProTree.setCheckedKeys([])
  5709. }
  5710. if(this.$refs.proTable){
  5711. this.$refs.proTable.clearSelection()
  5712. }
  5713. this.isShowLeft=true
  5714. this.isShowTable=false
  5715. },
  5716. getRangeOptions(){
  5717. getDictionary({
  5718. code: "wbs_snyc_range",
  5719. }).then((res) => {
  5720. this.rangeOptions = res.data.data;
  5721. });
  5722. },
  5723. getTypeOptions(){
  5724. getDictionary({
  5725. code: "wbs_sync_type",
  5726. }).then((res) => {
  5727. this.typeOptions = res.data.data;
  5728. });
  5729. },
  5730. handleCheckChange1(data){
  5731. getNodeStatus({ id:data.primaryKeyId}).then((res) => {
  5732. if(res.data.code==200){
  5733. if(res.data.data){
  5734. this.$message.success('该节点有同步任务,请取消选择')
  5735. }
  5736. }else{
  5737. this.$message.error(res.data.msg)
  5738. }
  5739. });
  5740. },
  5741. async handleCheckChange(_,{checkedKeys,halfCheckedNodes}) {
  5742. let ids=checkedKeys && checkedKeys.length ? checkedKeys.join(',') : ''
  5743. // await this.getNodeStatusData()
  5744. this.getTempProjectList(ids)
  5745. },
  5746. async getTempProjectList(ids){
  5747. if(ids.length>0){
  5748. //分页获取证书列表数据
  5749. const { data: res } = await getTempProject({
  5750. nodeIds:ids
  5751. });
  5752. if (res.code == 200) {
  5753. this.templateIdList = res.data;
  5754. }
  5755. }
  5756. },
  5757. async changeTemplateId(val){
  5758. if(!this.isShowTable){
  5759. return
  5760. }
  5761. let type=''
  5762. let projectId=''
  5763. let wbsId=''
  5764. for (let index = 0; index < this.templateIdList.length; index++) {
  5765. const elemet = this.templateIdList[index];
  5766. if(elemet.id==val){
  5767. type = elemet.type;
  5768. this.typeTem=elemet.type
  5769. projectId=elemet.id
  5770. wbsId=elemet.wbsId
  5771. break
  5772. }
  5773. }
  5774. if(type===2){
  5775. selectByNodeTable(this.curTreeData.id, projectId, wbsId).then((res) => {
  5776. if (res.data.data&&res.data.data.length > 0) {
  5777. this.preTableData = res.data.data;
  5778. } else {
  5779. this.preTableData = [];
  5780. }
  5781. });
  5782. }else{
  5783. const { data: res } = await findNodeTableByCondition1( this.curTreeData.id )
  5784. if (res.code === 200) {
  5785. console.log(Array.isArray(res.data));
  5786. if (Array.isArray(res.data)) {
  5787. this.preTableData = res.data
  5788. } else {
  5789. this.preTableData = []
  5790. }
  5791. }
  5792. }
  5793. },
  5794. async getCheckIdList(){
  5795. let code=this.wbsType!==1?'wbs_sync_contract_range':'wbs_sync_contract_quality'
  5796. getDictionary({
  5797. code: code,
  5798. }).then((res) => {
  5799. this.checkIdList = res.data.data;
  5800. });
  5801. },
  5802. closeProSyncTag(){
  5803. this.proSyncTag=false
  5804. this.syncForm={
  5805. range:'',
  5806. rangeName:'',
  5807. type:[],
  5808. typeName:'',
  5809. templateId:'',
  5810. templateName:'',
  5811. contractRange:[],
  5812. contractRangeName:'',
  5813. nodeId:'',
  5814. formIds:''};
  5815. this.preTableData=[]
  5816. this.isShowLeft=false
  5817. },
  5818. async saveProTag(){
  5819. this.syncForm.projectId=this.projectid
  5820. if(this.isShowLeft){
  5821. let ids=this.$refs.syncProTree.getCheckedKeys()
  5822. this.syncForm.nodeId=ids.join(',')
  5823. if(this.syncForm.nodeId===''){
  5824. this.$message.warning('请选择节点')
  5825. return
  5826. }
  5827. }else{
  5828. this.syncForm.nodeId=this.curTreeData.primaryKeyId
  5829. }
  5830. // await this.getNodeStatusData()
  5831. if(this.syncListDialog){
  5832. return
  5833. }
  5834. if(this.syncForm.rangeName==''){
  5835. for (let index = 0; index < this.rangeOptions.length; index++) {
  5836. const element =this. rangeOptions[index];
  5837. if(element.dictKey==this.syncForm.range){
  5838. this.syncForm.rangeName=element.dictValue
  5839. break
  5840. }
  5841. }
  5842. }
  5843. console.log(this.syncForm.range,'this.syncForm.range=');
  5844. if(this.syncForm.range===''){
  5845. this.$message.warning('请选择同步范围')
  5846. return
  5847. }
  5848. this.saveProTagLoading=true
  5849. addSync({
  5850. ...this.syncForm,
  5851. type:this.syncForm.type.join(','),
  5852. contractRange:this.syncForm.contractRange.join(',')
  5853. }
  5854. ).then((res) => {
  5855. console.log(res,'res');
  5856. this.saveProTagLoading=false
  5857. if(res.data.code==200){
  5858. this.$message.success(res.data.msg)
  5859. //this.getNodeStatusData()
  5860. console.log(res.data,'res.data');
  5861. this.syncListData.nodeNum=res.data.data.nodeNum
  5862. this.syncListData.nodeNumEnd=res.data.data.nodeNumEnd
  5863. if(this.isShowLeft){
  5864. this.isAdd=res.data.data.id
  5865. }else{
  5866. this.isAdd=''
  5867. }
  5868. this.syncListDialog=true
  5869. this.getSyncListDataNew ()
  5870. this.closeProSyncTag()
  5871. }else{
  5872. this.$message.error(res.data.msg)
  5873. this.saveProTagLoading=false
  5874. }
  5875. })
  5876. .finally(() => {
  5877. this.saveProTagLoading = false;
  5878. });
  5879. },
  5880. closeSyncListTag(){
  5881. this.syncListDialog=false;
  5882. this.updateNodeTable()
  5883. },
  5884. handleCheckAllChange(val) {
  5885. this.syncForm.type = val ? this.typeOptions.map(item => item.dictKey) : [];
  5886. this.isIndeterminate = false;
  5887. },
  5888. handleCheckAllChange1(val) {
  5889. this.syncForm.contractRange = val ? this.checkIdList.map(item => item.dictKey) : [];
  5890. this.isIndeterminate1 = false;
  5891. },
  5892. handleCheckedTypeChange(value){
  5893. let checkedCount = value.length;
  5894. this.checkAll = checkedCount === this.typeOptions.length;
  5895. this.isIndeterminate = checkedCount > 0 && checkedCount < this.typeOptions.length;
  5896. },
  5897. handleCheckedTypeChange1(value){
  5898. let checkedCount = value.length;
  5899. this.checkAll1 = checkedCount === this.checkIdList.length;
  5900. this.isIndeterminate1 = checkedCount > 0 && checkedCount < this.checkIdList.length;
  5901. },
  5902. handleSelectionChange(val) {
  5903. let arr = []
  5904. if(val.length>0){
  5905. if(this.syncForm.range==='2'){
  5906. for (let index = 0; index < val.length; index++) {
  5907. let i = val[index];
  5908. arr.push(i.pkeyId)
  5909. }
  5910. this.syncForm.formIds=arr.join(',')
  5911. }else{
  5912. for (let index = 0; index < val.length; index++) {
  5913. let i = val[index];
  5914. if( this.typeTem===2){
  5915. arr.push(i.pkeyId)
  5916. }else{
  5917. arr.push(i.id)
  5918. }
  5919. }
  5920. console.log(arr,'arr');
  5921. this.syncForm.formIds=arr.join(',')
  5922. }
  5923. }
  5924. },
  5925. async handleCommand(command,row){
  5926. // await this.getNodeStatusData()
  5927. if(this.syncListDialog){
  5928. return
  5929. }
  5930. this.checkRow=row
  5931. if(command==='a'){
  5932. this.$confirm("当前表单配置将同步到项目下所有相同表单,请谨慎同步!!!!!!", "表单同步提醒", {
  5933. distinguishCancelAndClose: true,
  5934. confirmButtonText: "确定",
  5935. cancelButtonText: "取消",
  5936. }).then(() => {
  5937. addSync({
  5938. projectId:this.projectid,
  5939. range:'3',
  5940. nodeId:row.pkeyId,
  5941. nodeName:this.curTreeData.title,
  5942. }
  5943. ).then((res) => {
  5944. if(res.data.code==200){
  5945. this.$message.success(res.data.msg)
  5946. }else{
  5947. this.$message.error(res.data.msg)
  5948. }
  5949. })
  5950. });
  5951. }else if(command==='b'){
  5952. this.syncTableDialog=true
  5953. this.isShowLeft=true
  5954. if(this.$refs.proTable1){
  5955. this.$refs.proTable1.clearSelection()
  5956. }
  5957. }
  5958. },
  5959. saveTableSync(){
  5960. this.saveTableSyncLoad=true
  5961. addSync({
  5962. projectId:this.projectid,
  5963. range:'4',
  5964. nodeId:this.checkRow.pkeyId,
  5965. nodeName:this.curTreeData.title,
  5966. formIds:this.formIds,
  5967. }
  5968. ).then((res) => {
  5969. this.saveTableSyncLoad=false
  5970. if(res.data.code==200){
  5971. this.$message.success(res.data.msg)
  5972. this.syncTableDialog=false
  5973. this.$refs.proTable1.clearSelection()
  5974. this.updateNodeTable()
  5975. }else{
  5976. this.$message.error(res.data.msg)
  5977. }
  5978. })
  5979. this.saveTableSyncLoad=false
  5980. },
  5981. handleNodeClick(data) {
  5982. selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
  5983. if (res.data.data.length) {
  5984. this.preTableData1 = res.data.data;
  5985. } else {
  5986. this.preTableData1 = [];
  5987. }
  5988. });
  5989. },
  5990. handleSelectionChange1(val) {
  5991. if (val.length > 1) {
  5992. // 如果选择了多个,只保留最后一个
  5993. this.$nextTick(() => {
  5994. this.$refs.proTable1.clearSelection();
  5995. this.$refs.proTable1.toggleRowSelection(val.pop());
  5996. });
  5997. }
  5998. if(val.length>0){
  5999. this.formIds=val[0].pkeyId
  6000. }else{
  6001. this.formIds=''
  6002. }
  6003. },
  6004. async refreshData(){
  6005. this.refreshLoading=true
  6006. getNodeStatus({ id:this.curTreeData.primaryKeyId}).then((res) => {
  6007. this.refreshLoading=false
  6008. if(res.data.code==200){
  6009. if(res.data.data){
  6010. this.syncListData.nodeNum=res.data.data.nodeNum
  6011. this.syncListData.nodeNumEnd=res.data.data.nodeNumEnd
  6012. }else{
  6013. this.syncListData={
  6014. nodeNum:'',//同步节点数量
  6015. nodeNumEnd:''//已同步数量
  6016. }
  6017. }
  6018. }else{
  6019. this.syncListData={
  6020. nodeNum:'',//同步节点数量
  6021. nodeNumEnd:''//已同步数量
  6022. }
  6023. this.$message.error(res.data.msg)
  6024. }
  6025. }).finally(() => {
  6026. this.refreshLoading = false;
  6027. });
  6028. },
  6029. refreshData1(){
  6030. console.log('shuax');
  6031. this.refreshLoading1=true
  6032. getById({ id:this.isAdd}).then((res) => {
  6033. this.refreshLoading1=false
  6034. if(res.data.code==200){
  6035. if(res.data.data){
  6036. this.syncListData.nodeNum=res.data.data.nodeNum
  6037. this.syncListData.nodeNumEnd=res.data.data.nodeNumEnd
  6038. }else{
  6039. this.syncListData={
  6040. nodeNum:'',//同步节点数量
  6041. nodeNumEnd:''//已同步数量
  6042. }
  6043. }
  6044. }else{
  6045. this.syncListData={
  6046. nodeNum:'',//同步节点数量
  6047. nodeNumEnd:''//已同步数量
  6048. }
  6049. this.$message.error(res.data.msg)
  6050. }
  6051. });
  6052. },
  6053. getNodeStatusData(){
  6054. let ids=''
  6055. if(this.isShowLeft){
  6056. ids=this.$refs.syncProTree.getCheckedKeys()
  6057. ids=ids.join(',')
  6058. }
  6059. else{
  6060. ids=this.curTreeData.primaryKeyId
  6061. }
  6062. getNodeStatus({ id:ids}).then((res) => {
  6063. if(res.data.code==200){
  6064. if(res.data.data){
  6065. this.syncListDialog=true
  6066. this.getSyncListDataNew ()
  6067. }else{
  6068. this.syncListDialog=false
  6069. }
  6070. }else{
  6071. this.syncListDialog=false
  6072. this.$message.error(res.data.msg)
  6073. }
  6074. });
  6075. },
  6076. //基础数据管理
  6077. handleBasicClick(command) {
  6078. if (command === "code") {
  6079. this.codeDialog = true;
  6080. this.$refs.codeSetRef.show(this.projectid)
  6081. }else if(command === "rule") {
  6082. this.$router.push({
  6083. path: "/rule/manager",
  6084. query: {
  6085. id: this.id,
  6086. parentId:this.nodeDetail.parentId,
  6087. tenant_id: this.userInfo.tenant_id,
  6088. projectid: this.projectid,
  6089. },
  6090. });
  6091. }
  6092. },
  6093. //表单配置
  6094. handleCommandRow(command,row){
  6095. if(command=='a'){
  6096. this. rightClick( row.pkeyId,row.excelId, row.id,row.initTableName, row.initTableId)
  6097. }else if(command=='b'){
  6098. this.adjustExcel(row.pkeyId, row.excelId)
  6099. }else if(command=='c'){
  6100. this.handleEditFormula(0, row)
  6101. }
  6102. },
  6103. //同步进度按钮
  6104. SyncbtnProGress(){
  6105. this.syncListDialog=true
  6106. this.getSyncListDataNew()
  6107. },
  6108. getSyncListDataNew(){
  6109. querySyncRecord({ projectId:this.projectid}).then((res) => {
  6110. if(res.data.code==200){
  6111. if(res.data.data){
  6112. this.syncListDataNew=res.data.data
  6113. }else{
  6114. this.syncListDataNew=[]
  6115. }
  6116. }else{
  6117. this.syncListDataNew=[]
  6118. }
  6119. });
  6120. }
  6121. },
  6122. watch: {
  6123. "GLExcelFrom.search"(val) {
  6124. console.log(val);
  6125. if (this.exceldata) {
  6126. this.$refs.tree.filter(val);
  6127. }
  6128. },
  6129. 'syncForm.contractRange': {
  6130. handler(newVal) {
  6131. if (newVal && newVal.length) {
  6132. const selectedValues = newVal.map(key => {
  6133. const item = this.checkIdList.find(item => item.dictKey === key);
  6134. return item ? item.dictValue : key;
  6135. });
  6136. this.syncForm.contractRangeName = selectedValues.join(',');
  6137. } else {
  6138. this.syncForm.contractRangeName = '';
  6139. }
  6140. },
  6141. immediate: true
  6142. },
  6143. 'syncForm.templateId': {
  6144. handler(newVal) {
  6145. if (newVal && newVal.length) {
  6146. for (let index = 0; index < this.templateIdList.length; index++) {
  6147. const elemet = this.templateIdList[index];
  6148. if(elemet.id==newVal){
  6149. this.syncForm.templateName = elemet.name;
  6150. break
  6151. }
  6152. }
  6153. } else {
  6154. this.syncForm.rangeName = '';
  6155. }
  6156. },
  6157. immediate: true
  6158. },
  6159. 'syncForm.type': {
  6160. handler(newVal) {
  6161. if (newVal && newVal.length) {
  6162. const selectedValues = newVal.map(key => {
  6163. const item = this.typeOptions.find(item => item.dictKey === key);
  6164. return item ? item.dictValue : key;
  6165. });
  6166. this.syncForm.typeName = selectedValues.join(',');
  6167. } else {
  6168. this.syncForm.typeName = '';
  6169. }
  6170. },
  6171. immediate: true
  6172. },
  6173. 'syncForm.range': {
  6174. handler(newVal) {
  6175. console.log(newVal,'newVal');
  6176. if (newVal && newVal.length) {
  6177. for (let index = 0; index < this.rangeOptions.length; index++) {
  6178. const elemet = this.rangeOptions[index];
  6179. if(elemet.dictKey==newVal){
  6180. this.syncForm.rangeName = elemet.dictValue;
  6181. break
  6182. }
  6183. }
  6184. } else {
  6185. this.syncForm.rangeName = '';
  6186. }
  6187. },
  6188. immediate: true
  6189. },
  6190. },
  6191. components: {
  6192. dynamicExcel,
  6193. ManualSorting,
  6194. FormulaEdit,
  6195. EditElement,
  6196. FormulaEditone,
  6197. CodeSet,
  6198. tableSortByType
  6199. },
  6200. };
  6201. </script>
  6202. <style scoped lang="scss">
  6203. .font-s-12 ::v-deep .iconfont {
  6204. font-size: 12px;
  6205. }
  6206. .el-popper[x-placement^="bottom"] {
  6207. margin-top: -6px;
  6208. }
  6209. .right-btn {
  6210. position: absolute;
  6211. right: 20px;
  6212. top: 10px;
  6213. font-size: 20px;
  6214. }
  6215. .custom-tree-node {
  6216. .normal-black {
  6217. display: none;
  6218. }
  6219. &:hover {
  6220. .normal-black {
  6221. display: inline-block;
  6222. }
  6223. }
  6224. &.show .normal-black {
  6225. display: inline-block;
  6226. }
  6227. }
  6228. .excelBox {
  6229. ::v-deep .el-dialog__body {
  6230. padding: 20px;
  6231. }
  6232. }
  6233. //调整表单样式
  6234. .excelHtml {
  6235. position: absolute;
  6236. z-index: 999999;
  6237. top: 50px;
  6238. left: 0px;
  6239. width: 100%;
  6240. height: 100%;
  6241. }
  6242. .jiedian {
  6243. ::v-deep .el-dialog__body {
  6244. padding: 10px 20px !important;
  6245. }
  6246. }
  6247. .filter-tree {
  6248. min-width: 100%;
  6249. display: inline-block;
  6250. }
  6251. .full-dialog {
  6252. ::v-deep .el-dialog__body {
  6253. padding-bottom: 0;
  6254. padding-top: 0;
  6255. }
  6256. ::v-deep .basic-container {
  6257. height: calc(100vh - 60px);
  6258. }
  6259. }
  6260. .my-basic-con {
  6261. padding: 6px 6px;
  6262. }
  6263. // 树形控件菜单样式
  6264. .contextmenu {
  6265. margin: 0;
  6266. background: #fff;
  6267. z-index: 1000;
  6268. position: fixed; //关键样式设置固定定位
  6269. list-style-type: none;
  6270. padding: 5px 0;
  6271. border-radius: 4px;
  6272. font-size: 12px;
  6273. font-weight: 400;
  6274. color: #333;
  6275. box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
  6276. }
  6277. .contextmenu li {
  6278. margin: 0;
  6279. padding: 7px 16px;
  6280. cursor: pointer;
  6281. }
  6282. .contextmenu li:hover {
  6283. background: #eee;
  6284. }
  6285. .selectBtn {
  6286. position: absolute;
  6287. top: 50px;
  6288. right: 585px;
  6289. z-index: 1000;
  6290. width: 140px;
  6291. text-align: left;
  6292. }
  6293. .titlerow {
  6294. // float: right;
  6295. background-color: rgba(31, 34, 41, 0.8);
  6296. // width:104%;
  6297. padding-left: 10px;
  6298. padding-right: 10px;
  6299. text-align: right;
  6300. margin-top: -20px;
  6301. margin-left: -20px;
  6302. margin-right: -20px;
  6303. }
  6304. .dialog-title{
  6305. display: flex;
  6306. }
  6307. .dialog-title-text{
  6308. flex: 0.4;
  6309. padding-left: 10px;
  6310. }
  6311. .dialog-title-tip{
  6312. flex: 0.6;
  6313. // position: absolute;
  6314. color:rgba(255, 125, 67, 1);
  6315. padding-left: 40px;
  6316. // right: 60px;
  6317. }
  6318. .sync-container{
  6319. margin-top: -30px;
  6320. display: flex;
  6321. height: 570px;
  6322. .box-card-1{
  6323. margin-right: 10px;
  6324. height: 100%;
  6325. overflow-y: auto;
  6326. }
  6327. .box-card-2{
  6328. flex: 1;
  6329. height: 100%;
  6330. overflow-y: auto;
  6331. .el-form-item {
  6332. border: 1px solid #dcdfe6;
  6333. padding: 0 10px 10px 10px;
  6334. border-radius: 4px;
  6335. font-weight: bold;
  6336. .el-form-item__label {
  6337. font-weight: bold;
  6338. padding-bottom: 0px;
  6339. }
  6340. .el-form--label-top .el-form-item__label{
  6341. padding: 0px !important;
  6342. }
  6343. }
  6344. }
  6345. }
  6346. .content-box{
  6347. display: flex;
  6348. flex-direction: column;
  6349. justify-content: center;
  6350. align-items: center;
  6351. font-weight: bolder;
  6352. .mt-14{
  6353. margin-top: 14px;
  6354. }
  6355. }
  6356. </style>
  6357. <style lang="scss">
  6358. .el-dialog.hc-link-nodes-dialog {
  6359. width: 500px;
  6360. margin-top: 50px !important;
  6361. height: calc(100% - 100px);
  6362. .el-dialog__body {
  6363. height: calc(100% - 154px);
  6364. border-top: 1px solid #eee;
  6365. border-bottom: 1px solid #eee;
  6366. padding: 14px;
  6367. overflow: auto;
  6368. }
  6369. }
  6370. .el-tree.hc-link-nodes-tree .el-tree-node .el-tree-node__content {
  6371. .el-checkbox {
  6372. display: none;
  6373. }
  6374. .is-leaf + .el-checkbox {
  6375. display: inline-block;
  6376. }
  6377. }
  6378. .warning-text{
  6379. color: orange;
  6380. font-weight: bold;
  6381. }
  6382. .orange {
  6383. color: orange;
  6384. }
  6385. .box-card-2{
  6386. .el-form-item {
  6387. .el-form-item__content {
  6388. line-height: 10px !important;
  6389. margin-top: -10px !important;
  6390. }
  6391. }
  6392. }
  6393. .category-section {
  6394. margin-bottom: 20px;
  6395. }
  6396. .category-header {
  6397. padding: 12px 20px;
  6398. background-color: #E8E8E8;
  6399. margin: 15px 0;
  6400. font-weight: bold;
  6401. font-size: 16px;
  6402. }
  6403. .el-dropdown-link{
  6404. cursor: pointer;
  6405. color: #409EFF;
  6406. margin-left: 8px;
  6407. }
  6408. .project-dialog {
  6409. .el-dialog__body {
  6410. color: black;
  6411. padding: 10px 20px 20px 20px !important;
  6412. }
  6413. .el-dialog__header {
  6414. border-bottom: 1px solid #e6e6e6;
  6415. }
  6416. .dialog-footer{
  6417. padding-top: 15px;
  6418. text-align: center;
  6419. border-top: #e6e6e6 solid 1px;
  6420. }
  6421. }
  6422. </style>
  6423. <style lang="scss" scoped>
  6424. .progress-status{
  6425. display: flex;
  6426. justify-content: space-between;
  6427. align-items: center;
  6428. padding: 5px;
  6429. }
  6430. .progress-text-btn{
  6431. display: flex;
  6432. align-items: center;
  6433. justify-content: space-between;
  6434. }
  6435. .rogress-text{
  6436. font-size: 14px;
  6437. color: #333;
  6438. }
  6439. .noData{
  6440. text-align: center;
  6441. }
  6442. .circle-btn{
  6443. border-radius: 200px;
  6444. }
  6445. </style>
  6446. <style scoped>
  6447. .sync-queue-dialog {
  6448. .el-dialog__header {
  6449. padding: 18px 20px;
  6450. border-bottom: 1px solid #eee;
  6451. }
  6452. .el-dialog__title {
  6453. font-size: 16px;
  6454. font-weight: 500;
  6455. }
  6456. .el-dialog__body {
  6457. padding: 20px;
  6458. max-height: 400px;
  6459. overflow-y: auto;
  6460. }
  6461. }
  6462. .sync-list {
  6463. max-height:600px;
  6464. overflow-y: auto;
  6465. .sync-item {
  6466. padding: 15px 0;
  6467. border-bottom: 1px dashed #eee;
  6468. &:last-child {
  6469. border-bottom: none;
  6470. }
  6471. }
  6472. .sync-header {
  6473. display: flex;
  6474. justify-content: space-between;
  6475. align-items: center;
  6476. margin-bottom: 10px;
  6477. font-size: 14px;
  6478. background-color: #F2F2F2;
  6479. height: 30px;
  6480. overflow-y: auto;
  6481. padding: 10px 10px;
  6482. border-radius: 10px;
  6483. .sync-party {
  6484. color: #333;
  6485. font-weight: 500;
  6486. }
  6487. .sync-status {
  6488. color: #666;
  6489. font-size: 13px;
  6490. }
  6491. }
  6492. .progress-container {
  6493. position: relative;
  6494. margin-bottom: 12px;
  6495. .progress-text {
  6496. display: flex;
  6497. justify-content: space-between;
  6498. padding: 5px;
  6499. .progress-num{
  6500. color:#2550A2;
  6501. font-weight: bold;
  6502. }
  6503. }
  6504. }
  6505. .sync-stats {
  6506. display: flex;
  6507. justify-content: space-between;
  6508. padding: 0 5px;
  6509. .stat-item {
  6510. display: flex;
  6511. flex-direction: column;
  6512. /* text-align: left; */
  6513. /* align-items: center;
  6514. justify-content: flex-end; */
  6515. width: 45%;
  6516. padding: 10px 15px;
  6517. border-radius: 4px;
  6518. background-color: #f5f7fa;
  6519. .stat-label {
  6520. font-size: 12px;
  6521. color: #999;
  6522. }
  6523. .stat-value {
  6524. font-size: 20px;
  6525. font-weight: 800;
  6526. }
  6527. .synced {
  6528. color: #42b983; /* Element UI success color */
  6529. }
  6530. .remaining {
  6531. color: #e6a23c; /* Element UI warning color */
  6532. }
  6533. }
  6534. }
  6535. }
  6536. .no-data {
  6537. display: flex;
  6538. flex-direction: column;
  6539. align-items: center;
  6540. justify-content: center;
  6541. }
  6542. .dialog-footer {
  6543. text-align: center;
  6544. padding: 15px 20px;
  6545. border-top: 1px solid #eee;
  6546. .confirm-btn {
  6547. width: 160px;
  6548. }
  6549. }
  6550. </style>
  6551. <style scoped>
  6552. /* 使用自定义类名定位,避免影响全局样式 */
  6553. ::v-deep .custom-progress .el-progress__text {
  6554. color: #2550A2; /* 进度文字颜色 */
  6555. }
  6556. </style>