tree.vue 110 KB

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