tree.vue 94 KB

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