tree.vue 88 KB

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