1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880 |
- <template>
- <div class="h-full">
- <div
- v-if="wbsTypeTabKey === 'tree'"
- v-loading="nodeSaveLoading"
- class="hc-layout-box"
- element-loading-text="批量保存数据中..."
- >
- <div
- id="wbs-left-tree"
- :class="[
- isWbsTreeShow ? 'show' : '',
- isMouseTree ? 'on-transition' : '',
- ]"
- :style="`width:${isWbsTreeShow ? leftWidth : 0}px; ${
- isWbsTreeShow ? '' : 'display: none'
- }`"
- class="hc-layout-left-box bg-white"
- >
- <div class="hc-project-box">
- <div class="hc-project-icon-box">
- <HcIcon name="stack" />
- </div>
- <div class="project-name-box ml-2">
- <div class="project-alias">
- {{ projectInfo?.projectName }}
- </div>
- </div>
- </div>
- <div class="hc-tree-box hc-tree-box1">
- <div class="hc-tree-back-to">
- <el-link type="primary" @click="gobackHistory">
- 回到上一次填报部位
- </el-link>
- <el-link
- type="warning"
- class="ml-4"
- @click="wbsMapTypeTab"
- >
- 导图结构填报
- </el-link>
- <HcTooltip keys="data-fill-wbs-hide-btn">
- <el-button
- class="data-fill-wbs-hide-btn ml-6"
- hc-btn
- keys="data-fill-wbs-hide-btn"
- :loading="hideSaveLoading"
- @click="hideTreeNode"
- >
- 隐藏
- </el-button>
- </HcTooltip>
- </div>
- <div class="hc-search-tree-val">
- <el-input
- v-model="searchTreeVal"
- clearable
- block
- placeholder="请输入名称关键词检索"
- @keyup="searchTreeKeyUp"
- >
- <template #suffix>
- <HcIcon
- name="search-2"
- ui="text-xl iscusor"
- @click="searchTreeClick"
- />
- </template>
- </el-input>
- </div>
- <div
- v-if="isShowLeft"
- id="hc-tree-scrollbar"
- v-loading="treeLoading"
- class="hc-tree-scrollbar"
- element-loading-text="获取数据中..."
- >
- <el-scrollbar
- v-show="isSearchTree"
- class="scroll-bar-right-16"
- >
- <HcDataTree
- is-load-menu
- :datas="searchTreeData"
- :is-mark="TreeMark"
- :menus="ElTreeMenu"
- is-counts
- is-type
- :auto-expand-keys="TreeAutoExpandKeys"
- default-expand-all
- is-form-date
- @node-tap="wbsElTreeClick"
- @menu-tap="ElTreeMenuClick"
- @load-menu="loadMenu"
- />
- </el-scrollbar>
- <el-scrollbar
- v-show="!isSearchTree"
- class="scroll-bar-right-16"
- >
- <HcLazyTree
- ref="wbstree"
- is-form-date
- is-load-menu
- :auto-expand-keys="TreeAutoExpandKeys"
- :is-mark="TreeMark"
- :menus="ElTreeMenu"
- is-counts
- is-type
- show-checkbox
- check-strictly
- @load="treeLoadNode"
- @menu-tap="ElTreeMenuClick"
- @node-loading="ElTreeNodeLoading"
- @node-tap="wbsElTreeClick"
- @check="ElTreeNodeCheck"
- @load-menu="loadMenu"
- />
- </el-scrollbar>
- </div>
- </div>
- <div class="hc-tree-foot-tip-box">
- <div class="dot-view green">已审批</div>
- <div class="dot-view black">未填报</div>
- <div class="dot-view orange">已填报-待审批</div>
- <div class="dot-view blue">已填报-未上报</div>
- </div>
- <!-- 左右拖动 -->
- <div class="horizontal-drag-line" @mousedown="onmousedown" />
- </div>
- <div
- id="wbs-content-box"
- v-loading="ListItemLoading"
- class="hc-layout-content-box"
- >
- <!---展开收缩树 -->
- <div
- class="hc-expansion-contraction-tree"
- @click="setWbsTreeShow"
- >
- <HcIcon v-show="isWbsTreeShow" name="arrow-left-s" />
- <HcIcon v-show="!isWbsTreeShow" name="arrow-right-s" />
- </div>
- <hc-tab-card
- :tabs="authBtnTabdata"
- :tab-key="authBtnTabKey"
- @change="authBtnTabClick"
- >
- <template #extra>
- <div v-if="ListItemDatas.length > 0 && isTemplateType" class="mr-2 flex items-center justify-center whitespace-nowrap">
- <div class="font-500"> 文件题名</div>
- <div class="title-input h-[30px] flex items-center leading-[30px]" :style="{ width: titleInput ? '' : '100px' }">{{ titleInput }}</div>
- </div>
-
- <HcTooltip keys="node_base_data">
- <el-button
- v-if="isTemplateType"
- hc-btn
- type="primary"
- :disabled="
- !primaryKeyId
- "
-
- @click="nodeBaseDataClick"
- >
- 节点基础数据
- </el-button>
- </HcTooltip>
- <HcTooltip keys="wbs_views_sort_btn">
- <el-button
- v-if="nodeDataInfo?.nodeClass !== 2"
- :disabled="ListItemDatas.length <= 0 || (nodeDataInfo?.colorStatus !== 1 && nodeDataInfo?.colorStatus !== 2)"
- hc-btn
- type="primary"
- @click="sortFormClick"
- >
- 排序
- </el-button>
- </HcTooltip>
- <HcTooltip keys="wbs_views_node_save_btn">
- <el-button
- v-if="nodeDataInfo?.nodeClass !== 2"
- :loading="nodeSaveLoading"
- hc-btn
- type="primary"
- @click="NodeSaveClick"
- >
- 辅助保存
- </el-button>
- </HcTooltip>
- <HcTooltip keys="wbs_views_drawings">
- <el-button
- v-if="nodeDataInfo?.nodeClass !== 2"
- :disabled="
- nodeDataInfo?.drawingsId === -1
- || nodeDataInfo?.drawingsId === null
- "
- hc-btn
- color="#e03997"
- @click="viewsDrawings"
- >
- 图纸
- </el-button>
- </HcTooltip>
- <HcTooltip keys="wbs_preview">
- <el-button
- :disabled="NodeStatus === '1'"
- :loading="bussPdfsLoading"
- hc-btn
- color="#A16222"
- @click="bussPdfsClick"
- >
- 预览
- </el-button>
- </HcTooltip>
- <el-button
- hc-btn
- color="#A16222"
- @click="attachmentModalShow"
- >
- 查看附件
- </el-button>
- <el-button
- hc-btn
- :disabled="isCanadd"
- color="#567722"
- @click="addFilelist"
- >
- 上传附件
- </el-button>
- <HcTooltip v-if="NodeStatus !== '3'" keys="wbs_report">
- <el-button
- v-if="nodeDataInfo?.nodeClass !== 2"
- :disabled="
- NodeStatus === '3' || NodeStatus === '1'
- "
- :loading="reportLoading"
- hc-btn
- color="#FF976A"
- style="color: white"
- @click="reportModalClick"
- >
- 上报
- </el-button>
- </HcTooltip>
- <HcTooltip v-if="NodeStatus === '3'" keys="wbs_abolish">
- <el-button
- v-if="nodeDataInfo?.nodeClass !== 2"
- hc-btn
- :laoding="abolishLoaing"
- color="#FF976A"
- style="color: white"
- @click="abolishOneClick"
- >
- 撤回上报流程
- </el-button>
- </HcTooltip>
- <HcTooltip keys="wbs_views_sync_data_btn">
- <el-button
- v-if="
- authBtnTabKey === '2'
- && nodeDataInfo?.nodeClass !== 2
- "
- hc-btn
- color="#37c0fe"
- style="color: white"
- :loading="syncdataloading"
- @click="syncdata"
- >
- 同步质检资料
- </el-button>
- <el-button
- v-if="nodeDataInfo?.majorDataType == 2"
- hc-btn
- color="#12C060"
- style="color: white"
- :loading="syncWorkloading"
- @click="syncWork"
- >
- 同步工序资料
- </el-button>
- </HcTooltip>
- <HcTooltip v-if="NodeStatus !== '3'" keys="wbs_save">
- <el-button
- v-if="nodeDataInfo?.nodeClass !== 2"
- :disabled="
- NodeStatus === '3'
- || ListItemDatas.length <= 0
- "
- :loading="tableFormSaveLoading"
- hc-btn
- color="#12C060"
- style="color: white; font-weight: bold"
- @click="tableFormSaveClick"
- >
- 保存数据
- </el-button>
- </HcTooltip>
- </template>
- <el-scrollbar
- v-if="ListItemDatas.length > 0"
- ref="ListItemScrollRef"
- >
- <CollapseForm
- ref="ListItemRef"
- :contract-info="
- contractInfo?.contractType === 2
- ? nodeDataInfo?.contractIdRelation
- : contractId
- "
- :tree-auto-expand-keys="TreeAutoExpandKeys"
- :classify="authBtnTabKey"
- :contract-id="contractId"
- :datas="ListItemDatas"
- :draw-type="!isDrawType"
- :primary-key-id="primaryKeyId"
- :status="NodeStatus"
- :tenant-id="userInfo?.tenant_id"
- :wbs-temp-id="
- projectInfo?.referenceWbsTemplateIdTrial
- "
- :wbs-type="2"
- :treenode-data-info="nodeDataInfo"
- :newlistdata="newlistdata"
- @offset-top="ListItemOffsetTop"
- @renew="getTableDataAll"
- @get-list="searchNodeAllTable1"
- />
- </el-scrollbar>
- <hc-empty v-else title="暂无表单" />
- </hc-tab-card>
- </div>
- </div>
- <hc-new-card
- v-if="wbsTypeTabKey === 'map'"
- id-ref="wbs-node-tree-card-target"
- >
- <template #header>
- <HcTooltip keys="wbs_views_division_btn">
- <el-button
- class="mr-10"
- hc-btn
- type="primary"
- @click="divisionClick"
- >
- <HcIcon :line="false" name="node-tree" />
- <span>划分变更</span>
- </el-button>
- </HcTooltip>
- <HcNewSwitch
- v-if="isDrawer"
- :datas="authBtnTabdata"
- :keys="authBtnTabKey"
- :round="false"
- size="default"
- @change="authBtnTabClick"
- />
- </template>
- <template #extra>
- <HcNewSwitch
- :datas="wbsTypeTab"
- :keys="wbsTypeTabKey"
- size="default"
- @change="wbsTypeTabChange"
- />
- </template>
- <NodeTree
- ref="NodeTreeRef"
- :accordion="NodeTreeAccordion"
- :auto-expand-keys="TreeAutoExpandKeys"
- :contract-id="contractId"
- :is-mark="TreeMark"
- :menus="ElTreeMenu"
- :project-id="projectId"
- @menu-click="NodeTreeMenuClick"
- @node-click="NodeTreeClick"
- @node-dbl-click="NodeTreeDblClick"
- />
- <template #action>
- <div class="hc-tree-mp-tip-box">
- <div class="dot-view green">已审批</div>
- <div class="dot-view black">未填报</div>
- <div class="dot-view orange">已填报-待审批</div>
- <div class="dot-view blue">已填报-未上报</div>
- </div>
- </template>
- <HcDrawer
- v-model="isDrawer"
- to-id="wbs-node-tree-card-target"
- is-close
- @close="drawerClose"
- >
- <!-- 清表列表 -->
- <el-scrollbar
- v-if="ListItemDatas.length > 0"
- ref="ListItemScrollRef"
- >
- <CollapseForm
- ref="ListItemsRef"
- :contract-info="
- contractInfo?.contractType === 2
- ? nodeDataInfo?.contractIdRelation
- : contractId
- "
- :classify="authBtnTabKey"
- :contract-id="contractId"
- :datas="ListItemDatas"
- :draw-type="isDrawType"
- :primary-key-id="primaryKeyId"
- :status="NodeStatus"
- :tenant-id="userInfo?.tenant_id"
- :wbs-temp-id="projectInfo?.referenceWbsTemplateIdTrial"
- :wbs-type="2"
- @offset-top="ListItemOffsetTop"
- @renew="getTableDataAll"
- />
- </el-scrollbar>
- <hc-empty v-else text="暂无表单" />
- <!-- 底部按钮区域 -->
- <template #action>
- <hc-tooltip v-if="NodeStatus !== '3'" keys="wbs_save">
- <el-button
- :disabled="
- NodeStatus === '3' || ListItemDatas.length <= 0
- "
- :loading="tableFormSaveLoading"
- hc-btn
- type="primary"
- @click="tableFormSaveClick"
- >
- <HcIcon name="save" />
- <span>保存</span>
- </el-button>
- </hc-tooltip>
- <hc-tooltip v-if="NodeStatus !== '3'" keys="wbs_report">
- <el-button
- :disabled="NodeStatus === '3' || NodeStatus === '1'"
- :loading="reportLoading"
- hc-btn
- @click="reportModalClick"
- >
- <HcIcon name="send-plane-2" />
- <span>上报</span>
- </el-button>
- </hc-tooltip>
- <hc-tooltip keys="wbs_preview">
- <el-button
- :disabled="NodeStatus === '1'"
- :loading="bussPdfsLoading"
- hc-btn
- @click="bussPdfsClick"
- >
- <HcIcon name="eye" />
- <span>预览</span>
- </el-button>
- </hc-tooltip>
- <hc-tooltip v-if="NodeStatus === '3'" keys="wbs_abolish">
- <el-button hc-btn>
- <HcIcon name="arrow-go-back" />
- <span>撤回上报流程</span>
- </el-button>
- </hc-tooltip>
- <hc-tooltip keys="wbs_views_drawings">
- <el-button
- :disabled="!nodeDataInfo?.fileUrl"
- hc-btn
- @click="viewsDrawings"
- >
- <HcIcon name="image" />
- <span>图纸</span>
- </el-button>
- </hc-tooltip>
- <el-button hc-btn @click="attachmentModalShow">
- <HcIcon name="file" />
- <span>附件</span>
- </el-button>
- <el-button hc-btn @click="drawerClose">
- <HcIcon name="close" />
- <span>关闭填报页面</span>
- </el-button>
- </template>
- </HcDrawer>
- </hc-new-card>
- <!-- 查看图纸 -->
- <hc-drag-modal
- :is-show="drawingsShow"
- close-icon
- lefts="145"
- title="查看图纸"
- tops="100"
- ui="hc-image-preview-box"
- widths="380px"
- @close="drawingsClose"
- >
- <div class="hc-image-preview-view">
- <!-- <el-image-viewer :url-list="[nodeDataInfo.fileUrl]" /> -->
- <el-image :src="drawList" />
- </div>
- </hc-drag-modal>
- <!-- 编辑节点 -->
- <hc-new-dialog
- v-model="editNodeModal"
- :loading="editNodeLoading"
- title="编辑节点"
- widths="600px"
- @save="editNodeClick"
- >
- <el-form
- ref="formEditNodeRef"
- :model="formEditNodeModel"
- :rules="formEditNodeRules"
- label-width="auto"
- size="large"
- >
- <el-form-item label="节点名称" prop="title">
- <el-input
- v-model="formEditNodeModel.title"
- placeholder="请输入节点名称"
- />
- </el-form-item>
- <el-form-item label="上级节点">
- <el-input
- v-model="formEditNodeModel.parent.title"
- disabled
- />
- </el-form-item>
- <el-form-item label="节点类型">
- <el-select
- v-model="formEditNodeModel.nodeType"
- :disabled="formEditNodeModel.isCustom !== 1"
- block
- >
- <el-option
- v-for="item in nodeTypeData"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="时间" prop="digitizeTime">
- <el-date-picker
- v-model="formEditNodeModel.digitizeTime"
- class="block"
- format="YYYY-MM-DD"
- placeholder="请选择"
- type="date"
- value-format="YYYY-MM-DD"
- />
- </el-form-item>
- <el-form-item
- v-if="formEditNodeModel.nodeClass == 2"
- label="内业资料类型"
- prop="majorDataType"
- >
- <el-select
- v-model="formEditNodeModel.majorDataType"
- block
- >
- <el-option
- v-for="item in majorDataTypeOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item
- v-if="formEditNodeModel.notExsitChild"
- label="标准分类"
- prop="className"
- >
- <el-select
- v-model="formEditNodeModel.className"
- block
- @change="changeStandType"
- >
- <el-option
- v-for="item in standardTypeOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item
- v-if="formEditNodeModel.notExsitChild"
- label="单位名称"
- prop="unitName"
- >
- <el-select v-model="formEditNodeModel.unitName" block>
- <el-option
- v-for="item in unitNameOptions"
- :key="item.value"
- :label="item.dictValue"
- :value="item.dictKey"
- />
- </el-select>
- </el-form-item>
- <el-row v-if="formEditNodeModel.nodeClass === 2" :gutter="24">
- <el-col :span="12">
- <el-form-item prop="unitNum" label="单元个数">
- <el-input-number
- v-model="formEditNodeModel.unitNum"
- placeholder="请输入单元个数"
- :controls="false"
- :min="0"
- :precision="0"
- class="w-100"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item prop="excellentNum" label="优良个数">
- <el-input-number
- v-model="formEditNodeModel.excellentNum"
- placeholder="请输入优良个数"
- :controls="false"
- :min="0"
- :precision="0"
- class="w-100"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-tooltip
- v-if="formEditNodeModel?.isReferenceNumber === 0"
- class="item"
- effect="light"
- content="当前合同段未开启引用标号功能,表格无法获取,请联系维护人员处理"
- placement="top"
- >
- <el-form-item label="划分编号">
- <el-input
- v-model="formEditNodeModel.partitionCode"
- placeholder="请输入划分编号"
- />
- </el-form-item>
- </el-tooltip>
- <el-form-item v-else label="划分编号">
- <el-input
- v-model="formEditNodeModel.partitionCode"
- placeholder="请输入划分编号"
- />
- </el-form-item>
- <el-form-item class="hc-position-input-icon" label="模板位置">
- <el-input
- v-model="formEditNodeModel.position"
- :autosize="{ minRows: 3, maxRows: 6 }"
- type="textarea"
- />
- <el-tooltip content="一键复制模板位置">
- <HcIcon
- name="file-copy-2"
- @click="
- copyPositionText(formEditNodeModel.position)
- "
- />
- </el-tooltip>
- </el-form-item>
- <el-form-item class="hc-position-input-icon mt-2" label="系统模板">
- <el-input
- v-model="formEditNodeModel.privateTemplate"
- :autosize="{ minRows: 3, maxRows: 6 }"
- type="textarea"
- />
- <el-tooltip content="一键复制系统模板">
- <HcIcon
- name="file-copy-2"
- @click="
- copyPositionText(formEditNodeModel.privateTemplate)
- "
- />
- </el-tooltip>
- </el-form-item>
- </el-form>
- </hc-new-dialog>
- <!-- 复制节点 -->
- <hc-new-dialog
- v-model="copyNodeModal"
- :loading="copyNodeLoading"
- :widths="copyNodeTabKey === '1' ? '600px' : '1200px'"
- loading-text="复制节点中,请耐心等待..."
- title="复制节点"
- >
- <div class="header-new-switch">
- <el-form
- ref="formCopyNodeModelRef"
- :model="formCopyNodeModel"
- label-position="left"
- :rules="formCopyNodeModelRules"
- label-width="auto"
- size="large"
- >
- <el-form-item
- label="是否复制数据"
- prop="isCopyData"
- style="margin-bottom: 0"
- >
- <!-- <el-input v-model="formCopyNodeModel.classify" placeholder="请输入节点名称"/> -->
- <el-radio-group v-model="isCopyData">
- <el-radio :value="1">是</el-radio>
- <el-radio :value="0">否</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item
- v-if="isCopyData === 1"
- label="所属方"
- prop="classify"
- style="margin-bottom: 0"
- >
- <!-- <el-input v-model="formCopyNodeModel.classify" placeholder="请输入节点名称"/> -->
- <el-checkbox-group v-model="classifyList">
- <el-checkbox value="施工">施工</el-checkbox>
- <el-checkbox value="监理">监理</el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- </el-form>
- </div>
- <div v-if="copyNodeTabKey === '1'" class="copy-node-form-box">
- <el-form
- ref="formCopyNodeModelRef"
- :model="formCopyNodeModel"
- :rules="formCopyNodeModelRules"
- label-width="auto"
- size="large"
- >
- <el-form-item
- v-if="copyNodeTabKey === '1'"
- label="节点名称"
- prop="title"
- style="margin-bottom: 0"
- >
- <el-input
- v-model="formCopyNodeModel.title"
- placeholder="请输入节点名称"
- />
- </el-form-item>
- <el-form-item
- v-if="copyNodeTabKey === '1'"
- label="划分编号"
- prop="partitionCode"
- style="margin-top: 10px"
- >
- <el-input
- v-model="formCopyNodeModel.partitionCode"
- placeholder="请输入划分编号"
- />
- </el-form-item>
- </el-form>
- </div>
- <div v-if="copyNodeTabKey === '3'" class="copy-node-form-box">
- <el-form
- ref="formCopyNodeModelRef"
- :model="formCopyNodeModel"
- :rules="formCopyNodeModelRules"
- label-width="auto"
- size="large"
- >
- <el-form-item
- label="所属方"
- prop="classify"
- style="margin-bottom: 0"
- >
- <!-- <el-input v-model="formCopyNodeModel.classify" placeholder="请输入节点名称"/> -->
- <el-checkbox-group v-model="classifyList">
- <el-checkbox value="施工">施工</el-checkbox>
- <el-checkbox value="监理">监理</el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- </el-form>
- </div>
- <div v-if="copyNodeTabKey !== '1'" class="copy-node-many-box">
- <div class="copy-node-many-tree">
- <el-scrollbar>
- <hc-lazy-tree
- :auto-expand-keys="TreeAutoExpandKeys"
- is-type
- @load="treeLoadNode"
- @node-tap="copyNodeElTreeClick"
- />
- </el-scrollbar>
- </div>
- <div class="copy-node-many-table">
- <el-scrollbar>
- <el-table :data="copyNodeTable" border>
- <el-table-column
- label="复制到的位置"
- prop="title"
- />
- <el-table-column
- v-if="copyNodeTabKey === '2'"
- label="节点名称"
- prop="nodeName"
- >
- <template #default="{ row }">
- <el-form
- ref="copyNodeTableRef"
- :model="row"
- :rules="copyNodeTableRules"
- label-width="0"
- size="large"
- >
- <el-form-item
- prop="nodeName"
- style="margin-bottom: 0"
- >
- <el-input
- v-model="row.nodeName"
- placeholder="请输入节点名称"
- />
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- <el-table-column
- v-if="copyNodeTabKey === '2'"
- label="划分编号"
- prop="partitionCode"
- >
- <template #default="{ row }">
- <el-form
- ref="copyNodeTableRef"
- :model="row"
- :rules="copyNodeTableRules"
- label-width="0"
- size="large"
- >
- <el-form-item
- prop="partitionCode"
- style="margin-bottom: 0"
- >
- <el-input
- v-model="row.partitionCode"
- placeholder="请输入划分编号"
- />
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="操作"
- prop="action"
- width="120"
- >
- <template #default="{ _, $index }">
- <el-button
- plain
- type="danger"
- @click="copyNodeTableDel($index)"
- >
- 删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-scrollbar>
- </div>
- </div>
- <template #footer>
- <div class="lr-dialog-footer">
- <div class="left">
- <template
- v-for="(item, index) in copyNodeTab"
- :key="index"
- >
- <el-button
- v-if="item?.key === copyNodeTabKey"
- plain
- size="large"
- type="primary"
- @click="copyNodeTabChange(item?.key)"
- >
- {{ item.name }}
- </el-button>
- <el-button
- v-else
- bg
- size="large"
- text
- @click="copyNodeTabChange(item?.key)"
- >
- {{ item.name }}
- </el-button>
- </template>
- </div>
- <div class="right">
- <el-button
- :disabled="copyNodeLoading"
- size="large"
- @click="copyNodeModal = false"
- >
- 取消
- </el-button>
- <el-button
- :loading="copyNodeLoading"
- hc-btn
- type="primary"
- @click="copyNodeClick"
- >
- 提交
- </el-button>
- </div>
- </div>
- </template>
- </hc-new-dialog>
- <!-- 新增子节点 -->
- <hc-new-dialog
- v-model="addNodeModal"
- :loading="addNodeLoading"
- loading-text="新增节点中,请耐心等待..."
- title="新增子节点"
- widths="720px"
- is-table
- >
- <el-alert
- :closable="false"
- title="双击节点,可编辑节点名称,编辑完成后,请按回车或输入框消失后,再点提交"
- type="warning"
- />
- <HcTreeNode
- v-if="addTreeNodeType === '1'"
- :node-id="addTreeNodeId"
- :old-id="addTreeNodeOldId"
- :contract-id="contractId"
- :wbs-id="projectInfo.referenceWbsTemplateId"
- :project-id="projectId"
- :is-custom="isCustom"
-
- @check-change="addTreeNodeCheckChange"
- />
- <HcTreeNode
- v-if="addTreeNodeType === '3'"
- :node-id="addTreeNodeId"
- :old-id="addTreeNodeOldId"
- :contract-id="contractId"
- :wbs-id="projectInfo.referenceWbsTemplateId"
- :project-id="projectId"
- :is-custom="isCustom"
- :strictly="true"
-
- :only-children-check="true"
- @check-change="addTreeNodeCheckChange"
- />
- <HcTreeNode
- v-if="addTreeNodeType === '2'"
- :node-id="addTreeNodeId"
- :old-id="addTreeNodeOldId"
- :contract-id="contractId"
- :wbs-id="projectInfo.referenceWbsTemplateId"
- :project-id="projectId"
- strictly
-
- :is-custom="isCustom"
-
-
- @check-change="addTreeNodeCheckChange"
- />
- <template #footer>
- <div class="lr-dialog-footer">
- <div class="left flex items-center">
- <div class="mr-4">选中方式:</div>
- <el-radio-group v-model="addTreeNodeType">
- <el-radio value="3">当前及子节点</el-radio>
- <el-radio class="ml-4" value="2">
- 仅当前节点
- </el-radio>
- <el-radio value="1">当前及父节点</el-radio>
- <!-- <el-radio value="1">当前子及节点</el-radio> -->
- </el-radio-group>
- </div>
- <div class="right">
- <el-button size="large" @click="addNodeModal = false">
- 取消
- </el-button>
- <el-button
- :loading="addNodeLoading"
- hc-btn
- type="primary"
- @click="addNodeClick"
- >
- 提交
- </el-button>
- </div>
- </div>
- </template>
- </hc-new-dialog>
- <!-- 新增自定义节点 -->
- <hc-new-dialog
- v-model="addNodeModalCus"
- :loading="addNodeLoadingCus"
- loading-text="新增节点中,请耐心等待..."
- title="新增自定义节点(水利工程)"
- widths="720px"
- @save="addNodeClickCur"
- >
- <el-form
- ref="formWaterNodeRef"
- :model="formWaterNodeModel"
- :rules="formWaterNodeRules"
- label-width="auto"
- size="large"
- label-position="left"
- >
- <el-form-item label="节点名称" prop="nodeName">
- <el-input
- v-model="formWaterNodeModel.nodeName"
- placeholder="请输入节点名称"
- />
- </el-form-item>
- <el-form-item label="节点类型" prop="nodeType">
- <el-select v-model="formWaterNodeModel.nodeType" block>
- <el-option
- v-for="item in nodeTypeData"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="编号" prop="number">
- <el-input
- v-model="formWaterNodeModel.number"
- placeholder="请输入编号"
- />
- </el-form-item>
- </el-form>
- </hc-new-dialog>
- <!-- 新增自定义节点-数字化文件 -->
- <hc-new-dialog
- v-model="addNodeModalData"
- :loading="addNodeLoadingData"
- loading-text="新增节点中,请耐心等待..."
- title="新增自定义节点(数字化文件)"
- widths="720px"
- @save="addNodeClickData"
- >
- <el-form
- ref="formDataNodeRef"
- :model="formDataNodeModel"
- :rules="formDataNodeRules"
- label-width="auto"
- size="large"
- >
- <el-form-item label="节点名称" prop="nodeName">
- <el-input
- v-model="formDataNodeModel.nodeName"
- placeholder="请输入节点名称"
- />
- </el-form-item>
- <el-form-item label="节点类型" prop="nodeType">
- <el-select v-model="formDataNodeModel.nodeType" block>
- <el-option
- v-for="item in nodeTypeData"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="是否含单元评定" prop="isClassifition">
- <el-radio-group v-model="formDataNodeModel.isClassifition">
- <el-radio :value="1">是</el-radio>
- <el-radio :value="0">否</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="时间" prop="digitizeTime">
- <el-date-picker
- v-model="formDataNodeModel.digitizeTime"
- class="block"
- format="YYYY-MM-DD"
- placeholder="请选择"
- type="date"
- value-format="YYYY-MM-DD"
- />
- </el-form-item>
- <el-form-item
- label="内业资料类型"
- prop="majorDataType"
- >
- <el-select
- v-model="formDataNodeModel.majorDataType"
- block
- >
- <el-option
- v-for="item in majorDataTypeOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item
- v-if="formDataNodeModel.isClassifition === 1"
- label="标准分类"
- prop="className"
- >
- <el-select
- v-model="formDataNodeModel.className"
- block
- @change="changeStandType"
- >
- <el-option
- v-for="item in standardTypeOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item
- v-if="formDataNodeModel.isClassifition === 1"
- label="单元名称"
- prop="unitName"
- >
- <el-select v-model="formDataNodeModel.unitName" block>
- <el-option
- v-for="item in unitNameOptions"
- :key="item.value"
- :label="item.dictValue"
- :value="item.dictKey"
- />
- </el-select>
- </el-form-item>
- <el-row
- v-if="formDataNodeModel.isClassifition === 1"
- :gutter="24"
- >
- <el-col :span="12">
- <el-form-item prop="unitNum" label="单元个数">
- <el-input-number
- v-model="formDataNodeModel.unitNum"
- placeholder="请输入单元个数"
- :controls="false"
- :min="0"
- :precision="0"
- class="w-100"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item prop="excellentNum" label="优良个数">
- <el-input-number
- v-model="formDataNodeModel.excellentNum"
- placeholder="请输入优良个数"
- :controls="false"
- :min="0"
- :precision="0"
- class="w-100"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </hc-new-dialog>
- <!-- 调整排序 -->
- <hc-new-dialog
- v-model="sortNodeModal"
- :loading="sortNodeLoading"
- title="调整排序"
- widths="700px"
- @save="sortNodeClick"
- >
- <el-alert
- :closable="false"
- title="可拖动排序,也可在后面点击图标,切换排序"
- type="warning"
- />
- <div class="sort-node-body-box list-group header">
- <div class="list-group-item">
- <div class="index-box">序号</div>
- <div class="title-box">节点名称</div>
- <div class="icon-box">排序</div>
- </div>
- </div>
- <Draggable
- :list="sortNodeData"
- class="sort-node-body-box list-group"
- ghost-class="ghost"
- item-key="id"
- @end="sortNodeDrag = false"
- @start="sortNodeDrag = true"
- >
- <template #item="{ element, index }">
- <div class="list-group-item">
- <div class="index-box">{{ index + 1 }}</div>
- <div class="title-box">{{ element.title }}</div>
- <div class="icon-box">
- <span class="icon" @click="downSortClick(index)">
- <HcIcon name="arrow-down" ui="text-lg" />
- </span>
- <span class="icon" @click="upSortClick(index)">
- <HcIcon name="arrow-up" ui="text-lg" />
- </span>
- </div>
- </div>
- </template>
- </Draggable>
- </hc-new-dialog>
- <!-- 批量上报审批 -->
- <hc-report-modal
- :addition="reportAddition"
- :contract-id="
- contractInfo?.contractType == 2
- ? nodeDataInfo?.contractIdRelation
- : contractId
- "
- :flow-contract-id="nodeDataInfo?.contractId"
- :ids="reportIds"
- :table-owner="authBtnTabKey"
- :classify-type="classType"
- :project-id="projectId"
- :show="showReportModal"
- :task-name="reportTaskName"
- :type-data="reportTypeData"
- title="批量上报审批"
- type="wbs"
- url="informationWriteQuery/taskOne"
- @finish="showReportFinish"
- @hide="showReportModal = false"
- />
- <!-- 查看附件 -->
- <hc-new-dialog
- v-model="attachmentModal"
-
- is-table
- title="附件列表"
- widths="780px"
- >
- <div
- v-if="attachmentList.length > 0"
- v-loading="attachmentListLoaing"
- >
- <div class="mb-1 p-2">
- <span class="text-orange">按住鼠标拖动文件可进行附件列表排序</span>
- </div>
- <div
- v-for="item in attachmentList"
- :key="item.id"
- class="hc-attachment-card"
- >
- <div class="hc-attachment-header">
- {{ item?.nodeName }}
- <!-- <el-button type="success" :loading="saveFileOrderLoad" style="float:right" @click="saveFileOrder">确定排序</el-button> -->
- </div>
- <div
- :ref="setAttachmentListRef"
- class="hc-attachment-content"
- >
- <div
- v-for="item1 in item.fileList"
- :key="item1.id"
- class="hc-attachment-item"
- >
- <div class="hc-attachment-file-name">
- <HcIcon name="arrow-up-down" class="text-blue" />
- <HcIcon name="attachment" class="ml-2" />
- <div class="name">{{ item1?.name }}</div>
- </div>
- <div class="hc-attachment-btn-box">
- <el-button
- plain
- size="small"
- type="primary"
- @click="previewFile(item1)"
- >
- <HcIcon name="eye" />
- <span>预览</span>
- </el-button>
- <el-button
- v-if="NodeStatus !== 3 || nodeDataInfo?.nodeClass === 2"
- plain
- size="small"
- style="margin-left: 16px"
- type="danger"
- :loading="item1?.loading"
- @click="delFile(item1)"
- >
- <HcIcon name="close" />
- <span>删除</span>
- </el-button>
- </div>
- </div>
- </div>
- </div>
- </div>
- <template #footer>
- <el-button @click="attachmentModal = false">关闭</el-button>
- <el-button type="primary" :loading="saveFileOrderLoad" @click="saveFileOrder">确定排序</el-button>
- </template>
- </hc-new-dialog>
- <!-- 上传文件 -->
- <hc-new-dialog
- v-model="uploadModal"
- :footer="false"
- title="上传文件"
- widths="38rem"
- @close="uploadModalClose"
- >
- <div class="mb-4">
- <span style="color: red">*</span> 选择附件类型:
- <el-select
- v-model="typevalue"
- placeholder="请选择"
- style="width: 240px"
- clearable
- @change="changeType"
- >
- <el-option
- v-for="item in typeoptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </div>
- <HcUpload
- :datas="uploadData"
- :file-list="fileListData"
- :is-canupload="false"
- action="/api/blade-manager/exceltab/add-bussfile-node"
- accept="application/pdf"
- accept-tip="允许格式:pdf"
- :auto-upload="false"
- :typevalue="typevalue"
- @change="uploadChange"
- @close="uploadModalClose"
- />
- </hc-new-dialog>
- <!-- 表单排序 -->
- <hc-new-dialog
- v-model="sortFormShow"
- is-table
- title="排序"
- widths="800px"
- is-footer-center
- @close="sortFormClose"
- >
- <hc-table
- ref="tableSortFormRef"
- :column="tableSortFormColumn"
- :datas="tableSortFormData"
- is-row-drop
- is-sort
- quick-sort
- @row-drop="sortFormDropTap"
- @row-sort="rowSortFormTap"
- />
- <template #footer>
- <el-button hc-btn @click="sortFormClose">取消</el-button>
- <el-button
- hc-btn
- type="primary"
- :loading="sortFormLoading"
- @click="sortFormSubmit"
- >
- 提交
- </el-button>
- </template>
- </hc-new-dialog>
- <!-- 节点基础数据 -->
- <hc-new-dialog
- v-model="nodeBaseDataModalDialog"
- title="节点基础数据"
- widths="800px"
- is-footer-center
- :loading="nodeBaseDataLoad"
- @close="nodeBaseDataModalClose"
- @save="nodeBaseDataModalSave"
- >
- <template #header>
- <div class="flex justify-between text-orange">
- <span>提示: 若填写框没有内容,则没有该节点类型。编保存后,需再次保存后才能生效。</span>
- <el-button type="success" size="small" @click="resetForm">刷新</el-button>
- </div>
- </template>
- <el-form :model="autoFormData" label-width="120px" inline>
- <el-form-item label="单位工程类型:" prop="unit">
- <el-input v-model="autoFormData.unit" />
- </el-form-item>
- <el-form-item label="单位工程:" prop="subUnit">
- <el-input v-model="autoFormData.subUnit" />
- </el-form-item>
- <el-form-item label="分部工程:" prop="division">
- <el-input v-model="autoFormData.division" />
- </el-form-item>
- <el-form-item label="子分部工程:" prop="subDivision">
- <el-input v-model="autoFormData.subDivision" />
- </el-form-item>
- <el-form-item label="分项工程:" prop="item">
- <el-input v-model="autoFormData.item" />
- </el-form-item>
- <el-form-item label="子分项工程:" prop="subItem">
- <el-input v-model="autoFormData.subItem" />
- </el-form-item>
- <el-form-item label="工序:" prop="processes">
- <el-input v-model="autoFormData.processes" />
- </el-form-item>
- </el-form>
- </hc-new-dialog>
- </div>
- </template>
- <script setup>
- import { nextTick, onMounted, ref, watch } from 'vue'
- import { useRoute, useRouter } from 'vue-router'
- import { useAppStore } from '~src/store'
- import { HcIsButton } from '~src/plugins/IsButtons'
- import CollapseForm from './collapse-form/index.vue'
- import NodeTree from './components/nodeTree/index.vue'
- import HcTreeNode from './components/HcTreeNode.vue'
- import { HcUploadFileApi } from 'hc-vue3-ui'
- import { getStoreValue, setStoreValue } from '~src/utils/storage'
- import { getDictionaryData } from '~uti/tools'
- import { getChildList } from '~api/other'
- import Sortable from 'sortablejs'
- import {
- arrToKey,
- deepClone,
- formValidate,
- getArrValue,
- getObjVal,
- getObjValue,
- isNullES,
- isString,
- setCopyText,
- } from 'js-fast-way'
- import {
- eVisaTaskCheckApi,
- getDictionary,
- getDictionaryBiz,
- userConfigSave,
- } from '~api/other'
- import wbsApi from '~api/data-fill/wbs'
- import queryApi from '~api/data-fill/query'
- import nodeBaseApi from '~api/data-fill/nodebaseinfo'
- import { useClick } from 'hc-vue3-ui'
- import Draggable from 'vuedraggable'
- import { HcDelMsg, NewDelMsg } from 'hc-vue3-ui'
- import HcUpload from './components/HcUpload.vue'
- import { toPdfPage } from '~uti/btn-auth'
- import website from '~src/config'
- //初始变量
- const router = useRouter()
- const useRoutes = useRoute()
- const useAppState = useAppStore()
- //全局变量
- const projectId = ref(useAppState.projectId)
- const contractId = ref(useAppState.contractId)
- const projectInfo = ref(useAppState.projectInfo)
- const contractInfo = ref(useAppState.contractInfo)
- const isCollapse = ref(useAppState.getCollapse)
- const userInfo = ref(useAppState.getUserInfo)
- const isLayout = ref(useAppState.isLayout)
- const leftWidth = ref(440)
- const isTemplateType = ref(useAppState.contractInfo?.templateType === 2)
- //路由参数
- const routerQuery = useRoutes?.query
- // const typeName = routerQuery?.type || 'map'
- const typeName = routerQuery?.type || 'tree'
- //是否是抽屉
- const isDrawType = ref(true)
- //自动展开缓存
- const TreeAutoExpandKeys = ref(getStoreValue('wbsTreeExpandKeys') || [])
- //树搜索
- const isSearchTree = ref(false)
- const searchTreeHeight = ref()
- const getSearchTreeData = async () => {
- treeLoading.value = true
- const { error, code, data }
- = await queryApi.getTreeNodeByQueryValueAndContractId({
- contractId: contractId.value,
- queryValue: searchTreeVal.value,
- tableOwner: authBtnTabKey.value,
- })
- //判断状态
- if (!error && code === 200) {
- let treedata = getArrValue(data)
- searchTreeData.value = treedata
- treeLoading.value = false
- } else {
- treeLoading.value = false
- searchTreeData.value = []
- }
- }
- //监听
- const searchTreeVal = ref('')
- watch(
- () => [useAppState.getCollapse, searchTreeVal.value],
- ([Collapse, search]) => {
- isCollapse.value = Collapse
- if (search.length == 0) {
- isSearchTree.value = false
- }
- },
- )
- //加载树需要的classType
- const classType = ref('')
- watch(
- () => [classType.value, useAppState.isLayout],
- ([classify, isLay]) => {
- isLayout.value = isLay || ''
- if (classify) {
- //重新加载左边树
- isShowLeft.value = false
- setTimeout(() => {
- isShowLeft.value = true
- }, 500)
- }
- },
- )
- //渲染完成
- onMounted(() => {
- console.log(projectInfo.value)
- treeLoading.value = typeName === 'tree'
- const treeWidth = useAppState.getTreeWidth
- leftWidth.value = isNullES(treeWidth) || treeWidth <= 0 ? 440 : treeWidth
- console.log(contractInfo.value, 'contractInfo.value')
- setContractType(contractInfo.value?.contractType)
- getDictionaryApi()
- getStandardTypeOptions()
- getMajorDataTypeOptions()
- })
- //身份按钮切换数据
- const authBtnTabKey = ref('1')
- //变量
- const wbstree = ref(null)
- const isShowLeft = ref(true)
- const authBtnTabClick = (val) => {
- if (!primaryKeyId.value) {
- window?.$message?.warning('请先在左侧项目树选择一个节点')
- } else if (val['key'] !== authBtnTabKey.value) {
- authBtnTabKey.value = val['key']
- //重新加载左边树
- isShowLeft.value = false
- setTimeout(() => {
- isShowLeft.value = true
- }, 500)
- getTableDataAll()
- }
- }
- //contractType, 1施工,2监理
- const setContractType = (contractType) => {
- if (contractType <= 0) {
- authBtnTabKey.value = '1'
- classType.value = '1'
- } else if (contractType === 3) {
- authBtnTabKey.value = '1'
- classType.value = '1'
- } else {
- authBtnTabKey.value = contractType + ''
- classType.value = contractType + ''
- }
- setElTreeMenu(contractType)
- }
- const getTableDataAll = async (key) => {
- await searchNodeAllTable()
- await queryNodeStatus()
- if (isTemplateType.value) {
- await getFileName()
- await getnodeBaseData()
- }
- //保存后自动展开到当前表单
- if (!isNullES(key)) {
- console.log(key)
- await nextTick(() => {
- ListItemRef.value?.setCollapseKey(key)
- })
- }
- }
- //结构类型tab数据和相关处理
- const wbsTypeTabKey = ref(typeName)
- const wbsTypeTab = ref([
- { key: 'map', name: '导图结构填报' },
- { key: 'tree', name: '树形结构填报' },
- ])
- const authBtnTabdata = ref([
- { key: '1', name: '施工质检' },
- { key: '2', name: '监理质检' },
- ])
- const wbsTypeTabChange = (item) => {
- wbsTypeTabKey.value = item?.key
- ListItemDatas.value = []
- isDrawer.value = false
- treeLoading.value = typeName === 'tree'
- setStoreValue('classifyType', classType.value)
- setStoreValue('tableOwner', authBtnTabKey.value)
- //路由跳转
- router.push({
- path: useRoutes.path,
- query: {
- type: item?.key,
- classifyType: classType.value,
- tableOwner: authBtnTabKey.value,
- },
- })
- getSearchTreeData()
- }
- //切换导图结构
- const wbsMapTypeTab = () => {
- wbsTypeTabChange({ key: 'map', name: '导图结构填报' })
- }
- //设置图纸数据
- const setUploadDrawingsData = async (echoParams, link) => {
- const info = nodeDataInfo.value
- const { error, code, data } = await wbsApi.saveContractTreeDrawings(
- {
- fileUrl: link,
- id: echoParams['drawingsId'],
- primaryKeyId: echoParams['primaryKeyId'],
- },
- false,
- )
- //处理数据
- if (!error && code === 200) {
- if (info['primaryKeyId'] === echoParams['primaryKeyId']) {
- nodeDataInfo.value['drawingsId'] = data
- nodeDataInfo.value['fileUrl'] = link
- window?.$message?.success('图纸上传成功')
- } else {
- window?.$message?.success(
- '图纸上传成功,由于您切换了其他节点,需要手动刷新才能查看到图纸',
- )
- }
- } else {
- window?.$message?.error('图纸保存失败')
- }
- }
- const NodeTreeAccordion = ref(true)
- //设置树菜单数据
- const ElTreeMenu = ref([])
- const TreeMark = ref(false)
- const setElTreeMenu = (contractType) => {
- let newArr = []
- if (contractType === 1) {
- if (HcIsButton('wbs_tree_add')) {
- newArr.push({ icon: 'add-circle', label: '新增节点', key: 'add' })
- newArr.push({
- icon: 'add-circle',
- label: '自定义节点(水利工程)',
- key: 'add1',
- })
- newArr.push({
- icon: 'add-circle',
- label: '自定义节点(数字化文件)',
- key: 'add2',
- })
- }
- if (HcIsButton('wbs_tree_edit')) {
- newArr.push({ icon: 'draft', label: '编辑节点', key: 'edit' })
- }
- if (HcIsButton('wbs_tree_copy')) {
- newArr.push({
- icon: 'file-copy-2',
- label: '复制节点',
- key: 'copy',
- })
- }
- if (HcIsButton('wbs_tree_mark')) {
- newArr.push({ icon: 'star', label: '标记为首件', key: 'mark' })
- TreeMark.value = true
- }
- if (HcIsButton('wbs_tree_upload')) {
- newArr.push({
- icon: 'file-upload',
- label: '上传图纸',
- key: 'upload',
- })
- }
- if (HcIsButton('wbs_tree_sort')) {
- newArr.push({ icon: 'sort-asc', label: '调整排序', key: 'sort' })
- }
- if (HcIsButton('wbs_tree_del')) {
- newArr.push({ icon: 'delete-bin', label: '删除节点', key: 'del' })
- }
- if (HcIsButton('wbs_views_division_btn')) {
- newArr.push({
- icon: 'folder-shared',
- label: '工程划分',
- key: 'nodetree',
- })
- }
- } else if (contractType === 2) {
- if (HcIsButton('wbs_tree_add')) {
- newArr.push({ icon: 'add-circle', label: '新增节点', key: 'add' })
- newArr.push({
- icon: 'add-circle',
- label: '自定义节点(水利工程)',
- key: 'add1',
- })
- newArr.push({
- icon: 'add-circle',
- label: '自定义节点(数字化文件)',
- key: 'add2',
- })
- }
- if (HcIsButton('wbs_tree_copy')) {
- newArr.push({
- icon: 'file-copy-2',
- label: '复制节点',
- key: 'copy',
- })
- }
- }
- ElTreeMenu.value = newArr
- }
- //树相关变量
- const primaryKeyId = ref('')
- const nodeItemInfo = ref({})
- const nodeDataInfo = ref({})
- const searchTreeData = ref([])
- //回车
- const searchTreeKeyUp = (e) => {
- if (e.key === 'Enter') {
- searchTreeClick()
- }
- }
- const treeLoading = ref(true)
- const searchTreeClick = async () => {
- if (searchTreeVal.value) {
- searchTreeHeight.value
- = document.getElementById('hc-tree-scrollbar').offsetHeight
- isSearchTree.value = true
- //treeLoading.value = true
- getSearchTreeData()
- } else {
- isSearchTree.value = false
- }
- }
- //懒加载的数据
- const treeLoadNode = async ({ node, item, level }, resolve) => {
- let contractIdRelation = '',
- parentId = '',
- primaryKeyId = ''
- if (level !== 0) {
- const nodeData = getObjValue(item)
- contractIdRelation = nodeData?.contractIdRelation || ''
- parentId = contractIdRelation ? nodeData?.primaryKeyId : nodeData?.id
- primaryKeyId = nodeData?.id || ''
- }
- //获取数据
- const { data } = await queryApi.queryWbsTreeData({
- contractId: contractId.value || '',
- contractIdRelation,
- primaryKeyId,
- parentId,
- // classifyType: authBtnTabKey.value,
- classifyType: classType.value,
- tableOwner: authBtnTabKey.value,
- dataTime:new Date(),
- })
- treeLoading.value = false
- resolve(getArrValue(data))
- }
- //树被点击
- const wbsElTreeClick = ({ node, data, keys }) => {
- nodeItemInfo.value = node
- nodeDataInfo.value = data
- primaryKeyId.value = data?.primaryKeyId || ''
- const { notExsitChild } = data
- const { hasChildren } = data
- if (notExsitChild || !hasChildren) {
- isCanadd.value = false
- getTableDataAll()
- } else {
- isCanadd.value = true
- ListItemDatas.value = []
- NodeStatus.value = '1'
- }
- setStoreValue('wbsTreeExpandKeys', keys)
- TreeAutoExpandKeys.value = keys || []
- saveHistory(keys.join(','))
-
- // getTableDataAll()
- }
- //树加载完成
- const ElTreeNodeLoading = () => {
- treeLoading.value = false
- }
- //保存用户填报历史
- const saveHistory = async (endNode) => {
- await wbsApi.saveUserHistory({
- contractId: contractId.value,
- projectId: projectId.value,
- endNode,
- })
- }
- //回到上次填报历史
- const gobackHistory = async () => {
- isSearchTree.value = false
- const { error, code, data, msg } = await wbsApi.getUserHistory({
- contractId: contractId.value,
- projectId: projectId.value,
- })
- if (!error && code === 200) {
- TreeAutoExpandKeys.value = data['endNode'].split(',') || []
- //重新加载左边树
- isShowLeft.value = false
- setTimeout(() => {
- isShowLeft.value = true
- }, 500)
- } else {
- window.$message.warning(msg)
- }
- }
- //树菜单被点击
- const ElTreeMenuClick = async ({ key, node, data, keys }) => {
- nodeItemInfo.value = node
- nodeDataInfo.value = data
- setStoreValue('wbsTreeExpandKeys', keys)
- TreeAutoExpandKeys.value = keys || []
- setTreeMenuDataClick({ key, node, data })
- }
- //导图结构数据
- const NodeTreeRef = ref(null)
- //鼠标左键单击事件
- const NodeTreeClick = ({ keys }) => {
- setStoreValue('wbsTreeExpandKeys', keys)
- TreeAutoExpandKeys.value = keys || []
- }
- //双击事件
- const isDrawer = ref(false)
- const NodeTreeDblClick = ({ node, data }) => {
- nodeItemInfo.value = node
- nodeDataInfo.value = data
- primaryKeyId.value = data?.primaryKeyId || ''
- isDrawer.value = true
- getTableDataAll()
- }
- const drawerClose = () => {
- isDrawer.value = false
- ListItemDatas.value = []
- }
- //导图树菜单被点击
- const NodeTreeMenuClick = async ({ key, node, data }) => {
- nodeItemInfo.value = node
- nodeDataInfo.value = data
- setTreeMenuDataClick({ key, node, data })
- }
- const orString = ref('')
- //处理菜单被点击数据
- const setTreeMenuDataClick = ({ key, node, data }) => {
- const tabKey = wbsTypeTabKey.value
- if (key === 'mark' || key === 'cancel_mark') {
- firstItemBox()
- } else if (key === 'edit') {
- console.log(data, 'data')
- let form = {}
- if (tabKey === 'tree') {
- const parent = deepClone(node?.parent?.data || {})
- form = { ...deepClone(data), parent: parent }
- } else if (tabKey === 'map') {
- const parent = deepClone(node?.parentNodes?.data || {})
- form = { ...deepClone(data), parent: parent }
- }
- formEditNodeModel.value = form
- orString.value = formEditNodeModel.value?.className
- changeStandType(formEditNodeModel.value?.className)
- console.log(
- formEditNodeModel.value?.className,
- 'formEditNodeModel.value?.className',
- )
- editNodeModal.value = true
- //处理路径
- let pathArr = []
- getPathName(node, pathArr)
- form.position = pathArr.join('\\')
- formEditNodeModel.value = form
- } else if (key === 'copy') {
- if (tabKey === 'tree') {
- const parent = deepClone(node?.parent?.data || {})
- formCopyNodeModel.value = { ...deepClone(data), parent: parent }
- } else if (tabKey === 'map') {
- const parent = deepClone(node?.parentNodes?.data || {})
- formCopyNodeModel.value = { ...deepClone(data), parent: parent }
- }
- classifyType.value = authBtnTabKey.value
- copyNodeTabKey.value = '1'
- copyNodeTable.value = []
- copyNodeLoading.value = false
- copyNodeModal.value = true
- } else if (key === 'add') {
- const { childNodes } = node
- console.log(childNodes, 'childNodes')
- isCustom.value = data?.isCustom
- addTreeNodeId.value = data?.primaryKeyId
- addTreeNodeOldId.value = data?.oldId
- addNodeLoading.value = false
- if (data?.isClassifition === 1) {
- window.$message.warning('该节点下不能创建子节点')
- addNodeModal.value = false
- return
- }
- {
- addNodeModal.value = true
- }
- } else if (key === 'add1') {
- addTreeNodeId.value = data?.primaryKeyId
- addTreeNodeOldId.value = data?.oldId
- addNodeLoading.value = false
- formWaterNodeModel.value = {
- nodeName: '',
- nodeType: null,
- }
- if (data?.isClassifition === 1) {
- window.$message.warning('该节点下不能创建子节点')
- addNodeModalCus.value = false
- return
- }
- {
- addNodeModalCus.value = true
- }
- } else if (key === 'add2') {
- addTreeNodeId.value = data?.primaryKeyId
- addTreeNodeOldId.value = data?.oldId
- addNodeLoading.value = false
- formDataNodeModel.value = {
- nodeName: '',
- nodeType: null,
- isClassifition: 0,
- className: '',
- unitName: '',
- unitNum: 1,
- excellentNum: 1,
- digitizeTime: '',
- }
- if (data?.isClassifition === 1) {
- window.$message.warning('该节点下不能创建子节点')
- addNodeModalData.value = false
- return
- } else {
- addNodeModalData.value = true
-
- }
- } else if (key === 'upload') {
- const info = nodeDataInfo.value
- HcUploadFileApi({
- url: '/api/blade-resource/oss/endpoint/put-file',
- accept: '.png,.jpg,jpeg',
- accept_tip: '图片(png、jpg、jpeg)',
- size: 80,
- multiple: false,
- echoParams: {
- drawingsId: info['drawingsId'],
- primaryKeyId: info['primaryKeyId'],
- },
- success: ({ echoParams }, { data }) => {
- setUploadDrawingsData(echoParams.sourceKey, data?.link)
- },
- error: () => {
- window.$message.error('上传失败')
- },
- })
- } else if (key === 'del') {
- console.log(data, 'data')
- if (
- data['colorStatus'] === 1
- || data['colorStatus'] === 2
- || data['colorStatus'] === null
- || data['colorStatus'] === -1
- ) {
- delModalClick()
- } else {
- window?.$message?.warning('该节点已存在上报数据,不允许删除')
- }
- } else if (key === 'sort') {
-
- let nodes = [],
- childNodes = []
- if (tabKey === 'tree') {
- childNodes
- = node?.parent?.childNodes || node?.parent?.children || []
- } else if (tabKey === 'map') {
- childNodes = node?.parentNodes?.childrenNodes || []
- }
- for (let i = 0; i < childNodes.length; i++) {
- const res = childNodes[i]?.data
- nodes.push({
- id: res?.primaryKeyId,
- title: res?.title,
- })
- }
- sortNodeData.value = nodes
- sortNodeModal.value = true
- } else if (key === 'nodetree') {
- divisionClick()
- }
- }
- //获取节点的路径名字
- const getPathName = (node, pathArr) => {
- if (node.parent?.parent) {
- pathArr.unshift(node.data?.title.replace(/(^\s*)|(\s*$)/g, '')) //去掉头尾空格
- getPathName(node.parent, pathArr)
- } else {
- //根节点结束
- pathArr.unshift(node.data?.title.replace(/(^\s*)|(\s*$)/g, '')) //去掉头尾空格
- return pathArr
- }
- }
- //确认标记为首件
- const firstItemBox = () => {
- const info = nodeDataInfo.value
- window?.$messageBox?.alert(
- `<div class="text-base font-bold">
- <span>请确认将</span>
- <span class="text-main">【${info['title']}】</span>
- <span>${info['isFirst'] ? '取消' : ''}标记为首件</span>
- </div>`,
- '标记首件制',
- {
- showCancelButton: true,
- dangerouslyUseHTMLString: true,
- callback: (action) => {
- if (action === 'confirm') {
- firstItemHttp(info)
- }
- },
- },
- )
- }
- //首件请求
- const firstItemHttp = async (info) => {
- const { error, code, msg } = await wbsApi.wbsTreeFirstSave({
- primaryKeyId: info['primaryKeyId'],
- saveOrDeleted: info['isFirst'] ? 1 : 0,
- })
- //处理数据
- if (!error && code === 200) {
- window?.$message?.success('操作成功')
- window?.location?.reload() //刷新页面
- }
- }
- //编辑节点
- const editNodeModal = ref(false)
- //获取节点类型
- const nodeTypeData = ref([])
- const getDictionaryApi = async () => {
- const { data } = await getDictionary({
- code: 'wbs_node_type',
- })
- //处理数据
- let newArr = []
- const newData = getArrValue(data)
- for (let i = 0; i < newData.length; i++) {
- newArr.push({
- label: newData[i]['dictValue'],
- value: Number(newData[i]['dictKey']),
- })
- }
- nodeTypeData.value = newArr
- }
- const formEditNodeRef = ref(null)
- const formEditNodeModel = ref({
- title: '',
- parent: {
- title: '',
- },
- nodeType: null,
- partitionCode: '',
- position: '',
- notExsitChild: '',
- })
- const formEditNodeRules = {
- title: {
- required: true,
- trigger: 'blur',
- message: '请输入节点名称',
- },
- }
- const editNodeLoading = ref(false)
- //保存编辑节点数据
- const editNodeClick = async () => {
- const validate = await formValidate(formEditNodeRef.value)
- if (validate) {
- //发起请求
- editNodeLoading.value = true
- const {
- primaryKeyId,
- title,
- partitionCode,
- className,
- unitName,
- excellentNum,
- unitNum,
- digitizeTime,
- majorDataType,
- nodeType,
- privateTemplate,
- } = formEditNodeModel.value
- const { error, code, msg } = await wbsApi.wbsTreeUpdateNode({
- nodeName: title || '',
- pKeyId: primaryKeyId || '',
- partitionCode: partitionCode || '',
- className,
- unitName,
- unitNum,
- excellentNum,
- digitizeTime,
- majorDataType,
- nodeType,
- privateTemplate,
- })
- //处理数据
- editNodeLoading.value = false
- if (!error && code === 200) {
- window?.$message?.success('修改成功')
- nodeDataInfo.value['title'] = title || ''
- nodeDataInfo.value['partitionCode'] = partitionCode || ''
- editNodeModal.value = false
- window?.location?.reload() //刷新页面
- }
- }
- }
- //复制节点
- const copyNodeModal = ref(false)
- //复制节点类型tab数据和相关处理
- const copyNodeTabKey = ref('')
- const copyNodeTab = ref([
- { key: '1', name: '单份复制' },
- { key: '2', name: '多份复制' },
- //{key: '3', name: '复制数据'}
- ])
- const copyNodeTabChange = (key) => {
- if (key !== copyNodeTabKey.value) {
- copyNodeTabKey.value = key
- copyNodeTable.value = []
- copyNodeLoading.value = false
- }
- }
- //复制节点变量
- const copyNodeLoading = ref(false)
- const formCopyNodeModel = ref({})
- const classifyList = ref([])
- const copyNodeTable = ref([])
- const isCopyData = ref(0)
- //复制树被点击
- const copyNodeElTreeClick = ({ data, node }) => {
- const TabKey = copyNodeTabKey.value
- const { title, type, partitionCode } = formCopyNodeModel.value
- console.log(formCopyNodeModel.value, 'formCopyNodeModel.value')
- console.log(data, '点击data')
- if (TabKey === '2') {
- // setCopyNodeTable(data, title, partitionCode)
- //1 单位工程,2 分部工程,3 子分部工程,4 分项工程, 5 子分项工程,6 工序
- // //不能复制到本身节点下
- // //只能往上一级点击,不能跨层级点击
- // //已上报的工序节点不能点击选择
- // //如果选择的是父级节点,那不能复制到子级节点
- const { hasChildren } = data
- if (hasChildren === 0) {
- if (
- data['colorStatus'] === 2
- || data['colorStatus'] == 1
- || data['colorStatus'] === null
- || data['colorStatus'] === -1
- ) {
- //已上报的工序不能点击
- if (data['id'] !== formCopyNodeModel.value.id) {
- //不能复制到本身节点下
- //只能往上一级点击,不能跨层级点击
- //如果选择的是父级节点,那不能复制到子级节点
- if (
- type === 6
- && (data['type'] === 4
- || data['type'] === 5
- || data['type'] == 6)
- ) {
- setCopyNodeTable(data, title)
- }
- if (type === 5 && data['type'] === 4) {
- setCopyNodeTable(data, title, partitionCode)
- }
- if (
- type === 4
- && (data['type'] === 2 || data['type'] === 3)
- ) {
- setCopyNodeTable(data, title, partitionCode)
- }
- if (type === 3 && data['type'] === 2) {
- setCopyNodeTable(data, title, partitionCode)
- }
- if (type === 2 && data['type'] === 1) {
- setCopyNodeTable(data, title, partitionCode)
- }
- if (type === 1 && data['type'] === 1) {
- setCopyNodeTable(data, title, partitionCode)
- }
- }
- } else {
- window?.$message?.warning('该节点已存在上报数据,不允许复制')
- }
- } else {
- if (data['id'] !== formCopyNodeModel.value.id) {
- //不能复制到本身节点下
- //只能往上一级点击,不能跨层级点击
- //如果选择的是父级节点,那不能复制到子级节点
- if (
- type === 6
- && (data['type'] === 4
- || data['type'] === 5
- || data['type'] == 6)
- ) {
- setCopyNodeTable(data, title)
- }
- if (type === 5 && data['type'] === 4) {
- setCopyNodeTable(data, title, partitionCode)
- }
- if (type === 4 && (data['type'] === 2 || data['type'] === 3)) {
- setCopyNodeTable(data, title, partitionCode)
- }
- if (type === 3 && data['type'] === 2) {
- setCopyNodeTable(data, title, partitionCode)
- }
- if (type === 2 && data['type'] === 1) {
- setCopyNodeTable(data, title, partitionCode)
- }
- if (type === 1 && data['type'] === 1) {
- setCopyNodeTable(data, title, partitionCode)
- }
- }
- }
- } else if (TabKey === '3') {
- console.log(1111111)
- setCopyNodeTable(data, data?.title)
- }
- }
- const setCopyNodeTable = (data, title) => {
- copyNodeTable.value.push({
- title: data?.title || '',
- nodeName: title || '',
- primaryKeyId: data?.primaryKeyId || '',
- parentId: data?.parentId || '',
- id: data?.id || '',
- })
- }
- //节点表单
- const formCopyNodeModelRef = ref(null)
- const formCopyNodeModelRules = {
- title: {
- required: true,
- trigger: 'blur',
- message: '请输入节点名称',
- },
- }
- //表格节点表单
- const copyNodeTableRef = ref(null)
- const copyNodeTableRules = {
- nodeName: {
- required: true,
- trigger: 'blur',
- message: '请输入节点名称',
- },
- }
- //删除选中的节点
- const copyNodeTableDel = (index) => {
- copyNodeTable.value.splice(index, 1)
- }
- const classifyType = ref(authBtnTabKey.value)
- //复制节点
- const copyNodeClick = async () => {
- const type = copyNodeTabKey.value
- const form = formCopyNodeModel.value
- const table = copyNodeTable.value
- let classify = ''
- let arr = []
- if (classifyList.value.length > 0) {
- classifyList.value.forEach((item) => {
- if (item === '施工') {
- arr.push(1)
- } else if (item === '监理') {
- arr.push(2)
- }
- })
- classify = arr.join(',')
- }
- //isSameNode 是否同节点 1=同节点,0=跨节点
- if (table.length > 0) {
- table.forEach((ele) => {
- if (
- ele.parentId === formCopyNodeModel.value.parentId
- || ele.id === formCopyNodeModel.value.parentId
- ) {
- ele.isSameNode = 1
- } else {
- ele.isSameNode = 0
- }
- })
- }
- if (isCopyData.value === 1) {
- if (classify) {
- //效验数据
- if (type === '1') {
- const validate = await formValidate(formCopyNodeModelRef.value)
- if (validate)
- await copyContractTreeNode(type, form, [], classify)
- } else if (type === '2') {
- if (table.length > 0) {
- const validate = await formValidate(copyNodeTableRef.value)
- if (validate)
- await copyContractTreeNode(type, form, table, classify)
- } else {
- window?.$message?.warning('请先在左侧选择要复制到的节点')
- }
- }
- } else {
- window?.$message?.warning('请选择所属方')
- }
- } else {
- if (type === '1') {
- const validate = await formValidate(formCopyNodeModelRef.value)
- if (validate) await copyContractTreeNode(type, form, [], classify)
- } else if (type === '2') {
- if (table.length > 0) {
- const validate = await formValidate(copyNodeTableRef.value)
- if (validate)
- await copyContractTreeNode(type, form, table, classify)
- } else {
- window?.$message?.warning('请先在左侧选择要复制到的节点')
- }
- }
- }
- }
- //单个复制、多份复制请求
- const copyContractTreeNode = async (type, form, table, classify) => {
- copyNodeLoading.value = true
- if (type === '1') {
- const { error, code, msg } = await wbsApi.copyContractTreeNode({
- copyType: type,
- needCopyNodeName: form?.title || '',
- partitionCode: form?.partitionCode || '',
- needCopyPrimaryKeyId: form?.primaryKeyId || '',
- parentPrimaryKeyId: form?.parent?.primaryKeyId || '',
- copyBatchToPaths: table,
- classifyType: classify,
- isCopyData: isCopyData.value,
- })
- //判断状态
- copyNodeLoading.value = false
- if (!error && code === 200) {
- window?.$message?.success('复制成功')
- copyNodeModal.value = false
- window?.location?.reload() //刷新页面
- }
- } else {
- const { error, code, msg } = await wbsApi.copyContractTreeNode({
- copyType: type,
- needCopyNodeName: form?.title || '',
- needCopyPrimaryKeyId: form?.primaryKeyId || '',
- parentPrimaryKeyId: form?.parent?.primaryKeyId || '',
- copyBatchToPaths: table,
- classifyType: classify,
- isCopyData: isCopyData.value,
- })
- //判断状态
- copyNodeLoading.value = false
- if (!error && code === 200) {
- window?.$message?.success('复制成功')
- copyNodeModal.value = false
- window?.location?.reload() //刷新页面
- }
- }
- }
- //新增节点
- const addNodeModal = ref(false)
- const addTreeNodeId = ref('')
- const addTreeNodeOldId = ref('')
- //const addTreeNodeType = ref('1')
- const addTreeNodeType = ref('1')
- const isCustom = ref(null)
- //新增自定义节点
- const addNodeModalCus = ref(false)
- const addNodeLoadingCus = ref(false)
- //水利工程
- const formWaterNodeRef = ref(null)
- const formWaterNodeModel = ref({
- nodeName: '',
- nodeType: null,
- })
- const formWaterNodeRules = {
- nodeName: {
- required: true,
- trigger: 'blur',
- message: '请输入节点名称',
- },
- nodeType: {
- required: true,
- trigger: 'blur',
- message: '请选择节点类型',
- },
- }
- //新增自定义节点-数字化文件
- const addNodeModalData = ref(false)
- const addNodeLoadingData = ref(false)
- const formDataNodeRef = ref(null)
- const formDataNodeModel = ref({
- nodeName: '',
- nodeType: null,
- isClassifition: 0,
- className: '',
- unitName: '',
- unitNum: 1,
- excellentNum: 1,
- majorDataType: '',
- digitizeTime: '',
- })
- const majorDataTypeOptions = ref([])
- const getMajorDataTypeOptions = async () => {
- majorDataTypeOptions.value = await getDictionaryData('major_data_type', false)
- }
- const standardTypeOptions = ref([])
- const getStandardTypeOptions = async () => {
- const { data } = await getDictionary({
- code: 'classification',
- })
- standardTypeOptions.value = await getDictionaryData(
- 'classification',
- false,
- )
- standardTypeOptions.value.forEach((element) => {
- // element.parentId=
- data.forEach((ele) => {
- if (ele.dictKey == element.value) {
- element.id = ele.id
- }
- })
- })
- // 定义要过滤的 dictKey 值
- const targetKeys = [1, 2, 3, 4, 5]
- // 过滤数组
- standardTypeOptions.value = standardTypeOptions.value.filter((item) =>
- targetKeys.includes(item.value),
- )
- }
- const unitNameOptions = ref([])
- const changeStandType = async (val) => {
- if (val !== orString.value) {
- formEditNodeModel.value.unitName = ''
- }
- formDataNodeModel.value.unitName = ''
- let parentId = ''
- standardTypeOptions.value.forEach((item) => {
- if (item.value == val) {
- parentId = item.id
- }
- })
- const { data } = await getChildList({ current: 1, size: 10000, parentId })
- unitNameOptions.value = data
- unitNameOptions.value = unitNameOptions.value.filter(
- (item) => item.dictKey != -1,
- )
- unitNameOptions.value.forEach((ele) => {
- ele.dictKey = Number(ele.dictKey)
- })
- }
- const formDataNodeRules = {
- nodeName: {
- required: true,
- trigger: 'blur',
- message: '请输入节点名称',
- },
- nodeType: {
- required: true,
- trigger: 'blur',
- message: '请选择节点类型',
- },
- isClassifition: {
- required: true,
- trigger: 'blur',
- message: '请选择是否含单元评定',
- },
- className: {
- required: true,
- trigger: 'blur',
- message: '请选择标准分类',
- },
- unitName: {
- required: true,
- trigger: 'blur',
- message: '请选择单位名称',
- },
- excellentNum: {
- required: true,
- trigger: 'blur',
- message: '请输入优良个数',
- },
- unitNum: {
- required: true,
- trigger: 'blur',
- message: '请输入单元个数',
- },
- digitizeTime: {
- required: true,
- trigger: 'blur',
- message: '请选择时间',
- },
- majorDataType:{
- required: true,
- trigger: 'blur',
- message: '请选择内业资料类型',
- },
- }
- const addNodeClickData = async () => {
- const validate = await formValidate(formDataNodeRef.value)
- if (!validate) return
- //发起请求
- addNodeClickData.value = true
- const { error, code, msg } = await wbsApi.saveCustomAddContractNode({
- nodeName: formDataNodeModel.value.nodeName,
- nodeType: formDataNodeModel.value?.nodeType || '',
- partitionCode: nodeDataInfo.value?.partitionCode || '',
- primaryKeyId: nodeDataInfo.value?.primaryKeyId || '',
- nodeClass: 2, //数字化文件
- isClassifition: formDataNodeModel.value?.isClassifition || 0,
- className: formDataNodeModel.value?.className || '',
- unitName: Number(formDataNodeModel.value?.unitName) || '',
- excellentNum: formDataNodeModel.value?.excellentNum || 0,
- digitizeTime: formDataNodeModel.value?.digitizeTime || '',
- unitNum: formDataNodeModel.value?.unitNum || 0,
- majorDataType: formDataNodeModel.value?.majorDataType || '',
- templateType:useAppState.contractInfo?.templateType,
-
- })
- //判断状态
- addNodeClickData.value = false
- if (!error && code === 200) {
- window?.$message?.success('新增成功')
- addNodeModalData.value = false
- window?.location?.reload() //刷新页面
- }
- }
- //选中的节点
- const allSelectedList = ref([])
- const halfSelectedList = ref([])
- const addTreeNodeCheckChange = (nodes) => {
- let NodesArr = [],
- halfArr = []
- //全选数据
- const keys = nodes.checkedNodes || []
- for (let i = 0; i < keys.length; i++) {
- NodesArr.push({
- nodeName: keys[i].nodeName,
- primaryKeyId: keys[i].pKeyId,
- isPeer: keys[i].isPeer || 2,
- })
- }
- allSelectedList.value = NodesArr
- //半选数据
- const halfNodes = nodes.halfCheckedNodes || []
- for (let i = 0; i < halfNodes.length; i++) {
- halfArr.push({
- nodeName: halfNodes[i].nodeName,
- primaryKeyId: halfNodes[i].pKeyId,
- isPeer: halfNodes[i].isPeer || 2,
- })
- }
- halfSelectedList.value = halfArr
-
- }
- //新增节点
- const addNodeLoading = ref(false)
- const addNodeClick = async () => {
- const keys = allSelectedList.value || []
- if (keys.length <= 0) {
- window?.$message?.warning('请先选择节点')
- } else {
- //发起请求
- addNodeLoading.value = true
- const primaryKeyId = nodeDataInfo.value?.primaryKeyId || ''
- const { error, code } = await wbsApi.saveContractTreeNode({
- projectId: projectId.value,
- contractId: contractId.value,
- saveType: addTreeNodeType.value,
- allSelectedList: allSelectedList.value,
- halfSelectedList: halfSelectedList.value,
- currentNodePrimaryKeyId: primaryKeyId,
- templateType:useAppState.contractInfo?.templateType,
-
- })
- //判断状态
- addNodeLoading.value = false
- if (!error && code === 200) {
- window?.$message?.success('新增成功')
- addNodeModal.value = false
- window?.location?.reload() //刷新页面
- }
- }
- }
- const addNodeClickCur = async () => {
- const validate = await formValidate(formWaterNodeRef.value)
- if (!validate) return
- //发起请求
- addNodeLoadingCus.value = true
- const { error, code, msg } = await wbsApi.saveCustomAddContractNode({
- nodeName: formWaterNodeModel.value.nodeName,
- nodeType: formWaterNodeModel.value?.nodeType || '',
- newPartitionCode:formWaterNodeModel.value?.number || '',
- partitionCode: nodeDataInfo.value?.partitionCode || '',
- primaryKeyId: nodeDataInfo.value?.primaryKeyId || '',
- nodeClass: 1, //1水利化工程,2数字化文件
- templateType:useAppState.contractInfo?.templateType,
- })
- //判断状态
- addNodeLoadingCus.value = false
- if (!error && code === 200) {
- window?.$message?.success('新增成功')
- addNodeModalCus.value = false
- window?.location?.reload() //刷新页面
- } else {
- window?.$message?.error(msg || '操作失败')
- }
- }
- //删除节点
- const delModalClick = async () => {
- const { code, msg } = await wbsApi.removeContractTreeNodeJudge({
- ids: nodeDataInfo.value?.primaryKeyId || '',
- })
- if (code === 200) {
- HcDelMsg(async (resolve) => {
- await removeContractTreeNode()
- resolve() //关闭弹窗的回调
- })
- } else {
- NewDelMsg({ text: msg }, async (resolve) => {
- await removeContractTreeNode()
- resolve() //关闭弹窗的回调
- })
- }
- }
- const removeContractTreeNode = async () => {
- const loadingInstance = window.$loading.service({
- fullscreen: true,
- text: '删除节点中,请耐心等待...',
- background: 'rgba(0, 0, 0, 0.7)',
- })
- const { error, code, msg } = await wbsApi.removeContractTreeNode({
- ids: nodeDataInfo.value?.primaryKeyId || '',
- })
- //处理结果
- loadingInstance.close()
- if (!error && code === 200) {
- window?.$message?.success('删除成功')
- window?.location?.reload() //刷新页面
- } else {
- window.$message.error(msg)
- }
- }
- //调整排序
- const sortNodeModal = ref(false)
- const sortNodeLoading = ref(false)
- const sortNodeData = ref([])
- const sortNodeDrag = ref(false)
- //向下
- const downSortClick = (index) => {
- const indexs = index + 1
- const data = sortNodeData.value || []
- if (indexs !== data.length) {
- const tmp = data.splice(indexs, 1)
- sortNodeData.value.splice(index, 0, tmp[0])
- } else {
- window?.$message?.warning('已经处于置底,无法下移')
- }
- }
- //向上
- const upSortClick = (index) => {
- const data = sortNodeData.value || []
- if (index !== 0) {
- const tmp = data.splice(index - 1, 1)
- sortNodeData.value.splice(index, 0, tmp[0])
- } else {
- window?.$message?.warning('已经处于置顶,无法上移')
- }
- }
- //确认排序
- const sortNodeClick = async () => {
- const sortList = []
- const nodes = sortNodeData.value || []
- nodes.forEach((item) => {
- sortList.push(item?.id)
- })
- //发起请求
- sortNodeLoading.value = true
- const { error, code, msg } = await wbsApi.diySortTreeNode({ sortList })
- sortNodeLoading.value = false
- //判断状态
- if (!error && code === 200) {
- window?.$message?.success('保存成功')
- sortNodeModal.value = false
- window?.location?.reload() //刷新页面
- } else {
- window.$message.error(msg)
- }
- }
- //查看图纸
- const drawList = ref('')
- const drawingsShow = ref(false)
- const viewsDrawings = () => {
- const { primaryKeyId, drawingsId } = nodeDataInfo.value
- if (!primaryKeyId) {
- window?.$message?.warning('请先选择树节点')
- } else if (drawingsId === -1 || drawingsId === null) {
- window?.$message?.warning('该节点暂未上传图纸')
- } else {
- drawingsShow.value = true
- getDrawList(drawingsId)
- }
- }
- const drawingsClose = (res) => {
- drawingsShow.value = res
- }
- const getDrawList = async (primaryKeyId) => {
- const { error, code, data } = await wbsApi.getTreeDrawings({
- primaryKeyId,
- })
- //判断状态
- if (!error && code === 200) {
- drawList.value = data
- } else {
- drawList.value = data
- }
- }
- //设置滚动条位置
- const ListItemScrollRef = ref(null)
- const ListItemOffsetTop = (offsetTop) => {
- if (offsetTop > 0) {
- setTimeout(() => {
- ListItemScrollRef.value?.setScrollTop(offsetTop)
- }, 350)
- } else {
- ListItemScrollRef.value?.setScrollTop(offsetTop)
- }
- }
- //获取数据列表
- const ListItemDatas = ref([])
- const ListItemLoading = ref(false)
- const searchNodeAllTable = async () => {
- ListItemLoading.value = true
- ListItemDatas.value = []
- const info = nodeDataInfo.value
- const { data } = await wbsApi.searchNodeAllTable({
- projectId: projectId.value,
- contractId: contractId.value,
- primaryKeyId: info['primaryKeyId'],
- type: authBtnTabKey.value,
- })
- ListItemDatas.value = getArrValue(data)
-
- ListItemLoading.value = false
- }
- //获取文件题名
- const getFileName = async () => {
- const info = nodeDataInfo.value
- const { error, code, data } = await wbsApi.getDICengNodeName({
- pKeyId: info['primaryKeyId'],
- classify: authBtnTabKey.value,
- contractId: contractId.value,
- })
- //判断状态
- if (!error && code === 200) {
- titleInput.value = data
- } else {
- titleInput.value = data
- }
- }
- const newlistdata = ref([])
- const searchNodeAllTable1 = async () => {
- console.log('重新获取表单列表')
- const info = nodeDataInfo.value
- const { data } = await wbsApi.searchNodeAllTable({
- projectId: projectId.value,
- contractId: contractId.value,
- primaryKeyId: info['primaryKeyId'],
- type: authBtnTabKey.value,
- })
- newlistdata.value = getArrValue(data)
- }
- //查询状态
- const NodeStatus = ref('1')
- const queryNodeStatus = async () => {
- const info = nodeDataInfo.value
- if (contractInfo.value?.contractType == 1) {
- const { error, code, data } = await wbsApi.queryNodeStatus({
- primaryKeyId: info['primaryKeyId'],
- //classify:1
- classify: authBtnTabKey.value,
- })
- //1 未填报,2待上报,3已上报
- if (!error && code === 200) {
- NodeStatus.value = data ?? '1'
- } else {
- NodeStatus.value = '1'
- }
- } else {
- const { error, code, data } = await wbsApi.queryNodeStatusJl({
- // primaryKeyId: info['contractIdRelation'] ? info['id'] : info['primaryKeyId'],
- primaryKeyId: info['primaryKeyId'],
- //classify: 1
- classify: authBtnTabKey.value,
- })
- //1 未填报,2待上报,3已上报
- if (!error && code === 200) {
- NodeStatus.value = data ?? '1'
- } else {
- NodeStatus.value = '1'
- }
- }
- }
- //批量上报
- const reportIds = ref('')
- const reportTaskName = ref('')
- const reportAddition = ref({})
- const showReportModal = ref(false)
- const reportLoading = ref(false)
- const reportTypeData = ref([])
- const reportModalClick = async () => {
- const info = nodeDataInfo.value
- const rows = ListItemDatas.value
- if (rows.length > 0) {
- reportLoading.value = true
- const taskCheck = await eVisaTaskCheckApi({
- projectId: projectId.value,
- contractId:
- contractInfo.value?.contractType == 2
- ? info?.contractIdRelation
- : contractId.value,
- // contractId: contractId.value
- })
- //处理数据
- let newArr = []
- for (let i = 0; i < rows.length; i++) {
- newArr.push(rows[i]['isTypePrivatePid'])
- }
- reportTypeData.value = newArr
- reportLoading.value = false
- if (taskCheck) {
- //初始弹出弹窗,防呆
- reportIds.value = info['primaryKeyId']
- reportAddition.value = {
- classify: authBtnTabKey.value,
- contractIdRelation: info['contractIdRelation'],
- }
- showReportModal.value = true
- //请求文件题名
- const { data } = await wbsApi.queryDocumentTitle({
- primaryKeyId: info['primaryKeyId'],
- classify: authBtnTabKey.value,
- })
- reportTaskName.value = isString(data) ? data : ''
- }
- } else {
- window.$message?.warning('暂无相关数据')
- }
- }
- //上报完成
- const showReportFinish = () => {
- showReportModal.value = false
- getTableDataAll()
- window?.location?.reload() //刷新页面
- }
- //表单变量
- const ListItemRef = ref(null)
- const ListItemsRef = ref(null)
- //保存
- const tableFormSaveLoading = ref(false)
- const tableFormSaveClick = async () => {
- //获取数据
- let FormData = [],
- FormRegExpJson = {}
- if (isDrawer.value) {
- FormData = await ListItemsRef.value?.getFormData()
- FormRegExpJson = await ListItemsRef.value?.getFormRegExpJson()
- } else {
- FormData = await ListItemRef.value?.getFormData()
- FormRegExpJson = await ListItemRef.value?.getFormRegExpJson()
- }
- //效验数据
- if (getObjVal(FormRegExpJson)) {
- setFormRegExpJson(FormRegExpJson)
- } else if (FormData.length > 0) {
- console.log('保存')
- tableFormSaveLoading.value = true
- console.log('FormData', FormData)
- const { error, code, msg, data } = await wbsApi.saveExcelBussData({
- dataInfo: { orderList: FormData },
- })
- tableFormSaveLoading.value = false
- if (!error && code === 200) {
- window?.$message?.success('保存成功')
- // await bussPdfsClick()
- const activeKey = ListItemRef.value?.getActiveKey()
- getTableDataAll(activeKey)
- } else {
- window?.$message?.error(msg || '操作失败')
- }
- } else {
- console.log('预览')
- // await bussPdfsClick()
- }
- }
- //效验数据
- const setFormRegExpJson = (FormRegExpJson) => {
- let nodeName = '',
- itemId = ''
- Object.keys(FormRegExpJson).forEach((key) => {
- const name = FormRegExpJson[key]?.nodeName ?? ''
- if (name) {
- if (nodeName) {
- nodeName += ',' + name
- } else {
- nodeName = name
- itemId = FormRegExpJson[key]?.itemId
- }
- }
- })
- //const activeKey = ListItemRef.value?.getActiveKey()
- //弹出提示
- const val
- = '<div style="font-size: 16px;">请先完善 <span style="color:#1ECC95;">'
- + nodeName
- + '</span> 的数据内容</div>'
- window?.$messageBox?.alert(val, '表单完善提醒', {
- confirmButtonText: '确定',
- dangerouslyUseHTMLString: true,
- callback: (action) => {
- if (action === 'confirm') {
- ListItemRef.value?.setActiveKey(itemId)
- ListItemOffsetTop(0)
- setTimeout(() => {
- const offsetTop
- = document.getElementById(itemId)?.offsetTop
- ListItemOffsetTop(offsetTop)
- }, 350)
- }
- },
- })
- }
- //多表预览
- const bussPdfsLoading = ref(false)
- const bussPdfsClick = async () => {
- const info = nodeDataInfo.value
- bussPdfsLoading.value = true
- const { error, code, data } = await wbsApi.getBussPdfs({
- nodeId: info?.primaryKeyId || '',
- classify: authBtnTabKey.value,
- projectId: projectId.value,
- // contractId: contractId.value
- contractId:
- contractInfo.value?.contractType == 2
- ? info?.contractIdRelation
- : contractId.value,
- })
- tableFormSaveLoading.value = false
- bussPdfsLoading.value = false
- if (!error && code === 200) {
- toPdfPage(data)
- //window.open(data, '_blank')
- } else {
- window.$message?.warning('获取PDF失败')
- }
- }
- //撤回上报流程
- const abolishLoaing = ref(false)
- const abolishOneClick = () => {
- window?.$messageBox?.alert('请谨慎考虑后,是否确定撤回?', '撤回上报', {
- showCancelButton: true,
- confirmButtonText: '确定撤回',
- cancelButtonText: '取消',
- callback: (action) => {
- if (action === 'confirm') {
- abolishOneSave()
- }
- },
- })
- }
- //撤回请求
- const abolishOneSave = async () => {
- const info = nodeDataInfo.value
- abolishLoaing.value = true
- const { error, code } = await wbsApi.abolishOne({
- primaryKeyId: info?.primaryKeyId || '',
- classify: authBtnTabKey.value,
- projectId: projectId.value,
- contractId: contractId.value,
- })
- abolishLoaing.value = false
- if (!error && code === 200) {
- window.$message?.success('撤回成功')
- getTableDataAll()
- window?.location?.reload() //刷新页面
- }
- }
- //附件列表
- const attachmentModal = ref(false)
- const attachmentModalShow = () => {
- attachmentModal.value = true
- initSortable()
- getAttachmentList()
- }
- const attachmentListLoaing = ref(false)
- const attachmentList = ref([])
- const getAttachmentList = async () => {
- attachmentListLoaing.value = true
- const info = nodeDataInfo.value
- const { error, code, data } = await wbsApi.tablesAndFile({
- primaryKeyId: info?.primaryKeyId || '',
- type: authBtnTabKey.value,
- contractId: contractId.value,
- projectId: projectId.value,
- classify: authBtnTabKey.value,
- })
- attachmentListLoaing.value = false
- if (!error && code === 200) {
- attachmentList.value = getArrValue(data)
- } else {
- attachmentList.value = []
- }
- }
- // 新增拖拽相关代码
- const attachmentListRefs = ref([])
- const setAttachmentListRef = (el) => {
- if (el) {
- attachmentListRefs.value.push(el)
- }
- }
- // 初始化拖拽排序
- const initSortable = () => {
- nextTick(() => {
- attachmentListRefs.value.forEach((el, index) => {
- new Sortable(el, {
- animation: 150,
- ghostClass: 'sortable-ghost',
- handle: '.hc-attachment-item', // 整个条目可拖拽
- onEnd: (evt) => {
- const { oldIndex, newIndex } = evt
- if (oldIndex !== newIndex) {
- // 更新对应节点的文件顺序
- const node = attachmentList.value[index]
- const [movedItem] = node.fileList.splice(oldIndex, 1)
- node.fileList.splice(newIndex, 0, movedItem)
-
- // // 这里可以调用API保存新的顺序
-
- }
- },
- })
- })
- })
- }
- // 保存文件顺序到后端
- const saveFileOrderLoad = ref(false)
- const saveFileOrder = async () => {
- saveFileOrderLoad.value = true
-
- const { error, code, msg } = await wbsApi.sortPdf( attachmentList.value)
- saveFileOrderLoad.value = false
- if (!error && code === 200) {
- window?.$message?.success(msg)
- getAttachmentList()
- initSortable()
- }
- }
- // 监听attachmentList变化时初始化拖拽
- watch(() => attachmentList.value, () => {
- initSortable()
- }, { deep: true })
- //预览
- const previewFile = (item) => {
- toPdfPage(item['domainPdfUrl'])
- //window.open(item['domainPdfUrl'], '_blank')
- }
- //删除
- const delFile = async (item) => {
- item.loading = true
- const { error, code, msg } = await wbsApi.removeBussFile({
- ids: item.id,
- })
- item.loading = false
- if (!error && code === 200) {
- window?.$message?.success('删除成功')
- getAttachmentList()
- getTableDataAll()
- return true
- } else {
- window.$message.error(msg)
- return false
- }
- }
- //划分变更
- const divisionClick = () => {
- router.push({
- path: '/data-fill/division',
- })
- }
- //树展开和收起
- const isWbsTreeShow = ref(true)
- const setWbsTreeShow = () => {
- isWbsTreeShow.value = !isWbsTreeShow.value
- }
- //拷贝内容
- const copyPositionText = (val) => {
- if (val) {
- //navigator.clipboard.writeText(val);
- setCopyText(val)
- .then(() => {
- window.$message?.success('复制成功')
- })
- .catch(() => {
- window.$message?.error('复制失败,请手动复制')
- })
- } else {
- window.$message?.warning('没有可复制的数据')
- }
- }
- //左右拖动,改变树形结构宽度
- const isMouseTree = ref(false)
- const onmousedown = () => {
- let leftNum = 0
- if (isLayout.value === 'no') {
- leftNum = 0
- } else {
- leftNum = isCollapse.value ? 142 : 272
- }
- isMouseTree.value = true
- document.onmousemove = async (ve) => {
- let diffVal = ve.clientX - leftNum
- if (diffVal >= 310 && diffVal <= 900) {
- leftWidth.value = diffVal
- }
- }
- document.onmouseup = () => {
- document.onmousemove = null
- document.onmouseup = null
- isMouseTree.value = false
- }
- }
- //更新配置
- watch(
- () => leftWidth.value,
- (diffVal) => {
- setUserConfig(diffVal)
- },
- )
- const setUserConfig = async (data) => {
- await useClick()
- useAppState.setTreeWidth(data)
- await userConfigSave({ treeWidth: data })
- }
- //同步质检资料
- const syncdataloading = ref(false)
- const syncdata = async () => {
- ListItemRef.value?.setActiveKey('')
- const info = nodeDataInfo.value
- syncdataloading.value = true
- const { error, code, msg } = await wbsApi.syncTbadata({
- pKeyId: info?.primaryKeyId || '',
- })
- syncdataloading.value = false
- if (!error && code === 200) {
- window.$message?.success(msg)
- getTableDataAll()
- // window?.location?.reload() //刷新页面
- }
- }
- //同步工序资料
- const syncWorkloading = ref(false)
- const syncWork = async () => {
- ListItemRef.value?.setActiveKey('')
- const info = nodeDataInfo.value
- syncdataloading.value = true
- const { error, code, msg } = await wbsApi.syncWorkDate({
- nodeId: info?.primaryKeyId || '',
- })
- syncdataloading.value = false
- if (!error && code === 200) {
- window.$message?.success(msg)
- getTableDataAll()
- // window?.location?.reload() //刷新页面
- }
- }
- //附件添加
- const typeoptions = ref([
- {
- value: '1',
- label: '模板1',
- },
- {
- value: '2',
- label: '模板2',
- },
- ])
- const getFileTypeApi = async () => {
- const { data } = await getDictionaryBiz({
- code: 'table_file_type',
- })
- //处理数据
- let newArr = []
- const newData = getArrValue(data)
- for (let i = 0; i < newData.length; i++) {
- newArr.push({
- label: newData[i]['dictValue'],
- value: Number(newData[i]['dictKey']),
- })
- }
- typeoptions.value = newArr
- }
- const typevalue = ref('')
- const isCanadd = ref(true)
- const uploadModal = ref(false)
- const fileListData = ref([])
- const uploadData = ref({})
- const uploadModalClose = () => {
- uploadModal.value = false
- typevalue.value = ''
- }
- //获取附件添加列表
- const getBussFileList = async (pkeyId) => {
- const { error, code, data } = await wbsApi.selectTableFileListByTen({
- pkeyid: pkeyId,
- classify: authBtnTabKey.value,
- })
- if (!error && code === 200) {
- fileListData.value = getArrValue(data)
- } else {
- fileListData.value = []
- }
- }
- const addFilelist = async () => {
- getBussFileList(primaryKeyId.value)
- uploadModal.value = true
- await getFileTypeApi()
- //上传的配置
- uploadData.value = {
- classify: authBtnTabKey.value,
- nodeId: primaryKeyId.value,
- type: typevalue.value,
- contractId: contractId.value,
- }
- }
- const changeType = (val) => {
- uploadData.value.type = val
- }
- //上传文件
- const uploadChange = async ({ type }) => {
- if (type === 'success') {
- getBussFileList(primaryKeyId.value)
- } else if (type === 'del') {
- getBussFileList(primaryKeyId.value)
- }
- }
- //树节点被选中
- const treeSelectNode = ref([])
- const treeSelectdata = ref([])
- const ElTreeNodeCheck = (_, { checkedKeys, checkedNodes }) => {
- console.log(checkedNodes, 'checkedNodes')
- treeSelectNode.value = getArrValue(checkedKeys)
- treeSelectdata.value = getArrValue(checkedNodes)
- }
- //隐藏节点
- const hideSaveLoading = ref(false)
- const hideTreeNode = async () => {
- const arr = getArrValue(treeSelectdata.value)
- if (arr.length <= 0) {
- window?.$message?.warning('请先在左侧项目树选择节点')
- return
- }
- let isExist = false
- for (let i = 0; i < arr.length; i++) {
- if ([3, 4].includes(arr[i].colorStatus)) {
- isExist = true
- break
- }
- }
- if (isExist) {
- window.$message.warning('已审批”、“已填报-待审批”的节点不允许隐藏;')
- return
- }
- const keys = arrToKey(treeSelectdata.value, 'pKeyId', ',')
- //发起请求
- hideSaveLoading.value = true
- const { error, code, msg } = await wbsApi.updateNodeStates(
- {
- ids: keys,
- status: 2,
- },
- false,
- )
- hideSaveLoading.value = false
- if (!error && code === 200) {
- window?.$message?.success(msg || '操作成功')
- setTimeout(() => {
- window?.location?.reload() //刷新页面
- }, 1000)
- }
- }
- const loadMenu = ({ node, item, level }, resolve) => {
- setElTreeMenu(contractInfo.value?.contractType)
- let menusArr = ElTreeMenu.value
- if (level === 1) {
- menusArr = [
- {
- icon: 'add-circle',
- label: '自定义节点(水利工程)',
- key: 'add1',
- },
- {
- icon: 'add-circle',
- label: '自定义节点(数字化文件)',
- key: 'add2',
- },
- ]
- resolve(menusArr)
- } else {
- resolve(menusArr)
- }
- }
- //批量保存
- const nodeSaveLoading = ref(false)
- const NodeSaveClick = async () => {
- const keys = treeSelectNode.value
- const rows = treeSelectdata.value
- if (rows.length <= 0 || keys.length <= 0) {
- window?.$message?.warning('请先在左侧项目树选择节点')
- return
- }
- //判断是否满足条件
- let result = false
- if (!website.localModel) {
- result = rows.every(({ colorStatus }) => {
- return colorStatus === 1 || colorStatus === 2
- })
- } else {
- //183 甬台温
- result = rows.every(({ colorStatus }) => {
- return colorStatus === 1 || colorStatus === 2 || colorStatus === 4
- })
- }
- if (!result) {
- window?.$message?.warning('只能选择未上报的节点进行辅助保存')
- return
- }
- //发起请求
- nodeSaveLoading.value = true
- const { error, code, msg } = await wbsApi.save_nodeId(
- {
- projectId: projectId.value,
- contractId: contractId.value,
- classify: authBtnTabKey.value,
- nodeIds: keys.join(),
- },
- false,
- )
- nodeSaveLoading.value = false
- if (!error && code === 200) {
- window?.$message?.success('批量保存成功')
- window?.location?.reload() //刷新页面
- }
- }
- //排序
- const tableSortFormRef = ref(null)
- const sortFormShow = ref(false)
- const tableSortFormColumn = [{ key: 'nodeName', name: '名称' }]
- const tableSortFormData = ref([])
- const sortFormClick = () => {
- sortFormShow.value = true
- tableSortFormData.value = deepClone(ListItemDatas.value)
- }
- // 行拖拽
- const sortFormDropTap = (rows) => {
- tableSortFormData.value = [] // 先清空,否则排序会异常
- nextTick(() => {
- tableSortFormRef.value?.setData(rows)
- })
- }
- // 点击排序
- const rowSortFormTap = (rows) => {
- tableSortFormData.value = [] // 先清空,否则排序会异常
- nextTick(() => {
- tableSortFormData.value = rows
- })
- }
- //关闭排序
- const sortFormClose = () => {
- sortFormShow.value = false
- sortFormLoading.value = false
- tableSortFormData.value = []
- }
- //提交排序
- const sortFormLoading = ref(false)
- const sortFormSubmit = async () => {
- const treeId = primaryKeyId.value
- if (isNullES(treeId)) {
- window?.$message?.warning('请先在左侧项目树选择一个节点')
- return
- }
- const rows = tableSortFormData.value
- const ids = arrToKey(rows, 'pkeyId')
- //发起请求
- sortFormLoading.value = true
- const { error, code, msg } = await wbsApi.formTableSort(
- {
- projectId: projectId.value,
- contractId: contractId.value,
- classify: authBtnTabKey.value,
- nodeIds: treeId,
- ids: ids,
- },
- false,
- )
- sortFormLoading.value = false
- if (!error && code === 200) {
- window?.$message?.success('操作成功')
- window?.location?.reload() //刷新页面
- }
- }
- //文件题名
- const titleInput = ref('')
- //节点基础数据
- const nodeBaseDataModalDialog = ref(false)
- const nodeBaseDataClick = async ()=>{
- await nextTick()
- await getnodeBaseData()
- nodeBaseDataModalDialog.value = true
- }
- const nodeBaseDataLoad = ref(false)
- const getnodeBaseData = async ()=>{
-
- const { error, code, msg, data } = await nodeBaseApi.getNodeData(
- {
- pKeyId: primaryKeyId.value,
- },
- )
- if (!error && code === 200) {
-
- autoFormData.value = getObjValue(data)
- }
- }
- const getOrSaveNodeBaseInfo = async ()=>{
-
- const { error, code, msg, data } = await nodeBaseApi.getOrSaveNodeBaseInfo(
- {
- pKeyId: primaryKeyId.value,
- },
- )
- if (!error && code === 200) {
- console.log(data, 'data')
- autoFormData.value = getObjValue(data)
- window?.$message?.success(msg)
- }
- }
- const nodeBaseDataModalClose = ()=>{
- nodeBaseDataModalDialog.value = false
- }
- const autoFormData = ref(
- {
- unit: '',
- subUnit: '',
- division: '',
- subDivision: '',
- subItem: '',
- item: '',
- processes: '',
- },
- )
- const resetForm = ()=>{
- getOrSaveNodeBaseInfo()
- }
- const nodeBaseDataModalSave = async ()=>{
- nodeBaseDataLoad.value = true
- const { error, code, msg } = await nodeBaseApi.save(
- {
- nodeId: primaryKeyId.value,
- ...autoFormData.value,
- },
- )
- nodeBaseDataLoad.value = false
- if (!error && code === 200) {
- window?.$message?.success(msg || '操作成功')
- nodeBaseDataModalDialog.value = false
- //刷新页面
- // setTimeout(() => {
- // window?.location?.reload()
- // }, 1000)
- const activeKey = ListItemRef.value?.getActiveKey()
- getTableDataAll(activeKey)
-
- }
- }
- </script>
- <style lang="scss" scoped>
- @import "../../styles/data-fill/wbs.scss";
- .title-input{
- height: 30px;
- padding: 10px;
- border: 1px solid #dcdfe6;
- background-color: #dcdfe6;
- line-height: 13px;
- border-radius: 5px;
- font-weight: 500;
- margin-left: 4px;
- max-width: 300px;
- overflow-x: auto;
- overflow-y: hidden;
- }
- .hc-add-node-modal-foot-box {
- position: relative;
- display: flex;
- align-items: center;
- .left-box {
- position: relative;
- flex: 1;
- display: flex;
- align-items: center;
- }
- .right-box {
- position: relative;
- }
- }
- .hc-expansion-contraction-tree {
- position: absolute;
- left: -13px;
- top: 0;
- width: 10px;
- height: 100%;
- user-select: none;
- cursor: pointer;
- display: flex;
- justify-content: center;
- align-items: center;
- color: #8c9099;
- font-size: 22px;
- border-radius: 5px;
- transition: background 0.2s;
- background: rgba(255, 255, 255, 0);
- &:hover {
- background: #f1f5f8;
- color: var(--el-color-primary);
- }
- }
- .hc-table-form-action-tip {
- position: absolute;
- bottom: 77px;
- width: 100%;
- }
- .data-fill-wbs-hide-btn {
- background: #fff;
- color: #ffffff;
- }
- html.dark .data-fill-wbs-hide-btn {
- background: #141414;
- color: #141414;
- }
- html.theme-dark {
- .bg-svg-xml {
- background-color: initial;
- background-image: initial;
- }
- .hc-layout-box
- .hc-layout-content-box
- .hc-card-max-h-box.node-tree
- .hc-tree-foot-tip-box {
- border-top: 1px solid #303030;
- }
- }
- </style>
- <style lang="scss">
- .hc-tree-box1 .el-tree-node {
- .el-checkbox {
- margin-right: 0;
- .el-checkbox__inner {
- display: none;
- }
- }
- .is-leaf + .el-checkbox {
- margin-right: 8px;
- .el-checkbox__inner {
- display: inline-block;
- }
- }
- }
- .data-fill-wbs-content {
- position: relative;
- height: 100%;
- .n-drawer-container {
- margin: -20px -24px;
- }
- .n-drawer.n-drawer--top-placement {
- height: auto !important;
- background-color: initial;
- pointer-events: none;
- bottom: 0;
- }
- .drawer-data-fill-content-box {
- position: relative;
- height: 100%;
- padding: 24px;
- .n-card {
- pointer-events: auto;
- height: 100%;
- overflow: auto;
- }
- .data-fill-content {
- position: relative;
- height: 100%;
- overflow-y: auto;
- scroll-behavior: smooth;
- .data-fill-list-box .data-fill-list-item-content {
- height: calc(100vh - 470px);
- .data-fill-table-form-box {
- height: 100%;
- }
- }
- }
- .data-fill-foot {
- position: relative;
- text-align: center;
- }
- }
- }
- .n-card.hc-card-overflow-box .n-card__content {
- padding: 24px;
- }
- .n-card.hc-custom-card > .n-card-header {
- padding: 15px 24px;
- }
- .n-card.hc-custom-card.copy {
- width: 1200px;
- max-height: 90vh;
- overflow: auto;
- .n-card-header .n-card-header__close {
- display: none;
- }
- &.one {
- width: 600px;
- }
- &.many {
- width: 1200px;
- }
- }
- .img-preview-box {
- position: relative;
- height: 100%;
- width: 100%;
- }
- .hc-layout-content-box {
- position: relative;
- }
- .iscusor {
- cursor: pointer;
- }
- .hc-table-form-action-tip .hc-alert {
- background-color: #f1f5f8;
- display: inline;
- vertical-align: middle;
- box-shadow: -2px 0 10px 0 rgba(32, 37, 50, 0.03),
- 0 10px 21px 20px rgba(32, 37, 50, 0.03);
- }
- .copy-node-form-box {
- margin-top: 24px;
- padding-top: 24px;
- border-top: 1px solid #efeff5;
- }
- .hc-position-input-icon {
- position: relative;
- margin-bottom: 0;
- .el-form-item__content {
- position: relative;
- .el-textarea .el-textarea__inner {
- padding-right: 30px;
- }
- .hc-icon-i {
- position: absolute;
- right: 10px;
- bottom: 0;
- font-size: 20px;
- cursor: pointer;
- color: #0081ff;
- opacity: 1;
- transition: opacity 0.2s;
- &:hover {
- opacity: 0.5;
- }
- }
- }
- }
- </style>
- <style lang="scss" scoped>
- /* 新增拖拽排序相关样式 */
- .sortable-ghost {
- opacity: 0.5;
- background: #f5f5f5;
- }
- .hc-attachment-item {
- transition: all 0.3s;
- cursor: move;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 12px;
- margin-bottom: 8px;
- background: #fff;
- border-radius: 4px;
- border: 1px solid #ebeef5;
-
- &:hover {
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
- }
- }
- .hc-attachment-content {
- min-height: 20px;
- }
- /* 原有样式保持不变 */
- .hc-attachment-card {
- margin-bottom: 16px;
-
- .hc-attachment-header {
- font-weight: bold;
- margin-bottom: 8px;
- padding-left: 8px;
- border-left: 3px solid #409eff;
- }
-
- .hc-attachment-file-name {
- display: flex;
- align-items: center;
-
- .name {
- margin-left: 8px;
- }
- }
-
- .hc-attachment-btn-box {
- display: flex;
- }
- }
- </style>
|