tree.vue 217 KB

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