1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892 |
- <template>
- <div style="height: 100%;">
- <basic-container v-show="showType == 1" >
- <el-row class="titlerow">
-
- <el-col >
- <div style="position:relative" >
- <span style="float: left; margin-top: 15px;color: white;">{{projectName }}</span>
- <!-- 同步按钮 -->
- <el-button
- size="medium"
- icon="el-icon-arrow-down"
- style="margin-right:10px"
- @click="showSyncbtn"
- v-show="!isshowSyncbtn"
- >数据同步</el-button >
- <el-button
- size="medium"
- icon="el-icon-arrow-up"
- style="margin-right:10px"
- @click="showSyncbtn"
- v-show="isshowSyncbtn"
- >数据同步</el-button >
- <!-- <el-select v-model="menuvalue" placeholder="数据同步" class="selectBtn" v-if="isshowSyncbtn">
- <el-option
- v-for="item in menuoptions"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- <span style="float: left">{{ item.label }}</span>
- </el-option>
- </el-select> -->
- <ul
- v-show="isshowSyncbtn"
- class="contextmenu selectBtn"
- >
- <li v-for="item in menuoptions" :key="item" @click="menuClick($event,item,data)" v-loading="item.load">
- {{item.label}}
- </li>
- </ul>
-
- <el-button
- size="medium"
- icon="el-icon-s-grid"
- @click="eleFormulaHandle"
- v-if="leftType == 5"
- >表单设置</el-button
- >
- <el-button
- size="medium"
- icon="el-icon-s-grid"
- @click="eleHandle"
- v-else
- >元素设置</el-button
- >
-
- <!-- <el-button
- class="el-btn-purple"
- type="primary"
- size="medium"
- icon="el-icon-upload"
- :loading="syncBtnLoad"
- @click="syncInfoHandle"
- >同步节点参数</el-button
- > -->
-
- <el-button
- size="medium"
- icon="el-icon-help"
- @click="nodeInfoHandle"
- >节点参数设置</el-button
- >
- <el-button
- style="margin-top:10px"
- size="medium"
- icon="el-icon-price-tag"
- @click="independent"
- >独立表单库</el-button
- >
- <el-button
- style="margin-top:10px"
- size="medium"
- icon="el-icon-time"
- @click="archiveTimeClick"
- >归档文件时间设置</el-button
- >
- <!-- <el-button
- :loading="syncElectricLoad"
- style="margin-top:10px"
- class="el-btn-purple"
- type="primary"
- size="medium"
- icon="el-icon-upload"
- @click="syncElectric"
- >同步电签默认信息</el-button
- > -->
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="20" class="h-100p" style="padding:10px">
-
- <el-col :span="10" class="h-100p">
- <div class="h-100p flex flex-d-c">
- <p style="margin-top:2px">工程节点信息</p>
- <div class="flex " style="align-items: center;justify-content: space-between;">
- <el-input
- placeholder="输入关键字进行过滤"
- v-model="filterText"
- clearable
- style="width: 65%;margin-right: 15px;"
- @clear="clearSearch"
- ></el-input>
- <el-switch
- v-model="searchType"
- active-value="1"
- inactive-value="2"
- inline-prompt
- active-text="按节点"
- inactive-text="按表名"
-
-
- />
- <el-button type="primary" @click="searchTreeClick">搜索</el-button>
- </div>
- <div class="flex1 ov-hidden">
- <el-scrollbar class="h-100p">
- <div v-loading="treeLoad">
- <el-tree
- class="filter-tree"
- lazy
- :load="loadNode"
- @node-click="getNodeDetail"
- :props="defaultProps"
- :expand-on-click-node="false"
- highlight-current
- node-key="id"
- ref="tree"
- :default-expanded-keys="defaultExpandedKeys"
- v-show="!isSearch"
- >
- <span
- class="custom-tree-node "
- :class="data.moreShow ? 'show' : ''"
- slot-scope="{ node, data }"
- @mouseleave="mouseout(data)"
- >
- <div class="pd-r-20 " >
- {{ node.label }}
- <div class="normal-black ">
- <div >
- <el-link :underline="false">
- <i
- class="el-icon-menu "
- @click="showMenu($event,data, node)"
- v-if="node.level != 1"
-
- ></i>
- </el-link>
-
-
- <!-- 因右键自定义菜单事件需要获取当前点击的位置,所以此处绑定动态样式来控制菜单实时跟踪鼠标右键点击位置 -->
- <ul
- v-show="menuvisible"
- :style="{ left: menuleft + 'px', top: menutop + 'px' }"
- class="contextmenu"
- >
- <li v-for="item in menusData" :key="item" @click="menuClick($event,item,data)">
- <i :class="item.icon"></i>
- <el-tooltip class="item" effect="light" :content="item.content" placement="right-start">
- <span>{{item.label}}</span>
- </el-tooltip>
- </li>
-
- </ul>
- </div>
- </div>
-
- </div>
- </span>
- </el-tree>
- <el-tree
- :load="searchtreeLoad"
- :data="searchTreeData"
- @node-click="getNodeDetail"
- :props="defaultProps"
- :expand-on-click-node="false"
- highlight-current
- node-key="id"
- v-show="isSearch"
- default-expand-all
- >
- <span
- class="custom-tree-node "
- :class="data.moreShow ? 'show' : ''"
- slot-scope="{ node, data }"
- @mouseleave="mouseout(data)"
- >
- <div class="pd-r-20 " >
- {{ node.label }}
- <div class="normal-black ">
- <div >
- <el-link :underline="false">
- <i
- class="el-icon-menu "
- @click="showMenu($event,data, node)"
- v-if="node.level != 1"
-
- ></i>
- </el-link>
-
-
- <ul
- v-show="menuvisible"
- :style="{ left: menuleft + 'px', top: menutop + 'px' }"
- class="contextmenu"
- >
- <li v-for="item in menusData" :key="item" @click="menuClick($event,item,data)">
- <i :class="item.icon"></i>{{item.label}}
- </li>
- </ul>
- </div>
- </div>
-
- </div>
- </span>
- </el-tree>
- </div>
- </el-scrollbar>
- </div>
- </div>
- </el-col>
- <el-col :span="14" class="h-100p flex flex-d-c">
-
- <template v-if="leftType == 5">
- <div class="mg-b-10">节点信息</div>
- <div>
- <el-table :data="tableData" border style="width: 100%">
- <el-table-column
- align="center"
- prop="nodeName"
- label="当前节点"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="nodeType"
- :formatter="formatCat"
- label="节点类型"
- width="180"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="parentName"
- label="上级节点"
- ></el-table-column>
- </el-table>
- </div>
- <div class="flex jc-sb">
- <p>
- <span>当前项目信息表</span>
- <!-- <el-button
- @click="showFormElement"
- type="text"
- icon="el-icon-circle-plus-outline"
- class="text-icon mg-l-10"
- ></el-button>
- <el-button
- type="text"
- icon="el-icon-document-copy"
- class="text-icon"
- ></el-button> -->
- <el-button
- type="text"
- style="margin-left: 10px"
- icon="el-icon-edit-outline"
- class="text-icon"
- @click="editEditElementForm()"
- ></el-button>
- <el-button
- type="text"
- icon="el-icon-sort"
- class="text-icon"
- @click="privateTableSort()"
- ></el-button>
- </p>
- <div class="mg-t-10"></div>
- </div>
- <div style="flex: 1; position: relative">
- <el-table
- :data="formData"
- border
- height="100%"
- style="width: 100%; position: absolute"
- >
- <el-table-column
- align="center"
- prop="tableName"
- label="表单名称"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="elementTotal"
- width="80"
- label="字段总量"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="fillRate"
- width="100"
- label="填报率"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="tableType"
- :formatter="formatTableType"
- width="100"
- label="表单类型"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="tableOwner"
- :formatter="formatOwner"
- label="所属方"
- ></el-table-column>
- <el-table-column label="操作" width="240">
- <template slot-scope="scope">
- <el-button
- size="mini"
- @click="handleEdit(scope.$index, scope.row)"
- >预览</el-button
- >
- <el-button
- size="mini"
- type="primary"
- v-throttle="3000"
- v-show="scope.row.status == 0"
- @click="hideMD(scope.row)"
- >取消隐藏</el-button
- >
- <el-button
- size="mini"
- type="primary"
- v-throttle="3000"
- v-show="scope.row.status == 1"
- @click="hideMD(scope.row)"
- >隐藏表单</el-button
- >
- <el-button
- size="mini"
- type="danger"
- @click="handleDelete(scope.$index, scope.row)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </div>
- </template>
- <template v-if="leftType == 4">
- <div style="flex: 1; position: relative">
- <el-table
- :data="formData"
- border
- height="100%"
- style="width: 100%; position: absolute"
- >
- <el-table-column
- align="center"
- prop="tableName"
- label="表单名称"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="tableType"
- :formatter="formatTableType"
- label="表单类型"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="fillRate"
- label="填报率"
- ></el-table-column>
- <el-table-column
- label="是否关联清表"
- prop="isLinkTable"
- align="center"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.isLinkTable == 2">是</span>
- <span v-else>否</span>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="tableOwner"
- :formatter="formatOwner"
- label="所属方"
- ></el-table-column>
- <el-table-column label="操作" width="450" align="center">
- <template slot-scope="scope">
- <el-link type="primary" @click="Associationlist(scope)"
- >关联清表</el-link
- >
- <el-link
- class="mg-l-10"
- type="primary"
- :disabled="scope.row.excelId == -1||scope.row.excelId == null"
- @click="
- rightClick(
- scope.row.pkeyId,
- scope.row.excelId,
- scope.row.id,
- scope.row.initTableName,
- scope.row.initTableId
- )
- "
- >编辑元素</el-link
- >
- <el-link
- class="mg-l-10"
- type="primary"
- :disabled="scope.row.excelId == -1||scope.row.excelId == null"
- @click="adjustExcel(scope.row.pkeyId, scope.row.excelId)"
- >调整表单</el-link
- >
- <el-link
- class="mg-l-10"
- type="primary"
- @click="handleEditFormula(scope.$index, scope.row)"
- >编辑元素公式.</el-link
- >
- <el-button
- class="mg-l-10"
- type="text"
- :loading="handlesyncLoad"
- @click="handlesync(scope.$index, scope.row)"
- >表单同步</el-button>
- <el-link
- class="mg-l-10"
- type="danger"
- @click="handleDelete(scope.$index, scope.row)"
- >删除表单</el-link
- >
- </template>
- </el-table-column>
- </el-table>
- </div>
- </template>
- </el-col>
- </el-row>
- </basic-container>
- <el-row class="h-100p" v-show="showType == 2">
- <el-col :span="6" class="h-100p">
- <basic-container>
- <el-scrollbar class="h-100p">
- <el-tree
- class="filter-tree"
- lazy
- :data="typeTreeData"
- :load="typeTreeLoadNode"
- @node-click="getTypeTreeDetail"
- :props="defaultProps"
- :expand-on-click-node="false"
- highlight-current
- node-key="id"
- >
- </el-tree>
- </el-scrollbar>
- </basic-container>
- </el-col>
- <el-col :span="18" class="h-100p">
- <basic-container>
- <div class="flex h-100p flex-d-c">
- <div style="flex: 1; position: relative">
- <el-table
- :data="formData"
- border
- height="100%"
- style="width: 100%; position: absolute"
- >
- <el-table-column
- align="center"
- prop="tableName"
- label="表单名称"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="tableType"
- :formatter="formatTableType"
- label="表单类型"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="fillRate"
- label="填报率"
- ></el-table-column>
- <el-table-column
- label="是否关联清表"
- prop="isLinkTable"
- align="center"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.isLinkTable == 2">是</span>
- <span v-else>否</span>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="tableOwner"
- :formatter="formatOwner"
- label="所属方"
- ></el-table-column>
- <el-table-column label="操作" align="center">
- <template slot-scope="scope">
- <el-link type="primary" @click="Associationlist(scope)"
- >关联清表</el-link
- >
- <el-link
- class="mg-l-10"
- type="primary"
- :disabled="scope.row.excelId == -1||scope.row.excelId == null"
- @click="
- rightClick(
- scope.row.pkeyId,
- scope.row.excelId,
- scope.row.id,
- scope.row.initTableName,
- scope.row.initTableId
- )
- "
- >编辑元素</el-link
- >
- <el-link
- class="mg-l-10"
- type="primary"
- :disabled="scope.row.excelId == -1||scope.row.excelId == null"
- @click="adjustExcel(scope.row.pkeyId, scope.row.excelId)"
- >调整表单</el-link
- >
- <el-link
- class="mg-l-10"
- type="primary"
- @click="handleEditFormula(scope.$index, scope.row)"
- >编辑元素公式</el-link
- >
-
- <el-link
- class="mg-l-10"
- type="danger"
- @click="handleDelete(scope.$index, scope.row)"
- >删除表单</el-link
- >
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="mg-t-10 flex jc-sb">
- <div></div>
- <el-button size="medium" @click="showType = 1"
- >返回WBS树</el-button
- >
- </div>
- </div>
- </basic-container>
- </el-col>
- </el-row>
- <!-- 编辑元素表单信息 -->
- <el-dialog
- title="编辑元素表单信息"
- :visible.sync="editElementFormTag"
- width="60%"
- :modal-append-to-body="false"
- >
- <div>
- <el-table :data="formDatass" border style="width: 100%">
- <el-table-column prop="tableName" label="表名">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.tableName"
- placeholder="请输入表名称"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column prop="tableType" label="表类型">
- <template slot-scope="scope">
- <el-select v-model="scope.row.tableType" placeholder="请选择">
- <el-option
- v-for="(item, key) in tableTypelist"
- :key="key"
- :label="item.dictValue"
- :value="item.dictKey"
- >
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column prop="tableOwner" label="所属方">
- <template slot-scope="scope">
- <el-select v-model="scope.row.tableOwner" placeholder="请选择">
- <el-option
- v-for="(item, key) in ownerTypeList"
- :key="key"
- :label="item.dictValue"
- :value="item.dictKey"
- >
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column prop="fillRate" label="填报率">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fillRate"
- placeholder="请输入填报率"
- ></el-input>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="editElementFormTag = false">取 消</el-button>
- <el-button type="primary" @click="editeditElementFormMF()" :loading="editeditElementFormMFLoading"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <!-- 调整表单模板 -->
- <div v-if="excelHtml" class="excelHtml">
- <dynamicExcel
- @remove="removeExcel"
- v-if="excelHtml"
- :pkeyId="GLExcelFrom.id"
- />
- </div>
- <!-- 私有wbs树排序弹框 -->
- <!-- <el-dialog
- title="调整排序"
- :visible.sync="sortTag"
- width="50%"
- append-to-body
- >
- <ManualSorting v-if="sortTag2" @bianhua="bianhua()" :sort="sort" />
- <span slot="footer" class="dialog-footer">
- <el-button @click="(sortTag = false), (sortTag2 = false)"
- >取 消</el-button
- >
- <el-button type="primary" @click="editSort()">确 定</el-button>
- </span>
- </el-dialog> -->
- <el-dialog
- title="调整排序"
- :visible.sync="sortTag"
- width="50%"
- append-to-body
- >
- <ManualSorting v-if="sortTag2" @bianhua="bianhua()" :sort="sort" />
- <span slot="footer" class="dialog-footer">
- <el-button @click="(sortTag = false), (sortTag2 = false)"
- >取 消</el-button
- >
- <el-button type="primary" @click="editSort()" v-loading="sureSortload">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 元素表排序 -->
- <el-dialog
- title="调整排序"
- :visible="excelSortTag"
- width="50%"
- append-to-body
- >
- <ManualSorting
- v-if="excelSortTag2"
- @bianhua="bianhua2()"
- :sort="tableSortList"
- />
- <span slot="footer" class="dialog-footer">
- <el-button @click="excelSortTag = false">取 消</el-button>
- <el-button type="primary" @click="editPrivateSort()" v-loading="surePrivateSortload">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 关联清表 -->
- <el-dialog
- title="关联清表"
- class="excelBox"
- :visible.sync="GLExcel"
- width="500px"
- modal-append-to-body
- append-to-body
- @close="GLExcelMD"
- >
- <div>
- <el-select
- style="width: 400px"
- v-model="GLExcelFrom.name"
- placeholder="请选择"
- @change="changetherr()"
- >
- <el-option
- v-for="(item, key) in GLExcelData"
- :key="key"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <el-scrollbar style="margin-top: 20px; height: 50vh">
- <el-input
- style="width: 400px"
- v-model.trim="GLExcelFrom.search"
- placeholder="请输入需要选择的内容"
- ></el-input>
- <el-tree
- :filter-node-method="filterNode222"
- ref="tree"
- class="filter-tree"
- style="margin-top: 10px"
- :props="GLExcelProps"
- :data="exceldata"
- node-key="id"
- accordion
- show-checkbox
- @check="checkchange"
- v-loading="GLExcelLoading"
- >
- </el-tree>
- </el-scrollbar>
- </div>
- <span
- slot="footer"
- class="dialog-footer"
- style="display: flex; justify-content: center; align-items: center"
- >
- <el-button @click="GLExcelMD()">取 消</el-button>
- <el-button
- style="margin-left: 30px"
- type="primary"
- v-throttle="2000"
- @click="saveLinkTab()"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <!-- 节点详情 -->
- <el-dialog
- :title="dialogTitle"
- :visible.sync="dialogVisible"
- width="50%"
- append-to-body
- :close-on-click-modal="false"
- @closed="saveNodeLoading = false"
- >
- <el-form
- ref="nodeDetail"
- :model="nodeDetail"
- :rules="rules"
- label-width="140px"
- >
- <el-form-item label="节点名称" prop="nodeName">
- <div class="flex">
- <el-input v-model="nodeDetail.nodeName"></el-input>
- <el-button class="mg-l-10" type="primary" @click="aliasShow"
- >添加别名</el-button
- >
- </div>
- </el-form-item>
- <el-form-item label="上级节点">
- <el-input v-model="nodeDetail.parentName" disabled></el-input>
- </el-form-item>
- <el-form-item label="节点类型" prop="nodeType">
- <el-select
- v-model="nodeDetail.nodeType"
-
- placeholder="请选择"
- class="w-100p"
- @change="nodeTypeChange"
- >
- <el-option
- v-for="item in nodeTypelist"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="划分编号" v-if="wbsType !== 2&&wbsType !== 5">
- <el-input v-model="nodeDetail.partitionCode"></el-input>
- </el-form-item>
- <el-form-item label="唯一编码" v-if="wbsType !== 5">
- <el-input v-model="nodeDetail.uniqueCode"></el-input>
- </el-form-item>
- <template v-if="nodeDetail.nodeType == 6">
- <el-form-item label="是否有混凝土">
- <el-radio-group v-model="nodeDetail.isConcrete" size="small">
- <el-radio :label="0" border>无</el-radio>
- <el-radio :label="1" border>有</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="是否试验节点">
- <el-radio-group v-model="nodeDetail.isExpernode" size="small">
- <el-radio :label="0" border>否</el-radio>
- <el-radio :label="1" border>是</el-radio>
- </el-radio-group>
- </el-form-item>
- </template>
- <el-form-item
- label="内业资料类型"
- prop="majorDataType"
- v-if="wbsType !== 2&&wbsType !== 5"
- >
- <el-select
- v-model="nodeDetail.majorDataType"
-
- placeholder="请选择"
- class="w-100p"
- >
- <el-option
- v-for="item in majorDataTypeList"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item
- label="勾选相关联试验"
- prop="mixRatioTestIds"
- v-if="wbsType === 2 && nodeDetail.nodeType === 53"
- >
- <div
- style="position: relative; height: 300px; border: 1px solid #dddfe6"
- >
- <el-scrollbar class="h-100p">
- <div v-loading="testTreeLoad">
- <el-tree
- class="filter-tree"
- :data="testTreeData"
- :props="defaultProps"
- :expand-on-click-node="false"
- highlight-current
- node-key="id"
- ref="treeall"
- show-checkbox
- :default-checked-keys="mixRatioTestIds"
- @check="TestTreeCheckChange"
- />
- </div>
- </el-scrollbar>
- </div>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="saveNode" :loading="saveNodeLoading"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <!-- 创建新的元素表 -->
- <el-dialog
- title="创建新的元素表"
- :visible.sync="eleVisible"
- width="80%"
- append-to-body
- :close-on-click-modal="false"
- >
- <el-form
- ref="eleDialog"
- :model="eleForm"
- :rules="eleRules"
- label-width="110px"
- >
- <el-form-item label="表名" prop="nodeName">
- <el-input v-model="eleForm.nodeName"></el-input>
- </el-form-item>
- <el-row>
- <el-col :span="12">
- <el-form-item label="表类型" prop="tableType">
- <el-select
- v-model="eleForm.tableType"
- placeholder="请选择"
- class="w-100p"
- >
- <el-option
- v-for="item in tableTypelist"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="所属方" prop="tableOwner">
- <el-select
- v-model="eleForm.tableOwner"
- placeholder="请选择"
- class="w-100p"
- >
- <el-option
- v-for="item in ownerTypeList"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div class="flex jc-sb">
- <div></div>
- <div>
- <el-link type="primary" @click="importVisible = true"
- >快捷导入</el-link
- >
- <el-link type="primary" class="mg-l-20" @click="downloadTmp"
- >下载导入模版</el-link
- >
- </div>
- </div>
- <div class="border-grey">
- <p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
- <el-table
- :data="eleForm.elementList"
- border
- style="width: 100%"
- height="400px"
- >
- <el-table-column
- align="center"
- type="index"
- width="50"
- ></el-table-column>
- <el-table-column align="center" prop="eName" label="字段名称">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.eName"
- size="small"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="eType"
- label="数据类型"
- width="120"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.eType"
- size="small"
- placeholder="请选择"
- >
- <el-option
- v-for="item in dataTypeList"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="eLength"
- label="长度"
- width="120"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.eLength"
- size="small"
- placeholder="请输入内容"
- :disabled="scope.row.eType == 4"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="eAllowDeviation"
- label="允许偏差值"
- >
- <template slot-scope="scope">
- <div class="flex">
- <el-select
- v-model="scope.row.allow"
- size="small"
- placeholder="请选择"
- style="width: 120px"
- >
- <el-option :key="1" label="≥" value="≥"></el-option>
- <el-option :key="2" label="≤" value="≤"></el-option>
- <el-option :key="3" label="±" value="±"></el-option>
- <el-option :key="4" label="【】" value="【】"></el-option>
- </el-select>
- <el-input
- v-model="scope.row.deviation"
- size="small"
- placeholder="请输入内容"
- ></el-input>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="eInspectionMethod"
- label="检查方法和频率"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.eInspectionMethod"
- size="small"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column align="center" label="操作" width="80">
- <template slot="header">
- <el-button
- @click="addEleRow(eleForm.elementList)"
- type="text"
- icon="el-icon-circle-plus-outline"
- class="text-icon"
- ></el-button>
- </template>
- <template slot-scope="scope">
- <el-button
- icon="el-icon-remove-outline"
- type="text"
- @click="delEleRow(scope.$index, eleForm.elementList)"
- class="text-icon text-icon-danger"
- ></el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="eleVisible = false">取 消</el-button>
- <el-button type="primary" @click="saveFormAndElementHandle"
- >保 存</el-button
- >
- </span>
- </el-dialog>
- <!-- 模板导入 -->
- <el-dialog
- title="模版导入"
- :visible.sync="importVisible"
- width="50%"
- append-to-body
- :close-on-click-modal="false"
- >
- <p>
- 提示:必须按照系统要求的模版格式上传,否则系统识别无效
- <el-link type="primary" @click="downloadTmp">下载导入模版</el-link>
- </p>
- <div>
- <el-button size="small" type="primary" @click="fileClick2"
- >本地上传</el-button
- >
- <input
- @change="tmpImport"
- type="file"
- hidden
- ref="file2"
- accept=".xls, .xlsx"
- />
- </div>
- <el-table :data="tempList" border style="width: 100%">
- <el-table-column align="center" prop="eName" label="字段信息">
- </el-table-column>
- <el-table-column
- align="center"
- prop="eType"
- label="数据类型"
- width="120"
- >
- </el-table-column>
- <el-table-column align="center" prop="eLength" label="长度" width="120">
- </el-table-column>
- <el-table-column
- align="center"
- prop="eAllowDeviation"
- label="允许偏差值"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="eInspectionMethod"
- label="检查方法和频率"
- >
- </el-table-column>
- </el-table>
- <span slot="footer" class="dialog-footer">
- <el-button @click="importVisible = false">取 消</el-button>
- <el-button type="primary" @click="importHandle">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 编辑元素 -->
- <el-dialog
- :title="(curEleTable.tableName ? curEleTable.tableName : '') + ''"
- :visible.sync="editEleVisible"
- width="80%"
- append-to-body
- :close-on-click-modal="false"
- >
- <!-- <p class="font-c-warning">编辑元素信息(请谨慎操作)</p> -->
- <el-table :data="editEleList" border style="width: 100%" height="400px">
- <el-table-column
- align="center"
- type="index"
- width="50"
- ></el-table-column>
- <el-table-column align="center" prop="eName" label="字段信息">
- </el-table-column>
- <el-table-column
- align="center"
- prop="eType"
- label="数据类型"
- width="120"
- :formatter="eTypeFormatter"
- >
- </el-table-column>
- <el-table-column align="center" prop="eLength" label="长度" width="120">
- </el-table-column>
- <el-table-column
- align="center"
- prop="eAllowDeviation"
- label="允许偏差值"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="eInspectionMethod"
- label="检查方法和频率"
- >
- </el-table-column>
- </el-table>
- <span slot="footer" class="dialog-footer">
- <el-button @click="editEleVisible = false">取 消</el-button>
- <!-- <el-button
- type="primary"
- @click="saveEles"
- >确 定</el-button> -->
- </span>
- </el-dialog>
- <!-- 元素公式 -->
- <el-dialog
- :title="(curEleTable.tableName?curEleTable.tableName:'')+' 元素公式..'"
-
- :visible.sync="editEleFormulaVisible"
- width="800px"
- append-to-body
- :close-on-click-modal="false"
- >
- <div class="flex mg-b-10">
- <el-input
- v-model="formulaInput"
- placeholder="请输入名称"
- size="samll"
- clearable
- @clear="searchFormulaName"
- ></el-input>
- <el-button type="info" class="mg-l-10" @click="searchFormulaName"
- >搜索</el-button
- >
- </div>
- <el-table
- :data="editEleListFilter"
- border
- style="width: 100%"
- height="400px"
- >
- <el-table-column align="center" prop="eName" label="字段信息">
- </el-table-column>
- <el-table-column align="center" label="操作" width="200">
- <template slot-scope="scope">
- <el-link
- :type="scope.row.globalFormula == 1 ? 'warning' : 'primary'"
- @click="toFormulaEdit(scope.row,10)"
- >全局公式</el-link
- >
- <el-link
- class="mg-l-10"
- :type="scope.row.isSaveFormula == 1 ? 'warning' : 'primary'"
- @click="toFormulaEdit(scope.row,20)"
- >节点公式</el-link
- >
- <!-- <el-link
- class="mg-l-10"
- type="danger"
- @click="delEleRowHandle(scope.$index,editEleListFilter)"
- >删除</el-link> -->
- </template>
- </el-table-column>
- </el-table>
- </el-dialog>
- <!-- 导入划分 -->
- <el-dialog
- title="导入划分"
- :visible.sync="importTemplateVisible"
- width="800px"
- append-to-body
- :close-on-click-modal="false"
- >
- <div v-loading="importLoading">
- <div>
- <el-link type="primary" @click="handleDownload">下载导入模版</el-link>
- </div>
- <div class="mg-t-20">
- <el-button type="primary" @click="fileClick">选择文件</el-button>
- <span v-if="upFile" class="mg-l-20">{{ upFile.name }}</span>
- <input
- @change="fileChange"
- type="file"
- hidden
- ref="file"
- accept=".xls, .xlsx"
- />
- </div>
- <div v-if="!upFile">当前还未选择文件,请选择需要导入的文件</div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="importTemplateVisible = false">取 消</el-button>
- <el-button
- type="primary"
- @click="importTemplateHandle"
- :loading="importLoading"
- >导 入</el-button
- >
- </span>
- </el-dialog>
- <!-- 节点参数 -->
- <el-dialog
- title="节点参数"
- :visible.sync="nodeInfoVisible"
- width="800px"
- append-to-body
- class="jiedian"
- :close-on-click-modal="false"
- :show-close="false"
- @close="closenodeInfoVisible"
- >
- <div>
- <el-button
- type="text"
- icon="el-icon-s-operation"
- class="right-btn"
- @click="setNodeParameters()"
- ></el-button>
- <div class="flexEnd">
- <i
- class="el-icon-circle-plus marbottom10"
- @click="addNodeInfoTable()"
- style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
- ></i>
- <i
- class="el-icon-refresh-right marbottom10"
- @click="refreshnfoTable()"
- style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
- ></i>
- </div>
- <el-table :data="nodeInfoTable" border style="width: 100%" height="400" v-loading="nodeInfoTableLoad">
- <el-table-column align="center" prop="name" label="参数名称">
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.k"
- placeholder="请选择"
- class="w-100p"
-
- >
- <el-option
- v-for="item in namelist"
- :key="item.k"
- :label="item.name"
- :value="item.k"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="value" label="参数值设置">
- <template slot-scope="scope">
- <el-input v-model="scope.row.v"></el-input>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="describe" label="描述">
- <template slot-scope="scope">
- <el-input v-model="scope.row.remark"></el-input>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="120" align="center">
- <template slot-scope="scope">
- <el-button
- type="text"
- size="small"
- class="text-icon-primary"
- @click="linkEle(scope.row)"
- >关联元素</el-button>
- <el-button
- type="text"
- size="small"
- class="text-icon-danger"
- @click="delNodeInfoss(scope.$index,scope.row)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="nodeInfoVisible = false">取 消</el-button>
- <el-button type="primary" @click="nodeInfoSave()" :loading="nodeInfoSaveload">保 存</el-button>
- </span>
- </el-dialog>
- <!-- 设置参数名称 -->
- <el-dialog
- title="设置参数名称"
- :visible.sync="infoNameVisible"
- width="800px"
- append-to-body
- class="jiedian"
- :close-on-click-modal="false"
-
- >
- <div>
- <div class="flexEnd">
- <i
- class="el-icon-circle-plus marbottom10"
- @click="setParameterName()"
- style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
- ></i>
- </div>
- <el-table :data="namelists" border style="width: 100%" height="400">
- <el-table-column align="center" prop="name" label="参数名称">
- <template slot-scope="scope">
- <el-input v-model="scope.row.name"></el-input>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="key" label="参数值KEY">
- <template slot-scope="scope">
- <el-input v-model="scope.row.k"></el-input>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="describe" label="描述">
- <template slot-scope="scope">
- <el-input v-model="scope.row.remark"></el-input>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="120" align="center">
- <template slot-scope="scope">
- <el-button
- type="text"
- size="small"
- class="text-icon-danger"
- @click="delNodeInfo(scope.$index,scope.row)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="addParameterName()">保 存</el-button>
- <el-button @click="closeParameter()">关 闭</el-button>
- </span>
- </el-dialog>
- <el-dialog
- title="别名"
- :visible.sync="aliasVisible"
- width="600px"
- append-to-body
- :close-on-click-modal="false"
- >
- <div>
- <div class="flex">
- <el-input
- v-model="aliasInput"
- placeholder="请输入节点别名"
- ></el-input>
- <el-button class="mg-l-20" type="primary" @click="addAlias"
- >添加</el-button
- >
- </div>
- <div class="flex" style="flex-wrap: wrap">
- <div class="mg-t-10" v-for="(tag, index) in aliasArr" :key="index">
- <el-tag closable @close="delAlias(index)">
- {{ tag }}
- </el-tag>
- <span v-if="index != aliasArr.length - 1">、</span>
- </div>
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="aliasVisible = false">取 消</el-button>
- <el-button type="primary" @click="saveAliasHandle">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 节点公式 -->
- <el-dialog
-
- :title="(curEleTable.tableName?curEleTable.tableName:'')+' 元素公式2'"
- :visible.sync="formulaCompVisible"
- fullscreen
- append-to-body
- class="full-dialog"
- @close="closeformulaComp"
- >
- <FormulaEdit
- :fromcurNode="curTreeData"
- :projectid="projectid"
- :wbsid="id"
- :nodeid="curTreeData.id"
- :eleid="formulaCurRow.id"
- :globaltype="formulaCurRow.globaltype"
- :iswbstype="0"
- @hideDialog="formulaCompVisible = false"
- v-if="formulaCompVisible"
- ></FormulaEdit>
- </el-dialog>
- <!-- 全局公式 -->
- <el-dialog title="" :visible.sync="formulaCompVisible1" fullscreen append-to-body class="full-dialog" @close="closeformulaComp1">
- <FormulaEditone :wbsid="id" :nodeid="curTreeData.id" :eleid="formulaCurRow.id" :elementType="formulaCurRow.elementType" :projectid="projectid" :tableType="istableType"
- :globaltype="formulaCurRow.globaltype" @hideDialog="formulaCompVisible1 = false" :fromcurNode="curEleTable" :iswbstype="0"
- v-if="formulaCompVisible1">
- </FormulaEditone>
- </el-dialog>
- <!-- 编辑元素 -->
- <el-dialog
- title=" "
- :visible.sync="editElementVisible"
- fullscreen
- append-to-body
- class="full-dialog"
- >
- <EditElement
- :editElementQuery="curTreeData"
- :pkeyId="editElementQuery.pkeyId"
- :excelId="editElementQuery.excelId"
- :id="editElementQuery.id"
- :initTableName="editElementQuery.initTableName"
- :pid="editElementQuery.pid"
- :wbsid="editElementQuery.wbsid"
- :initTableId="editElementQuery.initTableId"
- :nodeid="editElementQuery.nodeid"
- @hideDialog="editElementVisible = false"
- @adjustExcel="adjustExcel"
- v-if="editElementVisible"
- ></EditElement>
- </el-dialog>
- <el-dialog
- title="节点参数设置-关联元素"
- :visible.sync="linkEleVisible"
- width="800px"
- append-to-body
- class="jiedian"
- :close-on-click-modal="false"
- >
- <div>
- <el-table
- :data="linkEleTableList"
- border
- style="width: 100%"
- height="400"
- >
- <el-table-column
- align="center"
- prop="tableName"
- label="元素表名"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="elementName"
- label="关联元素字段"
- >
- </el-table-column>
- <el-table-column
- label="操作"
- width="160"
- align="center"
- >
- <template slot-scope="scope">
- <el-button v-if="!scope.row.mappingId"
- type="text"
- size="small"
- class="text-icon-primary"
- @click="tolinkEle(scope.row)"
- >选择元素</el-button>
- <el-button v-if="!!scope.row.mappingId"
- type="text"
- size="small"
- class="text-icon-danger"
- @click="delLink(scope.row)"
- >删除关联</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <!-- <el-button @click="saveLinks">保 存</el-button> -->
- <el-button @click="linkEleVisible = false">关 闭</el-button>
- </span>
- </el-dialog>
- <el-dialog
- title="选择关联元素"
- :visible.sync="linkCheckVisible"
- width="600px"
- append-to-body
- class="jiedian"
- :close-on-click-modal="false"
- >
- <div>
- <div class="flex mg-b-20">
- <el-input v-model="linkEleKey" placeholder="请输入元素关键字搜索"></el-input>
- <el-link class="mg-l-20" :underline="false">
- <i class="el-icon-search" style="font-size:20px" @click="searchEle"></i>
- </el-link>
- </div>
- <el-table
- :data="linkEleList"
- border
- style="width: 100%"
- height="400"
- >
- <el-table-column
- align="center"
- prop="eName"
- label="元素名"
- >
- </el-table-column>
- <el-table-column
- label="操作"
- width="55">
- <template slot-scope="scope">
- <el-checkbox v-model="scope.row.checked" @change="value => linkEleCheck(value,scope.$index)"></el-checkbox>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button @click="saveLinkEle">保 存</el-button>
- <el-button @click="linkCheckVisible = false">关 闭</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import ManualSorting from "@/components/WbsTree/ManualSorting";
- import dynamicExcel from "./treeTemplate/dynamicExcel.vue";
- import FormulaEdit from "@/views/formula/edit.vue";
- import FormulaEditone from '@/views/formula/edit1.vue'
- import EditElement from "@/views/manager/projectinfo/editElement/editElement.vue";
- import {
- saveFormAndElement,
- selectFormElements,
- importWbsTree,
- findWbsTreePrivateSameLevel,
- wbsTreePrivateSort,
- parameters,
- saveOrUpdateBatch,
- keymap,
- updateBatchNodeTableInfo2,
- updateStatus,
- getParamElements,
- specifiedParamElements,
- delParamElements, selectPrivateFormElements,syncCurrentFormInProject,getQueryValueByType
- } from "@/api/manager/wbstree";
- import {
- saveElement,
- remove as removeElement,
- updateBatchElements,
- getTemplate,
- importWbsElement,
- } from "@/api/manager/wbsformelement";
- import {
- getLazytree,
- getDetail,
- update,
- findNodeTableByCondition as selectByNodeTable,
- removeTableByCondition as removeTableById,
- removePrivateTreeNode,
- wbsTreePrivateTableSort,
- privateSubmitFullName,
- syncNodeParam,
- syncProjecteVisa,
- syncNodeTable,
- syncNodeinfo,
- tabTypeLazyTree,
- syncContractTabSort
- } from "@/api/manager/wbsprivate";
- import { findProjectTree as getAlltree } from "@/api/manager/projectinfo";
- import { findProjectTreeTrial as getAlltreeTrial } from "@/api/manager/projectinfo";
- import {refrehPram} from "@/api/manager/wbstree"
- import {getTableElments} from "@/api/manager/wbstree";
- import { getList as getAttchFromOriginalName } from "@/api/resource/attach";
- import { getDictionary } from "@/api/system/dict";
- import { mapGetters } from "vuex";
- import {
- getList,
- tabLazytreeAll,
- saveLinkTab,
- getExcelHtml,
- } from "@/api/exctab/excelmodel";
- import { getStore, setStore } from "@/util/store";
- import { log } from '@antv/g2plot/lib/utils';
- export default {
- data() {
- var checkMajorDataType = (rule, value, callback) => {
- //console.log(this.nodeDetail.nodeType)
- //console.log(this.nodeDetail.majorDataType)
- if (this.nodeDetail.nodeType == 6) {
- if (!this.nodeDetail.majorDataType) {
- callback(new Error("工序节点必须选择内业资料类型"));
- }
- }
- callback();
- };
- return {
- fromcurNode:{},
- formDatass: [],
- editElementFormTag: false,
- editeditElementFormMFLoading:false,
- jiedianId: "",
- //#region
- sortTag: false,
- sortTag2: false,
- sureSortload:false,
- surePrivateSortload:false,
-
- sort:[],
- //#endregion
- //#region 关联清表
- loading: false,
- GLExcel: false,
- GLExcelFrom: {
- id: "",
- name: "",
- search: "", //搜素框舒服的值
- ids: "",
- excelId: "",
- initTableName: "",
- initTableId:""
- },
- GLExcelData: [], //
- GLExcelProps: {
- label: "name",
- children: "children",
- disabled: "hasChildren",
- isLeaf: function (data) {
- let tag = false;
- if (!data.hasChildren) {
- tag = true;
- }
- if (data.isExistForm == 1) {
- tag = true;
- }
- return tag;
- },
- },
- exceldata: [], //清表模板
- GLExcelLoading: false,
- //#endregion
- //#region 调整表单
- adjustmentExcel: "",
- excelHtml: false,
- //#endregion
- //#region
- id: "",
- projectid: "",
- filterText: "",
- treeData: [],
- searchType:'1',
- isSearch:false,
- searchTreeData:[],
- searchtreeLoad:false,
- treeLoad: false,
- menuShow: false,
- defaultProps: {
- children: "children",
- label: "title",
- isLeaf: function (data) {
- //console.log(data, !data.hasChildren, data.isExistForm);
- let tag = false;
- if (!data.hasChildren) {
- tag = true;
- }
- if (data.isExistForm == 1) {
- tag = true;
- }
- if (data.nodeType >= 6 && data.nodeType <= 13) {
- tag = true;
- }
- //中间交工。开工报告、质量评定)
- if (
- data.majorDataType == 1 ||
- data.majorDataType == 2 ||
- data.majorDataType == 3
- ) {
- tag = true;
- }
- return tag;
- // return !data.hasChildren || (data.isExistForm == 1);
- },
- },
- leftType: 5,
- curTreeData: {},
- curTreeNode: {},
- tableData: [],
- nodeDetail: {},
- formData: [],
- editType: 1,
- dialogVisible: false,
- saveNodeLoading: false,
- nodeTypelist: [],
- majorDataTypeList: [],
- rules: {
- nodeName: [
- { required: true, message: "请输入节点名称", trigger: "blur" },
- ],
- nodeType: [
- { required: true, message: "请选择节点类型", trigger: "change" },
- ],
- majorDataType: [{ validator: checkMajorDataType, trigger: "change" }],
- },
- eleVisible: false,
- tableTypelist: [],
- dataTypeList: [],
- ownerTypeList: [],
- eleForm: {
- elementList: [],
- },
- eleRules: {
- nodeName: [
- { required: true, message: "请输入表名称", trigger: "blur" },
- ],
- tableType: [
- { required: true, message: "请选择表类型", trigger: "change" },
- ],
- tableOwner: [
- { required: true, message: "请选择所属方", trigger: "change" },
- ],
- },
- importVisible: false,
- tempList: [],
- curEleTable: {},
- istableType:true,
- editEleVisible: false,
- editEleList: [],
- eleReg: /(≥|≤|±|【】)?([^≥≤±【】]*)/,
- editEleFormulaVisible: false,
- formulaInput: "",
- editEleListFilter: [],
- editEleListAll: [],
- importTemplateVisible: false,
- fileUrl: "",
- upFile: null,
- importLoading: false,
- nodeInfoVisible: false,
- nodeInfoTable: [],
- nodeInfoTableLoad:false,
- namelist: [],
- namelists: [],
- delids:[],
- infoNameVisible: false,
- excelSortTag: false,
- excelSortTag2: false,
- tableSortList: [],
- //#endregion
- defaultExpandedKeys: [],
- expandName: this.$route.fullPath,
- aliasVisible: false, //别名
- aliasInput: "",
- aliasArr: [],
- formulaCompVisible: false, //公式弹框
- formulaCompVisible1:false,
- formulaCurRow: {}, //当前元素
- editElementVisible: false, //编辑元素弹框
- editElementQuery: {
- pkeyId: "",
- excelId: "",
- id: "",
- initTableName: "",
- initTableId:"",
- pid: "",
- wbsid: "",
- nodeid: ""
- }, //传参
- syncBtnLoad: false,
- syncElectricLoad:false,
- showType: 1,
- typeTreeData: [],
- testTreeLoad: false,
- testTreeData: [],
- mixRatioTestIds: [],
- //节点参数,关联元素
- curParam:{},//当前节点参数
- linkEleVisible:false,
- linkEleTableList:[],//元素表数组
- curLinkEleTable:{},//当前元素表
- linkCheckVisible:false,//关联弹框
- linkEleList:[],//元素数组
- linkEleKey:'',//搜索关键字
- menusData:[
- // {icon: 'el-icon-s-promotion', label: '新增节点', key: "add"},
- {icon: 'el-icon-s-promotion', label: '编辑节点', key: "edit",content:'编辑节点'},
- {icon: 'el-icon-upload', label: '同步新增元素表单', key: "sync1",content:'同步新增元素表单'},
- {icon: 'el-icon-upload', label: '同步元素表单排序到合同段', key: "sync3",content:'同步元素表单排序到合同段'},
- {icon: 'el-icon-s-promotion', label: '同步节点基础信息及表单URL', key: "sync2",content:'同步节点的基础信息、类型名称、表单url等信息'},
- {icon: 'el-icon-sort', label: '调整排序', key: "sort",content:'调整排序'},
- {icon: 'el-icon-s-promotion', label: '删除节点', key: "del",content:'删除节点'},
-
- ],//树组件操作菜单
- menuvisible:false,
- menuleft:20,
- menutop:0,
- //同步菜单按钮
- menuoptions:[
- {
- value: 'jdSync',
- label: '节点参数同步',
- load:false,
- }, {
- value: 'dqSync',
- label: '电签同步',
- load:false,
- },
- {
- value: 'gsSync',
- label: '公式同步',
- load:false,
- },
- ],
- menuvalue: '',
- isshowSyncbtn:false,
- projectName:'',
- nodeInfoSaveload:false,
- handlesyncLoad:false//表单同步
-
- };
- },
- computed: {
- ...mapGetters(["userInfo"]),
- // dialogTitle: function () {
- // let text = "节点";
- // if (this.leftType == 1) {
- // text = "新增" + text;
- // } else if (this.leftType == 2) {
- // text = "编辑" + text;
- // }
- // return text;
- // },
- },
- created() {
- this.init();
- //console.log(this.userInfo)
- },
- methods: {
- //#region
- init() {
- //this.id = this.$route.query.wbsid;
- //this.projectid = this.$route.query.pid;
- const { wbsid, pid, type } = this.$route.query;
- this.id = wbsid;
- this.projectid = pid;
- this.wbsType = type ? Number(type) : 1;
- this.getNodeTypelist();
- this.getTableTypelist();
- this.getDataTypelist();
- this.getOwnerTypelist();
- this.defaultExpandedKeys = getStore({ name: this.expandName });
- this.projectName=this.$route.query.projectName
-
-
- },
- loadNode(node, resolve) {
- let pid = 0;
- if (node.level != 0) {
- pid = node.data.id;
- }
- const type = this.wbsType;
- getLazytree(this.id, pid, this.userInfo.tenant_id, this.projectid, {
- wbsType: type,
- }).then((res) => {
- let arr = [];
- if (Array.isArray(res.data.data)) {
- arr = res.data.data;
- }
- return resolve(arr);
- });
- },
- getNodeDetail(data, node) {
- console.log('getNodeDetail',data);
- let parentName = "";
- if (node.parent.data) {
- parentName = node.parent.data.title;
- }
- this.curTreeData = data;
- this.curTreeNode = node;
- this.curTreeData.parentName = parentName;
- getDetail(data.id, this.id, this.projectid).then((res) => {
- res.data.data.parentName = parentName;
- this.tableData = [res.data.data];
- this.nodeDetail = Object.assign({}, res.data.data);
- });
- this.updateNodeTable();
- this.nodeTypeChange(53)
- //获取节点展开路径
- this.getExpandedKeys(node);
- },
- saveNode() {
- const type = this.wbsType;
- this.$refs["nodeDetail"].validate((valid) => {
- if (valid) {
- const { mixRatioTestIds, nodeType } = this.nodeDetail;
- if (type === 2 && nodeType === 53) {
- if (mixRatioTestIds) {
- if (this.editType == 1) {
- this.addNode();
- } else if (this.editType == 2) {
- this.updateNode();
- }
- } else {
- this.$message({
- type: "error",
- message: "请先选择节点",
- });
- return false;
- }
- } else {
- if (this.editType == 1) {
- this.addNode();
- } else if (this.editType == 2) {
- this.updateNode();
- }
- }
- } else {
- console.log("error submit!!");
- return false;
- }
- });
- },
- addNode() {
- this.saveNodeLoading = true;
- update(this.nodeDetail).then(() => {
- this.updateTreeNewNode();
- this.dialogVisible = false;
- this.$message({
- type: "success",
- message: "新增成功!",
- });
- });
- },
- updateNode() {
- update(this.nodeDetail).then(() => {
- let node = this.tableData[0];
- node.nodeName = this.nodeDetail.nodeName;
- node.nodeType = this.nodeDetail.nodeType;
- this.curTreeData.title = this.nodeDetail.nodeName;
- this.dialogVisible = false;
- this.$message({
- type: "success",
- message: "修改成功!",
- });
- });
- },
- toSplit(val) {
- return val ? String(val).split(",") : "";
- },
- setLeftType(type, data, node) {
- this.jiedianId = data.id;
- if (type == 4 || type == 5) {
- this.leftType = type;
- }
- this.curTreeData = data;
- this.curTreeNode = node;
- this.$refs.tree.setCurrentKey(data.id);
- if (type == 1 || type == 2) {
- this.getMajorDataTypeList();
- this.dialogVisible = true;
- this.editType = type;
- }
- getDetail(data.id, this.id, this.projectid).then((res) => {
- let parentName = "";
- if (node.parent.data) {
- parentName = node.parent.data.title;
- }
- res.data.data.parentName = parentName;
- this.tableData = [res.data.data];
- if (type == 1) {
- this.nodeDetail = {
- parentId: res.data.data.id,
- parentName: parentName,
- projectId: res.data.data.projectId,
- };
- } else {
- this.nodeDetail = Object.assign({}, res.data.data);
-
- this.mixRatioTestIds = this.toSplit(res.data.data.mixRatioTestIds);
- }
- this.nodeDetail.type = 1; // '1'节点 '2'表单
- this.nodeDetail.wbsId = this.id;
- this.nodeDetail.tenantId = this.userInfo.tenant_id;
- });
- if (this.leftType == 4) {
- selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
- if (res.data.data.length) {
- this.formData = res.data.data;
- this.formData.forEach((ele)=>{
- ele.handlesyncLoad=false
- })
- } else {
- this.formData = [];
- }
- });
- }
- //获取节点展开路径
- this.getExpandedKeys(node);
- },
- showFormElement() {
- if (!this.nodeDetail.id) {
- this.$message({
- type: "warning",
- message: "请先选择在哪个节点下创建表",
- });
- return;
- }
- this.eleVisible = true;
- },
- addEleRow(list) {
- list.push({});
- },
- delEleRow(index, list) {
- list.splice(index, 1);
- },
- saveFormAndElementHandle() {
- this.$refs["eleDialog"].validate((valid) => {
- if (valid) {
- this.eleForm.wbsId = this.id;
- this.eleForm.tenantId = this.userInfo.tenant_id;
- this.eleForm.nodeType = -1;
- this.eleForm.type = 2; // '1'节点 '2'表单
- this.eleForm.parentId = this.nodeDetail.id;
- this.eleForm.elementList.forEach((element) => {
- element.eAllowDeviation =
- (element.allow ? element.allow : "") +
- (element.deviation ? element.deviation : "");
- if (element.eType == 4) {
- element.eLength = 0;
- }
- });
- saveFormAndElement(this.eleForm).then(() => {
- //console.log(res)
- this.updateTreeNewNode();
- this.updateNodeTable();
- this.eleVisible = false;
- this.$message({
- type: "success",
- message: "新增成功!",
- });
- });
- } else {
- console.log("error submit!!");
- return false;
- }
- });
- },
- updateTreeNewNode() {
- getLazytree(
- this.id,
- this.nodeDetail.parentId,
- this.userInfo.tenant_id,
- this.projectid
- ).then((res) => {
- this.$refs.tree.updateKeyChildren(
- this.nodeDetail.parentId,
- res.data.data
- );
- });
- },
- updateNodeTable() {
- selectByNodeTable(this.curTreeData.id, this.projectid, this.id).then(
- (res) => {
- if (res.data.data&&res.data.data.length) {
- this.formData = res.data.data;
- } else {
- this.formData = [];
- }
- }
- );
- },
- deleNode(data, node) {
- let pid=data.primaryKeyId?data.primaryKeyId:data.pKeyId
- this.$confirm(
- "此操作将删除节点【" + data.title + "】, 是否继续?",
- "提示",
- {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }
- )
- .then(() => {
- removePrivateTreeNode(pid).then(() => {
- this.$refs.tree.remove(node);
- this.$message({
- type: "success",
- message: "删除成功!",
- });
- });
- })
- .catch(() => {});
- },
- importHandle() {},
- handleEdit(index, row) {
- this.curEleTable = row;
- selectPrivateFormElements(this.curEleTable.initTableId).then((res) => {
- res.data.data.forEach((element) => {
- this.eleReg.exec(element.eAllowDeviation);
- element.allow = RegExp.$1 ? RegExp.$1 : "";
- element.deviation = RegExp.$2 ? RegExp.$2 : "";
- });
- this.editEleList = res.data.data;
- });
- this.editEleVisible = true;
- },
- handleDelete(index, row) {
- this.$confirm("是否删除 " + row.tableName + " ?", "删除元素表", {
- distinguishCancelAndClose: true,
- confirmButtonText: "删除",
- cancelButtonText: "取消",
- }).then(() => {
- removeTableById(row.id, this.projectid, this.id).then(() => {
- this.formData.splice(index, 1);
- this.$message({
- type: "success",
- message: "删除成功!",
- });
- });
- });
- },
- async hideMD(row) {
- //隐藏按钮
- const code = await this.updateStatus(row.pkeyId, row.status);
- if (code == 200) {
- if (row.status == 0) {
- row.status = 1;
- } else {
- row.status = 0;
- }
- }
- },
- async updateStatus(pKeyId, status) {
- //隐藏功能激活
- const { data: res } = await updateStatus({ pKeyId });
- if (res.code == 200) {
- this.$message({
- type: "success",
- message: status == 1 ? "隐藏成功" : "激活成功",
- });
- }
- return res.code;
- },
- handleEditFormula(index, row) {
- this.curEleTable = row;
- selectFormElements(this.curEleTable.pkeyId,{type:0}).then((res) => {
- this.editEleListFilter = res.data.data;
- this.editEleListAll = [].concat(this.editEleListFilter);
- });
- this.editEleFormulaVisible = true;
- },
- //表单同步
- handlesync(index, row){
- this.handlesyncLoad=true
- syncCurrentFormInProject({pKeyId:row.pkeyId}).then((res)=>{
- if(res.data.code==200){
- this.$message.success('操作成功');
- }
- }).finally(()=>{
- this.handlesyncLoad=false
- })
- },
- //搜索 筛选
- searchFormulaName() {
- this.editEleListFilter = this.editEleListAll.filter((ele) => {
- return ele.eName.indexOf(this.formulaInput) > -1;
- });
- },
- saveNewEle(row) {
- row.eAllowDeviation =
- (row.allow ? row.allow : "") + (row.deviation ? row.deviation : "");
- row.fId = this.curEleTable.initTableId;
- row.initTableName = this.curEleTable.initTableName;
- if (row.eType == 4) {
- row.eLength = 0;
- }
- saveElement(row).then((res) => {
- if (res.data.data) {
- this.$set(row, "id", res.data.data.id);
- this.$set(row, "ekey", res.data.data.ekey);
- this.$message({
- type: "success",
- message: "保存成功!",
- });
- }
- });
- },
- delEleRowHandle(index, list) {
- let row = list[index];
- if (row.id) {
- //有id需要请求删除
- this.$confirm("是否确认删除?", "删除元素", {
- distinguishCancelAndClose: true,
- confirmButtonText: "删除",
- cancelButtonText: "取消",
- }).then(() => {
- removeElement(row.id, this.curEleTable.initTableName, row.ekey).then(
- () => {
- list.splice(index, 1);
- }
- );
- });
- } else {
- list.splice(index, 1);
- }
- },
- saveEles() {
- for (let i = 0; i < this.editEleList.length; i++) {
- if (!this.editEleList[i].id) {
- this.$message({
- type: "warning",
- message: "请先将新增的元素点击保存",
- });
- return;
- }
- }
- if (this.editEleList.length > 0) {
- this.editEleList.forEach((element) => {
- element.eAllowDeviation =
- (element.allow ? element.allow : "") +
- (element.deviation ? element.deviation : "");
- if (element.eType == 4) {
- element.eLength = 0;
- }
- });
- updateBatchElements(
- this.editEleList,
- this.curEleTable.initTableName
- ).then(() => {
- this.editEleVisible = false;
- this.updateNodeTable();
- this.$message({
- type: "success",
- message: "保存成功!",
- });
- });
- } else {
- this.editEleVisible = false;
- this.updateNodeTable();
- this.$message({
- type: "success",
- message: "保存成功!",
- });
- }
- },
- nodeTypeChange(val) {
- console.log(333333333);
- if (val === 53) {
- // if (this.testTreeData.length > 0) {
- // return;
- // }
-
- this.testTreeLoad = true;
- // getAlltreeTrial(this.projectid, this.id, this.curTreeData.primaryKeyId).then((res) => {
- // this.testTreeLoad = false;
- // console.log(res.data.data,'data');
- // let trialdata=res.data.data
- // if(trialdata&&trialdata.allTree){
- // this.testTreeData = trialdata.allTree[0];
- // if(trialdata.allStatusIds.length>0){
- // //设置勾选相关联试验全选
- // this.mixRatioTestIds =trialdata.allStatusIds[0];
- // }
-
- // }
-
- // });
- let pid=this.curTreeData.primaryKeyId?this.curTreeData.primaryKeyId:this.curTreeData.pKeyId
-
- getAlltree(this.projectid, this.id, pid).then((res) => {
- this.testTreeLoad = false;
- console.log(res.data.data,'data');
- this.testTreeData=res.data.data
-
- });
- }
- },
- //根据逗号联合
- toJoin(arr) {
- return arr ? arr.join() : "";
- },
- TestTreeCheckChange(_, { checkedKeys, halfCheckedKeys }) {
- // const newarr = [...checkedKeys, ...halfCheckedKeys];
- const newarr = [...checkedKeys]
- this.nodeDetail.mixRatioTestIds = this.toJoin(newarr);
-
- },
- // filterChange() {
- // if (this.treeData.length > 0) {
- // this.$refs.treeall.filter(this.filterText);
- // return;
- // }
- // this.treeLoad = true;
- // getAlltree(this.projectid, this.id).then((res) => {
- // this.treeLoad = false;
- // this.treeData = res.data.data;
- // console.log(res.data.data,'res.data.data');
- // this.$nextTick(() => {
- // this.$refs.treeall.filter(this.filterText);
- // });
- // });
- // },
- //搜索树
- //搜索树
- searchTreeClick(){
- if(this.filterText.length>0){
- this.isSearch=true
- this.searchtreeLoad=true
- getQueryValueByType({
- queryValue:this.filterText,
- type:this.searchType,
- wbsId:this.id,
- projectId: this.projectid
-
- }).then((res)=>{
- let arr = [];
- if (Array.isArray(res.data.data)) {
- arr = res.data.data;
- this.searchTreeData=arr
- }else{
- this.searchTreeData=[]
- }
-
- })
- }else{
- this.isSearch=false
- }
-
- this.searchtreeLoad=false
- },
- clearSearch(){
- this.isSearch=false
- },
- importTemplate(data) {
- this.importTemplateVisible = true;
- this.curTreeData = data;
- if (!this.fileUrl) {
- getAttchFromOriginalName(1, 20, {
- originalName: "WBS划分模板.xls",
- }).then((res) => {
- if (res.data.data.records.length) {
- this.fileUrl = res.data.data.records[0].link;
- } else {
- this.fileUrl = "";
- }
- });
- }
- },
- importTemplateHandle() {
- if (!this.upFile) {
- this.$message({
- type: "warning",
- message: "请先选择文件再进行导入",
- });
- return;
- }
- let forms = new FormData();
- forms.append("excelFile", this.upFile);
- let wbsTreeFu = {
- wbsId: this.id,
- parentId: this.curTreeData.id,
- // ancestors:'0,'+this.curTreeData.id,
- };
- let json = JSON.stringify(wbsTreeFu);
- let blob = new Blob([json], { type: "application/json" });
- forms.append("wbsTreeFu", blob);
- this.importLoading = true;
- importWbsTree(forms)
- .then(() => {
- //this.$router.go(0)
- let node = this.$refs.tree.getNode(this.curTreeData.id);
- node.isLeaf = false;
- this.importTemplateVisible = false;
- this.upFile = null;
- })
- .finally(() => {
- this.importLoading = false;
- });
- },
- handleDownload() {
- if (this.fileUrl) {
- window.open(this.fileUrl);
- } else {
- this.$message({
- type: "warning",
- message: "请先在附件管理上传【WBS划分模板.xls】文件",
- });
- }
- },
- fileClick() {
- this.$refs.file.click();
- },
- fileChange(e) {
- const file = e.target.files[0];
- if (!file) {
- // 如果用户没有选择图片,只是点了文件上传这个按钮
- return;
- }
- //console.log(file)
- this.upFile = file;
- },
- editNodeInfo(index, row) {
- this.$set(row, "isEdit", true);
- },
- saveNodeInfoHandle(index, row) {
- row.isEdit = false;
- },
- downloadTmp() {
- getTemplate().then((res) => {
- //console.log(res)
- let blob = new Blob([res.data], {
- type: "application/vnd.ms-excel",
- });
- //console.log(blob)
- let filename = Date.parse(new Date()) + ".xls";
- if (window.navigator.msSaveOrOpenBlob) {
- // 兼容IE10
- window.navigator.msSaveBlob(blob, filename);
- } else {
- // 兼容chrome/firefox
- let aTag = document.createElement("a");
- aTag.download = Date.parse(new Date()) + ".xls";
- aTag.href = window.URL.createObjectURL(blob);
- aTag.click();
- URL.revokeObjectURL(aTag.href);
- }
- });
- },
- fileClick2() {
- this.$refs.file2.click();
- },
- tmpImport(e) {
- const file = e.target.files[0];
- const formData = new FormData();
- formData.append("file", file);
- //console.log(file.name)
- importWbsElement(formData)
- .then((res) => {
- res.data.data.forEach((element) => {
- element.eName = element.elementName;
- element.eLength = element.elementLength;
- element.eType = Number(element.elementType);
- element.eAllowDeviation = element.elementAllowDeviation;
- element.eInspectionMethod = element.elementInspectionMethod;
- this.eleReg.exec(element.eAllowDeviation);
- // console.log(RegExp.$1)
- // console.log(RegExp.$2)
- element.allow = RegExp.$1 ? RegExp.$1 : "";
- element.deviation = RegExp.$2 ? RegExp.$2 : "";
- });
- this.eleForm.elementList = res.data.data;
- this.importVisible = false;
- })
- .finally(() => {
- e.target.value = "";
- });
- },
- visiblechange(value, data) {
- this.$set(data, "moreShow", value);
- },
- bianhua2() {
- this.excelSortTag2 = false;
- this.$nextTick(() => {
- this.excelSortTag2 = true;
- });
- },
- //私有树的元素表修改排序
- privateTableSort() {
- if (!this.curTreeData.id) {
- this.$message({
- type: "warning",
- message: "请先选择需要排序的节点",
- });
- return;
- }
- this.tableSortList = this.formData.map((form, index) => {
- return {
- sort: index + 1,
- nodeName: form.tableName,
- pkeyId: form.pkeyId,
- };
- });
- this.excelSortTag = true;
- this.excelSortTag2 = true;
- },
- editPrivateSort() {
- this.surePrivateSortload=true
- wbsTreePrivateTableSort(this.tableSortList).then(() => {
- this.$message({
- type: "success",
- message: "排序成功!",
- });
- this.updateNodeTable();
- this.surePrivateSortload=false
- this.excelSortTag = false;
- this.excelSortTag2 = false;
- });
- },
- //解析元素数据类型
- eTypeFormatter(row) {
- let text = "";
- for (let i = 0; i < this.dataTypeList.length; i++) {
- if (this.dataTypeList[i].dictKey == row.eType) {
- text = this.dataTypeList[i].dictValue;
- break;
- }
- }
- return text;
- },
- //跳转到公式配置页面
- toFormulaEdit(row,type) {
- // this.$router.push({
- // path: '/formula/edit',
- // query: {
- // wbsid: this.id,
- // eleid: row.id,
- // nodeid:this.curTreeData.id,
- // projectid:this.projectid
- // }
- // });
- this.formulaCurRow = row;
- this.formulaCurRow.globaltype = type;
- if(type===10){
- this.formulaCompVisible1 = true;
- this.formulaCurRow.elementType = false;
- this.istableType=true;
- }else{
- this.formulaCompVisible = true;
-
- }
-
- },
- //关闭公式弹窗
- closeformulaComp(){
- console.log('关闭');
- selectFormElements( this.curEleTable.pkeyId,{type:0}).then((res) => {
- this.editEleListFilter = res.data.data;
- this.editEleListAll = [].concat(this.editEleListFilter);
- })
- },
- //关闭公式弹窗
- closeformulaComp1(){
- console.log('关闭');
- selectFormElements( this.curEleTable.pkeyId,{type:0}).then((res) => {
- this.editEleListFilter = res.data.data;
- this.editEleListAll = [].concat(this.editEleListFilter);
- })
- },
- getNodeTypelist() {
- const type = this.wbsType;
- if (this.nodeTypelist.length > 1) {
- return;
- }
- let code=''
- if(type===5){
- code='lar_node_type'//征拆
- }else if(type===2){
- code='trial_node_type'//试验
- }else{
- code='wbs_node_type'//质检
- }
- getDictionary({
- code
- // code: type === 2 ? "trial_node_type" : "wbs_node_type",
-
- }).then((res) => {
- res.data.data.forEach((element) => {
- element.dictKey = Number(element.dictKey);
- });
- this.nodeTypelist = res.data.data;
- });
- },
- getMajorDataTypeList() {
- if (this.majorDataTypeList.length > 1) {
- return;
- }
- getDictionary({
- code: "major_data_type",
- }).then((res) => {
- res.data.data.forEach((element) => {
- element.dictKey = Number(element.dictKey);
- });
- this.majorDataTypeList = res.data.data;
- });
- },
- getTableTypelist() {
- const type = this.wbsType
- if (this.tableTypelist.length > 1) {
- return;
- }
- let code=''
- if(type===5){
- code='table_type'//征拆
- }else if(type===2){
- code='trial_table_type'//试验
- }else{
- code='table_type'//质检
- }
- getDictionary({
- // code: "table_type",
- // code: type === 2 ? "trial_table_type" : "table_type",
- code
- }).then((res) => {
- res.data.data.forEach((element) => {
- element.dictKey = Number(element.dictKey);
- });
- this.tableTypelist = res.data.data;
- });
- },
- getDataTypelist() {
- if (this.dataTypeList.length > 1) {
- return;
- }
- getDictionary({
- code: "data_type",
- }).then((res) => {
- res.data.data.forEach((element) => {
- element.dictKey = Number(element.dictKey);
- });
- this.dataTypeList = res.data.data;
- });
- },
- getOwnerTypelist() {
- if (this.ownerTypeList.length > 1) {
- return;
- }
- getDictionary({
- code: "owner_type",
- }).then((res) => {
- res.data.data.forEach((element) => {
- element.dictKey = Number(element.dictKey);
- });
- this.ownerTypeList = res.data.data;
- });
- },
- formatCat(row, column, cellValue) {
- for (let i = 0; i < this.nodeTypelist.length; i++) {
- if (this.nodeTypelist[i].dictKey == cellValue) {
- return this.nodeTypelist[i].dictValue;
- }
- }
- return cellValue;
- //console.log(cellValue)
- },
- formatTableType(row, column, cellValue) {
- for (let i = 0; i < this.tableTypelist.length; i++) {
- if (this.tableTypelist[i].dictKey == cellValue) {
- return this.tableTypelist[i].dictValue;
- }
- }
- return cellValue;
- //console.log(cellValue)
- },
- formatOwner(row, column, cellValue) {
- for (let i = 0; i < this.ownerTypeList.length; i++) {
- if (this.ownerTypeList[i].dictKey == cellValue) {
- return this.ownerTypeList[i].dictValue;
- }
- }
- return cellValue;
- //console.log(cellValue)
- },
- formatdataType(row, column, cellValue) {
- for (let i = 0; i < this.dataTypeList.length; i++) {
- if (this.dataTypeList[i].dictKey == cellValue) {
- return this.dataTypeList[i].dictValue;
- }
- }
- return cellValue;
- },
- // filterNode(value, data) {
- // if (!value) return true;
- // return data.title.indexOf(value) !== -1;
- // },
- getReturnNode(node,_array,value){
- let isPass = node.data && node.data.title && node.data.title.indexOf(value) !== -1;
- isPass?_array.push(isPass):'';
- if(!isPass && node.level!=1 && node.parent){
- this.getReturnNode(node.parent,_array,value);
- }
- },
- filterNode(value,data,node) {
- if(!value){
- return true;
- }
- let level = node.level;
- let _array = [];//这里使用数组存储 只是为了存储值。
- this.getReturnNode(node,_array,value);
- let result = false;
- _array.forEach((item)=>{
- result = result || item;
- });
- return result;
- },
- //#endregion
- //#region wbs私有树排序
- async sortpai(data) {
- console.log(data);
- await this.findWbsTreePrivateSameLevel({
- parentId: data.parentId,
- projectId: this.projectid,
- wbsId: this.id,
- });
- this.sortTag = true;
- this.sortTag2 = true;
- },
- editSort() {
- this.wbsTreePrivateSort();
- },
- bianhua() {
- this.sortTag2 = false;
- this.$nextTick(() => {
- this.sortTag2 = true;
- });
- },
- async wbsTreePrivateSort() {
- this.sureSortload=true
- //wbs私有树节点手动排序
- const { data: res } = await wbsTreePrivateSort(this.sort);
- console.log(res);
- if (res.code == 200) {
- this.sortTag = false;
- this.sortTag2 = false;
- this.$message({
- type: "success",
- message: "排序成功!",
- });
- this.sureSortload=false
- this.getLazytreessss();
- }
- },
- async findWbsTreePrivateSameLevel(da) {
- //wbs私有树同级节点接口
- const { data: res } = await findWbsTreePrivateSameLevel(da);
- if (res.code == 200) {
- this.sort = res.data;
- }
- },
- async getLazytreessss() {
- const type=this.wbsType
- const { data: res } = await getLazytree(
- this.id,
- 0,
- this.userInfo.tenant_id,
- this.projectid,
- { wbsType: type,}
-
-
- );
- console.log(res);
- if (res.code == 200) {
- this.treeData = res.data;
- }
- },
- //#endregion
- //#region 关联清表
- async getList(da) {
- //获取清表模板信息
- const { data: res } = await getList(da);
- console.log(res);
- if (res.code === 200 && res.msg === "操作成功") {
- this.GLExcelData = res.data.records;
- }
- },
- async tabLazytreeAll() {
- //清表树信息
- this.GLExcelLoading = true;
- const { data: res } = await tabLazytreeAll({
- modeId: this.GLExcelFrom.name,
- name: this.GLExcelFrom.search,
- });
- this.GLExcelLoading = false;
- console.log(res);
- if (res.code === 200 && res.msg === "操作成功") {
- this.exceldata = res.data;
- }
- },
- Associationlist(scope) {
- //关联清表点击事件
- console.log(scope.row);
- this.GLExcel = true;
- this.getList({
- current: 1,
- size: 100000,
- parentId: 0,
- });
- this.GLExcelFrom.name = scope.row.modeId;
- setTimeout(() => {
- this.$refs.tree.setCheckedKeys([scope.row.excelId]);
- }, 2000);
- this.GLExcelFrom.initTableId = scope.row.initTableId;
- this.GLExcelFrom.id = scope.row.pkeyId;
- this.GLExcelFrom.excelId = scope.row.excelId;
- this.GLExcelFrom.ids = scope.row.id;
- this.GLExcelFrom.initTableName = scope.row.initTableName;
- console.log(this.GLExcelFrom,'this.GLExcelFrom');
- },
- changetherr() {
- //清表类型选择框change事件
- if (this.GLExcelFrom.name != "") {
- this.GLExcelFrom.search = "";
- this.tabLazytreeAll();
- }
- },
- GLExcelMD() {
- //弹框关闭事件
- this.GLExcelFrom.name = "";
- this.GLExcelFrom.search = "";
- this.GLExcelFrom.id = "";
- this.exceldata = [];
- this.$refs.tree.setCheckedKeys([]);
- this.GLExcel = false;
- },
- checkchange(data) {
- //节点选中回调
- if (this.$refs.tree.getCheckedNodes().length === 0) {
- this.$refs.tree.setCheckedKeys([]);
- } else if (this.$refs.tree.getCheckedNodes().length >= 1) {
- this.$refs.tree.setCheckedKeys([data.id]);
- }
- },
- async saveLinkTab() {
- //保存按钮
- let checkNodes = this.$refs.tree.getCheckedNodes();
- if (checkNodes.length > 0) {
- let node = checkNodes[checkNodes.length - 1];
- if (node.fileType != 3) {
- this.$message({
- type: "warning",
- message: "请先上传Excel表",
- });
- return;
- }
- const { data: res } = await saveLinkTab({
- exceTabId: node.id,
- tabId: this.GLExcelFrom.id,
- });
- console.log(res);
- if (res.code === 200) {
- this.$message({
- type: "success",
- message: "关联清表成功",
- });
- // selectByNodeTable刷新表单列表
- this.updateNodeTable();
- this.GLExcel = false;
- console.log(this.GLExcelFrom,'GLExcelFrom');
- this.rightClick(
- this.GLExcelFrom.id,
- this.GLExcelFrom.excelId,
- this.GLExcelFrom.ids,
- this.GLExcelFrom.initTableName,
- this.GLExcelFrom.initTableId
- );
- }
- } else {
- this.$message({
- type: "warning",
- message: "请先设置清表",
- });
- }
- },
- getReturnNode2(node,_array,value){
- let isPass = node.data && node.data.name && node.data.name.indexOf(value) !== -1;
- isPass?_array.push(isPass):'';
- if(!isPass && node.level!=1 && node.parent){
- this.getReturnNode2(node.parent,_array,value);
- }
- },
- filterNode222(value,data,node) {
- if(!value){
- return true;
- }
- let level = node.level;
- let _array = [];//这里使用数组存储 只是为了存储值。
- this.getReturnNode2(node,_array,value);
- let result = false;
- _array.forEach((item)=>{
- result = result || item;
- });
- return result;
- },
- //#endregion
- //#region 节点参数
- nodeInfo(data) {
- //节点参数按钮
- this.keymap();
- //console.log(data)
- let pid=data.primaryKeyId?data.primaryKeyId:data.pKeyId
- this.jiedianId = pid;
- this.parameters(pid);
- this.nodeInfoVisible = true;
- },
- closenodeInfoVisible(){
- this.nodeInfoTable=[]
- this.nodeInfoVisible = false;
- },
- addNodeInfoTable() {
- //添加节点参数数据
- this.nodeInfoTable.unshift({
- k: "",
- v: "",
- remark: "",
- nodeId: this.jiedianId,
- type: 1,
- });
- console.log(this.nodeInfoTable)
- },
- refreshnfoTable(){
- //刷新表格
- let prams={
- nodeId: this.jiedianId,
- type: 1,
- projectId: this.projectid
- }
- this.nodeInfoTableLoad=true
- refrehPram(prams).then((res)=>{
- this.nodeInfoTableLoad=false;
- if(res.data.code==200){
- this.$message.success('刷新成功');
- }
- })
- },
- delNodeInfo(key,obj) {
- this.delids.push(obj.id)
- //设置参数名称中的删除按钮
- this.namelists.splice(key, 1);
- },
- delNodeInfoss(key,obj) {
- this.delids.push(obj.id)
- //节点参数
- this.nodeInfoTable.splice(key, 1);
- },
- setNodeParameters() {
- //打开设置节点参数弹框按钮
- this.infoNameVisible = true;
- this.namelists = [...this.namelist];
- },
- async setParameterName() {
- //设置参数名称中添加节点参数按钮
- // wbsId: this.jiedianId
- this.namelists.unshift({ name: "", remark: "", k: "", type: 0 ,nodeId:this.jiedianId});
- },
- async nodeInfoSave() {
- //节点参数弹框保存按钮
- if (this.nodeInfoTable) {
- // if (this.nodeInfoTable.length == 0) {
- // await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,type:1,delIds:this.delids,wps:[
- // {
- // nodeId: this.jiedianId,
- // type: -1,
- // },
- // ]});
- // this.nodeInfoVisible = false;
- // this.delIds=[];
- // this.$message({
- // type: "success",
- // message: "保存参数节点成功!",
- // });
- // return;
- // }
- console.log(this.namelist)
- let tag = true;
- this.nodeInfoTable.forEach((val) => {
- if (!val.k | !val.v) {
- return (tag = false);
- }
- if (!val.name) {
- for (let i = 0; i < this.namelist.length; i++) {
- if (this.namelist[i].k == val.k) {
- val.name = this.namelist[i].name;
- return;
- }
- }
- }
- });
- if (tag) {
- this.nodeInfoSaveload=true
- await this.saveOrUpdateBatch({scopeType:10,projectId:this.projectid,nodeId:this.jiedianId,wps:this.nodeInfoTable,type:1,delIds:this.delids});
- this.delIds=[];
- this.$message({
- type: "success",
- message: "设置参数节点成功!",
- });
- this.nodeInfoSaveload=false
- this.parameters(this.jiedianId)
- // this.nodeInfoVisible = false;
- } else {
- this.$message({
- type: "error",
- message: "请填写所有的参数名称和参数值!",
- });
- }
- } else {
- this.$message({
- type: "error",
- message: "请先设置参数节点!",
- });
- }
- },
- async addParameterName() {
- //设置参数名称中的保存按钮
- if (this.namelists.length) {
- let tag = true;
- this.namelists.forEach((val) => {
- if (!val.name || !val.k) {
- return (tag = false);
- }
- });
- if (tag) {
- await this.saveOrUpdateBatch({scopeType:10,projectId:this.projectid,nodeId:this.jiedianId,wps:this.namelists,type:0,delIds:this.delids}); //保存设置参数
- this.infoNameVisible = false;
- this.delIds=[];
- this.keymap();
- } else {
- this.$message({
- type: "error",
- message: "请填写所有的参数名称和参数值KEY!",
- });
- }
- } else {
- this.$message({
- type: "warning",
- message: "请先添加参数",
- });
- }
- },
- closeParameter() {
- //设置参数名称,关闭按钮
- this.namelists = [];
- this.infoNameVisible = false;
- },
- async parameters(wbsId) {
- //获取接待你参数列表
- const { data: res } = await parameters({ wbsId });
- console.log(res);
- if (res.code == 200) {
- if( Array.isArray(res.data)){
- this.nodeInfoTable = res.data
- }
- }
- },
- async saveOrUpdateBatch(da) {
- //保存
- const { data: res } = await saveOrUpdateBatch(da);
- this.delids=[];
- console.log(res);
- },
- async keymap() {
- //节点参数枚举
- const { data: res } = await keymap();
- console.log(res);
- if (res.code == 200) {
- this.namelist = res.data;
- }
- },
- //#endregion
- //#region 调整表单
- adjustExcel(pkeyId, excelId) {
- //调整表单
- this.GLExcelFrom.id = pkeyId;
- this.getExcelHtml(pkeyId);
- },
- async getExcelHtml(pkeyId) {
- const { data: res } = await getExcelHtml({ pkeyId });
- console.log(res);
- if (res.code === 200) {
- localStorage.setItem("excelHtml", res.data);
- this.adjustmentExcel = res.data;
- this.excelHtml = true;
- }
- },
- removeExcel() {
- this.excelHtml = false;
- },
- //#endregion
- //#region 编辑元素
- async rightClick(pkeyId, excelId, id, initTableName,initTableId) {
- await this.getExcelHtml2(pkeyId);
- this.editElementQuery.pkeyId = pkeyId;
- this.editElementQuery.excelId = excelId;
- this.editElementQuery.id = id;
- this.editElementQuery.initTableName = initTableName;
- this.editElementQuery.initTableId = initTableId;
- this.editElementQuery.pid = this.$route.query.pid;
- this.editElementQuery.wbsid = this.$route.query.wbsid;
- this.editElementQuery.nodeid = this.curTreeData.id;
- this.editElementVisible = true;
- },
- async getExcelHtml2(pkeyId) {
- const { data: res } = await getExcelHtml({ pkeyId });
- console.log(res);
- if (res.code === 200) {
- localStorage.setItem("editElement", res.data);
- }
- },
- //#endregion
- //#region 元素表单信息
- editEditElementForm() {
- //标记元素
- if (this.formData.length) {
- let da = [];
- this.formDatass = [...this.formData];
- this.formDatass.forEach((val) => {
- da.push({
- tableType: val.tableType - 0,
- tableOwner: val.tableOwner - 0,
- pkeyId: val.pkeyId,
- tableName: val.tableName,
- fillRate: val.fillRate,
- });
- });
- this.formDatass = da;
- this.editElementFormTag = true;
- }
- },
- editeditElementFormMF() {
- //保存按钮
- let da = [];
- let tag = true;
- this.formDatass.forEach((val) => {
- if (!val.tableName || !val.tableType || !val.tableOwner) {
- tag = false;
- return;
- } else {
- da.push({
- pkeyId: val.pkeyId,
- nodeName: val.tableName,
- tableType: val.tableType,
- tableOwner: val.tableOwner,
- fillRate: val.fillRate,
- });
- }
- });
- if (tag) {
-
- this.updateBatchNodeTableInfo2(da);
- } else {
- this.$message({
- type: "success",
- message: "请填写完整元素表单的所有信息!",
- });
- }
- },
- async updateBatchNodeTableInfo2(da) {
- this.editeditElementFormMFLoading=true
- //共有编辑元素
- const { data: res } = await updateBatchNodeTableInfo2(da);
- if (res.code == 200) {
- this.editElementFormTag = false;
- this.updateNodeTable();
- this.editeditElementFormMFLoading=false
- }
- this.editeditElementFormMFLoading=false
- },
- //#endregion
- //获取节点展开路径
- getExpandedKeys(node) {
- //console.log(node)
- let expandedKeys = [];
- while (node.parent) {
- expandedKeys.push(node.data.id);
- node = node.parent;
- }
- setStore({
- name: this.expandName,
- content: expandedKeys,
- type: true, //sessionStorage
- });
- //console.log(expandedKeys)
- },
- //触发节点参数
- nodeInfoHandle() {
- if (!this.curTreeData.id) {
- this.$message({
- type: "warning",
- message: "请先选择节点",
- });
- return;
- }
- this.nodeInfo(this.curTreeData);
- },
- eleFormulaHandle() {
- if (!this.curTreeData.id || !this.curTreeNode.id) {
- this.$message({
- type: "warning",
- message: "请先选择节点",
- });
- return;
- }
- this.setLeftType(4, this.curTreeData, this.curTreeNode);
- // this.showType = 2;
- },
- editNodeHandle() {
- if (!this.curTreeData.id || !this.curTreeNode.id) {
- this.$message({
- type: "warning",
- message: "请先选择节点",
- });
- return;
- }
- this.mixRatioTestIds = [];
- this.nodeTypeChange(53);
- this.dialogTitle='编辑节点'
- this.setLeftType(2, this.curTreeData, this.curTreeNode);
-
- },
- addNodeHandle() {
- if (!this.curTreeData.id || !this.curTreeNode.id) {
- this.$message({
- type: "warning",
- message: "请先选择节点",
- });
- return;
- }
- this.mixRatioTestIds = [];
- this.nodeTypeChange(53);
- this.dialogTitle='新增节点'
- this.setLeftType(1, this.curTreeData, this.curTreeNode);
-
-
- },
- copyNodeHandle() {
- if (!this.curTreeData.id || !this.curTreeNode.id) {
- this.$message({
- type: "warning",
- message: "请先选择节点",
- });
- return;
- }
- },
- delNodeHandle() {
- if (!this.curTreeData.id || !this.curTreeNode.id) {
- this.$message({
- type: "warning",
- message: "请先选择节点",
- });
- return;
- }
- if (this.curTreeNode.level == 1) {
- this.$message({
- type: "warning",
- message: "当前节点无法删除",
- });
- return;
- }
- this.deleNode(this.curTreeData, this.curTreeNode);
- },
- eleHandle() {
- if (!this.curTreeData.id || !this.curTreeNode.id) {
- this.$message({
- type: "warning",
- message: "请先选择节点",
- });
- return;
- }
- this.setLeftType(5, this.curTreeData, this.curTreeNode);
- },
- syncInfoHandle(item) {
- if(this.curTreeData.primaryKeyId||this.curTreeData.pKeyId){
- this.$confirm("是否同步节点参数?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- this.syncBtnLoad = true;
- this.menuoptions.forEach((ele)=>{
- if(item.value==ele.value){
- ele.load=true
- }
- })
- let pid=this.curTreeData.primaryKeyId?this.curTreeData.primaryKeyId:this.curTreeData.pKeyId
- syncNodeParam(this.projectid,pid)
- .then(() => {
- this.$message({
- type: "success",
- message: "同步成功!",
- });
- })
- .finally(() => {
- this.syncBtnLoad = false;
- this.menuoptions.forEach((ele)=>{
- if(item.value==ele.value){
- ele.load=false
- }
- })
- });
- });
- }else{
- this.$message.warning('请先选择左侧节点')
- }
-
- },
- //显示别名弹窗
- aliasShow() {
- this.aliasVisible = true;
- if (this.nodeDetail.fullName) {
- this.aliasArr = this.nodeDetail.fullName.split(",");
- } else {
- this.aliasArr = [];
- }
- this.aliasInput = "";
- },
- addAlias() {
- if (this.aliasInput) {
- this.aliasArr.push(this.aliasInput);
- this.aliasInput = "";
- }
- },
- delAlias(index) {
- this.aliasArr.splice(index, 1);
- },
- saveAliasHandle() {
- this.nodeDetail.fullName = this.aliasArr.join(",");
- if (this.editType == 1) {
- //新增
- this.aliasVisible = false;
- } else if (this.editType == 2) {
- //编辑 私有
- privateSubmitFullName(
- this.nodeDetail.pKeyId,
- this.nodeDetail.fullName
- ).then(() => {
- this.$message({
- type: "success",
- message: "保存成功",
- });
- this.aliasVisible = false;
- });
- }
- },
- syncNodeTableHandle(data) {
- this.$confirm("是否同步节点【" + data.title + "】?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- let notify = this.$notify({
- title: "提示",
- message: "节点数据同步中...",
- duration: 0,
- });
- let pid=data.primaryKeyId?data.primaryKeyId:data.pKeyId
- syncNodeTable(pid)
- .then(() => {
- this.updateNodeTable();
- this.$message({
- type: "success",
- message: "同步成功",
- });
- })
- .catch(() => {
- this.$message({
- type: "error",
- message: "同步失败",
- });
- })
- .finally(() => {
- notify.close();
- });
- });
- },
- syncProjectHandle (data) {
- this.$confirm("是否同步节点【" + data.title + "】到合同段?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- let notify = this.$notify({
- title: "提示",
- message: "节点数据同步中...",
- duration: 0,
- });
- let pid=data.primaryKeyId?data.primaryKeyId:data.pKeyId
- syncNodeinfo(pid)
- .then(() => {
- this.updateNodeTable();
- this.$message({
- type: "success",
- message: "同步成功",
- });
- })
- .catch(() => {
- this.$message({
- type: "error",
- message: "同步失败",
- });
- })
- .finally(() => {
- notify.close();
- });
- });
- },
- //同步元素表单排序到合同段
- syncSortHandle (data) {
- this.$confirm("同步元素表单排序到合同段", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- let notify = this.$notify({
- title: "提示",
- message: "节点数据同步中...",
- duration: 0,
- });
- syncContractTabSort(this.projectid)
- .then(() => {
- this.updateNodeTable();
- this.$message({
- type: "success",
- message: "同步成功",
- });
- })
- .catch(() => {
- this.$message({
- type: "error",
- message: "同步失败",
- });
- })
- .finally(() => {
- notify.close();
- });
- });
- },
- typeTreeLoadNode(node, resolve) {
- let pid = 0;
- if (node.level != 0) {
- pid = node.data.id;
- }
- tabTypeLazyTree(pid, this.projectid).then((res) => {
- let arr = [];
- if (Array.isArray(res.data.data)) {
- arr = res.data.data;
- }
- return resolve(arr);
- });
- },
- getTypeTreeDetail() {},
- independent(){
- this.$router.push({
- path: '/project/independent',
- query: { pid: this.projectid,wbsid:this.$route.query.wbsid }
- });
- },
- archiveTimeClick(){
- this.$router.push({
- path: '/project/archiveTime',
- query: { pid: this.projectid,wbsid:this.$route.query.wbsid }
- });
- },
- syncElectric(item){
- if(this.curTreeData.primaryKeyId||this.curTreeData.pKeyId){
- console.log('同步电签默认信息');
- this.$confirm("是否同步电签默认信息?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- this.syncElectricLoad = true;
- this.menuoptions.forEach((ele)=>{
- if(item.value==ele.value){
- ele.load=true
- }
- })
- let pid=this.curTreeData.primaryKeyId?this.curTreeData.primaryKeyId:this.curTreeData.pKeyId
- syncProjecteVisa(this.projectid,pid)
- .then(() => {
- this.$message({
- type: "success",
- message: "同步成功!",
- });
- })
- .finally(() => {
- this.syncElectricLoad = false;
- this.menuoptions.forEach((ele)=>{
- if(item.value==ele.value){
- ele.load=false
- }
- })
- });
- });
- }else{
- this.$message.warning('请先选择左侧节点')
- }
-
- },
- //节点参数 关联元素
- linkEle(row){
- console.log(row,'row');
- if(!row.id){
- this.$message.warning('请先保存数据,再点击关联元素')
- }else{
- this.linkEleVisible = true;
- this.curParam = row;
- getParamElements({nodeId:this.curTreeData.id,projectId:this.projectid,paramId:row.id,scopeType:10}).then((res) => {
- if (res.data.data.length) {
- this.linkEleTableList = res.data.data;
- } else {
- this.linkEleTableList = [];
- }
- })
- }
-
- },
- //关联元素弹框
- tolinkEle(row){
- this.curLinkEleTable = row;
- this.linkCheckVisible = true;
- let pid=this.curTreeData.primaryKeyId?this.curTreeData.primaryKeyId:this.curTreeData.pKeyId
- selectFormElements(row.id,{type:3,nodeId:pid}).then((res) => {
- res.data.data.forEach((ele)=>{
- ele.checked = false;
- ele.show = true;
- })
- this.linkEleList = res.data.data;
- this.linkEleListAll = [].concat(this.linkEleList);
- })
- },
- //删除关联
- delLink(data){
- this.$confirm('删除关联, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- console.log(data)
- delParamElements(data).then(() => {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- getParamElements({nodeId:this.curTreeData.id,projectId:this.projectid,paramId:this.curParam.id,scopeType:10}).then((res) => {
- if (res.data.data.length) {
- this.linkEleTableList = res.data.data;
- } else {
- this.linkEleTableList = [];
- } })
- })
- }).catch(() => {
- });
- },
- //筛选元素
- searchEle(){
- this.linkEleList = this.linkEleListAll.filter((ele)=>{
- return ele.eName.indexOf(this.linkEleKey) > -1;
- })
- },
- linkEleCheck(value,index){
- //console.log(value)
- if(value){
- this.linkEleList.forEach((ele,i)=>{
- if(i != index){
- ele.checked = false;
- }
- })
- }
- },
- //关联元素
- saveLinkEle(){
- let target={}
- this.linkEleList.forEach(e=>{
- if(e.checked==true){
- target={elementId:e.id,paramId:this.curParam.id};
- }
- })
- if(JSON.stringify(target) !== '{}'){
- specifiedParamElements(target).then(data=>{
- this.linkCheckVisible = false;
- getParamElements({nodeId:this.curTreeData.id,projectId:this.projectid,paramId:this.curParam.id,scopeType:10}).then((res) => {
- if (res.data.data.length) {
- this.linkEleTableList = res.data.data;
- } else {
- this.linkEleTableList = [];
- }})
- })
- }else{
- this.$message.warning('请先选择关联元素')
- }
-
- },
- //树形控件菜单相关方法
- mouseout(){
- this.menuvisible=false
- },
- //展示菜单
- showMenu(e,data,node){
- e.preventDefault();
- console.log(e,'e');
- var x = e.pageX; //这个应该是相对于整个浏览器页面的x坐标,左上角为坐标原点(0,0)
- var y = e.pageY; //这个应该是相对于整个浏览器页面的y坐标,左上角为坐标原点(0,0)
- this.menutop = y;
- this.menuleft = x;
- this.menuvisible=true
- },
- menuClick(e,item,data){
- e.preventDefault();
- if(item.key==='sort'){
- this.sortpai(data)
- }else if(item.key==='sync1'){
- this.syncNodeTableHandle(data)
- }else if(item.key==='sync2'){
- this.syncProjectHandle(data)
- }//
- else if(item.key==='sync3'){
- this.syncSortHandle(data)
- }
- else if(item.key==='add'){
- this.addNodeHandle()
- }
- else if(item.key==='edit'){
- this.editNodeHandle()
- }
- else if(item.key==='del'){
- this.delNodeHandle()
- }else if(item.value==='jdSync'){
- this.syncInfoHandle(item)
- }else if(item.value==='gsSync'){
- this.$message({
- type: "info",
- message: "暂无相关接口!"
- });
- }else if(item.value==='dqSync'){
- this.syncElectric(item)
- }
- },
- //展示数据同步下拉框
- showSyncbtn(){
- this.isshowSyncbtn=!this.isshowSyncbtn
- }
- },
- watch: {
- "GLExcelFrom.search"(val) {
- console.log(val);
- if (this.exceldata) {
- this.$refs.tree.filter(val);
- }
- },
- },
- components: {
- dynamicExcel,
- ManualSorting,
- FormulaEdit,
- EditElement,
- FormulaEditone
- },
- };
- </script>
- <style scoped lang="scss">
- .font-s-12 /deep/ .iconfont {
- font-size: 12px;
- }
- .el-popper[x-placement^="bottom"] {
- margin-top: -6px;
- }
- .right-btn {
- position: absolute;
- right: 20px;
- top: 10px;
- font-size: 20px;
- }
- .custom-tree-node {
- .normal-black {
- display: none;
- }
- &:hover {
- .normal-black {
- display: inline-block;
- }
- }
- &.show .normal-black {
- display: inline-block;
- }
- }
- .excelBox {
- /deep/.el-dialog__body {
- padding: 20px;
- }
- }
- //调整表单样式
- .excelHtml {
- position: absolute;
- z-index: 999999;
- top: 50px;
- left: 0px;
- width: 100%;
- height: 100%;
- }
- .jiedian {
- /deep/.el-dialog__body {
- padding: 10px 20px !important;
- }
- }
- .filter-tree {
- min-width: 100%;
- display: inline-block;
- }
- .full-dialog {
- /deep/ .el-dialog__body {
- padding-bottom: 0;
- padding-top: 0;
- }
- /deep/ .basic-container {
- height: calc(100vh - 60px);
- }
- }
- .my-basic-con {
- padding: 6px 6px;
- }
- // 树形控件菜单样式
- .contextmenu {
- margin: 0;
- background: #fff;
- z-index: 1000;
- position: fixed; //关键样式设置固定定位
- list-style-type: none;
- padding: 5px 0;
- border-radius: 4px;
- font-size: 12px;
- font-weight: 400;
- color: #333;
- box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
- }
- .contextmenu li {
- margin: 0;
- padding: 7px 16px;
- cursor: pointer;
- }
- .contextmenu li:hover {
- background: #eee;
- }
- .selectBtn{
- position:absolute;
- top:50px;
- right: 408px;
- z-index:1000;
- width:140px;
- text-align: left;
- }
- .titlerow{
- // float: right;
- background-color:rgba(31, 34, 41, 0.8);
- // width:104%;
- padding-left:10px;
- padding-right:10px;
- text-align:right;
- margin-top: -20px;
- margin-left: -20px;
- margin-right: -20px;
-
- }
- </style>
|