tree.vue 128 KB

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