tree.vue 161 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491
  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" v-loading="refreshLoading||refreshLoading1">
  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" @click="refreshData" v-loading="refreshLoading" v-if="!isAdd">刷新数据</el-link>
  1988. <el-link type="primary" @click="refreshData1" v-loading="refreshLoading1" v-else>刷新数据</el-link>
  1989. </div>
  1990. </div>
  1991. </el-dialog>
  1992. <!-- 同步表单其他配置 -->
  1993. <el-dialog
  1994. title="同步表单其他配置"
  1995. :visible.sync="syncTableDialog"
  1996. width="70%"
  1997. append-to-body
  1998. :close-on-click-modal="false"
  1999. >
  2000. <div class="sync-container">
  2001. <el-card class="box-card-1" :style="{ width: isShowLeft ? '40%' : '0%' }">
  2002. <el-scrollbar style="height: 100%;">
  2003. <div >
  2004. <el-tree
  2005. class="filter-tree"
  2006. lazy
  2007. :load="loadNode"
  2008. @node-click="handleNodeClick"
  2009. :props="defaultProps"
  2010. :expand-on-click-node="false"
  2011. highlight-current
  2012. node-key="primaryKeyId"
  2013. >
  2014. </el-tree>
  2015. </div>
  2016. </el-scrollbar>
  2017. </el-card>
  2018. <el-card class="box-card-2">
  2019. <div class="table-box">
  2020. <h4 style="margin-left: 4px;">表单预览</h4>
  2021. <el-table
  2022. size="small"
  2023. ref="proTable1"
  2024. :data="preTableData1"
  2025. stripe
  2026. style="width: 100%"
  2027. max-height="300"
  2028. @selection-change="handleSelectionChange1"
  2029. >
  2030. <el-table-column
  2031. type="selection"
  2032. width="55">
  2033. </el-table-column>
  2034. <el-table-column
  2035. prop="tableName"
  2036. label="表单名称"
  2037. width="180">
  2038. </el-table-column>
  2039. <el-table-column
  2040. prop="tableType"
  2041. :formatter="formatTableType"
  2042. label="表单类型"
  2043. width="180">
  2044. </el-table-column>
  2045. <el-table-column
  2046. prop="tableOwner"
  2047. :formatter="formatOwner"
  2048. label="所属方">
  2049. </el-table-column>
  2050. </el-table>
  2051. </div>
  2052. </el-card>
  2053. </div>
  2054. <span slot="footer" class="dialog-footer">
  2055. <el-button @click="syncTableDialog = false">取 消</el-button>
  2056. <el-button type="primary" @click="saveTableSync" :loading="saveTableSyncLoad">确 定</el-button>
  2057. </span>
  2058. </el-dialog>
  2059. </div>
  2060. </template>
  2061. <script>
  2062. import ManualSorting from "@/components/WbsTree/ManualSorting";
  2063. import dynamicExcel from "./treeTemplate/dynamicExcel.vue";
  2064. import FormulaEdit from "@/views/formula/edit.vue";
  2065. import FormulaEditone from "@/views/formula/edit1.vue";
  2066. import EditElement from "@/views/manager/projectinfo/editElement/editElement.vue";
  2067. import {
  2068. saveFormAndElement,
  2069. selectFormElements,
  2070. importWbsTree,
  2071. findWbsTreePrivateSameLevel,
  2072. wbsTreePrivateSort,
  2073. parameters,
  2074. saveOrUpdateBatch,
  2075. keymap,
  2076. updateBatchNodeTableInfo2,
  2077. updateStatus,
  2078. getParamElements,
  2079. specifiedParamElements,
  2080. delParamElements,
  2081. selectPrivateFormElements,
  2082. syncCurrentFormInProject,
  2083. getQueryValueByType,
  2084. } from "@/api/manager/wbstree";
  2085. import {
  2086. saveElement,
  2087. remove as removeElement,
  2088. updateBatchElements,
  2089. getTemplate,
  2090. importWbsElement,
  2091. } from "@/api/manager/wbsformelement";
  2092. import {
  2093. getLazytree,
  2094. getDetail,
  2095. update,
  2096. findNodeTableByCondition as selectByNodeTable,
  2097. removeTableByCondition as removeTableById,
  2098. removePrivateTreeNode,
  2099. wbsTreePrivateTableSort,
  2100. privateSubmitFullName,
  2101. syncNodeParam,
  2102. syncProjecteVisa,
  2103. syncNodeTable,
  2104. syncNodeinfo,
  2105. tabTypeLazyTree,
  2106. syncContractTabSort,
  2107. linkNodeTree,
  2108. getLinekNodeTreelist,getNameRule,getTitleRange,saveOrUpdateNameRule,deletedNameRule
  2109. } from "@/api/manager/wbsprivate";
  2110. import { findProjectTree as getAlltree } from "@/api/manager/projectinfo";
  2111. import { refrehPram } from "@/api/manager/wbstree";
  2112. import { getList as getAttchFromOriginalName } from "@/api/resource/attach";
  2113. import { getDictionary, getChildList } from "@/api/system/dict";
  2114. import { mapGetters } from "vuex";
  2115. import {
  2116. getList,
  2117. tabLazytreeAll,
  2118. saveLinkTab,
  2119. getExcelHtml,
  2120. } from "@/api/exctab/excelmodel";
  2121. import { getStore, setStore } from "@/util/store";
  2122. import { getTempProject,addSync,getNodeStatus } from "@/api/manager/ledger";
  2123. import { selectByNodeTable as findNodeTableByCondition1 } from "@/api/manager/wbstree";
  2124. export default {
  2125. data() {
  2126. var checkMajorDataType = (rule, value, callback) => {
  2127. //console.log(this.nodeDetail.nodeType)
  2128. //console.log(this.nodeDetail.majorDataType)
  2129. if (this.nodeDetail.nodeType == 6) {
  2130. if (!this.nodeDetail.majorDataType) {
  2131. callback(new Error("工序节点必须选择内业资料类型"));
  2132. }
  2133. }
  2134. callback();
  2135. };
  2136. return {
  2137. fromcurNode: {},
  2138. formDatass: [],
  2139. editElementFormTag: false,
  2140. editeditElementFormMFLoading: false,
  2141. jiedianId: "",
  2142. //#region
  2143. sortTag: false,
  2144. sortTag2: false,
  2145. sureSortload: false,
  2146. surePrivateSortload: false,
  2147. sort: [],
  2148. //#endregion
  2149. //#region 关联清表
  2150. loading: false,
  2151. GLExcel: false,
  2152. GLExcelFrom: {
  2153. id: "",
  2154. name: "",
  2155. search: "", //搜素框舒服的值
  2156. ids: "",
  2157. excelId: "",
  2158. initTableName: "",
  2159. initTableId: "",
  2160. },
  2161. GLExcelData: [], //
  2162. GLExcelProps: {
  2163. label: "name",
  2164. children: "children",
  2165. disabled: "hasChildren",
  2166. isLeaf: function (data) {
  2167. let tag = false;
  2168. if (!data.hasChildren) {
  2169. tag = true;
  2170. }
  2171. if (data.isExistForm == 1) {
  2172. tag = true;
  2173. }
  2174. return tag;
  2175. },
  2176. },
  2177. exceldata: [], //清表模板
  2178. GLExcelLoading: false,
  2179. //#endregion
  2180. //#region 调整表单
  2181. adjustmentExcel: "",
  2182. excelHtml: false,
  2183. //#endregion
  2184. //#region
  2185. id: "",
  2186. projectid: "",
  2187. filterText: "",
  2188. treeData: [],
  2189. searchType: "1",
  2190. isSearch: false,
  2191. searchTreeData: [],
  2192. searchtreeLoad: false,
  2193. treeLoad: false,
  2194. menuShow: false,
  2195. defaultProps: {
  2196. children: "children",
  2197. label: "title",
  2198. isLeaf: function (data) {
  2199. //console.log(data, !data.hasChildren, data.isExistForm);
  2200. let tag = false;
  2201. if (!data.hasChildren) {
  2202. tag = true;
  2203. }
  2204. /*if (data.isExistForm == 1) {
  2205. tag = true;
  2206. }*/
  2207. if (data.nodeType >= 6 && data.nodeType <= 13) {
  2208. tag = true;
  2209. }
  2210. //中间交工。开工报告、质量评定)
  2211. if (
  2212. data.majorDataType == 1 ||
  2213. data.majorDataType == 2 ||
  2214. data.majorDataType == 3
  2215. ) {
  2216. tag = true;
  2217. }
  2218. return tag;
  2219. // return !data.hasChildren || (data.isExistForm == 1);
  2220. },
  2221. },
  2222. leftType: 5,
  2223. curTreeData: {},
  2224. curTreeNode: {},
  2225. tableData: [],
  2226. nodeDetail: {},
  2227. formData: [],
  2228. editType: 1,
  2229. dialogVisible: false,
  2230. saveNodeLoading: false,
  2231. nodeTypelist1: [],
  2232. majorDataTypeList: [],
  2233. rules: {
  2234. nodeName: [
  2235. { required: true, message: "请输入节点名称", trigger: "blur" },
  2236. ],
  2237. nodeType: [
  2238. { required: true, message: "请选择节点类型", trigger: "change" },
  2239. ],
  2240. majorDataType: [{ validator: checkMajorDataType, trigger: "change" }],
  2241. isAddConceal: [
  2242. {
  2243. required: true,
  2244. message: "请选择是否新增中隐藏",
  2245. trigger: "change",
  2246. },
  2247. ],
  2248. },
  2249. eleVisible: false,
  2250. tableTypelist: [],
  2251. dataTypeList: [],
  2252. ownerTypeList: [],
  2253. eleForm: {
  2254. elementList: [],
  2255. },
  2256. eleRules: {
  2257. nodeName: [
  2258. { required: true, message: "请输入表名称", trigger: "blur" },
  2259. ],
  2260. tableType: [
  2261. { required: true, message: "请选择表类型", trigger: "change" },
  2262. ],
  2263. tableOwner: [
  2264. { required: true, message: "请选择所属方", trigger: "change" },
  2265. ],
  2266. },
  2267. importVisible: false,
  2268. tempList: [],
  2269. curEleTable: {},
  2270. istableType: true,
  2271. editEleVisible: false,
  2272. editEleList: [],
  2273. eleReg: /(≥|≤|±|【】)?([^≥≤±【】]*)/,
  2274. editEleFormulaVisible: false,
  2275. isMeter: false,
  2276. formulaInput: "",
  2277. editEleListFilter: [],
  2278. editEleListAll: [],
  2279. importTemplateVisible: false,
  2280. fileUrl: "",
  2281. upFile: null,
  2282. importLoading: false,
  2283. nodeInfoVisible: false,
  2284. nodeInfoTable: [],
  2285. nodeInfoTableLoad: false,
  2286. namelist: [],
  2287. namelists: [],
  2288. delids: [],
  2289. infoNameVisible: false,
  2290. excelSortTag: false,
  2291. excelSortTag2: false,
  2292. tableSortList: [],
  2293. //#endregion
  2294. defaultExpandedKeys: [],
  2295. expandName: this.$route.fullPath,
  2296. aliasVisible: false, //别名
  2297. aliasInput: "",
  2298. aliasArr: [],
  2299. formulaCompVisible: false, //公式弹框
  2300. formulaCompVisible1: false,
  2301. formulaCurRow: {}, //当前元素
  2302. editElementVisible: false, //编辑元素弹框
  2303. editElementQuery: {
  2304. pkeyId: "",
  2305. excelId: "",
  2306. id: "",
  2307. initTableName: "",
  2308. initTableId: "",
  2309. pid: "",
  2310. wbsid: "",
  2311. nodeid: "",
  2312. }, //传参
  2313. syncBtnLoad: false,
  2314. syncElectricLoad: false,
  2315. showType: 1,
  2316. typeTreeData: [],
  2317. testTreeLoad: false,
  2318. testTreeData: [],
  2319. mixRatioTestIds: [],
  2320. //节点参数,关联元素
  2321. curParam: {}, //当前节点参数
  2322. linkEleVisible: false,
  2323. linkEleTableList: [], //元素表数组
  2324. curLinkEleTable: {}, //当前元素表
  2325. linkCheckVisible: false, //关联弹框
  2326. linkEleList: [], //元素数组
  2327. linkEleKey: "", //搜索关键字
  2328. menusData: [
  2329. // {icon: 'el-icon-s-promotion', label: '新增节点', key: "add"},
  2330. {
  2331. icon: "el-icon-s-promotion",
  2332. label: "编辑节点",
  2333. key: "edit",
  2334. content: "编辑节点",
  2335. },
  2336. {
  2337. icon: "el-icon-upload",
  2338. label: "后管数据同步",
  2339. key: "sync1",
  2340. content: "后管数据同步",
  2341. },
  2342. {
  2343. icon: "el-icon-upload",
  2344. label: "同步到合同段",
  2345. key: "sync3",
  2346. content: "同步到合同段",
  2347. },
  2348. {
  2349. icon: "el-icon-sort",
  2350. label: "调整排序",
  2351. key: "sort",
  2352. content: "调整排序",
  2353. },
  2354. {
  2355. icon: "el-icon-s-promotion",
  2356. label: "删除节点",
  2357. key: "del",
  2358. content: "删除节点",
  2359. },
  2360. ], //树组件操作菜单
  2361. menuvisible: false,
  2362. menuleft: 20,
  2363. menutop: 0,
  2364. //同步菜单按钮
  2365. menuoptions: [
  2366. {
  2367. value: "jdSync",
  2368. label: "节点参数同步",
  2369. load: false,
  2370. },
  2371. {
  2372. value: "dqSync",
  2373. label: "电签同步",
  2374. load: false,
  2375. },
  2376. {
  2377. value: "gsSync",
  2378. label: "公式同步",
  2379. load: false,
  2380. },
  2381. // {
  2382. // value: "zdSync",
  2383. // label: "字典同步",
  2384. // load: false,
  2385. // },
  2386. ],
  2387. menuvalue: "",
  2388. isshowSyncbtn: false,
  2389. projectName: "",
  2390. nodeInfoSaveload: false,
  2391. handlesyncLoad: false, //表单同步
  2392. isLinkNodes: false,
  2393. linkNodesLoad: false,
  2394. checkedLinkNodesKeys: [],
  2395. rowPkeyId: "",
  2396. nodesCheck: [],
  2397. standardTypeOptions: [], //标准分类
  2398. unitOptions: [], //单位名称
  2399. editDialogShow: false, //编辑元素
  2400. searchinput: "",
  2401. editTable: [],
  2402. editEleTableloading: false,
  2403. dynamicDictList: [],
  2404. saveLoading: false,
  2405. fileTitleVisible:false,
  2406. deCheckTreeKeys:[],
  2407. fileTableData:[
  2408. ],
  2409. fileTitleRef:null,
  2410. fileTitleModel:{
  2411. type:'',
  2412. },
  2413. fileTreeLoading:false,
  2414. fileTreeData:[],
  2415. filedefaultProps:{
  2416. children: 'children',
  2417. label: 'nodeName',
  2418. disabled:function (data) {
  2419. return data.status===11 ;
  2420. },
  2421. },
  2422. fileTitleRules:{
  2423. type: [
  2424. { required: true, message: '请选择题名范围', trigger: 'blur' },
  2425. ],
  2426. },
  2427. fileTableLoading:false,
  2428. chooseFileVisible:false,
  2429. chooseFileRow: {},
  2430. chooseFileIndex: -1,
  2431. isShowSize:true,
  2432. selectDiv:Math.random(),
  2433. saveFileLoading:false,
  2434. proSyncTag:false,
  2435. rangeOptions:[],
  2436. typeOptions:[],
  2437. checkAll: false,
  2438. isIndeterminate: true,
  2439. syncForm:{
  2440. range:'',
  2441. rangeName:'',
  2442. type:[],
  2443. typeName:'',
  2444. templateId:'',
  2445. templateName:'',
  2446. contractRange:[],
  2447. contractRangeName:'',
  2448. formIds:''
  2449. },
  2450. preTableData:[],
  2451. multipleSelection: [],
  2452. checkIdList:[
  2453. ],
  2454. isShowLeft:false,
  2455. isShowTable:false,
  2456. templateIdList:[],//同步源
  2457. saveProTagLoading:false,
  2458. syncTableDialog:false,
  2459. preTableData1:[],
  2460. formIds:'',
  2461. saveTableSyncLoad:false,
  2462. checkRow:null,
  2463. syncListDialog:false,
  2464. refreshLoading:false,
  2465. syncListData:{
  2466. nodeNum:'',//同步节点数量
  2467. nodeNumEnd:''//已同步数量
  2468. },
  2469. isAdd:'',
  2470. refreshLoading1:false,
  2471. };
  2472. },
  2473. computed: {
  2474. ...mapGetters(["userInfo"]),
  2475. },
  2476. created() {
  2477. this.init();
  2478. //console.log(this.userInfo)
  2479. },
  2480. methods: {
  2481. //#region
  2482. init() {
  2483. //this.id = this.$route.query.wbsid;
  2484. //this.projectid = this.$route.query.pid;
  2485. const { wbsid, pid, type } = this.$route.query;
  2486. this.id = wbsid;
  2487. this.projectid = pid;
  2488. this.wbsType = type ? Number(type) : 1;
  2489. this.getNodeTypelistData()
  2490. this.getNodeTypelist();
  2491. this.getTableTypelist();
  2492. this.getDataTypelist();
  2493. this.getOwnerTypelist();
  2494. this.getStandardTypeOptions();
  2495. this.getMajorDataTypeList();
  2496. this.defaultExpandedKeys = getStore({ name: this.expandName });
  2497. this.projectName = this.$route.query.projectName;
  2498. },
  2499. loadNode(node, resolve) {
  2500. let pid = 0;
  2501. if (node.level != 0) {
  2502. pid = node.data.id;
  2503. }
  2504. const type = this.wbsType;
  2505. getLazytree(this.id, pid, this.userInfo.tenant_id, this.projectid, {
  2506. wbsType: type,
  2507. }).then((res) => {
  2508. let arr = [];
  2509. if (Array.isArray(res.data.data)) {
  2510. arr = res.data.data;
  2511. }
  2512. return resolve(arr);
  2513. });
  2514. },
  2515. getNodeDetail(data, node) {
  2516. console.log("getNodeDetail", data);
  2517. let parentName = "";
  2518. if (node.parent.data) {
  2519. parentName = node.parent.data.title;
  2520. }
  2521. this.curTreeData = data;
  2522. this.curTreeNode = node;
  2523. this.curTreeData.parentName = parentName;
  2524. getDetail(data.id, this.id, this.projectid).then((res) => {
  2525. res.data.data.parentName = parentName;
  2526. let tableObj=res.data.data;
  2527. tableObj.primaryKeyId=data.primaryKeyId
  2528. this.tableData = [res.data.data];
  2529. this.nodeDetail = Object.assign({}, res.data.data);
  2530. });
  2531. this.updateNodeTable();
  2532. // this.nodeTypeChange(data.nodeType)
  2533. //获取节点展开路径
  2534. this.getExpandedKeys(node);
  2535. },
  2536. saveNode() {
  2537. const type = this.wbsType;
  2538. this.$refs["nodeDetail"].validate((valid) => {
  2539. if (valid) {
  2540. const { mixRatioTestIds, nodeType } = this.nodeDetail;
  2541. if (type === 2 && nodeType === 53) {
  2542. if (mixRatioTestIds) {
  2543. if (this.editType == 1) {
  2544. this.addNode();
  2545. } else if (this.editType == 2) {
  2546. this.updateNode();
  2547. }
  2548. } else {
  2549. this.$message({
  2550. type: "error",
  2551. message: "请先选择节点",
  2552. });
  2553. return false;
  2554. }
  2555. } else {
  2556. if (this.editType == 1) {
  2557. this.addNode();
  2558. } else if (this.editType == 2) {
  2559. this.updateNode();
  2560. }
  2561. }
  2562. } else {
  2563. console.log("error submit!!");
  2564. return false;
  2565. }
  2566. });
  2567. },
  2568. addNode() {
  2569. this.saveNodeLoading = true;
  2570. update(this.nodeDetail).then(() => {
  2571. this.updateTreeNewNode();
  2572. this.dialogVisible = false;
  2573. this.$message({
  2574. type: "success",
  2575. message: "新增成功!",
  2576. });
  2577. });
  2578. },
  2579. updateNode() {
  2580. update(this.nodeDetail).then(() => {
  2581. let node = this.tableData[0];
  2582. node.nodeName = this.nodeDetail.nodeName;
  2583. node.nodeType = this.nodeDetail.nodeType;
  2584. this.curTreeData.title = this.nodeDetail.nodeName;
  2585. this.dialogVisible = false;
  2586. this.$message({
  2587. type: "success",
  2588. message: "修改成功!",
  2589. });
  2590. });
  2591. },
  2592. toSplit(val) {
  2593. return val ? String(val).split(",") : "";
  2594. },
  2595. setLeftType(type, data, node) {
  2596. this.jiedianId = data.id;
  2597. this.getNodeTypelistData()
  2598. if (type == 4 || type == 5) {
  2599. this.leftType = type;
  2600. }
  2601. this.curTreeData = data;
  2602. this.curTreeNode = node;
  2603. this.$refs.tree.setCurrentKey(data.id);
  2604. if (type == 1 || type == 2) {
  2605. this.getMajorDataTypeList();
  2606. this.dialogVisible = true;
  2607. this.editType = type;
  2608. }
  2609. getDetail(data.id, this.id, this.projectid).then((res) => {
  2610. let parentName = "";
  2611. if (node.parent.data) {
  2612. parentName = node.parent.data.title;
  2613. }
  2614. res.data.data.parentName = parentName;
  2615. this.tableData = [res.data.data];
  2616. if (type == 1) {
  2617. this.nodeDetail = {
  2618. parentId: res.data.data.id,
  2619. parentName: parentName,
  2620. projectId: res.data.data.projectId,
  2621. };
  2622. } else {
  2623. this.nodeDetail = Object.assign({}, res.data.data);
  2624. this.mixRatioTestIds = this.toSplit(res.data.data.mixRatioTestIds);
  2625. }
  2626. this.nodeDetail.type = 1; // '1'节点 '2'表单
  2627. this.nodeDetail.wbsId = this.id;
  2628. this.nodeDetail.tenantId = this.userInfo.tenant_id;
  2629. this.changeStandType(this.nodeDetail.className);
  2630. });
  2631. if (this.leftType == 4) {
  2632. selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
  2633. if (res.data.data.length) {
  2634. this.formData = res.data.data;
  2635. } else {
  2636. this.formData = [];
  2637. }
  2638. });
  2639. }
  2640. //获取节点展开路径
  2641. this.getExpandedKeys(node);
  2642. },
  2643. showFormElement() {
  2644. if (!this.nodeDetail.id) {
  2645. this.$message({
  2646. type: "warning",
  2647. message: "请先选择在哪个节点下创建表",
  2648. });
  2649. return;
  2650. }
  2651. this.eleVisible = true;
  2652. },
  2653. addEleRow(list) {
  2654. list.push({});
  2655. },
  2656. delEleRow(index, list) {
  2657. list.splice(index, 1);
  2658. },
  2659. saveFormAndElementHandle() {
  2660. this.$refs["eleDialog"].validate((valid) => {
  2661. if (valid) {
  2662. this.eleForm.wbsId = this.id;
  2663. this.eleForm.tenantId = this.userInfo.tenant_id;
  2664. this.eleForm.nodeType = -1;
  2665. this.eleForm.type = 2; // '1'节点 '2'表单
  2666. this.eleForm.parentId = this.nodeDetail.id;
  2667. this.eleForm.elementList.forEach((element) => {
  2668. element.eAllowDeviation =
  2669. (element.allow ? element.allow : "") +
  2670. (element.deviation ? element.deviation : "");
  2671. if (element.eType == 4) {
  2672. element.eLength = 0;
  2673. }
  2674. });
  2675. saveFormAndElement(this.eleForm).then(() => {
  2676. //console.log(res)
  2677. this.updateTreeNewNode();
  2678. this.updateNodeTable();
  2679. this.eleVisible = false;
  2680. this.$message({
  2681. type: "success",
  2682. message: "新增成功!",
  2683. });
  2684. });
  2685. } else {
  2686. console.log("error submit!!");
  2687. return false;
  2688. }
  2689. });
  2690. },
  2691. updateTreeNewNode() {
  2692. getLazytree(
  2693. this.id,
  2694. this.nodeDetail.parentId,
  2695. this.userInfo.tenant_id,
  2696. this.projectid
  2697. ).then((res) => {
  2698. this.$refs.tree.updateKeyChildren(
  2699. this.nodeDetail.parentId,
  2700. res.data.data
  2701. );
  2702. });
  2703. },
  2704. updateNodeTable() {
  2705. selectByNodeTable(this.curTreeData.id, this.projectid, this.id).then(
  2706. (res) => {
  2707. if (res.data.data && res.data.data.length) {
  2708. this.formData = res.data.data;
  2709. this.formData.forEach((ele) => {
  2710. ele.nodeType = Number(ele.nodeType);
  2711. });
  2712. } else {
  2713. this.formData = [];
  2714. }
  2715. }
  2716. );
  2717. },
  2718. deleNode(data, node) {
  2719. let pid = data.primaryKeyId ? data.primaryKeyId : data.pKeyId;
  2720. this.$confirm(
  2721. "此操作将删除节点【" + data.title + "】, 是否继续?",
  2722. "提示",
  2723. {
  2724. confirmButtonText: "确定",
  2725. cancelButtonText: "取消",
  2726. type: "warning",
  2727. }
  2728. )
  2729. .then(() => {
  2730. removePrivateTreeNode(pid).then(() => {
  2731. this.$refs.tree.remove(node);
  2732. this.$message({
  2733. type: "success",
  2734. message: "删除成功!",
  2735. });
  2736. });
  2737. })
  2738. .catch(() => {});
  2739. },
  2740. importHandle() {},
  2741. handlePreview(index, row) {
  2742. this.curEleTable = row;
  2743. selectPrivateFormElements(this.curEleTable.initTableId).then((res) => {
  2744. res.data.data.forEach((element) => {
  2745. this.eleReg.exec(element.eAllowDeviation);
  2746. element.allow = RegExp.$1 ? RegExp.$1 : "";
  2747. element.deviation = RegExp.$2 ? RegExp.$2 : "";
  2748. });
  2749. this.editEleList = res.data.data;
  2750. });
  2751. this.editEleVisible = true;
  2752. },
  2753. //关联节点
  2754. handleLinkNodes(index, row) {
  2755. this.rowPkeyId = row.pkeyId;
  2756. this.linkNodesLoad = false;
  2757. this.isLinkNodes = true;
  2758. getLinekNodeTreelist(row.pkeyId)
  2759. .then(({ data }) => {
  2760. const res = data.data;
  2761. if (res instanceof Array) {
  2762. this.checkedLinkNodesKeys = res;
  2763. } else {
  2764. this.checkedLinkNodesKeys = [];
  2765. }
  2766. })
  2767. .catch(() => {
  2768. this.checkedLinkNodesKeys = [];
  2769. });
  2770. },
  2771. //确定关联
  2772. linkNodesSave() {
  2773. const keys = this.$refs.tree2.getCheckedKeys();
  2774. // if (keys.length <= 0) {
  2775. // this.$message({
  2776. // type: "warning",
  2777. // message: "请先勾选节点",
  2778. // });
  2779. // return;
  2780. // }
  2781. const pkeyId = this.rowPkeyId;
  2782. this.linkNodesLoad = true;
  2783. linkNodeTree(keys.length >0?keys.join(","):'', pkeyId)
  2784. .then(() => {
  2785. this.$message({
  2786. type: "success",
  2787. message: "关联成功!",
  2788. });
  2789. this.linkNodesLoad = false;
  2790. this.linkNodesClose();
  2791. })
  2792. .catch(() => {
  2793. this.linkNodesLoad = false;
  2794. });
  2795. },
  2796. //关闭关联弹窗
  2797. linkNodesClose() {
  2798. this.isLinkNodes = false;
  2799. this.linkNodesLoad = false;
  2800. this.checkedLinkNodesKeys = [];
  2801. this.nodesCheck = [];
  2802. this.rowPkeyId = "";
  2803. },
  2804. handleDelete(index, row) {
  2805. this.$confirm("是否删除 " + row.tableName + " ?", "删除元素表", {
  2806. distinguishCancelAndClose: true,
  2807. confirmButtonText: "删除",
  2808. cancelButtonText: "取消",
  2809. }).then(() => {
  2810. removeTableById(row.id, this.projectid, this.id).then(() => {
  2811. this.formData.splice(index, 1);
  2812. this.$message({
  2813. type: "success",
  2814. message: "删除成功!",
  2815. });
  2816. });
  2817. });
  2818. },
  2819. async hideMD(row) {
  2820. //隐藏按钮
  2821. const code = await this.updateStatus(row.pkeyId, row.status);
  2822. if (code == 200) {
  2823. if (row.status == 0) {
  2824. row.status = 1;
  2825. } else {
  2826. row.status = 0;
  2827. }
  2828. }
  2829. },
  2830. async updateStatus(pKeyId, status) {
  2831. //隐藏功能激活
  2832. const { data: res } = await updateStatus({ pKeyId });
  2833. if (res.code == 200) {
  2834. this.$message({
  2835. type: "success",
  2836. message: status == 1 ? "隐藏成功" : "激活成功",
  2837. });
  2838. }
  2839. return res.code;
  2840. },
  2841. handleEditFormula(index, row) {
  2842. this.curEleTable = row;
  2843. selectFormElements(this.curEleTable.pkeyId, { type: 0 }).then((res) => {
  2844. this.editEleListFilter = res.data.data;
  2845. this.editEleListAll = [].concat(this.editEleListFilter);
  2846. });
  2847. this.editEleFormulaVisible = true;
  2848. },
  2849. //表单同步
  2850. handlesync(index, row) {
  2851. },
  2852. //搜索 筛选
  2853. searchFormulaName() {
  2854. this.editEleListFilter = this.editEleListAll.filter((ele) => {
  2855. return ele.eName.indexOf(this.formulaInput) > -1;
  2856. });
  2857. },
  2858. saveNewEle(row) {
  2859. row.eAllowDeviation =
  2860. (row.allow ? row.allow : "") + (row.deviation ? row.deviation : "");
  2861. row.fId = this.curEleTable.initTableId;
  2862. row.initTableName = this.curEleTable.initTableName;
  2863. if (row.eType == 4) {
  2864. row.eLength = 0;
  2865. }
  2866. saveElement(row).then((res) => {
  2867. if (res.data.data) {
  2868. this.$set(row, "id", res.data.data.id);
  2869. this.$set(row, "ekey", res.data.data.ekey);
  2870. this.$message({
  2871. type: "success",
  2872. message: "保存成功!",
  2873. });
  2874. }
  2875. });
  2876. },
  2877. delEleRowHandle(index, list) {
  2878. let row = list[index];
  2879. if (row.id) {
  2880. //有id需要请求删除
  2881. this.$confirm("是否确认删除?", "删除元素", {
  2882. distinguishCancelAndClose: true,
  2883. confirmButtonText: "删除",
  2884. cancelButtonText: "取消",
  2885. }).then(() => {
  2886. removeElement(row.id, this.curEleTable.initTableName, row.ekey).then(
  2887. () => {
  2888. list.splice(index, 1);
  2889. }
  2890. );
  2891. });
  2892. } else {
  2893. list.splice(index, 1);
  2894. }
  2895. },
  2896. nodeTypeChange(val) {
  2897. console.log(333333333);
  2898. if (val === 53) {
  2899. // if (this.testTreeData.length > 0) {
  2900. // return;
  2901. // }
  2902. this.testTreeLoad = true;
  2903. // getAlltreeTrial(this.projectid, this.id, this.curTreeData.primaryKeyId).then((res) => {
  2904. // this.testTreeLoad = false;
  2905. // console.log(res.data.data,'data');
  2906. // let trialdata=res.data.data
  2907. // if(trialdata&&trialdata.allTree){
  2908. // this.testTreeData = trialdata.allTree[0];
  2909. // if(trialdata.allStatusIds.length>0){
  2910. // //设置勾选相关联试验全选
  2911. // this.mixRatioTestIds =trialdata.allStatusIds[0];
  2912. // }
  2913. // }
  2914. // });
  2915. let pid = this.curTreeData.primaryKeyId
  2916. ? this.curTreeData.primaryKeyId
  2917. : this.curTreeData.pKeyId;
  2918. getAlltree(this.projectid, this.id, pid).then((res) => {
  2919. this.testTreeLoad = false;
  2920. console.log(res.data.data, "data");
  2921. this.testTreeData = res.data.data;
  2922. });
  2923. }
  2924. },
  2925. //根据逗号联合
  2926. toJoin(arr) {
  2927. return arr ? arr.join() : "";
  2928. },
  2929. TestTreeCheckChange(_, { checkedKeys, halfCheckedKeys }) {
  2930. // const newarr = [...checkedKeys, ...halfCheckedKeys];
  2931. const newarr = [...checkedKeys];
  2932. this.nodeDetail.mixRatioTestIds = this.toJoin(newarr);
  2933. },
  2934. // filterChange() {
  2935. // if (this.treeData.length > 0) {
  2936. // this.$refs.treeall.filter(this.filterText);
  2937. // return;
  2938. // }
  2939. // this.treeLoad = true;
  2940. // getAlltree(this.projectid, this.id).then((res) => {
  2941. // this.treeLoad = false;
  2942. // this.treeData = res.data.data;
  2943. // console.log(res.data.data,'res.data.data');
  2944. // this.$nextTick(() => {
  2945. // this.$refs.treeall.filter(this.filterText);
  2946. // });
  2947. // });
  2948. // },
  2949. //搜索树
  2950. //搜索树
  2951. searchTreeClick() {
  2952. if (this.filterText.length > 0) {
  2953. this.isSearch = true;
  2954. this.searchtreeLoad = true;
  2955. getQueryValueByType({
  2956. queryValue: this.filterText,
  2957. type: this.searchType,
  2958. wbsId: this.id,
  2959. projectId: this.projectid,
  2960. }).then((res) => {
  2961. let arr = [];
  2962. if (Array.isArray(res.data.data)) {
  2963. arr = res.data.data;
  2964. this.searchTreeData = arr;
  2965. } else {
  2966. this.searchTreeData = [];
  2967. }
  2968. });
  2969. } else {
  2970. this.isSearch = false;
  2971. }
  2972. this.searchtreeLoad = false;
  2973. },
  2974. clearSearch() {
  2975. this.isSearch = false;
  2976. },
  2977. importTemplate(data) {
  2978. this.importTemplateVisible = true;
  2979. this.curTreeData = data;
  2980. if (!this.fileUrl) {
  2981. getAttchFromOriginalName(1, 20, {
  2982. originalName: "WBS划分模板.xls",
  2983. }).then((res) => {
  2984. if (res.data.data.records.length) {
  2985. this.fileUrl = res.data.data.records[0].link;
  2986. } else {
  2987. this.fileUrl = "";
  2988. }
  2989. });
  2990. }
  2991. },
  2992. importTemplateHandle() {
  2993. if (!this.upFile) {
  2994. this.$message({
  2995. type: "warning",
  2996. message: "请先选择文件再进行导入",
  2997. });
  2998. return;
  2999. }
  3000. let forms = new FormData();
  3001. forms.append("excelFile", this.upFile);
  3002. let wbsTreeFu = {
  3003. wbsId: this.id,
  3004. parentId: this.curTreeData.id,
  3005. // ancestors:'0,'+this.curTreeData.id,
  3006. };
  3007. let json = JSON.stringify(wbsTreeFu);
  3008. let blob = new Blob([json], { type: "application/json" });
  3009. forms.append("wbsTreeFu", blob);
  3010. this.importLoading = true;
  3011. importWbsTree(forms)
  3012. .then(() => {
  3013. //this.$router.go(0)
  3014. let node = this.$refs.tree.getNode(this.curTreeData.id);
  3015. node.isLeaf = false;
  3016. this.importTemplateVisible = false;
  3017. this.upFile = null;
  3018. })
  3019. .finally(() => {
  3020. this.importLoading = false;
  3021. });
  3022. },
  3023. handleDownload() {
  3024. if (this.fileUrl) {
  3025. window.open(this.fileUrl);
  3026. } else {
  3027. this.$message({
  3028. type: "warning",
  3029. message: "请先在附件管理上传【WBS划分模板.xls】文件",
  3030. });
  3031. }
  3032. },
  3033. fileClick() {
  3034. this.$refs.file.click();
  3035. },
  3036. fileChange(e) {
  3037. const file = e.target.files[0];
  3038. if (!file) {
  3039. // 如果用户没有选择图片,只是点了文件上传这个按钮
  3040. return;
  3041. }
  3042. //console.log(file)
  3043. this.upFile = file;
  3044. },
  3045. editNodeInfo(index, row) {
  3046. this.$set(row, "isEdit", true);
  3047. },
  3048. saveNodeInfoHandle(index, row) {
  3049. row.isEdit = false;
  3050. },
  3051. downloadTmp() {
  3052. getTemplate().then((res) => {
  3053. //console.log(res)
  3054. let blob = new Blob([res.data], {
  3055. type: "application/vnd.ms-excel",
  3056. });
  3057. //console.log(blob)
  3058. let filename = Date.parse(new Date()) + ".xls";
  3059. if (window.navigator.msSaveOrOpenBlob) {
  3060. // 兼容IE10
  3061. window.navigator.msSaveBlob(blob, filename);
  3062. } else {
  3063. // 兼容chrome/firefox
  3064. let aTag = document.createElement("a");
  3065. aTag.download = Date.parse(new Date()) + ".xls";
  3066. aTag.href = window.URL.createObjectURL(blob);
  3067. aTag.click();
  3068. URL.revokeObjectURL(aTag.href);
  3069. }
  3070. });
  3071. },
  3072. fileClick2() {
  3073. this.$refs.file2.click();
  3074. },
  3075. tmpImport(e) {
  3076. const file = e.target.files[0];
  3077. const formData = new FormData();
  3078. formData.append("file", file);
  3079. //console.log(file.name)
  3080. importWbsElement(formData)
  3081. .then((res) => {
  3082. res.data.data.forEach((element) => {
  3083. element.eName = element.elementName;
  3084. element.eLength = element.elementLength;
  3085. element.eType = Number(element.elementType);
  3086. element.eAllowDeviation = element.elementAllowDeviation;
  3087. element.eInspectionMethod = element.elementInspectionMethod;
  3088. this.eleReg.exec(element.eAllowDeviation);
  3089. // console.log(RegExp.$1)
  3090. // console.log(RegExp.$2)
  3091. element.allow = RegExp.$1 ? RegExp.$1 : "";
  3092. element.deviation = RegExp.$2 ? RegExp.$2 : "";
  3093. });
  3094. this.eleForm.elementList = res.data.data;
  3095. this.importVisible = false;
  3096. })
  3097. .finally(() => {
  3098. e.target.value = "";
  3099. });
  3100. },
  3101. visiblechange(value, data) {
  3102. this.$set(data, "moreShow", value);
  3103. },
  3104. bianhua2() {
  3105. this.excelSortTag2 = false;
  3106. this.$nextTick(() => {
  3107. this.excelSortTag2 = true;
  3108. });
  3109. },
  3110. //私有树的元素表修改排序
  3111. privateTableSort() {
  3112. if (!this.curTreeData.id) {
  3113. this.$message({
  3114. type: "warning",
  3115. message: "请先选择需要排序的节点",
  3116. });
  3117. return;
  3118. }
  3119. this.tableSortList = this.formData.map((form, index) => {
  3120. return {
  3121. sort: index + 1,
  3122. nodeName: form.tableName,
  3123. pkeyId: form.pkeyId,
  3124. };
  3125. });
  3126. this.excelSortTag = true;
  3127. this.excelSortTag2 = true;
  3128. },
  3129. editPrivateSort() {
  3130. this.surePrivateSortload = true;
  3131. wbsTreePrivateTableSort(this.tableSortList).then(() => {
  3132. this.$message({
  3133. type: "success",
  3134. message: "排序成功!",
  3135. });
  3136. this.updateNodeTable();
  3137. this.surePrivateSortload = false;
  3138. this.excelSortTag = false;
  3139. this.excelSortTag2 = false;
  3140. });
  3141. },
  3142. //解析元素数据类型
  3143. eTypeFormatter(row) {
  3144. let text = "";
  3145. for (let i = 0; i < this.dataTypeList.length; i++) {
  3146. if (this.dataTypeList[i].dictKey == row.eType) {
  3147. text = this.dataTypeList[i].dictValue;
  3148. break;
  3149. }
  3150. }
  3151. return text;
  3152. },
  3153. //跳转到公式配置页面
  3154. toFormulaEdit(row, type) {
  3155. this.curEleTable.hasPartFormula = row.hasPartFormula;
  3156. this.formulaCurRow = row;
  3157. this.formulaCurRow.globaltype = type;
  3158. if (type === 10) {
  3159. this.formulaCompVisible1 = true;
  3160. this.formulaCurRow.elementType = false;
  3161. this.istableType = true;
  3162. } else {
  3163. this.formulaCompVisible = true;
  3164. }
  3165. },
  3166. //关闭公式弹窗
  3167. closeformulaComp() {
  3168. console.log("关闭");
  3169. selectFormElements(this.curEleTable.pkeyId, { type: 0 }).then((res) => {
  3170. this.editEleListFilter = res.data.data;
  3171. this.editEleListAll = [].concat(this.editEleListFilter);
  3172. });
  3173. },
  3174. //关闭公式弹窗
  3175. closeformulaComp1() {
  3176. console.log("关闭");
  3177. selectFormElements(this.curEleTable.pkeyId, { type: 0 }).then((res) => {
  3178. this.editEleListFilter = res.data.data;
  3179. this.editEleListAll = [].concat(this.editEleListFilter);
  3180. });
  3181. },
  3182. getNodeTypelist() {
  3183. let code = "name_rule";
  3184. getDictionary({
  3185. code,
  3186. }).then((res) => {
  3187. this.nodeTypelist1 = res.data.data;
  3188. });
  3189. },
  3190. getNodeTypelistData() {
  3191. const type = this.wbsType;
  3192. let code = "";
  3193. if (type === 5) {
  3194. code = "lar_node_type"; //征拆
  3195. } else if (type === 2) {
  3196. code = "trial_node_type"; //试验
  3197. } else if (type === 3) {
  3198. code = "meter_node_type"; //计量
  3199. } else {
  3200. {
  3201. code = "wbs_node_type"; //质检
  3202. }
  3203. }
  3204. getDictionary({
  3205. code,
  3206. }).then((res) => {
  3207. this.nodeTypelist = res.data.data;
  3208. res.data.data.forEach((element) => {
  3209. element.dictKey = Number(element.dictKey);
  3210. });
  3211. this.nodeTypelist = res.data.data;
  3212. });
  3213. },
  3214. getMajorDataTypeList() {
  3215. // if (this.majorDataTypeList.length > 1) {
  3216. // return;
  3217. // }
  3218. getDictionary({
  3219. code: "major_data_type",
  3220. }).then((res) => {
  3221. res.data.data.forEach((element) => {
  3222. element.dictKey = Number(element.dictKey);
  3223. });
  3224. this.majorDataTypeList = res.data.data;
  3225. });
  3226. },
  3227. getTableTypelist() {
  3228. const type = this.wbsType;
  3229. if (this.tableTypelist.length > 1) {
  3230. return;
  3231. }
  3232. let code = "";
  3233. if (type === 5) {
  3234. code = "table_type"; //征拆
  3235. } else if (type === 2) {
  3236. code = "trial_table_type"; //试验
  3237. } else {
  3238. code = "table_type"; //质检
  3239. }
  3240. getDictionary({
  3241. // code: "table_type",
  3242. // code: type === 2 ? "trial_table_type" : "table_type",
  3243. code,
  3244. }).then((res) => {
  3245. res.data.data.forEach((element) => {
  3246. element.dictKey = Number(element.dictKey);
  3247. });
  3248. this.tableTypelist = res.data.data;
  3249. });
  3250. },
  3251. getDataTypelist() {
  3252. if (this.dataTypeList.length > 1) {
  3253. return;
  3254. }
  3255. getDictionary({
  3256. code: "data_type",
  3257. }).then((res) => {
  3258. res.data.data.forEach((element) => {
  3259. element.dictKey = Number(element.dictKey);
  3260. });
  3261. this.dataTypeList = res.data.data;
  3262. });
  3263. },
  3264. getOwnerTypelist() {
  3265. if (this.ownerTypeList.length > 1) {
  3266. return;
  3267. }
  3268. getDictionary({
  3269. code: "owner_type",
  3270. }).then((res) => {
  3271. res.data.data.forEach((element) => {
  3272. element.dictKey = Number(element.dictKey);
  3273. });
  3274. this.ownerTypeList = res.data.data;
  3275. });
  3276. },
  3277. getStandardTypeOptions() {
  3278. getDictionary({
  3279. code: "classification",
  3280. }).then((res) => {
  3281. res.data.data.forEach((element) => {
  3282. element.dictKey = Number(element.dictKey);
  3283. });
  3284. // 定义要过滤的 dictKey 值
  3285. const targetKeys = [1, 2, 3, 4, 5];
  3286. // 过滤数组
  3287. const filteredOptions = res.data.data.filter((item) =>
  3288. targetKeys.includes(item.dictKey)
  3289. );
  3290. this.standardTypeOptions = filteredOptions;
  3291. });
  3292. },
  3293. changeStandType(val) {
  3294. let parentId = "";
  3295. this.standardTypeOptions.forEach((item) => {
  3296. if (item.dictKey == val) {
  3297. parentId = item.id; // 找到匹配项,提取 parentId
  3298. }
  3299. });
  3300. getChildList(1, 10000, parentId).then((res) => {
  3301. res.data.data.forEach((element) => {
  3302. element.dictKey = Number(element.dictKey);
  3303. });
  3304. this.unitOptions = res.data.data;
  3305. this.unitOptions = this.unitOptions.filter(
  3306. (item) => item.dictKey != -1
  3307. );
  3308. });
  3309. },
  3310. formatCat(row, column, cellValue) {
  3311. for (let i = 0; i < this.nodeTypelist.length; i++) {
  3312. if (this.nodeTypelist[i].dictKey == cellValue) {
  3313. return this.nodeTypelist[i].dictValue;
  3314. }
  3315. }
  3316. return cellValue;
  3317. //console.log(cellValue)
  3318. },
  3319. formatTableType(row, column, cellValue) {
  3320. for (let i = 0; i < this.tableTypelist.length; i++) {
  3321. if (this.tableTypelist[i].dictKey == cellValue) {
  3322. return this.tableTypelist[i].dictValue;
  3323. }
  3324. }
  3325. return cellValue;
  3326. //console.log(cellValue)
  3327. },
  3328. formatOwner(row, column, cellValue) {
  3329. for (let i = 0; i < this.ownerTypeList.length; i++) {
  3330. if (this.ownerTypeList[i].dictKey == cellValue) {
  3331. return this.ownerTypeList[i].dictValue;
  3332. }
  3333. }
  3334. return cellValue;
  3335. //console.log(cellValue)
  3336. },
  3337. formatdataType(row, column, cellValue) {
  3338. for (let i = 0; i < this.dataTypeList.length; i++) {
  3339. if (this.dataTypeList[i].dictKey == cellValue) {
  3340. return this.dataTypeList[i].dictValue;
  3341. }
  3342. }
  3343. return cellValue;
  3344. },
  3345. formMajorType(row, column, cellValue) {
  3346. for (let i = 0; i < this.majorDataTypeList.length; i++) {
  3347. if (this.majorDataTypeList[i].dictKey == cellValue) {
  3348. return this.majorDataTypeList[i].dictValue;
  3349. }
  3350. }
  3351. return cellValue;
  3352. },
  3353. // filterNode(value, data) {
  3354. // if (!value) return true;
  3355. // return data.title.indexOf(value) !== -1;
  3356. // },
  3357. getReturnNode(node, _array, value) {
  3358. let isPass =
  3359. node.data && node.data.title && node.data.title.indexOf(value) !== -1;
  3360. isPass ? _array.push(isPass) : "";
  3361. if (!isPass && node.level != 1 && node.parent) {
  3362. this.getReturnNode(node.parent, _array, value);
  3363. }
  3364. },
  3365. filterNode(value, data, node) {
  3366. if (!value) {
  3367. return true;
  3368. }
  3369. let level = node.level;
  3370. let _array = []; //这里使用数组存储 只是为了存储值。
  3371. this.getReturnNode(node, _array, value);
  3372. let result = false;
  3373. _array.forEach((item) => {
  3374. result = result || item;
  3375. });
  3376. return result;
  3377. },
  3378. //#endregion
  3379. //#region wbs私有树排序
  3380. async sortpai(data) {
  3381. console.log(data);
  3382. await this.findWbsTreePrivateSameLevel({
  3383. parentId: data.parentId,
  3384. projectId: this.projectid,
  3385. wbsId: this.id,
  3386. });
  3387. this.sortTag = true;
  3388. this.sortTag2 = true;
  3389. },
  3390. editSort() {
  3391. this.wbsTreePrivateSort();
  3392. },
  3393. bianhua() {
  3394. this.sortTag2 = false;
  3395. this.$nextTick(() => {
  3396. this.sortTag2 = true;
  3397. });
  3398. },
  3399. async wbsTreePrivateSort() {
  3400. this.sureSortload = true;
  3401. //wbs私有树节点手动排序
  3402. const { data: res } = await wbsTreePrivateSort(this.sort);
  3403. console.log(res);
  3404. if (res.code == 200) {
  3405. this.sortTag = false;
  3406. this.sortTag2 = false;
  3407. this.$message({
  3408. type: "success",
  3409. message: "排序成功!",
  3410. });
  3411. this.sureSortload = false;
  3412. this.getLazytreessss();
  3413. }
  3414. },
  3415. async findWbsTreePrivateSameLevel(da) {
  3416. //wbs私有树同级节点接口
  3417. const { data: res } = await findWbsTreePrivateSameLevel(da);
  3418. if (res.code == 200) {
  3419. this.sort = res.data;
  3420. }
  3421. },
  3422. async getLazytreessss() {
  3423. const type = this.wbsType;
  3424. const { data: res } = await getLazytree(
  3425. this.id,
  3426. 0,
  3427. this.userInfo.tenant_id,
  3428. this.projectid,
  3429. { wbsType: type }
  3430. );
  3431. console.log(res);
  3432. if (res.code == 200) {
  3433. this.treeData = res.data;
  3434. }
  3435. },
  3436. //#endregion
  3437. //#region 关联清表
  3438. async getList(da) {
  3439. //获取清表模板信息
  3440. const { data: res } = await getList(da);
  3441. console.log(res);
  3442. if (res.code === 200 && res.msg === "操作成功") {
  3443. this.GLExcelData = res.data.records;
  3444. }
  3445. },
  3446. async tabLazytreeAll() {
  3447. //清表树信息
  3448. this.GLExcelLoading = true;
  3449. const { data: res } = await tabLazytreeAll({
  3450. modeId: this.GLExcelFrom.name,
  3451. name: this.GLExcelFrom.search,
  3452. });
  3453. this.GLExcelLoading = false;
  3454. console.log(res);
  3455. if (res.code === 200 && res.msg === "操作成功") {
  3456. this.exceldata = res.data;
  3457. }
  3458. },
  3459. Associationlist(scope) {
  3460. //关联清表点击事件
  3461. console.log(scope.row);
  3462. this.GLExcel = true;
  3463. this.getList({
  3464. current: 1,
  3465. size: 100000,
  3466. parentId: 0,
  3467. });
  3468. this.GLExcelFrom.name = scope.row.modeId;
  3469. setTimeout(() => {
  3470. this.$refs.tree.setCheckedKeys([scope.row.excelId]);
  3471. }, 2000);
  3472. this.GLExcelFrom.initTableId = scope.row.initTableId;
  3473. this.GLExcelFrom.id = scope.row.pkeyId;
  3474. this.GLExcelFrom.excelId = scope.row.excelId;
  3475. this.GLExcelFrom.ids = scope.row.id;
  3476. this.GLExcelFrom.initTableName = scope.row.initTableName;
  3477. console.log(this.GLExcelFrom, "this.GLExcelFrom");
  3478. },
  3479. changetherr() {
  3480. //清表类型选择框change事件
  3481. if (this.GLExcelFrom.name != "") {
  3482. this.GLExcelFrom.search = "";
  3483. this.tabLazytreeAll();
  3484. }
  3485. },
  3486. GLExcelMD() {
  3487. //弹框关闭事件
  3488. this.GLExcelFrom.name = "";
  3489. this.GLExcelFrom.search = "";
  3490. this.GLExcelFrom.id = "";
  3491. this.exceldata = [];
  3492. this.$refs.tree.setCheckedKeys([]);
  3493. this.GLExcel = false;
  3494. },
  3495. checkchange(data) {
  3496. //节点选中回调
  3497. if (this.$refs.tree.getCheckedNodes().length === 0) {
  3498. this.$refs.tree.setCheckedKeys([]);
  3499. } else if (this.$refs.tree.getCheckedNodes().length >= 1) {
  3500. this.$refs.tree.setCheckedKeys([data.id]);
  3501. }
  3502. },
  3503. async saveLinkTab() {
  3504. //保存按钮
  3505. let checkNodes = this.$refs.tree.getCheckedNodes();
  3506. if (checkNodes.length > 0) {
  3507. let node = checkNodes[checkNodes.length - 1];
  3508. if (node.fileType != 3) {
  3509. this.$message({
  3510. type: "warning",
  3511. message: "请先上传Excel表",
  3512. });
  3513. return;
  3514. }
  3515. const { data: res } = await saveLinkTab({
  3516. exceTabId: node.id,
  3517. tabId: this.GLExcelFrom.id,
  3518. });
  3519. console.log(res);
  3520. if (res.code === 200) {
  3521. this.$message({
  3522. type: "success",
  3523. message: "关联清表成功",
  3524. });
  3525. // selectByNodeTable刷新表单列表
  3526. this.updateNodeTable();
  3527. this.GLExcel = false;
  3528. console.log(this.GLExcelFrom, "GLExcelFrom");
  3529. this.rightClick(
  3530. this.GLExcelFrom.id,
  3531. this.GLExcelFrom.excelId,
  3532. this.GLExcelFrom.ids,
  3533. this.GLExcelFrom.initTableName,
  3534. this.GLExcelFrom.initTableId
  3535. );
  3536. }
  3537. } else {
  3538. this.$message({
  3539. type: "warning",
  3540. message: "请先设置清表",
  3541. });
  3542. }
  3543. },
  3544. getReturnNode2(node, _array, value) {
  3545. let isPass =
  3546. node.data && node.data.name && node.data.name.indexOf(value) !== -1;
  3547. isPass ? _array.push(isPass) : "";
  3548. if (!isPass && node.level != 1 && node.parent) {
  3549. this.getReturnNode2(node.parent, _array, value);
  3550. }
  3551. },
  3552. filterNode222(value, data, node) {
  3553. if (!value) {
  3554. return true;
  3555. }
  3556. let level = node.level;
  3557. let _array = []; //这里使用数组存储 只是为了存储值。
  3558. this.getReturnNode2(node, _array, value);
  3559. let result = false;
  3560. _array.forEach((item) => {
  3561. result = result || item;
  3562. });
  3563. return result;
  3564. },
  3565. //#endregion
  3566. //#region 节点参数
  3567. nodeInfo(data) {
  3568. //节点参数按钮
  3569. this.keymap();
  3570. //console.log(data)
  3571. let pid = data.primaryKeyId ? data.primaryKeyId : data.pKeyId;
  3572. this.jiedianId = pid;
  3573. this.parameters(pid);
  3574. this.nodeInfoVisible = true;
  3575. },
  3576. closenodeInfoVisible() {
  3577. this.nodeInfoTable = [];
  3578. this.nodeInfoVisible = false;
  3579. },
  3580. addNodeInfoTable() {
  3581. //添加节点参数数据
  3582. this.nodeInfoTable.unshift({
  3583. k: "",
  3584. v: "",
  3585. remark: "",
  3586. nodeId: this.jiedianId,
  3587. type: 1,
  3588. });
  3589. console.log(this.nodeInfoTable);
  3590. },
  3591. refreshnfoTable() {
  3592. //刷新表格
  3593. let prams = {
  3594. nodeId: this.jiedianId,
  3595. type: 1,
  3596. projectId: this.projectid,
  3597. };
  3598. this.nodeInfoTableLoad = true;
  3599. refrehPram(prams).then((res) => {
  3600. this.nodeInfoTableLoad = false;
  3601. if (res.data.code == 200) {
  3602. this.$message.success("刷新成功");
  3603. }
  3604. });
  3605. },
  3606. delNodeInfo(key, obj) {
  3607. this.delids.push(obj.id);
  3608. //设置参数名称中的删除按钮
  3609. this.namelists.splice(key, 1);
  3610. },
  3611. delNodeInfoss(key, obj) {
  3612. this.delids.push(obj.id);
  3613. //节点参数
  3614. this.nodeInfoTable.splice(key, 1);
  3615. },
  3616. setNodeParameters() {
  3617. //打开设置节点参数弹框按钮
  3618. this.infoNameVisible = true;
  3619. this.namelists = [...this.namelist];
  3620. },
  3621. async setParameterName() {
  3622. //设置参数名称中添加节点参数按钮
  3623. // wbsId: this.jiedianId
  3624. this.namelists.unshift({
  3625. name: "",
  3626. remark: "",
  3627. k: "",
  3628. type: 0,
  3629. nodeId: this.jiedianId,
  3630. });
  3631. },
  3632. async nodeInfoSave() {
  3633. //节点参数弹框保存按钮
  3634. if (this.nodeInfoTable) {
  3635. // if (this.nodeInfoTable.length == 0) {
  3636. // await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,type:1,delIds:this.delids,wps:[
  3637. // {
  3638. // nodeId: this.jiedianId,
  3639. // type: -1,
  3640. // },
  3641. // ]});
  3642. // this.nodeInfoVisible = false;
  3643. // this.delIds=[];
  3644. // this.$message({
  3645. // type: "success",
  3646. // message: "保存参数节点成功!",
  3647. // });
  3648. // return;
  3649. // }
  3650. console.log(this.namelist);
  3651. let tag = true;
  3652. this.nodeInfoTable.forEach((val) => {
  3653. if (!val.k | !val.v) {
  3654. return (tag = false);
  3655. }
  3656. //if (!val.name) {
  3657. for (let i = 0; i < this.namelist.length; i++) {
  3658. if (this.namelist[i].k == val.k) {
  3659. val.name = this.namelist[i].name;
  3660. return;
  3661. }
  3662. }
  3663. //}
  3664. });
  3665. if (tag) {
  3666. this.nodeInfoSaveload = true;
  3667. await this.saveOrUpdateBatch({
  3668. scopeType: 10,
  3669. projectId: this.projectid,
  3670. nodeId: this.jiedianId,
  3671. wps: this.nodeInfoTable,
  3672. type: 1,
  3673. delIds: this.delids,
  3674. });
  3675. this.delIds = [];
  3676. this.$message({
  3677. type: "success",
  3678. message: "设置参数节点成功!",
  3679. });
  3680. this.nodeInfoSaveload = false;
  3681. this.parameters(this.jiedianId);
  3682. // this.nodeInfoVisible = false;
  3683. } else {
  3684. this.$message({
  3685. type: "error",
  3686. message: "请填写所有的参数名称和参数值!",
  3687. });
  3688. }
  3689. } else {
  3690. this.$message({
  3691. type: "error",
  3692. message: "请先设置参数节点!",
  3693. });
  3694. }
  3695. },
  3696. async addParameterName() {
  3697. //设置参数名称中的保存按钮
  3698. if (this.namelists.length) {
  3699. let tag = true;
  3700. this.namelists.forEach((val) => {
  3701. if (!val.name || !val.k) {
  3702. return (tag = false);
  3703. }
  3704. });
  3705. if (tag) {
  3706. await this.saveOrUpdateBatch({
  3707. scopeType: 10,
  3708. projectId: this.projectid,
  3709. nodeId: this.jiedianId,
  3710. wps: this.namelists,
  3711. type: 0,
  3712. delIds: this.delids,
  3713. }); //保存设置参数
  3714. this.infoNameVisible = false;
  3715. this.delIds = [];
  3716. this.keymap();
  3717. } else {
  3718. this.$message({
  3719. type: "error",
  3720. message: "请填写所有的参数名称和参数值KEY!",
  3721. });
  3722. }
  3723. } else {
  3724. this.$message({
  3725. type: "warning",
  3726. message: "请先添加参数",
  3727. });
  3728. }
  3729. },
  3730. closeParameter() {
  3731. //设置参数名称,关闭按钮
  3732. this.namelists = [];
  3733. this.infoNameVisible = false;
  3734. },
  3735. async parameters(wbsId) {
  3736. //获取接待你参数列表
  3737. const { data: res } = await parameters({ wbsId });
  3738. console.log(res);
  3739. if (res.code == 200) {
  3740. if (Array.isArray(res.data)) {
  3741. this.nodeInfoTable = res.data;
  3742. }
  3743. }
  3744. },
  3745. async saveOrUpdateBatch(da) {
  3746. //保存
  3747. const { data: res } = await saveOrUpdateBatch(da);
  3748. this.delids = [];
  3749. console.log(res);
  3750. },
  3751. async keymap() {
  3752. //节点参数枚举
  3753. const { data: res } = await keymap();
  3754. console.log(res);
  3755. if (res.code == 200) {
  3756. this.namelist = res.data;
  3757. }
  3758. },
  3759. //#endregion
  3760. //#region 调整表单
  3761. adjustExcel(pkeyId, excelId) {
  3762. //调整表单
  3763. this.GLExcelFrom.id = pkeyId;
  3764. this.GLExcelFrom.excelId = excelId;
  3765. this.getExcelHtml(pkeyId);
  3766. },
  3767. async getExcelHtml(pkeyId) {
  3768. const { data: res } = await getExcelHtml({ pkeyId });
  3769. console.log(res);
  3770. if (res.code === 200) {
  3771. localStorage.setItem("excelHtml", res.data);
  3772. this.adjustmentExcel = res.data;
  3773. this.excelHtml = true;
  3774. }
  3775. },
  3776. removeExcel() {
  3777. this.excelHtml = false;
  3778. },
  3779. //#endregion
  3780. //#region 编辑元素
  3781. async rightClick(pkeyId, excelId, id, initTableName, initTableId) {
  3782. await this.getExcelHtml2(pkeyId);
  3783. this.editElementQuery.pkeyId = pkeyId;
  3784. this.editElementQuery.excelId = excelId;
  3785. this.editElementQuery.id = id;
  3786. this.editElementQuery.initTableName = initTableName;
  3787. this.editElementQuery.initTableId = initTableId;
  3788. this.editElementQuery.pid = this.$route.query.pid;
  3789. this.editElementQuery.wbsid = this.$route.query.wbsid;
  3790. this.editElementQuery.nodeid = this.curTreeData.id;
  3791. this.editElementVisible = true;
  3792. },
  3793. async getExcelHtml2(pkeyId) {
  3794. const { data: res } = await getExcelHtml({ pkeyId });
  3795. console.log(res);
  3796. if (res.code === 200) {
  3797. localStorage.setItem("editElement", res.data);
  3798. }
  3799. },
  3800. //#endregion
  3801. //#region 元素表单信息
  3802. editEditElementForm() {
  3803. //标记元素
  3804. if (this.formData.length) {
  3805. let da = [];
  3806. this.formDatass = [...this.formData];
  3807. this.formDatass.forEach((val) => {
  3808. da.push({
  3809. tableType: val.tableType - 0,
  3810. tableOwner: val.tableOwner - 0,
  3811. pkeyId: val.pkeyId,
  3812. tableName: val.tableName,
  3813. fillRate: val.fillRate,
  3814. nodeType: val.nodeType - 0,
  3815. });
  3816. });
  3817. this.formDatass = da;
  3818. this.editElementFormTag = true;
  3819. }
  3820. },
  3821. editeditElementFormMF() {
  3822. //保存按钮
  3823. let da = [];
  3824. let tag = true;
  3825. this.formDatass.forEach((val) => {
  3826. if (!val.tableName || !val.tableType || !val.tableOwner) {
  3827. tag = false;
  3828. return;
  3829. } else {
  3830. da.push({
  3831. pkeyId: val.pkeyId,
  3832. nodeName: val.tableName,
  3833. tableType: val.tableType,
  3834. tableOwner: val.tableOwner,
  3835. fillRate: val.fillRate,
  3836. nodeType: val.nodeType,
  3837. });
  3838. }
  3839. });
  3840. if (tag) {
  3841. this.updateBatchNodeTableInfo2(da);
  3842. } else {
  3843. this.$message({
  3844. type: "success",
  3845. message: "请填写完整元素表单的所有信息!",
  3846. });
  3847. }
  3848. },
  3849. async updateBatchNodeTableInfo2(da) {
  3850. this.editeditElementFormMFLoading = true;
  3851. //共有编辑元素
  3852. const { data: res } = await updateBatchNodeTableInfo2(da);
  3853. if (res.code == 200) {
  3854. this.editElementFormTag = false;
  3855. this.updateNodeTable();
  3856. this.editeditElementFormMFLoading = false;
  3857. }
  3858. this.editeditElementFormMFLoading = false;
  3859. },
  3860. //#endregion
  3861. //获取节点展开路径
  3862. getExpandedKeys(node) {
  3863. //console.log(node)
  3864. let expandedKeys = [];
  3865. while (node.parent) {
  3866. expandedKeys.push(node.data.id);
  3867. node = node.parent;
  3868. }
  3869. setStore({
  3870. name: this.expandName,
  3871. content: expandedKeys,
  3872. type: true, //sessionStorage
  3873. });
  3874. //console.log(expandedKeys)
  3875. },
  3876. //触发节点参数
  3877. nodeInfoHandle() {
  3878. if (!this.curTreeData.id) {
  3879. this.$message({
  3880. type: "warning",
  3881. message: "请先选择节点",
  3882. });
  3883. return;
  3884. }
  3885. this.nodeInfo(this.curTreeData);
  3886. },
  3887. eleFormulaHandle() {
  3888. if (!this.curTreeData.id || !this.curTreeNode.id) {
  3889. this.$message({
  3890. type: "warning",
  3891. message: "请先选择节点",
  3892. });
  3893. return;
  3894. }
  3895. this.setLeftType(4, this.curTreeData, this.curTreeNode);
  3896. // this.showType = 2;
  3897. },
  3898. editNodeHandle() {
  3899. console.log(this.curTreeData, "this.curTreeData.id ");
  3900. if (!this.curTreeData.id || !this.curTreeNode.id) {
  3901. this.$message({
  3902. type: "warning",
  3903. message: "请先选择节点",
  3904. });
  3905. return;
  3906. }
  3907. this.mixRatioTestIds = [];
  3908. // this.nodeTypeChange(53);
  3909. this.nodeTypeChange(this.curTreeData.nodeType);
  3910. this.dialogTitle = "编辑节点";
  3911. this.setLeftType(2, this.curTreeData, this.curTreeNode);
  3912. },
  3913. addNodeHandle() {
  3914. if (!this.curTreeData.id || !this.curTreeNode.id) {
  3915. this.$message({
  3916. type: "warning",
  3917. message: "请先选择节点",
  3918. });
  3919. return;
  3920. }
  3921. this.mixRatioTestIds = [];
  3922. // this.nodeTypeChange(53);
  3923. this.nodeTypeChange(this.curTreeData.nodeType);
  3924. this.dialogTitle = "新增节点";
  3925. this.setLeftType(1, this.curTreeData, this.curTreeNode);
  3926. },
  3927. copyNodeHandle() {
  3928. if (!this.curTreeData.id || !this.curTreeNode.id) {
  3929. this.$message({
  3930. type: "warning",
  3931. message: "请先选择节点",
  3932. });
  3933. return;
  3934. }
  3935. },
  3936. delNodeHandle() {
  3937. if (!this.curTreeData.id || !this.curTreeNode.id) {
  3938. this.$message({
  3939. type: "warning",
  3940. message: "请先选择节点",
  3941. });
  3942. return;
  3943. }
  3944. if (this.curTreeNode.level == 1) {
  3945. this.$message({
  3946. type: "warning",
  3947. message: "当前节点无法删除",
  3948. });
  3949. return;
  3950. }
  3951. this.deleNode(this.curTreeData, this.curTreeNode);
  3952. },
  3953. eleHandle() {
  3954. if (!this.curTreeData.id || !this.curTreeNode.id) {
  3955. this.$message({
  3956. type: "warning",
  3957. message: "请先选择节点",
  3958. });
  3959. return;
  3960. }
  3961. this.setLeftType(5, this.curTreeData, this.curTreeNode);
  3962. },
  3963. syncInfoHandle(item) {
  3964. if (this.curTreeData.primaryKeyId || this.curTreeData.pKeyId) {
  3965. this.$confirm("是否同步节点参数?", "提示", {
  3966. confirmButtonText: "确定",
  3967. cancelButtonText: "取消",
  3968. type: "warning",
  3969. }).then(() => {
  3970. this.syncBtnLoad = true;
  3971. this.menuoptions.forEach((ele) => {
  3972. if (item.value == ele.value) {
  3973. ele.load = true;
  3974. }
  3975. });
  3976. let pid = this.curTreeData.primaryKeyId
  3977. ? this.curTreeData.primaryKeyId
  3978. : this.curTreeData.pKeyId;
  3979. syncNodeParam(this.projectid, pid)
  3980. .then(() => {
  3981. this.$message({
  3982. type: "success",
  3983. message: "同步成功!",
  3984. });
  3985. })
  3986. .finally(() => {
  3987. this.syncBtnLoad = false;
  3988. this.menuoptions.forEach((ele) => {
  3989. if (item.value == ele.value) {
  3990. ele.load = false;
  3991. }
  3992. });
  3993. });
  3994. });
  3995. } else {
  3996. this.$message.warning("请先选择左侧节点");
  3997. }
  3998. },
  3999. //显示别名弹窗
  4000. aliasShow() {
  4001. this.aliasVisible = true;
  4002. if (this.nodeDetail.fullName) {
  4003. this.aliasArr = this.nodeDetail.fullName.split(",");
  4004. } else {
  4005. this.aliasArr = [];
  4006. }
  4007. this.aliasInput = "";
  4008. },
  4009. addAlias() {
  4010. if (this.aliasInput) {
  4011. this.aliasArr.push(this.aliasInput);
  4012. this.aliasInput = "";
  4013. }
  4014. },
  4015. delAlias(index) {
  4016. this.aliasArr.splice(index, 1);
  4017. },
  4018. saveAliasHandle() {
  4019. this.nodeDetail.fullName = this.aliasArr.join(",");
  4020. if (this.editType == 1) {
  4021. //新增
  4022. this.aliasVisible = false;
  4023. } else if (this.editType == 2) {
  4024. //编辑 私有
  4025. privateSubmitFullName(
  4026. this.nodeDetail.pKeyId,
  4027. this.nodeDetail.fullName
  4028. ).then(() => {
  4029. this.$message({
  4030. type: "success",
  4031. message: "保存成功",
  4032. });
  4033. this.aliasVisible = false;
  4034. });
  4035. }
  4036. },
  4037. async syncNodeTableHandle(data) {
  4038. this.isAdd=''
  4039. console.log('后管数据同步',data);
  4040. this.curTreeData=data
  4041. this.isShowLeft=false
  4042. await this.getNodeStatusData()
  4043. if(this.syncListDialog){
  4044. return
  4045. }
  4046. this.syncForm.range='1'
  4047. this.proSyncTag=true
  4048. if(this.$refs.syncProTree){
  4049. this.$refs.syncProTree.setCheckedKeys([])
  4050. }
  4051. if(this.$refs.proTable){
  4052. this.$refs.proTable.clearSelection()
  4053. }
  4054. this.isShowTable=true
  4055. this.getTypeOptions()
  4056. this.getRangeOptions()
  4057. this.getCheckIdList()
  4058. this.getTempProjectList(data.primaryKeyId)
  4059. },
  4060. syncProjectHandle(data) {
  4061. this.$confirm("是否同步节点【" + data.title + "】到合同段?", "提示", {
  4062. confirmButtonText: "确定",
  4063. cancelButtonText: "取消",
  4064. type: "warning",
  4065. }).then(() => {
  4066. let notify = this.$notify({
  4067. title: "提示",
  4068. message: "节点数据同步中...",
  4069. duration: 0,
  4070. });
  4071. let pid = data.primaryKeyId ? data.primaryKeyId : data.pKeyId;
  4072. syncNodeinfo(pid)
  4073. .then(() => {
  4074. this.updateNodeTable();
  4075. this.$message({
  4076. type: "success",
  4077. message: "同步成功",
  4078. });
  4079. })
  4080. .catch(() => {
  4081. this.$message({
  4082. type: "error",
  4083. message: "同步失败",
  4084. });
  4085. })
  4086. .finally(() => {
  4087. notify.close();
  4088. });
  4089. });
  4090. },
  4091. //同步元素表单排序到合同段
  4092. async syncSortHandle(data) {
  4093. console.log('同步到合同');
  4094. this.isShowLeft=false
  4095. this.curTreeData=data
  4096. if(this.syncListDialog){
  4097. return
  4098. }
  4099. await this.getNodeStatusData()
  4100. this.syncForm.range='2'
  4101. this.proSyncTag=true
  4102. this.isShowTable=true
  4103. this.getTypeOptions()
  4104. this.getRangeOptions()
  4105. this.getCheckIdList()
  4106. selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
  4107. if (res.data.data.length) {
  4108. this.preTableData = res.data.data;
  4109. } else {
  4110. this.preTableData = [];
  4111. }
  4112. });
  4113. },
  4114. typeTreeLoadNode(node, resolve) {
  4115. let pid = 0;
  4116. if (node.level != 0) {
  4117. pid = node.data.id;
  4118. }
  4119. tabTypeLazyTree(pid, this.projectid).then((res) => {
  4120. let arr = [];
  4121. if (Array.isArray(res.data.data)) {
  4122. arr = res.data.data;
  4123. }
  4124. return resolve(arr);
  4125. });
  4126. },
  4127. getTypeTreeDetail() {},
  4128. independent() {
  4129. this.$router.push({
  4130. path: "/project/independent",
  4131. query: {
  4132. pid: this.projectid,
  4133. wbsid: this.$route.query.wbsid,
  4134. wbsType: this.wbsType,
  4135. },
  4136. });
  4137. },
  4138. archiveTimeClick() {
  4139. this.$router.push({
  4140. path: "/project/archiveTime",
  4141. query: { pid: this.projectid, wbsid: this.$route.query.wbsid },
  4142. });
  4143. },
  4144. syncElectric(item) {
  4145. if (this.curTreeData.primaryKeyId || this.curTreeData.pKeyId) {
  4146. console.log("同步电签默认信息");
  4147. this.$confirm("是否同步电签默认信息?", "提示", {
  4148. confirmButtonText: "确定",
  4149. cancelButtonText: "取消",
  4150. type: "warning",
  4151. }).then(() => {
  4152. this.syncElectricLoad = true;
  4153. this.menuoptions.forEach((ele) => {
  4154. if (item.value == ele.value) {
  4155. ele.load = true;
  4156. }
  4157. });
  4158. let pid = this.curTreeData.primaryKeyId
  4159. ? this.curTreeData.primaryKeyId
  4160. : this.curTreeData.pKeyId;
  4161. syncProjecteVisa(this.projectid, pid)
  4162. .then(() => {
  4163. this.$message({
  4164. type: "success",
  4165. message: "同步成功!",
  4166. });
  4167. })
  4168. .finally(() => {
  4169. this.syncElectricLoad = false;
  4170. this.menuoptions.forEach((ele) => {
  4171. if (item.value == ele.value) {
  4172. ele.load = false;
  4173. }
  4174. });
  4175. });
  4176. });
  4177. } else {
  4178. this.$message.warning("请先选择左侧节点");
  4179. }
  4180. },
  4181. //节点参数 关联元素
  4182. linkEle(row) {
  4183. console.log(row, "row");
  4184. if (!row.id) {
  4185. this.$message.warning("请先保存数据,再点击关联元素");
  4186. } else {
  4187. this.linkEleVisible = true;
  4188. this.curParam = row;
  4189. getParamElements({
  4190. nodeId: this.curTreeData.id,
  4191. projectId: this.projectid,
  4192. paramId: row.id,
  4193. scopeType: 10,
  4194. }).then((res) => {
  4195. if (res.data.data.length) {
  4196. this.linkEleTableList = res.data.data;
  4197. } else {
  4198. this.linkEleTableList = [];
  4199. }
  4200. });
  4201. }
  4202. },
  4203. //关联元素弹框
  4204. tolinkEle(row) {
  4205. this.curLinkEleTable = row;
  4206. this.linkCheckVisible = true;
  4207. let pid = this.curTreeData.primaryKeyId
  4208. ? this.curTreeData.primaryKeyId
  4209. : this.curTreeData.pKeyId;
  4210. selectFormElements(row.id, { type: 3, nodeId: pid }).then((res) => {
  4211. res.data.data.forEach((ele) => {
  4212. ele.checked = false;
  4213. ele.show = true;
  4214. });
  4215. this.linkEleList = res.data.data;
  4216. this.linkEleListAll = [].concat(this.linkEleList);
  4217. });
  4218. },
  4219. //删除关联
  4220. delLink(data) {
  4221. this.$confirm("删除关联, 是否继续?", "提示", {
  4222. confirmButtonText: "确定",
  4223. cancelButtonText: "取消",
  4224. type: "warning",
  4225. })
  4226. .then(() => {
  4227. console.log(data);
  4228. delParamElements(data).then(() => {
  4229. this.$message({
  4230. type: "success",
  4231. message: "删除成功!",
  4232. });
  4233. getParamElements({
  4234. nodeId: this.curTreeData.id,
  4235. projectId: this.projectid,
  4236. paramId: this.curParam.id,
  4237. scopeType: 10,
  4238. }).then((res) => {
  4239. if (res.data.data.length) {
  4240. this.linkEleTableList = res.data.data;
  4241. } else {
  4242. this.linkEleTableList = [];
  4243. }
  4244. });
  4245. });
  4246. })
  4247. .catch(() => {});
  4248. },
  4249. //筛选元素
  4250. searchEle() {
  4251. this.linkEleList = this.linkEleListAll.filter((ele) => {
  4252. return ele.eName.indexOf(this.linkEleKey) > -1;
  4253. });
  4254. },
  4255. linkEleCheck(value, index) {
  4256. //console.log(value)
  4257. if (value) {
  4258. this.linkEleList.forEach((ele, i) => {
  4259. if (i != index) {
  4260. ele.checked = false;
  4261. }
  4262. });
  4263. }
  4264. },
  4265. //关联元素
  4266. saveLinkEle() {
  4267. let target = {};
  4268. this.linkEleList.forEach((e) => {
  4269. if (e.checked == true) {
  4270. target = { elementId: e.id, paramId: this.curParam.id };
  4271. }
  4272. });
  4273. if (JSON.stringify(target) !== "{}") {
  4274. specifiedParamElements(target).then((data) => {
  4275. this.linkCheckVisible = false;
  4276. getParamElements({
  4277. nodeId: this.curTreeData.id,
  4278. projectId: this.projectid,
  4279. paramId: this.curParam.id,
  4280. scopeType: 10,
  4281. }).then((res) => {
  4282. if (res.data.data.length) {
  4283. this.linkEleTableList = res.data.data;
  4284. } else {
  4285. this.linkEleTableList = [];
  4286. }
  4287. });
  4288. });
  4289. } else {
  4290. this.$message.warning("请先选择关联元素");
  4291. }
  4292. },
  4293. //树形控件菜单相关方法
  4294. mouseout() {
  4295. this.menuvisible = false;
  4296. },
  4297. //展示菜单
  4298. showMenu(e, data, node) {
  4299. e.preventDefault();
  4300. console.log(e, "e");
  4301. var x = e.pageX; //这个应该是相对于整个浏览器页面的x坐标,左上角为坐标原点(0,0)
  4302. var y = e.pageY; //这个应该是相对于整个浏览器页面的y坐标,左上角为坐标原点(0,0)
  4303. this.menutop = y;
  4304. this.menuleft = x;
  4305. this.menuvisible = true;
  4306. },
  4307. menuClick(e, item, data) {
  4308. e.preventDefault();
  4309. if (item.key === "sort") {
  4310. this.sortpai(data);
  4311. } else if (item.key === "sync1") {
  4312. this.syncNodeTableHandle(data);
  4313. } //
  4314. else if (item.key === "sync3") {
  4315. this.syncSortHandle(data);
  4316. } else if (item.key === "add") {
  4317. this.addNodeHandle();
  4318. } else if (item.key === "edit") {
  4319. this.editNodeHandle();
  4320. } else if (item.key === "del") {
  4321. this.delNodeHandle();
  4322. } else if (item.value === "jdSync") {
  4323. this.syncInfoHandle(item);
  4324. } else if (item.value === "gsSync") {
  4325. this.$message({
  4326. type: "info",
  4327. message: "暂无相关接口!",
  4328. });
  4329. } else if (item.value === "dqSync") {
  4330. this.syncElectric(item);
  4331. }
  4332. },
  4333. //展示数据同步下拉框
  4334. showSyncbtn() {
  4335. this.isshowSyncbtn = !this.isshowSyncbtn;
  4336. },
  4337. getDictTypelist() {
  4338. if (this.dynamicDictList.length > 1) {
  4339. return;
  4340. }
  4341. getDictionary({
  4342. code: "land_field_dict",
  4343. }).then((res) => {
  4344. res.data.data.forEach((element) => {
  4345. element.dictKey = Number(element.dictKey);
  4346. });
  4347. this.dynamicDictList = res.data.data;
  4348. const filteredList = this.dynamicDictList.filter(
  4349. (item) => item.dictKey === 600 || item.dictKey === 0
  4350. );
  4351. this.dynamicDictList = filteredList;
  4352. });
  4353. },
  4354. getSelectFormElements(id) {
  4355. this.editEleTableloading = true;
  4356. selectFormElements(this.curEleTable.pkeyId, {
  4357. type: 0,
  4358. search: this.searchinput,
  4359. }).then((res) => {
  4360. this.editEleTableloading = false;
  4361. this.editTable = res.data.data;
  4362. });
  4363. },
  4364. //编辑
  4365. handleEdit(index, row) {
  4366. this.curEleTable = row;
  4367. this.getSelectFormElements();
  4368. this.editDialogShow = true;
  4369. this.getDictTypelist();
  4370. },
  4371. //编辑元素信息(请谨慎操作)
  4372. clearsearchinput() {
  4373. this.getSelectFormElements();
  4374. },
  4375. searchinputChange() {
  4376. this.getSelectFormElements();
  4377. },
  4378. saveEles() {
  4379. if (this.editTable.length > 0) {
  4380. this.saveLoading = true;
  4381. updateBatchElements(
  4382. this.editTable,
  4383. this.curEleTable.initTableName
  4384. ).then(() => {
  4385. this.saveLoading = false;
  4386. this.editDialogShow = false;
  4387. this.updateNodeTable();
  4388. this.$message({
  4389. type: "success",
  4390. message: "保存成功!",
  4391. });
  4392. });
  4393. } else {
  4394. this.editDialogShow = false;
  4395. this.updateNodeTable();
  4396. this.$message({
  4397. type: "success",
  4398. message: "保存成功!",
  4399. });
  4400. }
  4401. },
  4402. //文件题名(全局按钮)
  4403. fileTitleHandle(){
  4404. this.getFileTableData()
  4405. this.fileTitleVisible = true;
  4406. },
  4407. changeRadio(val){
  4408. console.log(val,'val');
  4409. const fileItem = this.fileTableData[this.chooseFileIndex];
  4410. this.$set(fileItem, 'type', val);
  4411. },
  4412. //获取文件题名规则
  4413. getFileTableData(){
  4414. this.fileTableLoading=true
  4415. getNameRule(
  4416. { projectId:this.projectid}
  4417. ).then((res) => {
  4418. this.fileTableLoading=false
  4419. if(res.data.data){
  4420. this.fileTableData = res.data.data;
  4421. this.fileTableData.forEach((element) => {
  4422. element.roleNameVal = element.nameRule.split(",");
  4423. element.ruleName=element.nameVaule.split("-")
  4424. if(element.type===2){
  4425. const list=element.list
  4426. let arr=[]
  4427. let arrId=[]
  4428. list.forEach((ele) => {
  4429. arr.push(ele.nodeName)
  4430. arrId.push(ele.nodeId)
  4431. });
  4432. element.ruleSizeVal = arr.join('、');
  4433. element.ruleSizeValId=arrId
  4434. }else{
  4435. element.ruleSizeVal=''
  4436. element.ruleSizeValId=''
  4437. }
  4438. });
  4439. }else{
  4440. this.fileTableData =[]
  4441. }
  4442. });
  4443. },
  4444. //获取文件题名范围
  4445. getTitleRangeData(nameId){
  4446. this.fileTreeLoading=true
  4447. getTitleRange(
  4448. { projectId:this.projectid,
  4449. }
  4450. ).then((res) => {
  4451. this.fileTreeLoading=false
  4452. if(res.data.data){
  4453. this.fileTreeData = res.data.data;
  4454. // this.deCheckTreeKeys = this.fileTreeData.filter(node => node.status === 11).map(node => node.id);
  4455. }else{
  4456. this.fileTreeData =[]
  4457. }
  4458. });
  4459. },
  4460. //选择题名范围
  4461. chooseFile(index,row){
  4462. const {ruleName}=row
  4463. if(ruleName&&ruleName.length>0){
  4464. this.chooseFileVisible = true;
  4465. this.chooseFileIndex= index;
  4466. this.deCheckTreeKeys=row.ruleSizeValId
  4467. this.getTitleRangeData()
  4468. }else{
  4469. this.$message.warning('请先选择文件题名规则');
  4470. }
  4471. },
  4472. checkFileSize(data,{checkedNodes,checkedKeys}){
  4473. let checkedTitles = checkedNodes.map(node => node.nodeName).join('、');
  4474. this.fileTableData[this.chooseFileIndex].isEdit1=false
  4475. const fileItem = this.fileTableData[this.chooseFileIndex];
  4476. this.$set(fileItem, 'ruleSizeVal', checkedTitles);
  4477. this.$set(fileItem, 'ruleSizeValId', checkedKeys);
  4478. this.deCheckTreeKeys=checkedKeys
  4479. },
  4480. getCheckedNodes (treeData, checkedKeys) {
  4481. let result = []
  4482. treeData.forEach(node => {
  4483. if (checkedKeys&&checkedKeys.includes(node.id)) {
  4484. result.push(node)
  4485. }
  4486. if (node.children) {
  4487. result = result.concat(getCheckedNodes(node.children, checkedKeys))
  4488. }
  4489. })
  4490. return result
  4491. },
  4492. saveFileSize(){
  4493. // const checkedNodes = this.getCheckedNodes(this.fileTreeData, this.deCheckTreeKeys).filter(node => node.status !== 11)
  4494. const checkedNodes = this.getCheckedNodes(this.fileTreeData, this.deCheckTreeKeys)
  4495. this.fileTableData[this.chooseFileIndex].ruleSizeValId = checkedNodes.map(node => node.id)
  4496. this.fileTableData[this.chooseFileIndex].ruleSizeVal = checkedNodes.map(node => node.nodeName).join('、')
  4497. this.chooseFileVisible = false;
  4498. this.isShowSize=false
  4499. setTimeout(()=>{
  4500. this.isShowSize=true
  4501. },100)
  4502. },
  4503. editRow(index,row){
  4504. console.log(row,'row');
  4505. this.$set(row, "isEdit", true);
  4506. this.$set(row, "isEdit1", true);
  4507. this.fileTitleModel.type=row.type
  4508. },
  4509. //保存文件题名
  4510. saveRow(index,row){
  4511. if(row.ruleName.length<1){
  4512. this.$message.warning('请选择文件题名规则')
  4513. return
  4514. }
  4515. if(!row.type){
  4516. this.$message.warning('请选择文件题名范围')
  4517. return
  4518. }
  4519. this.$set(row, "isEdit", false);
  4520. this.$set(row, "isEdit1", false)
  4521. const ruleName=row.ruleName.join('-')
  4522. let ruleSizeVal=''
  4523. if(row.type==1){
  4524. ruleSizeVal=''
  4525. }else{
  4526. ruleSizeVal=row.ruleSizeValId.join(',')
  4527. }
  4528. let nameRuleDtos={
  4529. nameId:row.nameId,
  4530. nameRule:ruleName,
  4531. nodeId:ruleSizeVal,
  4532. projectId:this.projectid,
  4533. type:this.fileTitleModel.type
  4534. }
  4535. saveOrUpdateNameRule(
  4536. [nameRuleDtos]
  4537. ).then((res) => {
  4538. if(res.data.code==200){
  4539. this.$message.success(res.data.msg)
  4540. this.getFileTableData()
  4541. }else{
  4542. this.$message.error(res.data.msg)
  4543. }
  4544. });
  4545. },
  4546. changeRoleName(data,row){
  4547. const originalData=this.nodeTypelist
  4548. const dictKeyToDictValueMap = originalData.reduce((acc, item) => {
  4549. acc[item.dictKey] = item.dictValue;
  4550. return acc;
  4551. }, {});
  4552. const result = data.map(dictKey => dictKeyToDictValueMap[dictKey]);
  4553. this.$set(row, "roleNameVal", result);
  4554. this.selectDiv=Math.random()
  4555. },
  4556. addRow(){
  4557. this.fileTableData.unshift({isEdit:true,isEdit1:true,})
  4558. this.fileTitleModel.type=''
  4559. },
  4560. refreshRow(){
  4561. this.getFileTableData()
  4562. },
  4563. delRow(index,row){
  4564. if(!row.nameId){
  4565. this.fileTableData.splice(index,1)
  4566. }else{
  4567. this.$confirm("确定将选择数据删除?", {
  4568. confirmButtonText: "确定",
  4569. cancelButtonText: "取消",
  4570. type: "warning"
  4571. })
  4572. .then(() => {
  4573. return deletedNameRule(
  4574. {nameId:row.nameId}
  4575. ).then((res) => {
  4576. if(res.data.code==200){
  4577. this.$message.success(res.data.msg)
  4578. this.getFileTableData()
  4579. }else{
  4580. this.$message.error(res.data.msg)
  4581. }
  4582. });
  4583. });
  4584. }
  4585. },
  4586. batchsaveFileSize(){
  4587. let isCansave=true
  4588. let saveArr=[]
  4589. this.fileTableData.forEach((ele)=>{
  4590. if(ele.ruleName.length<1||!ele.type){
  4591. this.$message.warning('请先完善相关信息')
  4592. isCansave=false
  4593. return
  4594. }
  4595. let ruleSizeVal=''
  4596. if(ele.type==1){
  4597. ruleSizeVal=''
  4598. }else{
  4599. ruleSizeVal=ele.ruleSizeValId.join(',')
  4600. }
  4601. const ruleName=ele.ruleName.join('-')
  4602. saveArr.push({
  4603. nameId:ele.nameId||'',
  4604. nameRule:ruleName,
  4605. nodeId:ruleSizeVal,
  4606. projectId:this.projectid,
  4607. type:ele.type
  4608. })
  4609. })
  4610. if(!isCansave){
  4611. return
  4612. }
  4613. this.saveFileLoading=true
  4614. saveOrUpdateNameRule(
  4615. saveArr
  4616. ).then((res) => {
  4617. this.saveFileLoading=false
  4618. if(res.data.code==200){
  4619. this.$message.success(res.data.msg)
  4620. this.getFileTableData()
  4621. }else{
  4622. this.$message.error(res.data.msg)
  4623. }
  4624. });
  4625. },
  4626. async proSyncbtn(){
  4627. console.log('项目数据同步');
  4628. this.isAdd=''
  4629. this.getTypeOptions()
  4630. this.getRangeOptions()
  4631. this.getCheckIdList()
  4632. this.proSyncTag=true
  4633. if(this.$refs.syncProTree){
  4634. this.$refs.syncProTree.setCheckedKeys([])
  4635. }
  4636. if(this.$refs.proTable){
  4637. this.$refs.proTable.clearSelection()
  4638. }
  4639. this.isShowLeft=true
  4640. this.isShowTable=false
  4641. },
  4642. getRangeOptions(){
  4643. getDictionary({
  4644. code: "wbs_snyc_range",
  4645. }).then((res) => {
  4646. this.rangeOptions = res.data.data;
  4647. });
  4648. },
  4649. getTypeOptions(){
  4650. getDictionary({
  4651. code: "wbs_sync_type",
  4652. }).then((res) => {
  4653. this.typeOptions = res.data.data;
  4654. });
  4655. },
  4656. handleCheckChange1(data){
  4657. console.log(data,'data1111111111');
  4658. getNodeStatus({ id:data.primaryKeyId}).then((res) => {
  4659. if(res.data.code==200){
  4660. if(res.data.data){
  4661. this.$message.success('该节点有同步任务,请取消选择')
  4662. }
  4663. }else{
  4664. this.$message.error(res.data.msg)
  4665. }
  4666. });
  4667. },
  4668. async handleCheckChange(_,{checkedKeys,halfCheckedNodes}) {
  4669. let ids=checkedKeys && checkedKeys.length ? checkedKeys.join(',') : ''
  4670. // await this.getNodeStatusData()
  4671. this.getTempProjectList(ids)
  4672. },
  4673. async getTempProjectList(ids){
  4674. if(ids.length>0){
  4675. //分页获取证书列表数据
  4676. const { data: res } = await getTempProject({
  4677. nodeIds:ids
  4678. });
  4679. if (res.code == 200) {
  4680. this.templateIdList = res.data;
  4681. }
  4682. }
  4683. },
  4684. async changeTemplateId(val){
  4685. if(!this.isShowTable){
  4686. return
  4687. }
  4688. let type=''
  4689. let projectId=''
  4690. let wbsId=''
  4691. for (let index = 0; index < this.templateIdList.length; index++) {
  4692. const elemet = this.templateIdList[index];
  4693. if(elemet.id==val){
  4694. type = elemet.type;
  4695. projectId=elemet.id
  4696. wbsId=elemet.wbsId
  4697. break
  4698. }
  4699. }
  4700. if(type===2){
  4701. selectByNodeTable(this.curTreeData.id, projectId, wbsId).then((res) => {
  4702. if (res.data.data.length) {
  4703. this.preTableData = res.data.data;
  4704. } else {
  4705. this.preTableData = [];
  4706. }
  4707. });
  4708. }else{
  4709. const { data: res } = await findNodeTableByCondition1( this.curTreeData.id )
  4710. if (res.code === 200) {
  4711. console.log(Array.isArray(res.data));
  4712. if (Array.isArray(res.data)) {
  4713. this.preTableData = res.data
  4714. } else {
  4715. this.preTableData = []
  4716. }
  4717. }
  4718. }
  4719. },
  4720. async getCheckIdList(){
  4721. let code=this.wbsType!==1?'wbs_sync_contract_range':'wbs_sync_contract_quality'
  4722. getDictionary({
  4723. code: code,
  4724. }).then((res) => {
  4725. this.checkIdList = res.data.data;
  4726. });
  4727. },
  4728. closeProSyncTag(){
  4729. this.proSyncTag=false
  4730. this.syncForm={
  4731. range:'',
  4732. rangeName:'',
  4733. type:[],
  4734. typeName:'',
  4735. templateId:'',
  4736. templateName:'',
  4737. contractRange:[],
  4738. contractRangeName:'',
  4739. nodeId:'',
  4740. formIds:''};
  4741. this.preTableData=[]
  4742. this.isShowLeft=false
  4743. },
  4744. async saveProTag(){
  4745. this.syncForm.projectId=this.projectid
  4746. if(this.isShowLeft){
  4747. let ids=this.$refs.syncProTree.getCheckedKeys()
  4748. this.syncForm.nodeId=ids.join(',')
  4749. }else{
  4750. this.syncForm.nodeId=this.curTreeData.primaryKeyId
  4751. }
  4752. // await this.getNodeStatusData()
  4753. if(this.syncListDialog){
  4754. return
  4755. }
  4756. if(this.syncForm.rangeName==''){
  4757. for (let index = 0; index < this.rangeOptions.length; index++) {
  4758. const element =this. rangeOptions[index];
  4759. if(element.dictKey==this.syncForm.range){
  4760. this.syncForm.rangeName=element.dictValue
  4761. break
  4762. }
  4763. }
  4764. }
  4765. console.log(this.syncForm.range,'this.syncForm.range=');
  4766. if(this.syncForm.range===''){
  4767. this.$message.warning('请选择同步范围')
  4768. return
  4769. }
  4770. this.saveProTagLoading=true
  4771. addSync({
  4772. ...this.syncForm,
  4773. type:this.syncForm.type.join(','),
  4774. contractRange:this.syncForm.contractRange.join(',')
  4775. }
  4776. ).then((res) => {
  4777. console.log(res,'res');
  4778. this.saveProTagLoading=false
  4779. if(res.data.code==200){
  4780. this.$message.success(res.data.msg)
  4781. //this.getNodeStatusData()
  4782. console.log(res.data,'res.data');
  4783. this.syncListData.nodeNum=res.data.data.nodeNum
  4784. this.syncListData.nodeNumEnd=res.data.nodeNumEnd
  4785. if(this.isShowLeft){
  4786. this.isAdd=res.data.data.nodeId
  4787. }else{
  4788. this.isAdd=''
  4789. }
  4790. this.syncListDialog=true
  4791. this.closeProSyncTag()
  4792. }else{
  4793. this.$message.error(res.data.msg)
  4794. this.saveProTagLoading=false
  4795. }
  4796. })
  4797. .finally(() => {
  4798. this.saveProTagLoading = false;
  4799. });
  4800. },
  4801. handleCheckAllChange(val) {
  4802. this.syncForm.type = val ? this.typeOptions.map(item => item.dictKey) : [];
  4803. this.isIndeterminate = false;
  4804. },
  4805. handleCheckedTypeChange(value){
  4806. let checkedCount = value.length;
  4807. this.checkAll = checkedCount === this.typeOptions.length;
  4808. this.isIndeterminate = checkedCount > 0 && checkedCount < this.typeOptions.length;
  4809. },
  4810. handleSelectionChange(val) {
  4811. let arr = []
  4812. if(val.length>0){
  4813. for (let index = 0; index < val.length; index++) {
  4814. let i = val[index];
  4815. arr.push(i.id)
  4816. }
  4817. this.syncForm.formIds=arr.join(',')
  4818. }
  4819. },
  4820. async handleCommand(command,row){
  4821. await this.getNodeStatusData()
  4822. if(this.syncListDialog){
  4823. return
  4824. }
  4825. this.checkRow=row
  4826. if(command==='a'){
  4827. this.$confirm("当前表单配置将同步到项目下所有相同表单,请谨慎同步!!!!!!", "表单同步提醒", {
  4828. distinguishCancelAndClose: true,
  4829. confirmButtonText: "确定",
  4830. cancelButtonText: "取消",
  4831. }).then(() => {
  4832. addSync({
  4833. projectId:this.projectid,
  4834. range:'3',
  4835. nodeId:row.pkeyId,
  4836. nodeName:this.curTreeData.title,
  4837. }
  4838. ).then((res) => {
  4839. if(res.data.code==200){
  4840. this.$message.success(res.data.msg)
  4841. }else{
  4842. this.$message.error(res.data.msg)
  4843. }
  4844. })
  4845. });
  4846. }else if(command==='b'){
  4847. this.syncTableDialog=true
  4848. if(this.$refs.proTable1){
  4849. this.$refs.proTable1.clearSelection()
  4850. }
  4851. }
  4852. },
  4853. saveTableSync(){
  4854. this.saveTableSyncLoad=true
  4855. addSync({
  4856. projectId:this.projectid,
  4857. range:'4',
  4858. nodeId:this.checkRow.pkeyId,
  4859. nodeName:this.curTreeData.title,
  4860. formIds:this.formIds,
  4861. }
  4862. ).then((res) => {
  4863. this.saveTableSyncLoad=false
  4864. if(res.data.code==200){
  4865. this.$message.success(res.data.msg)
  4866. this.syncTableDialog=false
  4867. this.$refs.proTable1.clearSelection()
  4868. }else{
  4869. this.$message.error(res.data.msg)
  4870. }
  4871. })
  4872. this.saveTableSyncLoad=false
  4873. },
  4874. handleNodeClick(data) {
  4875. selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
  4876. if (res.data.data.length) {
  4877. this.preTableData1 = res.data.data;
  4878. } else {
  4879. this.preTableData1 = [];
  4880. }
  4881. });
  4882. },
  4883. handleSelectionChange1(val) {
  4884. let arr = []
  4885. if(val.length>0){
  4886. for (let index = 0; index < val.length; index++) {
  4887. let i = val[index];
  4888. arr.push(i.id)
  4889. }
  4890. this.formIds=arr.join(',')
  4891. // this.syncForm.formIds=arr.join(',')
  4892. }
  4893. },
  4894. async refreshData(){
  4895. console.log('刷新数据');
  4896. this.refreshLoading=true
  4897. await this.getNodeStatusData()
  4898. this.syncListDialog=true
  4899. this.refreshLoading=false
  4900. },
  4901. refreshData1(){
  4902. this.refreshLoading1=true
  4903. getNodeStatus({ id:this.isAdd}).then((res) => {
  4904. this.refreshLoading1=false
  4905. if(res.data.code==200){
  4906. if(res.data.data){
  4907. this.syncListData.nodeNum=res.data.data.nodeNum
  4908. this.syncListData.nodeNumEnd=res.data.data.nodeNumEnd
  4909. }else{
  4910. this.syncListData={
  4911. nodeNum:'',//同步节点数量
  4912. nodeNumEnd:''//已同步数量
  4913. }
  4914. }
  4915. }else{
  4916. this.syncListData={
  4917. nodeNum:'',//同步节点数量
  4918. nodeNumEnd:''//已同步数量
  4919. }
  4920. this.$message.error(res.data.msg)
  4921. }
  4922. });
  4923. },
  4924. getNodeStatusData(){
  4925. let ids=''
  4926. if(this.isShowLeft){
  4927. ids=this.$refs.syncProTree.getCheckedKeys()
  4928. ids=ids.join(',')
  4929. }
  4930. else{
  4931. ids=this.curTreeData.primaryKeyId
  4932. }
  4933. getNodeStatus({ id:ids}).then((res) => {
  4934. if(res.data.code==200){
  4935. if(res.data.data){
  4936. this.syncListData.nodeNum=res.data.data.nodeNum
  4937. this.syncListData.nodeNumEnd=res.data.data.nodeNumEnd
  4938. this.syncListDialog=true
  4939. }else{
  4940. this.syncListData={
  4941. nodeNum:'',//同步节点数量
  4942. nodeNumEnd:''//已同步数量
  4943. }
  4944. this.syncListDialog=false
  4945. }
  4946. }else{
  4947. this.syncListDialog=false
  4948. this.syncListData={
  4949. nodeNum:'',//同步节点数量
  4950. nodeNumEnd:''//已同步数量
  4951. }
  4952. this.$message.error(res.data.msg)
  4953. }
  4954. });
  4955. }
  4956. },
  4957. watch: {
  4958. "GLExcelFrom.search"(val) {
  4959. console.log(val);
  4960. if (this.exceldata) {
  4961. this.$refs.tree.filter(val);
  4962. }
  4963. },
  4964. 'syncForm.contractRange': {
  4965. handler(newVal) {
  4966. if (newVal && newVal.length) {
  4967. const selectedValues = newVal.map(key => {
  4968. const item = this.checkIdList.find(item => item.dictKey === key);
  4969. return item ? item.dictValue : key;
  4970. });
  4971. this.syncForm.contractRangeName = selectedValues.join(',');
  4972. } else {
  4973. this.syncForm.contractRangeName = '';
  4974. }
  4975. },
  4976. immediate: true
  4977. },
  4978. 'syncForm.templateId': {
  4979. handler(newVal) {
  4980. if (newVal && newVal.length) {
  4981. for (let index = 0; index < this.templateIdList.length; index++) {
  4982. const elemet = this.templateIdList[index];
  4983. if(elemet.id==newVal){
  4984. this.syncForm.templateName = elemet.name;
  4985. break
  4986. }
  4987. }
  4988. } else {
  4989. this.syncForm.rangeName = '';
  4990. }
  4991. },
  4992. immediate: true
  4993. },
  4994. 'syncForm.type': {
  4995. handler(newVal) {
  4996. if (newVal && newVal.length) {
  4997. const selectedValues = newVal.map(key => {
  4998. const item = this.typeOptions.find(item => item.dictKey === key);
  4999. return item ? item.dictValue : key;
  5000. });
  5001. this.syncForm.typeName = selectedValues.join(',');
  5002. } else {
  5003. this.syncForm.typeName = '';
  5004. }
  5005. },
  5006. immediate: true
  5007. },
  5008. 'syncForm.range': {
  5009. handler(newVal) {
  5010. console.log(newVal,'newVal');
  5011. if (newVal && newVal.length) {
  5012. for (let index = 0; index < this.rangeOptions.length; index++) {
  5013. const elemet = this.rangeOptions[index];
  5014. if(elemet.dictKey==newVal){
  5015. this.syncForm.rangeName = elemet.dictValue;
  5016. break
  5017. }
  5018. }
  5019. } else {
  5020. this.syncForm.rangeName = '';
  5021. }
  5022. },
  5023. immediate: true
  5024. },
  5025. },
  5026. components: {
  5027. dynamicExcel,
  5028. ManualSorting,
  5029. FormulaEdit,
  5030. EditElement,
  5031. FormulaEditone,
  5032. },
  5033. };
  5034. </script>
  5035. <style scoped lang="scss">
  5036. .font-s-12 ::v-deep .iconfont {
  5037. font-size: 12px;
  5038. }
  5039. .el-popper[x-placement^="bottom"] {
  5040. margin-top: -6px;
  5041. }
  5042. .right-btn {
  5043. position: absolute;
  5044. right: 20px;
  5045. top: 10px;
  5046. font-size: 20px;
  5047. }
  5048. .custom-tree-node {
  5049. .normal-black {
  5050. display: none;
  5051. }
  5052. &:hover {
  5053. .normal-black {
  5054. display: inline-block;
  5055. }
  5056. }
  5057. &.show .normal-black {
  5058. display: inline-block;
  5059. }
  5060. }
  5061. .excelBox {
  5062. ::v-deep .el-dialog__body {
  5063. padding: 20px;
  5064. }
  5065. }
  5066. //调整表单样式
  5067. .excelHtml {
  5068. position: absolute;
  5069. z-index: 999999;
  5070. top: 50px;
  5071. left: 0px;
  5072. width: 100%;
  5073. height: 100%;
  5074. }
  5075. .jiedian {
  5076. ::v-deep .el-dialog__body {
  5077. padding: 10px 20px !important;
  5078. }
  5079. }
  5080. .filter-tree {
  5081. min-width: 100%;
  5082. display: inline-block;
  5083. }
  5084. .full-dialog {
  5085. ::v-deep .el-dialog__body {
  5086. padding-bottom: 0;
  5087. padding-top: 0;
  5088. }
  5089. ::v-deep .basic-container {
  5090. height: calc(100vh - 60px);
  5091. }
  5092. }
  5093. .my-basic-con {
  5094. padding: 6px 6px;
  5095. }
  5096. // 树形控件菜单样式
  5097. .contextmenu {
  5098. margin: 0;
  5099. background: #fff;
  5100. z-index: 1000;
  5101. position: fixed; //关键样式设置固定定位
  5102. list-style-type: none;
  5103. padding: 5px 0;
  5104. border-radius: 4px;
  5105. font-size: 12px;
  5106. font-weight: 400;
  5107. color: #333;
  5108. box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
  5109. }
  5110. .contextmenu li {
  5111. margin: 0;
  5112. padding: 7px 16px;
  5113. cursor: pointer;
  5114. }
  5115. .contextmenu li:hover {
  5116. background: #eee;
  5117. }
  5118. .selectBtn {
  5119. position: absolute;
  5120. top: 50px;
  5121. right: 585px;
  5122. z-index: 1000;
  5123. width: 140px;
  5124. text-align: left;
  5125. }
  5126. .titlerow {
  5127. // float: right;
  5128. background-color: rgba(31, 34, 41, 0.8);
  5129. // width:104%;
  5130. padding-left: 10px;
  5131. padding-right: 10px;
  5132. text-align: right;
  5133. margin-top: -20px;
  5134. margin-left: -20px;
  5135. margin-right: -20px;
  5136. }
  5137. .dialog-title-tip{
  5138. position: absolute;
  5139. color:rgba(255, 125, 67, 1);
  5140. right: 60px;
  5141. }
  5142. .sync-container{
  5143. display: flex;
  5144. height: 570px;
  5145. .box-card-1{
  5146. margin-right: 10px;
  5147. height: 100%;
  5148. overflow-y: auto;
  5149. }
  5150. .box-card-2{
  5151. flex: 1;
  5152. height: 100%;
  5153. overflow-y: auto;
  5154. .el-form-item {
  5155. border: 1px solid #dcdfe6;
  5156. padding: 0 10px 10px 10px;
  5157. border-radius: 4px;
  5158. font-weight: bold;
  5159. .el-form-item__label {
  5160. font-weight: bold;
  5161. padding-bottom: 0px;
  5162. }
  5163. .el-form--label-top .el-form-item__label{
  5164. padding: 0px !important;
  5165. }
  5166. }
  5167. }
  5168. }
  5169. .content-box{
  5170. display: flex;
  5171. flex-direction: column;
  5172. justify-content: center;
  5173. align-items: center;
  5174. font-weight: bolder;
  5175. .mt-14{
  5176. margin-top: 14px;
  5177. }
  5178. }
  5179. </style>
  5180. <style lang="scss">
  5181. .el-dialog.hc-link-nodes-dialog {
  5182. width: 500px;
  5183. margin-top: 50px !important;
  5184. height: calc(100% - 100px);
  5185. .el-dialog__body {
  5186. height: calc(100% - 154px);
  5187. border-top: 1px solid #eee;
  5188. border-bottom: 1px solid #eee;
  5189. padding: 14px;
  5190. overflow: auto;
  5191. }
  5192. }
  5193. .el-tree.hc-link-nodes-tree .el-tree-node .el-tree-node__content {
  5194. .el-checkbox {
  5195. display: none;
  5196. }
  5197. .is-leaf + .el-checkbox {
  5198. display: inline-block;
  5199. }
  5200. }
  5201. .warning-text{
  5202. color: orange;
  5203. font-weight: bold;
  5204. }
  5205. .orange {
  5206. color: orange;
  5207. }
  5208. .box-card-2{
  5209. .el-form-item {
  5210. .el-form-item__content {
  5211. line-height: 10px !important;
  5212. margin-top: -10px !important;
  5213. }
  5214. }
  5215. }
  5216. </style>