wbs.vue 119 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536
  1. <template>
  2. <div class="h-full">
  3. <div
  4. v-if="wbsTypeTabKey === 'tree'"
  5. v-loading="nodeSaveLoading"
  6. class="hc-layout-box"
  7. element-loading-text="批量保存数据中..."
  8. >
  9. <div
  10. id="wbs-left-tree"
  11. :class="[
  12. isWbsTreeShow ? 'show' : '',
  13. isMouseTree ? 'on-transition' : '',
  14. ]"
  15. :style="`width:${isWbsTreeShow ? leftWidth : 0}px; ${
  16. isWbsTreeShow ? '' : 'display: none'
  17. }`"
  18. class="hc-layout-left-box bg-white"
  19. >
  20. <div class="hc-project-box">
  21. <div class="hc-project-icon-box">
  22. <HcIcon name="stack" />
  23. </div>
  24. <div class="project-name-box ml-2">
  25. <div class="project-alias">
  26. {{ projectInfo?.projectName }}
  27. </div>
  28. </div>
  29. </div>
  30. <div class="hc-tree-box">
  31. <div class="hc-tree-back-to">
  32. <el-link type="primary" @click="gobackHistory">
  33. 回到上一次填报部位
  34. </el-link>
  35. <el-link
  36. type="warning"
  37. class="ml-4"
  38. @click="wbsMapTypeTab"
  39. >
  40. 导图结构填报
  41. </el-link>
  42. <HcTooltip keys="data-fill-wbs-hide-btn">
  43. <el-button
  44. class="data-fill-wbs-hide-btn ml-6"
  45. hc-btn
  46. keys="data-fill-wbs-hide-btn"
  47. :loading="hideSaveLoading"
  48. @click="hideTreeNode"
  49. >
  50. 隐藏
  51. </el-button>
  52. </HcTooltip>
  53. </div>
  54. <div class="hc-search-tree-val">
  55. <el-input
  56. v-model="searchTreeVal"
  57. clearable
  58. block
  59. placeholder="请输入名称关键词检索"
  60. @keyup="searchTreeKeyUp"
  61. >
  62. <template #suffix>
  63. <HcIcon
  64. name="search-2"
  65. ui="text-xl iscusor"
  66. @click="searchTreeClick"
  67. />
  68. </template>
  69. </el-input>
  70. </div>
  71. <div
  72. v-if="isShowLeft"
  73. id="hc-tree-scrollbar"
  74. v-loading="treeLoading"
  75. class="hc-tree-scrollbar"
  76. element-loading-text="获取数据中..."
  77. >
  78. <el-scrollbar
  79. v-show="isSearchTree"
  80. class="scroll-bar-right-16"
  81. >
  82. <HcDataTree
  83. is-load-menu
  84. :datas="searchTreeData"
  85. :is-mark="TreeMark"
  86. :menus="ElTreeMenu"
  87. is-counts
  88. is-type
  89. :auto-expand-keys="TreeAutoExpandKeys"
  90. default-expand-all
  91. @node-tap="wbsElTreeClick"
  92. @menu-tap="ElTreeMenuClick"
  93. @load-menu="loadMenu"
  94. />
  95. </el-scrollbar>
  96. <el-scrollbar
  97. v-show="!isSearchTree"
  98. class="scroll-bar-right-16"
  99. >
  100. <HcLazyTree
  101. ref="wbstree"
  102. is-load-menu
  103. :auto-expand-keys="TreeAutoExpandKeys"
  104. :is-mark="TreeMark"
  105. :menus="ElTreeMenu"
  106. is-counts
  107. is-type
  108. show-checkbox
  109. check-strictly
  110. @load="treeLoadNode"
  111. @menu-tap="ElTreeMenuClick"
  112. @node-loading="ElTreeNodeLoading"
  113. @node-tap="wbsElTreeClick"
  114. @check="ElTreeNodeCheck"
  115. @load-menu="loadMenu"
  116. />
  117. </el-scrollbar>
  118. </div>
  119. </div>
  120. <div class="hc-tree-foot-tip-box">
  121. <div class="dot-view green">已审批</div>
  122. <div class="dot-view black">未填报</div>
  123. <div class="dot-view orange">已填报-待审批</div>
  124. <div class="dot-view blue">已填报-未上报</div>
  125. </div>
  126. <!-- 左右拖动 -->
  127. <div class="horizontal-drag-line" @mousedown="onmousedown" />
  128. </div>
  129. <div
  130. id="wbs-content-box"
  131. v-loading="ListItemLoading"
  132. class="hc-layout-content-box"
  133. >
  134. <!---展开收缩树 -->
  135. <div
  136. class="hc-expansion-contraction-tree"
  137. @click="setWbsTreeShow"
  138. >
  139. <HcIcon v-show="isWbsTreeShow" name="arrow-left-s" />
  140. <HcIcon v-show="!isWbsTreeShow" name="arrow-right-s" />
  141. </div>
  142. <hc-tab-card
  143. :tabs="authBtnTabdata"
  144. :tab-key="authBtnTabKey"
  145. @change="authBtnTabClick"
  146. >
  147. <template #extra>
  148. <HcTooltip
  149. keys="wbs_views_sort_btn"
  150. v-if="nodeDataInfo?.nodeClass !== 2"
  151. >
  152. <el-button
  153. :disabled="ListItemDatas.length <= 0"
  154. hc-btn
  155. type="primary"
  156. @click="sortFormClick"
  157. >
  158. 排序
  159. </el-button>
  160. </HcTooltip>
  161. <HcTooltip
  162. keys="wbs_views_node_save_btn"
  163. v-if="nodeDataInfo?.nodeClass !== 2"
  164. >
  165. <el-button
  166. :loading="nodeSaveLoading"
  167. hc-btn
  168. type="primary"
  169. @click="NodeSaveClick"
  170. >
  171. 辅助保存
  172. </el-button>
  173. </HcTooltip>
  174. <HcTooltip
  175. keys="wbs_views_drawings"
  176. v-if="nodeDataInfo?.nodeClass !== 2"
  177. >
  178. <el-button
  179. :disabled="
  180. nodeDataInfo?.drawingsId === -1 ||
  181. nodeDataInfo?.drawingsId === null
  182. "
  183. hc-btn
  184. color="#e03997"
  185. @click="viewsDrawings"
  186. >
  187. 图纸
  188. </el-button>
  189. </HcTooltip>
  190. <HcTooltip keys="wbs_preview">
  191. <el-button
  192. :disabled="NodeStatus === '1'"
  193. :loading="bussPdfsLoading"
  194. hc-btn
  195. color="#A16222"
  196. @click="bussPdfsClick"
  197. >
  198. 预览
  199. </el-button>
  200. </HcTooltip>
  201. <el-button
  202. hc-btn
  203. color="#A16222"
  204. @click="attachmentModalShow"
  205. >
  206. 查看附件
  207. </el-button>
  208. <el-button
  209. hc-btn
  210. :disabled="isCanadd"
  211. color="#567722"
  212. @click="addFilelist"
  213. >
  214. 上传附件
  215. </el-button>
  216. <HcTooltip
  217. v-if="
  218. NodeStatus !== '3' ||
  219. nodeDataInfo?.nodeClass !== 2
  220. "
  221. keys="wbs_report"
  222. >
  223. <el-button
  224. :disabled="
  225. NodeStatus === '3' || NodeStatus === '1'
  226. "
  227. :loading="reportLoading"
  228. hc-btn
  229. color="#FF976A"
  230. style="color: white"
  231. @click="reportModalClick"
  232. >
  233. 上报
  234. </el-button>
  235. </HcTooltip>
  236. <HcTooltip
  237. v-if="
  238. NodeStatus === '3' ||
  239. nodeDataInfo?.nodeClass !== 2
  240. "
  241. keys="wbs_abolish"
  242. >
  243. <el-button
  244. hc-btn
  245. :laoding="abolishLoaing"
  246. color="#FF976A"
  247. style="color: white"
  248. @click="abolishOneClick"
  249. >
  250. 撤回上报流程
  251. </el-button>
  252. </HcTooltip>
  253. <HcTooltip keys="wbs_views_sync_data_btn">
  254. <el-button
  255. v-if="
  256. authBtnTabKey === '2' ||
  257. nodeDataInfo?.nodeClass !== 2
  258. "
  259. hc-btn
  260. color="#37c0fe"
  261. style="color: white"
  262. :loading="syncdataloading"
  263. @click="syncdata"
  264. >
  265. 同步质检资料
  266. </el-button>
  267. </HcTooltip>
  268. <el-button
  269. hc-btn
  270. color="#12C060"
  271. style="color: white"
  272. :loading="syncWorkloading"
  273. @click="syncWork"
  274. v-if="
  275. nodeDataInfo.majorDataType == 2 ||
  276. nodeDataInfo?.nodeClass !== 2
  277. "
  278. >
  279. 同步工序资料
  280. </el-button>
  281. <HcTooltip
  282. v-if="
  283. NodeStatus !== '3' ||
  284. nodeDataInfo?.nodeClass !== 2
  285. "
  286. keys="wbs_save"
  287. >
  288. <el-button
  289. :disabled="
  290. NodeStatus === '3' ||
  291. ListItemDatas.length <= 0
  292. "
  293. :loading="tableFormSaveLoading"
  294. hc-btn
  295. color="#12C060"
  296. style="color: white; font-weight: bold"
  297. @click="tableFormSaveClick"
  298. >
  299. 保存数据
  300. </el-button>
  301. </HcTooltip>
  302. </template>
  303. <el-scrollbar
  304. v-if="ListItemDatas.length > 0"
  305. ref="ListItemScrollRef"
  306. >
  307. <CollapseForm
  308. ref="ListItemRef"
  309. :tree-auto-expand-keys="TreeAutoExpandKeys"
  310. :classify="authBtnTabKey"
  311. :contract-id="contractId"
  312. :datas="ListItemDatas"
  313. :draw-type="!isDrawType"
  314. :primary-key-id="primaryKeyId"
  315. :status="NodeStatus"
  316. :tenant-id="userInfo?.tenant_id"
  317. :wbs-temp-id="
  318. projectInfo?.referenceWbsTemplateIdTrial
  319. "
  320. :wbs-type="2"
  321. :treenode-data-info="nodeDataInfo"
  322. :newlistdata="newlistdata"
  323. @offset-top="ListItemOffsetTop"
  324. @renew="getTableDataAll"
  325. @get-list="searchNodeAllTable1"
  326. />
  327. </el-scrollbar>
  328. <hc-empty v-else title="暂无表单" />
  329. </hc-tab-card>
  330. </div>
  331. </div>
  332. <hc-new-card
  333. v-if="wbsTypeTabKey === 'map'"
  334. id-ref="wbs-node-tree-card-target"
  335. >
  336. <template #header>
  337. <HcTooltip keys="wbs_views_division_btn">
  338. <el-button
  339. class="mr-10"
  340. hc-btn
  341. type="primary"
  342. @click="divisionClick"
  343. >
  344. <HcIcon :line="false" name="node-tree" />
  345. <span>划分变更</span>
  346. </el-button>
  347. </HcTooltip>
  348. <HcNewSwitch
  349. v-if="isDrawer"
  350. :datas="authBtnTabdata"
  351. :keys="authBtnTabKey"
  352. :round="false"
  353. size="default"
  354. @change="authBtnTabClick"
  355. />
  356. </template>
  357. <template #extra>
  358. <HcNewSwitch
  359. :datas="wbsTypeTab"
  360. :keys="wbsTypeTabKey"
  361. size="default"
  362. @change="wbsTypeTabChange"
  363. />
  364. </template>
  365. <NodeTree
  366. ref="NodeTreeRef"
  367. :accordion="NodeTreeAccordion"
  368. :auto-expand-keys="TreeAutoExpandKeys"
  369. :contract-id="contractId"
  370. :is-mark="TreeMark"
  371. :menus="ElTreeMenu"
  372. :project-id="projectId"
  373. @menu-click="NodeTreeMenuClick"
  374. @node-click="NodeTreeClick"
  375. @node-dbl-click="NodeTreeDblClick"
  376. />
  377. <template #action>
  378. <div class="hc-tree-mp-tip-box">
  379. <div class="dot-view green">已审批</div>
  380. <div class="dot-view black">未填报</div>
  381. <div class="dot-view orange">已填报-待审批</div>
  382. <div class="dot-view blue">已填报-未上报</div>
  383. </div>
  384. </template>
  385. <HcDrawer
  386. v-model="isDrawer"
  387. to-id="wbs-node-tree-card-target"
  388. @close="drawerClose"
  389. >
  390. <!-- 清表列表 -->
  391. <el-scrollbar
  392. v-if="ListItemDatas.length > 0"
  393. ref="ListItemScrollRef"
  394. >
  395. <CollapseForm
  396. ref="ListItemsRef"
  397. :classify="authBtnTabKey"
  398. :contract-id="contractId"
  399. :datas="ListItemDatas"
  400. :draw-type="isDrawType"
  401. :primary-key-id="primaryKeyId"
  402. :status="NodeStatus"
  403. :tenant-id="userInfo?.tenant_id"
  404. :wbs-temp-id="projectInfo?.referenceWbsTemplateIdTrial"
  405. :wbs-type="2"
  406. @offset-top="ListItemOffsetTop"
  407. @renew="getTableDataAll"
  408. />
  409. </el-scrollbar>
  410. <hc-status v-else text="暂无表单" />
  411. <!-- 底部按钮区域 -->
  412. <template #action>
  413. <hc-tooltip v-if="NodeStatus !== '3'" keys="wbs_save">
  414. <el-button
  415. :disabled="
  416. NodeStatus === '3' || ListItemDatas.length <= 0
  417. "
  418. :loading="tableFormSaveLoading"
  419. hc-btn
  420. type="primary"
  421. @click="tableFormSaveClick"
  422. >
  423. <HcIcon name="save" />
  424. <span>保存</span>
  425. </el-button>
  426. </hc-tooltip>
  427. <hc-tooltip v-if="NodeStatus !== '3'" keys="wbs_report">
  428. <el-button
  429. :disabled="NodeStatus === '3' || NodeStatus === '1'"
  430. :loading="reportLoading"
  431. hc-btn
  432. @click="reportModalClick"
  433. >
  434. <HcIcon name="send-plane-2" />
  435. <span>上报</span>
  436. </el-button>
  437. </hc-tooltip>
  438. <hc-tooltip keys="wbs_preview">
  439. <el-button
  440. :disabled="NodeStatus === '1'"
  441. :loading="bussPdfsLoading"
  442. hc-btn
  443. @click="bussPdfsClick"
  444. >
  445. <HcIcon name="eye" />
  446. <span>预览</span>
  447. </el-button>
  448. </hc-tooltip>
  449. <hc-tooltip v-if="NodeStatus === '3'" keys="wbs_abolish">
  450. <el-button hc-btn>
  451. <HcIcon name="arrow-go-back" />
  452. <span>撤回上报流程</span>
  453. </el-button>
  454. </hc-tooltip>
  455. <hc-tooltip keys="wbs_views_drawings">
  456. <el-button
  457. :disabled="!nodeDataInfo?.fileUrl"
  458. hc-btn
  459. @click="viewsDrawings"
  460. >
  461. <HcIcon name="image" />
  462. <span>图纸</span>
  463. </el-button>
  464. </hc-tooltip>
  465. <el-button hc-btn @click="attachmentModalShow">
  466. <HcIcon name="file" />
  467. <span>附件</span>
  468. </el-button>
  469. <el-button hc-btn @click="drawerClose">
  470. <HcIcon name="close" />
  471. <span>关闭填报页面</span>
  472. </el-button>
  473. </template>
  474. </HcDrawer>
  475. </hc-new-card>
  476. <!-- 查看图纸 -->
  477. <hc-drag-modal
  478. :is-show="drawingsShow"
  479. close-icon
  480. lefts="145"
  481. title="查看图纸"
  482. tops="100"
  483. ui="hc-image-preview-box"
  484. widths="380px"
  485. @close="drawingsClose"
  486. >
  487. <div class="hc-image-preview-view">
  488. <!-- <el-image-viewer :url-list="[nodeDataInfo.fileUrl]" /> -->
  489. <el-image :src="drawList" />
  490. </div>
  491. </hc-drag-modal>
  492. <!-- 编辑节点 -->
  493. <hc-new-dialog
  494. v-model="editNodeModal"
  495. :loading="editNodeLoading"
  496. title="编辑节点"
  497. widths="600px"
  498. @save="editNodeClick"
  499. >
  500. <el-form
  501. ref="formEditNodeRef"
  502. :model="formEditNodeModel"
  503. :rules="formEditNodeRules"
  504. label-width="auto"
  505. size="large"
  506. >
  507. <el-form-item label="节点名称" prop="title">
  508. <el-input
  509. v-model="formEditNodeModel.title"
  510. placeholder="请输入节点名称"
  511. />
  512. </el-form-item>
  513. <el-form-item label="上级节点">
  514. <el-input
  515. v-model="formEditNodeModel.parent.title"
  516. disabled
  517. />
  518. </el-form-item>
  519. <el-form-item label="节点类型">
  520. <el-select
  521. v-model="formEditNodeModel.nodeType"
  522. disabled
  523. block
  524. >
  525. <el-option
  526. v-for="item in nodeTypeData"
  527. :key="item.value"
  528. :label="item.label"
  529. :value="item.value"
  530. />
  531. </el-select>
  532. </el-form-item>
  533. <el-form-item label="时间" prop="digitizeTime">
  534. <el-date-picker
  535. v-model="formEditNodeModel.digitizeTime"
  536. class="block"
  537. format="YYYY-MM-DD"
  538. placeholder="请选择"
  539. type="date"
  540. value-format="YYYY-MM-DD"
  541. />
  542. </el-form-item>
  543. <el-form-item
  544. v-if="formEditNodeModel.notExsitChild"
  545. label="标准分类"
  546. prop="className"
  547. >
  548. <el-select
  549. v-model="formEditNodeModel.className"
  550. block
  551. @change="changeStandType"
  552. >
  553. <el-option
  554. v-for="item in standardTypeOptions"
  555. :key="item.value"
  556. :label="item.label"
  557. :value="item.value"
  558. />
  559. </el-select>
  560. </el-form-item>
  561. <el-form-item
  562. v-if="formEditNodeModel.notExsitChild"
  563. label="单位名称"
  564. prop="unitName"
  565. >
  566. <el-select v-model="formEditNodeModel.unitName" block>
  567. <el-option
  568. v-for="item in unitNameOptions"
  569. :key="item.value"
  570. :label="item.dictValue"
  571. :value="item.dictKey"
  572. />
  573. </el-select>
  574. </el-form-item>
  575. <el-row :gutter="24" v-if="formEditNodeModel.nodeClass === 2">
  576. <el-col :span="12">
  577. <el-form-item prop="unitNum" label="单元个数">
  578. <el-input-number
  579. v-model="formEditNodeModel.unitNum"
  580. placeholder="请输入单元个数"
  581. :controls="false"
  582. :min="0"
  583. :precision="0"
  584. class="w-100"
  585. />
  586. </el-form-item>
  587. </el-col>
  588. <el-col :span="12">
  589. <el-form-item prop="excellentNum" label="优良个数">
  590. <el-input-number
  591. v-model="formEditNodeModel.excellentNum"
  592. placeholder="请输入优良个数"
  593. :controls="false"
  594. :min="0"
  595. :precision="0"
  596. class="w-100"
  597. />
  598. </el-form-item>
  599. </el-col>
  600. </el-row>
  601. <el-form-item label="划分编号">
  602. <el-input
  603. v-model="formEditNodeModel.partitionCode"
  604. placeholder="请输入划分编号"
  605. />
  606. </el-form-item>
  607. <el-form-item class="hc-position-input-icon" label="模板位置">
  608. <el-input
  609. v-model="formEditNodeModel.position"
  610. :autosize="{ minRows: 3, maxRows: 6 }"
  611. type="textarea"
  612. />
  613. <el-tooltip content="一键复制模板位置">
  614. <HcIcon
  615. name="file-copy-2"
  616. @click="
  617. copyPositionText(formEditNodeModel.position)
  618. "
  619. />
  620. </el-tooltip>
  621. </el-form-item>
  622. </el-form>
  623. </hc-new-dialog>
  624. <!-- 复制节点 -->
  625. <hc-new-dialog
  626. v-model="copyNodeModal"
  627. :loading="copyNodeLoading"
  628. :widths="copyNodeTabKey === '1' ? '600px' : '1200px'"
  629. loading-text="复制节点中,请耐心等待..."
  630. title="复制节点"
  631. >
  632. <div class="header-new-switch">
  633. <el-form
  634. ref="formCopyNodeModelRef"
  635. :model="formCopyNodeModel"
  636. label-position="left"
  637. :rules="formCopyNodeModelRules"
  638. label-width="auto"
  639. size="large"
  640. >
  641. <el-form-item
  642. label="是否复制数据"
  643. prop="isCopyData"
  644. style="margin-bottom: 0"
  645. >
  646. <!-- <el-input v-model="formCopyNodeModel.classify" placeholder="请输入节点名称"/> -->
  647. <el-radio-group v-model="isCopyData">
  648. <el-radio :value="1">是</el-radio>
  649. <el-radio :value="0">否</el-radio>
  650. </el-radio-group>
  651. </el-form-item>
  652. <el-form-item
  653. v-if="isCopyData === 1"
  654. label="所属方"
  655. prop="classify"
  656. style="margin-bottom: 0"
  657. >
  658. <!-- <el-input v-model="formCopyNodeModel.classify" placeholder="请输入节点名称"/> -->
  659. <el-checkbox-group v-model="classifyList">
  660. <el-checkbox value="施工">施工</el-checkbox>
  661. <el-checkbox value="监理">监理</el-checkbox>
  662. </el-checkbox-group>
  663. </el-form-item>
  664. </el-form>
  665. <!-- HcNewSwitch :datas="authBtnTabdata" :keys="classifyType" :round="false" size="default"
  666. @change="classifyTypeTabClick"/ -->
  667. </div>
  668. <div v-if="copyNodeTabKey === '1'" class="copy-node-form-box">
  669. <el-form
  670. ref="formCopyNodeModelRef"
  671. :model="formCopyNodeModel"
  672. :rules="formCopyNodeModelRules"
  673. label-width="auto"
  674. size="large"
  675. >
  676. <el-form-item
  677. v-if="copyNodeTabKey === '1'"
  678. label="节点名称"
  679. prop="title"
  680. style="margin-bottom: 0"
  681. >
  682. <el-input
  683. v-model="formCopyNodeModel.title"
  684. placeholder="请输入节点名称"
  685. />
  686. </el-form-item>
  687. <el-form-item
  688. v-if="copyNodeTabKey === '1'"
  689. label="划分编号"
  690. prop="partitionCode"
  691. style="margin-top: 10px"
  692. >
  693. <el-input
  694. v-model="formCopyNodeModel.partitionCode"
  695. placeholder="请输入划分编号"
  696. />
  697. </el-form-item>
  698. </el-form>
  699. </div>
  700. <div v-if="copyNodeTabKey === '3'" class="copy-node-form-box">
  701. <el-form
  702. ref="formCopyNodeModelRef"
  703. :model="formCopyNodeModel"
  704. :rules="formCopyNodeModelRules"
  705. label-width="auto"
  706. size="large"
  707. >
  708. <el-form-item
  709. label="所属方"
  710. prop="classify"
  711. style="margin-bottom: 0"
  712. >
  713. <!-- <el-input v-model="formCopyNodeModel.classify" placeholder="请输入节点名称"/> -->
  714. <el-checkbox-group v-model="classifyList">
  715. <el-checkbox value="施工">施工</el-checkbox>
  716. <el-checkbox value="监理">监理</el-checkbox>
  717. </el-checkbox-group>
  718. </el-form-item>
  719. </el-form>
  720. </div>
  721. <div v-if="copyNodeTabKey !== '1'" class="copy-node-many-box">
  722. <div class="copy-node-many-tree">
  723. <el-scrollbar>
  724. <hc-lazy-tree
  725. :auto-expand-keys="TreeAutoExpandKeys"
  726. is-type
  727. @load="treeLoadNode"
  728. @node-tap="copyNodeElTreeClick"
  729. />
  730. </el-scrollbar>
  731. </div>
  732. <div class="copy-node-many-table">
  733. <el-scrollbar>
  734. <el-table :data="copyNodeTable" border>
  735. <el-table-column
  736. label="复制到的位置"
  737. prop="title"
  738. />
  739. <el-table-column
  740. v-if="copyNodeTabKey === '2'"
  741. label="节点名称"
  742. prop="nodeName"
  743. >
  744. <template #default="{ row }">
  745. <el-form
  746. ref="copyNodeTableRef"
  747. :model="row"
  748. :rules="copyNodeTableRules"
  749. label-width="0"
  750. size="large"
  751. >
  752. <el-form-item
  753. prop="nodeName"
  754. style="margin-bottom: 0"
  755. >
  756. <el-input
  757. v-model="row.nodeName"
  758. placeholder="请输入节点名称"
  759. />
  760. </el-form-item>
  761. </el-form>
  762. </template>
  763. </el-table-column>
  764. <el-table-column
  765. v-if="copyNodeTabKey === '2'"
  766. label="划分编号"
  767. prop="partitionCode"
  768. >
  769. <template #default="{ row }">
  770. <el-form
  771. ref="copyNodeTableRef"
  772. :model="row"
  773. :rules="copyNodeTableRules"
  774. label-width="0"
  775. size="large"
  776. >
  777. <el-form-item
  778. prop="partitionCode"
  779. style="margin-bottom: 0"
  780. >
  781. <el-input
  782. v-model="row.partitionCode"
  783. placeholder="请输入划分编号"
  784. />
  785. </el-form-item>
  786. </el-form>
  787. </template>
  788. </el-table-column>
  789. <el-table-column
  790. align="center"
  791. label="操作"
  792. prop="action"
  793. width="120"
  794. >
  795. <template #default="{ _, $index }">
  796. <el-button
  797. plain
  798. type="danger"
  799. @click="copyNodeTableDel($index)"
  800. >
  801. 删除
  802. </el-button>
  803. </template>
  804. </el-table-column>
  805. </el-table>
  806. </el-scrollbar>
  807. </div>
  808. </div>
  809. <template #footer>
  810. <div class="lr-dialog-footer">
  811. <div class="left">
  812. <template
  813. v-for="(item, index) in copyNodeTab"
  814. :key="index"
  815. >
  816. <el-button
  817. v-if="item?.key === copyNodeTabKey"
  818. plain
  819. size="large"
  820. type="primary"
  821. @click="copyNodeTabChange(item?.key)"
  822. >
  823. {{ item.name }}
  824. </el-button>
  825. <el-button
  826. v-else
  827. bg
  828. size="large"
  829. text
  830. @click="copyNodeTabChange(item?.key)"
  831. >
  832. {{ item.name }}
  833. </el-button>
  834. </template>
  835. </div>
  836. <div class="right">
  837. <el-button
  838. :disabled="copyNodeLoading"
  839. size="large"
  840. @click="copyNodeModal = false"
  841. >
  842. 取消
  843. </el-button>
  844. <el-button
  845. :loading="copyNodeLoading"
  846. hc-btn
  847. type="primary"
  848. @click="copyNodeClick"
  849. >
  850. 提交
  851. </el-button>
  852. </div>
  853. </div>
  854. </template>
  855. </hc-new-dialog>
  856. <!-- 新增子节点 -->
  857. <hc-new-dialog
  858. v-model="addNodeModal"
  859. :loading="addNodeLoading"
  860. loading-text="新增节点中,请耐心等待..."
  861. title="新增子节点"
  862. widths="720px"
  863. is-table
  864. >
  865. <el-alert
  866. :closable="false"
  867. title="双击节点,可编辑节点名称,编辑完成后,请按回车或输入框消失后,再点提交"
  868. type="warning"
  869. />
  870. <HcTreeNode
  871. v-if="addTreeNodeType === '1'"
  872. :node-id="addTreeNodeId"
  873. :old-id="addTreeNodeOldId"
  874. :contract-id="contractId"
  875. :wbs-id="projectInfo.referenceWbsTemplateId"
  876. :project-id="projectId"
  877. :is-custom="isCustom"
  878. @check-change="addTreeNodeCheckChange"
  879. />
  880. <HcTreeNode
  881. v-if="addTreeNodeType === '2'"
  882. :node-id="addTreeNodeId"
  883. :old-id="addTreeNodeOldId"
  884. :contract-id="contractId"
  885. :wbs-id="projectInfo.referenceWbsTemplateId"
  886. :project-id="projectId"
  887. strictly
  888. :is-custom="isCustom"
  889. @check-change="addTreeNodeCheckChange"
  890. />
  891. <template #footer>
  892. <div class="lr-dialog-footer">
  893. <div class="left flex items-center">
  894. <div class="mr-4">选中方式:</div>
  895. <el-radio-group v-model="addTreeNodeType">
  896. <el-radio label="1">当前及子节点</el-radio>
  897. <el-radio class="ml-4" label="2">
  898. 仅当前节点
  899. </el-radio>
  900. </el-radio-group>
  901. </div>
  902. <div class="right">
  903. <el-button size="large" @click="addNodeModal = false">
  904. 取消
  905. </el-button>
  906. <el-button
  907. :loading="addNodeLoading"
  908. hc-btn
  909. type="primary"
  910. @click="addNodeClick"
  911. >
  912. 提交
  913. </el-button>
  914. </div>
  915. </div>
  916. </template>
  917. </hc-new-dialog>
  918. <!-- 新增自定义节点 -->
  919. <hc-new-dialog
  920. v-model="addNodeModalCus"
  921. :loading="addNodeLoadingCus"
  922. loading-text="新增节点中,请耐心等待..."
  923. title="新增自定义节点(水利工程)"
  924. widths="720px"
  925. @save="addNodeClickCur"
  926. >
  927. <el-form
  928. ref="formWaterNodeRef"
  929. :model="formWaterNodeModel"
  930. :rules="formWaterNodeRules"
  931. label-width="auto"
  932. size="large"
  933. label-position="left"
  934. >
  935. <el-form-item label="节点名称" prop="nodeName">
  936. <el-input
  937. v-model="formWaterNodeModel.nodeName"
  938. placeholder="请输入节点名称"
  939. />
  940. </el-form-item>
  941. <el-form-item label="节点类型" prop="nodeType">
  942. <el-select v-model="formWaterNodeModel.nodeType" block>
  943. <el-option
  944. v-for="item in nodeTypeData"
  945. :key="item.value"
  946. :label="item.label"
  947. :value="item.value"
  948. />
  949. </el-select>
  950. </el-form-item>
  951. </el-form>
  952. </hc-new-dialog>
  953. <!-- 新增自定义节点-数字化文件 -->
  954. <hc-new-dialog
  955. v-model="addNodeModalData"
  956. :loading="addNodeLoadingData"
  957. loading-text="新增节点中,请耐心等待..."
  958. title="新增自定义节点(数字化文件)"
  959. widths="720px"
  960. @save="addNodeClickData"
  961. >
  962. <el-form
  963. ref="formDataNodeRef"
  964. :model="formDataNodeModel"
  965. :rules="formDataNodeRules"
  966. label-width="auto"
  967. size="large"
  968. >
  969. <el-form-item label="节点名称" prop="nodeName">
  970. <el-input
  971. v-model="formDataNodeModel.nodeName"
  972. placeholder="请输入节点名称"
  973. />
  974. </el-form-item>
  975. <el-form-item label="节点类型" prop="nodeType">
  976. <el-select v-model="formDataNodeModel.nodeType" block>
  977. <el-option
  978. v-for="item in nodeTypeData"
  979. :key="item.value"
  980. :label="item.label"
  981. :value="item.value"
  982. />
  983. </el-select>
  984. </el-form-item>
  985. <el-form-item label="是否含单元评定" prop="isClassifition">
  986. <el-radio-group v-model="formDataNodeModel.isClassifition">
  987. <el-radio :value="1">是</el-radio>
  988. <el-radio :value="0">否</el-radio>
  989. </el-radio-group>
  990. </el-form-item>
  991. <el-form-item label="时间" prop="digitizeTime">
  992. <el-date-picker
  993. v-model="formDataNodeModel.digitizeTime"
  994. class="block"
  995. format="YYYY-MM-DD"
  996. placeholder="请选择"
  997. type="date"
  998. value-format="YYYY-MM-DD"
  999. />
  1000. </el-form-item>
  1001. <el-form-item
  1002. v-if="formDataNodeModel.isClassifition === 1"
  1003. label="标准分类"
  1004. prop="className"
  1005. >
  1006. <el-select
  1007. v-model="formDataNodeModel.className"
  1008. block
  1009. @change="changeStandType"
  1010. >
  1011. <el-option
  1012. v-for="item in standardTypeOptions"
  1013. :key="item.value"
  1014. :label="item.label"
  1015. :value="item.value"
  1016. />
  1017. </el-select>
  1018. </el-form-item>
  1019. <el-form-item
  1020. v-if="formDataNodeModel.isClassifition === 1"
  1021. label="单元名称"
  1022. prop="unitName"
  1023. >
  1024. <el-select v-model="formDataNodeModel.unitName" block>
  1025. <el-option
  1026. v-for="item in unitNameOptions"
  1027. :key="item.value"
  1028. :label="item.dictValue"
  1029. :value="item.dictKey"
  1030. />
  1031. </el-select>
  1032. </el-form-item>
  1033. <el-row
  1034. :gutter="24"
  1035. v-if="formDataNodeModel.isClassifition === 1"
  1036. >
  1037. <el-col :span="12">
  1038. <el-form-item prop="unitNum" label="单元个数">
  1039. <el-input-number
  1040. v-model="formDataNodeModel.unitNum"
  1041. placeholder="请输入单元个数"
  1042. :controls="false"
  1043. :min="0"
  1044. :precision="0"
  1045. class="w-100"
  1046. />
  1047. </el-form-item>
  1048. </el-col>
  1049. <el-col :span="12">
  1050. <el-form-item prop="excellentNum" label="优良个数">
  1051. <el-input-number
  1052. v-model="formDataNodeModel.excellentNum"
  1053. placeholder="请输入优良个数"
  1054. :controls="false"
  1055. :min="0"
  1056. :precision="0"
  1057. class="w-100"
  1058. />
  1059. </el-form-item>
  1060. </el-col>
  1061. </el-row>
  1062. </el-form>
  1063. </hc-new-dialog>
  1064. <!-- 调整排序 -->
  1065. <hc-new-dialog
  1066. v-model="sortNodeModal"
  1067. :loading="sortNodeLoading"
  1068. title="调整排序"
  1069. widths="700px"
  1070. @save="sortNodeClick"
  1071. >
  1072. <el-alert
  1073. :closable="false"
  1074. title="可拖动排序,也可在后面点击图标,切换排序"
  1075. type="warning"
  1076. />
  1077. <div class="sort-node-body-box list-group header">
  1078. <div class="list-group-item">
  1079. <div class="index-box">序号</div>
  1080. <div class="title-box">节点名称</div>
  1081. <div class="icon-box">排序</div>
  1082. </div>
  1083. </div>
  1084. <Draggable
  1085. :list="sortNodeData"
  1086. class="sort-node-body-box list-group"
  1087. ghost-class="ghost"
  1088. item-key="id"
  1089. @end="sortNodeDrag = false"
  1090. @start="sortNodeDrag = true"
  1091. >
  1092. <template #item="{ element, index }">
  1093. <div class="list-group-item">
  1094. <div class="index-box">{{ index + 1 }}</div>
  1095. <div class="title-box">{{ element.title }}</div>
  1096. <div class="icon-box">
  1097. <span class="icon" @click="downSortClick(index)">
  1098. <HcIcon name="arrow-down" ui="text-lg" />
  1099. </span>
  1100. <span class="icon" @click="upSortClick(index)">
  1101. <HcIcon name="arrow-up" ui="text-lg" />
  1102. </span>
  1103. </div>
  1104. </div>
  1105. </template>
  1106. </Draggable>
  1107. </hc-new-dialog>
  1108. <!-- 批量上报审批 -->
  1109. <hc-report-modal
  1110. :addition="reportAddition"
  1111. :contract-id="
  1112. contractInfo?.contractType == 2
  1113. ? nodeDataInfo?.contractIdRelation
  1114. : contractId
  1115. "
  1116. :flow-contract-id="contractId"
  1117. :ids="reportIds"
  1118. :table-owner="authBtnTabKey"
  1119. :classify-type="classType"
  1120. :project-id="projectId"
  1121. :show="showReportModal"
  1122. :task-name="reportTaskName"
  1123. :type-data="reportTypeData"
  1124. title="批量上报审批"
  1125. type="wbs"
  1126. url="informationWriteQuery/taskOne"
  1127. @finish="showReportFinish"
  1128. @hide="showReportModal = false"
  1129. />
  1130. <!-- 查看附件 -->
  1131. <hc-new-dialog
  1132. v-model="attachmentModal"
  1133. :footer="false"
  1134. is-table
  1135. title="附件列表"
  1136. widths="780px"
  1137. >
  1138. <div
  1139. v-if="attachmentList.length > 0"
  1140. v-loading="attachmentListLoaing"
  1141. >
  1142. <div
  1143. v-for="item in attachmentList"
  1144. :key="item.id"
  1145. class="hc-attachment-card"
  1146. >
  1147. <div class="hc-attachment-header">{{ item?.nodeName }}</div>
  1148. <div class="hc-attachment-content">
  1149. <div
  1150. v-for="item1 in item.fileList"
  1151. :key="item1.id"
  1152. class="hc-attachment-item"
  1153. >
  1154. <div class="hc-attachment-file-name">
  1155. <HcIcon name="attachment" />
  1156. <div class="name">{{ item1?.name }}</div>
  1157. </div>
  1158. <div class="hc-attachment-btn-box">
  1159. <el-button
  1160. plain
  1161. size="small"
  1162. type="primary"
  1163. @click="previewFile(item1)"
  1164. >
  1165. <HcIcon name="eye" />
  1166. <span>预览</span>
  1167. </el-button>
  1168. <el-button
  1169. v-if="NodeStatus != 3"
  1170. plain
  1171. size="small"
  1172. style="margin-left: 16px"
  1173. type="danger"
  1174. :loading="item1?.loading"
  1175. @click="delFile(item1)"
  1176. >
  1177. <HcIcon name="close" />
  1178. <span>删除</span>
  1179. </el-button>
  1180. </div>
  1181. </div>
  1182. </div>
  1183. </div>
  1184. </div>
  1185. <div v-else style="height: 100%; width: 100%">
  1186. <hc-no-data />
  1187. </div>
  1188. </hc-new-dialog>
  1189. <!-- 上传文件 -->
  1190. <hc-new-dialog
  1191. v-model="uploadModal"
  1192. :footer="false"
  1193. title="上传文件"
  1194. widths="38rem"
  1195. @close="uploadModalClose"
  1196. >
  1197. <div class="mb-4">
  1198. <span style="color: red">*</span> 选择附件类型:
  1199. <el-select
  1200. v-model="typevalue"
  1201. placeholder="请选择"
  1202. style="width: 240px"
  1203. clearable
  1204. @change="changeType"
  1205. >
  1206. <el-option
  1207. v-for="item in typeoptions"
  1208. :key="item.value"
  1209. :label="item.label"
  1210. :value="item.value"
  1211. />
  1212. </el-select>
  1213. </div>
  1214. <HcUpload
  1215. :datas="uploadData"
  1216. :file-list="fileListData"
  1217. :is-canupload="false"
  1218. action="/api/blade-manager/exceltab/add-bussfile-node"
  1219. accept="application/pdf"
  1220. accept-tip="允许格式:pdf"
  1221. :auto-upload="false"
  1222. :typevalue="typevalue"
  1223. @change="uploadChange"
  1224. @close="uploadModalClose"
  1225. />
  1226. </hc-new-dialog>
  1227. <!-- 表单排序 -->
  1228. <hc-new-dialog
  1229. v-model="sortFormShow"
  1230. is-table
  1231. title="排序"
  1232. widths="800px"
  1233. is-footer-center
  1234. @close="sortFormClose"
  1235. >
  1236. <hc-table
  1237. ref="tableSortFormRef"
  1238. :column="tableSortFormColumn"
  1239. :datas="tableSortFormData"
  1240. is-row-drop
  1241. is-sort
  1242. quick-sort
  1243. @row-drop="sortFormDropTap"
  1244. @row-sort="rowSortFormTap"
  1245. />
  1246. <template #footer>
  1247. <el-button hc-btn @click="sortFormClose">取消</el-button>
  1248. <el-button
  1249. hc-btn
  1250. type="primary"
  1251. :loading="sortFormLoading"
  1252. @click="sortFormSubmit"
  1253. >
  1254. 提交
  1255. </el-button>
  1256. </template>
  1257. </hc-new-dialog>
  1258. </div>
  1259. </template>
  1260. <script setup>
  1261. import { nextTick, onMounted, ref, watch } from "vue";
  1262. import { useRoute, useRouter } from "vue-router";
  1263. import { useAppStore } from "~src/store";
  1264. import { HcIsButton } from "~src/plugins/IsButtons";
  1265. import CollapseForm from "./collapse-form/index.vue";
  1266. import NodeTree from "./components/nodeTree/index.vue";
  1267. import HcTreeNode from "./components/HcTreeNode.vue";
  1268. import { HcUploadFileApi } from "hc-vue3-ui";
  1269. import { getStoreValue, setStoreValue } from "~src/utils/storage";
  1270. import { getDictionaryData } from "~uti/tools";
  1271. import { getChildList } from "~api/other";
  1272. import {
  1273. arrToKey,
  1274. deepClone,
  1275. formValidate,
  1276. getArrValue,
  1277. getObjVal,
  1278. getObjValue,
  1279. isArrIndex,
  1280. isNullES,
  1281. isString,
  1282. setCopyText,
  1283. } from "js-fast-way";
  1284. import {
  1285. eVisaTaskCheckApi,
  1286. getDictionary,
  1287. getDictionaryBiz,
  1288. userConfigSave,
  1289. } from "~api/other";
  1290. import wbsApi from "~api/data-fill/wbs";
  1291. import queryApi from "~api/data-fill/query";
  1292. import Draggable from "vuedraggable";
  1293. import { HcDelMsg, NewDelMsg, useClick } from "hc-vue3-ui";
  1294. import HcUpload from "./components/HcUpload.vue";
  1295. import { toPdfPage } from "~uti/btn-auth";
  1296. import website from "~src/config";
  1297. //初始变量
  1298. const router = useRouter();
  1299. const useRoutes = useRoute();
  1300. const useAppState = useAppStore();
  1301. //全局变量
  1302. const projectId = ref(useAppState.projectId);
  1303. const contractId = ref(useAppState.contractId);
  1304. const projectInfo = ref(useAppState.projectInfo);
  1305. const contractInfo = ref(useAppState.contractInfo);
  1306. const isCollapse = ref(useAppState.getCollapse);
  1307. const userInfo = ref(useAppState.getUserInfo);
  1308. const isLayout = ref(useAppState.isLayout);
  1309. const leftWidth = ref(440);
  1310. //路由参数
  1311. const routerQuery = useRoutes?.query;
  1312. // const typeName = routerQuery?.type || 'map'
  1313. const typeName = routerQuery?.type || "tree";
  1314. //是否是抽屉
  1315. const isDrawType = ref(true);
  1316. //自动展开缓存
  1317. const TreeAutoExpandKeys = ref(getStoreValue("wbsTreeExpandKeys") || []);
  1318. //树搜索
  1319. const isSearchTree = ref(false);
  1320. const wbstreeKey = ref(Math.random());
  1321. const searchElTreeLoadNode = ref(true);
  1322. const searchTreeHeight = ref();
  1323. const getSearchTreeData = async () => {
  1324. treeLoading.value = true;
  1325. const { error, code, data } =
  1326. await queryApi.getTreeNodeByQueryValueAndContractId({
  1327. contractId: contractId.value,
  1328. queryValue: searchTreeVal.value,
  1329. tableOwner: authBtnTabKey.value,
  1330. });
  1331. //判断状态
  1332. if (!error && code === 200) {
  1333. let treedata = getArrValue(data);
  1334. searchTreeData.value = treedata;
  1335. treeLoading.value = false;
  1336. } else {
  1337. treeLoading.value = false;
  1338. searchTreeData.value = [];
  1339. }
  1340. };
  1341. //监听
  1342. const searchTreeVal = ref("");
  1343. watch(
  1344. () => [useAppState.getCollapse, searchTreeVal.value],
  1345. ([Collapse, search]) => {
  1346. isCollapse.value = Collapse;
  1347. if (search.length == 0) {
  1348. isSearchTree.value = false;
  1349. }
  1350. }
  1351. );
  1352. //加载树需要的classType
  1353. const classType = ref("");
  1354. watch(
  1355. () => [classType.value, useAppState.isLayout],
  1356. ([classify, isLay]) => {
  1357. isLayout.value = isLay || "";
  1358. if (classify) {
  1359. //重新加载左边树
  1360. isShowLeft.value = false;
  1361. setTimeout(() => {
  1362. isShowLeft.value = true;
  1363. }, 500);
  1364. }
  1365. }
  1366. );
  1367. //渲染完成
  1368. onMounted(() => {
  1369. console.log(projectInfo.value);
  1370. treeLoading.value = typeName === "tree";
  1371. const treeWidth = useAppState.getTreeWidth;
  1372. leftWidth.value = isNullES(treeWidth) || treeWidth <= 0 ? 440 : treeWidth;
  1373. setContractType(contractInfo.value?.contractType);
  1374. getDictionaryApi();
  1375. getStandardTypeOptions();
  1376. });
  1377. //身份按钮切换数据
  1378. const authBtnTabKey = ref("1");
  1379. //变量
  1380. const wbstree = ref(null);
  1381. const isShowLeft = ref(true);
  1382. const authBtnTabClick = (val) => {
  1383. if (!primaryKeyId.value) {
  1384. window?.$message?.warning("请先在左侧项目树选择一个节点");
  1385. } else if (val["key"] !== authBtnTabKey.value) {
  1386. authBtnTabKey.value = val["key"];
  1387. //重新加载左边树
  1388. isShowLeft.value = false;
  1389. setTimeout(() => {
  1390. isShowLeft.value = true;
  1391. }, 500);
  1392. getTableDataAll();
  1393. }
  1394. };
  1395. //contractType, 1施工,2监理
  1396. const setContractType = (contractType) => {
  1397. if (contractType <= 0) {
  1398. authBtnTabKey.value = "1";
  1399. classType.value = "1";
  1400. } else if (contractType === 3) {
  1401. authBtnTabKey.value = "1";
  1402. classType.value = "1";
  1403. } else {
  1404. authBtnTabKey.value = contractType + "";
  1405. classType.value = contractType + "";
  1406. }
  1407. setElTreeMenu(contractType);
  1408. };
  1409. const getTableDataAll = async (key) => {
  1410. await searchNodeAllTable();
  1411. await queryNodeStatus();
  1412. // wbstree.value.resetNode().then((res)=>{
  1413. // if(res){
  1414. // searchNodeAllTable()
  1415. // queryNodeStatus()
  1416. // }
  1417. // })
  1418. //保存后自动展开到当前表单
  1419. if (!isNullES(key)) {
  1420. console.log(key);
  1421. await nextTick(() => {
  1422. ListItemRef.value?.setCollapseKey(key);
  1423. });
  1424. }
  1425. };
  1426. //结构类型tab数据和相关处理
  1427. const wbsTypeTabKey = ref(typeName);
  1428. const wbsTypeTab = ref([
  1429. { key: "map", name: "导图结构填报" },
  1430. { key: "tree", name: "树形结构填报" },
  1431. ]);
  1432. const authBtnTabdata = ref([
  1433. { key: "1", name: "施工质检" },
  1434. { key: "2", name: "监理质检" },
  1435. ]);
  1436. const wbsTypeTabChange = (item) => {
  1437. wbsTypeTabKey.value = item?.key;
  1438. ListItemDatas.value = [];
  1439. isDrawer.value = false;
  1440. treeLoading.value = typeName === "tree";
  1441. setStoreValue("classifyType", classType.value);
  1442. setStoreValue("tableOwner", authBtnTabKey.value);
  1443. //路由跳转
  1444. router.push({
  1445. path: useRoutes.path,
  1446. query: {
  1447. type: item?.key,
  1448. classifyType: classType.value,
  1449. tableOwner: authBtnTabKey.value,
  1450. },
  1451. });
  1452. getSearchTreeData();
  1453. };
  1454. //切换导图结构
  1455. const wbsMapTypeTab = () => {
  1456. wbsTypeTabChange({ key: "map", name: "导图结构填报" });
  1457. };
  1458. //设置图纸数据
  1459. const setUploadDrawingsData = async (echoParams, link) => {
  1460. const info = nodeDataInfo.value;
  1461. const { error, code, data } = await wbsApi.saveContractTreeDrawings(
  1462. {
  1463. fileUrl: link,
  1464. id: echoParams["drawingsId"],
  1465. primaryKeyId: echoParams["primaryKeyId"],
  1466. },
  1467. false
  1468. );
  1469. //处理数据
  1470. if (!error && code === 200) {
  1471. if (info["primaryKeyId"] === echoParams["primaryKeyId"]) {
  1472. nodeDataInfo.value["drawingsId"] = data;
  1473. nodeDataInfo.value["fileUrl"] = link;
  1474. window?.$message?.success("图纸上传成功");
  1475. } else {
  1476. window?.$message?.success(
  1477. "图纸上传成功,由于您切换了其他节点,需要手动刷新才能查看到图纸"
  1478. );
  1479. }
  1480. } else {
  1481. window?.$message?.error("图纸保存失败");
  1482. }
  1483. };
  1484. const NodeTreeAccordion = ref(true);
  1485. //设置树菜单数据
  1486. const ElTreeMenu = ref([]);
  1487. const TreeMark = ref(false);
  1488. const setElTreeMenu = (contractType) => {
  1489. let newArr = [];
  1490. if (contractType === 1) {
  1491. if (HcIsButton("wbs_tree_add")) {
  1492. newArr.push({ icon: "add-circle", label: "新增节点", key: "add" });
  1493. newArr.push({
  1494. icon: "add-circle",
  1495. label: "自定义节点(水利工程)",
  1496. key: "add1",
  1497. });
  1498. newArr.push({
  1499. icon: "add-circle",
  1500. label: "自定义节点(数字化文件)",
  1501. key: "add2",
  1502. });
  1503. }
  1504. if (HcIsButton("wbs_tree_edit")) {
  1505. newArr.push({ icon: "draft", label: "编辑节点", key: "edit" });
  1506. }
  1507. if (HcIsButton("wbs_tree_copy")) {
  1508. newArr.push({
  1509. icon: "file-copy-2",
  1510. label: "复制节点",
  1511. key: "copy",
  1512. });
  1513. }
  1514. if (HcIsButton("wbs_tree_mark")) {
  1515. newArr.push({ icon: "star", label: "标记为首件", key: "mark" });
  1516. TreeMark.value = true;
  1517. }
  1518. if (HcIsButton("wbs_tree_upload")) {
  1519. newArr.push({
  1520. icon: "file-upload",
  1521. label: "上传图纸",
  1522. key: "upload",
  1523. });
  1524. }
  1525. if (HcIsButton("wbs_tree_sort")) {
  1526. newArr.push({ icon: "sort-asc", label: "调整排序", key: "sort" });
  1527. }
  1528. if (HcIsButton("wbs_tree_del")) {
  1529. newArr.push({ icon: "delete-bin", label: "删除节点", key: "del" });
  1530. }
  1531. if (HcIsButton("wbs_views_division_btn")) {
  1532. newArr.push({
  1533. icon: "folder-shared",
  1534. label: "工程划分",
  1535. key: "nodetree",
  1536. });
  1537. }
  1538. } else if (contractType === 2) {
  1539. if (HcIsButton("wbs_tree_add")) {
  1540. newArr.push({ icon: "add-circle", label: "新增节点", key: "add" });
  1541. newArr.push({
  1542. icon: "add-circle",
  1543. label: "自定义节点(水利工程)",
  1544. key: "add1",
  1545. });
  1546. newArr.push({
  1547. icon: "add-circle",
  1548. label: "自定义节点(数字化文件)",
  1549. key: "add2",
  1550. });
  1551. }
  1552. if (HcIsButton("wbs_tree_copy")) {
  1553. newArr.push({
  1554. icon: "file-copy-2",
  1555. label: "复制节点",
  1556. key: "copy",
  1557. });
  1558. }
  1559. }
  1560. ElTreeMenu.value = newArr;
  1561. };
  1562. //树相关变量
  1563. const primaryKeyId = ref("");
  1564. const nodeItemInfo = ref({});
  1565. const nodeDataInfo = ref({});
  1566. const searchTreeData = ref([]);
  1567. //回车
  1568. const searchTreeKeyUp = (e) => {
  1569. if (e.key === "Enter") {
  1570. searchTreeClick();
  1571. }
  1572. };
  1573. const treeLoading = ref(true);
  1574. const searchTreeClick = async () => {
  1575. if (searchTreeVal.value) {
  1576. searchTreeHeight.value =
  1577. document.getElementById("hc-tree-scrollbar").offsetHeight;
  1578. isSearchTree.value = true;
  1579. //treeLoading.value = true
  1580. getSearchTreeData();
  1581. } else {
  1582. isSearchTree.value = false;
  1583. }
  1584. };
  1585. //懒加载的数据
  1586. const treeLoadNode = async ({ node, item, level }, resolve) => {
  1587. let contractIdRelation = "",
  1588. parentId = "",
  1589. primaryKeyId = "";
  1590. if (level !== 0) {
  1591. const nodeData = getObjValue(item);
  1592. contractIdRelation = nodeData?.contractIdRelation || "";
  1593. parentId = contractIdRelation ? nodeData?.primaryKeyId : nodeData?.id;
  1594. primaryKeyId = nodeData?.id || "";
  1595. }
  1596. //获取数据
  1597. const { data } = await queryApi.queryWbsTreeData({
  1598. contractId: contractId.value || "",
  1599. contractIdRelation,
  1600. primaryKeyId,
  1601. parentId,
  1602. // classifyType: authBtnTabKey.value,
  1603. classifyType: classType.value,
  1604. tableOwner: authBtnTabKey.value,
  1605. });
  1606. treeLoading.value = false;
  1607. resolve(getArrValue(data));
  1608. };
  1609. //树被点击
  1610. const wbsElTreeClick = ({ node, data, keys }) => {
  1611. nodeItemInfo.value = node;
  1612. nodeDataInfo.value = data;
  1613. primaryKeyId.value = data?.primaryKeyId || "";
  1614. const { notExsitChild } = data;
  1615. const { hasChildren } = data;
  1616. if (notExsitChild || !hasChildren) {
  1617. isCanadd.value = false;
  1618. getTableDataAll();
  1619. } else {
  1620. isCanadd.value = true;
  1621. ListItemDatas.value = [];
  1622. NodeStatus.value = "1";
  1623. }
  1624. setStoreValue("wbsTreeExpandKeys", keys);
  1625. TreeAutoExpandKeys.value = keys || [];
  1626. saveHistory(keys.join(","));
  1627. // getTableDataAll()
  1628. };
  1629. //树加载完成
  1630. const ElTreeNodeLoading = () => {
  1631. treeLoading.value = false;
  1632. };
  1633. //保存用户填报历史
  1634. const saveHistory = async (endNode) => {
  1635. await wbsApi.saveUserHistory({
  1636. contractId: contractId.value,
  1637. projectId: projectId.value,
  1638. endNode,
  1639. });
  1640. };
  1641. //回到上次填报历史
  1642. const gobackHistory = async () => {
  1643. isSearchTree.value = false;
  1644. const { error, code, data, msg } = await wbsApi.getUserHistory({
  1645. contractId: contractId.value,
  1646. projectId: projectId.value,
  1647. });
  1648. if (!error && code === 200) {
  1649. TreeAutoExpandKeys.value = data["endNode"].split(",") || [];
  1650. //重新加载左边树
  1651. isShowLeft.value = false;
  1652. setTimeout(() => {
  1653. isShowLeft.value = true;
  1654. }, 500);
  1655. } else {
  1656. window.$message.warning(msg);
  1657. }
  1658. };
  1659. //树菜单被点击
  1660. const ElTreeMenuClick = async ({ key, node, data, keys }) => {
  1661. nodeItemInfo.value = node;
  1662. nodeDataInfo.value = data;
  1663. setStoreValue("wbsTreeExpandKeys", keys);
  1664. TreeAutoExpandKeys.value = keys || [];
  1665. setTreeMenuDataClick({ key, node, data });
  1666. };
  1667. const treeMenuClick = (data) => {
  1668. console.log(data, "data1");
  1669. };
  1670. //导图结构数据
  1671. const NodeTreeRef = ref(null);
  1672. //鼠标左键单击事件
  1673. const NodeTreeClick = ({ keys }) => {
  1674. setStoreValue("wbsTreeExpandKeys", keys);
  1675. TreeAutoExpandKeys.value = keys || [];
  1676. };
  1677. //双击事件
  1678. const isDrawer = ref(false);
  1679. const NodeTreeDblClick = ({ node, data }) => {
  1680. nodeItemInfo.value = node;
  1681. nodeDataInfo.value = data;
  1682. primaryKeyId.value = data?.primaryKeyId || "";
  1683. isDrawer.value = true;
  1684. getTableDataAll();
  1685. };
  1686. const drawerClose = () => {
  1687. isDrawer.value = false;
  1688. ListItemDatas.value = [];
  1689. };
  1690. //导图树菜单被点击
  1691. const NodeTreeMenuClick = async ({ key, node, data }) => {
  1692. nodeItemInfo.value = node;
  1693. nodeDataInfo.value = data;
  1694. setTreeMenuDataClick({ key, node, data });
  1695. };
  1696. const orString = ref("");
  1697. //处理菜单被点击数据
  1698. const setTreeMenuDataClick = ({ key, node, data }) => {
  1699. const tabKey = wbsTypeTabKey.value;
  1700. if (key === "mark" || key === "cancel_mark") {
  1701. firstItemBox();
  1702. } else if (key === "edit") {
  1703. console.log(data, "data");
  1704. let form = {};
  1705. if (tabKey === "tree") {
  1706. const parent = deepClone(node?.parent?.data || {});
  1707. form = { ...deepClone(data), parent: parent };
  1708. } else if (tabKey === "map") {
  1709. const parent = deepClone(node?.parentNodes?.data || {});
  1710. form = { ...deepClone(data), parent: parent };
  1711. }
  1712. formEditNodeModel.value = form;
  1713. orString.value = formEditNodeModel.value?.className;
  1714. changeStandType(formEditNodeModel.value?.className);
  1715. console.log(
  1716. formEditNodeModel.value?.className,
  1717. "formEditNodeModel.value?.className"
  1718. );
  1719. editNodeModal.value = true;
  1720. //处理路径
  1721. let pathArr = [];
  1722. getPathName(node, pathArr);
  1723. form.position = pathArr.join("\\");
  1724. formEditNodeModel.value = form;
  1725. } else if (key === "copy") {
  1726. if (tabKey === "tree") {
  1727. const parent = deepClone(node?.parent?.data || {});
  1728. formCopyNodeModel.value = { ...deepClone(data), parent: parent };
  1729. } else if (tabKey === "map") {
  1730. const parent = deepClone(node?.parentNodes?.data || {});
  1731. formCopyNodeModel.value = { ...deepClone(data), parent: parent };
  1732. }
  1733. classifyType.value = authBtnTabKey.value;
  1734. copyNodeTabKey.value = "1";
  1735. copyNodeTable.value = [];
  1736. copyNodeLoading.value = false;
  1737. copyNodeModal.value = true;
  1738. } else if (key === "add") {
  1739. const { childNodes } = node;
  1740. console.log(childNodes, "childNodes");
  1741. isCustom.value = data?.isCustom;
  1742. addTreeNodeId.value = data?.primaryKeyId;
  1743. addTreeNodeOldId.value = data?.oldId;
  1744. addNodeLoading.value = false;
  1745. if (data?.isClassifition === 1) {
  1746. window.$message.warning("该节点下不能创建子节点");
  1747. addNodeModal.value = false;
  1748. return;
  1749. }
  1750. {
  1751. addNodeModal.value = true;
  1752. }
  1753. } else if (key === "add1") {
  1754. addTreeNodeId.value = data?.primaryKeyId;
  1755. addTreeNodeOldId.value = data?.oldId;
  1756. addNodeLoading.value = false;
  1757. formWaterNodeModel.value = {
  1758. nodeName: "",
  1759. nodeType: null,
  1760. };
  1761. if (data?.isClassifition === 1) {
  1762. window.$message.warning("该节点下不能创建子节点");
  1763. addNodeModalCus.value = false;
  1764. return;
  1765. }
  1766. {
  1767. addNodeModalCus.value = true;
  1768. }
  1769. } else if (key === "add2") {
  1770. addTreeNodeId.value = data?.primaryKeyId;
  1771. addTreeNodeOldId.value = data?.oldId;
  1772. addNodeLoading.value = false;
  1773. formDataNodeModel.value = {
  1774. nodeName: "",
  1775. nodeType: null,
  1776. isClassifition: 0,
  1777. className: "",
  1778. unitName: "",
  1779. unitNum: 1,
  1780. excellentNum: 1,
  1781. digitizeTime: "",
  1782. };
  1783. if (data?.isClassifition === 1) {
  1784. window.$message.warning("该节点下不能创建子节点");
  1785. addNodeModalData.value = false;
  1786. return;
  1787. } else {
  1788. addNodeModalData.value = true;
  1789. }
  1790. } else if (key === "upload") {
  1791. const info = nodeDataInfo.value;
  1792. HcUploadFileApi({
  1793. url: "/api/blade-resource/oss/endpoint/put-file",
  1794. accept: ".png,.jpg,jpeg",
  1795. accept_tip: "图片(png、jpg、jpeg)",
  1796. size: 80,
  1797. multiple: false,
  1798. echoParams: {
  1799. drawingsId: info["drawingsId"],
  1800. primaryKeyId: info["primaryKeyId"],
  1801. },
  1802. success: ({ echoParams }, { data }) => {
  1803. setUploadDrawingsData(echoParams.sourceKey, data?.link);
  1804. },
  1805. error: () => {
  1806. window.$message.error("上传失败");
  1807. },
  1808. });
  1809. } else if (key === "del") {
  1810. console.log(data, "data");
  1811. if (
  1812. data["colorStatus"] === 1 ||
  1813. data["colorStatus"] === 2 ||
  1814. data["colorStatus"] === null ||
  1815. data["colorStatus"] === -1
  1816. ) {
  1817. delModalClick();
  1818. } else {
  1819. window?.$message?.warning("该节点已存在上报数据,不允许删除");
  1820. }
  1821. } else if (key === "sort") {
  1822. let nodes = [],
  1823. childNodes = [];
  1824. if (tabKey === "tree") {
  1825. childNodes =
  1826. node?.parent?.childNodes || node?.parent?.children || [];
  1827. } else if (tabKey === "map") {
  1828. childNodes = node?.parentNodes?.childrenNodes || [];
  1829. }
  1830. for (let i = 0; i < childNodes.length; i++) {
  1831. const res = childNodes[i]?.data;
  1832. nodes.push({
  1833. id: res?.primaryKeyId,
  1834. title: res?.title,
  1835. });
  1836. }
  1837. sortNodeData.value = nodes;
  1838. sortNodeModal.value = true;
  1839. } else if (key === "nodetree") {
  1840. divisionClick();
  1841. }
  1842. };
  1843. //获取节点的路径名字
  1844. const getPathName = (node, pathArr) => {
  1845. if (node.parent?.parent) {
  1846. pathArr.unshift(node.data?.title.replace(/(^\s*)|(\s*$)/g, "")); //去掉头尾空格
  1847. getPathName(node.parent, pathArr);
  1848. } else {
  1849. //根节点结束
  1850. pathArr.unshift(node.data?.title.replace(/(^\s*)|(\s*$)/g, "")); //去掉头尾空格
  1851. return pathArr;
  1852. }
  1853. };
  1854. //确认标记为首件
  1855. const firstItemBox = () => {
  1856. const info = nodeDataInfo.value;
  1857. window?.$messageBox?.alert(
  1858. `<div class="text-base font-bold">
  1859. <span>请确认将</span>
  1860. <span class="text-main">【${info["title"]}】</span>
  1861. <span>${info["isFirst"] ? "取消" : ""}标记为首件</span>
  1862. </div>`,
  1863. "标记首件制",
  1864. {
  1865. showCancelButton: true,
  1866. dangerouslyUseHTMLString: true,
  1867. callback: (action) => {
  1868. if (action === "confirm") {
  1869. firstItemHttp(info);
  1870. }
  1871. },
  1872. }
  1873. );
  1874. };
  1875. //首件请求
  1876. const firstItemHttp = async (info) => {
  1877. const { error, code, msg } = await wbsApi.wbsTreeFirstSave({
  1878. primaryKeyId: info["primaryKeyId"],
  1879. saveOrDeleted: info["isFirst"] ? 1 : 0,
  1880. });
  1881. //处理数据
  1882. if (!error && code === 200) {
  1883. window?.$message?.success("操作成功");
  1884. window?.location?.reload(); //刷新页面
  1885. } else {
  1886. window?.$message?.error(msg);
  1887. }
  1888. };
  1889. //编辑节点
  1890. const editNodeModal = ref(false);
  1891. //获取节点类型
  1892. const nodeTypeData = ref([]);
  1893. const getDictionaryApi = async () => {
  1894. const { data } = await getDictionary({
  1895. code: "wbs_node_type",
  1896. });
  1897. //处理数据
  1898. let newArr = [];
  1899. const newData = getArrValue(data);
  1900. for (let i = 0; i < newData.length; i++) {
  1901. newArr.push({
  1902. label: newData[i]["dictValue"],
  1903. value: Number(newData[i]["dictKey"]),
  1904. });
  1905. }
  1906. nodeTypeData.value = newArr;
  1907. };
  1908. const formEditNodeRef = ref(null);
  1909. const formEditNodeModel = ref({
  1910. title: "",
  1911. parent: {
  1912. title: "",
  1913. },
  1914. nodeType: null,
  1915. partitionCode: "",
  1916. position: "",
  1917. notExsitChild: "",
  1918. });
  1919. const formEditNodeRules = {
  1920. title: {
  1921. required: true,
  1922. trigger: "blur",
  1923. message: "请输入节点名称",
  1924. },
  1925. };
  1926. const editNodeLoading = ref(false);
  1927. //保存编辑节点数据
  1928. const editNodeClick = async () => {
  1929. const validate = await formValidate(formEditNodeRef.value);
  1930. if (validate) {
  1931. //发起请求
  1932. editNodeLoading.value = true;
  1933. const {
  1934. primaryKeyId,
  1935. title,
  1936. partitionCode,
  1937. className,
  1938. unitName,
  1939. excellentNum,
  1940. unitNum,
  1941. } = formEditNodeModel.value;
  1942. const { error, code, msg } = await wbsApi.wbsTreeUpdateNode({
  1943. nodeName: title || "",
  1944. pKeyId: primaryKeyId || "",
  1945. partitionCode: partitionCode || "",
  1946. className,
  1947. unitName,
  1948. unitNum,
  1949. excellentNum,
  1950. });
  1951. //处理数据
  1952. editNodeLoading.value = false;
  1953. if (!error && code === 200) {
  1954. window?.$message?.success("修改成功");
  1955. nodeDataInfo.value["title"] = title || "";
  1956. nodeDataInfo.value["partitionCode"] = partitionCode || "";
  1957. editNodeModal.value = false;
  1958. window?.location?.reload(); //刷新页面
  1959. } else {
  1960. window?.$message?.error(msg);
  1961. }
  1962. }
  1963. };
  1964. //复制节点
  1965. const copyNodeModal = ref(false);
  1966. //复制节点类型tab数据和相关处理
  1967. const copyNodeTabKey = ref("");
  1968. const copyNodeTab = ref([
  1969. { key: "1", name: "单份复制" },
  1970. { key: "2", name: "多份复制" },
  1971. //{key: '3', name: '复制数据'}
  1972. ]);
  1973. const copyNodeTabChange = (key) => {
  1974. if (key !== copyNodeTabKey.value) {
  1975. copyNodeTabKey.value = key;
  1976. copyNodeTable.value = [];
  1977. copyNodeLoading.value = false;
  1978. }
  1979. };
  1980. //复制节点变量
  1981. const copyNodeLoading = ref(false);
  1982. const formCopyNodeModel = ref({});
  1983. const classifyList = ref([]);
  1984. const copyNodeTable = ref([]);
  1985. const isCopyData = ref(0);
  1986. //复制树被点击
  1987. const copyNodeElTreeClick = ({ data, node }) => {
  1988. const TabKey = copyNodeTabKey.value;
  1989. const { title, type, partitionCode } = formCopyNodeModel.value;
  1990. console.log(formCopyNodeModel.value, "formCopyNodeModel.value");
  1991. console.log(data, "点击data");
  1992. if (TabKey === "2") {
  1993. // setCopyNodeTable(data, title, partitionCode)
  1994. //1 单位工程,2 分部工程,3 子分部工程,4 分项工程, 5 子分项工程,6 工序
  1995. // //不能复制到本身节点下
  1996. // //只能往上一级点击,不能跨层级点击
  1997. // //已上报的工序节点不能点击选择
  1998. // //如果选择的是父级节点,那不能复制到子级节点
  1999. const { hasChildren } = data;
  2000. if (hasChildren === 0) {
  2001. if (
  2002. data["colorStatus"] === 2 ||
  2003. data["colorStatus"] == 1 ||
  2004. data["colorStatus"] === null ||
  2005. data["colorStatus"] === -1
  2006. ) {
  2007. //已上报的工序不能点击
  2008. if (data["id"] !== formCopyNodeModel.value.id) {
  2009. //不能复制到本身节点下
  2010. //只能往上一级点击,不能跨层级点击
  2011. //如果选择的是父级节点,那不能复制到子级节点
  2012. if (
  2013. type === 6 &&
  2014. (data["type"] === 4 ||
  2015. data["type"] === 5 ||
  2016. data["type"] == 6)
  2017. ) {
  2018. setCopyNodeTable(data, title);
  2019. }
  2020. if (type === 5 && data["type"] === 4) {
  2021. setCopyNodeTable(data, title, partitionCode);
  2022. }
  2023. if (
  2024. type === 4 &&
  2025. (data["type"] === 2 || data["type"] === 3)
  2026. ) {
  2027. setCopyNodeTable(data, title, partitionCode);
  2028. }
  2029. if (type === 3 && data["type"] === 2) {
  2030. setCopyNodeTable(data, title, partitionCode);
  2031. }
  2032. if (type === 2 && data["type"] === 1) {
  2033. setCopyNodeTable(data, title, partitionCode);
  2034. }
  2035. if (type === 1 && data["type"] === 1) {
  2036. setCopyNodeTable(data, title, partitionCode);
  2037. }
  2038. }
  2039. } else {
  2040. window?.$message?.warning("该节点已存在上报数据,不允许复制");
  2041. }
  2042. } else {
  2043. if (data["id"] !== formCopyNodeModel.value.id) {
  2044. //不能复制到本身节点下
  2045. //只能往上一级点击,不能跨层级点击
  2046. //如果选择的是父级节点,那不能复制到子级节点
  2047. if (
  2048. type === 6 &&
  2049. (data["type"] === 4 ||
  2050. data["type"] === 5 ||
  2051. data["type"] == 6)
  2052. ) {
  2053. setCopyNodeTable(data, title);
  2054. }
  2055. if (type === 5 && data["type"] === 4) {
  2056. setCopyNodeTable(data, title, partitionCode);
  2057. }
  2058. if (type === 4 && (data["type"] === 2 || data["type"] === 3)) {
  2059. setCopyNodeTable(data, title, partitionCode);
  2060. }
  2061. if (type === 3 && data["type"] === 2) {
  2062. setCopyNodeTable(data, title, partitionCode);
  2063. }
  2064. if (type === 2 && data["type"] === 1) {
  2065. setCopyNodeTable(data, title, partitionCode);
  2066. }
  2067. if (type === 1 && data["type"] === 1) {
  2068. setCopyNodeTable(data, title, partitionCode);
  2069. }
  2070. }
  2071. }
  2072. } else if (TabKey === "3") {
  2073. console.log(1111111);
  2074. setCopyNodeTable(data, data?.title);
  2075. }
  2076. };
  2077. const setCopyNodeTable = (data, title) => {
  2078. copyNodeTable.value.push({
  2079. title: data?.title || "",
  2080. nodeName: title || "",
  2081. primaryKeyId: data?.primaryKeyId || "",
  2082. parentId: data?.parentId || "",
  2083. id: data?.id || "",
  2084. });
  2085. };
  2086. //节点表单
  2087. const formCopyNodeModelRef = ref(null);
  2088. const formCopyNodeModelRules = {
  2089. title: {
  2090. required: true,
  2091. trigger: "blur",
  2092. message: "请输入节点名称",
  2093. },
  2094. };
  2095. //表格节点表单
  2096. const copyNodeTableRef = ref(null);
  2097. const copyNodeTableRules = {
  2098. nodeName: {
  2099. required: true,
  2100. trigger: "blur",
  2101. message: "请输入节点名称",
  2102. },
  2103. };
  2104. //删除选中的节点
  2105. const copyNodeTableDel = (index) => {
  2106. copyNodeTable.value.splice(index, 1);
  2107. };
  2108. const classifyType = ref(authBtnTabKey.value);
  2109. const classifyTypeTabClick = ({ key }) => {
  2110. classifyType.value = key;
  2111. };
  2112. //复制节点
  2113. const copyNodeClick = async () => {
  2114. const type = copyNodeTabKey.value;
  2115. const form = formCopyNodeModel.value;
  2116. const table = copyNodeTable.value;
  2117. let classify = "";
  2118. let arr = [];
  2119. if (classifyList.value.length > 0) {
  2120. classifyList.value.forEach((item) => {
  2121. if (item === "施工") {
  2122. arr.push(1);
  2123. } else if (item === "监理") {
  2124. arr.push(2);
  2125. }
  2126. });
  2127. classify = arr.join(",");
  2128. }
  2129. //isSameNode 是否同节点 1=同节点,0=跨节点
  2130. if (table.length > 0) {
  2131. table.forEach((ele) => {
  2132. if (
  2133. ele.parentId === formCopyNodeModel.value.parentId ||
  2134. ele.id === formCopyNodeModel.value.parentId
  2135. ) {
  2136. ele.isSameNode = 1;
  2137. } else {
  2138. ele.isSameNode = 0;
  2139. }
  2140. });
  2141. }
  2142. if (isCopyData.value === 1) {
  2143. if (classify) {
  2144. //效验数据
  2145. if (type === "1") {
  2146. const validate = await formValidate(formCopyNodeModelRef.value);
  2147. if (validate)
  2148. await copyContractTreeNode(type, form, [], classify);
  2149. } else if (type === "2") {
  2150. if (table.length > 0) {
  2151. const validate = await formValidate(copyNodeTableRef.value);
  2152. if (validate)
  2153. await copyContractTreeNode(type, form, table, classify);
  2154. } else {
  2155. window?.$message?.warning("请先在左侧选择要复制到的节点");
  2156. }
  2157. }
  2158. } else {
  2159. window?.$message?.warning("请选择所属方");
  2160. }
  2161. } else {
  2162. if (type === "1") {
  2163. const validate = await formValidate(formCopyNodeModelRef.value);
  2164. if (validate) await copyContractTreeNode(type, form, [], classify);
  2165. } else if (type === "2") {
  2166. if (table.length > 0) {
  2167. const validate = await formValidate(copyNodeTableRef.value);
  2168. if (validate)
  2169. await copyContractTreeNode(type, form, table, classify);
  2170. } else {
  2171. window?.$message?.warning("请先在左侧选择要复制到的节点");
  2172. }
  2173. }
  2174. }
  2175. };
  2176. //单个复制、多份复制请求
  2177. const copyContractTreeNode = async (type, form, table, classify) => {
  2178. copyNodeLoading.value = true;
  2179. if (type === "1") {
  2180. const { error, code, msg } = await wbsApi.copyContractTreeNode({
  2181. copyType: type,
  2182. needCopyNodeName: form?.title || "",
  2183. partitionCode: form?.partitionCode || "",
  2184. needCopyPrimaryKeyId: form?.primaryKeyId || "",
  2185. parentPrimaryKeyId: form?.parent?.primaryKeyId || "",
  2186. copyBatchToPaths: table,
  2187. classifyType: classify,
  2188. isCopyData: isCopyData.value,
  2189. });
  2190. //判断状态
  2191. copyNodeLoading.value = false;
  2192. if (!error && code === 200) {
  2193. window?.$message?.success("复制成功");
  2194. copyNodeModal.value = false;
  2195. window?.location?.reload(); //刷新页面
  2196. } else {
  2197. window?.$message?.error(msg);
  2198. }
  2199. } else {
  2200. const { error, code, msg } = await wbsApi.copyContractTreeNode({
  2201. copyType: type,
  2202. needCopyNodeName: form?.title || "",
  2203. needCopyPrimaryKeyId: form?.primaryKeyId || "",
  2204. parentPrimaryKeyId: form?.parent?.primaryKeyId || "",
  2205. copyBatchToPaths: table,
  2206. classifyType: classify,
  2207. isCopyData: isCopyData.value,
  2208. });
  2209. //判断状态
  2210. copyNodeLoading.value = false;
  2211. if (!error && code === 200) {
  2212. window?.$message?.success("复制成功");
  2213. copyNodeModal.value = false;
  2214. window?.location?.reload(); //刷新页面
  2215. } else {
  2216. window?.$message?.error(msg);
  2217. }
  2218. }
  2219. };
  2220. //复制数据
  2221. const copyContractNodeSubmitBusinessData = async (form, table, classify) => {
  2222. copyNodeLoading.value = true;
  2223. const { error, code } = await wbsApi.copyContractNodeSubmitBusinessData({
  2224. needCopyPrimaryKeyId: form?.primaryKeyId || "",
  2225. copyBatchToPaths: table,
  2226. classify: classify,
  2227. });
  2228. //判断状态
  2229. copyNodeLoading.value = false;
  2230. if (!error && code === 200) {
  2231. window?.$message?.success("复制成功");
  2232. copyNodeModal.value = false;
  2233. window?.location?.reload(); //刷新页面
  2234. }
  2235. };
  2236. //新增节点
  2237. const addNodeModal = ref(false);
  2238. const addTreeNodeId = ref("");
  2239. const addTreeNodeOldId = ref("");
  2240. const addTreeNodeType = ref("1");
  2241. const isCustom = ref(null);
  2242. //新增自定义节点
  2243. const addNodeModalCus = ref(false);
  2244. const addNodeLoadingCus = ref(false);
  2245. //水利工程
  2246. const formWaterNodeRef = ref(null);
  2247. const formWaterNodeModel = ref({
  2248. nodeName: "",
  2249. nodeType: null,
  2250. });
  2251. const formWaterNodeRules = {
  2252. nodeName: {
  2253. required: true,
  2254. trigger: "blur",
  2255. message: "请输入节点名称",
  2256. },
  2257. nodeType: {
  2258. required: true,
  2259. trigger: "blur",
  2260. message: "请选择节点类型",
  2261. },
  2262. };
  2263. //新增自定义节点-数字化文件
  2264. const addNodeModalData = ref(false);
  2265. const addNodeLoadingData = ref(false);
  2266. const formDataNodeRef = ref(null);
  2267. const formDataNodeModel = ref({
  2268. nodeName: "",
  2269. nodeType: null,
  2270. isClassifition: 0,
  2271. className: "",
  2272. unitName: "",
  2273. unitNum: 1,
  2274. excellentNum: 1,
  2275. digitizeTime: "",
  2276. });
  2277. const standardTypeOptions = ref([]);
  2278. const getStandardTypeOptions = async () => {
  2279. const { data } = await getDictionary({
  2280. code: "classification",
  2281. });
  2282. standardTypeOptions.value = await getDictionaryData(
  2283. "classification",
  2284. false
  2285. );
  2286. standardTypeOptions.value.forEach((element) => {
  2287. // element.parentId=
  2288. data.forEach((ele) => {
  2289. if (ele.dictKey == element.value) {
  2290. element.id = ele.id;
  2291. }
  2292. });
  2293. });
  2294. // 定义要过滤的 dictKey 值
  2295. const targetKeys = [1, 2, 3, 4];
  2296. // 过滤数组
  2297. standardTypeOptions.value = standardTypeOptions.value.filter((item) =>
  2298. targetKeys.includes(item.value)
  2299. );
  2300. };
  2301. const unitNameOptions = ref([]);
  2302. const changeStandType = async (val) => {
  2303. if (val !== orString.value) {
  2304. formEditNodeModel.value.unitName = "";
  2305. }
  2306. formDataNodeModel.value.unitName = "";
  2307. let parentId = "";
  2308. standardTypeOptions.value.forEach((item) => {
  2309. if (item.value == val) {
  2310. parentId = item.id;
  2311. }
  2312. });
  2313. const { data } = await getChildList({ current: 1, size: 10000, parentId });
  2314. unitNameOptions.value = data;
  2315. unitNameOptions.value = unitNameOptions.value.filter(
  2316. (item) => item.dictKey != -1
  2317. );
  2318. unitNameOptions.value.forEach((ele) => {
  2319. ele.dictKey = Number(ele.dictKey);
  2320. });
  2321. };
  2322. const formDataNodeRules = {
  2323. nodeName: {
  2324. required: true,
  2325. trigger: "blur",
  2326. message: "请输入节点名称",
  2327. },
  2328. nodeType: {
  2329. required: true,
  2330. trigger: "blur",
  2331. message: "请选择节点类型",
  2332. },
  2333. isClassifition: {
  2334. required: true,
  2335. trigger: "blur",
  2336. message: "请选择是否含单元评定",
  2337. },
  2338. className: {
  2339. required: true,
  2340. trigger: "blur",
  2341. message: "请选择标准分类",
  2342. },
  2343. unitName: {
  2344. required: true,
  2345. trigger: "blur",
  2346. message: "请选择单位名称",
  2347. },
  2348. excellentNum: {
  2349. required: true,
  2350. trigger: "blur",
  2351. message: "请输入优良个数",
  2352. },
  2353. unitNum: {
  2354. required: true,
  2355. trigger: "blur",
  2356. message: "请输入单元个数",
  2357. },
  2358. digitizeTime: {
  2359. required: true,
  2360. trigger: "blur",
  2361. message: "请选择时间",
  2362. },
  2363. };
  2364. const addNodeClickData = async () => {
  2365. const validate = await formValidate(formDataNodeRef.value);
  2366. if (!validate) return;
  2367. //发起请求
  2368. addNodeClickData.value = true;
  2369. const { error, code, msg } = await wbsApi.saveCustomAddContractNode({
  2370. nodeName: formDataNodeModel.value.nodeName,
  2371. nodeType: formDataNodeModel.value?.nodeType || "",
  2372. partitionCode: nodeDataInfo.value?.partitionCode || "",
  2373. primaryKeyId: nodeDataInfo.value?.primaryKeyId || "",
  2374. nodeClass: 2, //数字化文件
  2375. isClassifition: formDataNodeModel.value?.isClassifition || 0,
  2376. className: formDataNodeModel.value?.className || "",
  2377. unitName: Number(formDataNodeModel.value?.unitName) || "",
  2378. excellentNum: formDataNodeModel.value?.excellentNum || 0,
  2379. digitizeTime: formDataNodeModel.value?.digitizeTime || "",
  2380. unitNum: formDataNodeModel.value?.unitNum || 0,
  2381. });
  2382. //判断状态
  2383. addNodeClickData.value = false;
  2384. if (!error && code === 200) {
  2385. window?.$message?.success("新增成功");
  2386. addNodeModalData.value = false;
  2387. window?.location?.reload(); //刷新页面
  2388. } else {
  2389. window?.$message?.error(msg);
  2390. }
  2391. };
  2392. //选中的节点
  2393. const allSelectedList = ref([]);
  2394. const halfSelectedList = ref([]);
  2395. const addTreeNodeCheckChange = (nodes) => {
  2396. let NodesArr = [],
  2397. halfArr = [];
  2398. //全选数据
  2399. const keys = nodes.checkedNodes || [];
  2400. console.log(keys, "keys");
  2401. for (let i = 0; i < keys.length; i++) {
  2402. NodesArr.push({
  2403. nodeName: keys[i].nodeName,
  2404. primaryKeyId: keys[i].pKeyId,
  2405. isPeer: keys[i].isPeer || 2,
  2406. });
  2407. }
  2408. allSelectedList.value = NodesArr;
  2409. console.log(allSelectedList.value, " allSelectedList.value");
  2410. //半选数据
  2411. const halfNodes = nodes.halfCheckedNodes || [];
  2412. for (let i = 0; i < halfNodes.length; i++) {
  2413. halfArr.push({
  2414. nodeName: halfNodes[i].nodeName,
  2415. primaryKeyId: halfNodes[i].pKeyId,
  2416. isPeer: halfNodes[i].isPeer || 2,
  2417. });
  2418. }
  2419. halfSelectedList.value = halfArr;
  2420. console.log(halfSelectedList.value, " halfSelectedList.value");
  2421. };
  2422. //新增节点
  2423. const addNodeLoading = ref(false);
  2424. const addNodeClick = async () => {
  2425. const keys = allSelectedList.value || [];
  2426. if (keys.length <= 0) {
  2427. window?.$message?.warning("请先选择节点");
  2428. } else {
  2429. //发起请求
  2430. addNodeLoading.value = true;
  2431. const primaryKeyId = nodeDataInfo.value?.primaryKeyId || "";
  2432. const { error, code } = await wbsApi.saveContractTreeNode({
  2433. projectId: projectId.value,
  2434. contractId: contractId.value,
  2435. saveType: addTreeNodeType.value,
  2436. allSelectedList: allSelectedList.value,
  2437. halfSelectedList: halfSelectedList.value,
  2438. currentNodePrimaryKeyId: primaryKeyId,
  2439. });
  2440. //判断状态
  2441. addNodeLoading.value = false;
  2442. if (!error && code === 200) {
  2443. window?.$message?.success("新增成功");
  2444. addNodeModal.value = false;
  2445. window?.location?.reload(); //刷新页面
  2446. }
  2447. }
  2448. };
  2449. const addNodeClickCur = async () => {
  2450. const validate = await formValidate(formWaterNodeRef.value);
  2451. if (!validate) return;
  2452. //发起请求
  2453. addNodeLoadingCus.value = true;
  2454. const { error, code, msg } = await wbsApi.saveCustomAddContractNode({
  2455. nodeName: formWaterNodeModel.value.nodeName,
  2456. nodeType: formWaterNodeModel.value?.nodeType || "",
  2457. partitionCode: nodeDataInfo.value?.partitionCode || "",
  2458. primaryKeyId: nodeDataInfo.value?.primaryKeyId || "",
  2459. nodeClass: 1, //1水利化工程,2数字化文件
  2460. });
  2461. //判断状态
  2462. addNodeLoadingCus.value = false;
  2463. if (!error && code === 200) {
  2464. window?.$message?.success("新增成功");
  2465. addNodeModalCus.value = false;
  2466. window?.location?.reload(); //刷新页面
  2467. } else {
  2468. window?.$message?.error(msg || "操作失败");
  2469. }
  2470. };
  2471. //删除节点
  2472. const delModalClick = async () => {
  2473. const { code, msg } = await wbsApi.removeContractTreeNodeJudge({
  2474. ids: nodeDataInfo.value?.primaryKeyId || "",
  2475. });
  2476. if (code === 200) {
  2477. HcDelMsg(async (resolve) => {
  2478. await removeContractTreeNode();
  2479. resolve(); //关闭弹窗的回调
  2480. });
  2481. } else {
  2482. NewDelMsg({ text: msg }, async (resolve) => {
  2483. await removeContractTreeNode();
  2484. resolve(); //关闭弹窗的回调
  2485. });
  2486. }
  2487. };
  2488. const removeContractTreeNode = async () => {
  2489. const loadingInstance = window.$loading.service({
  2490. fullscreen: true,
  2491. text: "删除节点中,请耐心等待...",
  2492. background: "rgba(0, 0, 0, 0.7)",
  2493. });
  2494. const { error, code, msg } = await wbsApi.removeContractTreeNode({
  2495. ids: nodeDataInfo.value?.primaryKeyId || "",
  2496. });
  2497. //处理结果
  2498. loadingInstance.close();
  2499. if (!error && code === 200) {
  2500. window?.$message?.success("删除成功");
  2501. window?.location?.reload(); //刷新页面
  2502. } else {
  2503. window.$message.error(msg);
  2504. }
  2505. };
  2506. //调整排序
  2507. const sortNodeModal = ref(false);
  2508. const sortNodeLoading = ref(false);
  2509. const sortNodeData = ref([]);
  2510. const sortNodeDrag = ref(false);
  2511. //向下
  2512. const downSortClick = (index) => {
  2513. const indexs = index + 1;
  2514. const data = sortNodeData.value || [];
  2515. if (indexs !== data.length) {
  2516. const tmp = data.splice(indexs, 1);
  2517. sortNodeData.value.splice(index, 0, tmp[0]);
  2518. } else {
  2519. window?.$message?.warning("已经处于置底,无法下移");
  2520. }
  2521. };
  2522. //向上
  2523. const upSortClick = (index) => {
  2524. const data = sortNodeData.value || [];
  2525. if (index !== 0) {
  2526. const tmp = data.splice(index - 1, 1);
  2527. sortNodeData.value.splice(index, 0, tmp[0]);
  2528. } else {
  2529. window?.$message?.warning("已经处于置顶,无法上移");
  2530. }
  2531. };
  2532. //确认排序
  2533. const sortNodeClick = async () => {
  2534. const sortList = [];
  2535. const nodes = sortNodeData.value || [];
  2536. nodes.forEach((item) => {
  2537. sortList.push(item?.id);
  2538. });
  2539. //发起请求
  2540. sortNodeLoading.value = true;
  2541. const { error, code, msg } = await wbsApi.diySortTreeNode({ sortList });
  2542. sortNodeLoading.value = false;
  2543. //判断状态
  2544. if (!error && code === 200) {
  2545. window?.$message?.success("保存成功");
  2546. sortNodeModal.value = false;
  2547. window?.location?.reload(); //刷新页面
  2548. } else {
  2549. window.$message.error(msg);
  2550. }
  2551. };
  2552. //查看图纸
  2553. const drawList = ref("");
  2554. const drawingsShow = ref(false);
  2555. const viewsDrawings = () => {
  2556. const { primaryKeyId, drawingsId } = nodeDataInfo.value;
  2557. if (!primaryKeyId) {
  2558. window?.$message?.warning("请先选择树节点");
  2559. } else if (drawingsId === -1 || drawingsId === null) {
  2560. window?.$message?.warning("该节点暂未上传图纸");
  2561. } else {
  2562. drawingsShow.value = true;
  2563. getDrawList(drawingsId);
  2564. }
  2565. };
  2566. const drawingsClose = (res) => {
  2567. drawingsShow.value = res;
  2568. };
  2569. const getDrawList = async (primaryKeyId) => {
  2570. const { error, code, data } = await wbsApi.getTreeDrawings({
  2571. primaryKeyId,
  2572. });
  2573. //判断状态
  2574. if (!error && code === 200) {
  2575. drawList.value = data;
  2576. } else {
  2577. drawList.value = data;
  2578. }
  2579. };
  2580. //设置滚动条位置
  2581. const ListItemScrollRef = ref(null);
  2582. const ListItemOffsetTop = (offsetTop) => {
  2583. if (offsetTop > 0) {
  2584. setTimeout(() => {
  2585. ListItemScrollRef.value?.setScrollTop(offsetTop);
  2586. }, 350);
  2587. } else {
  2588. ListItemScrollRef.value?.setScrollTop(offsetTop);
  2589. }
  2590. };
  2591. //获取数据列表
  2592. const ListItemDatas = ref([]);
  2593. const ListItemLoading = ref(false);
  2594. const searchNodeAllTable = async () => {
  2595. ListItemLoading.value = true;
  2596. ListItemDatas.value = [];
  2597. const info = nodeDataInfo.value;
  2598. const { data } = await wbsApi.searchNodeAllTable({
  2599. projectId: projectId.value,
  2600. contractId: contractId.value,
  2601. primaryKeyId: info["primaryKeyId"],
  2602. type: authBtnTabKey.value,
  2603. });
  2604. ListItemDatas.value = getArrValue(data);
  2605. ListItemLoading.value = false;
  2606. };
  2607. const newlistdata = ref([]);
  2608. const searchNodeAllTable1 = async () => {
  2609. console.log("重新获取表单列表");
  2610. const info = nodeDataInfo.value;
  2611. const { data } = await wbsApi.searchNodeAllTable({
  2612. projectId: projectId.value,
  2613. contractId: contractId.value,
  2614. primaryKeyId: info["primaryKeyId"],
  2615. type: authBtnTabKey.value,
  2616. });
  2617. newlistdata.value = getArrValue(data);
  2618. };
  2619. //查询状态
  2620. const NodeStatus = ref("1");
  2621. const queryNodeStatus = async () => {
  2622. const info = nodeDataInfo.value;
  2623. if (contractInfo.value?.contractType == 1) {
  2624. const { error, code, data } = await wbsApi.queryNodeStatus({
  2625. primaryKeyId: info["primaryKeyId"],
  2626. //classify:1
  2627. classify: authBtnTabKey.value,
  2628. });
  2629. //1 未填报,2待上报,3已上报
  2630. if (!error && code === 200) {
  2631. NodeStatus.value = data ?? "1";
  2632. } else {
  2633. NodeStatus.value = "1";
  2634. }
  2635. } else {
  2636. const { error, code, data } = await wbsApi.queryNodeStatusJl({
  2637. // primaryKeyId: info['contractIdRelation'] ? info['id'] : info['primaryKeyId'],
  2638. primaryKeyId: info["primaryKeyId"],
  2639. //classify: 1
  2640. classify: authBtnTabKey.value,
  2641. });
  2642. //1 未填报,2待上报,3已上报
  2643. if (!error && code === 200) {
  2644. NodeStatus.value = data ?? "1";
  2645. } else {
  2646. NodeStatus.value = "1";
  2647. }
  2648. }
  2649. };
  2650. //批量上报
  2651. const reportIds = ref("");
  2652. const reportTaskName = ref("");
  2653. const reportAddition = ref({});
  2654. const showReportModal = ref(false);
  2655. const reportLoading = ref(false);
  2656. const reportTypeData = ref([]);
  2657. const reportModalClick = async () => {
  2658. const info = nodeDataInfo.value;
  2659. const rows = ListItemDatas.value;
  2660. if (rows.length > 0) {
  2661. reportLoading.value = true;
  2662. const taskCheck = await eVisaTaskCheckApi({
  2663. projectId: projectId.value,
  2664. contractId:
  2665. contractInfo.value?.contractType == 2
  2666. ? info?.contractIdRelation
  2667. : contractId.value,
  2668. // contractId: contractId.value
  2669. });
  2670. //处理数据
  2671. let newArr = [];
  2672. for (let i = 0; i < rows.length; i++) {
  2673. newArr.push(rows[i]["isTypePrivatePid"]);
  2674. }
  2675. reportTypeData.value = newArr;
  2676. reportLoading.value = false;
  2677. if (taskCheck) {
  2678. //初始弹出弹窗,防呆
  2679. reportIds.value = info["primaryKeyId"];
  2680. reportAddition.value = {
  2681. classify: authBtnTabKey.value,
  2682. contractIdRelation: info["contractIdRelation"],
  2683. };
  2684. showReportModal.value = true;
  2685. //请求文件题名
  2686. const { data } = await wbsApi.queryDocumentTitle({
  2687. primaryKeyId: info["primaryKeyId"],
  2688. classify: authBtnTabKey.value,
  2689. });
  2690. reportTaskName.value = isString(data) ? data : "";
  2691. }
  2692. } else {
  2693. window.$message?.warning("暂无相关数据");
  2694. }
  2695. };
  2696. //上报完成
  2697. const showReportFinish = () => {
  2698. showReportModal.value = false;
  2699. getTableDataAll();
  2700. window?.location?.reload(); //刷新页面
  2701. };
  2702. //表单变量
  2703. const ListItemRef = ref(null);
  2704. const ListItemsRef = ref(null);
  2705. //保存
  2706. const tableFormSaveLoading = ref(false);
  2707. const tableFormSaveClick = async () => {
  2708. //获取数据
  2709. let FormData = [],
  2710. FormRegExpJson = {};
  2711. if (isDrawer.value) {
  2712. FormData = await ListItemsRef.value?.getFormData();
  2713. FormRegExpJson = await ListItemsRef.value?.getFormRegExpJson();
  2714. } else {
  2715. FormData = await ListItemRef.value?.getFormData();
  2716. FormRegExpJson = await ListItemRef.value?.getFormRegExpJson();
  2717. }
  2718. //效验数据
  2719. if (getObjVal(FormRegExpJson)) {
  2720. setFormRegExpJson(FormRegExpJson);
  2721. } else if (FormData.length > 0) {
  2722. console.log("保存");
  2723. tableFormSaveLoading.value = true;
  2724. console.log("FormData", FormData);
  2725. const { error, code, msg } = await wbsApi.saveExcelBussData({
  2726. dataInfo: { orderList: FormData },
  2727. });
  2728. tableFormSaveLoading.value = false;
  2729. if (!error && code === 200) {
  2730. window?.$message?.success("保存成功");
  2731. // await bussPdfsClick()
  2732. const activeKey = ListItemRef.value?.getActiveKey();
  2733. getTableDataAll(activeKey);
  2734. } else {
  2735. window?.$message?.error(msg || "操作失败");
  2736. }
  2737. } else {
  2738. console.log("预览");
  2739. // await bussPdfsClick()
  2740. }
  2741. };
  2742. //效验数据
  2743. const setFormRegExpJson = (FormRegExpJson) => {
  2744. let nodeName = "",
  2745. itemId = "";
  2746. Object.keys(FormRegExpJson).forEach((key) => {
  2747. const name = FormRegExpJson[key]?.nodeName ?? "";
  2748. if (name) {
  2749. if (nodeName) {
  2750. nodeName += "," + name;
  2751. } else {
  2752. nodeName = name;
  2753. itemId = FormRegExpJson[key]?.itemId;
  2754. }
  2755. }
  2756. });
  2757. //const activeKey = ListItemRef.value?.getActiveKey()
  2758. //弹出提示
  2759. const val =
  2760. '<div style="font-size: 16px;">请先完善 <span style="color:#1ECC95;">' +
  2761. nodeName +
  2762. "</span> 的数据内容</div>";
  2763. window?.$messageBox?.alert(val, "表单完善提醒", {
  2764. confirmButtonText: "确定",
  2765. dangerouslyUseHTMLString: true,
  2766. callback: (action) => {
  2767. if (action === "confirm") {
  2768. ListItemRef.value?.setActiveKey(itemId);
  2769. ListItemOffsetTop(0);
  2770. setTimeout(() => {
  2771. const offsetTop =
  2772. document.getElementById(itemId)?.offsetTop;
  2773. ListItemOffsetTop(offsetTop);
  2774. }, 350);
  2775. }
  2776. },
  2777. });
  2778. };
  2779. //多表预览
  2780. const bussPdfsLoading = ref(false);
  2781. const bussPdfsClick = async () => {
  2782. const info = nodeDataInfo.value;
  2783. bussPdfsLoading.value = true;
  2784. const { error, code, data } = await wbsApi.getBussPdfs({
  2785. nodeId: info?.primaryKeyId || "",
  2786. classify: authBtnTabKey.value,
  2787. projectId: projectId.value,
  2788. // contractId: contractId.value
  2789. contractId:
  2790. contractInfo.value?.contractType == 2
  2791. ? info?.contractIdRelation
  2792. : contractId.value,
  2793. });
  2794. tableFormSaveLoading.value = false;
  2795. bussPdfsLoading.value = false;
  2796. if (!error && code === 200) {
  2797. toPdfPage(data);
  2798. //window.open(data, '_blank')
  2799. } else {
  2800. window.$message?.warning("获取PDF失败");
  2801. }
  2802. };
  2803. //撤回上报流程
  2804. const abolishLoaing = ref(false);
  2805. const abolishOneClick = () => {
  2806. window?.$messageBox?.alert("请谨慎考虑后,是否确定撤回?", "撤回上报", {
  2807. showCancelButton: true,
  2808. confirmButtonText: "确定撤回",
  2809. cancelButtonText: "取消",
  2810. callback: (action) => {
  2811. if (action === "confirm") {
  2812. abolishOneSave();
  2813. }
  2814. },
  2815. });
  2816. };
  2817. //撤回请求
  2818. const abolishOneSave = async () => {
  2819. const info = nodeDataInfo.value;
  2820. abolishLoaing.value = true;
  2821. const { error, code } = await wbsApi.abolishOne({
  2822. primaryKeyId: info?.primaryKeyId || "",
  2823. classify: authBtnTabKey.value,
  2824. projectId: projectId.value,
  2825. contractId: contractId.value,
  2826. });
  2827. abolishLoaing.value = false;
  2828. if (!error && code === 200) {
  2829. window.$message?.success("撤回成功");
  2830. getTableDataAll();
  2831. window?.location?.reload(); //刷新页面
  2832. }
  2833. };
  2834. //附件列表
  2835. const attachmentModal = ref(false);
  2836. const attachmentModalShow = () => {
  2837. attachmentModal.value = true;
  2838. getAttachmentList();
  2839. };
  2840. const attachmentListLoaing = ref(false);
  2841. const attachmentList = ref([]);
  2842. const getAttachmentList = async () => {
  2843. attachmentListLoaing.value = true;
  2844. const info = nodeDataInfo.value;
  2845. const { error, code, data } = await wbsApi.tablesAndFile({
  2846. primaryKeyId: info?.primaryKeyId || "",
  2847. type: authBtnTabKey.value,
  2848. contractId: contractId.value,
  2849. projectId: projectId.value,
  2850. classify: authBtnTabKey.value,
  2851. });
  2852. attachmentListLoaing.value = false;
  2853. if (!error && code === 200) {
  2854. attachmentList.value = getArrValue(data);
  2855. } else {
  2856. attachmentList.value = [];
  2857. }
  2858. };
  2859. //预览
  2860. const previewFile = (item) => {
  2861. toPdfPage(item["domainPdfUrl"]);
  2862. //window.open(item['domainPdfUrl'], '_blank')
  2863. };
  2864. //删除
  2865. const delFile = async (item) => {
  2866. item.loading = true;
  2867. const { error, code, msg } = await wbsApi.removeBussFile({
  2868. ids: item.id,
  2869. });
  2870. item.loading = false;
  2871. if (!error && code === 200) {
  2872. window?.$message?.success("删除成功");
  2873. getAttachmentList();
  2874. getTableDataAll();
  2875. return true;
  2876. } else {
  2877. window.$message.error(msg);
  2878. return false;
  2879. }
  2880. };
  2881. //划分变更
  2882. const divisionClick = () => {
  2883. router.push({
  2884. path: "/data-fill/division",
  2885. });
  2886. };
  2887. //树展开和收起
  2888. const isWbsTreeShow = ref(true);
  2889. const setWbsTreeShow = () => {
  2890. isWbsTreeShow.value = !isWbsTreeShow.value;
  2891. };
  2892. //拷贝内容
  2893. const copyPositionText = (val) => {
  2894. if (val) {
  2895. //navigator.clipboard.writeText(val);
  2896. setCopyText(val)
  2897. .then(() => {
  2898. window.$message?.success("复制成功");
  2899. })
  2900. .catch(() => {
  2901. window.$message?.error("复制失败,请手动复制");
  2902. });
  2903. } else {
  2904. window.$message?.warning("没有可复制的数据");
  2905. }
  2906. };
  2907. //左右拖动,改变树形结构宽度
  2908. const isMouseTree = ref(false);
  2909. const onmousedown = () => {
  2910. let leftNum = 0;
  2911. if (isLayout.value === "no") {
  2912. leftNum = 0;
  2913. } else {
  2914. leftNum = isCollapse.value ? 142 : 272;
  2915. }
  2916. isMouseTree.value = true;
  2917. document.onmousemove = async (ve) => {
  2918. let diffVal = ve.clientX - leftNum;
  2919. if (diffVal >= 310 && diffVal <= 900) {
  2920. leftWidth.value = diffVal;
  2921. }
  2922. };
  2923. document.onmouseup = () => {
  2924. document.onmousemove = null;
  2925. document.onmouseup = null;
  2926. isMouseTree.value = false;
  2927. };
  2928. };
  2929. //更新配置
  2930. watch(
  2931. () => leftWidth.value,
  2932. (diffVal) => {
  2933. setUserConfig(diffVal);
  2934. }
  2935. );
  2936. const setUserConfig = async (data) => {
  2937. await useClick();
  2938. useAppState.setTreeWidth(data);
  2939. await userConfigSave({ treeWidth: data });
  2940. };
  2941. //同步质检资料
  2942. const syncdataloading = ref(false);
  2943. const syncdata = async () => {
  2944. ListItemRef.value?.setActiveKey("");
  2945. const info = nodeDataInfo.value;
  2946. syncdataloading.value = true;
  2947. const { error, code, msg } = await wbsApi.syncTbadata({
  2948. pKeyId: info?.primaryKeyId || "",
  2949. });
  2950. syncdataloading.value = false;
  2951. if (!error && code === 200) {
  2952. window.$message?.success(msg);
  2953. getTableDataAll();
  2954. // window?.location?.reload() //刷新页面
  2955. }
  2956. };
  2957. //同步工序资料
  2958. const syncWorkloading = ref(false);
  2959. const syncWork = async () => {
  2960. ListItemRef.value?.setActiveKey("");
  2961. const info = nodeDataInfo.value;
  2962. syncdataloading.value = true;
  2963. const { error, code, msg } = await wbsApi.syncWorkDate({
  2964. nodeId: info?.primaryKeyId || "",
  2965. });
  2966. syncdataloading.value = false;
  2967. if (!error && code === 200) {
  2968. window.$message?.success(msg);
  2969. getTableDataAll();
  2970. // window?.location?.reload() //刷新页面
  2971. }
  2972. };
  2973. //附件添加
  2974. const typeoptions = ref([
  2975. {
  2976. value: "1",
  2977. label: "模板1",
  2978. },
  2979. {
  2980. value: "2",
  2981. label: "模板2",
  2982. },
  2983. ]);
  2984. const getFileTypeApi = async () => {
  2985. const { data } = await getDictionaryBiz({
  2986. code: "table_file_type",
  2987. });
  2988. //处理数据
  2989. let newArr = [];
  2990. const newData = getArrValue(data);
  2991. for (let i = 0; i < newData.length; i++) {
  2992. newArr.push({
  2993. label: newData[i]["dictValue"],
  2994. value: Number(newData[i]["dictKey"]),
  2995. });
  2996. }
  2997. typeoptions.value = newArr;
  2998. };
  2999. const typevalue = ref("");
  3000. const isCanadd = ref(true);
  3001. const uploadModal = ref(false);
  3002. const fileListData = ref([]);
  3003. const uploadData = ref({});
  3004. const uploadModalClose = () => {
  3005. uploadModal.value = false;
  3006. typevalue.value = "";
  3007. };
  3008. //获取附件添加列表
  3009. const getBussFileList = async (pkeyId) => {
  3010. const { error, code, data } = await wbsApi.selectTableFileListByTen({
  3011. pkeyid: pkeyId,
  3012. classify: authBtnTabKey.value,
  3013. });
  3014. if (!error && code === 200) {
  3015. fileListData.value = getArrValue(data);
  3016. } else {
  3017. fileListData.value = [];
  3018. }
  3019. };
  3020. const addFilelist = async () => {
  3021. getBussFileList(primaryKeyId.value);
  3022. uploadModal.value = true;
  3023. await getFileTypeApi();
  3024. //上传的配置
  3025. uploadData.value = {
  3026. classify: authBtnTabKey.value,
  3027. nodeId: primaryKeyId.value,
  3028. type: typevalue.value,
  3029. contractId: contractId.value,
  3030. };
  3031. };
  3032. const changeType = (val) => {
  3033. uploadData.value.type = val;
  3034. };
  3035. //上传文件
  3036. const uploadChange = async ({ type }) => {
  3037. if (type === "success") {
  3038. getBussFileList(primaryKeyId.value);
  3039. } else if (type === "del") {
  3040. getBussFileList(primaryKeyId.value);
  3041. }
  3042. };
  3043. //树节点被选中
  3044. const treeSelectNode = ref([]);
  3045. const treeSelectdata = ref([]);
  3046. const ElTreeNodeCheck = (_, { checkedKeys, checkedNodes }) => {
  3047. console.log(checkedNodes, "checkedNodes");
  3048. treeSelectNode.value = getArrValue(checkedKeys);
  3049. treeSelectdata.value = getArrValue(checkedNodes);
  3050. };
  3051. //隐藏节点
  3052. const hideSaveLoading = ref(false);
  3053. const hideTreeNode = async () => {
  3054. const arr = getArrValue(treeSelectdata.value);
  3055. if (arr.length <= 0) {
  3056. window?.$message?.warning("请先在左侧项目树选择节点");
  3057. return;
  3058. }
  3059. let isExist = false;
  3060. for (let i = 0; i < arr.length; i++) {
  3061. if ([2, 3, 4].includes(arr[i].colorStatus)) {
  3062. isExist = true;
  3063. break;
  3064. }
  3065. }
  3066. if (isExist) {
  3067. window.$message.warning("已审批和已填报-待审批状态的节点,不可隐藏;");
  3068. return;
  3069. }
  3070. const keys = arrToKey(treeSelectdata.value, "pKeyId", ",");
  3071. //发起请求
  3072. hideSaveLoading.value = true;
  3073. const { error, code, msg } = await wbsApi.updateNodeStates(
  3074. {
  3075. ids: keys,
  3076. status: 2,
  3077. },
  3078. false
  3079. );
  3080. hideSaveLoading.value = false;
  3081. if (!error && code === 200) {
  3082. window?.$message?.success(msg || "操作成功");
  3083. setTimeout(() => {
  3084. window?.location?.reload(); //刷新页面
  3085. }, 1000);
  3086. } else {
  3087. window?.$message?.error(msg);
  3088. }
  3089. };
  3090. const loadMenu = ({ node, item, level }, resolve) => {
  3091. setElTreeMenu(contractInfo.value?.contractType);
  3092. let menusArr = ElTreeMenu.value;
  3093. const { isCustomChild, notExsitChild } = item; //isCustomChild===1//代表子级是自定义节点
  3094. // const { isCustom } = item
  3095. // if (isCustom === 1 && isCustomChild === 0 && notExsitChild) {//无子级,显示两个按钮
  3096. // menusArr.unshift( { icon: 'add-circle', label: '新增自定义节点', key: 'add1' })
  3097. // resolve(menusArr)
  3098. // } else if (isCustom === 1 && isCustomChild === 1) {//自定义节点类型下如果有自定义节点,就不允许新增节点
  3099. // menusArr.unshift( { icon: 'add-circle', label: '新增自定义节点', key: 'add1' })
  3100. // let menusArr1 = arrDelKey(menusArr, 'label', '新增节点') // [{id:1}]
  3101. // resolve(menusArr1)
  3102. // } else if (isCustom === 1 && isCustomChild === 0 && !notExsitChild) { //自定义节点类型下如果有划分节点,就不允许新增自定义节点
  3103. // resolve(menusArr)
  3104. // } else if (level === 1) {
  3105. // menusArr = [ { icon: 'add-circle', label: '新增自定义节点', key: 'add1' }]
  3106. // resolve(menusArr)
  3107. // } else {
  3108. // resolve(menusArr)
  3109. // }
  3110. if (level === 1) {
  3111. menusArr = [
  3112. {
  3113. icon: "add-circle",
  3114. label: "自定义节点(水利工程)",
  3115. key: "add1",
  3116. },
  3117. {
  3118. icon: "add-circle",
  3119. label: "自定义节点(数字化文件)",
  3120. key: "add2",
  3121. },
  3122. ];
  3123. resolve(menusArr);
  3124. } else {
  3125. resolve(menusArr);
  3126. }
  3127. };
  3128. //批量保存
  3129. const nodeSaveLoading = ref(false);
  3130. const NodeSaveClick = async () => {
  3131. const keys = treeSelectNode.value;
  3132. const rows = treeSelectdata.value;
  3133. if (rows.length <= 0 || keys.length <= 0) {
  3134. window?.$message?.warning("请先在左侧项目树选择节点");
  3135. return;
  3136. }
  3137. //判断是否满足条件
  3138. let result = false;
  3139. if (!website.localModel) {
  3140. result = rows.every(({ colorStatus }) => {
  3141. return colorStatus === 1 || colorStatus === 2;
  3142. });
  3143. } else {
  3144. //183 甬台温
  3145. result = rows.every(({ colorStatus }) => {
  3146. return colorStatus === 1 || colorStatus === 2 || colorStatus === 4;
  3147. });
  3148. }
  3149. if (!result) {
  3150. window?.$message?.warning("只能选择未上报的节点进行辅助保存");
  3151. return;
  3152. }
  3153. //发起请求
  3154. nodeSaveLoading.value = true;
  3155. const { error, code, msg } = await wbsApi.save_nodeId(
  3156. {
  3157. projectId: projectId.value,
  3158. contractId: contractId.value,
  3159. classify: authBtnTabKey.value,
  3160. nodeIds: keys.join(),
  3161. },
  3162. false
  3163. );
  3164. nodeSaveLoading.value = false;
  3165. if (!error && code === 200) {
  3166. window?.$message?.success("批量保存成功");
  3167. window?.location?.reload(); //刷新页面
  3168. } else {
  3169. window?.$message?.error(msg);
  3170. }
  3171. };
  3172. //排序
  3173. const tableSortFormRef = ref(null);
  3174. const sortFormShow = ref(false);
  3175. const tableSortFormColumn = [{ key: "nodeName", name: "名称" }];
  3176. const tableSortFormData = ref([]);
  3177. const sortFormClick = () => {
  3178. sortFormShow.value = true;
  3179. tableSortFormData.value = deepClone(ListItemDatas.value);
  3180. };
  3181. // 行拖拽
  3182. const sortFormDropTap = (rows) => {
  3183. tableSortFormData.value = []; // 先清空,否则排序会异常
  3184. nextTick(() => {
  3185. tableSortFormRef.value?.setData(rows);
  3186. });
  3187. };
  3188. // 点击排序
  3189. const rowSortFormTap = (rows) => {
  3190. tableSortFormData.value = []; // 先清空,否则排序会异常
  3191. nextTick(() => {
  3192. tableSortFormData.value = rows;
  3193. });
  3194. };
  3195. //关闭排序
  3196. const sortFormClose = () => {
  3197. sortFormShow.value = false;
  3198. sortFormLoading.value = false;
  3199. tableSortFormData.value = [];
  3200. };
  3201. //提交排序
  3202. const sortFormLoading = ref(false);
  3203. const sortFormSubmit = async () => {
  3204. const treeId = primaryKeyId.value;
  3205. if (isNullES(treeId)) {
  3206. window?.$message?.warning("请先在左侧项目树选择一个节点");
  3207. return;
  3208. }
  3209. const rows = tableSortFormData.value;
  3210. const ids = arrToKey(rows, "pkeyId");
  3211. //发起请求
  3212. sortFormLoading.value = true;
  3213. const { error, code, msg } = await wbsApi.formTableSort(
  3214. {
  3215. projectId: projectId.value,
  3216. contractId: contractId.value,
  3217. classify: authBtnTabKey.value,
  3218. nodeIds: treeId,
  3219. ids: ids,
  3220. },
  3221. false
  3222. );
  3223. sortFormLoading.value = false;
  3224. if (!error && code === 200) {
  3225. window?.$message?.success("操作成功");
  3226. window?.location?.reload(); //刷新页面
  3227. } else {
  3228. window?.$message?.error(msg);
  3229. }
  3230. };
  3231. </script>
  3232. <style lang="scss" scoped>
  3233. @import "../../styles/data-fill/wbs.scss";
  3234. .hc-add-node-modal-foot-box {
  3235. position: relative;
  3236. display: flex;
  3237. align-items: center;
  3238. .left-box {
  3239. position: relative;
  3240. flex: 1;
  3241. display: flex;
  3242. align-items: center;
  3243. }
  3244. .right-box {
  3245. position: relative;
  3246. }
  3247. }
  3248. .hc-expansion-contraction-tree {
  3249. position: absolute;
  3250. left: -13px;
  3251. top: 0;
  3252. width: 10px;
  3253. height: 100%;
  3254. user-select: none;
  3255. cursor: pointer;
  3256. display: flex;
  3257. justify-content: center;
  3258. align-items: center;
  3259. color: #8c9099;
  3260. font-size: 22px;
  3261. border-radius: 5px;
  3262. transition: background 0.2s;
  3263. background: rgba(255, 255, 255, 0);
  3264. &:hover {
  3265. background: #f1f5f8;
  3266. color: var(--el-color-primary);
  3267. }
  3268. }
  3269. .hc-table-form-action-tip {
  3270. position: absolute;
  3271. bottom: 77px;
  3272. width: 100%;
  3273. }
  3274. .data-fill-wbs-hide-btn {
  3275. background: #fff;
  3276. color: #ffffff;
  3277. }
  3278. html.dark .data-fill-wbs-hide-btn {
  3279. background: #141414;
  3280. color: #141414;
  3281. }
  3282. html.theme-dark {
  3283. .bg-svg-xml {
  3284. background-color: initial;
  3285. background-image: initial;
  3286. }
  3287. .hc-layout-box
  3288. .hc-layout-content-box
  3289. .hc-card-max-h-box.node-tree
  3290. .hc-tree-foot-tip-box {
  3291. border-top: 1px solid #303030;
  3292. }
  3293. }
  3294. </style>
  3295. <style lang="scss">
  3296. .hc-tree-box .el-tree-node {
  3297. .el-checkbox {
  3298. margin-right: 0;
  3299. .el-checkbox__inner {
  3300. display: none;
  3301. }
  3302. }
  3303. .is-leaf + .el-checkbox {
  3304. margin-right: 8px;
  3305. .el-checkbox__inner {
  3306. display: inline-block;
  3307. }
  3308. }
  3309. }
  3310. .data-fill-wbs-content {
  3311. position: relative;
  3312. height: 100%;
  3313. .n-drawer-container {
  3314. margin: -20px -24px;
  3315. }
  3316. .n-drawer.n-drawer--top-placement {
  3317. height: auto !important;
  3318. background-color: initial;
  3319. pointer-events: none;
  3320. bottom: 0;
  3321. }
  3322. .drawer-data-fill-content-box {
  3323. position: relative;
  3324. height: 100%;
  3325. padding: 24px;
  3326. .n-card {
  3327. pointer-events: auto;
  3328. height: 100%;
  3329. overflow: auto;
  3330. }
  3331. .data-fill-content {
  3332. position: relative;
  3333. height: 100%;
  3334. overflow-y: auto;
  3335. scroll-behavior: smooth;
  3336. .data-fill-list-box .data-fill-list-item-content {
  3337. height: calc(100vh - 470px);
  3338. .data-fill-table-form-box {
  3339. height: 100%;
  3340. }
  3341. }
  3342. }
  3343. .data-fill-foot {
  3344. position: relative;
  3345. text-align: center;
  3346. }
  3347. }
  3348. }
  3349. .n-card.hc-card-overflow-box .n-card__content {
  3350. padding: 24px;
  3351. }
  3352. .n-card.hc-custom-card > .n-card-header {
  3353. padding: 15px 24px;
  3354. }
  3355. .n-card.hc-custom-card.copy {
  3356. width: 1200px;
  3357. max-height: 90vh;
  3358. overflow: auto;
  3359. .n-card-header .n-card-header__close {
  3360. display: none;
  3361. }
  3362. &.one {
  3363. width: 600px;
  3364. }
  3365. &.many {
  3366. width: 1200px;
  3367. }
  3368. }
  3369. .img-preview-box {
  3370. position: relative;
  3371. height: 100%;
  3372. width: 100%;
  3373. }
  3374. .hc-layout-content-box {
  3375. position: relative;
  3376. }
  3377. .iscusor {
  3378. cursor: pointer;
  3379. }
  3380. .hc-table-form-action-tip .hc-alert {
  3381. background-color: #f1f5f8;
  3382. display: inline;
  3383. vertical-align: middle;
  3384. box-shadow: -2px 0 10px 0 rgba(32, 37, 50, 0.03),
  3385. 0 10px 21px 20px rgba(32, 37, 50, 0.03);
  3386. }
  3387. .copy-node-form-box {
  3388. margin-top: 24px;
  3389. padding-top: 24px;
  3390. border-top: 1px solid #efeff5;
  3391. }
  3392. .hc-position-input-icon {
  3393. position: relative;
  3394. margin-bottom: 0;
  3395. .el-form-item__content {
  3396. position: relative;
  3397. .el-textarea .el-textarea__inner {
  3398. padding-right: 30px;
  3399. }
  3400. .hc-icon-i {
  3401. position: absolute;
  3402. right: 10px;
  3403. bottom: 0;
  3404. font-size: 20px;
  3405. cursor: pointer;
  3406. color: #0081ff;
  3407. opacity: 1;
  3408. transition: opacity 0.2s;
  3409. &:hover {
  3410. opacity: 0.5;
  3411. }
  3412. }
  3413. }
  3414. }
  3415. </style>