tree.vue 111 KB

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