tree.vue 205 KB

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