collection.vue 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111
  1. <template>
  2. <hc-body :loading="!isAppLoading" :project-nmae="projectInfo?.name" class="hc-file-collection-page" split>
  3. <template #tree>
  4. <HcTree
  5. ref="treeRef" :auto-expand-keys="treeAutoExpandKeys" :contract-id="contractId" :menus="ElTreeMenu"
  6. :project-id="projectId"
  7. :is-show-number="true" @node-tap="projectTreeClick" @node-loading="treeNodeLoading" @menu-tap="ElTreeMenuClick"
  8. />
  9. </template>
  10. <hc-new-card>
  11. <template #header>
  12. <HcTooltip keys="file_collection_btn_upload_scanned_files">
  13. <el-button hc-btn type="primary" @click="uploadModalClick">上传扫描文件</el-button>
  14. </HcTooltip>
  15. <HcTooltip keys="file_collection_btn_sorting">
  16. <el-button hc-btn type="success" @click="sortingClick">分盒整理</el-button>
  17. </HcTooltip>
  18. <HcTooltip keys="file_collection_btn_download">
  19. <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn>下载</el-button>
  20. </HcTooltip>
  21. <HcTooltip keys="file_collection_btn_certified">
  22. <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="certificationModalClick">认证</el-button>
  23. </HcTooltip>
  24. <HcTooltip keys="file_collection_btn_report">
  25. <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn type="warning" @click="reportModalClick">上报</el-button>
  26. </HcTooltip>
  27. <HcTooltip keys="file_collection_btn_edit">
  28. <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="batchEditClick">编辑</el-button>
  29. </HcTooltip>
  30. <HcTooltip keys="file_collection_btn_repeal">
  31. <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="repealModalClick">废除</el-button>
  32. </HcTooltip>
  33. <HcTooltip keys="file_collection_btn_del">
  34. <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn type="danger" @click="delModalClick">删除</el-button>
  35. </HcTooltip>
  36. <el-button :disabled="tableCheckedKeys.length <= 0" :loading="onlineLoading" color="#e03997" hc-btn @click="batchOnline">在线验签</el-button>
  37. <HcTooltip keys="file_collection_btn_look">
  38. <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" type="success" @click="replaceClick">
  39. 查找替换
  40. </el-button>
  41. </HcTooltip>
  42. </template>
  43. <template #extra>
  44. <HcTooltip keys="file_collection_sort_date">
  45. <el-button hc-btn class="mr-1" type="success" @click="dateClick">按日期排序</el-button>
  46. </HcTooltip>
  47. <HcTooltip keys="file_collection_btn_moves">
  48. <el-button color="#626aef" hc-btn @click="movesClick">跨目录移动</el-button>
  49. </HcTooltip>
  50. </template>
  51. <template #search>
  52. <div class="w-40">
  53. <el-select v-model="searchForm.sourceType" clearable placeholder="文件来源">
  54. <el-option label="原生" :value="1" />
  55. <el-option label="数字化" :value="2" />
  56. </el-select>
  57. </div>
  58. <div class="ml-2 w-40">
  59. <el-select v-model="searchForm.isApprovalValue" clearable placeholder="审批状态">
  60. <el-option v-for="item in approvalStatus" :key="item.value" :label="item.label" :value="item.value" />
  61. </el-select>
  62. </div>
  63. <div class="ml-2 w-40">
  64. <el-select v-model="searchForm.isCertificationValue" clearable placeholder="认证状态">
  65. <el-option v-for="item in certifiedStatus" :key="item.value" :label="item.label" :value="item.value" />
  66. </el-select>
  67. </div>
  68. <div class="ml-2 w-40">
  69. <el-select v-model="searchForm.isArchive" clearable placeholder="组卷状态">
  70. <el-option label="已组卷" :value="1" />
  71. <el-option label="未组卷" :value="0" />
  72. </el-select>
  73. </div>
  74. <div class="ml-2 w-64">
  75. <el-input v-model="searchForm.queryValue" clearable placeholder="请输入名称关键词检索" @keyup="keyUpEvent" />
  76. </div>
  77. <div class="ml-2">
  78. <el-button type="primary" @click="searchClick">搜索</el-button>
  79. </div>
  80. </template>
  81. <HcTable
  82. ref="tableRef" :check-style="{ width: 29 }" :column="tableColumn" :datas="tableData"
  83. :index-style="{ width: 80 }" :loading="tableLoading" is-check is-new
  84. @selection-change="tableSelection"
  85. >
  86. <template #table-column-header-num>
  87. <HcTooltip keys="file_collection_btn_sort">
  88. <span class="text-link text-lg" @click="tableSortClick">
  89. <HcIcon name="arrow-up-down" />
  90. </span>
  91. </HcTooltip>
  92. </template>
  93. <template #isCertificationValue="{ row }">
  94. <el-tag v-if="row?.isCertificationValue" :type="`${row.isCertificationValue === '已认证' ? 'success' : 'warning'}`" class="mx-1" effect="dark">
  95. {{ row.isCertificationValue }}
  96. </el-tag>
  97. </template>
  98. <template #isArchive="{ row }">
  99. <el-tag v-if="row.isArchive === 1" type="success" class="mx-1" effect="dark">
  100. 已组卷
  101. </el-tag>
  102. <el-tag v-if="row.isArchive === 0" type="warning" class="mx-1" effect="dark">
  103. 未组卷
  104. </el-tag>
  105. </template>
  106. <template #isApprovalValue="{ row }">
  107. <el-tag v-if="row?.isApprovalValue" :type="`${row.isApprovalValue === '已审批' ? 'success' : row.isApprovalValue === '待审批' ? 'warning' : row.isApprovalValue === '已废除' ? 'danger' : 'info'}`" class="mx-1" effect="dark">
  108. {{ row.isApprovalValue }}
  109. </el-tag>
  110. </template>
  111. <template #fileName="{ row }">
  112. <!-- 资料是否完整 -->
  113. <div v-if="row.checkStatus > 0" class="inline-block text-red">
  114. <el-tooltip
  115. class="box-item"
  116. effect="light"
  117. content="检测到文件完整性不足"
  118. placement="top"
  119. >
  120. <HcIcon name="error-warning" ui="text-xl" />
  121. </el-tooltip>
  122. </div>
  123. <HcIcon v-if="row.isLock === 1" name="lock" style=" color:red;font-weight: bold;" /> <HcIcon v-else name="lock-unlock" style=" color:green;font-weight: bold;" />
  124. <span class="text-link" @click="tableRowName(row)">{{ row?.fileName }}</span>
  125. </template>
  126. <template #sourceType="{ row }">
  127. <span>{{ row?.sourceType === 1 ? '原生' : '数字化' }}</span>
  128. </template>
  129. <template #fileTime="{ row }">
  130. <span>{{ getTableFileTime(row.fileTime) }}</span>
  131. </template>
  132. </HcTable>
  133. <template #action>
  134. <div class="lr-dialog-footer h-full">
  135. <div class="left hc-flex h-full text-14px">
  136. <span class="text">当前页的文件总页数:</span>
  137. <span>{{ fileTotalPage || 0 }}</span>
  138. </div>
  139. <div class="right">
  140. <HcPages :pages="searchForm" :sizes="[20, 50, 100, 200, 300, 500]" @change="pageChange" />
  141. </div>
  142. </div>
  143. </template>
  144. </hc-new-card>
  145. <!-- 预组卷整理 -->
  146. <hc-new-dialog v-model="sortingModal" is-row-footer is-table title="预组卷整理" widths="850px" @close="sortingModalClose">
  147. <div class="hc-sorting-modal-collapse">
  148. <el-collapse v-model="sortingActiveKey">
  149. <template v-for="(item, index) in sortingItemData" :key="index">
  150. <el-collapse-item :id="`item-${index}`" :name="`item-${index}`" disabled>
  151. <template #title>
  152. <div class="hc-collapse-item-header">
  153. <div class="item-index">盒{{ index + 1 }}</div>
  154. <el-divider direction="vertical" />
  155. <div class="item-input">
  156. <el-input
  157. v-model="item.boxName" :class="item.isName ? 'is-error' : ''"
  158. placeholder="请输入案卷题名"
  159. @change="tableIsInput($event, item, 'isName')"
  160. @input="tableIsInput($event, item, 'isName')"
  161. />
  162. </div>
  163. <el-divider direction="vertical" />
  164. <div class="item-action">
  165. <el-button type="primary" @click="sortingSelectFile(item, index)">选择文件</el-button>
  166. <el-button type="danger" @click="sortingDelData(item, index)">删除</el-button>
  167. </div>
  168. </div>
  169. </template>
  170. <HcTable
  171. ref="sorTableRef" :check-style="{ width: 29 }" :column="sortingTableColumn" :datas="item.list"
  172. :index-style="{ width: 60 }" :loading="sortingTableLoading" is-check is-new
  173. @selection-change="rows => sortingTableSelection(rows, item.list, index)"
  174. @single-select="singleCheck"
  175. >
  176. <template #name="{ row }">
  177. <span class="text-link">{{ row?.fileName }}</span>
  178. </template>
  179. </HcTable>
  180. </el-collapse-item>
  181. </template>
  182. </el-collapse>
  183. </div>
  184. <template #leftRowFooter>
  185. <el-button hc-btn type="primary" @click="addSortingModalClick">
  186. <HcIcon name="add" />
  187. <span>添加分盒</span>
  188. </el-button>
  189. </template>
  190. <template #rightRowFooter>
  191. <el-button hc-btn @click="sortingModalClose">
  192. <HcIcon name="close" />
  193. <span>取消</span>
  194. </el-button>
  195. <el-button :loading="sortingModalLoading" hc-btn type="primary" @click="sortingModalSave">
  196. <HcIcon name="check" />
  197. <span>确认</span>
  198. </el-button>
  199. </template>
  200. </hc-new-dialog>
  201. <!-- 预组卷整理 无数据 -->
  202. <hc-new-dialog v-model="sortingNoneModal" is-row-footer is-table title="预组卷整理" widths="850px" @close="sortingNoneModalClose">
  203. <div class="flex-center">
  204. <i class="el-icon" data-v-029747aa="" style="font-size: 200px;color:#81b337;cursor: pointer;" @click="toSortingModal">
  205. <svg data-v-029747aa="" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
  206. <path d="M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0v147.2z" fill="currentColor" />
  207. </svg>
  208. </i>
  209. <span>添加分盒</span>
  210. </div>
  211. </hc-new-dialog>
  212. <!-- 跨目录移动 -->
  213. <hc-new-dialog v-model="movesModal" :loading="movesModalLoading" is-table title="跨目录移动" widths="990px" @close="movesModalClose" @save="movesModalSave">
  214. <div class="hc-moves-transfer-box">
  215. <div class="hc-moves-transfer-panel">
  216. <div class="panel-header">
  217. <div class="panel-header-label">
  218. <el-checkbox v-model="movesCheckAll" :indeterminate="isIndeterminate" class="space size-xl" @change="handleCheckAllChange">
  219. 选择需要迁移的文件
  220. </el-checkbox>
  221. </div>
  222. <div class="panel-header-extra">{{ checkedMoves.length }}/{{ fileDatasList.length }}</div>
  223. </div>
  224. <div class="panel-body">
  225. <el-scrollbar v-loading="fileDatasListLoading">
  226. <el-checkbox-group v-model="checkedMoves" @change="handleCheckedMovesChange">
  227. <!-- <div v-for="item in fileDatasList" :key="item.id" class="hc-file-checkbox">
  228. <el-checkbox class="size-xl space" :label="item">
  229. {{ item.fileName }}
  230. </el-checkbox>
  231. </div> -->
  232. <recycle-scroller
  233. :buffer="1000" :item-size="110" :items="fileDatasList"
  234. :prerender="200" class="virtual-list" key-field="id"
  235. style="height: 900px"
  236. >
  237. <template #default="{ item, index }">
  238. <div :key="index">
  239. <el-checkbox :value="item" class="space mt-5 size-xl">{{ item.fileName }}</el-checkbox>
  240. </div>
  241. </template>
  242. </recycle-scroller>
  243. </el-checkbox-group>
  244. </el-scrollbar>
  245. </div>
  246. </div>
  247. <div class="hc-moves-transfer-buttons">
  248. <HcIcon name="arrow-right-double" style="font-size: 22px;" type="primary" />
  249. </div>
  250. <div class="hc-moves-transfer-panel">
  251. <div class="panel-header">选择移动目录</div>
  252. <div v-loading="treePanelLoading" class="panel-body">
  253. <el-scrollbar>
  254. <HcTree
  255. :contract-id="contractId" :is-show-menu="false" :project-id="projectId"
  256. :show-radio-fun="showRadioFun" id-prefix="hc-tree-moves-" is-radio
  257. @radio-change="radioChange" @node-loading="panelTreeLoading"
  258. />
  259. </el-scrollbar>
  260. </div>
  261. </div>
  262. </div>
  263. </hc-new-dialog>
  264. <!-- 调整排序 -->
  265. <hc-new-dialog v-model="sortModal" is-row-footer is-table title="调整排序" widths="80vw" @close="sortModalClose">
  266. <el-alert :closable="false" title="可拖动排序,也可在后面点击图标,切换排序" type="error" />
  267. <div class="hc-table-h">
  268. <HcTable
  269. :column="sortTableColumn" :datas="sortTableData" :index-style="{ width: 80 }"
  270. :loading="sortTableLoading"
  271. is-new is-row-drop quick-sort ui="hc-table-row-drop"
  272. @row-drop="sortTableRowDrop" @row-sort="sortTableRowDrop"
  273. >
  274. <template #action="{ index }">
  275. <span class="text-link text-xl" @click="upSortClick(index)">
  276. <HcIcon fill name="arrow-up" />
  277. </span>
  278. <span class="text-link ml-2 text-xl" @click="downSortClick(index)">
  279. <HcIcon fill name="arrow-down" />
  280. </span>
  281. </template>
  282. </HcTable>
  283. </div>
  284. <template #leftRowFooter>
  285. <el-button hc-btn @click="sortModalClose">
  286. <HcIcon name="close" />
  287. <span>取消</span>
  288. </el-button>
  289. <el-button :loading="sortModalLoading" hc-btn type="primary" @click="sortModalSave">
  290. <HcIcon name="check" />
  291. <span>确认</span>
  292. </el-button>
  293. </template>
  294. <template #rightRowFooter>
  295. <HcPages :pages="sortSearchForm" :sizes="[10, 20, 50, 100, 200, 300, 400, 500, 600]" @change="sortPageChange" />
  296. </template>
  297. </hc-new-dialog>
  298. <!-- 新增编辑文件 -->
  299. <hc-new-dialog v-model="showUploadModal" is-table title="上传工程文件" widths="90vw" @close="uploadModalClose">
  300. <template #search>
  301. <el-select v-model="needApproval" placeholder="请选择是否需要认证" class="mr-2 w-100" clearable>
  302. <el-option label="需要" :value="1" />
  303. <el-option label="不需要" :value="0" />
  304. </el-select>
  305. <el-select v-model="needApproval1" placeholder="请选择是否需要审批" class="mr-2 w-100" clearable>
  306. <el-option label="需要" :value="1" />
  307. <el-option label="不需要" :value="0" />
  308. </el-select>
  309. <el-button type="primary" @click="batchAuthentication">批量设置</el-button>
  310. </template>
  311. <HcTable
  312. :column="tableUploadColumn" :datas="tableUploadData" :index-style="{ width: 80 }"
  313. :loading="uploadSaveLoading"
  314. is-new is-sort ui="hc-form-table" @row-sort="tableUploadRowSort"
  315. >
  316. <template #fileNumber="{ row }">
  317. <!-- <el-input v-model="row.fileNumber" :class="row['isFileNumber'] ? 'is-error' : ''" @input="tableIsInput($event, row, 'isFileNumber')"/> -->
  318. <el-input v-model="row.fileNumber" />
  319. </template>
  320. <template #fileName="{ row }">
  321. <el-input v-model="row.fileName" :class="row.isFileName ? 'is-error' : ''" @input="tableIsInput($event, row, 'isFileName')" />
  322. </template>
  323. <template #fileTime="{ row }">
  324. <div class="relative w-full">
  325. <el-date-picker v-model="row.fileTime" class="w-full!" :clearable="false" format="YYYYMMDD" type="date" value-format="YYYYMMDD" />
  326. </div>
  327. <!-- <el-input v-model="row.fileTime" :class="row['isFileTime'] ? 'is-error' : ''" @input="tableIsInput($event, row, 'isFileTime')"/> -->
  328. </template>
  329. <template v-if="isBuiltDrawing === 2" #sheetType="{ row }">
  330. <el-select v-model="row.sheetType">
  331. <el-option v-for="item in sheetType" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
  332. </el-select>
  333. </template>
  334. <template v-if="isBuiltDrawing === 2" #sheetSource="{ row }">
  335. <el-select v-model="row.sheetSource">
  336. <el-option v-for="item in sheetSourceType" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
  337. </el-select>
  338. </template>
  339. <template v-if="isBuiltDrawing === 2" #drawingNo="{ row }">
  340. <el-input v-model="row.drawingNo" />
  341. </template>
  342. <template v-if="isBuiltDrawing === 2" #citeChangeNumber="{ row }">
  343. <el-input v-model="row.citeChangeNumber" />
  344. </template>
  345. <template #isApproval="{ row }">
  346. <el-select v-model="row.isApproval">
  347. <el-option v-for="item in whetherData" :key="item.value" :label="item.label" :value="item.value" />
  348. </el-select>
  349. </template>
  350. <template #isNeedCertification="{ row }">
  351. <el-select v-model="row.isNeedCertification">
  352. <el-option v-for="item in whetherData" :key="item.value" :label="item.label" :value="item.value" />
  353. </el-select>
  354. </template>
  355. <template #dutyUser="{ row }">
  356. <el-input v-model="row.dutyUser" />
  357. </template>
  358. <template #isElement="{ row }">
  359. <el-select v-model="row.isElement">
  360. <el-option :value="1" label="是" />
  361. <el-option :value="0" label="否" />
  362. </el-select>
  363. </template>
  364. <template #action="{ row, index }">
  365. <el-button v-if="tableUploadType === 'edit'" plain size="small" type="warning" @click="tableRowName(row)">查看文件</el-button>
  366. <el-button v-if="tableUploadType === 'edit'" :loading="row.newBtnLoading" plain size="small" type="primary" @click="substitutionClick(row)">替换</el-button>
  367. <el-button :loading="row.delBtnLoading" plain size="small" type="danger" @click="delUploadData(row, index)">删除</el-button>
  368. </template>
  369. </HcTable>
  370. <template #footer>
  371. <div class="lr-dialog-footer">
  372. <div class="left flex items-center">
  373. <el-button v-if="tableUploadType === 'add'" hc-btn type="primary" @click="uploadFileClick">
  374. <HcIcon name="add-circle" />
  375. <span>新增上传</span>
  376. </el-button>
  377. </div>
  378. <div class="right">
  379. <el-button size="large" :loading="uploadSaveLoading" @click="batchUploadCancel">
  380. <HcIcon name="close" />
  381. <span>取消</span>
  382. </el-button>
  383. <el-button :loading="uploadSaveLoading" hc-btn type="primary" @click="batchUploadSave">
  384. <HcIcon name="save" />
  385. <span>提交保存</span>
  386. </el-button>
  387. </div>
  388. </div>
  389. </template>
  390. </hc-new-dialog>
  391. <!-- 批量认证 -->
  392. <hc-new-dialog v-model="showCertificationModal" is-table title="批量认证" widths="80vw">
  393. <div class="hc-card-body-flex">
  394. <div class="flex-table">
  395. <HcTable
  396. :column="CertColumns" :datas="CertData" :index-style="{ width: 80 }"
  397. is-new ui="hc-form-table"
  398. @row-click="CertRowClick"
  399. >
  400. <template #action="{ row, index }">
  401. <el-button plain size="small" type="primary" @click.stop="CertRowClick2(row)">预览</el-button>
  402. </template>
  403. </HcTable>
  404. </div>
  405. <div v-if="CertPdf" class="flex-iframe">
  406. <!-- <iframe :src="CertPdf" allow="display-capture" frameborder="1" height="100%" width="100%" /> -->
  407. <HcPdf :src="CertPdf" />
  408. </div>
  409. <div v-else class="flex-iframe hc-no-table-form">
  410. <div class="table-form-no">
  411. <img :src="notableform" alt="">
  412. <div class="desc">暂无 PDF 数据</div>
  413. </div>
  414. </div>
  415. </div>
  416. <template #footer>
  417. <div class="dialog-footer">
  418. <el-button size="large" @click="showCertificationModal = false">
  419. <HcIcon name="close" />
  420. <span>取消</span>
  421. </el-button>
  422. <el-button :loading="CertLoading" hc-btn type="primary" @click="CertClick">
  423. <HcIcon name="save" />
  424. <span>确认认证</span>
  425. </el-button>
  426. </div>
  427. </template>
  428. </hc-new-dialog>
  429. <!-- 批量编辑 -->
  430. <HcReport :data="reportData" :show="isReport" @finish="reportFinish" @hide="isReport = false" />
  431. <!-- 在线验签 -->
  432. <hc-new-drawer v-model="isOnlineVerifyDrawer" modal-class="hc-online-verify-drawer" to-id="app" @close="onlineVerifyDrawerClose">
  433. <hc-new-card>
  434. <template #header>
  435. <div class="online-verify-title">这是标题名称</div>
  436. </template>
  437. <template #extra>
  438. <div class="online-verify-icon" @click="onlineVerifyDrawerClose">
  439. <HcIcon name="close-circle" />
  440. <span class="ml-1">关闭</span>
  441. </div>
  442. </template>
  443. <hc-body :options="onlineVerifyOptions" padding="0px" split>
  444. <template #left>
  445. <hc-new-card>
  446. <HcPdf :src="onlineVerifyData.pdfUrl" />
  447. </hc-new-card>
  448. </template>
  449. <hc-new-card>
  450. <HcTable :column="cscTableColumn" :datas="cscTableData" :index-style="{ width: 60 }" is-new />
  451. </hc-new-card>
  452. </hc-body>
  453. </hc-new-card>
  454. </hc-new-drawer>
  455. <!-- 查找替换弹窗 -->
  456. <hc-new-dialog v-model="showReplaceModal" widths="50vw" :loading="saveReplaceLoad" @save="saveReplace">
  457. <template #header>
  458. <div class="text-1xl mt-2 text-center font-bold">
  459. {{ replaceTitle }}
  460. </div>
  461. </template>
  462. <div class="replace-dialog-content">
  463. <div class="text-center">
  464. <el-radio-group v-model="tabPosition" style="margin-bottom: 30px" @change="changeTab">
  465. <el-radio-button value="1">新增</el-radio-button>
  466. <el-radio-button value="2">替换</el-radio-button>
  467. <el-radio-button value="3">删除</el-radio-button>
  468. </el-radio-group>
  469. </div>
  470. <el-form
  471. ref="ruleFormRef"
  472. :model="ruleForm"
  473. label-width="auto"
  474. size="large"
  475. >
  476. <el-form-item v-if="tabPosition !== '3'" label="查找内容" prop="query">
  477. <el-input v-model="ruleForm.query" placeholder="请输入原内容" />
  478. </el-form-item>
  479. <el-form-item v-if="tabPosition === '1'" label="新增内容" prop="replace">
  480. <el-input
  481. v-model="ruleForm.replace"
  482. placeholder="请输入新增内容"
  483. />
  484. </el-form-item>
  485. <el-form-item v-if="tabPosition === '2'" label="替换内容" prop="replace">
  486. <el-input
  487. v-model="ruleForm.replace"
  488. placeholder="请输入替换后内容"
  489. />
  490. </el-form-item>
  491. <el-form-item v-if="tabPosition === '3'" label="删除内容" prop="query">
  492. <el-input
  493. v-model="ruleForm.query"
  494. placeholder="请输入原内容"
  495. />
  496. </el-form-item>
  497. <el-form-item v-if="tabPosition === '1'" label="定位条件" prop="position">
  498. <el-select
  499. v-model="ruleForm.position"
  500. placeholder="请选择"
  501. >
  502. <el-option
  503. label="前"
  504. :value="1"
  505. />
  506. <el-option
  507. label="后"
  508. :value="2"
  509. />
  510. </el-select>
  511. </el-form-item>
  512. <!-- <el-form-item label="作用范围">
  513. <span>{{ checkInfo }}</span>
  514. </el-form-item>
  515. </el-form> -->
  516. </el-form>
  517. </div>
  518. </hc-new-dialog>
  519. </hc-body>
  520. </template>
  521. <script setup>
  522. import { useAppStore } from '~src/store'
  523. import { getStoreValue, setStoreValue } from '~src/utils/storage'
  524. import { computed, nextTick, onMounted, ref, watch } from 'vue'
  525. import HcTree from '~src/components/tree/hc-tree.vue'
  526. import HcReport from './components/HcReport.vue'
  527. import notableform from '~src/assets/view/notableform.svg'
  528. import { rowsToId } from '~uti/tools'
  529. import { HcDelMsg, HcUploadFileApi } from 'hc-vue3-ui'
  530. import archiveFileApi from '~api/archiveFile/archiveFile'
  531. import tasksFlowApi from '~api/tasks/flow'
  532. import { arrKeySort, arrToId, deepClone, getArrValue, getObjVal, isNullES } from 'js-fast-way'
  533. import tasksApi from '~api/tasks/data'
  534. import ossApi from '~api/oss'
  535. import { toPdfPage } from '~uti/btn-auth'
  536. //变量
  537. const useAppState = useAppStore()
  538. const projectId = ref(useAppState.getProjectId)
  539. const contractId = ref(useAppState.getContractId)
  540. const projectInfo = ref(useAppState.getProjectInfo)
  541. const isCollapse = ref(useAppState.getCollapse)
  542. //上传进度
  543. const uploadsLoading = ref(false)
  544. const treeRef = ref(null)
  545. //监听
  546. watch(() => [
  547. useAppState.getCollapse,
  548. ], ([Collapse]) => {
  549. isCollapse.value = Collapse
  550. })
  551. //监听
  552. watch(() => [useAppState.getProjectId, useAppState.getContractId, useAppState.getProjectInfo], ([pid, cid, info]) => {
  553. projectId.value = pid
  554. contractId.value = cid
  555. projectInfo.value = info
  556. }, { deep: true })
  557. //加载中
  558. const isAppLoading = computed(() => {
  559. return !isNullES(projectId.value) && !isNullES(contractId.value)
  560. })
  561. //监听变化
  562. watch(() => isAppLoading.value, (val) => {
  563. if (val) {
  564. treeLoading.value = true
  565. setTableColumns()
  566. }
  567. })
  568. //渲染完成
  569. onMounted(() => {
  570. if (isAppLoading.value) {
  571. treeLoading.value = true
  572. setTableColumns()
  573. }
  574. if (tableRef.value) {
  575. const scrollWidth = tableRef.value.scrollWidth
  576. // 使用scrollWidth进行后续操作
  577. }
  578. })
  579. //设置树菜单数据
  580. const ElTreeMenu = ref([
  581. { icon: 'add-circle', label: '新增', key: 'add' },
  582. { icon: 'draft', label: '编辑', key: 'edit' },
  583. { icon: 'delete-bin', label: '删除', key: 'del' },
  584. { icon: 'refresh', label: '目录同步', key: 'sync' },
  585. { icon: 'sort-asc', label: '排序', key: 'sort' },
  586. ])
  587. const dutyUser = ref('')
  588. //设置责任者
  589. const setdutyUser = async () => {
  590. const { error, code, data } = await archiveFileApi.getDutyUser({
  591. contractId: treecontractId.value,
  592. projectId: projectId.value,
  593. })
  594. if (!error && code === 200) {
  595. if (data?.contractType === 1) {
  596. dutyUser.value = data?.constructionUnitName || ''
  597. } else if (data?.contractType === 2) {
  598. dutyUser.value = data?.supervisionUnitName || ''
  599. } else if (data?.contractType === 3) {
  600. dutyUser.value = data?.contractorUnitName || ''
  601. }
  602. }
  603. }
  604. //打开文件选择框
  605. const uploadFileClick = () => {
  606. HcUploadFileApi({
  607. multiple: true,
  608. progress: () => {
  609. uploadsLoading.value = true
  610. },
  611. success: (file, res) => {
  612. uploadsChange(file.id, res.data)
  613. },
  614. error: (file) => {
  615. uploadsLoading.value = false
  616. window.$message.error(`${file.name} 上传失败`)
  617. },
  618. finish: () => {
  619. uploadsLoading.value = false
  620. window.$message.success('全部上传完成')
  621. },
  622. })
  623. }
  624. //替换文件
  625. const substitutionClick = (row) => {
  626. HcUploadFileApi({
  627. multiple: false,
  628. progress: () => {
  629. uploadsLoading.value = true
  630. },
  631. success: (_, { data }) => {
  632. //更新数据
  633. // row.fileName = data?.originalName
  634. row.fileName = data?.originalName.split('.')[0]
  635. row.ossFileName = data?.name || ''
  636. row.fileUrl = data?.link || ''
  637. row.pdfFileUrl = data?.pdfUrl || ''
  638. row.filePage = data?.page || ''
  639. row.isUpdateUrl = 1
  640. uploadsLoading.value = false
  641. window.$message.success('上传成功')
  642. },
  643. error: (file) => {
  644. uploadsLoading.value = false
  645. window.$message.error(`${file.name} 上传失败`)
  646. },
  647. })
  648. }
  649. //树加载
  650. const treeLoading = ref(false)
  651. const treeNodeLoading = () => {
  652. treeLoading.value = false
  653. }
  654. const treePanelLoading = ref(false)
  655. const panelTreeLoading = () => {
  656. treePanelLoading.value = false
  657. }
  658. //审批状态
  659. const approvalStatus = ref([
  660. { label: '未上报', value: '0' },
  661. { label: '待审批', value: '1' },
  662. { label: '已审批', value: '2' },
  663. ])
  664. //认证状态
  665. const certifiedStatus = ref([
  666. { label: '已认证', value: '1' },
  667. { label: '未认证', value: '0' },
  668. ])
  669. //搜索表单
  670. const searchForm = ref({
  671. nodeIds: '',
  672. approval: null, certified: null, queryValue: null,
  673. current: 1, size: 20, total: 0, isArchive:'',
  674. })
  675. //树相关的变量
  676. const isBuiltDrawing = ref(0)
  677. const isStorageNode = ref(0)
  678. const nodeIds = ref('')
  679. const treecontractId = ref('')
  680. //自动展开缓存
  681. const treeAutoExpandKeys = ref(getStoreValue('wbsTreeExpandKeys') || [])
  682. const checkTreeData = ref(null)
  683. const projectTreeClick = ({ data, keys }) => {
  684. checkTreeData.value = data
  685. setStoreValue('wbsTreeExpandKeys', keys)
  686. treeAutoExpandKeys.value = keys || []
  687. nodeIds.value = data.id || ''
  688. isStorageNode.value = data['isStorageNode'] || 0
  689. treecontractId.value = data?.contractId || ''
  690. //设置搜索数据
  691. searchForm.value.current = 1
  692. searchForm.value.nodeIds = data.id || ''
  693. sortSearchForm.value.nodeIds = data.id || ''
  694. isBuiltDrawing.value = data.storageType
  695. getTableData()
  696. }
  697. //树菜单被点击
  698. const ElTreeMenuClick = async ({ data, keys }) => {
  699. // debugger
  700. setStoreValue('wbsTreeExpandKeys', keys)
  701. treeAutoExpandKeys.value = keys || []
  702. if (data?.extType === 2) {
  703. // 声像节点显示声像文件同步菜单
  704. ElTreeMenu.value = [
  705. { icon: 'add-circle', label: '新增', key: 'add' },
  706. { icon: 'draft', label: '编辑', key: 'edit' },
  707. { icon: 'delete-bin', label: '删除', key: 'del' },
  708. { icon: 'refresh', label: '目录同步', key: 'sync' },
  709. { icon: 'refresh', label: '文件同步', key: 'fileSync' },
  710. { icon: 'sort-asc', label: '排序', key: 'sort' },
  711. ]
  712. } else {
  713. if (data?.associationType === 3) {
  714. //声像
  715. ElTreeMenu.value = [
  716. { icon: 'add-circle', label: '新增', key: 'add' },
  717. { icon: 'draft', label: '编辑', key: 'edit' },
  718. { icon: 'delete-bin', label: '删除', key: 'del' },
  719. //{ icon: 'refresh', label: '目录同步', key: 'sync' },
  720. { icon: 'sort-asc', label: '排序', key: 'sort' },
  721. { icon: 'refresh', label: '声像文件同步', key: 'syncVocie' },
  722. ]
  723. } else if (data?.associationType === 6) {
  724. //日志
  725. ElTreeMenu.value = [
  726. { icon: 'add-circle', label: '新增', key: 'add' },
  727. { icon: 'draft', label: '编辑', key: 'edit' },
  728. { icon: 'delete-bin', label: '删除', key: 'del' },
  729. //{ icon: 'refresh', label: '目录同步', key: 'sync' },
  730. { icon: 'sort-asc', label: '排序', key: 'sort' },
  731. { icon: 'refresh', label: '日志文件同步', key: 'syncVocie' },
  732. ]
  733. } else if (data?.associationType === 2) {
  734. //试验
  735. ElTreeMenu.value = [
  736. { icon: 'add-circle', label: '新增', key: 'add' },
  737. { icon: 'draft', label: '编辑', key: 'edit' },
  738. { icon: 'delete-bin', label: '删除', key: 'del' },
  739. //{ icon: 'refresh', label: '目录同步', key: 'sync' },
  740. { icon: 'sort-asc', label: '排序', key: 'sort' },
  741. { icon: 'refresh', label: '试验文件同步', key: 'syncVocie' },
  742. ]
  743. } else {
  744. ElTreeMenu.value = [
  745. { icon: 'add-circle', label: '新增', key: 'add' },
  746. { icon: 'draft', label: '编辑', key: 'edit' },
  747. { icon: 'delete-bin', label: '删除', key: 'del' },
  748. { icon: 'refresh', label: '目录同步', key: 'sync' },
  749. { icon: 'sort-asc', label: '排序', key: 'sort' },
  750. ]
  751. }
  752. }
  753. }
  754. //回车搜索
  755. const keyUpEvent = (e) => {
  756. if (e.key === 'Enter') {
  757. searchForm.value.current = 1
  758. getTableData()
  759. }
  760. }
  761. //搜索
  762. const searchClick = () => {
  763. searchForm.value.current = 1
  764. getTableData()
  765. }
  766. //分页被点击
  767. const pageChange = ({ current, size }) => {
  768. searchForm.value.current = current
  769. searchForm.value.size = size
  770. getTableData()
  771. }
  772. //表格数据
  773. const tableRef = ref(null)
  774. const tableColumn = ref([])
  775. //设置表头
  776. const setTableColumns = () => {
  777. if (isBuiltDrawing.value === 1) {
  778. tableColumn.value = [
  779. { key: 'sourceType', name: '文件来源', width: 100 },
  780. { key: 'fileNumber', name: '文件编号', width: 100, autoWidth: true },
  781. { key: 'fileName', name: '文件名称' },
  782. { key: 'filePage', name: '文件页数', width: 120 },
  783. { key: 'sheetType', name: '图幅', width: 110 },
  784. { key: 'sheetSourceValue', name: '图表来源', width: 110 },
  785. { key: 'drawingNo', name: '图号', width: 110 },
  786. { key: 'citeChangeNumber', name: '引用变更令编号', width: 110 },
  787. { key: 'isCertificationValue', name: '认证状态', width: 100 },
  788. { key: 'isApprovalValue', name: '状态', width: 100 },
  789. { key: 'isArchive', name: '组卷状态', width: 100 },
  790. { key: 'fileTime', name: '文件时间', width: 120, autoWidth: true },
  791. { key: 'dutyUser', name: '责任者', width: 140 },
  792. ]
  793. sheetTypeStatus()
  794. sheetSourceStatus()
  795. } else {
  796. tableColumn.value = [
  797. { key: 'sourceType', name: '文件来源', width: 100 },
  798. { key: 'fileNumber', name: '文件编号', width: 100, autoWidth: true },
  799. { key: 'fileName', name: '文件名称' },
  800. { key: 'filePage', name: '文件页数', width: 100 },
  801. { key: 'isCertificationValue', name: '认证状态', width: 100 },
  802. { key: 'isApprovalValue', name: '状态', width: 100 },
  803. { key: 'isArchive', name: '组卷状态', width: 100 },
  804. { key: 'fileTime', name: '文件时间', width: 120, autoWidth: true },
  805. { key: 'dutyUser', name: '责任者', width: 140 },
  806. ]
  807. }
  808. }
  809. const tableData = ref([])
  810. //获取数据
  811. const tableLoading = ref(false)
  812. const getTableData = async () => {
  813. tableLoading.value = true
  814. fileTotalPage.value = 0
  815. const { error, code, data } = await archiveFileApi.getarchiveFilePage({
  816. ...searchForm.value,
  817. projectId: projectId.value,
  818. contractId: contractId.value,
  819. })
  820. tableLoading.value = false
  821. if (!error && code === 200) {
  822. tableData.value = getArrValue(data['records'])
  823. searchForm.value.total = data['total'] || 0
  824. } else {
  825. tableData.value = []
  826. searchForm.value.total = 0
  827. }
  828. getFileTotalPage()
  829. }
  830. //获取当前页的总页数
  831. const fileTotalPage = ref(0)
  832. const getFileTotalPage = () => {
  833. const arr = tableData.value
  834. if (arr.length <= 0) {
  835. fileTotalPage.value = 0
  836. return
  837. }
  838. //遍历数据
  839. let newPage = 0
  840. for (let i = 0; i < arr.length; i++) {
  841. newPage = newPage + Number(arr[i].filePage || 0)
  842. }
  843. fileTotalPage.value = newPage
  844. }
  845. //多选
  846. const tableCheckedKeys = ref([])
  847. const tableSelection = (rows) => {
  848. tableCheckedKeys.value = rows
  849. }
  850. //分盒整理
  851. const sortingModal = ref(false)
  852. const sortingClick = async () => {
  853. if (nodeIds.value && isStorageNode.value === 1) {
  854. const { error, code, data } = await archiveFileApi.getBoxNameAndBoxNumber({
  855. nodeId: nodeIds.value,
  856. })
  857. if (!error && code === 200) {
  858. if (data.length > 0) {
  859. sortingActiveKey.value = []
  860. sortingModal.value = true
  861. sortingItemData.value = getArrValue(data)
  862. sortingOldData.value = deepClone(sortingItemData.value)
  863. } else {
  864. console.log(1111111)
  865. sortingNoneModal.value = true
  866. }
  867. }
  868. } else {
  869. window?.$message?.warning('请先选择一个子节点')
  870. }
  871. }
  872. const sortingNoneModal = ref(false)//无数据显示的弹窗
  873. const toSortingModal = () => {
  874. sortingNoneModal.value = false
  875. sortingActiveKey.value = []
  876. sortingItemData.value = []
  877. sortingModal.value = true
  878. }
  879. const sortingNoneModalClose = () => {
  880. sortingNoneModal.value = false
  881. }
  882. const sortingItemData = ref([])
  883. const sortingOldData = ref([])//旧数据,用来对比是否修改名字
  884. //校验
  885. const tableIsInput = (val, row, key) => {
  886. //检测是否改过案卷名字
  887. if (key === 'isName') {
  888. row.isChange = true
  889. }
  890. row[key] = !val
  891. }
  892. const sortingActiveKey = ref([])
  893. const tableIndex = ref('')
  894. const sortingSelectFile = (row, index) => {
  895. tableIndex.value = index
  896. const key = `item-${index}`
  897. const indexNum = sortingActiveKey.value.indexOf(key)
  898. if (indexNum > -1) {
  899. sortingActiveKey.value.splice(indexNum, 1)
  900. } else {
  901. sortingActiveKey.value.push(key)
  902. if (!(row.list && row.list.length > 0)) {
  903. getSortingTableData(row, index)
  904. }
  905. }
  906. }
  907. //表格
  908. const sortingTableColumn = [
  909. { key: 'name', name: '文件名称' },
  910. ]
  911. //获取数据
  912. const sortingTableLoading = ref(false)
  913. const getSortingTableData = async (row, index) => {
  914. sortingTableLoading.value = true
  915. tableindex.value = index
  916. const { error, code, data } = await archiveFileApi.pageByBoxName({
  917. size: 99999,
  918. current: 1,
  919. projectId: projectId.value,
  920. contractId: contractId.value,
  921. nodeIds: nodeIds.value,
  922. boxName: row.boxName ? row.boxName : '',
  923. })
  924. sortingTableLoading.value = false
  925. if (!error && code === 200) {
  926. row.list = getArrValue(data['records'])
  927. setTableCheck(row, index).then()
  928. } else {
  929. row.list = []
  930. }
  931. }
  932. //表格ref
  933. const sorTableRef = ref([])
  934. const tableindex = ref('')
  935. //回显勾选
  936. const setTableCheck = async (row, index) => {
  937. if (row.ids) {
  938. const keys = row.ids.split(','), list = row.list
  939. for (let i = 0; i < list.length; i++) {
  940. const item = list[i]
  941. if (keys.indexOf(item.id) > -1) {
  942. item.checked = true
  943. await nextTick()
  944. // console.log(sorTableRef.value[index], 'sorTableRef.value[index]')
  945. sorTableRef.value[index].toggleRowSelection(item, true)
  946. }
  947. }
  948. }
  949. }
  950. //多选
  951. const checkList = ref([])
  952. const arrfliter = ref([])
  953. const singleCheck = async ({ row }) => {
  954. let isCheck = false
  955. let checkrow = JSON.parse(JSON.stringify(row))
  956. if (checkrow.checked === false || checkrow.checked === undefined) {
  957. if (checkList.value.length > 0) {
  958. let arr = checkList.value.filter(e => e.id === checkrow.id)
  959. if (arr.length > 0) {
  960. window.$message.warning('多个盒子不能选择同一份文件')
  961. await nextTick()
  962. sorTableRef.value[tableindex.value].toggleRowSelection(row, false)
  963. isCheck = true
  964. } else {
  965. isCheck = false
  966. row.tableindex = tableindex.value
  967. checkList.value.push(row)
  968. }
  969. } else {
  970. row.tableindex = tableindex.value
  971. checkList.value.push(row)
  972. }
  973. } else {
  974. let arr = checkList.value.filter(e => e.id === checkrow.id)
  975. if (isCheck === false && arr[0]?.checked === true || isCheck) {
  976. arrfliter.value = checkList.value.filter(e => e.id !== checkrow.id)
  977. } else {
  978. arrfliter.value = checkList.value
  979. }
  980. let newarr = []
  981. arrfliter.value.forEach((item) => {
  982. newarr.push(JSON.parse(JSON.stringify(item)))
  983. })
  984. checkList.value = newarr
  985. }
  986. }
  987. const sortingTableSelection = (rows, list, index) => {
  988. tableindex.value = index
  989. if (list) {
  990. list.forEach(element => {
  991. element.checked = false
  992. })
  993. }
  994. rows.forEach((element) => {
  995. element.checked = true
  996. })
  997. }
  998. //删除
  999. const sortingDelData = (row, index) => {
  1000. sortingItemData.value.splice(index, 1)
  1001. console.log(checkList.value, 'checkList.value')
  1002. // checkList.value=[]
  1003. //过滤掉当前选择的文件
  1004. checkList.value = checkList.value.filter(e => e.tableindex !== index)
  1005. if (row.boxNumber) {
  1006. HcDelMsg(async (resolve) => {
  1007. const { error, code } = await archiveFileApi.removeAllocation({
  1008. boxName: row.boxName,
  1009. boxNumber: row.boxNumber,
  1010. })
  1011. if (!error && code === 200) {
  1012. window.$message?.success('删除成功!')
  1013. sortingClick()
  1014. }
  1015. resolve() //关闭弹窗的回调
  1016. })
  1017. }
  1018. }
  1019. //添加分盒
  1020. const addSortingModalClick = () => {
  1021. console.log('添加分盒')
  1022. sortingItemData.value.push({
  1023. boxName: '',
  1024. })
  1025. }
  1026. //确认保存
  1027. const sortingModalLoading = ref(false)
  1028. const sortingModalSave = async () => {
  1029. sortingModalLoading.value = true
  1030. //检测案卷名是否重复
  1031. let nameRes = await checkNames()
  1032. //console.log(nameRes)
  1033. //return;
  1034. for (let i = 0; i < nameRes.length; i++) {
  1035. if (typeof nameRes[i].data == 'string') {
  1036. window.$message?.error(nameRes[i].data + ',案卷名重复')
  1037. sortingModalLoading.value = false
  1038. return
  1039. }
  1040. }
  1041. //组装数据
  1042. let rows = []
  1043. sortingItemData.value.forEach((item, index) => {
  1044. let obj = {
  1045. ids: '',
  1046. boxName: item.boxName,
  1047. boxNumber: index + 1,
  1048. }
  1049. let list = []
  1050. if (item.list) {
  1051. item.list.forEach((item2) => {
  1052. if (item2.checked) {
  1053. list.push(item2.id)
  1054. }
  1055. })
  1056. obj.ids = list.join(',')
  1057. } else {
  1058. obj.ids = item.ids
  1059. }
  1060. rows.push(obj)
  1061. })
  1062. console.log(rows, 'rows')
  1063. if (rows[0]?.ids) {
  1064. const { error, code, data } = await archiveFileApi.allocation({
  1065. list: rows,
  1066. })
  1067. if (!error && code === 200) {
  1068. window.$message?.success('保存成功')
  1069. sortingModal.value = false
  1070. } else {
  1071. window.$message?.error('保存失败')
  1072. }
  1073. } else {
  1074. window.$message?.warning('空数据不能提交')
  1075. }
  1076. sortingModalLoading.value = false
  1077. }
  1078. const checkNames = () => {
  1079. const arr = []
  1080. sortingItemData.value.forEach((item) => {
  1081. if (item.boxNumber) {
  1082. if (item.isChange) {
  1083. //是否修改过
  1084. //对比旧的数据,是否相同
  1085. for (let i = 0; i < sortingOldData.value.length; i++) {
  1086. if (sortingOldData.value[i].boxNumber == item.boxNumber) {
  1087. if (sortingOldData.value[i].boxName != item.boxName) {
  1088. arr.push(
  1089. archiveFileApi.getIsBoxName({
  1090. boxName: item.boxName,
  1091. }),
  1092. )
  1093. }
  1094. return
  1095. }
  1096. }
  1097. }
  1098. } else {
  1099. arr.push(
  1100. archiveFileApi.getIsBoxName({
  1101. boxName: item.boxName,
  1102. }),
  1103. )
  1104. }
  1105. })
  1106. return Promise.all(arr)
  1107. }
  1108. //关闭
  1109. const sortingModalClose = () => {
  1110. sortingModal.value = false
  1111. }
  1112. //删除
  1113. const delModalClick = () => {
  1114. const rows = tableCheckedKeys.value
  1115. //待审批,已审批都不能删除 豆海涛说,先取消限制
  1116. /*const result = rows.some(({ isApprovalValue }) => {
  1117. return isApprovalValue === '待审批' || isApprovalValue === '已审批'
  1118. })
  1119. if (result) {
  1120. window.$message.warning('待审批或者已审批的文件都不能删除')
  1121. return
  1122. }
  1123. if (rows.length <= 0) {
  1124. window.$message?.error('请选择需要删除的数据')
  1125. } else {
  1126. HcDelMsg(async (resolve) => {
  1127. const keys = arrToId(rows)
  1128. const { error, code } = await archiveFileApi.removeFile({
  1129. ids: keys,
  1130. })
  1131. if (!error && code === 200) {
  1132. window.$message?.success('删除成功!')
  1133. searchClick()
  1134. }
  1135. resolve() //关闭弹窗的回调
  1136. })
  1137. }*/
  1138. const lockedArchives = tableCheckedKeys.value.filter(item => item.isLock === 1)
  1139. if (lockedArchives.length > 0) {
  1140. window.$message.warning('选择的文件中包含被锁定的项,无法操作')
  1141. return
  1142. }
  1143. HcDelMsg(async (resolve) => {
  1144. const keys = arrToId(rows)
  1145. const { error, code } = await archiveFileApi.removeFile({
  1146. ids: keys,
  1147. })
  1148. if (!error && code === 200) {
  1149. window.$message?.success('删除成功!')
  1150. searchClick()
  1151. }
  1152. resolve() //关闭弹窗的回调
  1153. })
  1154. }
  1155. //废除
  1156. const repealModalClick = async () => {
  1157. const rows = tableCheckedKeys.value
  1158. if (rows.length <= 0) {
  1159. window.$message?.error('请选择需要废除的数据')
  1160. } else {
  1161. const lockedArchives = tableCheckedKeys.value.filter(item => item.isLock === 1)
  1162. if (lockedArchives.length > 0) {
  1163. window.$message.warning('选择的文件中包含被锁定的项,无法操作')
  1164. return
  1165. }
  1166. window?.$messageBox?.alert('请谨慎考虑后,确认是否需要废除?', '废除提醒', {
  1167. showCancelButton: true,
  1168. confirmButtonText: '确认废除',
  1169. cancelButtonText: '取消',
  1170. type: 'warning',
  1171. callback: async (action, instance, done) => {
  1172. if (action === 'confirm') {
  1173. instance.confirmButtonLoading = true
  1174. const keys = arrToId(rows)
  1175. const { error, code } = await tasksFlowApi.batchRepealTaskArchive({
  1176. ids: keys,
  1177. type: 1,
  1178. projectId: projectId.value,
  1179. contractId: contractId.value,
  1180. })
  1181. if (!error && code === 200) {
  1182. window.$message?.success('废除成功!')
  1183. searchClick()
  1184. }
  1185. instance.confirmButtonLoading = false
  1186. done()
  1187. } else {
  1188. done()
  1189. }
  1190. },
  1191. })
  1192. }
  1193. }
  1194. //跨目录移动
  1195. const movesModal = ref(false)
  1196. const movesClick = async () => {
  1197. movesModal.value = true
  1198. checkedMoves.value = []
  1199. movesCheckAll.value = false
  1200. treePanelLoading.value = true
  1201. fileDatasListLoading.value = true
  1202. const { error, code, data } = await archiveFileApi.getarchiveFilePage({
  1203. ...searchForm.value,
  1204. current: 1,
  1205. size: 50000,
  1206. projectId: projectId.value,
  1207. contractId: contractId.value,
  1208. })
  1209. fileDatasListLoading.value = false
  1210. if (!error && code === 200) {
  1211. fileDatasList.value = getArrValue(data['records'])
  1212. } else {
  1213. fileDatasList.value = []
  1214. }
  1215. }
  1216. //选择需要迁移的文件
  1217. const movesCheckAll = ref(false)
  1218. const isIndeterminate = ref(true)
  1219. const checkedMoves = ref([])
  1220. //左侧待迁移文件
  1221. const fileDatasList = ref([])
  1222. const fileDatasListLoading = ref(false)
  1223. //全选
  1224. const handleCheckAllChange = (val) => {
  1225. console.log(val, 'val')
  1226. const checked = fileDatasList.value
  1227. checkedMoves.value = val ? checked : []
  1228. isIndeterminate.value = false
  1229. }
  1230. //勾选
  1231. const handleCheckedMovesChange = (value) => {
  1232. const keys = fileDatasList.value
  1233. const checkedCount = value.length
  1234. movesCheckAll.value = checkedCount === keys.length
  1235. isIndeterminate.value = checkedCount > 0 && checkedCount < keys.length
  1236. }
  1237. //右侧radio
  1238. let radioNodeId = ''
  1239. const radioChange = (id) => {
  1240. //console.log(id)
  1241. radioNodeId = id
  1242. }
  1243. //只显示储存节点的单选
  1244. const showRadioFun = (data) => {
  1245. if (data.isStorageNode == 1) {
  1246. return true
  1247. } else {
  1248. return false
  1249. }
  1250. }
  1251. //保存
  1252. const movesModalLoading = ref(false)
  1253. const movesModalSave = async () => {
  1254. const keys = rowsToId(checkedMoves.value)
  1255. let ids = keys
  1256. if (checkedMoves.value.length < 1) {
  1257. window.$message?.warning('请勾选需要迁移的文件')
  1258. return
  1259. }
  1260. if (radioNodeId == '') {
  1261. window.$message?.warning('请选择要移动到的节点')
  1262. return
  1263. }
  1264. movesModalLoading.value = true
  1265. const { error, code, data } = await archiveFileApi.migrateFile({
  1266. ids: ids,
  1267. nodeId: radioNodeId,
  1268. })
  1269. movesModalLoading.value = false
  1270. if (!error && code === 200) {
  1271. window.$message?.success('保存成功')
  1272. movesModal.value = false
  1273. getTableData()
  1274. } else {
  1275. window.$message?.error('保存失败')
  1276. }
  1277. }
  1278. //关闭
  1279. const movesModalClose = () => {
  1280. movesModal.value = false
  1281. }
  1282. //表格排序
  1283. const sortModal = ref(false)
  1284. //显示
  1285. const tableSortClick = () => {
  1286. const { hasChildren } = checkTreeData.value
  1287. if (hasChildren) {
  1288. window.$message?.error('仅支持最小存储节点内进行排序,若需跨节点排序,请使用【跨目录移动】按钮')
  1289. return
  1290. }
  1291. sortModal.value = true
  1292. getSortTableData()
  1293. }
  1294. //搜索表单
  1295. const sortSearchForm = ref({
  1296. nodeIds: '',
  1297. current: 1, size: 20, total: 0,
  1298. })
  1299. //分页被点击
  1300. const sortPageChange = ({ current, size }) => {
  1301. sortSearchForm.value.current = current
  1302. sortSearchForm.value.size = size
  1303. getSortTableData()
  1304. }
  1305. //表格数据
  1306. const sortTableColumn = ref([
  1307. { key: 'fileNumber', name: '文件编号', width: 160 },
  1308. { key: 'fileName', name: '文件名称' },
  1309. { key: 'fileTime', name: '文件时间', width: 120 },
  1310. { key: 'action', name: '排序', width: 90 },
  1311. ])
  1312. const sortTableData = ref([])
  1313. const sortTableLoading = ref(false)
  1314. const getSortTableData = async () => {
  1315. sortTableLoading.value = true
  1316. const { error, code, data } = await archiveFileApi.getarchiveFilePage({
  1317. ...sortSearchForm.value,
  1318. projectId: projectId.value,
  1319. contractId: contractId.value,
  1320. })
  1321. sortTableLoading.value = false
  1322. if (!error && code === 200) {
  1323. sortTableData.value = getArrValue(data['records'])
  1324. oldList.value = deepClone(sortTableData.value)
  1325. sortSearchForm.value.total = data['total'] || 0
  1326. } else {
  1327. sortTableData.value = []
  1328. sortSearchForm.value.total = 0
  1329. }
  1330. }
  1331. //拖动完成
  1332. const sortTableRowDrop = (rows) => {
  1333. sortTableData.value = [] // 先清空,否则排序会异常
  1334. nextTick(() => {
  1335. sortTableData.value = rows
  1336. })
  1337. }
  1338. //向下
  1339. const downSortClick = (index) => {
  1340. const indexs = index + 1
  1341. const data = sortTableData.value
  1342. if (indexs !== data.length) {
  1343. const tmp = data.splice(indexs, 1)
  1344. sortTableData.value.splice(index, 0, tmp[0])
  1345. } else {
  1346. window?.$message?.warning('已经处于置底,无法下移')
  1347. }
  1348. }
  1349. //向上
  1350. const upSortClick = (index) => {
  1351. const data = sortTableData.value || []
  1352. if (index !== 0) {
  1353. const tmp = data.splice(index - 1, 1)
  1354. sortTableData.value.splice(index, 0, tmp[0])
  1355. } else {
  1356. window?.$message?.warning('已经处于置顶,无法上移')
  1357. }
  1358. }
  1359. //保存
  1360. const oldList = ref([])
  1361. const sortModalLoading = ref(false)
  1362. const sortModalSave = async () => {
  1363. await batchEditSaveApi(sortTableData.value)
  1364. sortModal.value = false
  1365. }
  1366. //关闭
  1367. const sortModalClose = () => {
  1368. sortModal.value = false
  1369. }
  1370. //获取认证状态
  1371. const certificationType = ref([])
  1372. const certificationStatus = async () => {
  1373. const { error, code, data } = await tasksApi.queryTaskTypeStatus({
  1374. typeOrStatus: 'certification_status',
  1375. })
  1376. //处理数据
  1377. if (!error && code === 200) {
  1378. certificationType.value = getArrValue(data)
  1379. } else {
  1380. certificationType.value = []
  1381. }
  1382. }
  1383. //获取图幅类型
  1384. const sheetType = ref([])
  1385. const sheetTypeStatus = async () => {
  1386. console.log(1111111)
  1387. const { error, code, data } = await tasksApi.queryTaskTypeStatus({
  1388. typeOrStatus: 'sheet_type',
  1389. })
  1390. //处理数据
  1391. if (!error && code === 200) {
  1392. sheetType.value = getArrValue(data)
  1393. } else {
  1394. sheetType.value = []
  1395. }
  1396. }
  1397. //获取图表来源
  1398. const sheetSourceType = ref([])
  1399. const sheetSourceStatus = async () => {
  1400. const { error, code, data } = await tasksApi.queryTaskTypeStatus({
  1401. typeOrStatus: 'sheet_source',
  1402. })
  1403. //处理数据
  1404. if (!error && code === 200) {
  1405. sheetSourceType.value = getArrValue(data)
  1406. } else {
  1407. sheetSourceType.value = []
  1408. }
  1409. }
  1410. //新增文件
  1411. const tableUploadType = ref('add')
  1412. const showUploadModal = ref(false)
  1413. const needApproval = ref('')
  1414. const needApproval1 = ref('')
  1415. const batchAuthentication = ()=>{
  1416. tableUploadData.value.forEach(item=>{
  1417. // item.isApproval = needApproval.value
  1418. // item.isNeedCertification = needApproval1.value
  1419. item.isApproval = needApproval1.value
  1420. item.isNeedCertification = needApproval.value
  1421. })
  1422. }
  1423. const uploadModalClick = () => {
  1424. if (nodeIds.value && isStorageNode.value === 1) {
  1425. tableUploadType.value = 'add'
  1426. setTableUploadColumn()
  1427. uploadSaveLoading.value = false
  1428. tableUploadData.value = []
  1429. needApproval.value = ''
  1430. needApproval1.value = ''
  1431. showUploadModal.value = true
  1432. setdutyUser()
  1433. } else {
  1434. window?.$message?.warning('请先选择一个子节点')
  1435. }
  1436. }
  1437. const uploadModalClose = () => {
  1438. batchUploadCancel()
  1439. }
  1440. //设置文件表头
  1441. const tableUploadColumn = ref([
  1442. { key: 'fileNumber', name: '文件编号' },
  1443. { key: 'fileName', name: '文件名称' },
  1444. { key: 'fileTime', name: '文件时间' },
  1445. { key: 'isApproval', name: '是否需要审批', width: 80 },
  1446. { key: 'isNeedCertification', name: '是否需要认证', width: 80 },
  1447. { key: 'dutyUser', name: '责任者' },
  1448. { key: 'isElement', name: '是否四要素' },
  1449. { key: 'action', name: '操作', width: 220 },
  1450. ])
  1451. const setTableUploadColumn = () => {
  1452. const type = tableUploadType
  1453. if (isBuiltDrawing.value === 2) {
  1454. tableUploadColumn.value = [
  1455. { key: 'fileNumber', name: '文件编号', width: 200 },
  1456. { key: 'fileName', name: '文件名称', minWidth: 400 },
  1457. { key: 'fileTime', name: '文件时间', width: 140 },
  1458. { key: 'sheetType', name: '图幅', width: 100 },
  1459. { key: 'sheetSource', name: '图表来源', width: 100 },
  1460. { key: 'drawingNo', name: '图号', width: 140 },
  1461. { key: 'citeChangeNumber', name: '引用变更令编号', width: 140 },
  1462. { key: 'isApproval', name: '是否需要审批', width: 100 },
  1463. { key: 'isNeedCertification', name: '是否需要认证', width: 100 },
  1464. { key: 'dutyUser', name: '责任者', width: 160 },
  1465. { key: 'isElement', name: '是否四要素', width: 90 },
  1466. {
  1467. key: 'action', name: '操作',
  1468. width: type.value === 'edit' ? 220 : 70,
  1469. align: 'center', fixed: 'right',
  1470. },
  1471. ]
  1472. sheetTypeStatus()
  1473. sheetSourceStatus()
  1474. } else {
  1475. tableUploadColumn.value = [
  1476. { key: 'fileNumber', name: '文件编号', width: 200 },
  1477. { key: 'fileName', name: '文件名称' },
  1478. { key: 'fileTime', name: '文件时间', width: 140 },
  1479. { key: 'isApproval', name: '是否需要审批', width: 100 },
  1480. { key: 'isNeedCertification', name: '是否需要认证', width: 100 },
  1481. { key: 'dutyUser', name: '责任者', width: 160 },
  1482. { key: 'isElement', name: '是否四要素', width: 90 },
  1483. {
  1484. key: 'action', name: '操作',
  1485. width: type.value === 'edit' ? 220 : 70,
  1486. align: 'center', fixed: 'right',
  1487. },
  1488. ]
  1489. }
  1490. }
  1491. const tableUploadData = ref([])
  1492. //上传的文件结果
  1493. const uploadsChange = (fileId, item) => {
  1494. if (getObjVal(item)) {
  1495. let newArr = tableUploadData.value
  1496. const sheet = sheetType.value, source = sheetSourceType.value
  1497. let name = item['originalName'] || ''
  1498. let fileName = name.substring(0, name.lastIndexOf('.'))
  1499. newArr.push({
  1500. fileUploadId: fileId,
  1501. projectId: projectId.value,
  1502. contractId: contractId.value,
  1503. nodeId: nodeIds.value,
  1504. fileNumber: '',
  1505. fileName: fileName,
  1506. ossFileName: item?.name || '',
  1507. fileTime: null,
  1508. fileUrl: item?.link || '',
  1509. sheetType: sheet.length > 0 ? sheet[0]['dictKey'] || '' : '',
  1510. sheetSource: source.length > 0 ? source[0]['dictKey'] || '' : '',
  1511. drawingNo: '',
  1512. citeChangeNumber: '',
  1513. isApproval: 1,
  1514. isNeedCertification: 1,
  1515. dutyUser: dutyUser.value,
  1516. pdfFileUrl: item?.pdfUrl || '',
  1517. filePage: item?.page || '',
  1518. isElement: 0,
  1519. isUpdateUrl: 0,
  1520. fileSize: item?.fileSize,
  1521. })
  1522. //tableUploadData.value = newArr
  1523. tableUploadData.value = arrKeySort(newArr, 'fileUploadId')
  1524. } else {
  1525. console.log(item)
  1526. }
  1527. }
  1528. //表单下拉数据
  1529. const whetherData = ref([
  1530. { label: '不需要', value: 0 },
  1531. { label: '需要', value: 1 },
  1532. ])
  1533. //表格数据排序
  1534. const tableUploadRowSort = (arr) => {
  1535. tableUploadData.value = arr
  1536. }
  1537. //删除
  1538. const delUploadData = async (row, index) => {
  1539. if (row['ossFileName']) {
  1540. row['delBtnLoading'] = true
  1541. await ossApi.removeFile({ fileName: row['ossFileName'] })
  1542. row['delBtnLoading'] = false
  1543. tableUploadData.value.splice(index, 1)
  1544. } else {
  1545. tableUploadData.value.splice(index, 1)
  1546. }
  1547. }
  1548. //批量上传保存
  1549. const uploadSaveLoading = ref(false)
  1550. const batchUploadSave = async () => {
  1551. const rows = tableUploadData.value
  1552. if (rows.length > 0) {
  1553. //验证表单数据
  1554. uploadSaveLoading.value = true
  1555. let isTableRows = false
  1556. for (let i = 0; i < rows.length; i++) {
  1557. // if (!rows[i]['fileNumber']) {
  1558. // rows[i]['isFileNumber'] = true
  1559. // isTableRows = true
  1560. // } else if (!rows[i]['fileName']) {
  1561. // rows[i]['isFileName'] = true
  1562. // isTableRows = true
  1563. // }
  1564. // if (!rows[i]['fileTime']) {
  1565. // rows[i]['isFileTime'] = true
  1566. // isTableRows = true
  1567. // }
  1568. // else
  1569. if (!rows[i]['fileName']) {
  1570. rows[i]['isFileName'] = true
  1571. isTableRows = true
  1572. }
  1573. }
  1574. //判断数据
  1575. if (isTableRows) {
  1576. uploadSaveLoading.value = false
  1577. window.$message?.warning('请先完善表单信息')
  1578. } else {
  1579. if (tableUploadType.value === 'add') {
  1580. await batchUploadSaveApi(rows)
  1581. } else {
  1582. await batchEditSaveApi(rows)
  1583. }
  1584. }
  1585. } else {
  1586. window.$message?.warning('请先上传文件')
  1587. }
  1588. }
  1589. //确认上传保存
  1590. const batchUploadSaveApi = async (rows) => {
  1591. uploadSaveLoading.value = true
  1592. const { error, code } = await archiveFileApi.batchUploadSave({
  1593. list: rows,
  1594. }, false)
  1595. //判断状态
  1596. uploadSaveLoading.value = false
  1597. if (!error && code === 200) {
  1598. window.$message?.success('保存成功')
  1599. batchUploadCancel()
  1600. getTableData()
  1601. } else {
  1602. window.$message?.error('保存失败')
  1603. }
  1604. }
  1605. //取消上传
  1606. const batchUploadCancel = () => {
  1607. tableUploadData.value = []
  1608. uploadSaveLoading.value = false
  1609. uploadsLoading.value = false
  1610. showUploadModal.value = false
  1611. }
  1612. //上传新文件
  1613. // const newUploadsChange = ({fileList}, row) => {
  1614. // if (fileList.length > 0) {
  1615. // tableUploadType.value = 'edit'
  1616. // const item = fileList[0]
  1617. // const name = item['originalName'] || ''
  1618. // const fileName = name.substring(0, name.lastIndexOf("."))
  1619. // //更新数据
  1620. // row.fileName = fileName;
  1621. // row.ossFileName = item?.name || ''
  1622. // row.fileUrl = item?.link || ''
  1623. // row.pdfFileUrl = item?.pdfUrl || ''
  1624. // row.filePage = item?.page || ''
  1625. // row.isUpdateUrl=1
  1626. // }
  1627. // }
  1628. // const newUploadsProgress = (val, row) => {
  1629. // row.newBtnLoading = val
  1630. // }
  1631. //批量编辑
  1632. const batchEditClick = () => {
  1633. // const rows = deepClone(tableCheckedKeys.value)
  1634. const rows = JSON.parse(JSON.stringify(tableCheckedKeys.value))
  1635. //判断是否满足条件 豆海涛说,先取消限制
  1636. /*const result = rows.every(({ status }) => {
  1637. return status !== 1 && status !== 2
  1638. })
  1639. //判断状态
  1640. if (result) {
  1641. tableUploadType.value = 'edit'
  1642. setTableUploadColumn()
  1643. uploadSaveLoading.value = false
  1644. tableUploadData.value = rows
  1645. showUploadModal.value = true
  1646. } else {
  1647. window.$message?.warning('已上报或已审批的文件不能编辑')
  1648. }*/
  1649. const lockedArchives = tableCheckedKeys.value.filter(item => item.isLock === 1)
  1650. if (lockedArchives.length > 0) {
  1651. window.$message.warning('选择的文件中包含被锁定的项,无法操作')
  1652. return
  1653. }
  1654. tableUploadType.value = 'edit'
  1655. setTableUploadColumn()
  1656. uploadSaveLoading.value = false
  1657. tableUploadData.value = rows
  1658. showUploadModal.value = true
  1659. }
  1660. //确认编辑上传保存
  1661. const batchEditSaveApi = async (rows) => {
  1662. uploadSaveLoading.value = true
  1663. let finalRows = rows
  1664. finalRows.forEach(item=>{
  1665. delete item.utime
  1666. })
  1667. const { error, code } = await archiveFileApi.batchUpdateSort({
  1668. list: finalRows,
  1669. oldList:oldList.value,
  1670. }, false)
  1671. //判断状态
  1672. uploadSaveLoading.value = false
  1673. if (!error && code === 200) {
  1674. window.$message?.success('保存成功')
  1675. batchUploadCancel()
  1676. getTableData()
  1677. } else {
  1678. window.$message?.error('保存失败')
  1679. }
  1680. }
  1681. //批量认证
  1682. const CertData = ref([])
  1683. const CertIds = ref([])
  1684. const CertPdf = ref('')
  1685. const CertColumns = [
  1686. { key: 'fileName', name: '文件名称' },
  1687. { key: 'action', name: '操作', width: 100 },
  1688. ]
  1689. //批量认证弹窗
  1690. const showCertificationModal = ref(false)
  1691. const certificationModalClick = () => {
  1692. const rows = tableCheckedKeys.value
  1693. // 检查是否有被锁定的案卷
  1694. const lockedArchives = tableCheckedKeys.value.filter(item => item.isLock === 1)
  1695. if (lockedArchives.length > 0) {
  1696. window.$message.warning('选择的文件中包含被锁定的项,无法操作')
  1697. return
  1698. }
  1699. CertData.value = rows
  1700. CertIds.value = rowsToId(rows)
  1701. CertPdf.value = rows[0]?.pdfFileUrl || ''
  1702. const result = rows.every(({ isCertification }) => {
  1703. return isCertification === 0
  1704. })
  1705. const result1 = rows.every(({ status }) => {
  1706. return status === 0 || status === 3
  1707. })//已上报不能认证
  1708. if (!result1) {
  1709. window.$message.warning('已上报的文件不能进行认证')
  1710. } else {
  1711. if (result) {
  1712. CertData.value = rows
  1713. CertIds.value = rowsToId(rows)
  1714. CertPdf.value = rows[0]?.pdfFileUrl || ''
  1715. showCertificationModal.value = true
  1716. } else {
  1717. window.$message?.warning('已认证的文件不能再认证')
  1718. }
  1719. }
  1720. }
  1721. //认证行被点击
  1722. const CertRowClick = ({ row }) => {
  1723. const pdfFileUrl = row?.pdfFileUrl || ''
  1724. if (CertPdf.value !== pdfFileUrl) {
  1725. CertPdf.value = pdfFileUrl
  1726. }
  1727. }
  1728. //认证预览被点击
  1729. const CertRowClick2 = ({ pdfFileUrl }) => {
  1730. const pdfUrl = pdfFileUrl || ''
  1731. if (CertPdf.value !== pdfUrl) {
  1732. CertPdf.value = pdfUrl
  1733. }
  1734. }
  1735. //确认认证
  1736. const CertLoading = ref(false)
  1737. const CertClick = async () => {
  1738. CertLoading.value = true
  1739. const { error, code, msg } = await tasksFlowApi.batchCertification({
  1740. ids: CertIds.value,
  1741. }, false)
  1742. //判断状态
  1743. CertLoading.value = false
  1744. if (!error && code === 200) {
  1745. window.$message?.success(msg)
  1746. showCertificationModal.value = false
  1747. // searchClick()
  1748. getTableData()
  1749. } else {
  1750. window.$message?.error(msg)
  1751. }
  1752. }
  1753. //名称被点击
  1754. const tableRowName = (row) => {
  1755. if (row?.isCertificationValue === '已认证' || row?.isApprovalValue === '已审批') {
  1756. if (row['eVisaFile']) {
  1757. toPdfPage(row['eVisaFile'])
  1758. } else if (row['pdfFileUrl']) {
  1759. toPdfPage(row['pdfFileUrl'])
  1760. } else {
  1761. window.$message?.warning('文件不存在')
  1762. }
  1763. } else {
  1764. if (row['pdfFileUrl']) {
  1765. toPdfPage(row['pdfFileUrl'])
  1766. } else {
  1767. window.$message?.warning('文件不存在')
  1768. }
  1769. }
  1770. }
  1771. //上报
  1772. const isReport = ref(false)
  1773. const reportData = ref([])
  1774. const reportModalClick = () => {
  1775. reportData.value = []
  1776. const rows = tableCheckedKeys.value
  1777. const lockedArchives = tableCheckedKeys.value.filter(item => item.isLock === 1)
  1778. if (lockedArchives.length > 0) {
  1779. window.$message.warning('选择的文件中包含被锁定的项,无法操作')
  1780. return
  1781. }
  1782. //判断是否满足条件
  1783. const result = rows.every(({ status }) => {
  1784. return status === 0 || status === 3
  1785. })
  1786. const result1 = rows.every(({ isCertification }) => {
  1787. return isCertification === 1
  1788. })
  1789. if (result1) {
  1790. window.$message?.warning('已认证的文件不能进行上报')
  1791. return false
  1792. } else {
  1793. if (!result) {
  1794. window.$message?.warning('已上报的文件不能进行再次上报')
  1795. return false
  1796. }
  1797. }
  1798. rows.sort((a, b) => a.sort - b.sort)
  1799. //展示上报弹窗
  1800. reportData.value = rows
  1801. console.log(reportData.value, ' reportData.valu')
  1802. isReport.value = true
  1803. }
  1804. //上报完成
  1805. const reportFinish = () => {
  1806. searchClick()
  1807. }
  1808. //在线验签
  1809. const onlineLoading = ref(false)
  1810. const onlineVerifyData = ref({})
  1811. const isOnlineVerifyDrawer = ref(false)
  1812. const onlineVerifyOptions = {
  1813. sizes: [50, 50],
  1814. snapOffset: 0,
  1815. minSize: ['10%', '80%'],
  1816. }
  1817. const batchOnline = async () => {
  1818. const rows = tableCheckedKeys.value
  1819. if (rows.length > 1) {
  1820. window.$message?.warning('在线验签只能勾选一条数据进行验签')
  1821. return
  1822. }
  1823. const lockedArchives = tableCheckedKeys.value.filter(item => item.isLock === 1)
  1824. if (lockedArchives.length > 0) {
  1825. window.$message.warning('选择的文件中包含被锁定的项,无法操作')
  1826. return
  1827. }
  1828. //判断是否满足条件
  1829. const result = rows.every(({ status }) => {
  1830. return status === 2
  1831. })
  1832. //判断状态
  1833. if (!result) {
  1834. window.$message?.warning('存在未审批或未上报数据')
  1835. return
  1836. }
  1837. //发起请求
  1838. //const ids = arrToId(rows)
  1839. onlineLoading.value = true
  1840. /*const { error, code, msg, data } = await queryApi.onlineVerify({
  1841. ids: ids,
  1842. })
  1843. //处理数据
  1844. onlineLoading.value = false
  1845. if (!error && code === 200) {
  1846. onlineVerifyData.value = getObjValue(data)
  1847. //cscTableData.value = getArrValue(data['certBeanVOList'])
  1848. isOnlineVerifyDrawer.value = true
  1849. } else {
  1850. onlineVerifyData.value = {}
  1851. window.$message?.error(msg ?? '操作失败')
  1852. }*/
  1853. onlineVerifyData.value = {}
  1854. isOnlineVerifyDrawer.value = true
  1855. }
  1856. //签名信息
  1857. const cscTableColumn = [
  1858. { key: 'user', name: '签名者', width: 300 },
  1859. { key: 'time', name: '签名时间', width: 200 },
  1860. { key: 'val', name: '摘要' },
  1861. ]
  1862. const cscTableData = ref([])
  1863. //在线验签抽屉被关闭
  1864. const onlineVerifyDrawerClose = () => {
  1865. isOnlineVerifyDrawer.value = false
  1866. onlineLoading.value = false
  1867. }
  1868. //处理时间
  1869. const getTableFileTime = (time) => {
  1870. if (isNullES(time)) return ''
  1871. return time.replace(/-/g, '')
  1872. }
  1873. //按日期排序
  1874. const dateClick = async () => {
  1875. let id = nodeIds.value
  1876. if (!id) {
  1877. window.$message?.warning('请先选择节点')
  1878. return
  1879. }
  1880. const { error, code, msg, data } = await archiveFileApi.sortByFileTime({
  1881. nodeId: id,
  1882. })
  1883. if (!error && code === 200) {
  1884. window.$message?.success(msg)
  1885. setTimeout(() => {
  1886. window?.location?.reload() //刷新页面
  1887. }, 1000)
  1888. }
  1889. }
  1890. // 查找替换弹窗相关变量
  1891. const showReplaceModal = ref(false)
  1892. // 查找替换弹窗相关变量
  1893. const replaceTitle = ref('查找替换')
  1894. // 触发查找替换弹窗显示
  1895. const replaceClick = () => {
  1896. if (tableCheckedKeys.value.length === 0) {
  1897. window.$message?.warning('请选择需要更新的案卷')
  1898. return
  1899. }
  1900. // 检查是否有被锁定的案卷
  1901. const lockedArchives = tableCheckedKeys.value.filter(item => item.isLock === 1)
  1902. if (lockedArchives.length > 0) {
  1903. window.$message.warning('选择的案卷中包含被锁定的项,无法操作')
  1904. return
  1905. }
  1906. showReplaceModal.value = true
  1907. ruleForm.value = {}
  1908. }
  1909. const changeTab = ()=>{
  1910. ruleForm.value = {}
  1911. }
  1912. const tabPosition = ref('1')
  1913. const ruleFormRef = ref(null)
  1914. const ruleForm = ref({})
  1915. const saveReplaceLoad = ref(false)
  1916. const saveReplace = async ()=>{
  1917. const rows = tableCheckedKeys.value
  1918. let ids = ''
  1919. ids = arrToId(rows)
  1920. // 保存前去除空格
  1921. if (ruleForm.value.query) {
  1922. ruleForm.value.query = ruleForm.value.query.trim()
  1923. }
  1924. if (ruleForm.value.replace) {
  1925. ruleForm.value.replace = ruleForm.value.replace.trim()
  1926. }
  1927. saveReplaceLoad.value = true
  1928. const { error, code, data, msg } = await archiveFileApi.findAndReplace({
  1929. ...ruleForm.value,
  1930. ids,
  1931. type:tabPosition.value,
  1932. })
  1933. saveReplaceLoad.value = false
  1934. if (!error && code === 200) {
  1935. window.$message?.success(msg)
  1936. showReplaceModal.value = false
  1937. getTableData()
  1938. } else {
  1939. window.$message?.warning(msg)
  1940. }
  1941. }
  1942. </script>
  1943. <style lang="scss">
  1944. @import '~style/file/collection.scss';
  1945. //在线验签
  1946. .hc-online-verify-drawer .el-card.hc-new-card-box {
  1947. .hc-card-header-box {
  1948. .online-verify-title {
  1949. font-size: 20px;
  1950. }
  1951. .online-verify-icon {
  1952. display: flex;
  1953. align-items: center;
  1954. cursor: pointer;
  1955. color: #5a5959;
  1956. i {
  1957. font-size: 18px;
  1958. }
  1959. &:hover {
  1960. color: var(--el-color-primary);
  1961. }
  1962. }
  1963. }
  1964. }
  1965. html.dark .hc-online-verify-drawer .el-card.hc-new-card-box {
  1966. background-color: var(--hc-bg-color);
  1967. .hc-card-header-box {
  1968. .online-verify-icon {
  1969. color: var(--el-color-primary);
  1970. }
  1971. }
  1972. }
  1973. </style>