tree.vue 159 KB

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