tree.vue 151 KB

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