tree.vue 141 KB

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