tree.vue 92 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134
  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. v-loading="GLExcelLoading"
  687. >
  688. </el-tree>
  689. </el-scrollbar>
  690. </div>
  691. <span
  692. slot="footer"
  693. class="dialog-footer"
  694. style="display: flex;justify-content: center;align-items: center;"
  695. >
  696. <el-button @click="GLExcelMD()">取 消</el-button>
  697. <el-button
  698. style="margin-left:30px;"
  699. type="primary"
  700. v-throttle='2000'
  701. @click="saveLinkTab()"
  702. >确 定</el-button>
  703. </span>
  704. </el-dialog>
  705. <el-dialog
  706. :title="dialogTitle"
  707. :visible.sync="dialogVisible"
  708. width="50%"
  709. append-to-body
  710. :close-on-click-modal="false"
  711. @closed="saveNodeLoading = false"
  712. >
  713. <el-form
  714. ref="nodeDetail"
  715. :model="nodeDetail"
  716. :rules="rules"
  717. label-width="140px"
  718. >
  719. <el-form-item
  720. label="节点名称"
  721. prop="nodeName"
  722. >
  723. <div class="flex">
  724. <el-input v-model="nodeDetail.nodeName"></el-input>
  725. <el-button class="mg-l-10" type="primary" @click="aliasShow">添加别名</el-button>
  726. </div>
  727. </el-form-item>
  728. <el-form-item label="上级节点">
  729. <el-input
  730. v-model="nodeDetail.parentName"
  731. ></el-input>
  732. </el-form-item>
  733. <el-form-item
  734. label="节点类型"
  735. prop="nodeType"
  736. >
  737. <el-select
  738. v-model="nodeDetail.nodeType"
  739. disabled
  740. placeholder="请选择"
  741. class="w-100p"
  742. @change="nodeTypeChange"
  743. >
  744. <el-option
  745. v-for="item in nodeTypelist"
  746. :key="item.id"
  747. :label="item.dictValue"
  748. :value="item.dictKey"
  749. ></el-option>
  750. </el-select>
  751. </el-form-item>
  752. <el-form-item label="划分编号" v-if="wbsType !== 2">
  753. <el-input v-model="nodeDetail.partitionCode"></el-input>
  754. </el-form-item>
  755. <el-form-item label="唯一编码">
  756. <el-input v-model="nodeDetail.uniqueCode"></el-input>
  757. </el-form-item>
  758. <template v-if="nodeDetail.nodeType == 6">
  759. <el-form-item label="是否有混凝土">
  760. <el-radio-group
  761. v-model="nodeDetail.isConcrete"
  762. size="small"
  763. >
  764. <el-radio
  765. :label="0"
  766. border
  767. >无</el-radio>
  768. <el-radio
  769. :label="1"
  770. border
  771. >有</el-radio>
  772. </el-radio-group>
  773. </el-form-item>
  774. <el-form-item label="是否试验节点">
  775. <el-radio-group
  776. v-model="nodeDetail.isExpernode"
  777. size="small"
  778. >
  779. <el-radio
  780. :label="0"
  781. border
  782. >否</el-radio>
  783. <el-radio
  784. :label="1"
  785. border
  786. >是</el-radio>
  787. </el-radio-group>
  788. </el-form-item>
  789. </template>
  790. <el-form-item label="内业资料类型" prop="majorDataType" v-if="wbsType !== 2">
  791. <el-select
  792. v-model="nodeDetail.majorDataType"
  793. disabled
  794. placeholder="请选择"
  795. class="w-100p"
  796. >
  797. <el-option
  798. v-for="item in majorDataTypeList"
  799. :key="item.id"
  800. :label="item.dictValue"
  801. :value="item.dictKey"
  802. ></el-option>
  803. </el-select>
  804. </el-form-item>
  805. <el-form-item label="勾选相关联试验" prop="mixRatioTestIds" v-if="wbsType === 2 && nodeDetail.nodeType === 53">
  806. <div style="position: relative; height: 300px; border: 1px solid #dddfe6;">
  807. <el-scrollbar class="h-100p">
  808. <div v-loading="testTreeLoad">
  809. <el-tree class="filter-tree"
  810. :data="testTreeData"
  811. :props="defaultProps"
  812. :expand-on-click-node="false"
  813. highlight-current
  814. node-key="id"
  815. ref="treeall"
  816. show-checkbox
  817. :default-checked-keys="mixRatioTestIds"
  818. @check="TestTreeCheckChange"
  819. />
  820. </div>
  821. </el-scrollbar>
  822. </div>
  823. </el-form-item>
  824. </el-form>
  825. <span
  826. slot="footer"
  827. class="dialog-footer"
  828. >
  829. <el-button @click="dialogVisible = false">取 消</el-button>
  830. <el-button
  831. type="primary"
  832. @click="saveNode"
  833. :loading="saveNodeLoading"
  834. >确 定</el-button>
  835. </span>
  836. </el-dialog>
  837. <el-dialog
  838. title="创建新的元素表"
  839. :visible.sync="eleVisible"
  840. width="80%"
  841. append-to-body
  842. :close-on-click-modal="false"
  843. >
  844. <el-form
  845. ref="eleDialog"
  846. :model="eleForm"
  847. :rules="eleRules"
  848. label-width="110px"
  849. >
  850. <el-form-item
  851. label="表名"
  852. prop="nodeName"
  853. >
  854. <el-input v-model="eleForm.nodeName"></el-input>
  855. </el-form-item>
  856. <el-row>
  857. <el-col :span="12">
  858. <el-form-item
  859. label="表类型"
  860. prop="tableType"
  861. >
  862. <el-select
  863. v-model="eleForm.tableType"
  864. placeholder="请选择"
  865. class="w-100p"
  866. >
  867. <el-option
  868. v-for="item in tableTypelist"
  869. :key="item.id"
  870. :label="item.dictValue"
  871. :value="item.dictKey"
  872. ></el-option>
  873. </el-select>
  874. </el-form-item>
  875. </el-col>
  876. <el-col :span="12">
  877. <el-form-item
  878. label="所属方"
  879. prop="tableOwner"
  880. >
  881. <el-select
  882. v-model="eleForm.tableOwner"
  883. placeholder="请选择"
  884. class="w-100p"
  885. >
  886. <el-option
  887. v-for="item in ownerTypeList"
  888. :key="item.id"
  889. :label="item.dictValue"
  890. :value="item.dictKey"
  891. ></el-option>
  892. </el-select>
  893. </el-form-item>
  894. </el-col>
  895. </el-row>
  896. </el-form>
  897. <div class="flex jc-sb">
  898. <div></div>
  899. <div>
  900. <el-link
  901. type="primary"
  902. @click="importVisible = true"
  903. >快捷导入</el-link>
  904. <el-link
  905. type="primary"
  906. class="mg-l-20"
  907. @click="downloadTmp"
  908. >下载导入模版</el-link>
  909. </div>
  910. </div>
  911. <div class="border-grey">
  912. <p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
  913. <el-table
  914. :data="eleForm.elementList"
  915. border
  916. style="width: 100%"
  917. height="400px"
  918. >
  919. <el-table-column
  920. align="center"
  921. type="index"
  922. width="50"
  923. ></el-table-column>
  924. <el-table-column
  925. align="center"
  926. prop="eName"
  927. label="字段名称"
  928. >
  929. <template slot-scope="scope">
  930. <el-input
  931. v-model="scope.row.eName"
  932. size="small"
  933. placeholder="请输入内容"
  934. ></el-input>
  935. </template>
  936. </el-table-column>
  937. <el-table-column
  938. align="center"
  939. prop="eType"
  940. label="数据类型"
  941. width="120"
  942. >
  943. <template slot-scope="scope">
  944. <el-select
  945. v-model="scope.row.eType"
  946. size="small"
  947. placeholder="请选择"
  948. >
  949. <el-option
  950. v-for="item in dataTypeList"
  951. :key="item.id"
  952. :label="item.dictValue"
  953. :value="item.dictKey"
  954. ></el-option>
  955. </el-select>
  956. </template>
  957. </el-table-column>
  958. <el-table-column
  959. align="center"
  960. prop="eLength"
  961. label="长度"
  962. width="120"
  963. >
  964. <template slot-scope="scope">
  965. <el-input
  966. v-model="scope.row.eLength"
  967. size="small"
  968. placeholder="请输入内容"
  969. :disabled="scope.row.eType == 4"
  970. ></el-input>
  971. </template>
  972. </el-table-column>
  973. <el-table-column
  974. align="center"
  975. prop="eAllowDeviation"
  976. label="允许偏差值"
  977. >
  978. <template slot-scope="scope">
  979. <div class="flex">
  980. <el-select
  981. v-model="scope.row.allow"
  982. size="small"
  983. placeholder="请选择"
  984. style="width:120px"
  985. >
  986. <el-option
  987. :key="1"
  988. label="≥"
  989. value="≥"
  990. ></el-option>
  991. <el-option
  992. :key="2"
  993. label="≤"
  994. value="≤"
  995. ></el-option>
  996. <el-option
  997. :key="3"
  998. label="±"
  999. value="±"
  1000. ></el-option>
  1001. <el-option
  1002. :key="4"
  1003. label="【】"
  1004. value="【】"
  1005. ></el-option>
  1006. </el-select>
  1007. <el-input
  1008. v-model="scope.row.deviation"
  1009. size="small"
  1010. placeholder="请输入内容"
  1011. ></el-input>
  1012. </div>
  1013. </template>
  1014. </el-table-column>
  1015. <el-table-column
  1016. align="center"
  1017. prop="eInspectionMethod"
  1018. label="检查方法和频率"
  1019. >
  1020. <template slot-scope="scope">
  1021. <el-input
  1022. v-model="scope.row.eInspectionMethod"
  1023. size="small"
  1024. placeholder="请输入内容"
  1025. ></el-input>
  1026. </template>
  1027. </el-table-column>
  1028. <el-table-column
  1029. align="center"
  1030. label="操作"
  1031. width="80"
  1032. >
  1033. <template slot="header">
  1034. <el-button
  1035. @click="addEleRow(eleForm.elementList)"
  1036. type="text"
  1037. icon="el-icon-circle-plus-outline"
  1038. class="text-icon"
  1039. ></el-button>
  1040. </template>
  1041. <template slot-scope="scope">
  1042. <el-button
  1043. icon="el-icon-remove-outline"
  1044. type="text"
  1045. @click="delEleRow(scope.$index,eleForm.elementList)"
  1046. class="text-icon text-icon-danger"
  1047. ></el-button>
  1048. </template>
  1049. </el-table-column>
  1050. </el-table>
  1051. </div>
  1052. <span
  1053. slot="footer"
  1054. class="dialog-footer"
  1055. >
  1056. <el-button @click="eleVisible = false">取 消</el-button>
  1057. <el-button
  1058. type="primary"
  1059. @click="saveFormAndElementHandle"
  1060. >保 存</el-button>
  1061. </span>
  1062. </el-dialog>
  1063. <el-dialog
  1064. title="模版导入"
  1065. :visible.sync="importVisible"
  1066. width="50%"
  1067. append-to-body
  1068. :close-on-click-modal="false"
  1069. >
  1070. <p>提示:必须按照系统要求的模版格式上传,否则系统识别无效 <el-link
  1071. type="primary"
  1072. @click="downloadTmp"
  1073. >下载导入模版</el-link>
  1074. </p>
  1075. <div>
  1076. <el-button
  1077. size="small"
  1078. type="primary"
  1079. @click="fileClick2"
  1080. >本地上传</el-button>
  1081. <input
  1082. @change="tmpImport"
  1083. type="file"
  1084. hidden
  1085. ref="file2"
  1086. accept=".xls, .xlsx"
  1087. >
  1088. </div>
  1089. <el-table
  1090. :data="tempList"
  1091. border
  1092. style="width: 100%"
  1093. >
  1094. <el-table-column
  1095. align="center"
  1096. prop="eName"
  1097. label="字段信息"
  1098. >
  1099. </el-table-column>
  1100. <el-table-column
  1101. align="center"
  1102. prop="eType"
  1103. label="数据类型"
  1104. width="120"
  1105. >
  1106. </el-table-column>
  1107. <el-table-column
  1108. align="center"
  1109. prop="eLength"
  1110. label="长度"
  1111. width="120"
  1112. >
  1113. </el-table-column>
  1114. <el-table-column
  1115. align="center"
  1116. prop="eAllowDeviation"
  1117. label="允许偏差值"
  1118. >
  1119. </el-table-column>
  1120. <el-table-column
  1121. align="center"
  1122. prop="eInspectionMethod"
  1123. label="检查方法和频率"
  1124. >
  1125. </el-table-column>
  1126. </el-table>
  1127. <span
  1128. slot="footer"
  1129. class="dialog-footer"
  1130. >
  1131. <el-button @click="importVisible = false">取 消</el-button>
  1132. <el-button
  1133. type="primary"
  1134. @click="importHandle"
  1135. >确 定</el-button>
  1136. </span>
  1137. </el-dialog>
  1138. <el-dialog
  1139. :title="(curEleTable.tableName?curEleTable.tableName:'')+''"
  1140. :visible.sync="editEleVisible"
  1141. width="80%"
  1142. append-to-body
  1143. :close-on-click-modal="false"
  1144. >
  1145. <!-- <p class="font-c-warning">编辑元素信息(请谨慎操作)</p> -->
  1146. <el-table
  1147. :data="editEleList"
  1148. border
  1149. style="width: 100%"
  1150. height="400px"
  1151. >
  1152. <el-table-column
  1153. align="center"
  1154. type="index"
  1155. width="50"
  1156. ></el-table-column>
  1157. <el-table-column
  1158. align="center"
  1159. prop="eName"
  1160. label="字段信息"
  1161. >
  1162. </el-table-column>
  1163. <el-table-column
  1164. align="center"
  1165. prop="eType"
  1166. label="数据类型"
  1167. width="120"
  1168. :formatter="eTypeFormatter"
  1169. >
  1170. </el-table-column>
  1171. <el-table-column
  1172. align="center"
  1173. prop="eLength"
  1174. label="长度"
  1175. width="120"
  1176. >
  1177. </el-table-column>
  1178. <el-table-column
  1179. align="center"
  1180. prop="eAllowDeviation"
  1181. label="允许偏差值"
  1182. >
  1183. </el-table-column>
  1184. <el-table-column
  1185. align="center"
  1186. prop="eInspectionMethod"
  1187. label="检查方法和频率"
  1188. >
  1189. </el-table-column>
  1190. </el-table>
  1191. <span
  1192. slot="footer"
  1193. class="dialog-footer"
  1194. >
  1195. <el-button @click="editEleVisible = false">取 消</el-button>
  1196. <!-- <el-button
  1197. type="primary"
  1198. @click="saveEles"
  1199. >确 定</el-button> -->
  1200. </span>
  1201. </el-dialog>
  1202. <el-dialog
  1203. title="元素公式"
  1204. :visible.sync="editEleFormulaVisible"
  1205. width="800px"
  1206. append-to-body
  1207. :close-on-click-modal="false"
  1208. >
  1209. <div class="flex mg-b-10">
  1210. <el-input
  1211. v-model="formulaInput"
  1212. placeholder="请输入名称"
  1213. size="samll" clearable @clear="searchFormulaName"
  1214. ></el-input>
  1215. <el-button type="info" class="mg-l-10" @click="searchFormulaName">搜索</el-button>
  1216. </div>
  1217. <el-table
  1218. :data="editEleListFilter"
  1219. border
  1220. style="width: 100%"
  1221. height="400px"
  1222. >
  1223. <el-table-column
  1224. align="center"
  1225. prop="eName"
  1226. label="字段信息"
  1227. >
  1228. </el-table-column>
  1229. <el-table-column
  1230. align="center"
  1231. label="操作"
  1232. width="200"
  1233. >
  1234. <template slot-scope="scope">
  1235. <el-link
  1236. :type="scope.row.isSaveFormula == 1?'warning':'primary'"
  1237. @click="toFormulaEdit(scope.row)"
  1238. >公式配置</el-link>
  1239. <!-- <el-link
  1240. class="mg-l-10"
  1241. type="danger"
  1242. @click="delEleRowHandle(scope.$index,editEleListFilter)"
  1243. >删除</el-link> -->
  1244. </template>
  1245. </el-table-column>
  1246. </el-table>
  1247. </el-dialog>
  1248. <el-dialog
  1249. title="导入划分"
  1250. :visible.sync="importTemplateVisible"
  1251. width="800px"
  1252. append-to-body
  1253. :close-on-click-modal="false"
  1254. >
  1255. <div v-loading="importLoading">
  1256. <div>
  1257. <el-link
  1258. type="primary"
  1259. @click="handleDownload"
  1260. >下载导入模版</el-link>
  1261. </div>
  1262. <div class="mg-t-20">
  1263. <el-button
  1264. type="primary"
  1265. @click="fileClick"
  1266. >选择文件</el-button>
  1267. <span
  1268. v-if="upFile"
  1269. class="mg-l-20"
  1270. >{{upFile.name}}</span>
  1271. <input
  1272. @change="fileChange"
  1273. type="file"
  1274. hidden
  1275. ref="file"
  1276. accept=".xls, .xlsx"
  1277. >
  1278. </div>
  1279. <div v-if="!upFile">当前还未选择文件,请选择需要导入的文件</div>
  1280. </div>
  1281. <span
  1282. slot="footer"
  1283. class="dialog-footer"
  1284. >
  1285. <el-button @click="importTemplateVisible = false">取 消</el-button>
  1286. <el-button
  1287. type="primary"
  1288. @click="importTemplateHandle"
  1289. :loading="importLoading"
  1290. >导 入</el-button>
  1291. </span>
  1292. </el-dialog>
  1293. <el-dialog
  1294. title="节点参数"
  1295. :visible.sync="nodeInfoVisible"
  1296. width="800px"
  1297. append-to-body
  1298. class="jiedian"
  1299. :close-on-click-modal="false"
  1300. :show-close="false"
  1301. >
  1302. <div>
  1303. <el-button
  1304. type="text"
  1305. icon="el-icon-s-operation"
  1306. class="right-btn"
  1307. @click="setNodeParameters()"
  1308. ></el-button>
  1309. <div class="flexEnd">
  1310. <i
  1311. class="el-icon-circle-plus marbottom10"
  1312. @click="addNodeInfoTable()"
  1313. style="font-size:24px;color:rgb(37, 193, 99);cursor: pointer;"
  1314. ></i>
  1315. </div>
  1316. <el-table
  1317. :data="nodeInfoTable"
  1318. border
  1319. style="width: 100%"
  1320. height="400"
  1321. >
  1322. <el-table-column
  1323. align="center"
  1324. prop="name"
  1325. label="参数名称"
  1326. >
  1327. <template slot-scope="scope">
  1328. <el-select
  1329. v-model="scope.row.k"
  1330. placeholder="请选择"
  1331. class="w-100p"
  1332. >
  1333. <el-option
  1334. v-for="item in namelist"
  1335. :key="item.k"
  1336. :label="item.name"
  1337. :value="item.k"
  1338. ></el-option>
  1339. </el-select>
  1340. </template>
  1341. </el-table-column>
  1342. <el-table-column
  1343. align="center"
  1344. prop="value"
  1345. label="参数值设置"
  1346. >
  1347. <template slot-scope="scope">
  1348. <el-input v-model="scope.row.v"></el-input>
  1349. </template>
  1350. </el-table-column>
  1351. <el-table-column
  1352. align="center"
  1353. prop="describe"
  1354. label="描述"
  1355. >
  1356. <template slot-scope="scope">
  1357. <el-input v-model="scope.row.remark"></el-input>
  1358. </template>
  1359. </el-table-column>
  1360. <el-table-column
  1361. label="操作"
  1362. width="120"
  1363. align="center"
  1364. >
  1365. <template slot-scope="scope">
  1366. <el-button
  1367. type="text"
  1368. size="small"
  1369. class="text-icon-danger"
  1370. @click="delNodeInfoss(scope.$index)"
  1371. >删除</el-button>
  1372. </template>
  1373. </el-table-column>
  1374. </el-table>
  1375. </div>
  1376. <span
  1377. slot="footer"
  1378. class="dialog-footer"
  1379. >
  1380. <el-button @click="nodeInfoVisible = false">取 消</el-button>
  1381. <el-button
  1382. type="primary"
  1383. @click="nodeInfoSave()"
  1384. >保 存</el-button>
  1385. </span>
  1386. </el-dialog>
  1387. <!-- 设置参数名称 -->
  1388. <el-dialog
  1389. title="设置参数名称"
  1390. :visible.sync="infoNameVisible"
  1391. width="800px"
  1392. append-to-body
  1393. class="jiedian"
  1394. :close-on-click-modal="false"
  1395. >
  1396. <div>
  1397. <div class="flexEnd">
  1398. <i
  1399. class="el-icon-circle-plus marbottom10"
  1400. @click="setParameterName()"
  1401. style="font-size:24px;color:rgb(37, 193, 99);cursor: pointer;"
  1402. ></i>
  1403. </div>
  1404. <el-table
  1405. :data="namelists"
  1406. border
  1407. style="width: 100%"
  1408. height="400"
  1409. >
  1410. <el-table-column
  1411. align="center"
  1412. prop="name"
  1413. label="参数名称"
  1414. >
  1415. <template slot-scope="scope">
  1416. <el-input v-model="scope.row.name"></el-input>
  1417. </template>
  1418. </el-table-column>
  1419. <el-table-column
  1420. align="center"
  1421. prop="key"
  1422. label="参数值KEY"
  1423. >
  1424. <template slot-scope="scope">
  1425. <el-input v-model="scope.row.k"></el-input>
  1426. </template>
  1427. </el-table-column>
  1428. <el-table-column
  1429. align="center"
  1430. prop="describe"
  1431. label="描述"
  1432. >
  1433. <template slot-scope="scope">
  1434. <el-input v-model="scope.row.remark"></el-input>
  1435. </template>
  1436. </el-table-column>
  1437. <el-table-column
  1438. label="操作"
  1439. width="120"
  1440. align="center"
  1441. >
  1442. <template slot-scope="scope">
  1443. <el-button
  1444. type="text"
  1445. size="small"
  1446. class="text-icon-danger"
  1447. @click="delNodeInfo(scope.$index)"
  1448. >删除</el-button>
  1449. </template>
  1450. </el-table-column>
  1451. </el-table>
  1452. </div>
  1453. <span
  1454. slot="footer"
  1455. class="dialog-footer"
  1456. >
  1457. <el-button @click="addParameterName()">保 存</el-button>
  1458. <el-button @click="closeParameter()">关 闭</el-button>
  1459. </span>
  1460. </el-dialog>
  1461. <el-dialog
  1462. title="别名"
  1463. :visible.sync="aliasVisible"
  1464. width="600px"
  1465. append-to-body
  1466. :close-on-click-modal="false"
  1467. >
  1468. <div>
  1469. <div class="flex">
  1470. <el-input v-model="aliasInput" placeholder="请输入节点别名"></el-input>
  1471. <el-button class="mg-l-20" type="primary" @click="addAlias">添加</el-button>
  1472. </div>
  1473. <div class="flex" style="flex-wrap:wrap">
  1474. <div class="mg-t-10" v-for="(tag,index) in aliasArr" :key="index">
  1475. <el-tag closable @close="delAlias(index)">
  1476. {{tag}}
  1477. </el-tag>
  1478. <span v-if="index != aliasArr.length-1">、</span>
  1479. </div>
  1480. </div>
  1481. </div>
  1482. <span
  1483. slot="footer"
  1484. class="dialog-footer"
  1485. >
  1486. <el-button @click="aliasVisible = false">取 消</el-button>
  1487. <el-button type="primary" @click="saveAliasHandle">确 定</el-button>
  1488. </span>
  1489. </el-dialog>
  1490. <!-- 公式 -->
  1491. <el-dialog title="元素公式" :visible.sync="formulaCompVisible" fullscreen append-to-body class="full-dialog">
  1492. <FormulaEdit :wbsid="id" :nodeid="curTreeData.id" :eleid="formulaCurRow.id" :projectid="projectid" @hideDialog="formulaCompVisible = false" v-if="formulaCompVisible"></FormulaEdit>
  1493. </el-dialog>
  1494. <!-- 编辑元素 -->
  1495. <el-dialog title=" " :visible.sync="editElementVisible" fullscreen append-to-body class="full-dialog">
  1496. <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>
  1497. </el-dialog>
  1498. </div>
  1499. </template>
  1500. <script>
  1501. import ManualSorting from '@/components/WbsTree/ManualSorting'
  1502. import dynamicExcel from "./treeTemplate/dynamicExcel.vue";
  1503. import FormulaEdit from '@/views/formula/edit.vue'
  1504. import EditElement from '@/views/manager/projectinfo/editElement/editElement.vue'
  1505. import {
  1506. saveFormAndElement, selectFormElements,
  1507. importWbsTree, findWbsTreePrivateSameLevel, wbsTreePrivateSort, parameters, saveOrUpdateBatch, keymap, updateBatchNodeTableInfo2, updateStatus
  1508. } from "@/api/manager/wbstree";
  1509. import {
  1510. saveElement, remove as removeElement, updateBatchElements, getTemplate,
  1511. importWbsElement
  1512. } from "@/api/manager/wbsformelement";
  1513. import { getLazytree, getDetail, update, findNodeTableByCondition as selectByNodeTable, removeTableByCondition as removeTableById, removePrivateTreeNode, wbsTreePrivateTableSort ,privateSubmitFullName,syncNodeParam,syncNodeTable,tabTypeLazyTree} from "@/api/manager/wbsprivate";
  1514. import { findProjectTree as getAlltree } from "@/api/manager/projectinfo";
  1515. import { getList as getAttchFromOriginalName } from "@/api/resource/attach";
  1516. import { getDictionary } from "@/api/system/dict";
  1517. import { mapGetters } from "vuex";
  1518. import { getList, tabLazytreeAll, saveLinkTab, getExcelHtml } from '@/api/exctab/excelmodel'
  1519. import {getStore,setStore} from '@/util/store'
  1520. export default {
  1521. data () {
  1522. var checkMajorDataType = (rule, value, callback) => {
  1523. //console.log(this.nodeDetail.nodeType)
  1524. //console.log(this.nodeDetail.majorDataType)
  1525. if(this.nodeDetail.nodeType == 6){
  1526. if(!this.nodeDetail.majorDataType){
  1527. callback(new Error('工序节点必须选择内业资料类型'));
  1528. }
  1529. }
  1530. callback();
  1531. };
  1532. return {
  1533. formDatass: [],
  1534. editElementFormTag: false,
  1535. jiedianId: '',
  1536. //#region
  1537. sortTag: false,
  1538. sortTag2: false,
  1539. sortArray: [],
  1540. //#endregion
  1541. //#region 关联清表
  1542. loading: false,
  1543. GLExcel: false,
  1544. GLExcelFrom: {
  1545. id: "",
  1546. name: '',
  1547. search: '',//搜素框舒服的值
  1548. ids: '',
  1549. excelId: '',
  1550. initTableName: '',
  1551. },
  1552. GLExcelData: [],//
  1553. GLExcelProps: {
  1554. label: 'name',
  1555. children: 'children',
  1556. disabled: 'hasChildren',
  1557. isLeaf: function (data) {
  1558. let tag = false
  1559. if (!data.hasChildren) {
  1560. tag = true
  1561. }
  1562. if (data.isExistForm == 1) {
  1563. tag = true
  1564. }
  1565. return tag
  1566. },
  1567. },
  1568. exceldata: [],//清表模板
  1569. GLExcelLoading:false,
  1570. //#endregion
  1571. //#region 调整表单
  1572. adjustmentExcel: '',
  1573. excelHtml: false,
  1574. //#endregion
  1575. //#region
  1576. id: '',
  1577. projectid: '',
  1578. filterText: '',
  1579. treeData: [],
  1580. treeLoad: false,
  1581. menuShow: false,
  1582. defaultProps: {
  1583. children: 'children',
  1584. label: 'title',
  1585. isLeaf: function (data) {
  1586. //console.log(data, !data.hasChildren, data.isExistForm);
  1587. let tag = false
  1588. if (!data.hasChildren) {
  1589. tag = true
  1590. }
  1591. if (data.isExistForm == 1) {
  1592. tag = true
  1593. }
  1594. if (data.nodeType >= 6 && data.nodeType <= 13) {
  1595. tag = true
  1596. }
  1597. //中间交工。开工报告、质量评定)
  1598. if(data.majorDataType == 1 || data.majorDataType == 2 || data.majorDataType == 3){
  1599. tag = true
  1600. }
  1601. return tag
  1602. // return !data.hasChildren || (data.isExistForm == 1);
  1603. },
  1604. },
  1605. leftType: 5,
  1606. curTreeData: {},
  1607. curTreeNode: {},
  1608. tableData: [],
  1609. nodeDetail: {},
  1610. formData: [],
  1611. editType: 1,
  1612. dialogVisible: false,
  1613. saveNodeLoading: false,
  1614. nodeTypelist: [],
  1615. majorDataTypeList: [],
  1616. rules: {
  1617. nodeName: [
  1618. { required: true, message: '请输入节点名称', trigger: 'blur' },
  1619. ],
  1620. nodeType: [
  1621. { required: true, message: '请选择节点类型', trigger: 'change' }
  1622. ],
  1623. majorDataType:[
  1624. { validator: checkMajorDataType, trigger: 'change' }
  1625. ]
  1626. },
  1627. eleVisible: false,
  1628. tableTypelist: [],
  1629. dataTypeList: [],
  1630. ownerTypeList: [],
  1631. eleForm: {
  1632. elementList: [],
  1633. },
  1634. eleRules: {
  1635. nodeName: [
  1636. { required: true, message: '请输入表名称', trigger: 'blur' },
  1637. ],
  1638. tableType: [
  1639. { required: true, message: '请选择表类型', trigger: 'change' }
  1640. ],
  1641. tableOwner: [
  1642. { required: true, message: '请选择所属方', trigger: 'change' }
  1643. ],
  1644. },
  1645. importVisible: false,
  1646. tempList: [],
  1647. curEleTable: {},
  1648. editEleVisible: false,
  1649. editEleList: [],
  1650. eleReg: /(≥|≤|±|【】)?([^≥≤±【】]*)/,
  1651. editEleFormulaVisible: false,
  1652. formulaInput: '',
  1653. editEleListFilter:[],
  1654. editEleListAll:[],
  1655. importTemplateVisible: false,
  1656. fileUrl: '',
  1657. upFile: null,
  1658. importLoading: false,
  1659. nodeInfoVisible: false,
  1660. nodeInfoTable: [],
  1661. namelist: [],
  1662. namelists: [],
  1663. infoNameVisible: false,
  1664. excelSortTag: false,
  1665. excelSortTag2: false,
  1666. tableSortList: [],
  1667. //#endregion
  1668. defaultExpandedKeys:[],
  1669. expandName:this.$route.fullPath,
  1670. aliasVisible:false,//别名
  1671. aliasInput:'',
  1672. aliasArr:[],
  1673. formulaCompVisible:false,//公式弹框
  1674. formulaCurRow:{},//当前元素
  1675. editElementVisible:false,//编辑元素弹框
  1676. editElementQuery:{
  1677. pkeyId: '',
  1678. excelId: '',
  1679. id: '',
  1680. initTableName:'',
  1681. pid: '',
  1682. wbsid: '',
  1683. nodeid: '',
  1684. },//传参
  1685. syncBtnLoad:false,
  1686. showType:1,
  1687. typeTreeData:[],
  1688. testTreeLoad: false,
  1689. testTreeData: [],
  1690. mixRatioTestIds: []
  1691. };
  1692. },
  1693. computed: {
  1694. ...mapGetters(["userInfo"]),
  1695. dialogTitle: function () {
  1696. let text = '节点';
  1697. if (this.leftType == 1) {
  1698. text = '新增' + text;
  1699. } else if (this.leftType == 2) {
  1700. text = '编辑' + text;
  1701. }
  1702. return text;
  1703. },
  1704. },
  1705. created () {
  1706. this.init();
  1707. //console.log(this.userInfo)
  1708. },
  1709. methods: {
  1710. //#region
  1711. init () {
  1712. //this.id = this.$route.query.wbsid;
  1713. //this.projectid = this.$route.query.pid;
  1714. const {wbsid, pid, type} = this.$route.query;
  1715. this.id = wbsid
  1716. this.projectid = pid
  1717. this.wbsType = type ? Number(type) : 1
  1718. this.getNodeTypelist();
  1719. this.getTableTypelist();
  1720. this.getDataTypelist();
  1721. this.getOwnerTypelist();
  1722. this.defaultExpandedKeys = getStore({name:this.expandName});
  1723. },
  1724. loadNode (node, resolve) {
  1725. let pid = 0;
  1726. if (node.level != 0) {
  1727. pid = node.data.id
  1728. }
  1729. const type = this.wbsType
  1730. getLazytree(this.id, pid, this.userInfo.tenant_id, this.projectid, {
  1731. wbsType: type
  1732. }).then((res) => {
  1733. let arr = [];
  1734. if (Array.isArray(res.data.data)) {
  1735. arr = res.data.data;
  1736. }
  1737. return resolve(arr);
  1738. })
  1739. },
  1740. getNodeDetail (data, node) {
  1741. let parentName = '';
  1742. if (node.parent.data) {
  1743. parentName = node.parent.data.title;
  1744. }
  1745. this.curTreeData = data;
  1746. this.curTreeNode = node;
  1747. this.curTreeData.parentName = parentName;
  1748. getDetail(data.id, this.id, this.projectid).then((res) => {
  1749. res.data.data.parentName = parentName;
  1750. this.tableData = [res.data.data];
  1751. this.nodeDetail = Object.assign({}, res.data.data);
  1752. })
  1753. this.updateNodeTable();
  1754. //获取节点展开路径
  1755. this.getExpandedKeys(node);
  1756. },
  1757. saveNode () {
  1758. const type = this.wbsType
  1759. this.$refs['nodeDetail'].validate((valid) => {
  1760. if (valid) {
  1761. const { mixRatioTestIds, nodeType } = this.nodeDetail
  1762. if (type === 2 && nodeType === 53) {
  1763. if (mixRatioTestIds) {
  1764. if (this.editType == 1) {
  1765. this.addNode();
  1766. } else if (this.editType == 2) {
  1767. this.updateNode();
  1768. }
  1769. } else {
  1770. this.$message({
  1771. type: "error",
  1772. message: '请先选择节点'
  1773. });
  1774. return false;
  1775. }
  1776. } else {
  1777. if (this.editType == 1) {
  1778. this.addNode();
  1779. } else if (this.editType == 2) {
  1780. this.updateNode();
  1781. }
  1782. }
  1783. } else {
  1784. console.log('error submit!!');
  1785. return false;
  1786. }
  1787. });
  1788. },
  1789. addNode () {
  1790. this.saveNodeLoading = true;
  1791. update(this.nodeDetail).then(() => {
  1792. this.updateTreeNewNode();
  1793. this.dialogVisible = false;
  1794. this.$message({
  1795. type: "success",
  1796. message: "新增成功!"
  1797. });
  1798. })
  1799. },
  1800. updateNode () {
  1801. update(this.nodeDetail).then(() => {
  1802. let node = this.tableData[0];
  1803. node.nodeName = this.nodeDetail.nodeName;
  1804. node.nodeType = this.nodeDetail.nodeType;
  1805. this.curTreeData.title = this.nodeDetail.nodeName;
  1806. this.dialogVisible = false;
  1807. this.$message({
  1808. type: "success",
  1809. message: "修改成功!"
  1810. });
  1811. })
  1812. },
  1813. toSplit(val) {
  1814. return val ? String(val).split(',') : '';
  1815. },
  1816. setLeftType (type, data, node) {
  1817. this.jiedianId = data.id
  1818. if (type == 4 || type == 5) {
  1819. this.leftType = type;
  1820. }
  1821. this.curTreeData = data;
  1822. this.curTreeNode = node;
  1823. this.$refs.tree.setCurrentKey(data.id);
  1824. if (type == 1 || type == 2) {
  1825. this.getMajorDataTypeList();
  1826. this.dialogVisible = true;
  1827. this.editType = type;
  1828. }
  1829. getDetail(data.id, this.id, this.projectid).then((res) => {
  1830. let parentName = '';
  1831. if (node.parent.data) {
  1832. parentName = node.parent.data.title;
  1833. }
  1834. res.data.data.parentName = parentName;
  1835. this.tableData = [res.data.data];
  1836. if (type == 1) {
  1837. this.nodeDetail = {
  1838. parentId: res.data.data.id,
  1839. parentName: parentName,
  1840. projectId: res.data.data.projectId
  1841. };
  1842. } else {
  1843. this.nodeDetail = Object.assign({}, res.data.data);
  1844. this.mixRatioTestIds = this.toSplit(res.data.data.mixRatioTestIds)
  1845. }
  1846. this.nodeDetail.type = 1;// '1'节点 '2'表单
  1847. this.nodeDetail.wbsId = this.id;
  1848. this.nodeDetail.tenantId = this.userInfo.tenant_id
  1849. })
  1850. if (this.leftType == 4) {
  1851. selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
  1852. if (res.data.data.length) {
  1853. this.formData = res.data.data;
  1854. } else {
  1855. this.formData = [];
  1856. }
  1857. })
  1858. }
  1859. //获取节点展开路径
  1860. this.getExpandedKeys(node);
  1861. },
  1862. showFormElement () {
  1863. if (!this.nodeDetail.id) {
  1864. this.$message({
  1865. type: "warning",
  1866. message: "请先选择在哪个节点下创建表"
  1867. });
  1868. return;
  1869. }
  1870. this.eleVisible = true;
  1871. },
  1872. addEleRow (list) {
  1873. list.push({});
  1874. },
  1875. delEleRow (index, list) {
  1876. list.splice(index, 1);
  1877. },
  1878. saveFormAndElementHandle () {
  1879. this.$refs['eleDialog'].validate((valid) => {
  1880. if (valid) {
  1881. this.eleForm.wbsId = this.id;
  1882. this.eleForm.tenantId = this.userInfo.tenant_id;
  1883. this.eleForm.nodeType = -1;
  1884. this.eleForm.type = 2;// '1'节点 '2'表单
  1885. this.eleForm.parentId = this.nodeDetail.id;
  1886. this.eleForm.elementList.forEach((element) => {
  1887. element.eAllowDeviation = (element.allow ? element.allow : '') + (element.deviation ? element.deviation : '');
  1888. if (element.eType == 4) {
  1889. element.eLength = 0;
  1890. }
  1891. })
  1892. saveFormAndElement(this.eleForm).then(() => {
  1893. //console.log(res)
  1894. this.updateTreeNewNode();
  1895. this.updateNodeTable();
  1896. this.eleVisible = false;
  1897. this.$message({
  1898. type: "success",
  1899. message: "新增成功!"
  1900. });
  1901. })
  1902. } else {
  1903. console.log('error submit!!');
  1904. return false;
  1905. }
  1906. });
  1907. },
  1908. updateTreeNewNode () {
  1909. getLazytree(this.id, this.nodeDetail.parentId, this.userInfo.tenant_id, this.projectid).then((res) => {
  1910. this.$refs.tree.updateKeyChildren(this.nodeDetail.parentId, res.data.data)
  1911. })
  1912. },
  1913. updateNodeTable () {
  1914. selectByNodeTable(this.curTreeData.id, this.projectid, this.id).then((res) => {
  1915. if (res.data.data.length) {
  1916. this.formData = res.data.data;
  1917. } else {
  1918. this.formData = [];
  1919. }
  1920. })
  1921. },
  1922. deleNode (data, node) {
  1923. this.$confirm('此操作将删除节点【' + data.title + '】, 是否继续?', '提示', {
  1924. confirmButtonText: '确定',
  1925. cancelButtonText: '取消',
  1926. type: 'warning'
  1927. }).then(() => {
  1928. removePrivateTreeNode(data.primaryKeyId).then(() => {
  1929. this.$refs.tree.remove(node);
  1930. this.$message({
  1931. type: "success",
  1932. message: "删除成功!"
  1933. });
  1934. })
  1935. }).catch(() => {
  1936. });
  1937. },
  1938. importHandle () {
  1939. },
  1940. handleEdit (index, row) {
  1941. this.curEleTable = row;
  1942. selectFormElements(this.curEleTable.id).then((res) => {
  1943. res.data.data.forEach((element) => {
  1944. this.eleReg.exec(element.eAllowDeviation);
  1945. // console.log(RegExp.$1)
  1946. // console.log(RegExp.$2)
  1947. element.allow = RegExp.$1 ? RegExp.$1 : '';
  1948. element.deviation = RegExp.$2 ? RegExp.$2 : '';
  1949. })
  1950. this.editEleList = res.data.data;
  1951. })
  1952. this.editEleVisible = true;
  1953. },
  1954. handleDelete (index, row) {
  1955. this.$confirm('是否删除 ' + row.tableName + ' ?', '删除元素表', {
  1956. distinguishCancelAndClose: true,
  1957. confirmButtonText: '删除',
  1958. cancelButtonText: '取消'
  1959. }).then(() => {
  1960. removeTableById(row.id, this.projectid, this.id).then(() => {
  1961. this.formData.splice(index, 1);
  1962. this.$message({
  1963. type: "success",
  1964. message: "删除成功!"
  1965. });
  1966. })
  1967. })
  1968. },
  1969. async hideMD (row) {//隐藏按钮
  1970. const code = await this.updateStatus(row.pkeyId, row.status)
  1971. if (code == 200) {
  1972. if (row.status == 0) {
  1973. row.status = 1
  1974. } else {
  1975. row.status = 0
  1976. }
  1977. }
  1978. },
  1979. async updateStatus (pKeyId, status) {//隐藏功能激活
  1980. const { data: res } = await updateStatus({ pKeyId })
  1981. if (res.code == 200) {
  1982. this.$message({
  1983. type: 'success',
  1984. message: status == 1 ? '隐藏成功' : '激活成功'
  1985. })
  1986. }
  1987. return res.code
  1988. },
  1989. handleEditFormula (index, row) {
  1990. this.curEleTable = row;
  1991. selectFormElements(this.curEleTable.id).then((res) => {
  1992. this.editEleListFilter = res.data.data;
  1993. this.editEleListAll = [].concat(this.editEleListFilter);
  1994. })
  1995. this.editEleFormulaVisible = true;
  1996. },
  1997. //搜索 筛选
  1998. searchFormulaName(){
  1999. this.editEleListFilter = this.editEleListAll.filter((ele)=>{
  2000. return ele.eName.indexOf(this.formulaInput) > -1;
  2001. })
  2002. },
  2003. saveNewEle (row) {
  2004. row.eAllowDeviation = (row.allow ? row.allow : '') + (row.deviation ? row.deviation : '');
  2005. row.fId = this.curEleTable.id;
  2006. row.initTableName = this.curEleTable.initTableName;
  2007. if (row.eType == 4) {
  2008. row.eLength = 0;
  2009. }
  2010. saveElement(row).then((res) => {
  2011. if (res.data.data) {
  2012. this.$set(row, 'id', res.data.data.id);
  2013. this.$set(row, 'ekey', res.data.data.ekey);
  2014. this.$message({
  2015. type: "success",
  2016. message: "保存成功!"
  2017. });
  2018. }
  2019. })
  2020. },
  2021. delEleRowHandle (index, list) {
  2022. let row = list[index];
  2023. if (row.id) {
  2024. //有id需要请求删除
  2025. this.$confirm('是否确认删除?', '删除元素', {
  2026. distinguishCancelAndClose: true,
  2027. confirmButtonText: '删除',
  2028. cancelButtonText: '取消'
  2029. }).then(() => {
  2030. removeElement(row.id, this.curEleTable.initTableName, row.ekey).then(() => {
  2031. list.splice(index, 1);
  2032. })
  2033. })
  2034. } else {
  2035. list.splice(index, 1);
  2036. }
  2037. },
  2038. saveEles () {
  2039. for (let i = 0; i < this.editEleList.length; i++) {
  2040. if (!this.editEleList[i].id) {
  2041. this.$message({
  2042. type: "warning",
  2043. message: "请先将新增的元素点击保存"
  2044. });
  2045. return;
  2046. }
  2047. }
  2048. if (this.editEleList.length > 0) {
  2049. this.editEleList.forEach((element) => {
  2050. element.eAllowDeviation = (element.allow ? element.allow : '') + (element.deviation ? element.deviation : '');
  2051. if (element.eType == 4) {
  2052. element.eLength = 0;
  2053. }
  2054. })
  2055. updateBatchElements(this.editEleList, this.curEleTable.initTableName).then(() => {
  2056. this.editEleVisible = false;
  2057. this.updateNodeTable();
  2058. this.$message({
  2059. type: "success",
  2060. message: "保存成功!"
  2061. });
  2062. })
  2063. } else {
  2064. this.editEleVisible = false;
  2065. this.updateNodeTable();
  2066. this.$message({
  2067. type: "success",
  2068. message: "保存成功!"
  2069. });
  2070. }
  2071. },
  2072. nodeTypeChange(val) {
  2073. if (val === 53) {
  2074. if (this.testTreeData.length > 0) {
  2075. return;
  2076. }
  2077. this.testTreeLoad = true;
  2078. getAlltree(this.projectid, this.id).then((res) => {
  2079. this.testTreeLoad = false;
  2080. this.testTreeData = res.data.data;
  2081. })
  2082. }
  2083. },
  2084. //根据逗号联合
  2085. toJoin(arr) {
  2086. return arr ? arr.join() : '';
  2087. },
  2088. TestTreeCheckChange(_, {checkedKeys, halfCheckedKeys}) {
  2089. const newarr = [...checkedKeys, ...halfCheckedKeys]
  2090. this.nodeDetail.mixRatioTestIds = this.toJoin(newarr)
  2091. },
  2092. filterChange () {
  2093. //console.log(this.$refs)
  2094. //debugger
  2095. if (this.treeData.length > 0) {
  2096. this.$refs.treeall.filter(this.filterText);
  2097. return;
  2098. }
  2099. this.treeLoad = true;
  2100. getAlltree(this.projectid, this.id).then((res) => {
  2101. this.treeLoad = false;
  2102. this.treeData = res.data.data;
  2103. this.$nextTick(() => {
  2104. this.$refs.treeall.filter(this.filterText);
  2105. })
  2106. })
  2107. },
  2108. importTemplate (data) {
  2109. this.importTemplateVisible = true;
  2110. this.curTreeData = data;
  2111. if (!this.fileUrl) {
  2112. getAttchFromOriginalName(1, 20, {
  2113. originalName: 'WBS划分模板.xls'
  2114. }).then((res) => {
  2115. if (res.data.data.records.length) {
  2116. this.fileUrl = res.data.data.records[0].link;
  2117. } else {
  2118. this.fileUrl = '';
  2119. }
  2120. })
  2121. }
  2122. },
  2123. importTemplateHandle () {
  2124. if (!this.upFile) {
  2125. this.$message({
  2126. type: "warning",
  2127. message: "请先选择文件再进行导入"
  2128. });
  2129. return;
  2130. }
  2131. let forms = new FormData();
  2132. forms.append('excelFile', this.upFile);
  2133. let wbsTreeFu = {
  2134. wbsId: this.id,
  2135. parentId: this.curTreeData.id,
  2136. // ancestors:'0,'+this.curTreeData.id,
  2137. }
  2138. let json = JSON.stringify(wbsTreeFu);
  2139. let blob = new Blob([json], { type: 'application/json' })
  2140. forms.append('wbsTreeFu', blob);
  2141. this.importLoading = true;
  2142. importWbsTree(forms).then(() => {
  2143. //this.$router.go(0)
  2144. let node = this.$refs.tree.getNode(this.curTreeData.id);
  2145. node.isLeaf = false;
  2146. this.importTemplateVisible = false;
  2147. this.upFile = null;
  2148. }).finally(() => {
  2149. this.importLoading = false;
  2150. })
  2151. },
  2152. handleDownload () {
  2153. if (this.fileUrl) {
  2154. window.open(this.fileUrl);
  2155. } else {
  2156. this.$message({
  2157. type: "warning",
  2158. message: "请先在附件管理上传【WBS划分模板.xls】文件"
  2159. });
  2160. }
  2161. },
  2162. fileClick () {
  2163. this.$refs.file.click();
  2164. },
  2165. fileChange (e) {
  2166. const file = e.target.files[0]
  2167. if (!file) {
  2168. // 如果用户没有选择图片,只是点了文件上传这个按钮
  2169. return
  2170. }
  2171. //console.log(file)
  2172. this.upFile = file;
  2173. },
  2174. editNodeInfo (index, row) {
  2175. this.$set(row, 'isEdit', true);
  2176. },
  2177. saveNodeInfoHandle (index, row) {
  2178. row.isEdit = false;
  2179. },
  2180. downloadTmp () {
  2181. getTemplate().then((res) => {
  2182. //console.log(res)
  2183. let blob = new Blob([res.data], {
  2184. type: 'application/vnd.ms-excel'
  2185. });
  2186. //console.log(blob)
  2187. let filename = Date.parse(new Date()) + '.xls';
  2188. if (window.navigator.msSaveOrOpenBlob) {
  2189. // 兼容IE10
  2190. window.navigator.msSaveBlob(blob, filename);
  2191. } else {
  2192. // 兼容chrome/firefox
  2193. let aTag = document.createElement('a');
  2194. aTag.download = Date.parse(new Date()) + '.xls';
  2195. aTag.href = window.URL.createObjectURL(blob);
  2196. aTag.click();
  2197. URL.revokeObjectURL(aTag.href);
  2198. }
  2199. })
  2200. },
  2201. fileClick2 () {
  2202. this.$refs.file2.click();
  2203. },
  2204. tmpImport (e) {
  2205. const file = e.target.files[0];
  2206. const formData = new FormData();
  2207. formData.append('file', file);
  2208. //console.log(file.name)
  2209. importWbsElement(formData).then((res) => {
  2210. res.data.data.forEach((element) => {
  2211. element.eName = element.elementName;
  2212. element.eLength = element.elementLength;
  2213. element.eType = Number(element.elementType);
  2214. element.eAllowDeviation = element.elementAllowDeviation;
  2215. element.eInspectionMethod = element.elementInspectionMethod;
  2216. this.eleReg.exec(element.eAllowDeviation);
  2217. // console.log(RegExp.$1)
  2218. // console.log(RegExp.$2)
  2219. element.allow = RegExp.$1 ? RegExp.$1 : '';
  2220. element.deviation = RegExp.$2 ? RegExp.$2 : '';
  2221. })
  2222. this.eleForm.elementList = res.data.data;
  2223. this.importVisible = false;
  2224. }).finally(() => {
  2225. e.target.value = '';
  2226. })
  2227. },
  2228. visiblechange (value, data) {
  2229. this.$set(data, 'moreShow', value)
  2230. },
  2231. bianhua2 () {
  2232. this.excelSortTag2 = false
  2233. this.$nextTick(() => {
  2234. this.excelSortTag2 = true
  2235. })
  2236. },
  2237. //私有树的元素表修改排序
  2238. privateTableSort () {
  2239. if (!this.curTreeData.id) {
  2240. this.$message({
  2241. type: "warning",
  2242. message: "请先选择需要排序的节点"
  2243. })
  2244. return;
  2245. }
  2246. this.tableSortList = this.formData.map((form, index) => {
  2247. return {
  2248. sort: index + 1,
  2249. nodeName: form.tableName,
  2250. pkeyId: form.pkeyId,
  2251. }
  2252. })
  2253. this.excelSortTag = true
  2254. this.excelSortTag2 = true
  2255. },
  2256. editPrivateSort () {
  2257. wbsTreePrivateTableSort(this.tableSortList).then(() => {
  2258. this.updateNodeTable();
  2259. this.$message({
  2260. type: "success",
  2261. message: "排序成功!"
  2262. });
  2263. this.excelSortTag = false;
  2264. this.excelSortTag2 = false;
  2265. })
  2266. },
  2267. //解析元素数据类型
  2268. eTypeFormatter (row) {
  2269. let text = '';
  2270. for (let i = 0; i < this.dataTypeList.length; i++) {
  2271. if (this.dataTypeList[i].dictKey == row.eType) {
  2272. text = this.dataTypeList[i].dictValue;
  2273. break;
  2274. }
  2275. }
  2276. return text;
  2277. },
  2278. //跳转到公式配置页面
  2279. toFormulaEdit (row) {
  2280. // this.$router.push({
  2281. // path: '/formula/edit',
  2282. // query: {
  2283. // wbsid: this.id,
  2284. // eleid: row.id,
  2285. // nodeid:this.curTreeData.id,
  2286. // projectid:this.projectid
  2287. // }
  2288. // });
  2289. this.formulaCurRow = row;
  2290. this.formulaCompVisible = true;
  2291. },
  2292. getNodeTypelist () {
  2293. const type = this.wbsType
  2294. if (this.nodeTypelist.length > 1) {
  2295. return;
  2296. }
  2297. getDictionary({
  2298. code: type === 2 ? 'trial_node_type':'wbs_node_type'
  2299. }).then((res) => {
  2300. res.data.data.forEach(element => {
  2301. element.dictKey = Number(element.dictKey)
  2302. });
  2303. this.nodeTypelist = res.data.data;
  2304. })
  2305. },
  2306. getMajorDataTypeList () {
  2307. if (this.majorDataTypeList.length > 1) {
  2308. return;
  2309. }
  2310. getDictionary({
  2311. code: 'major_data_type'
  2312. }).then((res) => {
  2313. res.data.data.forEach(element => {
  2314. element.dictKey = Number(element.dictKey)
  2315. });
  2316. this.majorDataTypeList = res.data.data;
  2317. })
  2318. },
  2319. getTableTypelist () {
  2320. if (this.tableTypelist.length > 1) {
  2321. return;
  2322. }
  2323. getDictionary({
  2324. code: 'table_type'
  2325. }).then((res) => {
  2326. res.data.data.forEach(element => {
  2327. element.dictKey = Number(element.dictKey)
  2328. });
  2329. this.tableTypelist = res.data.data;
  2330. })
  2331. },
  2332. getDataTypelist () {
  2333. if (this.dataTypeList.length > 1) {
  2334. return;
  2335. }
  2336. getDictionary({
  2337. code: 'data_type'
  2338. }).then((res) => {
  2339. res.data.data.forEach(element => {
  2340. element.dictKey = Number(element.dictKey)
  2341. });
  2342. this.dataTypeList = res.data.data;
  2343. })
  2344. },
  2345. getOwnerTypelist () {
  2346. if (this.ownerTypeList.length > 1) {
  2347. return;
  2348. }
  2349. getDictionary({
  2350. code: 'owner_type'
  2351. }).then((res) => {
  2352. res.data.data.forEach(element => {
  2353. element.dictKey = Number(element.dictKey)
  2354. });
  2355. this.ownerTypeList = res.data.data;
  2356. })
  2357. },
  2358. formatCat (row, column, cellValue) {
  2359. for (let i = 0; i < this.nodeTypelist.length; i++) {
  2360. if (this.nodeTypelist[i].dictKey == cellValue) {
  2361. return this.nodeTypelist[i].dictValue
  2362. }
  2363. }
  2364. return cellValue;
  2365. //console.log(cellValue)
  2366. },
  2367. formatTableType (row, column, cellValue) {
  2368. for (let i = 0; i < this.tableTypelist.length; i++) {
  2369. if (this.tableTypelist[i].dictKey == cellValue) {
  2370. return this.tableTypelist[i].dictValue
  2371. }
  2372. }
  2373. return cellValue;
  2374. //console.log(cellValue)
  2375. },
  2376. formatOwner (row, column, cellValue) {
  2377. for (let i = 0; i < this.ownerTypeList.length; i++) {
  2378. if (this.ownerTypeList[i].dictKey == cellValue) {
  2379. return this.ownerTypeList[i].dictValue
  2380. }
  2381. }
  2382. return cellValue;
  2383. //console.log(cellValue)
  2384. },
  2385. formatdataType (row, column, cellValue) {
  2386. for (let i = 0; i < this.dataTypeList.length; i++) {
  2387. if (this.dataTypeList[i].dictKey == cellValue) {
  2388. return this.dataTypeList[i].dictValue
  2389. }
  2390. }
  2391. return cellValue;
  2392. },
  2393. filterNode (value, data) {
  2394. if (!value) return true;
  2395. return data.title.indexOf(value) !== -1;
  2396. },
  2397. //#endregion
  2398. //#region wbs私有树排序
  2399. async sortpai (data) {
  2400. console.log(data);
  2401. await this.findWbsTreePrivateSameLevel({
  2402. parentId: data.parentId,
  2403. projectId: this.projectid,
  2404. wbsId: this.id
  2405. })
  2406. this.sortTag = true
  2407. this.sortTag2 = true
  2408. },
  2409. editSort () {
  2410. this.wbsTreePrivateSort()
  2411. },
  2412. bianhua () {
  2413. this.sortTag2 = false
  2414. this.$nextTick(() => {
  2415. this.sortTag2 = true
  2416. })
  2417. },
  2418. async wbsTreePrivateSort () {//wbs私有树节点手动排序
  2419. const { data: res } = await wbsTreePrivateSort(this.sort)
  2420. console.log(res);
  2421. if (res.code == 200) {
  2422. this.sortTag = false
  2423. this.sortTag2 = false
  2424. this.getLazytreessss()
  2425. }
  2426. },
  2427. async findWbsTreePrivateSameLevel (da) {//wbs私有树同级节点接口
  2428. const { data: res } = await findWbsTreePrivateSameLevel(da)
  2429. console.log(res);
  2430. if (res.code == 200) {
  2431. this.sort = res.data
  2432. }
  2433. },
  2434. async getLazytreessss () {
  2435. const { data: res } = await getLazytree(this.id, 0, this.userInfo.tenant_id, this.projectid)
  2436. console.log(res);
  2437. if (res.code == 200) {
  2438. this.treeData = res.data
  2439. }
  2440. },
  2441. //#endregion
  2442. //#region 关联清表
  2443. async getList (da) {//获取清表模板信息
  2444. const { data: res } = await getList(da)
  2445. console.log(res);
  2446. if (res.code === 200 && res.msg === '操作成功') {
  2447. this.GLExcelData = res.data.records
  2448. }
  2449. },
  2450. async tabLazytreeAll () {//清表树信息
  2451. this.GLExcelLoading = true;
  2452. const { data: res } = await tabLazytreeAll({
  2453. modeId: this.GLExcelFrom.name,
  2454. name: this.GLExcelFrom.search,
  2455. })
  2456. this.GLExcelLoading = false;
  2457. console.log(res);
  2458. if (res.code === 200 && res.msg === '操作成功') {
  2459. this.exceldata = res.data
  2460. }
  2461. },
  2462. Associationlist (scope) {//关联清表点击事件
  2463. console.log(scope.row);
  2464. this.GLExcel = true
  2465. this.getList({
  2466. current: 1,
  2467. size: 100000,
  2468. parentId: 0,
  2469. })
  2470. this.GLExcelFrom.name = scope.row.modeId
  2471. setTimeout(() => {
  2472. this.$refs.tree.setCheckedKeys([scope.row.excelId])
  2473. }, 2000)
  2474. this.GLExcelFrom.id = scope.row.pkeyId
  2475. this.GLExcelFrom.excelId = scope.row.excelId
  2476. this.GLExcelFrom.ids = scope.row.id
  2477. this.GLExcelFrom.initTableName = scope.row.initTableName
  2478. },
  2479. changetherr () {//清表类型选择框change事件
  2480. if (this.GLExcelFrom.name != "") {
  2481. this.GLExcelFrom.search = ''
  2482. this.tabLazytreeAll()
  2483. }
  2484. },
  2485. GLExcelMD () {//弹框关闭事件
  2486. this.GLExcelFrom.name = ""
  2487. this.GLExcelFrom.search = ''
  2488. this.GLExcelFrom.id = ''
  2489. this.exceldata = []
  2490. this.$refs.tree.setCheckedKeys([])
  2491. this.GLExcel = false
  2492. },
  2493. checkchange (data) {//节点选中回调
  2494. if (this.$refs.tree.getCheckedNodes().length === 0) {
  2495. this.$refs.tree.setCheckedKeys([])
  2496. } else if (this.$refs.tree.getCheckedNodes().length >= 1) {
  2497. this.$refs.tree.setCheckedKeys([data.id])
  2498. }
  2499. },
  2500. async saveLinkTab () {//保存按钮
  2501. let checkNodes = this.$refs.tree.getCheckedNodes();
  2502. if (checkNodes.length > 0) {
  2503. let node = checkNodes[checkNodes.length - 1];
  2504. if(node.fileType != 3){
  2505. this.$message({
  2506. type: "warning",
  2507. message: "请先上传Excel表"
  2508. });
  2509. return;
  2510. }
  2511. const { data: res } = await saveLinkTab({
  2512. exceTabId: node.id,
  2513. tabId: this.GLExcelFrom.id,
  2514. })
  2515. console.log(res);
  2516. if (res.code === 200) {
  2517. this.$message({
  2518. type: 'success',
  2519. message: '关联清表成功',
  2520. })
  2521. this.GLExcel = false
  2522. this.rightClick(this.GLExcelFrom.id, this.GLExcelFrom.excelId, this.GLExcelFrom.ids, this.GLExcelFrom.initTableName,)
  2523. }
  2524. } else {
  2525. this.$message({
  2526. type: 'warning',
  2527. message: '请先设置清表',
  2528. })
  2529. }
  2530. },
  2531. filterNode222 (value, data) {
  2532. if (!value) return true;
  2533. return data.name.indexOf(value) !== -1;
  2534. },
  2535. //#endregion
  2536. //#region 节点参数
  2537. nodeInfo (data) {//节点参数按钮
  2538. this.keymap()
  2539. //console.log(data)
  2540. this.jiedianId = data.primaryKeyId
  2541. this.parameters(data.primaryKeyId)
  2542. this.nodeInfoVisible = true;
  2543. },
  2544. addNodeInfoTable () {//添加节点参数数据
  2545. this.nodeInfoTable.unshift({ k: '', v: '', remark: '', wbsId: this.jiedianId, type: 1 })
  2546. },
  2547. delNodeInfo (key) {//设置参数名称中的删除按钮
  2548. this.namelists.splice(key, 1)
  2549. },
  2550. delNodeInfoss (key) {//节点参数
  2551. this.nodeInfoTable.splice(key, 1)
  2552. },
  2553. setNodeParameters () {//打开设置节点参数弹框按钮
  2554. this.infoNameVisible = true
  2555. this.namelists = [...this.namelist]
  2556. },
  2557. async setParameterName () {//设置参数名称中添加节点参数按钮
  2558. // wbsId: this.jiedianId
  2559. this.namelists.unshift({ name: '', remark: '', k: '', type: 0, })
  2560. },
  2561. async nodeInfoSave () {//节点参数弹框保存按钮
  2562. if (this.nodeInfoTable) {
  2563. if(this.nodeInfoTable.length == 0){
  2564. await this.saveOrUpdateBatch([{
  2565. "wbsId": this.jiedianId,
  2566. "type": -1,
  2567. }])
  2568. this.nodeInfoVisible = false
  2569. this.$message({
  2570. type: "success",
  2571. message: "保存参数节点成功!"
  2572. })
  2573. return;
  2574. }
  2575. let tag = true
  2576. this.nodeInfoTable.forEach(val => {
  2577. if (!val.k | !val.v) {
  2578. return tag = false
  2579. }
  2580. if(!val.name){
  2581. for (let i = 0; i < this.namelist.length; i++) {
  2582. if(this.namelist[i].k == val.k){
  2583. val.name = this.namelist[i].name;
  2584. return;
  2585. }
  2586. }
  2587. }
  2588. })
  2589. if (tag) {
  2590. await this.saveOrUpdateBatch(this.nodeInfoTable)
  2591. this.nodeInfoVisible = false
  2592. this.$message({
  2593. type: "success",
  2594. message: "设置参数节点成功!"
  2595. })
  2596. } else {
  2597. this.$message({
  2598. type: "error",
  2599. message: "请填写所有的参数名称和参数值!"
  2600. })
  2601. }
  2602. } else {
  2603. this.$message({
  2604. type: "error",
  2605. message: "请先设置参数节点!"
  2606. })
  2607. }
  2608. },
  2609. async addParameterName () {//设置参数名称中的保存按钮
  2610. if (this.namelists.length) {
  2611. let tag = true
  2612. this.namelists.forEach(val => {
  2613. if (!val.name || !val.k) {
  2614. return tag = false
  2615. }
  2616. })
  2617. if (tag) {
  2618. await this.saveOrUpdateBatch(this.namelists) //保存设置参数
  2619. this.infoNameVisible = false
  2620. this.keymap()
  2621. } else {
  2622. this.$message({
  2623. type: "error",
  2624. message: "请填写所有的参数名称和参数值KEY!"
  2625. })
  2626. }
  2627. } else {
  2628. this.$message({
  2629. type: "warning",
  2630. message: "请先添加参数"
  2631. })
  2632. }
  2633. },
  2634. closeParameter () {//设置参数名称,关闭按钮
  2635. this.namelists = []
  2636. this.infoNameVisible = false
  2637. },
  2638. async parameters (wbsId) {//获取接待你参数列表
  2639. const { data: res } = await parameters({ wbsId })
  2640. console.log(res);
  2641. if (res.code == 200) {
  2642. this.nodeInfoTable = res.data
  2643. }
  2644. },
  2645. async saveOrUpdateBatch (da) {//保存
  2646. const { data: res } = await saveOrUpdateBatch(da)
  2647. console.log(res);
  2648. },
  2649. async keymap () {//节点参数枚举
  2650. const { data: res } = await keymap()
  2651. console.log(res);
  2652. if (res.code == 200) {
  2653. this.namelist = res.data
  2654. }
  2655. },
  2656. //#endregion
  2657. //#region 调整表单
  2658. adjustExcel (pkeyId, excelId) {//调整表单
  2659. this.GLExcelFrom.id = pkeyId
  2660. this.getExcelHtml(pkeyId)
  2661. },
  2662. async getExcelHtml (pkeyId) {
  2663. const { data: res } = await getExcelHtml({ pkeyId })
  2664. console.log(res);
  2665. if (res.code === 200) {
  2666. localStorage.setItem('excelHtml', res.data)
  2667. this.adjustmentExcel = res.data
  2668. this.excelHtml = true
  2669. }
  2670. },
  2671. removeExcel () {
  2672. this.excelHtml = false
  2673. },
  2674. //#endregion
  2675. //#region 编辑元素
  2676. async rightClick (pkeyId, excelId, id, initTableName) {
  2677. await this.getExcelHtml2(pkeyId)
  2678. // this.$router.push({
  2679. // path: '/project/editElement',
  2680. // query: {
  2681. // pkeyId: pkeyId,
  2682. // excelId: excelId,
  2683. // id: id,
  2684. // initTableName,
  2685. // pid: this.$route.query.pid,
  2686. // wbsid: this.$route.query.wbsid,
  2687. // nodeid:this.curTreeData.id,
  2688. // }
  2689. // })
  2690. this.editElementQuery.pkeyId = pkeyId;
  2691. this.editElementQuery.excelId = excelId;
  2692. this.editElementQuery.id = id;
  2693. this.editElementQuery.initTableName = initTableName;
  2694. this.editElementQuery.pid = this.$route.query.pid;
  2695. this.editElementQuery.wbsid = this.$route.query.wbsid;
  2696. this.editElementQuery.nodeid = this.curTreeData.id;
  2697. this.editElementVisible = true;
  2698. },
  2699. async getExcelHtml2 (pkeyId) {
  2700. const { data: res } = await getExcelHtml({ pkeyId })
  2701. console.log(res);
  2702. if (res.code === 200) {
  2703. localStorage.setItem('editElement', res.data)
  2704. }
  2705. },
  2706. //#endregion
  2707. //#region 元素表单信息
  2708. editEditElementForm () {//标记元素
  2709. if (this.formData.length) {
  2710. let da = []
  2711. this.formDatass = [...this.formData]
  2712. this.formDatass.forEach(val => {
  2713. da.push({
  2714. tableType: val.tableType - 0,
  2715. tableOwner: val.tableOwner - 0,
  2716. pkeyId: val.pkeyId,
  2717. tableName: val.tableName,
  2718. fillRate: val.fillRate,
  2719. })
  2720. })
  2721. this.formDatass = da
  2722. this.editElementFormTag = true
  2723. }
  2724. },
  2725. editeditElementFormMF () {//保存按钮
  2726. let da = []
  2727. let tag = true
  2728. this.formDatass.forEach(val => {
  2729. if (!val.tableName || !val.tableType || !val.tableOwner) {
  2730. tag = false
  2731. return
  2732. } else {
  2733. da.push({
  2734. pkeyId: val.pkeyId,
  2735. nodeName: val.tableName,
  2736. tableType: val.tableType,
  2737. tableOwner: val.tableOwner,
  2738. fillRate: val.fillRate,
  2739. })
  2740. }
  2741. })
  2742. if (tag) {
  2743. this.updateBatchNodeTableInfo2(da)
  2744. } else {
  2745. this.$message({
  2746. type: 'success',
  2747. message: '请填写完整元素表单的所有信息!',
  2748. })
  2749. }
  2750. },
  2751. async updateBatchNodeTableInfo2 (da) {//共有编辑元素
  2752. const { data: res } = await updateBatchNodeTableInfo2(da)
  2753. console.log(res);
  2754. if (res.code == 200) {
  2755. this.editElementFormTag = false
  2756. this.updateNodeTable()
  2757. }
  2758. },
  2759. //#endregion
  2760. //获取节点展开路径
  2761. getExpandedKeys(node){
  2762. //console.log(node)
  2763. let expandedKeys = [];
  2764. while(node.parent){
  2765. expandedKeys.push(node.data.id);
  2766. node = node.parent;
  2767. }
  2768. setStore({
  2769. name:this.expandName,
  2770. content:expandedKeys,
  2771. type:true//sessionStorage
  2772. })
  2773. //console.log(expandedKeys)
  2774. },
  2775. //触发节点参数
  2776. nodeInfoHandle(){
  2777. if(!this.curTreeData.id){
  2778. this.$message({
  2779. type: "warning",
  2780. message: "请先选择节点"
  2781. })
  2782. return;
  2783. }
  2784. this.nodeInfo(this.curTreeData)
  2785. },
  2786. eleFormulaHandle(){
  2787. if(!this.curTreeData.id || !this.curTreeNode.id){
  2788. this.$message({
  2789. type: "warning",
  2790. message: "请先选择节点"
  2791. })
  2792. return;
  2793. }
  2794. this.setLeftType(4,this.curTreeData,this.curTreeNode);
  2795. // this.showType = 2;
  2796. },
  2797. editNodeHandle(){
  2798. if(!this.curTreeData.id || !this.curTreeNode.id){
  2799. this.$message({
  2800. type: "warning",
  2801. message: "请先选择节点"
  2802. })
  2803. return;
  2804. }
  2805. this.mixRatioTestIds = []
  2806. this.nodeTypeChange(53)
  2807. this.setLeftType(2,this.curTreeData,this.curTreeNode)
  2808. },
  2809. copyNodeHandle(){
  2810. if(!this.curTreeData.id || !this.curTreeNode.id){
  2811. this.$message({
  2812. type: "warning",
  2813. message: "请先选择节点"
  2814. })
  2815. return;
  2816. }
  2817. },
  2818. delNodeHandle(){
  2819. if(!this.curTreeData.id || !this.curTreeNode.id){
  2820. this.$message({
  2821. type: "warning",
  2822. message: "请先选择节点"
  2823. })
  2824. return;
  2825. }
  2826. if(this.curTreeNode.level == 1){
  2827. this.$message({
  2828. type: "warning",
  2829. message: "当前节点无法删除"
  2830. })
  2831. return;
  2832. }
  2833. this.deleNode(this.curTreeData,this.curTreeNode)
  2834. },
  2835. eleHandle(){
  2836. if(!this.curTreeData.id || !this.curTreeNode.id){
  2837. this.$message({
  2838. type: "warning",
  2839. message: "请先选择节点"
  2840. })
  2841. return;
  2842. }
  2843. this.setLeftType(5,this.curTreeData,this.curTreeNode);
  2844. },
  2845. syncInfoHandle(){
  2846. this.$confirm('是否同步节点参数?', '提示', {
  2847. confirmButtonText: '确定',
  2848. cancelButtonText: '取消',
  2849. type: 'warning'
  2850. }).then(() => {
  2851. this.syncBtnLoad = true;
  2852. syncNodeParam(this.projectid).then(() => {
  2853. this.$message({
  2854. type: "success",
  2855. message: "同步成功!"
  2856. });
  2857. }).finally(()=>{
  2858. this.syncBtnLoad = false;
  2859. })
  2860. })
  2861. },
  2862. //显示别名弹窗
  2863. aliasShow(){
  2864. this.aliasVisible = true;
  2865. if(this.nodeDetail.fullName){
  2866. this.aliasArr = this.nodeDetail.fullName.split(',');
  2867. }else{
  2868. this.aliasArr = [];
  2869. }
  2870. this.aliasInput = '';
  2871. },
  2872. addAlias(){
  2873. if(this.aliasInput){
  2874. this.aliasArr.push(this.aliasInput);
  2875. this.aliasInput = '';
  2876. }
  2877. },
  2878. delAlias(index){
  2879. this.aliasArr.splice(index,1);
  2880. },
  2881. saveAliasHandle(){
  2882. this.nodeDetail.fullName = this.aliasArr.join(',');
  2883. if (this.editType == 1) {
  2884. //新增
  2885. this.aliasVisible = false;
  2886. } else if (this.editType == 2) {
  2887. //编辑 私有
  2888. privateSubmitFullName(
  2889. this.nodeDetail.pKeyId,this.nodeDetail.fullName
  2890. ).then(()=>{
  2891. this.$message({
  2892. type: 'success',
  2893. message: '保存成功',
  2894. })
  2895. this.aliasVisible = false;
  2896. })
  2897. }
  2898. },
  2899. syncNodeTableHandle(data){
  2900. this.$confirm('是否同步节点【'+data.title+'】?', '提示', {
  2901. confirmButtonText: '确定',
  2902. cancelButtonText: '取消',
  2903. type: 'warning'
  2904. }).then(() => {
  2905. let notify = this.$notify({
  2906. title: '提示',
  2907. message: '节点数据同步中...',
  2908. duration: 0
  2909. });
  2910. syncNodeTable(data.primaryKeyId).then(()=>{
  2911. this.updateNodeTable();
  2912. this.$message({
  2913. type: 'success',
  2914. message: '同步成功',
  2915. })
  2916. }).catch(()=>{
  2917. this.$message({
  2918. type: "error",
  2919. message: "同步失败"
  2920. })
  2921. }).finally(()=>{
  2922. notify.close();
  2923. })
  2924. })
  2925. },
  2926. typeTreeLoadNode (node, resolve) {
  2927. let pid = 0;
  2928. if (node.level != 0) {
  2929. pid = node.data.id
  2930. }
  2931. tabTypeLazyTree(pid,this.projectid).then((res) => {
  2932. let arr = [];
  2933. if (Array.isArray(res.data.data)) {
  2934. arr = res.data.data;
  2935. }
  2936. return resolve(arr);
  2937. })
  2938. },
  2939. getTypeTreeDetail(){
  2940. },
  2941. },
  2942. watch: {
  2943. 'GLExcelFrom.search' (val) {
  2944. console.log(val);
  2945. if (this.exceldata) {
  2946. this.$refs.tree.filter(val);
  2947. }
  2948. }
  2949. },
  2950. components: {
  2951. dynamicExcel,
  2952. ManualSorting,
  2953. FormulaEdit,
  2954. EditElement
  2955. },
  2956. };
  2957. </script>
  2958. <style scoped lang="scss">
  2959. .font-s-12 /deep/ .iconfont {
  2960. font-size: 12px;
  2961. }
  2962. .el-popper[x-placement^="bottom"] {
  2963. margin-top: -6px;
  2964. }
  2965. .right-btn {
  2966. position: absolute;
  2967. right: 20px;
  2968. top: 10px;
  2969. font-size: 20px;
  2970. }
  2971. .custom-tree-node {
  2972. .normal-black {
  2973. display: none;
  2974. }
  2975. &:hover {
  2976. .normal-black {
  2977. display: inline-block;
  2978. }
  2979. }
  2980. &.show .normal-black {
  2981. display: inline-block;
  2982. }
  2983. }
  2984. .excelBox {
  2985. /deep/.el-dialog__body {
  2986. padding: 20px;
  2987. }
  2988. }
  2989. //调整表单样式
  2990. .excelHtml {
  2991. position: absolute;
  2992. z-index: 999999;
  2993. top: 50px;
  2994. left: 0px;
  2995. width: 100%;
  2996. height: 100%;
  2997. }
  2998. .jiedian {
  2999. /deep/.el-dialog__body {
  3000. padding: 10px 20px !important;
  3001. }
  3002. }
  3003. .filter-tree {
  3004. min-width: 100%;
  3005. display: inline-block;
  3006. }
  3007. .full-dialog{
  3008. /deep/ .el-dialog__body{
  3009. padding-bottom: 0;
  3010. padding-top: 0;
  3011. }
  3012. /deep/ .basic-container{
  3013. height: calc(100vh - 60px);
  3014. }
  3015. }
  3016. .my-basic-con {
  3017. padding: 6px 6px;
  3018. }
  3019. </style>