tree.vue 132 KB

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