123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658 |
- <template>
- <div style="height: 100%">
- <basic-container v-show="showType == 1">
- <el-row class="titlerow">
- <el-col>
- <div style="position: relative">
- <span style="float: left; margin-top: 15px; color: white">{{
- projectName
- }}</span>
- <el-button
- size="medium"
- icon="el-icon-help"
- style="margin-right: 10px"
- @click="fileTitleHandle"
- >文件题名(全局)
- </el-button>
- <el-dropdown style="margin-right: 10px" @command ="handleBasicClick" v-if="wbsType == 2">
- <el-button size="medium">
- 基础数据管理<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item command="code">编号管理</el-dropdown-item>
- <el-dropdown-item command="rule">规范参数配置</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <!-- 同步按钮 -->
- <el-button
- size="medium"
- style="margin-right: 10px"
- @click="proSyncbtn"
- >项目数据同步
- </el-button>
- <el-button
- size="medium"
- icon="el-icon-s-grid"
- @click="eleFormulaHandle"
- v-if="leftType == 5"
- >表单设置
- </el-button>
- <el-button
- size="medium"
- icon="el-icon-s-grid"
- @click="eleHandle"
- v-else
- >元素设置
- </el-button>
-
- <el-button size="medium" icon="el-icon-help" @click="nodeInfoHandle"
- >节点参数设置
- </el-button>
- <el-button
- style="margin-top: 10px"
- size="medium"
- icon="el-icon-price-tag"
- @click="independent"
- >独立表单库
- </el-button>
- <el-button
- style="margin-top: 10px"
- size="medium"
- icon="el-icon-time"
- @click="archiveTimeClick"
- >归档文件时间设置
- </el-button>
-
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="20" class="h-100p" style="padding: 10px">
- <el-col :span="8" style="height: 85%">
- <div class="h-100p flex flex-d-c">
- <p style="margin-top: 2px">工程节点信息</p>
- <div
- class="flex"
- style="align-items: center; justify-content: space-between"
- >
- <div>
- <div>
- <el-radio v-model="searchType" label="1">节点</el-radio>
- </div>
- <div>
- <el-radio v-model="searchType" label="2">表名</el-radio>
- </div>
- </div>
- <el-input
- placeholder="输入关键字进行过滤"
- v-model="filterText"
- clearable
- style="width: 65%; margin-right: 15px"
- @clear="clearSearch"
- ></el-input>
-
- <el-button type="primary" @click="searchTreeClick"
- >搜索</el-button
- >
-
- <el-tooltip content="查询工序节点无内业资料类型" placement="top">
- <el-button type="success" @click="filterSearchClick" >过滤</el-button>
- </el-tooltip>
- </div>
- <div class="flex1 ov-hidden">
- <el-scrollbar class="h-100p" v-if="isShowTree">
- <div v-loading="treeLoad">
- <el-tree
- class="filter-tree"
- lazy
- :load="loadNode"
- @node-click="getNodeDetail"
- :props="defaultProps"
- :expand-on-click-node="false"
- highlight-current
- node-key="id"
- ref="tree"
- :default-expanded-keys="defaultExpandedKeys"
- v-show="!isSearch"
- >
- <span
- class="custom-tree-node"
- :class="data.moreShow ? 'show' : ''"
- slot-scope="{ node, data }"
- @mouseleave="mouseout(data)"
- >
- <div class="pd-r-20">
- {{ node.label }}
- <div class="normal-black">
- <div>
- <el-link :underline="false">
- <i
- class="el-icon-menu"
- @click.stop="showMenu($event, data, node)"
- v-if="node.level != 1"
- ></i>
- </el-link>
- <!-- 因右键自定义菜单事件需要获取当前点击的位置,所以此处绑定动态样式来控制菜单实时跟踪鼠标右键点击位置 -->
- <ul
- v-show="menuvisible"
- :style="{
- left: menuleft + 'px',
- top: menutop + 'px',
- }"
- class="contextmenu"
- >
- <li
- v-for="item in menusData"
- :key="item"
- @click="menuClick($event, item, data)"
- >
- <i :class="item.icon"></i>
- <el-tooltip
- class="item"
- effect="light"
- :content="item.content"
- placement="right-start"
- >
- <span>{{ item.label }}</span>
- </el-tooltip>
- </li>
- </ul>
- </div>
- </div>
- </div>
- </span>
- </el-tree>
- <el-tree
- :load="searchtreeLoad"
- :data="searchTreeData"
- @node-click="getNodeDetail"
- :props="defaultProps"
- :expand-on-click-node="false"
- highlight-current
- node-key="id"
- v-show="isSearch"
- default-expand-all
- >
- <span
- class="custom-tree-node"
- :class="data.moreShow ? 'show' : ''"
- slot-scope="{ node, data }"
- @mouseleave="mouseout(data)"
- >
- <div class="pd-r-20">
- {{ node.label }}
- <div class="normal-black">
- <div>
- <el-link :underline="false">
- <i
- class="el-icon-menu"
- @click="showMenu($event, data, node)"
- v-if="node.level != 1"
- ></i>
- </el-link>
- <ul
- v-show="menuvisible"
- :style="{
- left: menuleft + 'px',
- top: menutop + 'px',
- }"
- class="contextmenu"
- >
- <li
- v-for="item in menusData"
- :key="item"
- @click="menuClick($event, item, data)"
- >
- <i :class="item.icon"></i>{{ item.label }}
- </li>
- </ul>
- </div>
- </div>
- </div>
- </span>
- </el-tree>
- </div>
- </el-scrollbar>
- </div>
- </div>
- </el-col>
- <el-col :span="16" class="h-100p flex flex-d-c">
- <template v-if="leftType == 5">
- <div class="mg-b-10">节点信息</div>
- <div>
- <el-table :data="tableData" border style="width: 100%">
- <el-table-column
- align="center"
- prop="nodeName"
- label="当前节点"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="nodeType"
- :formatter="formatCat"
- label="节点类型"
- width="180"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="parentName"
- label="上级节点"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="primaryKeyId"
- label="primaryKeyId"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="id"
- label="id"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="majorDataType"
- :formatter="formMajorType"
- label="内业资料类型"
- ></el-table-column>
- </el-table>
- </div>
- <div class="flex jc-sb">
- <p>
- <span>当前项目信息表</span>
-
- <el-button
- type="text"
- style="margin-left: 10px"
- icon="el-icon-edit-outline"
- class="text-icon"
- @click="editEditElementForm()"
- ></el-button>
- <el-button
- type="text"
- icon="el-icon-sort"
- class="text-icon"
- @click="privateTableSort()"
- ></el-button>
- </p>
- <div class="mg-t-10"></div>
- </div>
- <div style="flex: 1; position: relative">
- <el-table
- :data="formData"
- border
- height="100%"
- style="width: 100%; position: absolute"
- >
- <el-table-column
- align="center"
- prop="tableName"
- label="表单名称"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="elementTotal"
- width="80"
- label="字段总量"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="fillRate"
- width="80"
- label="填报率"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="tableType"
- :formatter="formatTableType"
- width="100"
- label="表单类型"
- ></el-table-column>
- <el-table-column width="150"
- align="center"
- prop="tableOwner"
- :formatter="formatOwner"
- label="所属方"
- ></el-table-column>
- <el-table-column label="操作" >
- <template slot-scope="scope">
- <el-button
- size="mini"
- @click="handlePreview(scope.$index, scope.row)"
- >预览
- </el-button>
- <el-button
- size="mini"
- @click="handleEdit(scope.$index, scope.row)"
- >编辑
- </el-button>
- <el-button
- size="mini"
- type="success"
- v-throttle="3000"
- v-show="scope.row.status == 0"
- @click="hideMD(scope.row)"
- >取消隐藏
- </el-button>
- <el-button
- size="mini"
- type="primary"
- v-throttle="3000"
- v-show="scope.row.status == 1"
- @click="hideMD(scope.row)"
- >隐藏表单
- </el-button>
- <el-button
- size="mini"
- type="danger"
- @click="handleDelete(scope.$index, scope.row)"
- >删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </template>
- <template v-if="leftType == 4">
- <div style="flex: 1; position: relative">
- <el-table
- :data="formData"
- border
- height="100%"
- style="width: 100%; position: absolute"
- >
- <el-table-column
- align="center"
- prop="tableName"
- label="表单名称"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="tableType"
- :formatter="formatTableType"
- label="表单类型"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="fillRate"
- label="填报率"
- ></el-table-column>
- <el-table-column
- label="是否关联清表"
- prop="isLinkTable"
- align="center"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.isLinkTable == 2">是</span>
- <span v-else>否</span>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="tableOwner"
- :formatter="formatOwner"
- label="所属方"
- ></el-table-column>
- <el-table-column label="操作" width="520" align="center">
- <template slot-scope="scope">
- <el-link type="primary" @click="Associationlist(scope)"
- >关联清表
- </el-link>
- <el-link
- class="mg-l-10"
- type="primary"
- :disabled="
- scope.row.excelId == -1 || scope.row.excelId == null
- "
- @click="
- rightClick(
- scope.row.pkeyId,
- scope.row.excelId,
- scope.row.id,
- scope.row.initTableName,
- scope.row.initTableId
- )
- "
- >编辑元素
- </el-link>
- <el-link
- class="mg-l-10"
- type="primary"
- :disabled="
- scope.row.excelId == -1 || scope.row.excelId == null
- "
- @click="adjustExcel(scope.row.pkeyId, scope.row.excelId)"
- >调整表单
- </el-link>
- <el-link
- class="mg-l-10"
- type="primary"
- @click="handleEditFormula(scope.$index, scope.row)"
- >编辑元素公式
- </el-link>
-
- <el-dropdown @command="handleCommand($event,scope.row)">
- <el-button type="text" class="mg-l-10">
- 表单同步<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item command="a">同步到项目下所有表单</el-dropdown-item>
- <el-dropdown-item command="b">同步其他表单配置</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <el-button
- class="mg-l-10"
- type="text"
- :loading="handlesyncLoad"
- @click="handleLinkNodes(scope.$index, scope.row)"
- v-if="
- curTreeData.nodeType === 1000 ||
- curTreeData.nodeType === 1001
- "
- >关联节点
- </el-button>
- <el-link
- class="mg-l-10"
- type="danger"
- @click="handleDelete(scope.$index, scope.row)"
- >删除表单
- </el-link>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </template>
- </el-col>
- </el-row>
- </basic-container>
- <el-row class="h-100p" v-show="showType == 2">
- <el-col :span="6" class="h-100p">
- <basic-container>
- <el-scrollbar class="h-100p">
- <el-tree
- class="filter-tree"
- lazy
- :data="typeTreeData"
- :load="typeTreeLoadNode"
- @node-click="getTypeTreeDetail"
- :props="defaultProps"
- :expand-on-click-node="false"
- highlight-current
- node-key="id"
- >
- </el-tree>
- </el-scrollbar>
- </basic-container>
- </el-col>
- <el-col :span="18" class="h-100p">
- <basic-container>
- <div class="flex h-100p flex-d-c">
- <div style="flex: 1; position: relative">
- <el-table
- :data="formData"
- border
- height="100%"
- style="width: 100%; position: absolute"
- >
- <el-table-column
- align="center"
- prop="tableName"
- label="表单名称"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="tableType"
- :formatter="formatTableType"
- label="表单类型"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="fillRate"
- label="填报率"
- ></el-table-column>
- <el-table-column
- label="是否关联清表"
- prop="isLinkTable"
- align="center"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.isLinkTable == 2">是</span>
- <span v-else>否</span>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="tableOwner"
- :formatter="formatOwner"
- label="所属方"
- ></el-table-column>
- <el-table-column label="操作" align="center">
- <template slot-scope="scope">
- <el-link type="primary" @click="Associationlist(scope)"
- >关联清表
- </el-link>
- <el-link
- class="mg-l-10"
- type="primary"
- :disabled="
- scope.row.excelId == -1 || scope.row.excelId == null
- "
- @click="
- rightClick(
- scope.row.pkeyId,
- scope.row.excelId,
- scope.row.id,
- scope.row.initTableName,
- scope.row.initTableId
- )
- "
- >编辑元素
- </el-link>
- <el-link
- class="mg-l-10"
- type="primary"
- :disabled="
- scope.row.excelId == -1 || scope.row.excelId == null
- "
- @click="adjustExcel(scope.row.pkeyId, scope.row.excelId)"
- >调整表单
- </el-link>
- <el-link
- class="mg-l-10"
- type="primary"
- @click="handleEditFormula(scope.$index, scope.row)"
- >编辑元素公式
- </el-link>
- <el-link
- class="mg-l-10"
- type="danger"
- @click="handleDelete(scope.$index, scope.row)"
- >删除表单
- </el-link>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="mg-t-10 flex jc-sb">
- <div></div>
- <el-button size="medium" @click="showType = 1"
- >返回WBS树
- </el-button>
- </div>
- </div>
- </basic-container>
- </el-col>
- </el-row>
- <!-- 编辑元素表单信息 -->
- <el-dialog
- title="编辑元素表单信息"
- :visible.sync="editElementFormTag"
- width="60%"
- :modal-append-to-body="false"
- >
- <div>
- <el-table :data="formDatass" border style="width: 100%">
- <el-table-column prop="tableName" label="表名">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.tableName"
- placeholder="请输入表名称"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column prop="tableType" label="表类型">
- <template slot-scope="scope">
- <el-select v-model="scope.row.tableType" placeholder="请选择">
- <el-option
- v-for="(item, key) in tableTypelist"
- :key="key"
- :label="item.dictValue"
- :value="item.dictKey"
- >
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column prop="tableOwner" label="所属方">
- <template slot-scope="scope">
- <el-select v-model="scope.row.tableOwner" placeholder="请选择">
- <el-option
- v-for="(item, key) in ownerTypeList"
- :key="key"
- :label="item.dictValue"
- :value="item.dictKey"
- >
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column prop="fillRate" label="填报率">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fillRate"
- placeholder="请输入填报率"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column prop="nodeType" label="节点类型" v-if="wbsType == 5">
- <template slot-scope="scope">
- <el-select v-model="scope.row.nodeType" placeholder="请选择" >
- <el-option
- v-for="item in nodeTypelist"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="editElementFormTag = false">取 消</el-button>
- <el-button
- type="primary"
- @click="editeditElementFormMF()"
- :loading="editeditElementFormMFLoading"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <!-- 调整表单模板 -->
- <div v-if="excelHtml" class="excelHtml">
- <dynamicExcel
- @remove="removeExcel"
- v-if="excelHtml"
- :pkeyId="GLExcelFrom.id"
- :excelId="GLExcelFrom.excelId"
- />
- </div>
- <el-dialog
- title="调整排序"
- :visible.sync="sortTag"
- width="50%"
- append-to-body
- >
- <ManualSorting v-if="sortTag2" @bianhua="bianhua()" :sort="sort" />
- <span slot="footer" class="dialog-footer">
- <el-button @click="(sortTag = false), (sortTag2 = false)"
- >取 消</el-button
- >
- <el-button type="primary" @click="editSort()" v-loading="sureSortload"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <!-- 元素表排序 -->
- <el-dialog
- title="调整排序"
- :visible.sync="excelSortTag"
- width="50%"
- append-to-body
- >
- <ManualSorting
- v-if="excelSortTag2"
- @bianhua="bianhua2()"
- :sort="tableSortList"
- />
- <span slot="footer" class="dialog-footer">
- <el-button @click="excelSortTag = false">取 消</el-button>
- <el-button
- type="primary"
- @click="editPrivateSort()"
- v-loading="surePrivateSortload"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <!-- 关联清表 -->
- <el-dialog
- title="关联清表"
- class="excelBox"
- :visible.sync="GLExcel"
- width="500px"
- modal-append-to-body
- append-to-body
- @close="GLExcelMD"
- >
- <div>
- <el-select
- style="width: 400px"
- v-model="GLExcelFrom.name"
- placeholder="请选择"
- @change="changetherr()"
- >
- <el-option
- v-for="(item, key) in GLExcelData"
- :key="key"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <el-scrollbar style="margin-top: 20px; height: 50vh">
- <el-input
- style="width: 400px"
- v-model.trim="GLExcelFrom.search"
- placeholder="请输入需要选择的内容"
- ></el-input>
- <el-tree
- :filter-node-method="filterNode222"
- ref="tree"
- class="filter-tree"
- style="margin-top: 10px"
- :props="GLExcelProps"
- :data="exceldata"
- node-key="id"
- accordion
- show-checkbox
- @check="checkchange"
- v-loading="GLExcelLoading"
- >
- </el-tree>
- </el-scrollbar>
- </div>
- <span
- slot="footer"
- class="dialog-footer"
- style="display: flex; justify-content: center; align-items: center"
- >
- <el-button @click="GLExcelMD()">取 消</el-button>
- <el-button
- style="margin-left: 30px"
- type="primary"
- v-throttle="2000"
- @click="saveLinkTab()"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <!-- 节点详情 -->
- <el-dialog
- :title="dialogTitle"
- :visible.sync="dialogVisible"
- width="50%"
- append-to-body
- :close-on-click-modal="false"
- @closed="saveNodeLoading = false"
- >
- <el-form
- ref="nodeDetail"
- :model="nodeDetail"
- :rules="rules"
- label-width="140px"
- >
- <el-form-item label="节点名称" prop="nodeName">
- <div class="flex">
- <el-input v-model="nodeDetail.nodeName"></el-input>
- <el-button class="mg-l-10" type="primary" @click="aliasShow"
- >添加别名
- </el-button>
- </div>
- </el-form-item>
- <el-form-item label="上级节点">
- <el-input v-model="nodeDetail.parentName" disabled></el-input>
- </el-form-item>
- <el-form-item label="节点类型" prop="nodeType">
- <el-select
- v-model="nodeDetail.nodeType"
- placeholder="请选择"
- class="w-100p"
- @change="nodeTypeChange"
- clearable
- >
- <el-option
- v-for="item in nodeTypelist"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="划分编号" v-if="wbsType !== 2 && wbsType !== 5">
- <el-input v-model="nodeDetail.partitionCode"></el-input>
- </el-form-item>
- <!-- <el-form-item label="唯一编码" v-if="wbsType !== 5">
- <el-input v-model="nodeDetail.uniqueCode"></el-input>
- </el-form-item> -->
- <el-form-item label="参数掩码" v-if="wbsType !== 5">
- <el-input v-model="nodeDetail.uniqueCode"></el-input>
- </el-form-item>
- <template v-if="nodeDetail.nodeType == 6">
- <el-form-item label="是否有混凝土">
- <el-radio-group v-model="nodeDetail.isConcrete" size="small">
- <el-radio :label="0" border>无</el-radio>
- <el-radio :label="1" border>有</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="是否试验节点">
- <el-radio-group v-model="nodeDetail.isExpernode" size="small">
- <el-radio :label="0" border>否</el-radio>
- <el-radio :label="1" border>是</el-radio>
- </el-radio-group>
- </el-form-item>
- </template>
- <el-form-item
- label="内业资料类型"
- prop="majorDataType"
- v-if="wbsType !== 2 && wbsType !== 5"
- >
- <el-select
- v-model="nodeDetail.majorDataType"
- placeholder="请选择"
- class="w-100p"
- clearable
- >
- <el-option
- v-for="item in majorDataTypeList"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="标准分类">
- <el-select
- v-model="nodeDetail.className"
- placeholder="请选择"
- class="w-100p"
- @change="changeStandType"
- clearable
- >
- <el-option
- v-for="item in standardTypeOptions"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="单元名称">
- <el-select
- v-model="nodeDetail.unitName"
- placeholder="请选择"
- class="w-100p"
- clearable
- >
- <el-option
- v-for="item in unitOptions"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item
- label="是否新增中隐藏"
- prop="isAddConceal"
- v-if="wbsType !== 2 && wbsType !== 5"
- >
- <el-radio-group v-model="nodeDetail.isAddConceal" size="small">
- <el-radio :label="1" border>是</el-radio>
- <el-radio :label="0" border>否</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item
- label="勾选相关联试验"
- prop="mixRatioTestIds"
- v-if="wbsType === 2 && nodeDetail.nodeType === 53"
- >
- <div
- style="position: relative; height: 300px; border: 1px solid #dddfe6"
- >
- <el-scrollbar class="h-100p">
- <div v-loading="testTreeLoad">
- <el-tree
- class="filter-tree"
- :data="testTreeData"
- :props="defaultProps"
- :expand-on-click-node="false"
- highlight-current
- node-key="id"
- ref="treeall"
- show-checkbox
- :default-checked-keys="mixRatioTestIds"
- @check="TestTreeCheckChange"
- />
- </div>
- </el-scrollbar>
- </div>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="saveNode" :loading="saveNodeLoading"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <!-- 创建新的元素表 -->
- <el-dialog
- title="创建新的元素表"
- :visible.sync="eleVisible"
- width="80%"
- append-to-body
- :close-on-click-modal="false"
- >
- <el-form
- ref="eleDialog"
- :model="eleForm"
- :rules="eleRules"
- label-width="110px"
- >
- <el-form-item label="表名" prop="nodeName">
- <el-input v-model="eleForm.nodeName"></el-input>
- </el-form-item>
- <el-row>
- <el-col :span="12">
- <el-form-item label="表类型" prop="tableType">
- <el-select
- v-model="eleForm.tableType"
- placeholder="请选择"
- class="w-100p"
- >
- <el-option
- v-for="item in tableTypelist"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="所属方" prop="tableOwner">
- <el-select
- v-model="eleForm.tableOwner"
- placeholder="请选择"
- class="w-100p"
- >
- <el-option
- v-for="item in ownerTypeList"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div class="flex jc-sb">
- <div></div>
- <div>
- <el-link type="primary" @click="importVisible = true"
- >快捷导入
- </el-link>
- <el-link type="primary" class="mg-l-20" @click="downloadTmp"
- >下载导入模版
- </el-link>
- </div>
- </div>
- <div class="border-grey">
- <p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
- <el-table
- :data="eleForm.elementList"
- border
- style="width: 100%"
- height="400px"
- >
- <el-table-column
- align="center"
- type="index"
- width="50"
- ></el-table-column>
- <el-table-column align="center" prop="eName" label="字段名称">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.eName"
- size="small"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="eType"
- label="数据类型"
- width="120"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.eType"
- size="small"
- placeholder="请选择"
- >
- <el-option
- v-for="item in dataTypeList"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="eLength"
- label="长度"
- width="120"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.eLength"
- size="small"
- placeholder="请输入内容"
- :disabled="scope.row.eType == 4"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="eAllowDeviation"
- label="允许偏差值"
- >
- <template slot-scope="scope">
- <div class="flex">
- <el-select
- v-model="scope.row.allow"
- size="small"
- placeholder="请选择"
- style="width: 120px"
- >
- <el-option :key="1" label="≥" value="≥"></el-option>
- <el-option :key="2" label="≤" value="≤"></el-option>
- <el-option :key="3" label="±" value="±"></el-option>
- <el-option :key="4" label="【】" value="【】"></el-option>
- </el-select>
- <el-input
- v-model="scope.row.deviation"
- size="small"
- placeholder="请输入内容"
- ></el-input>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="eInspectionMethod"
- label="检查方法和频率"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.eInspectionMethod"
- size="small"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column align="center" label="操作" width="80">
- <template slot="header">
- <el-button
- @click="addEleRow(eleForm.elementList)"
- type="text"
- icon="el-icon-circle-plus-outline"
- class="text-icon"
- ></el-button>
- </template>
- <template slot-scope="scope">
- <el-button
- icon="el-icon-remove-outline"
- type="text"
- @click="delEleRow(scope.$index, eleForm.elementList)"
- class="text-icon text-icon-danger"
- ></el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="eleVisible = false">取 消</el-button>
- <el-button type="primary" @click="saveFormAndElementHandle"
- >保 存</el-button
- >
- </span>
- </el-dialog>
- <!-- 模板导入 -->
- <el-dialog
- title="模版导入"
- :visible.sync="importVisible"
- width="50%"
- append-to-body
- :close-on-click-modal="false"
- >
- <p>
- 提示:必须按照系统要求的模版格式上传,否则系统识别无效
- <el-link type="primary" @click="downloadTmp">下载导入模版</el-link>
- </p>
- <div>
- <el-button size="small" type="primary" @click="fileClick2"
- >本地上传
- </el-button>
- <input
- @change="tmpImport"
- type="file"
- hidden
- ref="file2"
- accept=".xls, .xlsx"
- />
- </div>
- <el-table :data="tempList" border style="width: 100%">
- <el-table-column align="center" prop="eName" label="字段信息">
- </el-table-column>
- <el-table-column
- align="center"
- prop="eType"
- label="数据类型"
- width="120"
- >
- </el-table-column>
- <el-table-column align="center" prop="eLength" label="长度" width="120">
- </el-table-column>
- <el-table-column
- align="center"
- prop="eAllowDeviation"
- label="允许偏差值"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="eInspectionMethod"
- label="检查方法和频率"
- >
- </el-table-column>
- </el-table>
- <span slot="footer" class="dialog-footer">
- <el-button @click="importVisible = false">取 消</el-button>
- <el-button type="primary" @click="importHandle">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 预览元素 -->
- <el-dialog
- :title="(curEleTable.tableName ? curEleTable.tableName : '') + ''"
- :visible.sync="editEleVisible"
- width="80%"
- append-to-body
- :close-on-click-modal="false"
- >
- <!-- <p class="font-c-warning">编辑元素信息(请谨慎操作)</p> -->
- <el-table :data="editEleList" border style="width: 100%" height="400px">
- <el-table-column
- align="center"
- type="index"
- width="50"
- ></el-table-column>
- <el-table-column align="center" prop="eName" label="字段信息">
- </el-table-column>
- <el-table-column
- align="center"
- prop="eType"
- label="数据类型"
- width="120"
- :formatter="eTypeFormatter"
- >
- </el-table-column>
- <el-table-column align="center" prop="eLength" label="长度" width="120">
- </el-table-column>
- <el-table-column
- align="center"
- prop="eAllowDeviation"
- label="允许偏差值"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="eInspectionMethod"
- label="检查方法和频率"
- >
- </el-table-column>
- </el-table>
- <span slot="footer" class="dialog-footer">
- <el-button @click="editEleVisible = false">取 消</el-button>
- <!-- <el-button
- type="primary"
- @click="saveEles"
- >确 定</el-button> -->
- </span>
- </el-dialog>
- <!-- 元素公式 -->
- <el-dialog
- :title="
- (curEleTable.tableName ? curEleTable.tableName : '') + ' 元素公式'
- "
- :visible.sync="editEleFormulaVisible"
- width="800px"
- append-to-body
- :close-on-click-modal="false"
- >
- <div class="flex mg-b-10">
- <el-input
- v-model="formulaInput"
- placeholder="请输入名称"
- size="samll"
- clearable
- @clear="searchFormulaName"
- ></el-input>
- <el-button type="info" class="mg-l-10" @click="searchFormulaName"
- >搜索
- </el-button>
- </div>
- <el-table
- :data="editEleListFilter"
- border
- style="width: 100%"
- height="400px"
- >
- <el-table-column align="center" prop="eName" label="字段信息">
- </el-table-column>
- <el-table-column align="center" label="操作" width="200">
- <template slot-scope="scope">
- <el-link
- :type="scope.row.globalFormula == 1 ? 'warning' : 'primary'"
- @click="toFormulaEdit(scope.row, 10)"
- >全局公式
- </el-link>
- <el-link
- v-show="scope.row.hasPartFormula"
- class="mg-l-10"
- :type="scope.row.isSaveFormula == 1 ? 'warning' : 'primary'"
- @click="toFormulaEdit(scope.row, 20)"
- >节点公式
- </el-link>
- <!-- <el-link
- class="mg-l-10"
- type="danger"
- @click="delEleRowHandle(scope.$index,editEleListFilter)"
- >删除</el-link> -->
- </template>
- </el-table-column>
- </el-table>
- </el-dialog>
- <!-- 导入划分 -->
- <el-dialog
- title="导入划分"
- :visible.sync="importTemplateVisible"
- width="800px"
- append-to-body
- :close-on-click-modal="false"
- >
- <div v-loading="importLoading">
- <div>
- <el-link type="primary" @click="handleDownload">下载导入模版</el-link>
- </div>
- <div class="mg-t-20">
- <el-button type="primary" @click="fileClick">选择文件</el-button>
- <span v-if="upFile" class="mg-l-20">{{ upFile.name }}</span>
- <input
- @change="fileChange"
- type="file"
- hidden
- ref="file"
- accept=".xls, .xlsx"
- />
- </div>
- <div v-if="!upFile">当前还未选择文件,请选择需要导入的文件</div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="importTemplateVisible = false">取 消</el-button>
- <el-button
- type="primary"
- @click="importTemplateHandle"
- :loading="importLoading"
- >导 入</el-button
- >
- </span>
- </el-dialog>
- <!-- 节点参数 -->
- <el-dialog
- title="节点参数"
- :visible.sync="nodeInfoVisible"
- width="800px"
- append-to-body
- class="jiedian"
- :close-on-click-modal="false"
- :show-close="false"
- @close="closenodeInfoVisible"
- >
- <div>
- <el-button
- type="text"
- icon="el-icon-s-operation"
- class="right-btn"
- @click="setNodeParameters()"
- ></el-button>
- <div class="flexEnd">
- <i
- class="el-icon-circle-plus marbottom10"
- @click="addNodeInfoTable()"
- style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
- ></i>
- <i
- class="el-icon-refresh-right marbottom10"
- @click="refreshnfoTable()"
- style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
- ></i>
- </div>
- <el-table
- :data="nodeInfoTable"
- border
- style="width: 100%"
- height="400"
- v-loading="nodeInfoTableLoad"
- >
- <el-table-column align="center" prop="name" label="参数名称">
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.k"
- placeholder="请选择"
- class="w-100p"
- >
- <el-option
- v-for="item in namelist"
- :key="item.k"
- :label="item.name"
- :value="item.k"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="value" label="参数值设置">
- <template slot-scope="scope">
- <el-input v-model="scope.row.v"></el-input>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="describe" label="描述">
- <template slot-scope="scope">
- <el-input v-model="scope.row.remark"></el-input>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="120" align="center">
- <template slot-scope="scope">
- <el-button
- type="text"
- size="small"
- class="text-icon-primary"
- @click="linkEle(scope.row)"
- >关联元素
- </el-button>
- <el-button
- type="text"
- size="small"
- class="text-icon-danger"
- @click="delNodeInfoss(scope.$index, scope.row)"
- >删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="nodeInfoVisible = false">取 消</el-button>
- <el-button
- type="primary"
- @click="nodeInfoSave()"
- :loading="nodeInfoSaveload"
- >保 存</el-button
- >
- </span>
- </el-dialog>
- <!-- 设置参数名称 -->
- <el-dialog
- title="设置参数名称"
- :visible.sync="infoNameVisible"
- width="800px"
- append-to-body
- class="jiedian"
- :close-on-click-modal="false"
- >
- <div>
- <div class="flexEnd">
- <i
- class="el-icon-circle-plus marbottom10"
- @click="setParameterName()"
- style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
- ></i>
- </div>
- <el-table :data="namelists" border style="width: 100%" height="400">
- <el-table-column align="center" prop="name" label="参数名称">
- <template slot-scope="scope">
- <el-input v-model="scope.row.name"></el-input>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="key" label="参数值KEY">
- <template slot-scope="scope">
- <el-input v-model="scope.row.k"></el-input>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="describe" label="描述">
- <template slot-scope="scope">
- <el-input v-model="scope.row.remark"></el-input>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="120" align="center">
- <template slot-scope="scope">
- <el-button
- type="text"
- size="small"
- class="text-icon-danger"
- @click="delNodeInfo(scope.$index, scope.row)"
- >删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="addParameterName()">保 存</el-button>
- <el-button @click="closeParameter()">关 闭</el-button>
- </span>
- </el-dialog>
- <el-dialog
- title="别名"
- :visible.sync="aliasVisible"
- width="600px"
- append-to-body
- :close-on-click-modal="false"
- >
- <div>
- <div class="flex">
- <el-input
- v-model="aliasInput"
- placeholder="请输入节点别名"
- ></el-input>
- <el-button class="mg-l-20" type="primary" @click="addAlias"
- >添加
- </el-button>
- </div>
- <div class="flex" style="flex-wrap: wrap">
- <div class="mg-t-10" v-for="(tag, index) in aliasArr" :key="index">
- <el-tag closable @close="delAlias(index)">
- {{ tag }}
- </el-tag>
- <span v-if="index != aliasArr.length - 1">、</span>
- </div>
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="aliasVisible = false">取 消</el-button>
- <el-button type="primary" @click="saveAliasHandle">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 节点公式 -->
- <el-dialog
- :title="
- (curEleTable.tableName ? curEleTable.tableName : '') +
- ' 元素公式(元素库)'
- "
- :visible.sync="formulaCompVisible"
- fullscreen
- append-to-body
- class="full-dialog"
- @close="closeformulaComp"
- >
- <FormulaEdit
- :fromcurNode="curTreeData"
- :projectid="projectid"
- :wbsid="id"
- :nodeid="curTreeData.id"
- :eleid="formulaCurRow.id"
- :globaltype="formulaCurRow.globaltype"
- :iswbstype="0"
- @hideDialog="formulaCompVisible = false"
- v-if="formulaCompVisible"
- ></FormulaEdit>
- </el-dialog>
- <!-- 全局公式 -->
- <el-dialog
- title=""
- :visible.sync="formulaCompVisible1"
- fullscreen
- append-to-body
- class="full-dialog"
- @close="closeformulaComp1"
- >
- <FormulaEditone
- :wbsid="id"
- :nodeid="curTreeData.id"
- :eleid="formulaCurRow.id"
- :elementType="formulaCurRow.elementType"
- :projectid="projectid"
- :tableType="istableType"
- :globaltype="formulaCurRow.globaltype"
- @hideDialog="formulaCompVisible1 = false"
- :fromcurNode="curEleTable"
- :iswbstype="0"
- v-if="formulaCompVisible1"
- >
- </FormulaEditone>
- </el-dialog>
- <!-- 编辑元素 -->
- <el-dialog
- title=" "
- :visible.sync="editElementVisible"
- fullscreen
- append-to-body
- class="full-dialog"
- >
- <EditElement
- :editElementQuery="curTreeData"
- :pkeyId="editElementQuery.pkeyId"
- :excelId="editElementQuery.excelId"
- :id="editElementQuery.id"
- :initTableName="editElementQuery.initTableName"
- :pid="editElementQuery.pid"
- :wbsid="editElementQuery.wbsid"
- :initTableId="editElementQuery.initTableId"
- :nodeid="editElementQuery.nodeid"
- @hideDialog="editElementVisible = false"
- @adjustExcel="adjustExcel"
- v-if="editElementVisible"
- ></EditElement>
- </el-dialog>
- <el-dialog
- title="节点参数设置-关联元素"
- :visible.sync="linkEleVisible"
- width="800px"
- append-to-body
- class="jiedian"
- :close-on-click-modal="false"
- >
- <div>
- <el-table
- :data="linkEleTableList"
- border
- style="width: 100%"
- height="400"
- >
- <el-table-column align="center" prop="tableName" label="元素表名">
- </el-table-column>
- <el-table-column
- align="center"
- prop="elementName"
- label="关联元素字段"
- >
- </el-table-column>
- <el-table-column label="操作" width="160" align="center">
- <template slot-scope="scope">
- <el-button
- v-if="!scope.row.mappingId"
- type="text"
- size="small"
- class="text-icon-primary"
- @click="tolinkEle(scope.row)"
- >选择元素
- </el-button>
- <el-button
- v-if="!!scope.row.mappingId"
- type="text"
- size="small"
- class="text-icon-danger"
- @click="delLink(scope.row)"
- >删除关联
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
- <!-- <el-button @click="saveLinks">保 存</el-button> -->
- <el-button @click="linkEleVisible = false">关 闭</el-button>
- </span>
- </el-dialog>
- <el-dialog
- title="选择关联元素"
- :visible.sync="linkCheckVisible"
- width="600px"
- append-to-body
- class="jiedian"
- :close-on-click-modal="false"
- >
- <div>
- <div class="flex mg-b-20">
- <el-input
- v-model="linkEleKey"
- placeholder="请输入元素关键字搜索"
- ></el-input>
- <el-link class="mg-l-20" :underline="false">
- <i
- class="el-icon-search"
- style="font-size: 20px"
- @click="searchEle"
- ></i>
- </el-link>
- </div>
- <el-table :data="linkEleList" border style="width: 100%" height="400">
- <el-table-column align="center" prop="eName" label="元素名">
- </el-table-column>
- <el-table-column label="操作" width="55">
- <template slot-scope="scope">
- <el-checkbox
- v-model="scope.row.checked"
- @change="(value) => linkEleCheck(value, scope.$index)"
- ></el-checkbox>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="saveLinkEle">保 存</el-button>
- <el-button @click="linkCheckVisible = false">关 闭</el-button>
- </span>
- </el-dialog>
- <!-- 关联节点 -->
- <el-dialog
- title="关联节点"
- :visible="isLinkNodes"
- append-to-body
- center
- destroy-on-close
- custom-class="hc-link-nodes-dialog"
- @close="linkNodesClose"
- >
- <el-tree
- ref="tree2"
- class="hc-link-nodes-tree"
- lazy
- :load="loadNode"
- :props="defaultProps"
- show-checkbox
- check-strictly
- :default-checked-keys="checkedLinkNodesKeys"
- highlight-current
- node-key="primaryKeyId"
- />
- <span slot="footer" class="dialog-footer">
- <el-button @click="linkNodesClose">取 消</el-button>
- <el-button
- type="primary"
- @click="linkNodesSave"
- v-loading="linkNodesLoad"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <!-- 编辑 -->
- <el-dialog
- :title="(curEleTable.tableName ? curEleTable.tableName : '') + ''"
- :visible.sync="editDialogShow"
- width="80%"
- append-to-body
- :close-on-click-modal="false"
- >
- <p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
- <div style="display: flex; margin-bottom: 10px">
- <el-input
- placeholder="请输入你想编辑的元素名称"
- v-model="searchinput"
- :size="size"
- clearable
- @clear="clearsearchinput"
- >
- </el-input>
- <el-button
- type="primary"
- icon="el-icon-search"
- size="small"
- @click="searchinputChange"
- >搜索</el-button
- >
- </div>
- <el-table
- :data="editTable"
- border
- style="width: 100%"
- height="400px"
- v-loading="editEleTableloading"
- >
- <el-table-column
- align="center"
- type="index"
- width="50"
- ></el-table-column>
- <el-table-column align="center" prop="eName" label="元素名称">
- <template slot="header">
- <i class="required"></i>
- <span>元素名称</span>
- </template>
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.eName"
- size="small"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="dynamicDict" label="动态字典">
- <template slot="header">
- <span>动态字典</span>
- </template>
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.dynamicDict"
- filterable
- size="small"
- placeholder="请选择"
- >
- <el-option
- v-for="item in dynamicDictList"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- </el-table>
- <span slot="footer" class="dialog-footer">
- <el-button @click="editDialogShow = false">取 消</el-button>
- <el-button type="primary" @click="saveEles" :loading="saveLoading"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <!-- 文件题名全局配置 -->
- <el-dialog
- title="文件题名全局配置"
- :visible.sync="fileTitleVisible"
- width="60%"
- append-to-body
- :close-on-click-modal="false"
- >
-
- <div class="flexEnd">
- <i
- class="el-icon-circle-plus "
- style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
- @click="addRow"
- ></i>
- <i
- class="el-icon-refresh "
- style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
- @click="refreshRow"
- ></i>
- </div>
-
- <el-table
- :data="fileTableData"
- style="width: 100%;height: 500px;"
- align="center"
- v-loading="fileTableLoading"
- >
-
- <el-table-column
- label="文件题名规则"
- prop="roleNameVal">
- <template #default="scope">
- <el-select
- :id="selectDiv"
- v-if="scope.row.isEdit"
- v-model="scope.row.ruleName"
- multiple
- placeholder="请选择"
- style="width: 240px"
- @change="changeRoleName($event,scope.row,scope.index)"
- >
- <el-option
- v-for="item in nodeTypelist1"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- <span v-else>
- <el-tag v-for="item in scope.row.roleNameVal" style="margin-right: 2px;">{{ item }}</el-tag>
- </span>
- </template>
- </el-table-column>
- <el-table-column
- label="文件题名范围"
- prop="ruleSizeVal"
-
- >
- <template #default="scope">
- <div v-if="isShowSize">
- <span v-if="scope.row.type===1" :class="{'orange': scope.row.isEdit}" @click="chooseFile(scope.$index, scope.row)">所有节点</span>
- <div v-else>
- <el-link type="warning" @click="chooseFile(scope.$index, scope.row)" v-if="!scope.row.ruleSizeVal">选择题名范围</el-link>
- <span v-else @click="chooseFile(scope.$index, scope.row)" :class="{'orange': scope.row.isEdit}">{{ scope.row.ruleSizeVal }}</span>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- width="150px"
- >
-
- <template slot-scope="scope">
- <el-link
- v-if="!scope.row.isEdit"
- type="primary"
- class="mg-r-10"
- @click="editRow(scope.$index, scope.row)">编辑</el-link>
- <el-link
- v-else
- type="primary"
- class="mg-r-10"
- @click="saveRow(scope.$index, scope.row)">保存</el-link>
- <el-link
- @click="delRow(scope.$index, scope.row)"
- type="danger"
- >删除</el-link>
- </template>
- </el-table-column>
- </el-table>
- <template #footer>
- <div class="dialog-footer">
- <el-button @click="fileTitleVisible=false">取消</el-button>
- <el-button type="primary" @click="batchsaveFileSize" :loading="saveFileLoading">
- 保存
- </el-button>
- </div>
- </template>
- </el-dialog>
- <!-- 选择题名范围i -->
- <el-dialog
- :visible.sync="chooseFileVisible"
- title="选择题名范围"
- width="500"
- align-center
- append-to-body
- >
- <el-form label-position="left" label-width="80px" :model="fileTitleModel" :rules="fileTitleRules" ref="fileTitleRef">
-
- <el-form-item label="题名范围" prop="type">
- <el-radio v-model="fileTitleModel.type" :label="1" @input="changeRadio">所有节点</el-radio><br/>
- <el-radio v-model="fileTitleModel.type" :label="2" @input="changeRadio">部分节点</el-radio>
- <div v-if="fileTitleModel.type==2" class="warning-text">请选择节点</div>
- <el-scrollbar class="h-100p" style="height: 400px;" v-if="fileTitleModel.type==2" v-loading="fileTreeLoading">
- <el-tree
- :data="fileTreeData"
- :props="filedefaultProps"
- :expand-on-click-node="false"
- highlight-current
- node-key="id"
- show-checkbox
- @check="checkFileSize"
- :default-checked-keys="deCheckTreeKeys"
-
- >
- </el-tree>
- </el-scrollbar>
- </el-form-item>
-
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button @click="chooseFileVisible=false">取消</el-button>
- <el-button type="primary" @click="saveFileSize">
- 保存
- </el-button>
- </div>
- </template>
- </el-dialog>
- <!-- 项目数据同步 -->
-
- <el-dialog
-
- :visible.sync="proSyncTag"
- width="80%"
- append-to-body
- @close=closeProSyncTag
- >
- <span slot="title" class="dialog-title">
- <div class="dialog-title-text">项目数据同步</div>
- <span class="dialog-title-tip">重新同步项目下所有配置,不保留独有配置,慎重同步!!!</span>
- </span>
- <div class="sync-container">
- <el-card class="box-card-1" :style="{ width: isShowLeft ? '40%' : '0%' }">
- <el-scrollbar style="height: 100%;">
- <div v-loading="treeLoad">
- <el-tree
- check-strictly
- class="filter-tree"
- lazy
- :load="loadNode"
- show-checkbox
- :props="defaultProps"
- :expand-on-click-node="false"
- highlight-current
- node-key="primaryKeyId"
- @check="handleCheckChange"
- @check-change="handleCheckChange1"
- ref="syncProTree"
- >
- </el-tree>
-
- </div>
- </el-scrollbar>
- </el-card>
- <el-card class="box-card-2">
- <el-form ref="syncForm" :model="syncForm" label-position="top">
- <el-form-item label="同步范围" v-if="!isShowTable">
- <el-radio-group v-model="syncForm.range">
- <el-radio
- v-for="item in rangeOptions"
- :key="item.id"
- :label="item.dictKey"
- >{{ item.dictValue}}</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="同步类型" prop="type">
- <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
- <div style="margin: 15px 0;"></div>
- <el-checkbox-group v-model="syncForm.type" @change="handleCheckedTypeChange">
- <el-checkbox v-for="item in typeOptions" :label="item.dictKey" :key="item.id">{{ item.dictValue}}</el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- <!-- <el-form-item label="选择同步范围(节点状态)" prop="contractRange" v-if="syncForm.range==='2'">
- <el-checkbox-group v-model="syncForm.contractRange">
- <el-checkbox label="全选" name="1"></el-checkbox>
- <el-checkbox v-for="(item,index) in checkIdList" :label="item.dictKey" :key="item.id">{{ item.dictValue}}</el-checkbox>
-
- </el-checkbox-group>
- </el-form-item> -->
- <el-form-item label="选择同步范围(节点状态)" prop="contractRange" v-if="syncForm.range==='2'">
- <el-checkbox :indeterminate="isIndeterminate1" v-model="checkAll1" @change="handleCheckAllChange1">全选</el-checkbox>
- <div style="margin: 15px 0;"></div>
- <el-checkbox-group v-model="syncForm.contractRange" @change="handleCheckedTypeChange1">
- <el-checkbox v-for="item in checkIdList" :label="item.dictKey" :key="item.id">{{ item.dictValue}}</el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- <el-form-item label="选择同步源" prop="templateId" v-else>
- <el-select v-model="syncForm.templateId" placeholder="请选择同步源" style="width: 100%;" size="small" @change="changeTemplateId">
- <el-option
- v-for="item in templateIdList"
- :key="item.id"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
-
- </el-form>
- <div class="table-box" v-if="isShowTable">
- <h4 style="margin-left: 4px;">表单预览</h4>
- <el-table
-
- size="small"
- ref="proTable"
- :data="preTableData"
- stripe
- style="width: 100%"
- max-height="300"
- @selection-change="handleSelectionChange"
- >
- <el-table-column
- type="selection"
- width="55">
- </el-table-column>
- <el-table-column
- prop="tableName"
- label="表单名称"
- width="180">
- </el-table-column>
- <el-table-column
- prop="tableType"
- :formatter="formatTableType"
- label="表单类型"
- width="180">
- </el-table-column>
- <el-table-column
- prop="tableOwner"
- :formatter="formatOwner"
- label="所属方">
- </el-table-column>
- </el-table>
- </div>
- </el-card>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="closeProSyncTag">取 消</el-button>
- <el-button type="primary" @click="saveProTag" :loading="saveProTagLoading">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 同步队列 -->
- <el-dialog
- title="同步队列"
- :visible.sync="syncListDialog"
- width="30%"
- append-to-body
- :close-on-click-modal="false"
- @close="closeSyncListTag"
- >
- <div class="content-box" v-loading="refreshLoading||refreshLoading1">
- <el-image
- style="width: 100px; height: 100px"
- :src="require('@/assets/loader.svg')"
- fit="contain"></el-image>
- <div class="mt-14">同步中</div>
- <div class="mt-14">
- 同步数量{{ syncListData.nodeNum }} 剩余数量{{ syncListData.nodeNumEnd }}
- </div>
- <div class="mt-14">
- <el-button type="primary" @click="syncListDialog=false">好的,我已知晓</el-button>
- </div>
- <div class="mt-14">
- <el-link type="primary" @click="refreshData" v-loading="refreshLoading" v-if="!isAdd">刷新数据</el-link>
- <el-link type="primary" @click="refreshData1" v-loading="refreshLoading1" v-else>刷新数据</el-link>
- </div>
- </div>
-
-
-
- </el-dialog>
- <!-- 同步表单其他配置 -->
- <el-dialog
- title="同步表单其他配置"
- :visible.sync="syncTableDialog"
- width="70%"
- append-to-body
- :close-on-click-modal="false"
- >
- <div class="sync-container">
- <el-card class="box-card-1" :style="{ width: isShowLeft ? '40%' : '0%' }">
- <el-scrollbar style="height: 100%;">
- <div >
- <el-tree
- class="filter-tree"
- lazy
- :load="loadNode"
- @node-click="handleNodeClick"
- :default-expanded-keys="defaultExpandedKeys"
- :props="defaultProps"
- :expand-on-click-node="false"
- highlight-current
- node-key="primaryKeyId"
- >
- </el-tree>
-
- </div>
- </el-scrollbar>
- </el-card>
- <el-card class="box-card-2">
-
- <div class="table-box">
- <h4 style="margin-left: 4px;">表单预览</h4>
- <el-table
- size="small"
- ref="proTable1"
- :data="preTableData1"
- stripe
- style="width: 100%"
- max-height="300"
- @selection-change="handleSelectionChange1"
-
- >
- <el-table-column
- type="selection"
- width="55">
- </el-table-column>
- <el-table-column
- prop="tableName"
- label="表单名称"
- width="180">
- </el-table-column>
- <el-table-column
- prop="tableType"
- :formatter="formatTableType"
- label="表单类型"
- width="180">
- </el-table-column>
- <el-table-column
- prop="tableOwner"
- :formatter="formatOwner"
- label="所属方">
- </el-table-column>
- </el-table>
- </div>
- </el-card>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="syncTableDialog = false">取 消</el-button>
- <el-button type="primary" @click="saveTableSync" :loading="saveTableSyncLoad">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 编号设置弹窗 -->
- <CodeSet ref="codeSetRef" ></CodeSet>
- </div>
- </template>
- <script>
- import ManualSorting from "@/components/WbsTree/ManualSorting";
- import dynamicExcel from "./treeTemplate/dynamicExcel.vue";
- import FormulaEdit from "@/views/formula/edit.vue";
- import FormulaEditone from "@/views/formula/edit1.vue";
- import EditElement from "@/views/manager/projectinfo/editElement/editElement.vue";
- import CodeSet from "./codeSet.vue";
- import {
- saveFormAndElement,
- selectFormElements,
- importWbsTree,
- findWbsTreePrivateSameLevel,
- wbsTreePrivateSort,
- parameters,
- saveOrUpdateBatch,
- keymap,
- updateBatchNodeTableInfo2,
- updateStatus,
- getParamElements,
- specifiedParamElements,
- delParamElements,
- selectPrivateFormElements,
- syncCurrentFormInProject,
- getQueryValueByType,
- getQueryValueByNodeType
- } from "@/api/manager/wbstree";
- import {
- saveElement,
- remove as removeElement,
- updateBatchElements,
- getTemplate,
- importWbsElement,
- } from "@/api/manager/wbsformelement";
- import {
- getLazytree,
- getDetail,
- update,
- findNodeTableByCondition as selectByNodeTable,
- removeTableByCondition as removeTableById,
- removePrivateTreeNode,
- wbsTreePrivateTableSort,
- privateSubmitFullName,
- syncNodeParam,
- syncProjecteVisa,
- syncNodeTable,
- syncNodeinfo,
- tabTypeLazyTree,
- syncContractTabSort,
- linkNodeTree,
- getLinekNodeTreelist,getNameRule,getTitleRange,saveOrUpdateNameRule,deletedNameRule
- } from "@/api/manager/wbsprivate";
- import { findProjectTree as getAlltree } from "@/api/manager/projectinfo";
- import { refrehPram } from "@/api/manager/wbstree";
- import { getList as getAttchFromOriginalName } from "@/api/resource/attach";
- import { getDictionary, getChildList } from "@/api/system/dict";
- import { mapGetters } from "vuex";
- import {
- getList,
- tabLazytreeAll,
- saveLinkTab,
- getExcelHtml,
- } from "@/api/exctab/excelmodel";
- import { getStore, setStore } from "@/util/store";
- import { getTempProject,addSync,getNodeStatus,getById } from "@/api/manager/ledger";
- import { selectByNodeTable as findNodeTableByCondition1 } from "@/api/manager/wbstree";
- export default {
- data() {
- var checkMajorDataType = (rule, value, callback) => {
- //console.log(this.nodeDetail.nodeType)
- //console.log(this.nodeDetail.majorDataType)
- if (this.nodeDetail.nodeType == 6) {
- if (!this.nodeDetail.majorDataType) {
- callback(new Error("工序节点必须选择内业资料类型"));
- }
- }
- callback();
- };
- return {
- fromcurNode: {},
- formDatass: [],
- editElementFormTag: false,
- editeditElementFormMFLoading: false,
- jiedianId: "",
- //#region
- sortTag: false,
- sortTag2: false,
- sureSortload: false,
- surePrivateSortload: false,
- sort: [],
- //#endregion
- //#region 关联清表
- loading: false,
- GLExcel: false,
- GLExcelFrom: {
- id: "",
- name: "",
- search: "", //搜素框舒服的值
- ids: "",
- excelId: "",
- initTableName: "",
- initTableId: "",
- },
- GLExcelData: [], //
- GLExcelProps: {
- label: "name",
- children: "children",
- disabled: "hasChildren",
- isLeaf: function (data) {
- let tag = false;
- if (!data.hasChildren) {
- tag = true;
- }
- if (data.isExistForm == 1) {
- tag = true;
- }
- return tag;
- },
- },
- exceldata: [], //清表模板
- GLExcelLoading: false,
- //#endregion
- //#region 调整表单
- adjustmentExcel: "",
- excelHtml: false,
- //#endregion
- //#region
- id: "",
- projectid: "",
- filterText: "",
- treeData: [],
- searchType: "1",
- isSearch: false,
- searchTreeData: [],
- searchtreeLoad: false,
- treeLoad: false,
- isShowTree: true,
- menuShow: false,
- defaultProps: {
- children: "children",
- label: "title",
- isLeaf: function (data) {
- //console.log(data, !data.hasChildren, data.isExistForm);
- let tag = false;
- if (!data.hasChildren) {
- tag = true;
- }
- /*if (data.isExistForm == 1) {
- tag = true;
- }*/
- if (data.nodeType >= 6 && data.nodeType <= 13) {
- tag = true;
- }
- //中间交工。开工报告、质量评定)
- if (
- data.majorDataType == 1 ||
- data.majorDataType == 2 ||
- data.majorDataType == 3
- ) {
- tag = true;
- }
- return tag;
- // return !data.hasChildren || (data.isExistForm == 1);
- },
- },
- leftType: 5,
- curTreeData: {},
- curTreeNode: {},
- tableData: [],
- nodeDetail: {},
- formData: [],
- editType: 1,
- dialogVisible: false,
- saveNodeLoading: false,
- nodeTypelist1: [],
- majorDataTypeList: [],
- rules: {
- nodeName: [
- { required: true, message: "请输入节点名称", trigger: "blur" },
- ],
- nodeType: [
- { required: true, message: "请选择节点类型", trigger: "change" },
- ],
- majorDataType: [{ validator: checkMajorDataType, trigger: "change" }],
- isAddConceal: [
- {
- required: true,
- message: "请选择是否新增中隐藏",
- trigger: "change",
- },
- ],
- },
- eleVisible: false,
- tableTypelist: [],
- dataTypeList: [],
- ownerTypeList: [],
- eleForm: {
- elementList: [],
- },
- eleRules: {
- nodeName: [
- { required: true, message: "请输入表名称", trigger: "blur" },
- ],
- tableType: [
- { required: true, message: "请选择表类型", trigger: "change" },
- ],
- tableOwner: [
- { required: true, message: "请选择所属方", trigger: "change" },
- ],
- },
- importVisible: false,
- tempList: [],
- curEleTable: {},
- istableType: true,
- editEleVisible: false,
- editEleList: [],
- eleReg: /(≥|≤|±|【】)?([^≥≤±【】]*)/,
- editEleFormulaVisible: false,
- isMeter: false,
- formulaInput: "",
- editEleListFilter: [],
- editEleListAll: [],
- importTemplateVisible: false,
- fileUrl: "",
- upFile: null,
- importLoading: false,
- nodeInfoVisible: false,
- nodeInfoTable: [],
- nodeInfoTableLoad: false,
- namelist: [],
- namelists: [],
- delids: [],
- infoNameVisible: false,
- excelSortTag: false,
- excelSortTag2: false,
- tableSortList: [],
- //#endregion
- defaultExpandedKeys: [],
- expandName: this.$route.fullPath,
- aliasVisible: false, //别名
- aliasInput: "",
- aliasArr: [],
- formulaCompVisible: false, //公式弹框
- formulaCompVisible1: false,
- formulaCurRow: {}, //当前元素
- editElementVisible: false, //编辑元素弹框
- editElementQuery: {
- pkeyId: "",
- excelId: "",
- id: "",
- initTableName: "",
- initTableId: "",
- pid: "",
- wbsid: "",
- nodeid: "",
- }, //传参
- syncBtnLoad: false,
- syncElectricLoad: false,
- showType: 1,
- typeTreeData: [],
- testTreeLoad: false,
- testTreeData: [],
- mixRatioTestIds: [],
- //节点参数,关联元素
- curParam: {}, //当前节点参数
- linkEleVisible: false,
- linkEleTableList: [], //元素表数组
- curLinkEleTable: {}, //当前元素表
- linkCheckVisible: false, //关联弹框
- linkEleList: [], //元素数组
- linkEleKey: "", //搜索关键字
- menusData: [
- // {icon: 'el-icon-s-promotion', label: '新增节点', key: "add"},
- {
- icon: "el-icon-s-promotion",
- label: "编辑节点",
- key: "edit",
- content: "编辑节点",
- },
- {
- icon: "el-icon-upload",
- label: "后管数据同步",
- key: "sync1",
- content: "后管数据同步",
- },
- {
- icon: "el-icon-upload",
- label: "同步到合同段",
- key: "sync3",
- content: "同步到合同段",
- },
-
-
- {
- icon: "el-icon-sort",
- label: "调整排序",
- key: "sort",
- content: "调整排序",
- },
- {
- icon: "el-icon-s-promotion",
- label: "删除节点",
- key: "del",
- content: "删除节点",
- },
- ], //树组件操作菜单
- menuvisible: false,
- menuleft: 20,
- menutop: 0,
- //同步菜单按钮
- menuoptions: [
- {
- value: "jdSync",
- label: "节点参数同步",
- load: false,
- },
- {
- value: "dqSync",
- label: "电签同步",
- load: false,
- },
- {
- value: "gsSync",
- label: "公式同步",
- load: false,
- },
- // {
- // value: "zdSync",
- // label: "字典同步",
- // load: false,
- // },
- ],
- menuvalue: "",
- isshowSyncbtn: false,
- projectName: "",
- nodeInfoSaveload: false,
- handlesyncLoad: false, //表单同步
- isLinkNodes: false,
- linkNodesLoad: false,
- checkedLinkNodesKeys: [],
- rowPkeyId: "",
- nodesCheck: [],
- standardTypeOptions: [], //标准分类
- unitOptions: [], //单位名称
- editDialogShow: false, //编辑元素
- searchinput: "",
- editTable: [],
- editEleTableloading: false,
- dynamicDictList: [],
- saveLoading: false,
- fileTitleVisible:false,
- deCheckTreeKeys:[],
- fileTableData:[
-
- ],
- fileTitleRef:null,
-
- fileTitleModel:{
- type:'',
-
- },
- fileTreeLoading:false,
- fileTreeData:[],
- filedefaultProps:{
- children: 'children',
- label: 'nodeName',
- disabled:function (data) {
- return data.status===11 ;
- },
- },
- fileTitleRules:{
- type: [
- { required: true, message: '请选择题名范围', trigger: 'blur' },
-
- ],
- },
-
- fileTableLoading:false,
- chooseFileVisible:false,
- chooseFileRow: {},
- chooseFileIndex: -1,
- isShowSize:true,
- selectDiv:Math.random(),
- saveFileLoading:false,
- proSyncTag:false,
- rangeOptions:[],
- typeOptions:[],
- checkAll: false,
- checkAll1: false,
- isIndeterminate: false,
- isIndeterminate1: false,
- syncForm:{
- range:'',
- rangeName:'',
- type:[],
- typeName:'',
- templateId:'',
- templateName:'',
- contractRange:[],
- contractRangeName:'',
- formIds:''
- },
- preTableData:[],
- multipleSelection: [],
- checkIdList:[
-
- ],
- isShowLeft:false,
- isShowTable:false,
- templateIdList:[],//同步源
- saveProTagLoading:false,
- syncTableDialog:false,
- preTableData1:[],
- formIds:'',
- saveTableSyncLoad:false,
- checkRow:null,
- syncListDialog:false,
- refreshLoading:false,
- syncListData:{
- nodeNum:'',//同步节点数量
- nodeNumEnd:''//已同步数量
- },
- isAdd:'',
- refreshLoading1:false,
- codeDialog:false,
-
- codeSetRef: null,
- typeTem:''
-
- };
- },
- computed: {
- ...mapGetters(["userInfo"]),
- },
- created() {
- this.init();
- //console.log(this.userInfo)
- },
- methods: {
- //#region
- init() {
- //this.id = this.$route.query.wbsid;
- //this.projectid = this.$route.query.pid;
- const { wbsid, pid, type } = this.$route.query;
- this.id = wbsid;
- this.projectid = pid;
- this.wbsType = type ? Number(type) : 1;
- this.getNodeTypelistData()
- this.getNodeTypelist();
- this.getTableTypelist();
- this.getDataTypelist();
- this.getOwnerTypelist();
- this.getStandardTypeOptions();
- this.getMajorDataTypeList();
- this.defaultExpandedKeys = getStore({ name: this.expandName });
- this.projectName = this.$route.query.projectName;
- },
- loadNode(node, resolve) {
- let pid = 0;
- if (node.level != 0) {
- pid = node.data.id;
- }
- const type = this.wbsType;
- getLazytree(this.id, pid, this.userInfo.tenant_id, this.projectid, {
- wbsType: type,
- }).then((res) => {
- let arr = [];
- if (Array.isArray(res.data.data)) {
- arr = res.data.data;
- }
- return resolve(arr);
- });
- },
- getNodeDetail(data, node) {
- console.log("getNodeDetail", data);
- let parentName = "";
- if (node.parent.data) {
- parentName = node.parent.data.title;
- }
- this.curTreeData = data;
- this.curTreeNode = node;
- this.curTreeData.parentName = parentName;
- getDetail(data.id, this.id, this.projectid).then((res) => {
- res.data.data.parentName = parentName;
- let tableObj=res.data.data;
- tableObj.primaryKeyId=data.primaryKeyId
- this.tableData = [res.data.data];
- this.nodeDetail = Object.assign({}, res.data.data);
-
- });
- this.updateNodeTable();
- // this.nodeTypeChange(data.nodeType)
- //获取节点展开路径
- this.getExpandedKeys(node);
- },
- saveNode() {
- const type = this.wbsType;
- this.$refs["nodeDetail"].validate((valid) => {
- if (valid) {
- const { mixRatioTestIds, nodeType } = this.nodeDetail;
- if (type === 2 && nodeType === 53) {
- if (mixRatioTestIds) {
- if (this.editType == 1) {
- this.addNode();
- } else if (this.editType == 2) {
- this.updateNode();
- }
- } else {
- this.$message({
- type: "error",
- message: "请先选择节点",
- });
- return false;
- }
- } else {
- if (this.editType == 1) {
- this.addNode();
- } else if (this.editType == 2) {
- this.updateNode();
- }
- }
- } else {
- console.log("error submit!!");
- return false;
- }
- });
- },
- addNode() {
- this.saveNodeLoading = true;
- update(this.nodeDetail).then(() => {
- this.updateTreeNewNode();
- this.dialogVisible = false;
- this.$message({
- type: "success",
- message: "新增成功!",
- });
- });
- },
- updateNode() {
- update(this.nodeDetail).then(() => {
- let node = this.tableData[0];
- node.nodeName = this.nodeDetail.nodeName;
- node.nodeType = this.nodeDetail.nodeType;
- this.curTreeData.title = this.nodeDetail.nodeName;
- this.dialogVisible = false;
- this.$message({
- type: "success",
- message: "修改成功!",
- });
- });
- },
- toSplit(val) {
- return val ? String(val).split(",") : "";
- },
- setLeftType(type, data, node) {
- this.jiedianId = data.id;
- this.getNodeTypelistData()
- if (type == 4 || type == 5) {
- this.leftType = type;
- }
- this.curTreeData = data;
- this.curTreeNode = node;
- this.$refs.tree.setCurrentKey(data.id);
- if (type == 1 || type == 2) {
- this.getMajorDataTypeList();
-
- this.dialogVisible = true;
- this.editType = type;
- }
-
- getDetail(data.id, this.id, this.projectid).then((res) => {
- let parentName = "";
- if (node.parent.data) {
- parentName = node.parent.data.title;
- }
- res.data.data.parentName = parentName;
- this.tableData = [res.data.data];
- if (type == 1) {
- this.nodeDetail = {
- parentId: res.data.data.id,
- parentName: parentName,
- projectId: res.data.data.projectId,
- };
- } else {
- this.nodeDetail = Object.assign({}, res.data.data);
- this.mixRatioTestIds = this.toSplit(res.data.data.mixRatioTestIds);
- }
- this.nodeDetail.type = 1; // '1'节点 '2'表单
- this.nodeDetail.wbsId = this.id;
- this.nodeDetail.tenantId = this.userInfo.tenant_id;
- this.changeStandType(this.nodeDetail.className);
- });
- if (this.leftType == 4) {
- selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
- if (res.data.data.length) {
- this.formData = res.data.data;
- } else {
- this.formData = [];
- }
- });
- }
- //获取节点展开路径
- this.getExpandedKeys(node);
- },
- showFormElement() {
- if (!this.nodeDetail.id) {
- this.$message({
- type: "warning",
- message: "请先选择在哪个节点下创建表",
- });
- return;
- }
- this.eleVisible = true;
- },
- addEleRow(list) {
- list.push({});
- },
- delEleRow(index, list) {
- list.splice(index, 1);
- },
- saveFormAndElementHandle() {
- this.$refs["eleDialog"].validate((valid) => {
- if (valid) {
- this.eleForm.wbsId = this.id;
- this.eleForm.tenantId = this.userInfo.tenant_id;
- this.eleForm.nodeType = -1;
- this.eleForm.type = 2; // '1'节点 '2'表单
- this.eleForm.parentId = this.nodeDetail.id;
- this.eleForm.elementList.forEach((element) => {
- element.eAllowDeviation =
- (element.allow ? element.allow : "") +
- (element.deviation ? element.deviation : "");
- if (element.eType == 4) {
- element.eLength = 0;
- }
- });
- saveFormAndElement(this.eleForm).then(() => {
- //console.log(res)
- this.updateTreeNewNode();
- this.updateNodeTable();
- this.eleVisible = false;
- this.$message({
- type: "success",
- message: "新增成功!",
- });
- });
- } else {
- console.log("error submit!!");
- return false;
- }
- });
- },
- updateTreeNewNode() {
- getLazytree(
- this.id,
- this.nodeDetail.parentId,
- this.userInfo.tenant_id,
- this.projectid
- ).then((res) => {
- this.$refs.tree.updateKeyChildren(
- this.nodeDetail.parentId,
- res.data.data
- );
- });
- },
- updateNodeTable() {
- selectByNodeTable( this.curTreeData.id, this.projectid, this.id).then(
- (res) => {
- if (res.data.data && res.data.data.length) {
- this.formData = res.data.data;
- this.formData.forEach((ele) => {
- ele.nodeType = Number(ele.nodeType);
- });
- } else {
- this.formData = [];
- }
- }
- );
- },
- deleNode(data, node) {
- let pid = data.primaryKeyId ? data.primaryKeyId : data.pKeyId;
- this.$confirm(
- "此操作将删除节点【" + data.title + "】, 是否继续?",
- "提示",
- {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }
- )
- .then(() => {
- removePrivateTreeNode(pid).then(() => {
- this.$refs.tree.remove(node);
- this.$message({
- type: "success",
- message: "删除成功!",
- });
- });
- })
- .catch(() => {});
- },
- importHandle() {},
- handlePreview(index, row) {
- this.curEleTable = row;
- selectPrivateFormElements(this.curEleTable.initTableId).then((res) => {
- res.data.data.forEach((element) => {
- this.eleReg.exec(element.eAllowDeviation);
- element.allow = RegExp.$1 ? RegExp.$1 : "";
- element.deviation = RegExp.$2 ? RegExp.$2 : "";
- });
- this.editEleList = res.data.data;
- });
- this.editEleVisible = true;
- },
- //关联节点
- handleLinkNodes(index, row) {
- this.rowPkeyId = row.pkeyId;
- this.linkNodesLoad = false;
- this.isLinkNodes = true;
- getLinekNodeTreelist(row.pkeyId)
- .then(({ data }) => {
- const res = data.data;
- if (res instanceof Array) {
- this.checkedLinkNodesKeys = res;
- } else {
- this.checkedLinkNodesKeys = [];
- }
- })
- .catch(() => {
- this.checkedLinkNodesKeys = [];
- });
- },
- //确定关联
- linkNodesSave() {
- const keys = this.$refs.tree2.getCheckedKeys();
- // if (keys.length <= 0) {
- // this.$message({
- // type: "warning",
- // message: "请先勾选节点",
- // });
- // return;
- // }
-
- const pkeyId = this.rowPkeyId;
- this.linkNodesLoad = true;
- linkNodeTree(keys.length >0?keys.join(","):'', pkeyId)
- .then(() => {
- this.$message({
- type: "success",
- message: "关联成功!",
- });
- this.linkNodesLoad = false;
- this.linkNodesClose();
- })
- .catch(() => {
- this.linkNodesLoad = false;
- });
- },
- //关闭关联弹窗
- linkNodesClose() {
- this.isLinkNodes = false;
- this.linkNodesLoad = false;
- this.checkedLinkNodesKeys = [];
- this.nodesCheck = [];
- this.rowPkeyId = "";
- },
- handleDelete(index, row) {
- this.$confirm("是否删除 " + row.tableName + " ?", "删除元素表", {
- distinguishCancelAndClose: true,
- confirmButtonText: "删除",
- cancelButtonText: "取消",
- }).then(() => {
- removeTableById(row.id, this.projectid, this.id).then(() => {
- this.formData.splice(index, 1);
- this.$message({
- type: "success",
- message: "删除成功!",
- });
- });
- });
- },
- async hideMD(row) {
- //隐藏按钮
- const code = await this.updateStatus(row.pkeyId, row.status);
- if (code == 200) {
- if (row.status == 0) {
- row.status = 1;
- } else {
- row.status = 0;
- }
- }
- },
- async updateStatus(pKeyId, status) {
- //隐藏功能激活
- const { data: res } = await updateStatus({ pKeyId });
- if (res.code == 200) {
- this.$message({
- type: "success",
- message: status == 1 ? "隐藏成功" : "激活成功",
- });
- }
- return res.code;
- },
- handleEditFormula(index, row) {
- this.curEleTable = row;
- selectFormElements(this.curEleTable.pkeyId, { type: 0 }).then((res) => {
- this.editEleListFilter = res.data.data;
- this.editEleListAll = [].concat(this.editEleListFilter);
- });
- this.editEleFormulaVisible = true;
- },
- //表单同步
- handlesync(index, row) {
-
- },
- //搜索 筛选
- searchFormulaName() {
- this.editEleListFilter = this.editEleListAll.filter((ele) => {
- return ele.eName.indexOf(this.formulaInput) > -1;
- });
- },
- saveNewEle(row) {
- row.eAllowDeviation =
- (row.allow ? row.allow : "") + (row.deviation ? row.deviation : "");
- row.fId = this.curEleTable.initTableId;
- row.initTableName = this.curEleTable.initTableName;
- if (row.eType == 4) {
- row.eLength = 0;
- }
- saveElement(row).then((res) => {
- if (res.data.data) {
- this.$set(row, "id", res.data.data.id);
- this.$set(row, "ekey", res.data.data.ekey);
- this.$message({
- type: "success",
- message: "保存成功!",
- });
- }
- });
- },
- delEleRowHandle(index, list) {
- let row = list[index];
- if (row.id) {
- //有id需要请求删除
- this.$confirm("是否确认删除?", "删除元素", {
- distinguishCancelAndClose: true,
- confirmButtonText: "删除",
- cancelButtonText: "取消",
- }).then(() => {
- removeElement(row.id, this.curEleTable.initTableName, row.ekey).then(
- () => {
- list.splice(index, 1);
- }
- );
- });
- } else {
- list.splice(index, 1);
- }
- },
- nodeTypeChange(val) {
- console.log(333333333);
- if (val === 53) {
- // if (this.testTreeData.length > 0) {
- // return;
- // }
- this.testTreeLoad = true;
- // getAlltreeTrial(this.projectid, this.id, this.curTreeData.primaryKeyId).then((res) => {
- // this.testTreeLoad = false;
- // console.log(res.data.data,'data');
- // let trialdata=res.data.data
- // if(trialdata&&trialdata.allTree){
- // this.testTreeData = trialdata.allTree[0];
- // if(trialdata.allStatusIds.length>0){
- // //设置勾选相关联试验全选
- // this.mixRatioTestIds =trialdata.allStatusIds[0];
- // }
- // }
- // });
- let pid = this.curTreeData.primaryKeyId
- ? this.curTreeData.primaryKeyId
- : this.curTreeData.pKeyId;
- getAlltree(this.projectid, this.id, pid).then((res) => {
- this.testTreeLoad = false;
- console.log(res.data.data, "data");
- this.testTreeData = res.data.data;
- });
- }
- },
- //根据逗号联合
- toJoin(arr) {
- return arr ? arr.join() : "";
- },
- TestTreeCheckChange(_, { checkedKeys, halfCheckedKeys }) {
- // const newarr = [...checkedKeys, ...halfCheckedKeys];
- const newarr = [...checkedKeys];
- this.nodeDetail.mixRatioTestIds = this.toJoin(newarr);
- },
- // filterChange() {
- // if (this.treeData.length > 0) {
- // this.$refs.treeall.filter(this.filterText);
- // return;
- // }
- // this.treeLoad = true;
- // getAlltree(this.projectid, this.id).then((res) => {
- // this.treeLoad = false;
- // this.treeData = res.data.data;
- // console.log(res.data.data,'res.data.data');
- // this.$nextTick(() => {
- // this.$refs.treeall.filter(this.filterText);
- // });
- // });
- // },
- //搜索树
- //搜索树
- searchTreeClick() {
- if (this.filterText.length > 0) {
- this.isSearch = true;
- this.searchtreeLoad = true;
- getQueryValueByType({
- queryValue: this.filterText,
- type: this.searchType,
- wbsId: this.id,
- projectId: this.projectid,
- }).then((res) => {
- let arr = [];
- if (Array.isArray(res.data.data)) {
- arr = res.data.data;
- this.searchTreeData = arr;
- } else {
- this.searchTreeData = [];
- }
- });
- } else {
- this.isSearch = false;
- }
- this.searchtreeLoad = false;
- },
- filterSearchClick(){
-
- this.isSearch = true;
- this.searchtreeLoad = true;
- getQueryValueByNodeType({
- queryValue: this.filterText,
- wbsId: this.id,
- projectId: this.projectid,
- }).then((res) => {
- let arr = [];
- if (Array.isArray(res.data.data)) {
- arr = res.data.data;
- this.searchTreeData = arr;
- } else {
- this.searchTreeData = [];
- }
- });
-
- this.searchtreeLoad = false;
- },
- clearSearch() {
- this.isSearch = false;
- },
- importTemplate(data) {
- this.importTemplateVisible = true;
- this.curTreeData = data;
- if (!this.fileUrl) {
- getAttchFromOriginalName(1, 20, {
- originalName: "WBS划分模板.xls",
- }).then((res) => {
- if (res.data.data.records.length) {
- this.fileUrl = res.data.data.records[0].link;
- } else {
- this.fileUrl = "";
- }
- });
- }
- },
- importTemplateHandle() {
- if (!this.upFile) {
- this.$message({
- type: "warning",
- message: "请先选择文件再进行导入",
- });
- return;
- }
- let forms = new FormData();
- forms.append("excelFile", this.upFile);
- let wbsTreeFu = {
- wbsId: this.id,
- parentId: this.curTreeData.id,
- // ancestors:'0,'+this.curTreeData.id,
- };
- let json = JSON.stringify(wbsTreeFu);
- let blob = new Blob([json], { type: "application/json" });
- forms.append("wbsTreeFu", blob);
- this.importLoading = true;
- importWbsTree(forms)
- .then(() => {
- //this.$router.go(0)
- let node = this.$refs.tree.getNode(this.curTreeData.id);
- node.isLeaf = false;
- this.importTemplateVisible = false;
- this.upFile = null;
- })
- .finally(() => {
- this.importLoading = false;
- });
- },
- handleDownload() {
- if (this.fileUrl) {
- window.open(this.fileUrl);
- } else {
- this.$message({
- type: "warning",
- message: "请先在附件管理上传【WBS划分模板.xls】文件",
- });
- }
- },
- fileClick() {
- this.$refs.file.click();
- },
- fileChange(e) {
- const file = e.target.files[0];
- if (!file) {
- // 如果用户没有选择图片,只是点了文件上传这个按钮
- return;
- }
- //console.log(file)
- this.upFile = file;
- },
- editNodeInfo(index, row) {
- this.$set(row, "isEdit", true);
- },
- saveNodeInfoHandle(index, row) {
- row.isEdit = false;
- },
- downloadTmp() {
- getTemplate().then((res) => {
- //console.log(res)
- let blob = new Blob([res.data], {
- type: "application/vnd.ms-excel",
- });
- //console.log(blob)
- let filename = Date.parse(new Date()) + ".xls";
- if (window.navigator.msSaveOrOpenBlob) {
- // 兼容IE10
- window.navigator.msSaveBlob(blob, filename);
- } else {
- // 兼容chrome/firefox
- let aTag = document.createElement("a");
- aTag.download = Date.parse(new Date()) + ".xls";
- aTag.href = window.URL.createObjectURL(blob);
- aTag.click();
- URL.revokeObjectURL(aTag.href);
- }
- });
- },
- fileClick2() {
- this.$refs.file2.click();
- },
- tmpImport(e) {
- const file = e.target.files[0];
- const formData = new FormData();
- formData.append("file", file);
- //console.log(file.name)
- importWbsElement(formData)
- .then((res) => {
- res.data.data.forEach((element) => {
- element.eName = element.elementName;
- element.eLength = element.elementLength;
- element.eType = Number(element.elementType);
- element.eAllowDeviation = element.elementAllowDeviation;
- element.eInspectionMethod = element.elementInspectionMethod;
- this.eleReg.exec(element.eAllowDeviation);
- // console.log(RegExp.$1)
- // console.log(RegExp.$2)
- element.allow = RegExp.$1 ? RegExp.$1 : "";
- element.deviation = RegExp.$2 ? RegExp.$2 : "";
- });
- this.eleForm.elementList = res.data.data;
- this.importVisible = false;
- })
- .finally(() => {
- e.target.value = "";
- });
- },
- visiblechange(value, data) {
- this.$set(data, "moreShow", value);
- },
- bianhua2() {
- this.excelSortTag2 = false;
- this.$nextTick(() => {
- this.excelSortTag2 = true;
- });
- },
- //私有树的元素表修改排序
- privateTableSort() {
- if (!this.curTreeData.id) {
- this.$message({
- type: "warning",
- message: "请先选择需要排序的节点",
- });
- return;
- }
- this.tableSortList = this.formData.map((form, index) => {
- return {
- sort: index + 1,
- nodeName: form.tableName,
- pkeyId: form.pkeyId,
- };
- });
- this.excelSortTag = true;
- this.excelSortTag2 = true;
- },
- editPrivateSort() {
- this.surePrivateSortload = true;
- wbsTreePrivateTableSort(this.tableSortList).then(() => {
- this.$message({
- type: "success",
- message: "排序成功!",
- });
- this.updateNodeTable();
- this.surePrivateSortload = false;
- this.excelSortTag = false;
- this.excelSortTag2 = false;
- });
- },
- //解析元素数据类型
- eTypeFormatter(row) {
- let text = "";
- for (let i = 0; i < this.dataTypeList.length; i++) {
- if (this.dataTypeList[i].dictKey == row.eType) {
- text = this.dataTypeList[i].dictValue;
- break;
- }
- }
- return text;
- },
- //跳转到公式配置页面
- toFormulaEdit(row, type) {
- this.curEleTable.hasPartFormula = row.hasPartFormula;
- this.formulaCurRow = row;
- this.formulaCurRow.globaltype = type;
- if (type === 10) {
- this.formulaCompVisible1 = true;
- this.formulaCurRow.elementType = false;
- this.istableType = true;
- } else {
- this.formulaCompVisible = true;
- }
- },
- //关闭公式弹窗
- closeformulaComp() {
- console.log("关闭");
- selectFormElements(this.curEleTable.pkeyId, { type: 0 }).then((res) => {
- this.editEleListFilter = res.data.data;
- this.editEleListAll = [].concat(this.editEleListFilter);
- });
- },
- //关闭公式弹窗
- closeformulaComp1() {
- console.log("关闭");
- selectFormElements(this.curEleTable.pkeyId, { type: 0 }).then((res) => {
- this.editEleListFilter = res.data.data;
- this.editEleListAll = [].concat(this.editEleListFilter);
- });
- },
- getNodeTypelist() {
- let code = "name_rule";
- getDictionary({
- code,
- }).then((res) => {
- this.nodeTypelist1 = res.data.data;
-
-
- });
- },
- getNodeTypelistData() {
- const type = this.wbsType;
- let code = "";
- if (type === 5) {
- code = "lar_node_type"; //征拆
- } else if (type === 2) {
- code = "trial_node_type"; //试验
- } else if (type === 3) {
- code = "meter_node_type"; //计量
- } else {
- {
- code = "wbs_node_type"; //质检
- }
- }
- getDictionary({
- code,
- }).then((res) => {
- this.nodeTypelist = res.data.data;
- res.data.data.forEach((element) => {
- element.dictKey = Number(element.dictKey);
-
- });
- this.nodeTypelist = res.data.data;
-
-
- });
- },
- getMajorDataTypeList() {
- // if (this.majorDataTypeList.length > 1) {
- // return;
- // }
- getDictionary({
- code: "major_data_type",
- }).then((res) => {
- res.data.data.forEach((element) => {
- element.dictKey = Number(element.dictKey);
-
- });
- // this.majorDataTypeList = res.data.data;
- this.majorDataTypeList = res.data.data.filter(
- (item) => item.dictKey != 0
- );
-
-
- });
- },
- getTableTypelist() {
- const type = this.wbsType;
- if (this.tableTypelist.length > 1) {
- return;
- }
- let code = "";
- if (type === 5) {
- code = "table_type"; //征拆
- } else if (type === 2) {
- code = "trial_table_type"; //试验
- } else {
- code = "table_type"; //质检
- }
- getDictionary({
- // code: "table_type",
- // code: type === 2 ? "trial_table_type" : "table_type",
- code,
- }).then((res) => {
- res.data.data.forEach((element) => {
- element.dictKey = Number(element.dictKey);
- });
- this.tableTypelist = res.data.data;
- });
- },
- getDataTypelist() {
- if (this.dataTypeList.length > 1) {
- return;
- }
- getDictionary({
- code: "data_type",
- }).then((res) => {
- res.data.data.forEach((element) => {
- element.dictKey = Number(element.dictKey);
- });
- this.dataTypeList = res.data.data;
- });
- },
- getOwnerTypelist() {
- if (this.ownerTypeList.length > 1) {
- return;
- }
- getDictionary({
- code: "owner_type",
- }).then((res) => {
- res.data.data.forEach((element) => {
- element.dictKey = Number(element.dictKey);
- });
- this.ownerTypeList = res.data.data;
- });
- },
- getStandardTypeOptions() {
- getDictionary({
- code: "classification",
- }).then((res) => {
- res.data.data.forEach((element) => {
- element.dictKey = Number(element.dictKey);
- });
- // 定义要过滤的 dictKey 值
- const targetKeys = [1, 2, 3, 4, 5];
- // 过滤数组
- const filteredOptions = res.data.data.filter((item) =>
- targetKeys.includes(item.dictKey)
- );
- this.standardTypeOptions = filteredOptions;
- });
- },
- changeStandType(val) {
- let parentId = "";
- this.standardTypeOptions.forEach((item) => {
- if (item.dictKey == val) {
- parentId = item.id; // 找到匹配项,提取 parentId
- }
- });
- getChildList(1, 10000, parentId).then((res) => {
- res.data.data.forEach((element) => {
- element.dictKey = Number(element.dictKey);
- });
- this.unitOptions = res.data.data;
- this.unitOptions = this.unitOptions.filter(
- (item) => item.dictKey != -1
- );
- });
- },
- formatCat(row, column, cellValue) {
- for (let i = 0; i < this.nodeTypelist.length; i++) {
- if (this.nodeTypelist[i].dictKey == cellValue) {
- return this.nodeTypelist[i].dictValue;
- }
- }
- return cellValue;
- //console.log(cellValue)
- },
- formatTableType(row, column, cellValue) {
- for (let i = 0; i < this.tableTypelist.length; i++) {
- if (this.tableTypelist[i].dictKey == cellValue) {
- return this.tableTypelist[i].dictValue;
- }
- }
- return cellValue;
- //console.log(cellValue)
- },
- formatOwner(row, column, cellValue) {
- for (let i = 0; i < this.ownerTypeList.length; i++) {
- if (this.ownerTypeList[i].dictKey == cellValue) {
- return this.ownerTypeList[i].dictValue;
- }
- }
- return cellValue;
- //console.log(cellValue)
- },
- formatdataType(row, column, cellValue) {
- for (let i = 0; i < this.dataTypeList.length; i++) {
- if (this.dataTypeList[i].dictKey == cellValue) {
- return this.dataTypeList[i].dictValue;
- }
- }
- return cellValue;
- },
- formMajorType(row, column, cellValue) {
-
- for (let i = 0; i < this.majorDataTypeList.length; i++) {
- if (this.majorDataTypeList[i].dictKey == cellValue) {
- return this.majorDataTypeList[i].dictValue;
- }
- }
- return cellValue;
- },
- // filterNode(value, data) {
- // if (!value) return true;
- // return data.title.indexOf(value) !== -1;
- // },
- getReturnNode(node, _array, value) {
- let isPass =
- node.data && node.data.title && node.data.title.indexOf(value) !== -1;
- isPass ? _array.push(isPass) : "";
- if (!isPass && node.level != 1 && node.parent) {
- this.getReturnNode(node.parent, _array, value);
- }
- },
- filterNode(value, data, node) {
- if (!value) {
- return true;
- }
- let level = node.level;
- let _array = []; //这里使用数组存储 只是为了存储值。
- this.getReturnNode(node, _array, value);
- let result = false;
- _array.forEach((item) => {
- result = result || item;
- });
- return result;
- },
- //#endregion
- //#region wbs私有树排序
- async sortpai(data) {
- console.log(data);
- await this.findWbsTreePrivateSameLevel({
- parentId: data.parentId,
- projectId: this.projectid,
- wbsId: this.id,
- });
- this.sortTag = true;
- this.sortTag2 = true;
- },
- editSort() {
- this.wbsTreePrivateSort();
- },
- bianhua() {
- this.sortTag2 = false;
- this.$nextTick(() => {
- this.sortTag2 = true;
- });
- },
- async wbsTreePrivateSort() {
- this.sureSortload = true;
- //wbs私有树节点手动排序
- const { data: res } = await wbsTreePrivateSort(this.sort);
- console.log(res);
- if (res.code == 200) {
- this.sortTag = false;
- this.sortTag2 = false;
- this.$message({
- type: "success",
- message: "排序成功!",
- });
- this.sureSortload = false;
- this.isShowTree = false;
- setTimeout(() => {
- this.isShowTree = true;
- }, 100);
- // window.location.reload();
- // this.getLazytreessss();
- }
- },
- async findWbsTreePrivateSameLevel(da) {
- //wbs私有树同级节点接口
- const { data: res } = await findWbsTreePrivateSameLevel(da);
- if (res.code == 200) {
- this.sort = res.data;
- }
- },
- async getLazytreessss() {
- const type = this.wbsType;
- const { data: res } = await getLazytree(
- this.id,
- 0,
- this.userInfo.tenant_id,
- this.projectid,
- { wbsType: type }
- );
- console.log(res);
- if (res.code == 200) {
- this.treeData = res.data;
- }
- },
- //#endregion
- //#region 关联清表
- async getList(da) {
- //获取清表模板信息
- const { data: res } = await getList(da);
- console.log(res);
- if (res.code === 200 && res.msg === "操作成功") {
- this.GLExcelData = res.data.records;
- }
- },
- async tabLazytreeAll() {
- //清表树信息
- this.GLExcelLoading = true;
- const { data: res } = await tabLazytreeAll({
- modeId: this.GLExcelFrom.name,
- name: this.GLExcelFrom.search,
- });
- this.GLExcelLoading = false;
- console.log(res);
- if (res.code === 200 && res.msg === "操作成功") {
- this.exceldata = res.data;
- }
- },
- Associationlist(scope) {
- //关联清表点击事件
- console.log(scope.row);
- this.GLExcel = true;
- this.getList({
- current: 1,
- size: 100000,
- parentId: 0,
- });
- this.GLExcelFrom.name = scope.row.modeId;
- setTimeout(() => {
- this.$refs.tree.setCheckedKeys([scope.row.excelId]);
- }, 2000);
- this.GLExcelFrom.initTableId = scope.row.initTableId;
- this.GLExcelFrom.id = scope.row.pkeyId;
- this.GLExcelFrom.excelId = scope.row.excelId;
- this.GLExcelFrom.ids = scope.row.id;
- this.GLExcelFrom.initTableName = scope.row.initTableName;
- console.log(this.GLExcelFrom, "this.GLExcelFrom");
- },
- changetherr() {
- //清表类型选择框change事件
- if (this.GLExcelFrom.name != "") {
- this.GLExcelFrom.search = "";
- this.tabLazytreeAll();
- }
- },
- GLExcelMD() {
- //弹框关闭事件
- this.GLExcelFrom.name = "";
- this.GLExcelFrom.search = "";
- this.GLExcelFrom.id = "";
- this.exceldata = [];
- this.$refs.tree.setCheckedKeys([]);
- this.GLExcel = false;
- },
- checkchange(data) {
- //节点选中回调
- if (this.$refs.tree.getCheckedNodes().length === 0) {
- this.$refs.tree.setCheckedKeys([]);
- } else if (this.$refs.tree.getCheckedNodes().length >= 1) {
- this.$refs.tree.setCheckedKeys([data.id]);
- }
- },
- async saveLinkTab() {
- //保存按钮
- let checkNodes = this.$refs.tree.getCheckedNodes();
- if (checkNodes.length > 0) {
- let node = checkNodes[checkNodes.length - 1];
- if (node.fileType != 3) {
- this.$message({
- type: "warning",
- message: "请先上传Excel表",
- });
- return;
- }
- const { data: res } = await saveLinkTab({
- exceTabId: node.id,
- tabId: this.GLExcelFrom.id,
- });
- console.log(res);
- if (res.code === 200) {
- this.$message({
- type: "success",
- message: "关联清表成功",
- });
- // selectByNodeTable刷新表单列表
- this.updateNodeTable();
- this.GLExcel = false;
- console.log(this.GLExcelFrom, "GLExcelFrom");
- this.rightClick(
- this.GLExcelFrom.id,
- this.GLExcelFrom.excelId,
- this.GLExcelFrom.ids,
- this.GLExcelFrom.initTableName,
- this.GLExcelFrom.initTableId
- );
- }
- } else {
- this.$message({
- type: "warning",
- message: "请先设置清表",
- });
- }
- },
- getReturnNode2(node, _array, value) {
- let isPass =
- node.data && node.data.name && node.data.name.indexOf(value) !== -1;
- isPass ? _array.push(isPass) : "";
- if (!isPass && node.level != 1 && node.parent) {
- this.getReturnNode2(node.parent, _array, value);
- }
- },
- filterNode222(value, data, node) {
- if (!value) {
- return true;
- }
- let level = node.level;
- let _array = []; //这里使用数组存储 只是为了存储值。
- this.getReturnNode2(node, _array, value);
- let result = false;
- _array.forEach((item) => {
- result = result || item;
- });
- return result;
- },
- //#endregion
- //#region 节点参数
- nodeInfo(data) {
- //节点参数按钮
- this.keymap();
- //console.log(data)
- let pid = data.primaryKeyId ? data.primaryKeyId : data.pKeyId;
- this.jiedianId = pid;
- this.parameters(pid);
- this.nodeInfoVisible = true;
- },
- closenodeInfoVisible() {
- this.nodeInfoTable = [];
- this.nodeInfoVisible = false;
- },
- addNodeInfoTable() {
- //添加节点参数数据
- this.nodeInfoTable.unshift({
- k: "",
- v: "",
- remark: "",
- nodeId: this.jiedianId,
- type: 1,
- });
- console.log(this.nodeInfoTable);
- },
- refreshnfoTable() {
- //刷新表格
- let prams = {
- nodeId: this.jiedianId,
- type: 1,
- projectId: this.projectid,
- };
- this.nodeInfoTableLoad = true;
- refrehPram(prams).then((res) => {
- this.nodeInfoTableLoad = false;
- if (res.data.code == 200) {
- this.$message.success("刷新成功");
- }
- });
- },
- delNodeInfo(key, obj) {
- this.delids.push(obj.id);
- //设置参数名称中的删除按钮
- this.namelists.splice(key, 1);
- },
- delNodeInfoss(key, obj) {
- this.delids.push(obj.id);
- //节点参数
- this.nodeInfoTable.splice(key, 1);
- },
- setNodeParameters() {
- //打开设置节点参数弹框按钮
- this.infoNameVisible = true;
- this.namelists = [...this.namelist];
- },
- async setParameterName() {
- //设置参数名称中添加节点参数按钮
- // wbsId: this.jiedianId
- this.namelists.unshift({
- name: "",
- remark: "",
- k: "",
- type: 0,
- nodeId: this.jiedianId,
- });
- },
- async nodeInfoSave() {
- //节点参数弹框保存按钮
- if (this.nodeInfoTable) {
- // if (this.nodeInfoTable.length == 0) {
- // await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,type:1,delIds:this.delids,wps:[
- // {
- // nodeId: this.jiedianId,
- // type: -1,
- // },
- // ]});
- // this.nodeInfoVisible = false;
- // this.delIds=[];
- // this.$message({
- // type: "success",
- // message: "保存参数节点成功!",
- // });
- // return;
- // }
- console.log(this.namelist);
- let tag = true;
- this.nodeInfoTable.forEach((val) => {
- if (!val.k | !val.v) {
- return (tag = false);
- }
- //if (!val.name) {
- for (let i = 0; i < this.namelist.length; i++) {
- if (this.namelist[i].k == val.k) {
- val.name = this.namelist[i].name;
- return;
- }
- }
- //}
- });
- if (tag) {
- this.nodeInfoSaveload = true;
- await this.saveOrUpdateBatch({
- scopeType: 10,
- projectId: this.projectid,
- nodeId: this.jiedianId,
- wps: this.nodeInfoTable,
- type: 1,
- delIds: this.delids,
- });
- this.delIds = [];
- this.$message({
- type: "success",
- message: "设置参数节点成功!",
- });
- this.nodeInfoSaveload = false;
- this.parameters(this.jiedianId);
- // this.nodeInfoVisible = false;
- } else {
- this.$message({
- type: "error",
- message: "请填写所有的参数名称和参数值!",
- });
- }
- } else {
- this.$message({
- type: "error",
- message: "请先设置参数节点!",
- });
- }
- },
- async addParameterName() {
- //设置参数名称中的保存按钮
- if (this.namelists.length) {
- let tag = true;
- this.namelists.forEach((val) => {
- if (!val.name || !val.k) {
- return (tag = false);
- }
- });
- if (tag) {
- await this.saveOrUpdateBatch({
- scopeType: 10,
- projectId: this.projectid,
- nodeId: this.jiedianId,
- wps: this.namelists,
- type: 0,
- delIds: this.delids,
- }); //保存设置参数
- this.infoNameVisible = false;
- this.delIds = [];
- this.keymap();
- } else {
- this.$message({
- type: "error",
- message: "请填写所有的参数名称和参数值KEY!",
- });
- }
- } else {
- this.$message({
- type: "warning",
- message: "请先添加参数",
- });
- }
- },
- closeParameter() {
- //设置参数名称,关闭按钮
- this.namelists = [];
- this.infoNameVisible = false;
- },
- async parameters(wbsId) {
- //获取接待你参数列表
- const { data: res } = await parameters({ wbsId });
- console.log(res);
- if (res.code == 200) {
- if (Array.isArray(res.data)) {
- this.nodeInfoTable = res.data;
- }
- }
- },
- async saveOrUpdateBatch(da) {
- //保存
- const { data: res } = await saveOrUpdateBatch(da);
- this.delids = [];
- console.log(res);
- },
- async keymap() {
- //节点参数枚举
- const { data: res } = await keymap();
- console.log(res);
- if (res.code == 200) {
- this.namelist = res.data;
- }
- },
- //#endregion
- //#region 调整表单
- adjustExcel(pkeyId, excelId) {
- //调整表单
- this.GLExcelFrom.id = pkeyId;
- this.GLExcelFrom.excelId = excelId;
- this.getExcelHtml(pkeyId);
- },
- async getExcelHtml(pkeyId) {
- const { data: res } = await getExcelHtml({ pkeyId });
- console.log(res);
- if (res.code === 200) {
- localStorage.setItem("excelHtml", res.data);
- this.adjustmentExcel = res.data;
- this.excelHtml = true;
- }
- },
- removeExcel() {
- this.excelHtml = false;
- },
- //#endregion
- //#region 编辑元素
- async rightClick(pkeyId, excelId, id, initTableName, initTableId) {
- await this.getExcelHtml2(pkeyId);
- this.editElementQuery.pkeyId = pkeyId;
- this.editElementQuery.excelId = excelId;
- this.editElementQuery.id = id;
- this.editElementQuery.initTableName = initTableName;
- this.editElementQuery.initTableId = initTableId;
- this.editElementQuery.pid = this.$route.query.pid;
- this.editElementQuery.wbsid = this.$route.query.wbsid;
- this.editElementQuery.nodeid = this.curTreeData.id;
- this.editElementVisible = true;
- },
- async getExcelHtml2(pkeyId) {
- const { data: res } = await getExcelHtml({ pkeyId });
- console.log(res);
- if (res.code === 200) {
- localStorage.setItem("editElement", res.data);
- }
- },
- //#endregion
- //#region 元素表单信息
- editEditElementForm() {
- //标记元素
- if (this.formData.length) {
- let da = [];
- this.formDatass = [...this.formData];
- this.formDatass.forEach((val) => {
- da.push({
- tableType: val.tableType - 0,
- tableOwner: val.tableOwner - 0,
- pkeyId: val.pkeyId,
- tableName: val.tableName,
- fillRate: val.fillRate,
- nodeType: val.nodeType - 0,
- });
- });
- this.formDatass = da;
- this.editElementFormTag = true;
- }else{
- this.$message({
- type: "warning",
- message: "当前列表无数据!",
- });
- }
- },
- editeditElementFormMF() {
- //保存按钮
- let da = [];
- let tag = true;
- this.formDatass.forEach((val) => {
- if (!val.tableName || !val.tableType || !val.tableOwner) {
- tag = false;
- return;
- } else {
- da.push({
- pkeyId: val.pkeyId,
- nodeName: val.tableName,
- tableType: val.tableType,
- tableOwner: val.tableOwner,
- fillRate: val.fillRate,
- nodeType: val.nodeType,
- });
- }
- });
- if (tag) {
- this.updateBatchNodeTableInfo2(da);
- } else {
- this.$message({
- type: "success",
- message: "请填写完整元素表单的所有信息!",
- });
- }
- },
- async updateBatchNodeTableInfo2(da) {
- this.editeditElementFormMFLoading = true;
- //共有编辑元素
- const { data: res } = await updateBatchNodeTableInfo2(da);
- if (res.code == 200) {
- this.editElementFormTag = false;
- this.updateNodeTable();
- this.editeditElementFormMFLoading = false;
- }
- this.editeditElementFormMFLoading = false;
- },
- //#endregion
- //获取节点展开路径
- getExpandedKeys(node) {
- //console.log(node)
- let expandedKeys = [];
- while (node.parent) {
- expandedKeys.push(node.data.id);
- node = node.parent;
- }
- setStore({
- name: this.expandName,
- content: expandedKeys,
- type: true, //sessionStorage
- });
- //console.log(expandedKeys)
- },
- //触发节点参数
- nodeInfoHandle() {
- if (!this.curTreeData.id) {
- this.$message({
- type: "warning",
- message: "请先选择节点",
- });
- return;
- }
- this.nodeInfo(this.curTreeData);
- },
- eleFormulaHandle() {
- if (!this.curTreeData.id || !this.curTreeNode.id) {
- this.$message({
- type: "warning",
- message: "请先选择节点",
- });
- return;
- }
- this.setLeftType(4, this.curTreeData, this.curTreeNode);
- // this.showType = 2;
- },
- editNodeHandle() {
- console.log(this.curTreeData, "this.curTreeData.id ");
- if (!this.curTreeData.id || !this.curTreeNode.id) {
- this.$message({
- type: "warning",
- message: "请先选择节点",
- });
- return;
- }
- this.mixRatioTestIds = [];
- // this.nodeTypeChange(53);
- this.nodeTypeChange(this.curTreeData.nodeType);
- this.dialogTitle = "编辑节点";
- this.setLeftType(2, this.curTreeData, this.curTreeNode);
- },
- addNodeHandle() {
- if (!this.curTreeData.id || !this.curTreeNode.id) {
- this.$message({
- type: "warning",
- message: "请先选择节点",
- });
- return;
- }
- this.mixRatioTestIds = [];
- // this.nodeTypeChange(53);
- this.nodeTypeChange(this.curTreeData.nodeType);
- this.dialogTitle = "新增节点";
- this.setLeftType(1, this.curTreeData, this.curTreeNode);
- },
- copyNodeHandle() {
- if (!this.curTreeData.id || !this.curTreeNode.id) {
- this.$message({
- type: "warning",
- message: "请先选择节点",
- });
- return;
- }
- },
- delNodeHandle() {
- if (!this.curTreeData.id || !this.curTreeNode.id) {
- this.$message({
- type: "warning",
- message: "请先选择节点",
- });
- return;
- }
- if (this.curTreeNode.level == 1) {
- this.$message({
- type: "warning",
- message: "当前节点无法删除",
- });
- return;
- }
- this.deleNode(this.curTreeData, this.curTreeNode);
- },
- eleHandle() {
- if (!this.curTreeData.id || !this.curTreeNode.id) {
- this.$message({
- type: "warning",
- message: "请先选择节点",
- });
- return;
- }
- this.setLeftType(5, this.curTreeData, this.curTreeNode);
- },
- syncInfoHandle(item) {
- if (this.curTreeData.primaryKeyId || this.curTreeData.pKeyId) {
- this.$confirm("是否同步节点参数?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- this.syncBtnLoad = true;
- this.menuoptions.forEach((ele) => {
- if (item.value == ele.value) {
- ele.load = true;
- }
- });
- let pid = this.curTreeData.primaryKeyId
- ? this.curTreeData.primaryKeyId
- : this.curTreeData.pKeyId;
- syncNodeParam(this.projectid, pid)
- .then(() => {
- this.$message({
- type: "success",
- message: "同步成功!",
- });
- })
- .finally(() => {
- this.syncBtnLoad = false;
- this.menuoptions.forEach((ele) => {
- if (item.value == ele.value) {
- ele.load = false;
- }
- });
- });
- });
- } else {
- this.$message.warning("请先选择左侧节点");
- }
- },
- //显示别名弹窗
- aliasShow() {
- this.aliasVisible = true;
- if (this.nodeDetail.fullName) {
- this.aliasArr = this.nodeDetail.fullName.split(",");
- } else {
- this.aliasArr = [];
- }
- this.aliasInput = "";
- },
- addAlias() {
- if (this.aliasInput) {
- this.aliasArr.push(this.aliasInput);
- this.aliasInput = "";
- }
- },
- delAlias(index) {
- this.aliasArr.splice(index, 1);
- },
- saveAliasHandle() {
- this.nodeDetail.fullName = this.aliasArr.join(",");
- if (this.editType == 1) {
- //新增
- this.aliasVisible = false;
- } else if (this.editType == 2) {
- //编辑 私有
- privateSubmitFullName(
- this.nodeDetail.pKeyId,
- this.nodeDetail.fullName
- ).then(() => {
- this.$message({
- type: "success",
- message: "保存成功",
- });
- this.aliasVisible = false;
- });
- }
- },
- async syncNodeTableHandle(data) {
- this.isAdd=''
- console.log('后管数据同步',data);
- this.curTreeData=data
- this.isShowLeft=false
- // await this.getNodeStatusData()
- if(this.syncListDialog){
- return
- }
- this.syncForm.range='1'
-
-
-
- this.proSyncTag=true
- if(this.$refs.syncProTree){
- this.$refs.syncProTree.setCheckedKeys([])
- }
- if(this.$refs.proTable){
- this.$refs.proTable.clearSelection()
- }
- this.isShowTable=true
- this.getTypeOptions()
- this.getRangeOptions()
- this.getCheckIdList()
- this.getTempProjectList(data.primaryKeyId)
-
- },
- syncProjectHandle(data) {
- this.$confirm("是否同步节点【" + data.title + "】到合同段?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- let notify = this.$notify({
- title: "提示",
- message: "节点数据同步中...",
- duration: 0,
- });
- let pid = data.primaryKeyId ? data.primaryKeyId : data.pKeyId;
- syncNodeinfo(pid)
- .then(() => {
- this.updateNodeTable();
- this.$message({
- type: "success",
- message: "同步成功",
- });
- })
- .catch(() => {
- this.$message({
- type: "error",
- message: "同步失败",
- });
- })
- .finally(() => {
- notify.close();
- });
- });
- },
- //同步元素表单排序到合同段
- async syncSortHandle(data) {
- console.log('同步到合同');
- this.isShowLeft=false
- this.curTreeData=data
-
- if(this.syncListDialog){
- return
- }
- // await this.getNodeStatusData()
- this.syncForm.range='2'
-
- this.proSyncTag=true
-
- this.isShowTable=true
- this.getTypeOptions()
- this.getRangeOptions()
-
- this.getCheckIdList()
- selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
- if (res.data.data.length>0) {
- this.preTableData = res.data.data;
- } else {
- this.preTableData = [];
- }
- });
-
- },
- typeTreeLoadNode(node, resolve) {
- let pid = 0;
- if (node.level != 0) {
- pid = node.data.id;
- }
- tabTypeLazyTree(pid, this.projectid).then((res) => {
- let arr = [];
- if (Array.isArray(res.data.data)) {
- arr = res.data.data;
- }
- return resolve(arr);
- });
- },
- getTypeTreeDetail() {},
- independent() {
- this.$router.push({
- path: "/project/independent",
- query: {
- pid: this.projectid,
- wbsid: this.$route.query.wbsid,
- wbsType: this.wbsType,
- },
- });
- },
- archiveTimeClick() {
- this.$router.push({
- path: "/project/archiveTime",
- query: { pid: this.projectid, wbsid: this.$route.query.wbsid },
- });
- },
- syncElectric(item) {
- if (this.curTreeData.primaryKeyId || this.curTreeData.pKeyId) {
- console.log("同步电签默认信息");
- this.$confirm("是否同步电签默认信息?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- this.syncElectricLoad = true;
- this.menuoptions.forEach((ele) => {
- if (item.value == ele.value) {
- ele.load = true;
- }
- });
- let pid = this.curTreeData.primaryKeyId
- ? this.curTreeData.primaryKeyId
- : this.curTreeData.pKeyId;
- syncProjecteVisa(this.projectid, pid)
- .then(() => {
- this.$message({
- type: "success",
- message: "同步成功!",
- });
- })
- .finally(() => {
- this.syncElectricLoad = false;
- this.menuoptions.forEach((ele) => {
- if (item.value == ele.value) {
- ele.load = false;
- }
- });
- });
- });
- } else {
- this.$message.warning("请先选择左侧节点");
- }
- },
- //节点参数 关联元素
- linkEle(row) {
- console.log(row, "row");
- if (!row.id) {
- this.$message.warning("请先保存数据,再点击关联元素");
- } else {
- this.linkEleVisible = true;
- this.curParam = row;
- getParamElements({
- nodeId: this.curTreeData.id,
- projectId: this.projectid,
- paramId: row.id,
- scopeType: 10,
- }).then((res) => {
- if (res.data.data.length) {
- this.linkEleTableList = res.data.data;
- } else {
- this.linkEleTableList = [];
- }
- });
- }
- },
- //关联元素弹框
- tolinkEle(row) {
- this.curLinkEleTable = row;
- this.linkCheckVisible = true;
- let pid = this.curTreeData.primaryKeyId
- ? this.curTreeData.primaryKeyId
- : this.curTreeData.pKeyId;
- selectFormElements(row.id, { type: 3, nodeId: pid }).then((res) => {
- res.data.data.forEach((ele) => {
- ele.checked = false;
- ele.show = true;
- });
- this.linkEleList = res.data.data;
- this.linkEleListAll = [].concat(this.linkEleList);
- });
- },
- //删除关联
- delLink(data) {
- this.$confirm("删除关联, 是否继续?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- console.log(data);
- delParamElements(data).then(() => {
- this.$message({
- type: "success",
- message: "删除成功!",
- });
- getParamElements({
- nodeId: this.curTreeData.id,
- projectId: this.projectid,
- paramId: this.curParam.id,
- scopeType: 10,
- }).then((res) => {
- if (res.data.data.length) {
- this.linkEleTableList = res.data.data;
- } else {
- this.linkEleTableList = [];
- }
- });
- });
- })
- .catch(() => {});
- },
- //筛选元素
- searchEle() {
- this.linkEleList = this.linkEleListAll.filter((ele) => {
- return ele.eName.indexOf(this.linkEleKey) > -1;
- });
- },
- linkEleCheck(value, index) {
- //console.log(value)
- if (value) {
- this.linkEleList.forEach((ele, i) => {
- if (i != index) {
- ele.checked = false;
- }
- });
- }
- },
- //关联元素
- saveLinkEle() {
- let target = {};
- this.linkEleList.forEach((e) => {
- if (e.checked == true) {
- target = { elementId: e.id, paramId: this.curParam.id };
- }
- });
- if (JSON.stringify(target) !== "{}") {
- specifiedParamElements(target).then((data) => {
- this.linkCheckVisible = false;
- getParamElements({
- nodeId: this.curTreeData.id,
- projectId: this.projectid,
- paramId: this.curParam.id,
- scopeType: 10,
- }).then((res) => {
- if (res.data.data.length) {
- this.linkEleTableList = res.data.data;
- } else {
- this.linkEleTableList = [];
- }
- });
- });
- } else {
- this.$message.warning("请先选择关联元素");
- }
- },
- //树形控件菜单相关方法
- mouseout() {
- this.menuvisible = false;
- },
- //展示菜单
- showMenu(e, data, node) {
- e.preventDefault();
- console.log(e, "e");
- var x = e.pageX; //这个应该是相对于整个浏览器页面的x坐标,左上角为坐标原点(0,0)
- var y = e.pageY; //这个应该是相对于整个浏览器页面的y坐标,左上角为坐标原点(0,0)
- this.menutop = y;
- this.menuleft = x;
- this.menuvisible = true;
- },
- menuClick(e, item, data) {
- e.preventDefault();
- if (item.key === "sort") {
- this.sortpai(data);
- } else if (item.key === "sync1") {
- this.syncNodeTableHandle(data);
- } //
- else if (item.key === "sync3") {
- this.syncSortHandle(data);
- } else if (item.key === "add") {
- this.addNodeHandle();
- } else if (item.key === "edit") {
- this.editNodeHandle();
- } else if (item.key === "del") {
- this.delNodeHandle();
- } else if (item.value === "jdSync") {
- this.syncInfoHandle(item);
- } else if (item.value === "gsSync") {
- this.$message({
- type: "info",
- message: "暂无相关接口!",
- });
- } else if (item.value === "dqSync") {
- this.syncElectric(item);
- }
- },
- //展示数据同步下拉框
- showSyncbtn() {
- this.isshowSyncbtn = !this.isshowSyncbtn;
- },
- getDictTypelist() {
- if (this.dynamicDictList.length > 1) {
- return;
- }
- getDictionary({
- code: "land_field_dict",
- }).then((res) => {
- res.data.data.forEach((element) => {
- element.dictKey = Number(element.dictKey);
- });
- this.dynamicDictList = res.data.data;
- const filteredList = this.dynamicDictList.filter(
- (item) => item.dictKey === 600 || item.dictKey === 0
- );
- this.dynamicDictList = filteredList;
- });
- },
- getSelectFormElements(id) {
- this.editEleTableloading = true;
- selectFormElements(this.curEleTable.pkeyId, {
- type: 0,
- search: this.searchinput,
- }).then((res) => {
- this.editEleTableloading = false;
- this.editTable = res.data.data;
- });
- },
- //编辑
- handleEdit(index, row) {
- this.curEleTable = row;
- this.getSelectFormElements();
- this.editDialogShow = true;
- this.getDictTypelist();
- },
- //编辑元素信息(请谨慎操作)
- clearsearchinput() {
- this.getSelectFormElements();
- },
- searchinputChange() {
- this.getSelectFormElements();
- },
- saveEles() {
- if (this.editTable.length > 0) {
- this.saveLoading = true;
- updateBatchElements(
- this.editTable,
- this.curEleTable.initTableName
- ).then(() => {
- this.saveLoading = false;
- this.editDialogShow = false;
- this.updateNodeTable();
- this.$message({
- type: "success",
- message: "保存成功!",
- });
- });
- } else {
- this.editDialogShow = false;
- this.updateNodeTable();
- this.$message({
- type: "success",
- message: "保存成功!",
- });
- }
- },
- //文件题名(全局按钮)
- fileTitleHandle(){
- this.getFileTableData()
- this.fileTitleVisible = true;
- },
- changeRadio(val){
- console.log(val,'val');
- const fileItem = this.fileTableData[this.chooseFileIndex];
- this.$set(fileItem, 'type', val);
- },
- //获取文件题名规则
- getFileTableData(){
- this.fileTableLoading=true
- getNameRule(
- { projectId:this.projectid}
- ).then((res) => {
- this.fileTableLoading=false
- if(res.data.data){
- this.fileTableData = res.data.data;
- this.fileTableData.forEach((element) => {
- element.roleNameVal = element.nameRule.split(",");
- element.ruleName=element.nameVaule.split("-")
- if(element.type===2){
- const list=element.list
- let arr=[]
- let arrId=[]
- list.forEach((ele) => {
- arr.push(ele.nodeName)
- arrId.push(ele.nodeId)
- });
- element.ruleSizeVal = arr.join('、');
- element.ruleSizeValId=arrId
- }else{
- element.ruleSizeVal=''
- element.ruleSizeValId=''
- }
- });
- }else{
- this.fileTableData =[]
- }
- });
- },
- //获取文件题名范围
- getTitleRangeData(row){
- this.fileTreeLoading=true
- getTitleRange(
- { projectId:this.projectid,
- nameId:row.nameId,
-
- }
- ).then((res) => {
- this.fileTreeLoading=false
- if(res.data.data){
- this.fileTreeData = res.data.data;
-
-
- // this.deCheckTreeKeys = this.fileTreeData.filter(node => node.status === 11).map(node => node.id);
-
- }else{
- this.fileTreeData =[]
- }
- });
- },
- //选择题名范围
- chooseFile(index,row){
- const {ruleName}=row
- if(ruleName&&ruleName.length>0){
- this.chooseFileVisible = true;
- this.chooseFileIndex= index;
- this.deCheckTreeKeys=row.ruleSizeValId
- this.getTitleRangeData(row)
- }else{
- this.$message.warning('请先选择文件题名规则');
- }
-
-
- },
- checkFileSize(data,{checkedNodes,checkedKeys}){
- let checkedTitles = checkedNodes.map(node => node.nodeName).join('、');
- this.fileTableData[this.chooseFileIndex].isEdit1=false
- const fileItem = this.fileTableData[this.chooseFileIndex];
- this.$set(fileItem, 'ruleSizeVal', checkedTitles);
- this.$set(fileItem, 'ruleSizeValId', checkedKeys);
- this.deCheckTreeKeys=checkedKeys
-
- },
- getCheckedNodes (treeData, checkedKeys) {
-
- let result = []
- treeData.forEach(node => {
- if (checkedKeys&&checkedKeys.includes(node.id)) {
- result.push(node)
- }
- if (node.children) {
- result = result.concat(getCheckedNodes(node.children, checkedKeys))
- }
- })
- return result
- },
- saveFileSize(){
- // const checkedNodes = this.getCheckedNodes(this.fileTreeData, this.deCheckTreeKeys).filter(node => node.status !== 11)
- const checkedNodes = this.getCheckedNodes(this.fileTreeData, this.deCheckTreeKeys)
- this.fileTableData[this.chooseFileIndex].ruleSizeValId = checkedNodes.map(node => node.id)
- this.fileTableData[this.chooseFileIndex].ruleSizeVal = checkedNodes.map(node => node.nodeName).join('、')
- this.chooseFileVisible = false;
- this.isShowSize=false
- setTimeout(()=>{
- this.isShowSize=true
- },100)
- },
- editRow(index,row){
- console.log(row,'row');
-
- this.$set(row, "isEdit", true);
- this.$set(row, "isEdit1", true);
- this.fileTitleModel.type=row.type
- },
- //保存文件题名
- saveRow(index,row){
- if(row.ruleName.length<1){
- this.$message.warning('请选择文件题名规则')
- return
- }
- if(!row.type){
- this.$message.warning('请选择文件题名范围')
- return
- }
- this.$set(row, "isEdit", false);
- this.$set(row, "isEdit1", false)
- const ruleName=row.ruleName.join('-')
- let ruleSizeVal=''
- if(row.type==1){
- ruleSizeVal=''
- }else{
- ruleSizeVal=row.ruleSizeValId.join(',')
- }
-
- let nameRuleDtos={
- nameId:row.nameId,
- nameRule:ruleName,
- nodeId:ruleSizeVal,
- projectId:this.projectid,
- type:this.fileTitleModel.type
- }
- saveOrUpdateNameRule(
- [nameRuleDtos]
- ).then((res) => {
- if(res.data.code==200){
- this.$message.success(res.data.msg)
- this.getFileTableData()
- }else{
- this.$message.error(res.data.msg)
- }
- });
- },
- changeRoleName(data,row){
- const originalData=this.nodeTypelist
- const dictKeyToDictValueMap = originalData.reduce((acc, item) => {
- acc[item.dictKey] = item.dictValue;
- return acc;
- }, {});
- const result = data.map(dictKey => dictKeyToDictValueMap[dictKey]);
- this.$set(row, "roleNameVal", result);
- this.selectDiv=Math.random()
- },
- addRow(){
- this.fileTableData.unshift({isEdit:true,isEdit1:true,})
- this.fileTitleModel.type=''
- },
- refreshRow(){
- this.getFileTableData()
- },
- delRow(index,row){
- if(!row.nameId){
- this.fileTableData.splice(index,1)
- }else{
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return deletedNameRule(
- {nameId:row.nameId}
- ).then((res) => {
- if(res.data.code==200){
- this.$message.success(res.data.msg)
- this.getFileTableData()
- }else{
- this.$message.error(res.data.msg)
- }
- });
- });
- }
-
- },
- batchsaveFileSize(){
- let isCansave=true
- let saveArr=[]
- this.fileTableData.forEach((ele)=>{
- if(ele.ruleName.length<1||!ele.type){
- this.$message.warning('请先完善相关信息')
- isCansave=false
- return
- }
- let ruleSizeVal=''
- if(ele.type==1){
- ruleSizeVal=''
- }else{
- ruleSizeVal=ele.ruleSizeValId.join(',')
- }
- const ruleName=ele.ruleName.join('-')
- saveArr.push({
- nameId:ele.nameId||'',
- nameRule:ruleName,
- nodeId:ruleSizeVal,
- projectId:this.projectid,
- type:ele.type
- })
- })
- if(!isCansave){
- return
- }
- this.saveFileLoading=true
- saveOrUpdateNameRule(
- saveArr
- ).then((res) => {
- this.saveFileLoading=false
- if(res.data.code==200){
- this.$message.success(res.data.msg)
- this.getFileTableData()
- }else{
- this.$message.error(res.data.msg)
- }
- });
-
- },
- async proSyncbtn(){
- console.log('项目数据同步');
- this.isAdd=''
- this.getTypeOptions()
- this.getRangeOptions()
- this.getCheckIdList()
- this.proSyncTag=true
- if(this.$refs.syncProTree){
- this.$refs.syncProTree.setCheckedKeys([])
- }
- if(this.$refs.proTable){
- this.$refs.proTable.clearSelection()
- }
- this.isShowLeft=true
- this.isShowTable=false
- },
- getRangeOptions(){
- getDictionary({
- code: "wbs_snyc_range",
- }).then((res) => {
- this.rangeOptions = res.data.data;
- });
- },
- getTypeOptions(){
- getDictionary({
- code: "wbs_sync_type",
- }).then((res) => {
- this.typeOptions = res.data.data;
- });
- },
- handleCheckChange1(data){
- console.log(data,'data1111111111');
-
- getNodeStatus({ id:data.primaryKeyId}).then((res) => {
- if(res.data.code==200){
- if(res.data.data){
- this.$message.success('该节点有同步任务,请取消选择')
- }
- }else{
- this.$message.error(res.data.msg)
- }
- });
- },
- async handleCheckChange(_,{checkedKeys,halfCheckedNodes}) {
- let ids=checkedKeys && checkedKeys.length ? checkedKeys.join(',') : ''
- // await this.getNodeStatusData()
- this.getTempProjectList(ids)
- },
- async getTempProjectList(ids){
- if(ids.length>0){
- //分页获取证书列表数据
- const { data: res } = await getTempProject({
- nodeIds:ids
- });
- if (res.code == 200) {
- this.templateIdList = res.data;
-
- }
- }
-
- },
- async changeTemplateId(val){
- if(!this.isShowTable){
- return
- }
-
- let type=''
- let projectId=''
- let wbsId=''
- for (let index = 0; index < this.templateIdList.length; index++) {
- const elemet = this.templateIdList[index];
- if(elemet.id==val){
- type = elemet.type;
- this.typeTem=elemet.type
- projectId=elemet.id
- wbsId=elemet.wbsId
-
- break
- }
- }
- if(type===2){
- selectByNodeTable(this.curTreeData.id, projectId, wbsId).then((res) => {
- if (res.data.data&&res.data.data.length > 0) {
- this.preTableData = res.data.data;
- } else {
- this.preTableData = [];
- }
- });
- }else{
- const { data: res } = await findNodeTableByCondition1( this.curTreeData.id )
- if (res.code === 200) {
- console.log(Array.isArray(res.data));
- if (Array.isArray(res.data)) {
- this.preTableData = res.data
-
- } else {
- this.preTableData = []
- }
- }
- }
-
- },
- async getCheckIdList(){
- let code=this.wbsType!==1?'wbs_sync_contract_range':'wbs_sync_contract_quality'
- getDictionary({
- code: code,
- }).then((res) => {
- this.checkIdList = res.data.data;
- });
- },
-
- closeProSyncTag(){
- this.proSyncTag=false
- this.syncForm={
- range:'',
- rangeName:'',
- type:[],
- typeName:'',
- templateId:'',
- templateName:'',
- contractRange:[],
- contractRangeName:'',
- nodeId:'',
- formIds:''};
-
-
- this.preTableData=[]
- this.isShowLeft=false
-
-
- },
- async saveProTag(){
- this.syncForm.projectId=this.projectid
- if(this.isShowLeft){
- let ids=this.$refs.syncProTree.getCheckedKeys()
- this.syncForm.nodeId=ids.join(',')
- if(this.syncForm.nodeId===''){
- this.$message.warning('请选择节点')
- return
- }
- }else{
- this.syncForm.nodeId=this.curTreeData.primaryKeyId
- }
- // await this.getNodeStatusData()
- if(this.syncListDialog){
- return
- }
-
- if(this.syncForm.rangeName==''){
- for (let index = 0; index < this.rangeOptions.length; index++) {
- const element =this. rangeOptions[index];
- if(element.dictKey==this.syncForm.range){
- this.syncForm.rangeName=element.dictValue
- break
- }
-
- }
- }
- console.log(this.syncForm.range,'this.syncForm.range=');
-
- if(this.syncForm.range===''){
- this.$message.warning('请选择同步范围')
- return
- }
- this.saveProTagLoading=true
- addSync({
- ...this.syncForm,
- type:this.syncForm.type.join(','),
- contractRange:this.syncForm.contractRange.join(',')
- }
- ).then((res) => {
- console.log(res,'res');
-
- this.saveProTagLoading=false
- if(res.data.code==200){
- this.$message.success(res.data.msg)
- //this.getNodeStatusData()
- console.log(res.data,'res.data');
-
-
- this.syncListData.nodeNum=res.data.data.nodeNum
- this.syncListData.nodeNumEnd=res.data.data.nodeNumEnd
-
-
- if(this.isShowLeft){
- this.isAdd=res.data.data.id
- }else{
- this.isAdd=''
- }
- this.syncListDialog=true
- this.closeProSyncTag()
-
-
- }else{
- this.$message.error(res.data.msg)
- this.saveProTagLoading=false
-
-
- }
- })
- .finally(() => {
- this.saveProTagLoading = false;
- });
- },
- closeSyncListTag(){
- this.syncListDialog=false;
- this.updateNodeTable()
- },
- handleCheckAllChange(val) {
- this.syncForm.type = val ? this.typeOptions.map(item => item.dictKey) : [];
- this.isIndeterminate = false;
- },
- handleCheckAllChange1(val) {
- this.syncForm.contractRange = val ? this.checkIdList.map(item => item.dictKey) : [];
- this.isIndeterminate1 = false;
- },
- handleCheckedTypeChange(value){
- let checkedCount = value.length;
- this.checkAll = checkedCount === this.typeOptions.length;
- this.isIndeterminate = checkedCount > 0 && checkedCount < this.typeOptions.length;
- },
- handleCheckedTypeChange1(value){
- let checkedCount = value.length;
- this.checkAll1 = checkedCount === this.checkIdList.length;
- this.isIndeterminate1 = checkedCount > 0 && checkedCount < this.checkIdList.length;
- },
- handleSelectionChange(val) {
- let arr = []
- if(val.length>0){
- for (let index = 0; index < val.length; index++) {
- let i = val[index];
- if( this.typeTem===2){
- arr.push(i.pkeyId)
- }else{
- arr.push(i.id)
- }
-
- // arr.push(i.id)
- }
- this.syncForm.formIds=arr.join(',')
- }
- },
- async handleCommand(command,row){
- // await this.getNodeStatusData()
- if(this.syncListDialog){
- return
- }
- this.checkRow=row
- if(command==='a'){
- this.$confirm("当前表单配置将同步到项目下所有相同表单,请谨慎同步!!!!!!", "表单同步提醒", {
- distinguishCancelAndClose: true,
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- }).then(() => {
- addSync({
- projectId:this.projectid,
- range:'3',
- nodeId:row.pkeyId,
- nodeName:this.curTreeData.title,
-
- }
- ).then((res) => {
-
- if(res.data.code==200){
- this.$message.success(res.data.msg)
-
-
- }else{
- this.$message.error(res.data.msg)
- }
- })
-
- });
- }else if(command==='b'){
-
-
- this.syncTableDialog=true
- this.isShowLeft=true
- if(this.$refs.proTable1){
- this.$refs.proTable1.clearSelection()
- }
-
- }
-
- },
- saveTableSync(){
- this.saveTableSyncLoad=true
- addSync({
- projectId:this.projectid,
- range:'4',
- nodeId:this.checkRow.pkeyId,
- nodeName:this.curTreeData.title,
- formIds:this.formIds,
-
-
- }
- ).then((res) => {
- this.saveTableSyncLoad=false
- if(res.data.code==200){
- this.$message.success(res.data.msg)
- this.syncTableDialog=false
- this.$refs.proTable1.clearSelection()
- this.updateNodeTable()
-
- }else{
- this.$message.error(res.data.msg)
- }
- })
- this.saveTableSyncLoad=false
- },
- handleNodeClick(data) {
-
- selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
- if (res.data.data.length) {
- this.preTableData1 = res.data.data;
- } else {
- this.preTableData1 = [];
- }
- });
-
- },
- handleSelectionChange1(val) {
-
- if (val.length > 1) {
- // 如果选择了多个,只保留最后一个
- this.$nextTick(() => {
- this.$refs.proTable1.clearSelection();
- this.$refs.proTable1.toggleRowSelection(val.pop());
- });
- }
- if(val.length>0){
- this.formIds=val[0].pkeyId
- }else{
- this.formIds=''
- }
-
-
- },
- async refreshData(){
- this.refreshLoading=true
- getNodeStatus({ id:this.curTreeData.primaryKeyId}).then((res) => {
- this.refreshLoading=false
- if(res.data.code==200){
- if(res.data.data){
-
- this.syncListData.nodeNum=res.data.data.nodeNum
- this.syncListData.nodeNumEnd=res.data.data.nodeNumEnd
-
- }else{
-
- this.syncListData={
- nodeNum:'',//同步节点数量
- nodeNumEnd:''//已同步数量
- }
-
- }
-
- }else{
-
- this.syncListData={
- nodeNum:'',//同步节点数量
- nodeNumEnd:''//已同步数量
- }
- this.$message.error(res.data.msg)
- }
- }).finally(() => {
- this.refreshLoading = false;
- });
-
-
- },
- refreshData1(){
- console.log('shuax');
-
- this.refreshLoading1=true
- getById({ id:this.isAdd}).then((res) => {
- this.refreshLoading1=false
- if(res.data.code==200){
- if(res.data.data){
-
- this.syncListData.nodeNum=res.data.data.nodeNum
- this.syncListData.nodeNumEnd=res.data.data.nodeNumEnd
-
- }else{
-
- this.syncListData={
- nodeNum:'',//同步节点数量
- nodeNumEnd:''//已同步数量
- }
-
- }
-
- }else{
-
- this.syncListData={
- nodeNum:'',//同步节点数量
- nodeNumEnd:''//已同步数量
- }
- this.$message.error(res.data.msg)
- }
- });
-
- },
- getNodeStatusData(){
-
- let ids=''
- if(this.isShowLeft){
- ids=this.$refs.syncProTree.getCheckedKeys()
- ids=ids.join(',')
- }
- else{
- ids=this.curTreeData.primaryKeyId
- }
- getNodeStatus({ id:ids}).then((res) => {
- if(res.data.code==200){
- if(res.data.data){
-
- this.syncListData.nodeNum=res.data.data.nodeNum
- this.syncListData.nodeNumEnd=res.data.data.nodeNumEnd
- this.syncListDialog=true
- }else{
-
- this.syncListData={
- nodeNum:'',//同步节点数量
- nodeNumEnd:''//已同步数量
- }
- this.syncListDialog=false
- }
-
- }else{
- this.syncListDialog=false
- this.syncListData={
- nodeNum:'',//同步节点数量
- nodeNumEnd:''//已同步数量
- }
- this.$message.error(res.data.msg)
- }
- });
- },
- //基础数据管理
- handleBasicClick(command) {
-
- if (command === "code") {
- this.codeDialog = true;
-
- this.$refs.codeSetRef.show(this.projectid)
- }else if(command === "rule") {
- this.$router.push({
- path: "/rule/manager",
- query: {
- id: this.id,
- parentId:this.nodeDetail.parentId,
- tenant_id: this.userInfo.tenant_id,
- projectid: this.projectid,
- },
-
- });
- }
- }
- },
- watch: {
- "GLExcelFrom.search"(val) {
- console.log(val);
- if (this.exceldata) {
- this.$refs.tree.filter(val);
- }
- },
- 'syncForm.contractRange': {
- handler(newVal) {
- if (newVal && newVal.length) {
- const selectedValues = newVal.map(key => {
- const item = this.checkIdList.find(item => item.dictKey === key);
- return item ? item.dictValue : key;
- });
- this.syncForm.contractRangeName = selectedValues.join(',');
- } else {
- this.syncForm.contractRangeName = '';
- }
- },
- immediate: true
- },
- 'syncForm.templateId': {
- handler(newVal) {
-
- if (newVal && newVal.length) {
- for (let index = 0; index < this.templateIdList.length; index++) {
- const elemet = this.templateIdList[index];
- if(elemet.id==newVal){
- this.syncForm.templateName = elemet.name;
- break
- }
- }
- } else {
- this.syncForm.rangeName = '';
- }
- },
- immediate: true
- },
- 'syncForm.type': {
- handler(newVal) {
- if (newVal && newVal.length) {
- const selectedValues = newVal.map(key => {
- const item = this.typeOptions.find(item => item.dictKey === key);
- return item ? item.dictValue : key;
- });
- this.syncForm.typeName = selectedValues.join(',');
- } else {
- this.syncForm.typeName = '';
- }
- },
- immediate: true
- },
- 'syncForm.range': {
- handler(newVal) {
- console.log(newVal,'newVal');
-
- if (newVal && newVal.length) {
- for (let index = 0; index < this.rangeOptions.length; index++) {
- const elemet = this.rangeOptions[index];
- if(elemet.dictKey==newVal){
- this.syncForm.rangeName = elemet.dictValue;
- break
- }
- }
- } else {
- this.syncForm.rangeName = '';
- }
- },
- immediate: true
- },
- },
- components: {
- dynamicExcel,
- ManualSorting,
- FormulaEdit,
- EditElement,
- FormulaEditone,
- CodeSet
- },
- };
- </script>
- <style scoped lang="scss">
- .font-s-12 ::v-deep .iconfont {
- font-size: 12px;
- }
- .el-popper[x-placement^="bottom"] {
- margin-top: -6px;
- }
- .right-btn {
- position: absolute;
- right: 20px;
- top: 10px;
- font-size: 20px;
- }
- .custom-tree-node {
- .normal-black {
- display: none;
- }
- &:hover {
- .normal-black {
- display: inline-block;
- }
- }
- &.show .normal-black {
- display: inline-block;
- }
- }
- .excelBox {
- ::v-deep .el-dialog__body {
- padding: 20px;
- }
- }
- //调整表单样式
- .excelHtml {
- position: absolute;
- z-index: 999999;
- top: 50px;
- left: 0px;
- width: 100%;
- height: 100%;
- }
- .jiedian {
- ::v-deep .el-dialog__body {
- padding: 10px 20px !important;
- }
- }
- .filter-tree {
- min-width: 100%;
- display: inline-block;
- }
- .full-dialog {
- ::v-deep .el-dialog__body {
- padding-bottom: 0;
- padding-top: 0;
- }
- ::v-deep .basic-container {
- height: calc(100vh - 60px);
- }
- }
- .my-basic-con {
- padding: 6px 6px;
- }
- // 树形控件菜单样式
- .contextmenu {
- margin: 0;
- background: #fff;
- z-index: 1000;
- position: fixed; //关键样式设置固定定位
- list-style-type: none;
- padding: 5px 0;
- border-radius: 4px;
- font-size: 12px;
- font-weight: 400;
- color: #333;
- box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
- }
- .contextmenu li {
- margin: 0;
- padding: 7px 16px;
- cursor: pointer;
- }
- .contextmenu li:hover {
- background: #eee;
- }
- .selectBtn {
- position: absolute;
- top: 50px;
- right: 585px;
- z-index: 1000;
- width: 140px;
- text-align: left;
- }
- .titlerow {
- // float: right;
- background-color: rgba(31, 34, 41, 0.8);
- // width:104%;
- padding-left: 10px;
- padding-right: 10px;
- text-align: right;
- margin-top: -20px;
- margin-left: -20px;
- margin-right: -20px;
- }
- .dialog-title{
- display: flex;
- }
- .dialog-title-text{
- flex: 0.4;
- padding-left: 10px;
- }
- .dialog-title-tip{
- flex: 0.6;
- // position: absolute;
- color:rgba(255, 125, 67, 1);
- padding-left: 40px;
- // right: 60px;
- }
- .sync-container{
- margin-top: -30px;
- display: flex;
- height: 570px;
- .box-card-1{
- margin-right: 10px;
- height: 100%;
- overflow-y: auto;
- }
- .box-card-2{
- flex: 1;
- height: 100%;
- overflow-y: auto;
- .el-form-item {
- border: 1px solid #dcdfe6;
- padding: 0 10px 10px 10px;
- border-radius: 4px;
- font-weight: bold;
- .el-form-item__label {
- font-weight: bold;
- padding-bottom: 0px;
- }
- .el-form--label-top .el-form-item__label{
- padding: 0px !important;
- }
- }
-
- }
- }
- .content-box{
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- font-weight: bolder;
- .mt-14{
- margin-top: 14px;
- }
- }
- </style>
- <style lang="scss">
- .el-dialog.hc-link-nodes-dialog {
- width: 500px;
- margin-top: 50px !important;
- height: calc(100% - 100px);
- .el-dialog__body {
- height: calc(100% - 154px);
- border-top: 1px solid #eee;
- border-bottom: 1px solid #eee;
- padding: 14px;
- overflow: auto;
- }
- }
- .el-tree.hc-link-nodes-tree .el-tree-node .el-tree-node__content {
- .el-checkbox {
- display: none;
- }
- .is-leaf + .el-checkbox {
- display: inline-block;
- }
- }
- .warning-text{
- color: orange;
- font-weight: bold;
- }
- .orange {
- color: orange;
- }
- .box-card-2{
- .el-form-item {
- .el-form-item__content {
- line-height: 10px !important;
- margin-top: -10px !important;
- }
- }
- }
- </style>
|