tree.vue 128 KB

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