wbs.vue 73 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949
  1. <template>
  2. <div class="h-full">
  3. <HcCard v-if="wbsTypeTabKey === 'map'" id-ref="wbs-node-tree-card-target">
  4. <template #header>
  5. <HcTooltip keys="wbs_views_division_btn">
  6. <el-button class="mr-10" hc-btn type="primary" @click="divisionClick">
  7. <HcIcon :line="false" name="node-tree"/>
  8. <span>划分变更</span>
  9. </el-button>
  10. </HcTooltip>
  11. <HcNewSwitch v-if="isDrawer" :datas="authBtnTabdata" :keys="authBtnTabKey" :round="false"
  12. size="default" @change="authBtnTabClick"/>
  13. </template>
  14. <template #extra>
  15. <HcNewSwitch :datas="wbsTypeTab" :keys="wbsTypeTabKey" @change="wbsTypeTabChange"/>
  16. </template>
  17. <NodeTree
  18. ref="NodeTreeRef"
  19. :accordion='NodeTreeAccordion'
  20. :autoExpandKeys="TreeAutoExpandKeys"
  21. :contractId="contractId"
  22. :isMark="TreeMark"
  23. :menus="ElTreeMenu"
  24. :projectId="projectId"
  25. @menuClick="NodeTreeMenuClick"
  26. @nodeClick="NodeTreeClick"
  27. @nodeDblClick="NodeTreeDblClick"/>
  28. <template #action>
  29. <div class="hc-tree-mp-tip-box">
  30. <div class="dot-view green">已审批</div>
  31. <div class="dot-view black">未填报</div>
  32. <div class="dot-view orange">已填报-待审批</div>
  33. <div class="dot-view blue">已填报-未上报</div>
  34. </div>
  35. </template>
  36. <HcDrawer :show="isDrawer" actionUi="text-center" to-id="wbs-node-tree-card-target" @close="drawerClose">
  37. <!--清表列表-->
  38. <el-scrollbar v-if="ListItemDatas.length > 0" ref="ListItemScrollRef">
  39. <CollapseForm ref="ListItemsRef"
  40. :classify="authBtnTabKey"
  41. :contractId="contractId"
  42. :datas="ListItemDatas"
  43. :drawType="isDrawType"
  44. :primaryKeyId="primaryKeyId"
  45. :status="NodeStatus"
  46. :tenantId="userInfo?.tenant_id"
  47. :wbsTempId="projectInfo?.referenceWbsTemplateIdTrial"
  48. :wbsType="2"
  49. @offsetTop="ListItemOffsetTop"
  50. @renew="getTableDataAll"/>
  51. </el-scrollbar>
  52. <HcStatus v-else text="暂无表单"/>
  53. <!--底部按钮区域-->
  54. <template #action>
  55. <HcTooltip v-if="NodeStatus !== '3'" keys="wbs_save">
  56. <el-button :disabled="NodeStatus === '3' || ListItemDatas.length <= 0"
  57. :loading="tableFormSaveLoading"
  58. hc-btn
  59. type="primary"
  60. @click="tableFormSaveClick">
  61. <HcIcon name="save"/>
  62. <span>保存</span>
  63. </el-button>
  64. </HcTooltip>
  65. <HcTooltip v-if="NodeStatus !== '3'" keys="wbs_report">
  66. <el-button :disabled="NodeStatus === '3' || NodeStatus === '1'"
  67. :loading="reportLoading"
  68. hc-btn
  69. @click="reportModalClick">
  70. <HcIcon name="send-plane-2"/>
  71. <span>上报</span>
  72. </el-button>
  73. </HcTooltip>
  74. <HcTooltip keys="wbs_preview">
  75. <el-button :disabled="NodeStatus === '1'"
  76. :loading="bussPdfsLoading"
  77. hc-btn
  78. @click="bussPdfsClick">
  79. <HcIcon name="eye"/>
  80. <span>预览</span>
  81. </el-button>
  82. </HcTooltip>
  83. <HcTooltip v-if="NodeStatus === '3'" keys="wbs_abolish">
  84. <el-button hc-btn>
  85. <HcIcon name="arrow-go-back"/>
  86. <span>撤回上报流程</span>
  87. </el-button>
  88. </HcTooltip>
  89. <HcTooltip keys="wbs_views_drawings">
  90. <el-button :disabled="!nodeDataInfo?.fileUrl" hc-btn @click="viewsDrawings">
  91. <HcIcon name="image"/>
  92. <span>图纸</span>
  93. </el-button>
  94. </HcTooltip>
  95. <el-button hc-btn>
  96. <HcIcon name="file"/>
  97. <span>附件</span>
  98. </el-button>
  99. <el-button hc-btn @click="drawerClose">
  100. <HcIcon name="close"/>
  101. <span>关闭填报页面</span>
  102. </el-button>
  103. </template>
  104. </HcDrawer>
  105. </HcCard>
  106. <div v-if="wbsTypeTabKey === 'tree'" class="hc-layout-box">
  107. <div id="wbs-left-tree" :class="[isWbsTreeShow?'show':'', isMouseTree ? 'on-transition':'']"
  108. :style="'width:' + (isWbsTreeShow ? leftWidth : 0) + 'px;'"
  109. class="hc-layout-left-box">
  110. <div class="hc-project-box">
  111. <div class="hc-project-icon-box">
  112. <HcIcon name="stack"/>
  113. </div>
  114. <div class="ml-2 project-name-box">
  115. <span class="text-xl text-cut project-alias">{{ projectInfo['projectAlias'] }}</span>
  116. <div class="text-xs text-cut project-name">{{ projectInfo['name'] }}</div>
  117. </div>
  118. </div>
  119. <div class="hc-tree-box">
  120. <div class="hc-search-tree-val">
  121. <el-input v-model="searchTreeVal" block clearable placeholder="请输入名称关键词检索"
  122. size="large" @keyup="searchTreeKeyUp">
  123. <template #suffix>
  124. <HcIcon name="search-2" ui="text-xl iscusor" @click="searchTreeClick"/>
  125. </template>
  126. </el-input>
  127. </div>
  128. <div v-loading="treeLoading" class="hc-tree-scrollbar" element-loading-text="获取数据中...">
  129. <el-scrollbar>
  130. <KeepAlive>
  131. <template v-if="isSearchTree">
  132. <HcTreeData
  133. :ElTreeLoadNode="searchElTreeLoadNode"
  134. :autoExpandKeys="TreeAutoExpandKeys"
  135. :datas="searchTreeData"
  136. :isMark="TreeMark"
  137. :menus="ElTreeMenu" :searchTreeVal="searchTreeVal" :submitCounts="false"
  138. isColor
  139. @changeSearch="changeisSearch"
  140. @changetreelaod="changetreelaod"
  141. @menuTap="ElTreeMenuClick"
  142. @nodeTap="wbsElTreeClick"/>
  143. </template>
  144. <template v-else>
  145. <WbsTree
  146. ref="wbstree"
  147. :autoExpandKeys="TreeAutoExpandKeys"
  148. :classifyType="authBtnTabKey"
  149. :contractId="contractId"
  150. :isMark="TreeMark"
  151. :menus="ElTreeMenu"
  152. :projectId="projectId"
  153. :submitCounts="false"
  154. :treeKey="wbstreeKey"
  155. isColor
  156. @menuTap="ElTreeMenuClick"
  157. @nodeLoading="ElTreeNodeLoading"
  158. @nodeTap="wbsElTreeClick"/>
  159. </template>
  160. </KeepAlive>
  161. </el-scrollbar>
  162. </div>
  163. </div>
  164. <div class="hc-tree-foot-tip-box">
  165. <div class="dot-view green">已审批</div>
  166. <div class="dot-view black">未填报</div>
  167. <div class="dot-view orange">已填报-待审批</div>
  168. <div class="dot-view blue">已填报-未上报</div>
  169. </div>
  170. <!--左右拖动-->
  171. <div class="horizontal-drag-line" @mousedown="onmousedown"/>
  172. </div>
  173. <div class="hc-layout-content-box">
  174. <!---展开收缩树-->
  175. <div class="hc-expansion-contraction-tree" @click="setWbsTreeShow">
  176. <HcIcon v-show="isWbsTreeShow" name="arrow-left-s"/>
  177. <HcIcon v-show="!isWbsTreeShow" name="arrow-right-s"/>
  178. </div>
  179. <HcCard actionUi="text-center">
  180. <template #header>
  181. <HcNewSwitch :datas="authBtnTabdata" :keys="authBtnTabKey" :round="false"
  182. size="default" @change="authBtnTabClick"/>
  183. </template>
  184. <!--切换导图或树形模式-->
  185. <template #extra>
  186. <HcNewSwitch :datas="wbsTypeTab" :keys="wbsTypeTabKey" @change="wbsTypeTabChange"/>
  187. </template>
  188. <!--清表列表-->
  189. <el-scrollbar v-if="ListItemDatas.length > 0" ref="ListItemScrollRef" v-loading="ListItemLoading">
  190. <CollapseForm ref="ListItemRef"
  191. :classify="authBtnTabKey"
  192. :contractId="contractId"
  193. :datas="ListItemDatas"
  194. :drawType="!isDrawType"
  195. :primaryKeyId="primaryKeyId"
  196. :status="NodeStatus"
  197. :tenantId="userInfo?.tenant_id"
  198. :wbsTempId="projectInfo?.referenceWbsTemplateIdTrial"
  199. :wbsType="2"
  200. @offsetTop="ListItemOffsetTop"
  201. @renew="getTableDataAll"/>
  202. </el-scrollbar>
  203. <HcStatus v-else text="暂无表单"/>
  204. <!--底部按钮区域-->
  205. <template #action>
  206. <div class="hc-table-form-action-tip">
  207. <el-alert :closable="false"
  208. class="hc-alert"
  209. show-icon
  210. style=""
  211. title="完善资料填写后记得一定要保存哦"
  212. type="warning"/>
  213. </div>
  214. <HcTooltip v-if="NodeStatus !== '3'" keys="wbs_save">
  215. <el-button :disabled="NodeStatus === '3' || ListItemDatas.length <= 0"
  216. :loading="tableFormSaveLoading"
  217. hc-btn
  218. style="width:150px;font-weight: bold;font-size:large"
  219. type="primary"
  220. @click="tableFormSaveClick">
  221. <HcIcon name="save"/>
  222. <span>保存</span>
  223. </el-button>
  224. </HcTooltip>
  225. <HcTooltip v-if="NodeStatus !== '3'" keys="wbs_report">
  226. <el-button :disabled="NodeStatus === '3' || NodeStatus === '1'" :loading="reportLoading"
  227. hc-btn @click="reportModalClick">
  228. <HcIcon name="send-plane-2"/>
  229. <span>上报</span>
  230. </el-button>
  231. </HcTooltip>
  232. <HcTooltip keys="wbs_preview">
  233. <el-button :disabled="NodeStatus === '1'" :loading="bussPdfsLoading" hc-btn
  234. @click="bussPdfsClick">
  235. <HcIcon name="eye"/>
  236. <span>预览</span>
  237. </el-button>
  238. </HcTooltip>
  239. <HcTooltip v-if="NodeStatus === '3'" keys="wbs_abolish">
  240. <el-button hc-btn @click="abolishOneClick">
  241. <HcIcon name="arrow-go-back"/>
  242. <span>撤回上报流程</span>
  243. </el-button>
  244. </HcTooltip>
  245. <HcTooltip keys="wbs_views_drawings">
  246. <el-button :disabled="!nodeDataInfo?.fileUrl" hc-btn @click="viewsDrawings">
  247. <HcIcon name="image"/>
  248. <span>图纸</span>
  249. </el-button>
  250. </HcTooltip>
  251. <el-button hc-btn @click="attachmentModalShow">
  252. <HcIcon name="file"/>
  253. <span>附件</span>
  254. </el-button>
  255. </template>
  256. </HcCard>
  257. </div>
  258. </div>
  259. <!--上传图纸-->
  260. <div class="upload-drawing">
  261. <el-upload :accept="accept" :action="action" :before-upload="beforeUpload" :headers="getTokenHeader()"
  262. :on-error="uploadError" :on-success="uploadFinish">
  263. <div id="upload-drawing">上传图纸</div>
  264. </el-upload>
  265. </div>
  266. <!--查看图纸-->
  267. <HcDragModal :isShow="drawingsShow" closeIcon lefts="145" title="查看图纸" tops="100" ui="hc-image-preview-box"
  268. widths="380px" @close="drawingsClose">
  269. <div class="hc-image-preview-view">
  270. <el-image-viewer :url-list="[nodeDataInfo.fileUrl]"/>
  271. </div>
  272. </HcDragModal>
  273. <!--编辑节点-->
  274. <HcDialog :loading="editNodeLoading" :show="editNodeModal" title="编辑节点" widths="600px"
  275. @close="editNodeModal = false" @save="editNodeClick">
  276. <el-form ref="formEditNodeRef" :model="formEditNodeModel" :rules="formEditNodeRules" label-width="auto"
  277. size="large">
  278. <el-form-item label="节点名称" prop="title">
  279. <el-input v-model="formEditNodeModel.title" placeholder="请输入节点名称"/>
  280. </el-form-item>
  281. <el-form-item label="上级节点">
  282. <el-input v-model="formEditNodeModel.parent.title" disabled/>
  283. </el-form-item>
  284. <el-form-item label="节点类型">
  285. <el-select v-model="formEditNodeModel.type" block disabled>
  286. <el-option v-for="item in nodeTypeData" :label="item.label" :value="item.value"/>
  287. </el-select>
  288. </el-form-item>
  289. <el-form-item label="划分编号">
  290. <el-input v-model="formEditNodeModel.partitionCode" placeholder="请输入划分编号"/>
  291. </el-form-item>
  292. <!-- <el-form-item label="模板位置">
  293. <el-input v-model="formEditNodeModel.position" id="copyText">
  294. <template #append>
  295. <el-button :icon="DocumentCopy" @click="copyText"/>
  296. </template>
  297. </el-input>
  298. </el-form-item> -->
  299. </el-form>
  300. </HcDialog>
  301. <!--复制节点-->
  302. <HcDialog :loading="copyNodeLoading" :show="copyNodeModal" :widths="copyNodeTabKey === '1'?'600px':'1200px'"
  303. loading-text="复制节点中,请耐心等待..."
  304. title="复制节点" @close="copyNodeModal = false">
  305. <div class="header-new-switch">
  306. <HcNewSwitch :datas="authBtnTabdata" :keys="classifyType" :round="false" size="default"
  307. @change="classifyTypeTabClick"/>
  308. </div>
  309. <div v-if="copyNodeTabKey === '1'" class="copy-node-form-box">
  310. <el-form ref="formCopyNodeModelRef" :model="formCopyNodeModel"
  311. :rules="formCopyNodeModelRules" label-width="auto" size="large">
  312. <el-form-item v-if="copyNodeTabKey === '1'" label="节点名称" prop="title" style="margin-bottom: 0;">
  313. <el-input v-model="formCopyNodeModel.title" placeholder="请输入节点名称"/>
  314. </el-form-item>
  315. <el-form-item v-if="copyNodeTabKey === '1'" label="划分编号" prop="partitionCode"
  316. style="margin-top: 10px;">
  317. <el-input v-model="formCopyNodeModel.partitionCode" placeholder="请输入划分编号"/>
  318. </el-form-item>
  319. </el-form>
  320. </div>
  321. <div v-if="copyNodeTabKey === '3'" class="copy-node-form-box">
  322. <el-form ref="formCopyNodeModelRef" :model="formCopyNodeModel"
  323. :rules="formCopyNodeModelRules" label-width="auto" size="large">
  324. <el-form-item label="所属方" prop="classify" style="margin-bottom: 0;">
  325. <!-- <el-input v-model="formCopyNodeModel.classify" placeholder="请输入节点名称"/> -->
  326. <el-checkbox-group v-model="classifyList">
  327. <el-checkbox label="施工"/>
  328. <el-checkbox label="监理"/>
  329. </el-checkbox-group>
  330. </el-form-item>
  331. </el-form>
  332. </div>
  333. <div v-if="copyNodeTabKey !== '1'" class="copy-node-many-box">
  334. <div class="copy-node-many-tree">
  335. <el-scrollbar>
  336. <WbsTree :autoExpandKeys="TreeAutoExpandKeys" :contractId="contractId" :isAutoClick="false"
  337. :isAutoKeys="false" :projectId="projectId" classifyType="1"
  338. idPrefix="tree-node-copy-" @nodeTap="copyNodeElTreeClick"/>
  339. </el-scrollbar>
  340. </div>
  341. <div class="copy-node-many-table">
  342. <el-scrollbar>
  343. <el-table :data="copyNodeTable" border stripe>
  344. <el-table-column label="复制到的位置" prop="title"/>
  345. <el-table-column v-if="copyNodeTabKey === '2'" label="节点名称" prop="nodeName">
  346. <template #default="{row}">
  347. <el-form ref="copyNodeTableRef" :model="row" :rules="copyNodeTableRules"
  348. label-width="0" size="large">
  349. <el-form-item prop="nodeName" style="margin-bottom: 0;">
  350. <el-input v-model="row.nodeName" placeholder="请输入节点名称"/>
  351. </el-form-item>
  352. </el-form>
  353. </template>
  354. </el-table-column>
  355. <el-table-column v-if="copyNodeTabKey === '2'" label="划分编号" prop="nodeName">
  356. <template #default="{row}">
  357. <el-form ref="copyNodeTableRef" :model="row" :rules="copyNodeTableRules"
  358. label-width="0" size="large">
  359. <el-form-item prop="partitionCode" style="margin-bottom: 0;">
  360. <el-input v-model="row.partitionCode" placeholder="请输入划分编号"/>
  361. </el-form-item>
  362. </el-form>
  363. </template>
  364. </el-table-column>
  365. <el-table-column align="center" label="操作" prop="action" width="120">
  366. <template #default="{_,$index}">
  367. <el-button plain type="danger" @click="copyNodeTableDel($index)">删除</el-button>
  368. </template>
  369. </el-table-column>
  370. </el-table>
  371. </el-scrollbar>
  372. </div>
  373. </div>
  374. <template #footer>
  375. <div class="lr-dialog-footer">
  376. <div class="left">
  377. <template v-for="item in copyNodeTab">
  378. <el-button v-if="item?.key === copyNodeTabKey" plain size="large" type="primary"
  379. @click="copyNodeTabChange(item?.key)">{{ item.name }}
  380. </el-button>
  381. <el-button v-else bg size="large" text @click="copyNodeTabChange(item?.key)">
  382. {{ item.name }}
  383. </el-button>
  384. </template>
  385. </div>
  386. <div class="right">
  387. <el-button :disabled="copyNodeLoading" size="large" @click="copyNodeModal = false">取消
  388. </el-button>
  389. <el-button :loading="copyNodeLoading" hc-btn type="primary" @click="copyNodeClick">提交
  390. </el-button>
  391. </div>
  392. </div>
  393. </template>
  394. </HcDialog>
  395. <!--新增子节点-->
  396. <HcDialog :loading="addNodeLoading" :show="addNodeModal" loading-text="新增节点中,请耐心等待..."
  397. title="新增子节点"
  398. widths="720px" @close="addNodeModal = false">
  399. <el-alert :closable="false" title="双击节点,可编辑节点名称,编辑完成后,请按回车或输入框消失后,再点提交"
  400. type="warning"/>
  401. <HcTreeNode v-if="addTreeNodeType === '1'" :nodeId="addTreeNodeId" :oldId="addTreeNodeOldId"
  402. :projectId="projectId" @check-change="addTreeNodeCheckChange"/>
  403. <HcTreeNode v-if="addTreeNodeType === '2'" :nodeId="addTreeNodeId" :oldId="addTreeNodeOldId"
  404. :projectId="projectId"
  405. strictly @check-change="addTreeNodeCheckChange"/>
  406. <template #footer>
  407. <div class="lr-dialog-footer">
  408. <div class="left flex items-center">
  409. <div class="mr-4">选中方式:</div>
  410. <el-radio-group v-model="addTreeNodeType">
  411. <el-radio label="1">当前及子节点</el-radio>
  412. <el-radio class="ml-4" label="2">仅当前节点</el-radio>
  413. </el-radio-group>
  414. </div>
  415. <div class="right">
  416. <el-button size="large" @click="addNodeModal = false">取消</el-button>
  417. <el-button :loading="addNodeLoading" hc-btn type="primary" @click="addNodeClick">提交
  418. </el-button>
  419. </div>
  420. </div>
  421. </template>
  422. </HcDialog>
  423. <!--调整排序-->
  424. <HcDialog :loading="sortNodeLoading" :show="sortNodeModal" title="调整排序" widths="700px"
  425. @close="sortNodeModal = false" @save="sortNodeClick">
  426. <el-alert :closable="false" title="可拖动排序,也可在后面点击图标,切换排序" type="warning"/>
  427. <div class="sort-node-body-box list-group header">
  428. <div class="list-group-item">
  429. <div class="index-box">序号</div>
  430. <div class="title-box">节点名称</div>
  431. <div class="icon-box">排序</div>
  432. </div>
  433. </div>
  434. <Draggable :list="sortNodeData" class="sort-node-body-box list-group" ghost-class="ghost" item-key="id"
  435. @end="sortNodeDrag = false" @start="sortNodeDrag = true">
  436. <template #item="{element, index}">
  437. <div class="list-group-item">
  438. <div class="index-box">{{ index + 1 }}</div>
  439. <div class="title-box">{{ element.title }}</div>
  440. <div class="icon-box">
  441. <span class="icon" @click="downSortClick(index)">
  442. <HcIcon name="arrow-down" ui="text-lg"/>
  443. </span>
  444. <span class="icon" @click="upSortClick(index)">
  445. <HcIcon name="arrow-up" ui="text-lg"/>
  446. </span>
  447. </div>
  448. </div>
  449. </template>
  450. </Draggable>
  451. </HcDialog>
  452. <!--批量上报审批-->
  453. <HcReportModal :addition="reportAddition"
  454. :contractId="contractInfo?.contractType==2?nodeDataInfo?.contractIdRelation:contractId"
  455. :ids="reportIds"
  456. :projectId="projectId"
  457. :show="showReportModal"
  458. :taskName="reportTaskName"
  459. :typeData="reportTypeData"
  460. title="批量上报审批" type="wbs" url="informationWriteQuery/taskOne"
  461. @finish="showReportFinish" @hide="showReportModal = false"/>
  462. <!--查看附件-->
  463. <HcDialog :footer="false" :show="attachmentModal" isTable title="附件列表" widths="780px"
  464. @close="attachmentModal = false">
  465. <div class="hc-attachment-card">
  466. <div class="hc-attachment-header">表单名称</div>
  467. <div class="hc-attachment-content">
  468. <div class="hc-attachment-item">
  469. <div class="hc-attachment-file-name">
  470. <HcIcon name="attachment"/>
  471. <div class="name">文件名称</div>
  472. </div>
  473. <div class="hc-attachment-btn-box">
  474. <el-button plain size="small" type="primary">
  475. <HcIcon name="eye"/>
  476. <span>预览</span>
  477. </el-button>
  478. <el-button plain size="small" style="margin-left: 16px" type="danger">
  479. <HcIcon name="close"/>
  480. <span>删除</span>
  481. </el-button>
  482. </div>
  483. </div>
  484. <div class="hc-attachment-item">
  485. <div class="hc-attachment-file-name">
  486. <HcIcon name="attachment"/>
  487. <div class="name">文件名称</div>
  488. </div>
  489. <div class="hc-attachment-btn-box">
  490. <el-button plain size="small" type="primary">
  491. <HcIcon name="eye"/>
  492. <span>预览</span>
  493. </el-button>
  494. <el-button plain size="small" style="margin-left: 16px" type="danger">
  495. <HcIcon name="close"/>
  496. <span>删除</span>
  497. </el-button>
  498. </div>
  499. </div>
  500. <div class="hc-attachment-item">
  501. <div class="hc-attachment-file-name">
  502. <HcIcon name="attachment"/>
  503. <div class="name">文件名称</div>
  504. </div>
  505. <div class="hc-attachment-btn-box">
  506. <el-button plain size="small" type="primary">
  507. <HcIcon name="eye"/>
  508. <span>预览</span>
  509. </el-button>
  510. <el-button plain size="small" style="margin-left: 16px" type="danger">
  511. <HcIcon name="close"/>
  512. <span>删除</span>
  513. </el-button>
  514. </div>
  515. </div>
  516. </div>
  517. </div>
  518. <div class="hc-attachment-card">
  519. <div class="hc-attachment-header">表单名称</div>
  520. <div class="hc-attachment-content">
  521. <div class="hc-attachment-item">
  522. <div class="hc-attachment-file-name">
  523. <HcIcon name="attachment"/>
  524. <div class="name">文件名称</div>
  525. </div>
  526. <div class="hc-attachment-btn-box">
  527. <el-button plain size="small" type="primary">
  528. <HcIcon name="eye"/>
  529. <span>预览</span>
  530. </el-button>
  531. <el-button plain size="small" style="margin-left: 16px" type="danger">
  532. <HcIcon name="close"/>
  533. <span>删除</span>
  534. </el-button>
  535. </div>
  536. </div>
  537. <div class="hc-attachment-item">
  538. <div class="hc-attachment-file-name">
  539. <HcIcon name="attachment"/>
  540. <div class="name">文件名称</div>
  541. </div>
  542. <div class="hc-attachment-btn-box">
  543. <el-button plain size="small" type="primary">
  544. <HcIcon name="eye"/>
  545. <span>预览</span>
  546. </el-button>
  547. <el-button plain size="small" style="margin-left: 16px" type="danger">
  548. <HcIcon name="close"/>
  549. <span>删除</span>
  550. </el-button>
  551. </div>
  552. </div>
  553. <div class="hc-attachment-item">
  554. <div class="hc-attachment-file-name">
  555. <HcIcon name="attachment"/>
  556. <div class="name">文件名称</div>
  557. </div>
  558. <div class="hc-attachment-btn-box">
  559. <el-button plain size="small" type="primary">
  560. <HcIcon name="eye"/>
  561. <span>预览</span>
  562. </el-button>
  563. <el-button plain size="small" style="margin-left: 16px" type="danger">
  564. <HcIcon name="close"/>
  565. <span>删除</span>
  566. </el-button>
  567. </div>
  568. </div>
  569. </div>
  570. </div>
  571. <div class="hc-attachment-card">
  572. <div class="hc-attachment-header">表单名称</div>
  573. <div class="hc-attachment-content">
  574. <div class="hc-attachment-item">
  575. <div class="hc-attachment-file-name">
  576. <HcIcon name="attachment"/>
  577. <div class="name">文件名称</div>
  578. </div>
  579. <div class="hc-attachment-btn-box">
  580. <el-button plain size="small" type="primary">
  581. <HcIcon name="eye"/>
  582. <span>预览</span>
  583. </el-button>
  584. <el-button plain size="small" style="margin-left: 16px" type="danger">
  585. <HcIcon name="close"/>
  586. <span>删除</span>
  587. </el-button>
  588. </div>
  589. </div>
  590. <div class="hc-attachment-item">
  591. <div class="hc-attachment-file-name">
  592. <HcIcon name="attachment"/>
  593. <div class="name">文件名称</div>
  594. </div>
  595. <div class="hc-attachment-btn-box">
  596. <el-button plain size="small" type="primary">
  597. <HcIcon name="eye"/>
  598. <span>预览</span>
  599. </el-button>
  600. <el-button plain size="small" style="margin-left: 16px" type="danger">
  601. <HcIcon name="close"/>
  602. <span>删除</span>
  603. </el-button>
  604. </div>
  605. </div>
  606. <div class="hc-attachment-item">
  607. <div class="hc-attachment-file-name">
  608. <HcIcon name="attachment"/>
  609. <div class="name">文件名称</div>
  610. </div>
  611. <div class="hc-attachment-btn-box">
  612. <el-button plain size="small" type="primary">
  613. <HcIcon name="eye"/>
  614. <span>预览</span>
  615. </el-button>
  616. <el-button plain size="small" style="margin-left: 16px" type="danger">
  617. <HcIcon name="close"/>
  618. <span>删除</span>
  619. </el-button>
  620. </div>
  621. </div>
  622. </div>
  623. </div>
  624. </HcDialog>
  625. </div>
  626. </template>
  627. <script setup>
  628. import {ref, watch, onMounted} from "vue";
  629. import {useRouter, useRoute} from 'vue-router'
  630. import {useAppStore} from "~src/store";
  631. import {HcIsButton} from "~src/plugins/IsButtons";
  632. import ListItem from "./components/ListItem.vue"
  633. import CollapseForm from "./collapse-form/index.vue"
  634. import NodeTree from "./components/nodeTree/index.vue"
  635. import HcTreeNode from "./components/HcTreeNode.vue"
  636. import HcTreeData from "./components/HcTreeData.vue"
  637. import WbsTree from "./components/WbsTree.vue"
  638. import {getTokenHeader} from '~src/api/request/header';
  639. import {getStoreData, setStoreData} from '~src/utils/storage'
  640. import {isType, deepClone, formValidate} from "vue-utils-plus"
  641. import {getDictionary, eVisaTaskCheckApi} from "~api/other"
  642. import wbsApi from "~api/data-fill/wbs"
  643. import queryApi from '~api/data-fill/query';
  644. import Draggable from "vuedraggable";
  645. //初始变量
  646. const router = useRouter()
  647. const useRoutes = useRoute()
  648. const useAppState = useAppStore()
  649. const {getObjValue, getArrValue, getObjNullValue, isString} = isType()
  650. //全局变量
  651. const projectId = ref(useAppState.getProjectId);
  652. const contractId = ref(useAppState.getContractId);
  653. const projectInfo = ref(useAppState.getProjectInfo);
  654. const contractInfo = ref(useAppState.getContractInfo);
  655. const isCollapse = ref(useAppState.getCollapse)
  656. const userInfo = ref(useAppState.getUserInfo);
  657. //路由参数
  658. const routerQuery = useRoutes?.query;
  659. // const typeName = routerQuery?.type || 'map'
  660. const typeName = routerQuery?.type || 'tree'
  661. //是否是抽屉
  662. const isDrawType = ref(true)
  663. //自动展开缓存
  664. const TreeAutoExpandKeys = ref(getStoreData('wbsTreeExpandKeys') || [])
  665. //树搜索
  666. const isSearchTree = ref(false)
  667. const wbstreeKey = ref(Math.random())
  668. const searchElTreeLoadNode = ref(true)
  669. const getSearchTreeData = async () => {
  670. searchElTreeLoadNode.value = true
  671. if (contractInfo.value?.contractType == 2 || contractInfo.value?.contractType == 3) {
  672. const {error, code, data} = await queryApi.getTreeallJl({
  673. contractId: contractId.value,
  674. })
  675. //判断状态
  676. if (!error && code === 200) {
  677. // searchTreeData.value = getArrValue(data)
  678. let searchobj = getObjValue(data)
  679. let searcharr = []
  680. for (let key in searchobj) {
  681. searcharr.push(searchobj[key][0])
  682. }
  683. searchTreeData.value = searcharr
  684. searchElTreeLoadNode.value = false
  685. treeLoading.value = false
  686. } else {
  687. treeLoading.value = false
  688. searchElTreeLoadNode.value = false
  689. searchTreeData.value = []
  690. }
  691. } else {
  692. searchElTreeLoadNode.value = true
  693. const {error, code, data} = await queryApi.getTreeall({
  694. contractId: contractId.value,
  695. projectId: projectId.value,
  696. wbsId: projectInfo?.value.referenceWbsTemplateId
  697. })
  698. //判断状态
  699. if (!error && code === 200) {
  700. searchTreeData.value = getArrValue(data)
  701. searchElTreeLoadNode.value = false
  702. treeLoading.value = false
  703. } else {
  704. treeLoading.value = false
  705. searchElTreeLoadNode.value = false
  706. searchTreeData.value = []
  707. }
  708. }
  709. }
  710. //监听
  711. watch(() => [
  712. useAppState.getCollapse,
  713. ], ([Collapse]) => {
  714. isCollapse.value = Collapse
  715. })
  716. watch(projectId, (val) => {
  717. console.log(val, 'val')
  718. if (val) {
  719. getSearchTreeData()
  720. }
  721. },
  722. {immediate: true}
  723. )
  724. //渲染完成
  725. onMounted(() => {
  726. treeLoading.value = typeName === 'tree';
  727. setContractType(contractInfo.value?.contractType)
  728. getDictionaryApi()
  729. })
  730. //身份按钮切换数据
  731. const authBtnTabKey = ref('1')
  732. //变量
  733. const wbstree = ref(null)
  734. const authBtnTabClick = (val) => {
  735. if (!primaryKeyId.value) {
  736. window?.$message?.warning('请先在左侧项目树选择一个节点')
  737. } else if (val['key'] !== authBtnTabKey.value) {
  738. authBtnTabKey.value = val['key']
  739. // wbstreeKey.value=new Date().toString()
  740. getTableDataAll()
  741. }
  742. }
  743. //contractType, 1施工,2监理
  744. const setContractType = (contractType) => {
  745. if (contractType <= 0) {
  746. authBtnTabKey.value = '1'
  747. } else if (contractType === 3) {
  748. authBtnTabKey.value = '1'
  749. } else {
  750. authBtnTabKey.value = contractType + ''
  751. }
  752. setElTreeMenu(contractType)
  753. }
  754. const getTableDataAll = () => {
  755. searchNodeAllTable()
  756. queryNodeStatus()
  757. // wbstree.value.resetNode().then((res)=>{
  758. // if(res){
  759. // searchNodeAllTable()
  760. // queryNodeStatus()
  761. // }
  762. // })
  763. }
  764. //结构类型tab数据和相关处理
  765. const wbsTypeTabKey = ref(typeName)
  766. const wbsTypeTab = ref([
  767. {key: 'map', name: '导图结构填报'},
  768. {key: 'tree', name: '树形结构填报'}
  769. ]);
  770. const authBtnTabdata = ref([
  771. {key: '1', name: '施工质检'},
  772. {key: '2', name: '监理质检'}
  773. ]);
  774. const wbsTypeTabChange = (item) => {
  775. wbsTypeTabKey.value = item?.key;
  776. ListItemDatas.value = []
  777. isDrawer.value = false;
  778. treeLoading.value = typeName === 'tree';
  779. //路由跳转
  780. router.push({
  781. path: useRoutes.path,
  782. query: {
  783. type: item?.key
  784. }
  785. })
  786. getSearchTreeData()
  787. }
  788. //上传文件的
  789. const action = ref("/api/blade-resource/oss/endpoint/put-file")
  790. const accept = ref("image/png,image/jpg,image/jpeg")
  791. const NodeTreeAccordion = ref(true)
  792. //设置树菜单数据
  793. const ElTreeMenu = ref([])
  794. const TreeMark = ref(false)
  795. const setElTreeMenu = (contractType) => {
  796. let newArr = [];
  797. if (contractType === 1) {
  798. if (HcIsButton('wbs_tree_edit')) {
  799. newArr.push({icon: 'draft', label: '编辑节点', key: "edit"})
  800. }
  801. if (HcIsButton('wbs_tree_mark')) {
  802. newArr.push({icon: 'star', label: '标记为首件', key: "mark"})
  803. TreeMark.value = true
  804. }
  805. if (HcIsButton('wbs_tree_copy')) {
  806. newArr.push({icon: 'file-copy-2', label: '复制节点', key: "copy"})
  807. }
  808. if (HcIsButton('wbs_tree_add')) {
  809. newArr.push({icon: 'add-circle', label: '新增节点', key: "add"})
  810. }
  811. if (HcIsButton('wbs_tree_upload')) {
  812. newArr.push({icon: 'file-upload', label: '上传图纸', key: "upload"})
  813. }
  814. if (HcIsButton('wbs_tree_del')) {
  815. newArr.push({icon: 'delete-bin', label: '删除节点', key: "del"})
  816. }
  817. if (HcIsButton('wbs_tree_sort')) {
  818. newArr.push({icon: 'sort-asc', label: '调整排序', key: "sort"})
  819. }
  820. if (HcIsButton('wbs_views_division_btn')) {
  821. newArr.push({icon: 'folder-shared', label: '工程划分', key: "nodetree"})
  822. }
  823. } else if (contractType === 2) {
  824. if (HcIsButton('wbs_tree_copy')) {
  825. newArr.push({icon: 'file-copy-2', label: '复制节点', key: "copy"})
  826. }
  827. if (HcIsButton('wbs_tree_add')) {
  828. newArr.push({icon: 'add-circle', label: '新增节点', key: "add"})
  829. }
  830. }
  831. ElTreeMenu.value = newArr
  832. }
  833. //树相关变量
  834. const primaryKeyId = ref('')
  835. const nodeItemInfo = ref({})
  836. const nodeDataInfo = ref({})
  837. const searchTreeVal = ref('')
  838. const searchTreeData = ref([])
  839. //回车
  840. const searchTreeKeyUp = (e) => {
  841. if (e.key === "Enter") {
  842. searchTreeClick()
  843. }
  844. }
  845. const changeisSearch = () => {
  846. isSearchTree.value = false
  847. }
  848. const changetreelaod = (val) => {
  849. treeLoading.value = val
  850. }
  851. const treeLoading = ref(false)
  852. const searchTreeClick = async () => {
  853. // isSearchTree.value=true
  854. treeLoading.value = true
  855. if (searchElTreeLoadNode.value === true) {
  856. treeLoading.value = true
  857. window?.$message?.warning('请加载完再次点击搜索')
  858. } else {
  859. isSearchTree.value = true
  860. }
  861. }
  862. // if (searchTreeVal.value) {
  863. // isSearchTree.value = true
  864. // treeLoading.value = true
  865. // const {error, code, data} = await wbsApi.searchContractTree({
  866. // contractId: contractId.value,
  867. // queryValue: searchTreeVal.value
  868. // })
  869. // //判断状态
  870. // if (!error && code === 200) {
  871. // searchTreeData.value = getArrValue(data)
  872. // treeLoading.value = false
  873. // } else {
  874. // treeLoading.value = false
  875. // searchTreeData.value = []
  876. // }
  877. // } else {
  878. // treeLoading.value = false
  879. // isSearchTree.value = false
  880. // }
  881. //树被点击
  882. const wbsElTreeClick = ({node, data, keys}) => {
  883. nodeItemInfo.value = node
  884. nodeDataInfo.value = data
  885. primaryKeyId.value = data?.primaryKeyId || ''
  886. setStoreData('wbsTreeExpandKeys', keys)
  887. TreeAutoExpandKeys.value = keys || []
  888. getTableDataAll()
  889. }
  890. //树加载完成
  891. const ElTreeNodeLoading = () => {
  892. treeLoading.value = false
  893. }
  894. //树菜单被点击
  895. const ElTreeMenuClick = async ({key, node, data, keys}) => {
  896. nodeItemInfo.value = node
  897. nodeDataInfo.value = data
  898. setStoreData('wbsTreeExpandKeys', keys)
  899. setTreeMenuDataClick({key, node, data})
  900. }
  901. //导图结构数据
  902. const NodeTreeRef = ref(null)
  903. //鼠标左键单击事件
  904. const NodeTreeClick = ({keys}) => {
  905. setStoreData('wbsTreeExpandKeys', keys)
  906. TreeAutoExpandKeys.value = keys || []
  907. }
  908. //双击事件
  909. const isDrawer = ref(false)
  910. const NodeTreeDblClick = ({node, data}) => {
  911. nodeItemInfo.value = node
  912. nodeDataInfo.value = data
  913. primaryKeyId.value = data?.primaryKeyId || ''
  914. isDrawer.value = true;
  915. getTableDataAll()
  916. }
  917. const drawerClose = () => {
  918. isDrawer.value = false;
  919. ListItemDatas.value = []
  920. }
  921. //导图树菜单被点击
  922. const NodeTreeMenuClick = async ({key, node, data}) => {
  923. nodeItemInfo.value = node
  924. nodeDataInfo.value = data
  925. setTreeMenuDataClick({key, node, data})
  926. }
  927. //处理菜单被点击数据
  928. const setTreeMenuDataClick = ({key, node, data}) => {
  929. const tabKey = wbsTypeTabKey.value
  930. if (key === 'mark' || key === 'cancel_mark') {
  931. firstItemBox()
  932. } else if (key === 'edit') {
  933. if (tabKey === 'tree') {
  934. const parent = deepClone(node?.parent?.data || {})
  935. formEditNodeModel.value = {...deepClone(data), parent: parent}
  936. } else if (tabKey === 'map') {
  937. const parent = deepClone(node?.parentNodes?.data || {})
  938. formEditNodeModel.value = {...deepClone(data), parent: parent}
  939. }
  940. editNodeModal.value = true
  941. } else if (key === 'copy') {
  942. if (tabKey === 'tree') {
  943. const parent = deepClone(node?.parent?.data || {})
  944. formCopyNodeModel.value = {...deepClone(data), parent: parent}
  945. } else if (tabKey === 'map') {
  946. const parent = deepClone(node?.parentNodes?.data || {})
  947. formCopyNodeModel.value = {...deepClone(data), parent: parent}
  948. }
  949. classifyType.value = authBtnTabKey.value
  950. copyNodeTabKey.value = '1'
  951. copyNodeTable.value = []
  952. copyNodeLoading.value = false
  953. copyNodeModal.value = true
  954. } else if (key === 'add') {
  955. addTreeNodeId.value = data?.id
  956. addTreeNodeOldId.value = data?.oldId
  957. addNodeLoading.value = false
  958. addNodeModal.value = true
  959. } else if (key === 'upload') {
  960. document.getElementById('upload-drawing').click()
  961. } else if (key === 'del') {
  962. if (data['colorStatus'] === 1 || data['colorStatus'] === 2) {
  963. delModalClick()
  964. } else {
  965. window?.$message?.warning('该节点已存在上报数据,不允许删除')
  966. }
  967. } else if (key === 'sort') {
  968. let nodes = [], childNodes = []
  969. if (tabKey === 'tree') {
  970. childNodes = node?.parent?.childNodes || []
  971. } else if (tabKey === 'map') {
  972. childNodes = node?.parentNodes?.childrenNodes || []
  973. }
  974. for (let i = 0; i < childNodes.length; i++) {
  975. const res = childNodes[i]?.data
  976. nodes.push({
  977. id: res?.primaryKeyId,
  978. title: res?.title
  979. })
  980. }
  981. sortNodeData.value = nodes
  982. sortNodeModal.value = true
  983. } else if (key === 'nodetree') {
  984. divisionClick()
  985. }
  986. }
  987. //复制节点位置
  988. const copyText = () => {
  989. let copyCon = document.getElementById("copyText");
  990. copyCon.select(); // 选中文本
  991. document.execCommand("copy"); // 执行浏览器复制命令
  992. window.$message?.success("复制成功!");
  993. }
  994. //上传前
  995. const loadingReactive = ref(null)
  996. const beforeUpload = () => {
  997. loadingReactive.value = window.$loading?.service({
  998. lock: true,
  999. text: '图纸上传中...',
  1000. background: 'rgba(0, 0, 0, 0.7)',
  1001. })
  1002. return true
  1003. }
  1004. //上传完成
  1005. const uploadFinish = async (response) => {
  1006. const res = getObjValue(response.data)
  1007. const info = nodeDataInfo.value;
  1008. if (res?.link) {
  1009. const {error, code, data} = await wbsApi.saveContractTreeDrawings({
  1010. fileUrl: res?.link,
  1011. id: info['drawingsId'],
  1012. primaryKeyId: info['primaryKeyId']
  1013. }, false)
  1014. //处理数据
  1015. loadingReactive.value.close();
  1016. if (!error && code === 200) {
  1017. nodeDataInfo.value['drawingsId'] = data
  1018. nodeDataInfo.value['fileUrl'] = res?.link
  1019. window?.$message?.success('图纸上传成功')
  1020. } else {
  1021. window?.$message?.error('图纸保存失败')
  1022. }
  1023. } else {
  1024. loadingReactive.value.close();
  1025. window?.$message?.error('图纸上传失败')
  1026. }
  1027. }
  1028. //上传失败
  1029. const uploadError = () => {
  1030. loadingReactive.value.close();
  1031. window?.$message?.error('图纸上传失败')
  1032. }
  1033. //确认标记为首件
  1034. const firstItemBox = () => {
  1035. const info = nodeDataInfo.value;
  1036. window?.$messageBox?.alert(`<div class="text-base font-bold">
  1037. <span>请确认将</span>
  1038. <span class="text-main">【${info['title']}】</span>
  1039. <span>${info['isFirst'] ? '取消' : ''}标记为首件</span>
  1040. </div>`, '标记首件制', {
  1041. showCancelButton: true,
  1042. dangerouslyUseHTMLString: true,
  1043. callback: (action) => {
  1044. if (action === 'confirm') {
  1045. firstItemHttp(info)
  1046. }
  1047. }
  1048. })
  1049. }
  1050. //首件请求
  1051. const firstItemHttp = async (info) => {
  1052. const {error, code} = await wbsApi.wbsTreeFirstSave({
  1053. primaryKeyId: info['primaryKeyId'],
  1054. saveOrDeleted: !!info['isFirst'] ? 1 : 0,
  1055. })
  1056. //处理数据
  1057. if (!error && code === 200) {
  1058. window?.$message?.success('操作成功')
  1059. window?.location?.reload() //刷新页面
  1060. }
  1061. }
  1062. //编辑节点
  1063. const editNodeModal = ref(false)
  1064. //获取节点类型
  1065. const nodeTypeData = ref([])
  1066. const getDictionaryApi = async () => {
  1067. const {data} = await getDictionary({
  1068. code: 'wbs_node_type'
  1069. })
  1070. //处理数据
  1071. let newArr = []
  1072. const newData = getArrValue(data)
  1073. for (let i = 0; i < newData.length; i++) {
  1074. newArr.push({
  1075. label: newData[i]['dictValue'],
  1076. value: Number(newData[i]['dictKey']),
  1077. })
  1078. }
  1079. nodeTypeData.value = newArr
  1080. }
  1081. const formEditNodeRef = ref(null)
  1082. const formEditNodeModel = ref({})
  1083. const formEditNodeRules = {
  1084. title: {
  1085. required: true,
  1086. trigger: 'blur',
  1087. message: "请输入节点名称"
  1088. },
  1089. }
  1090. const editNodeLoading = ref(false)
  1091. //保存编辑节点数据
  1092. const editNodeClick = async () => {
  1093. const validate = await formValidate(formEditNodeRef.value)
  1094. if (validate) {
  1095. //发起请求
  1096. editNodeLoading.value = true
  1097. const {primaryKeyId, title, partitionCode} = formEditNodeModel.value
  1098. const {error, code} = await wbsApi.wbsTreeUpdateNode({
  1099. nodeName: title || '',
  1100. pKeyId: primaryKeyId || '',
  1101. partitionCode: partitionCode || ''
  1102. })
  1103. //处理数据
  1104. editNodeLoading.value = false
  1105. if (!error && code === 200) {
  1106. window?.$message?.success('修改成功')
  1107. nodeDataInfo.value['title'] = title || ''
  1108. nodeDataInfo.value['partitionCode'] = partitionCode || ''
  1109. editNodeModal.value = false
  1110. window?.location?.reload() //刷新页面
  1111. }
  1112. }
  1113. }
  1114. //复制节点
  1115. const copyNodeModal = ref(false)
  1116. //复制节点类型tab数据和相关处理
  1117. const copyNodeTabKey = ref('1')
  1118. const copyNodeTab = ref([
  1119. {key: '1', name: '单份复制'},
  1120. {key: '2', name: '多份复制'},
  1121. //{key: '3', name: '复制数据'}
  1122. ]);
  1123. const copyNodeTabChange = (key) => {
  1124. if (key !== copyNodeTabKey.value) {
  1125. copyNodeTabKey.value = key;
  1126. copyNodeTable.value = []
  1127. copyNodeLoading.value = false
  1128. }
  1129. }
  1130. //复制节点变量
  1131. const copyNodeLoading = ref(false)
  1132. const formCopyNodeModel = ref({})
  1133. const classifyList = ref([])
  1134. const copyNodeTable = ref([])
  1135. //复制树被点击
  1136. const copyNodeElTreeClick = ({data}) => {
  1137. const TabKey = copyNodeTabKey.value;
  1138. const {title, type, partitionCode} = formCopyNodeModel.value;
  1139. if (TabKey === '2') {
  1140. //1 单位工程,2 分部工程,3 子分部工程,4 分项工程, 5 子分项工程,6 工序
  1141. //工序节点不能复制到工序节点下面
  1142. // if (type === 6 && (data['type'] === 4 || data['type'] === 5 || data['type'] == 6)) {
  1143. // setCopyNodeTable(data, title)
  1144. // }
  1145. if (type === 6 && (data['type'] === 4 || data['type'] === 5 || data['type'] !== 6)) {
  1146. setCopyNodeTable(data, title, partitionCode)
  1147. }
  1148. if (type === 5 && data['type'] === 4) {
  1149. setCopyNodeTable(data, title, partitionCode)
  1150. }
  1151. if (type === 4 && (data['type'] === 2 || data['type'] === 3)) {
  1152. setCopyNodeTable(data, title, partitionCode)
  1153. }
  1154. if (type === 3 && data['type'] === 2) {
  1155. setCopyNodeTable(data, title, partitionCode)
  1156. }
  1157. if (type === 2 && data['type'] === 1) {
  1158. setCopyNodeTable(data, title, partitionCode)
  1159. }
  1160. if (type === 1 && data['type'] === 1) {
  1161. setCopyNodeTable(data, title, partitionCode)
  1162. }
  1163. } else if (TabKey === '3') {
  1164. //限制复制数据不能复制到本身节点下
  1165. if (data['id'] !== formCopyNodeModel.value.id) {
  1166. // console.log(formCopyNodeModel.value,'formCopyNodeModel.value');
  1167. // console.log(data,'data');
  1168. // if(data['colorStatus']===1||data['colorStatus']===2){
  1169. // // delModalClick()
  1170. // }else{
  1171. // window?.$message?.warning('该节点已存在上报数据,不允许复制')
  1172. // }
  1173. if (data['notExsitChild']) {
  1174. //限制一个节点不能点击多次
  1175. let oldarr = copyNodeTable.value
  1176. let result = oldarr.some(item => item.primaryKeyId === data['primaryKeyId']) //true
  1177. if (!result) {
  1178. setCopyNodeTable(data, data?.title)
  1179. }
  1180. }
  1181. }
  1182. }
  1183. }
  1184. const setCopyNodeTable = (data, title) => {
  1185. copyNodeTable.value.push({
  1186. title: data?.title || '',
  1187. nodeName: title || '',
  1188. primaryKeyId: data?.primaryKeyId || '',
  1189. })
  1190. }
  1191. //节点表单
  1192. const formCopyNodeModelRef = ref(null)
  1193. const formCopyNodeModelRules = {
  1194. title: {
  1195. required: true,
  1196. trigger: "blur",
  1197. message: "请输入节点名称"
  1198. }
  1199. }
  1200. //表格节点表单
  1201. const copyNodeTableRef = ref(null)
  1202. const copyNodeTableRules = {
  1203. nodeName: {
  1204. required: true,
  1205. trigger: "blur",
  1206. message: "请输入节点名称"
  1207. }
  1208. }
  1209. //删除选中的节点
  1210. const copyNodeTableDel = (index) => {
  1211. copyNodeTable.value.splice(index, 1)
  1212. }
  1213. const classifyType = ref(authBtnTabKey.value)
  1214. const classifyTypeTabClick = ({key}) => {
  1215. classifyType.value = key
  1216. }
  1217. //复制节点
  1218. const copyNodeClick = async () => {
  1219. const type = copyNodeTabKey.value
  1220. const form = formCopyNodeModel.value
  1221. const table = copyNodeTable.value
  1222. let classify = ''
  1223. let arr = []
  1224. if (classifyList.value.length > 0) {
  1225. classifyList.value.forEach((item) => {
  1226. if (item === '施工') {
  1227. arr.push(1)
  1228. } else if (item === '监理') {
  1229. arr.push(2)
  1230. }
  1231. })
  1232. classify = arr.join(',')
  1233. }
  1234. //效验数据
  1235. if (type === '1') {
  1236. const validate = await formValidate(formCopyNodeModelRef.value)
  1237. if (validate) await copyContractTreeNode(type, form, [])
  1238. } else if (type === '2') {
  1239. if (table.length > 0) {
  1240. const validate = await formValidate(copyNodeTableRef.value)
  1241. if (validate) await copyContractTreeNode(type, form, table)
  1242. } else {
  1243. window?.$message?.warning('请先在左侧选择要复制到的节点')
  1244. }
  1245. } else if (type === '3') {
  1246. if (table.length > 0 && classify.length > 0) {
  1247. await copyContractNodeSubmitBusinessData(form, table, classify)
  1248. } else {
  1249. window?.$message?.warning('请先在左侧选择要复制的节点或选择所属方')
  1250. }
  1251. }
  1252. }
  1253. //单个复制、多份复制请求
  1254. const copyContractTreeNode = async (type, form, table) => {
  1255. copyNodeLoading.value = true
  1256. if (type === '1') {
  1257. const {error, code} = await wbsApi.copyContractTreeNode({
  1258. copyType: type,
  1259. needCopyNodeName: form?.title || '',
  1260. partitionCode: form?.partitionCode || '',
  1261. needCopyPrimaryKeyId: form?.primaryKeyId || '',
  1262. parentPrimaryKeyId: form?.parent?.primaryKeyId || '',
  1263. copyBatchToPaths: table,
  1264. classifyType: classifyType.value
  1265. })
  1266. //判断状态
  1267. copyNodeLoading.value = false
  1268. if (!error && code === 200) {
  1269. window?.$message?.success('复制成功')
  1270. copyNodeModal.value = false
  1271. window?.location?.reload() //刷新页面
  1272. }
  1273. } else {
  1274. const {error, code} = await wbsApi.copyContractTreeNode({
  1275. copyType: type,
  1276. needCopyNodeName: form?.title || '',
  1277. needCopyPrimaryKeyId: form?.primaryKeyId || '',
  1278. parentPrimaryKeyId: form?.parent?.primaryKeyId || '',
  1279. copyBatchToPaths: table,
  1280. classifyType: classifyType.value
  1281. })
  1282. //判断状态
  1283. copyNodeLoading.value = false
  1284. if (!error && code === 200) {
  1285. window?.$message?.success('复制成功')
  1286. copyNodeModal.value = false
  1287. window?.location?.reload() //刷新页面
  1288. }
  1289. }
  1290. }
  1291. //复制数据
  1292. const copyContractNodeSubmitBusinessData = async (form, table, classify) => {
  1293. copyNodeLoading.value = true
  1294. const {error, code} = await wbsApi.copyContractNodeSubmitBusinessData({
  1295. needCopyPrimaryKeyId: form?.primaryKeyId || '',
  1296. copyBatchToPaths: table,
  1297. classify: classify
  1298. })
  1299. //判断状态
  1300. copyNodeLoading.value = false
  1301. if (!error && code === 200) {
  1302. window?.$message?.success('复制成功')
  1303. copyNodeModal.value = false
  1304. window?.location?.reload() //刷新页面
  1305. }
  1306. }
  1307. //新增节点
  1308. const addNodeModal = ref(false)
  1309. const addTreeNodeId = ref('')
  1310. const addTreeNodeOldId = ref('')
  1311. const addTreeNodeType = ref('1')
  1312. //选中的节点
  1313. const allSelectedList = ref([])
  1314. const halfSelectedList = ref([])
  1315. const addTreeNodeCheckChange = (nodes) => {
  1316. let NodesArr = [], halfArr = []
  1317. //全选数据
  1318. const keys = nodes.checkedNodes || []
  1319. for (let i = 0; i < keys.length; i++) {
  1320. NodesArr.push({
  1321. nodeName: keys[i].title,
  1322. primaryKeyId: keys[i].primaryKeyId
  1323. })
  1324. }
  1325. allSelectedList.value = NodesArr
  1326. //半选数据
  1327. const halfNodes = nodes.halfCheckedNodes || []
  1328. for (let i = 0; i < halfNodes.length; i++) {
  1329. halfArr.push({
  1330. nodeName: halfNodes[i].title,
  1331. primaryKeyId: halfNodes[i].primaryKeyId
  1332. })
  1333. }
  1334. halfSelectedList.value = halfArr
  1335. }
  1336. //新增节点
  1337. const addNodeLoading = ref(false)
  1338. const addNodeClick = async () => {
  1339. const keys = allSelectedList.value || []
  1340. if (keys.length <= 0) {
  1341. window?.$message?.warning('请先选择节点')
  1342. } else {
  1343. //发起请求
  1344. addNodeLoading.value = true
  1345. const primaryKeyId = nodeDataInfo.value?.primaryKeyId || ''
  1346. const {error, code} = await wbsApi.saveContractTreeNode({
  1347. projectId: projectId.value,
  1348. contractId: contractId.value,
  1349. saveType: addTreeNodeType.value,
  1350. allSelectedList: allSelectedList.value,
  1351. halfSelectedList: halfSelectedList.value,
  1352. currentNodePrimaryKeyId: primaryKeyId
  1353. })
  1354. //判断状态
  1355. addNodeLoading.value = false
  1356. if (!error && code === 200) {
  1357. window?.$message?.success('新增成功')
  1358. addNodeModal.value = false
  1359. window?.location?.reload() //刷新页面
  1360. }
  1361. }
  1362. }
  1363. //删除节点
  1364. const delModalClick = () => {
  1365. window?.$messageBox?.alert('请谨慎考虑后,确认是否需要删除?', '删除节点', {
  1366. showCancelButton: true,
  1367. confirmButtonText: '确认删除',
  1368. cancelButtonText: '取消',
  1369. callback: (action) => {
  1370. if (action === 'confirm') {
  1371. removeContractTreeNode()
  1372. }
  1373. }
  1374. })
  1375. }
  1376. const removeContractTreeNode = async () => {
  1377. const loadingInstance = window.$loading.service({
  1378. fullscreen: true,
  1379. text: '删除节点中,请耐心等待...',
  1380. background: 'rgba(0, 0, 0, 0.7)'
  1381. })
  1382. const {error, code} = await wbsApi.removeContractTreeNode({
  1383. ids: nodeDataInfo.value?.primaryKeyId || ''
  1384. })
  1385. //处理结果
  1386. loadingInstance.close()
  1387. if (!error && code === 200) {
  1388. window?.$message?.success('删除成功')
  1389. window?.location?.reload() //刷新页面
  1390. }
  1391. }
  1392. //调整排序
  1393. const sortNodeModal = ref(false)
  1394. const sortNodeLoading = ref(false)
  1395. const sortNodeData = ref([])
  1396. const sortNodeDrag = ref(false)
  1397. //向下
  1398. const downSortClick = (index) => {
  1399. const indexs = index + 1
  1400. const data = sortNodeData.value || []
  1401. if (indexs !== data.length) {
  1402. const tmp = data.splice(indexs, 1);
  1403. sortNodeData.value.splice(index, 0, tmp[0]);
  1404. } else {
  1405. window?.$message?.warning('已经处于置底,无法下移')
  1406. }
  1407. }
  1408. //向上
  1409. const upSortClick = (index) => {
  1410. const data = sortNodeData.value || []
  1411. if (index !== 0) {
  1412. const tmp = data.splice(index - 1, 1);
  1413. sortNodeData.value.splice(index, 0, tmp[0]);
  1414. } else {
  1415. window?.$message?.warning('已经处于置顶,无法上移')
  1416. }
  1417. }
  1418. //确认排序
  1419. const sortNodeClick = async () => {
  1420. const sortList = [];
  1421. const nodes = sortNodeData.value || []
  1422. nodes.forEach(item => {
  1423. sortList.push(item?.id)
  1424. })
  1425. //发起请求
  1426. sortNodeLoading.value = true
  1427. const {error, code} = await wbsApi.diySortTreeNode({sortList})
  1428. sortNodeLoading.value = false
  1429. //判断状态
  1430. if (!error && code === 200) {
  1431. window?.$message?.success('保存成功')
  1432. sortNodeModal.value = false
  1433. window?.location?.reload() //刷新页面
  1434. }
  1435. }
  1436. //查看图纸
  1437. const drawingsShow = ref(false);
  1438. const viewsDrawings = () => {
  1439. const {primaryKeyId, fileUrl} = nodeDataInfo.value
  1440. if (!primaryKeyId) {
  1441. window?.$message?.warning('请先选择树节点')
  1442. } else if (!fileUrl) {
  1443. window?.$message?.warning('该节点暂未上传图纸')
  1444. } else {
  1445. drawingsShow.value = true
  1446. }
  1447. }
  1448. const drawingsClose = (res) => {
  1449. drawingsShow.value = res
  1450. }
  1451. //设置滚动条位置
  1452. const ListItemScrollRef = ref(null)
  1453. const ListItemOffsetTop = (offsetTop) => {
  1454. if (offsetTop > 0) {
  1455. setTimeout(() => {
  1456. ListItemScrollRef.value?.setScrollTop(offsetTop)
  1457. }, 350)
  1458. } else {
  1459. ListItemScrollRef.value?.setScrollTop(offsetTop)
  1460. }
  1461. }
  1462. //获取数据列表
  1463. const ListItemDatas = ref([]);
  1464. const ListItemLoading = ref(false);
  1465. const searchNodeAllTable = async () => {
  1466. ListItemDatas.value = []
  1467. const info = nodeDataInfo.value;
  1468. ListItemLoading.value = true
  1469. const {error, code, data} = await wbsApi.searchNodeAllTable({
  1470. projectId: projectId.value,
  1471. contractId: contractId.value,
  1472. primaryKeyId: info['primaryKeyId'],
  1473. type: authBtnTabKey.value
  1474. })
  1475. //处理数据
  1476. ListItemLoading.value = false
  1477. if (!error && code === 200) {
  1478. ListItemDatas.value = getArrValue(data)
  1479. } else {
  1480. ListItemDatas.value = []
  1481. }
  1482. }
  1483. //查询状态
  1484. const NodeStatus = ref('1')
  1485. const queryNodeStatus = async () => {
  1486. const info = nodeDataInfo.value;
  1487. if (contractInfo.value?.contractType == 1) {
  1488. const {error, code, data} = await wbsApi.queryNodeStatus({
  1489. primaryKeyId: info['primaryKeyId'],
  1490. //classify:1
  1491. classify: authBtnTabKey.value
  1492. })
  1493. //1 未填报,2待上报,3已上报
  1494. if (!error && code === 200) {
  1495. NodeStatus.value = data ?? '1'
  1496. } else {
  1497. NodeStatus.value = '1'
  1498. }
  1499. } else {
  1500. const {error, code, data} = await wbsApi.queryNodeStatusJl({
  1501. // primaryKeyId: info['contractIdRelation'] ? info['id'] : info['primaryKeyId'],
  1502. primaryKeyId: info['primaryKeyId'],
  1503. //classify: 1
  1504. classify: authBtnTabKey.value
  1505. })
  1506. //1 未填报,2待上报,3已上报
  1507. if (!error && code === 200) {
  1508. NodeStatus.value = data ?? '1'
  1509. } else {
  1510. NodeStatus.value = '1'
  1511. }
  1512. }
  1513. }
  1514. //批量上报
  1515. const reportIds = ref('')
  1516. const reportTaskName = ref('')
  1517. const reportAddition = ref({})
  1518. const showReportModal = ref(false)
  1519. const reportLoading = ref(false)
  1520. const reportTypeData = ref([])
  1521. const reportModalClick = async () => {
  1522. const info = nodeDataInfo.value;
  1523. const rows = ListItemDatas.value;
  1524. if (rows.length > 0) {
  1525. reportLoading.value = true
  1526. const taskCheck = await eVisaTaskCheckApi({
  1527. projectId: projectId.value,
  1528. contractId: contractInfo.value?.contractType == 2 ? info?.contractIdRelation : contractId.value
  1529. // contractId: contractId.value
  1530. })
  1531. //处理数据
  1532. let newArr = [];
  1533. for (let i = 0; i < rows.length; i++) {
  1534. newArr.push(rows[i]['isTypePrivatePid'])
  1535. }
  1536. reportTypeData.value = newArr
  1537. reportLoading.value = false
  1538. if (taskCheck) {
  1539. //初始弹出弹窗,防呆
  1540. reportIds.value = info['primaryKeyId']
  1541. reportAddition.value = {
  1542. classify: authBtnTabKey.value,
  1543. contractIdRelation: info['contractIdRelation'],
  1544. }
  1545. showReportModal.value = true
  1546. //请求文件题名
  1547. const {data} = await wbsApi.queryDocumentTitle({
  1548. primaryKeyId: info['primaryKeyId'],
  1549. classify: authBtnTabKey.value
  1550. })
  1551. reportTaskName.value = isString(data) ? data : ''
  1552. }
  1553. } else {
  1554. window.$message?.warning('暂无相关数据')
  1555. }
  1556. }
  1557. //上报完成
  1558. const showReportFinish = () => {
  1559. showReportModal.value = false
  1560. getTableDataAll()
  1561. // window?.location?.reload() //刷新页面
  1562. }
  1563. //表单变量
  1564. const ListItemRef = ref(null)
  1565. const ListItemsRef = ref(null)
  1566. //保存
  1567. const tableFormSaveLoading = ref(false)
  1568. const tableFormSaveClick = async () => {
  1569. //获取数据
  1570. let FormData = [], FormRegExpJson = {};
  1571. if (isDrawer.value) {
  1572. FormData = ListItemsRef.value?.getFormData()
  1573. FormRegExpJson = ListItemsRef.value?.getFormRegExpJson()
  1574. } else {
  1575. FormData = ListItemRef.value?.getFormData()
  1576. FormRegExpJson = ListItemRef.value?.getFormRegExpJson()
  1577. }
  1578. //效验数据
  1579. if (getObjNullValue(FormRegExpJson)) {
  1580. setFormRegExpJson(FormRegExpJson)
  1581. } else if (FormData.length > 0) {
  1582. tableFormSaveLoading.value = true
  1583. console.log(FormData, 'FormData')
  1584. const {error, code} = await wbsApi.saveExcelBussData({
  1585. dataInfo: {orderList: FormData}
  1586. })
  1587. tableFormSaveLoading.value = false
  1588. if (!error && code === 200) {
  1589. window?.$message?.success('保存成功')
  1590. await bussPdfsClick()
  1591. getTableDataAll()
  1592. }
  1593. } else {
  1594. //http://testcandao.hcxxy.com/bug-view-819.html
  1595. await bussPdfsClick()
  1596. }
  1597. }
  1598. //效验数据
  1599. const setFormRegExpJson = (FormRegExpJson) => {
  1600. let nodeName = '', itemId = '';
  1601. Object.keys(FormRegExpJson).forEach(key => {
  1602. const name = FormRegExpJson[key]?.nodeName ?? ''
  1603. if (name) {
  1604. if (nodeName) {
  1605. nodeName += ',' + name
  1606. } else {
  1607. nodeName = name
  1608. itemId = FormRegExpJson[key]?.itemId
  1609. }
  1610. }
  1611. })
  1612. //const activeKey = ListItemRef.value?.getActiveKey()
  1613. //弹出提示
  1614. const val = '<div style="font-size: 16px;">请先完善 <span style="color:#1ECC95;">' + nodeName + '</span> 的数据内容</div>'
  1615. window?.$messageBox?.alert(val, '表单完善提醒', {
  1616. confirmButtonText: '确定',
  1617. dangerouslyUseHTMLString: true,
  1618. callback: (action) => {
  1619. if (action === 'confirm') {
  1620. ListItemRef.value?.setActiveKey(itemId)
  1621. ListItemOffsetTop(0)
  1622. setTimeout(() => {
  1623. const offsetTop = document.getElementById(itemId)?.offsetTop
  1624. ListItemOffsetTop(offsetTop)
  1625. }, 350)
  1626. }
  1627. }
  1628. })
  1629. }
  1630. //多表预览
  1631. const bussPdfsLoading = ref(false)
  1632. const bussPdfsClick = async () => {
  1633. const info = nodeDataInfo.value;
  1634. console.log(info, 'info')
  1635. bussPdfsLoading.value = true
  1636. const {error, code, data} = await wbsApi.getBussPdfs({
  1637. nodeId: info?.primaryKeyId || '',
  1638. classify: authBtnTabKey.value,
  1639. projectId: projectId.value,
  1640. // contractId: contractId.value
  1641. contractId: contractInfo.value?.contractType == 2 ? info?.contractIdRelation : contractId.value
  1642. })
  1643. tableFormSaveLoading.value = false
  1644. bussPdfsLoading.value = false
  1645. if (!error && code === 200) {
  1646. window.open(data, '_blank')
  1647. } else {
  1648. window.$message?.warning('获取PDF失败')
  1649. }
  1650. }
  1651. //撤回上报流程
  1652. const abolishOneClick = () => {
  1653. window?.$messageBox?.alert('请谨慎考虑后,是否确定撤回?', '撤回上报', {
  1654. showCancelButton: true,
  1655. confirmButtonText: '确定撤回',
  1656. cancelButtonText: '取消',
  1657. callback: (action) => {
  1658. if (action === 'confirm') {
  1659. abolishOneSave()
  1660. }
  1661. }
  1662. })
  1663. }
  1664. //撤回请求
  1665. const abolishOneSave = async () => {
  1666. const info = nodeDataInfo.value;
  1667. const {error, code} = await wbsApi.abolishOne({
  1668. primaryKeyId: info?.primaryKeyId || '',
  1669. classify: authBtnTabKey.value
  1670. })
  1671. if (!error && code === 200) {
  1672. window.$message?.success('撤回成功')
  1673. getTableDataAll()
  1674. window?.location?.reload() //刷新页面
  1675. }
  1676. }
  1677. //附件列表
  1678. const attachmentModal = ref(false)
  1679. const attachmentModalShow = () => {
  1680. attachmentModal.value = true
  1681. }
  1682. //划分变更
  1683. const divisionClick = () => {
  1684. router.push({
  1685. path: '/data-fill/division'
  1686. })
  1687. }
  1688. //树展开和收起
  1689. const isWbsTreeShow = ref(true)
  1690. const setWbsTreeShow = () => {
  1691. isWbsTreeShow.value = !isWbsTreeShow.value
  1692. }
  1693. //左右拖动,改变树形结构宽度
  1694. const leftWidth = ref(382);
  1695. const isMouseTree = ref(false);
  1696. const onmousedown = () => {
  1697. const leftNum = isCollapse.value ? 142 : 272
  1698. isMouseTree.value = true;
  1699. document.onmousemove = (ve) => {
  1700. let diffVal = ve.clientX - leftNum;
  1701. if (diffVal >= 310 && diffVal <= 900) {
  1702. leftWidth.value = diffVal;
  1703. }
  1704. }
  1705. document.onmouseup = () => {
  1706. document.onmousemove = null;
  1707. document.onmouseup = null;
  1708. isMouseTree.value = false;
  1709. }
  1710. }
  1711. </script>
  1712. <style lang="scss" scoped>
  1713. @import "../../styles/data-fill/wbs.scss";
  1714. .hc-add-node-modal-foot-box {
  1715. position: relative;
  1716. display: flex;
  1717. align-items: center;
  1718. .left-box {
  1719. position: relative;
  1720. flex: 1;
  1721. display: flex;
  1722. align-items: center;
  1723. }
  1724. .right-box {
  1725. position: relative;
  1726. }
  1727. }
  1728. .hc-expansion-contraction-tree {
  1729. position: absolute;
  1730. left: -21px;
  1731. top: 0;
  1732. width: 18px;
  1733. height: 100%;
  1734. user-select: none;
  1735. cursor: pointer;
  1736. display: flex;
  1737. justify-content: center;
  1738. align-items: center;
  1739. color: #8c9099;
  1740. font-size: 22px;
  1741. border-radius: 5px;
  1742. transition: background 0.2s;
  1743. background: rgba(255, 255, 255, 0);
  1744. &:hover {
  1745. background: #f1f5f8;
  1746. color: var(--el-color-primary);
  1747. }
  1748. }
  1749. .hc-table-form-action-tip {
  1750. position: absolute;
  1751. bottom: 77px;
  1752. width: 100%;
  1753. }
  1754. html.theme-dark {
  1755. .bg-svg-xml {
  1756. background-color: initial;
  1757. background-image: initial;
  1758. }
  1759. .hc-layout-box .hc-layout-content-box .hc-card-max-h-box.node-tree .hc-tree-foot-tip-box {
  1760. border-top: 1px solid #303030;
  1761. }
  1762. }
  1763. </style>
  1764. <style lang="scss">
  1765. .data-fill-wbs-content {
  1766. position: relative;
  1767. height: 100%;
  1768. .n-drawer-container {
  1769. margin: -20px -24px;
  1770. }
  1771. .n-drawer.n-drawer--top-placement {
  1772. height: auto !important;
  1773. background-color: initial;
  1774. pointer-events: none;
  1775. bottom: 0;
  1776. }
  1777. .drawer-data-fill-content-box {
  1778. position: relative;
  1779. height: 100%;
  1780. padding: 24px;
  1781. .n-card {
  1782. pointer-events: auto;
  1783. height: 100%;
  1784. overflow: auto;
  1785. }
  1786. .data-fill-content {
  1787. position: relative;
  1788. height: 100%;
  1789. overflow-y: auto;
  1790. scroll-behavior: smooth;
  1791. .data-fill-list-box .data-fill-list-item-content {
  1792. height: calc(100vh - 470px);
  1793. .data-fill-table-form-box {
  1794. height: 100%;
  1795. }
  1796. }
  1797. }
  1798. .data-fill-foot {
  1799. position: relative;
  1800. text-align: center;
  1801. }
  1802. }
  1803. }
  1804. .n-card.hc-card-overflow-box .n-card__content {
  1805. padding: 24px;
  1806. }
  1807. .n-card.hc-custom-card > .n-card-header {
  1808. padding: 15px 24px;
  1809. }
  1810. .n-card.hc-custom-card.copy {
  1811. width: 1200px;
  1812. max-height: 90vh;
  1813. overflow: auto;
  1814. .n-card-header .n-card-header__close {
  1815. display: none;
  1816. }
  1817. &.one {
  1818. width: 600px;
  1819. }
  1820. &.many {
  1821. width: 1200px;
  1822. }
  1823. }
  1824. .img-preview-box {
  1825. position: relative;
  1826. height: 100%;
  1827. width: 100%;
  1828. }
  1829. .hc-layout-content-box {
  1830. position: relative;
  1831. }
  1832. .iscusor {
  1833. cursor: pointer;
  1834. }
  1835. .hc-table-form-action-tip .hc-alert {
  1836. background-color: #f1f5f8;
  1837. display: inline;
  1838. vertical-align: middle;
  1839. box-shadow: -2px 0 10px 0 rgba(32, 37, 50, 0.03), 0 10px 21px 20px rgba(32, 37, 50, 0.03);
  1840. }
  1841. .copy-node-form-box {
  1842. margin-top: 24px;
  1843. padding-top: 24px;
  1844. border-top: 1px solid #efeff5;
  1845. }
  1846. </style>