tree.vue 107 KB

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