tree.vue 112 KB

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