tree.vue 117 KB

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