query.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163
  1. <template>
  2. <div class="hc-page-box" id="carry-spot-checks-layout-target">
  3. <HcCard ui="hc-query-card-box" v-show="!isCarrySpotChecksDrawer">
  4. <div v-if="isShowheader" class="flex_box">
  5. <div class="hc-arrow-icon">
  6. <HcIcon name="arrow-left-s"/>
  7. </div>
  8. <div class="hc-tag-box">
  9. <el-scrollbar>
  10. <div class="scrollbar-content">
  11. <template v-for="item in tags">
  12. <el-tag class="mx-1" closable effect="light" size="large" @close="deltag(item)">{{ item.name }}</el-tag>
  13. </template>
  14. </div>
  15. </el-scrollbar>
  16. </div>
  17. <div class="hc-arrow-icon">
  18. <HcIcon name="arrow-right-s"/>
  19. </div>
  20. </div>
  21. <div class="hc-query-input-box">
  22. <el-input placeholder="可按关键字模糊搜索,多个关键字用“,” 隔开" v-model="searchInput" clearable @clear="clearinput">
  23. <template #prepend>
  24. <div class="prepend-filtering" @click="filteringClick">
  25. <span class="name">条件筛选</span>
  26. <HcIcon name="arrow-up-double" v-if="filteringShow === 'show'"/>
  27. <HcIcon name="arrow-down-double" v-else/>
  28. </div>
  29. </template>
  30. <template #append>
  31. <div class="append-search-btn-box">
  32. <el-button type="primary" class="search-btn" @click="searchCaseClick('1')">
  33. 按案卷查询
  34. </el-button>
  35. <el-button type="primary" class="search-btn" @click="searchFileClick('2')">
  36. 按文件查询
  37. </el-button>
  38. </div>
  39. </template>
  40. </el-input>
  41. </div>
  42. <div class="hc-query-filtering-collapse-box">
  43. <el-collapse v-model="filteringShow" @change="filteringChange" accordion>
  44. <el-collapse-item name="show">
  45. <div class="hc-search-hot-key">
  46. <span>热门搜索词汇:</span>
  47. <span class="text-hover ml-4" v-for="item in hotInputlist" @click="clickHottitle(item)">{{ item.name }}</span>
  48. </div>
  49. <div class="hc-search-screening-item">
  50. <div class="title">年度:</div>
  51. <template v-for="item in annuals">
  52. <div class="screening-key" :class="isArrIndex(annual,'key', item.key) ? 'cut': ''" @click="annualClick(item)">{{item.name}}</div>
  53. </template>
  54. </div>
  55. <div class="hc-search-screening-item">
  56. <div class="title">月份:</div>
  57. <template v-for="item in months">
  58. <div class="screening-key" :class="isArrIndex(month,'key', item.key) ? 'cut': ''" @click="monthClick(item)">{{item.name}}</div>
  59. </template>
  60. </div>
  61. <div class="hc-search-screening-item">
  62. <div class="title">期限:</div>
  63. <template v-for="item in deadlines">
  64. <div class="screening-key" :class="isArrIndex(deadline,'key', item.key) ? 'cut': ''" @click="deadlineClick(item)">{{item.name}}</div>
  65. </template>
  66. </div>
  67. <div class="hc-search-screening-item">
  68. <div class="title">密级:</div>
  69. <template v-for="item in securitys">
  70. <div class="screening-key" :class="isArrIndex(security,'key', item.key) ? 'cut': ''" @click="securityClick(item)">{{item.name}}</div>
  71. </template>
  72. </div>
  73. <div class="hc-search-screening-item">
  74. <div class="title">类别:</div>
  75. <template v-for="item in classess">
  76. <div class="screening-key" :class="isArrIndex(classes,'key', item.key) ? 'cut': ''" @click="classesClick(item)">{{item.name}}</div>
  77. </template>
  78. </div>
  79. <div class="hc-search-screening-item mb-4">
  80. <div class="title">目录:</div>
  81. <div class="screening-key text-link" @click="nodeTreeClick">
  82. <HcIcon name="node-tree" :line="false"/>
  83. <span class="ml-1">目录树</span>
  84. </div>
  85. </div>
  86. </el-collapse-item>
  87. </el-collapse>
  88. </div>
  89. <div class="hc-query-content-header-box">
  90. <div class="header">
  91. <HcNewSwitch :datas="tabData" :keys="tabKey" @change="tabChange" :round="false"/>
  92. </div>
  93. <div class="extra">
  94. <el-button type="primary" hc-btn>
  95. <HcIcon name="download"/>
  96. <span>下载</span>
  97. </el-button>
  98. </div>
  99. </div>
  100. <div class="hc-gather-card-box" :class="tableAllShow?'file-table':''">
  101. <HcCardItem ui="hc-card-item-main">
  102. <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCurrentRow isCheck @selection-change="tableSelection" @row-click="tableRowClick" :ui="hoverHand?'hover-hand':''">
  103. <template #action="{row,index}">
  104. <el-button type="primary" size="small" @click.stop="consultFileClick(row,1)">查阅案卷</el-button>
  105. </template>
  106. </HcTable>
  107. <template #action>
  108. <HcPages :pages="searchForm" @change="pageChange"/>
  109. </template>
  110. </HcCardItem>
  111. <HcCardItem ui="hc-card-item-file" title="卷内文件">
  112. <template #extra>
  113. <div class="hc-icon-close text-hover" @click="tableFileCloseClick">
  114. <HcIcon name="close"/>
  115. </div>
  116. </template>
  117. <HcTable ref="tableFileRef" :column="tableFileColumn" :datas="tableFileData" :loading="tableFileLoading" isCheck @selection-change="tableFileSelection">
  118. <template #action="{row,index}">
  119. <el-button type="primary" size="small" @click.stop="consultFileClick(row,2)">查阅文件</el-button>
  120. </template>
  121. <!-- <template #fileName="{row}">
  122. <span class="text-link text-hover" @click="viewfilePdf(row)">{{ row?.fileName }}</span>
  123. </template> -->
  124. </HcTable>
  125. <!-- <template #action>
  126. <HcPages :pages="InsearchForm" @change="InpageChange"/>
  127. </template> -->
  128. </HcCardItem>
  129. </div>
  130. </HcCard>
  131. <!--展开抽查-->
  132. <HcDrawer :show="isCarrySpotChecksDrawer" uis="hc-carry-spot-checks-target" to-id="carry-spot-checks-layout-target" @close="onCarrySpotChecksDrawerClose">
  133. <div class="hc-carry-spot-checks-pdf">
  134. <!-- <HcPdf src="https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20221212/ce9799c7d18efc03efefd6f242439f2e.pdf"/> -->
  135. <HcPdf :src="pdfUrl"/>
  136. <el-tooltip content="展开/收起 右侧目录" placement="top" :disabled="!isBubble">
  137. <div class="hc-csc-pdf-btn" @click="onCarryDataShow">
  138. <HcIcon name="arrow-right-s" v-show="isCarryDataShow"/>
  139. <HcIcon name="arrow-left-s" v-show="!isCarryDataShow"/>
  140. </div>
  141. </el-tooltip>
  142. </div>
  143. <div class="hc-carry-spot-checks-data" v-show="isCarryDataShow">
  144. <div class="hc-csc-switch">
  145. <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange" size="default" :round="false"/>
  146. </div>
  147. <div class="hc-csc-info-box">
  148. <el-scrollbar>
  149. <div class="hc-info-text-item">
  150. <div class="title">案卷题名:</div>
  151. <div class="content">{{ fileInfo.name }}</div>
  152. </div>
  153. <div class="hc-info-text-item">
  154. <div class="title">
  155. <span>密</span>
  156. <span class="ml-7">级:</span>
  157. </div>
  158. <div class="content">{{ fileInfo.secretLevelValue }}</div>
  159. </div>
  160. <div class="hc-info-text-item">
  161. <div class="title">保管期限:</div>
  162. <div class="content">{{ fileInfo.storageTimeValue }}</div>
  163. </div>
  164. <div class="hc-info-text-item">
  165. <div class="title">卷内文件:</div>
  166. <div class="content">{{ fileInfo.pageNumber }}</div>
  167. </div>
  168. <div class="hc-info-text-item">
  169. <div class="title">起止日期:</div>
  170. <div class="content" v-if="fileInfo.endDate!==''||fileInfo.startDate!==''">{{ fileInfo.endDate+"~"+ fileInfo.startDate}}</div>
  171. <div class="content" v-else></div>
  172. </div>
  173. <div class="hc-info-text-item">
  174. <div class="title">立卷单位:</div>
  175. <div class="content">{{ fileInfo.unit }}</div>
  176. </div>
  177. </el-scrollbar>
  178. </div>
  179. <div class="hc-csc-data-box">
  180. <HcTable :column="cscTableColumn1" :datas="cscTableData1" :loading="cscTableLoading" :isArrIndex="false" v-if="tabTypeKey === 'tab1'">
  181. <template #name="{row}">
  182. <div :class="row.id === checkId ? 'text-link' : 'text-hover'" @click="changePdf(row)">{{row?.fileName}}</div>
  183. </template>
  184. </HcTable>
  185. <HcTable :column="cscTableColumn2" :datas="cscTableData2" :loading="cscTableLoading" :isArrIndex="false" v-if="tabTypeKey === 'tab2'">
  186. <template #name="{row}">
  187. <div :class="row.id === 2 ? 'text-link' : 'text-hover'">{{row?.name}}</div>
  188. </template>
  189. </HcTable>
  190. <HcTable :column="cscTableColumn3" :datas="cscTableData3" :loading="cscTableLoading" :isArrIndex="false" v-if="tabTypeKey === 'tab3'">
  191. <template #name="{row}">
  192. <div :class="row.id === 2 ? 'text-link' : 'text-hover'">{{row?.name}}</div>
  193. </template>
  194. </HcTable>
  195. <HcTable :column="cscTableColumn4" :datas="cscTableData4" :loading="cscTableLoading" :isArrIndex="false" v-if="tabTypeKey === 'tab4'">
  196. <template #name="{row}">
  197. <div class="hc-csc-associated-row" :class="row.id === 2 ? 'text-link' : 'text-hover'">
  198. <el-tag effect="dark">{{row?.tag}}</el-tag>
  199. <span class="ml-3">{{row?.name}}</span>
  200. </div>
  201. </template>
  202. </HcTable>
  203. <MetaTable :loading="cscTableLoading" v-if="tabTypeKey === 'tab5'"/>
  204. <HcTable :column="cscTableColumn5" :datas="cscTableData5" :loading="cscTableLoading" v-if="tabTypeKey === 'tab6'"/>
  205. <el-tooltip content="使用弹窗查看数据" placement="top" :disabled="!isBubble" v-if="tabTypeKey === 'tab6' || tabTypeKey === 'tab5'">
  206. <div class="hc-table-info-btn" @click="cscTableDataModalShow">
  207. <HcIcon name="airplay"/>
  208. </div>
  209. </el-tooltip>
  210. </div>
  211. <div class="hc-csc-action-box">
  212. <div class="btn-box">
  213. <el-button hc-btn @click="onCarrySpotChecksDrawerClose">
  214. <HcIcon name="close"/>
  215. <span>取消查阅</span>
  216. </el-button>
  217. </div>
  218. </div>
  219. </div>
  220. </HcDrawer>
  221. <!--使用弹窗查看数据-->
  222. <HcDialog :show="cscTableDataModal" :title="cscTableDataTitle" widths="1080px" isTable :footer="false" @close="cscTableDataModalClose">
  223. <MetaTable :loading="cscTableLoading" v-if="tabTypeKey === 'tab5'"/>
  224. <HcTable :column="cscTableColumn51" :datas="cscTableData5" :loading="cscTableLoading" v-if="tabTypeKey === 'tab6'"/>
  225. </HcDialog>
  226. <!--目录树-->
  227. <HcDialog :show="nodeTreeModal" widths="1080px" isTable saveText="确认" :isClose="false" @close="nodeTreeModalClose" @save="nodeTreeModalSave" >
  228. <template #header>
  229. <div role="heading" class="el-dialog__title">
  230. <span class="mr-3">选择目录</span>
  231. <span class="text-sm text-orange">点击左侧黄色文件夹可展开下一级</span>
  232. </div>
  233. </template>
  234. <template #extra>
  235. <HcNewSwitch :datas="nodeTabData" :keys="nodeTabKey" @change="nodeTabChange" :round="false"/>
  236. </template>
  237. <el-collapse class="hc-node-tree-collapse" v-model="activeName" accordion @change="collapseChange" v-loading="nodeTreeArrLoad">
  238. <template v-for="(item) in nodeTreeArr">
  239. <el-collapse-item :name="item.id.toString()" :disabled="item.notExsitChild===true">
  240. <template #title>
  241. <div class="hc-collapse-item-title">
  242. <el-checkbox v-model="item.checkColId" style="font-size: 24px;" @change="changeCheckColId(item)" ></el-checkbox>
  243. <HcIcon name="file" fill class="icon" v-if="item.notExsitChild===true"/>
  244. <HcIcon name="folder-3" fill class="icon" v-else/>
  245. <span class="title">{{item.nodeName}}</span>
  246. </div>
  247. </template>
  248. <!-- <HcNodeTree :projectId="projectId" :contractId="contractId"/> -->
  249. <el-tree
  250. class="col_tree"
  251. node-key="id"
  252. ref="nodetreeEl"
  253. :props="defaultProps"
  254. show-checkbox
  255. v-loading="nodetreeElloading"
  256. lazy
  257. :load="loadNode"
  258. :data="Nodetreedata"
  259. >
  260. <template #default="{ node, data }">
  261. <span class="custom-tree-node">
  262. <HcIcon name="file" fill class="icon" style="color: #FFAF2D;" v-if="data.notExsitChild===true"/>
  263. <HcIcon name="folder-3" fill class="icon" style="color: #FFAF2D;" v-else/><span>{{ node.label }}</span>
  264. </span>
  265. </template>
  266. </el-tree>
  267. </el-collapse-item>
  268. </template>
  269. </el-collapse>
  270. <HcNoData v-if="nodeTreeArr.length==0"/>
  271. </HcDialog>
  272. </div>
  273. </template>
  274. <script setup>
  275. import {ref, nextTick, onMounted, watch} from "vue";
  276. import {useAppStore} from "~src/store";
  277. import MetaTable from "../transfer/components/meta-table.vue"
  278. import HcNodeTree from "./components/query/hc-tree.vue"
  279. // import HcNodeTree from "~src/components/tree/hc-tree-1.vue"
  280. import {getArrValue, arrIndex, isArrIndex} from "js-fast-way"
  281. import website from '~src/config/index'
  282. import archiveQueryApi from "~api/using/query.js";
  283. //变量
  284. const useAppState = useAppStore()
  285. const projectId = ref(useAppState.getProjectId);
  286. const contractId = ref(useAppState.getContractId);
  287. const projectInfo = ref(useAppState.getProjectInfo);
  288. const isBubble = ref(useAppState.getBubble);
  289. const userRoleId = ref(useAppState.getRoleId);
  290. const hoverHand = ref(true)
  291. const isShowheader = ref(false)
  292. const tags = ref([])
  293. //监听
  294. watch(() => [
  295. useAppState.getBubble,tags.value
  296. ], ([bubble,Tags]) => {
  297. isBubble.value = bubble
  298. if(Tags.length==0){
  299. isShowheader.value=false
  300. }else{
  301. isShowheader.value=true
  302. }
  303. })
  304. //渲染完成
  305. onMounted(() => {
  306. getCarrierTypeByDictdata()
  307. setAnnuals()
  308. setMonths()
  309. getTableData()
  310. })
  311. //处理数据
  312. const rowsToArr = (rows) => {
  313. let newArr = [];
  314. for (let i = 0; i < rows.length; i++) {
  315. newArr.push(rows[i]?.key)
  316. }
  317. return newArr.join(',')
  318. }
  319. const deltag=(item)=>{
  320. tags.value=tags.value.filter((ele)=>{
  321. if(item.name!==ele.name){
  322. return item
  323. }
  324. })
  325. //设置年份
  326. annual.value=annual.value.filter((ele)=>{
  327. if(item.name!==ele.name){
  328. return item
  329. }
  330. })
  331. yeararr.value=yeararr.value.filter((ele)=>{
  332. if(item.name!==ele.name){
  333. return item
  334. }
  335. })
  336. searchForm.value.year=rowsToArr(annual.value)
  337. if(annual.value.length==0){
  338. annual.value=[{key: 'all', name: '所有'}]
  339. }
  340. //设置月份
  341. month.value=month.value.filter((ele)=>{
  342. if(item.name!==ele.name){
  343. return item
  344. }
  345. })
  346. montharr.value=montharr.value.filter((ele)=>{
  347. if(item.name!==ele.name){
  348. return item
  349. }
  350. })
  351. searchForm.value.month=rowsToArr(month.value)
  352. if(month.value.length==0){
  353. month.value=[{key: 'all', name: '所有'}]
  354. }
  355. //设置保管期限
  356. deadline.value=deadline.value.filter((ele)=>{
  357. if(item.name!==ele.name){
  358. return item
  359. }
  360. })
  361. deadlinearr.value=deadlinearr.value.filter((ele)=>{
  362. if(item.name!==ele.name){
  363. return item
  364. }
  365. })
  366. searchForm.value.storageTime=rowsToArr(deadline.value)
  367. if(deadline.value.length==0){
  368. deadline.value=[{key: 'all', name: '所有'}]
  369. }
  370. //设置密级
  371. security.value=security.value.filter((ele)=>{
  372. if(item.name!==ele.name){
  373. return item
  374. }
  375. })
  376. securityarr.value=securityarr.value.filter((ele)=>{
  377. if(item.name!==ele.name){
  378. return item
  379. }
  380. })
  381. searchForm.value.secretLevel=rowsToArr(security.value)
  382. if(security.value.length==0){
  383. security.value=[{key: 'all', name: '所有'}]
  384. }
  385. //设置类别
  386. classes.value=classes.value.filter((ele)=>{
  387. if(item.name!==ele.name){
  388. return item
  389. }
  390. })
  391. classesarr.value=classesarr.value.filter((ele)=>{
  392. if(item.name!==ele.name){
  393. return item
  394. }
  395. })
  396. searchForm.value.carrierType=rowsToArr(classes.value)
  397. if(classes.value.length==0){
  398. classes.value=[{key: 'all', name: '所有'}]
  399. }
  400. }
  401. //搜索表单
  402. const searchForm = ref({
  403. current: 1, size: 20, total: 0,searchType:"1"
  404. })
  405. //卷内文件
  406. const InsearchForm = ref({
  407. current: 1, size: 20, total: 0
  408. })
  409. //热门搜索词汇
  410. const hotInputlist=ref([
  411. {name:'文件名'},
  412. {name:'案卷名'},
  413. {name:'档号'},
  414. {name:'单位'},
  415. ])
  416. const clickHottitle=(item)=>{
  417. searchInput.value=item.name
  418. searchForm.value.queryValue=item.name
  419. }
  420. const clearinput=()=>{
  421. searchForm.value.searchType='1'
  422. getTableData()
  423. }
  424. //年度
  425. const annuals = ref([])
  426. const setAnnuals = () => {
  427. let annualArr = [{key: 'all', name: '所有'}]
  428. const year = new Date().getFullYear()
  429. for (let i = 0; i < 8; i++) {
  430. const item = year - i + ''
  431. annualArr.push({
  432. key: item,
  433. name: item+'年'
  434. })
  435. }
  436. annuals.value = annualArr
  437. }
  438. //数组去重
  439. const some=(arr)=> {
  440. let some= [];
  441. arr.forEach(el => {
  442. if (!some.some(e => e.name == el.name)) {
  443. some.push(el);
  444. }
  445. });
  446. return some
  447. }
  448. const allarr=ref([])
  449. const montharr=ref([])
  450. const yeararr=ref([])
  451. const deadlinearr=ref([])
  452. const securityarr=ref([])
  453. const classesarr=ref([])
  454. const setTags=(val,type)=>{
  455. let arr=[]
  456. val.forEach((item)=>{
  457. if(item.name!=='所有'){
  458. arr.push({name:item.name})
  459. }
  460. })
  461. let filarr=some(arr)
  462. if(type==='month'){
  463. montharr.value=some(filarr)
  464. if(montharr.value.length==0){
  465. month.value=[{key: 'all', name: '所有'}]
  466. }
  467. }else if(type==='year'){
  468. yeararr.value=some(filarr)
  469. if(yeararr.value.length==0){
  470. annual.value=[{key: 'all', name: '所有'}]
  471. }
  472. }else if(type==='deadline'){
  473. deadlinearr.value=some(filarr)
  474. if(deadlinearr.value.length==0){
  475. deadline.value=[{key: 'all', name: '所有'}]
  476. }
  477. }else if(type==='security'){
  478. securityarr.value=some(filarr)
  479. if(securityarr.value.length==0){
  480. security.value=[{key: 'all', name: '所有'}]
  481. }
  482. }else if(type==='classes'){
  483. classesarr.value=some(filarr)
  484. if(classesarr.value.length==0){
  485. classes.value=[{key: 'all', name: '所有'}]
  486. }
  487. }
  488. let finalarr=[]
  489. yeararr.value.forEach((item)=>{
  490. finalarr.push({name:item.name})
  491. })
  492. montharr.value.forEach((item)=>{
  493. finalarr.push({name:item.name})
  494. })
  495. deadlinearr.value.forEach((item)=>{
  496. finalarr.push({name:item.name})
  497. })
  498. securityarr.value.forEach((item)=>{
  499. finalarr.push({name:item.name})
  500. })
  501. classesarr.value.forEach((item)=>{
  502. finalarr.push({name:item.name})
  503. })
  504. tags.value=some(finalarr)
  505. }
  506. const annual = ref([{key: 'all', name: '所有'}])
  507. const annualClick = (item) => {
  508. annual.value = setQueryFiltering(annual.value, item)
  509. setTags(annual.value,'year')
  510. searchForm.value.year=item.name;
  511. let arr=[]
  512. annual.value.forEach((item)=>{
  513. arr.push(item.key)
  514. })
  515. searchForm.value.year=arr+''
  516. }
  517. //月份
  518. const months = ref([])
  519. const setMonths = () => {
  520. let monthArr = [{key: 'all', name: '所有'}]
  521. for (let i = 0; i < 12; i++) {
  522. let item = (i + 1) + ''
  523. item.length === 1 && (item = item)
  524. monthArr.push({
  525. key: item,
  526. name: item + '月'
  527. })
  528. }
  529. months.value = monthArr
  530. }
  531. const month = ref([{key: 'all', name: '所有'}])
  532. const monthClick = (item) => {
  533. month.value = setQueryFiltering(month.value, item)
  534. setTags(month.value,'month')
  535. let arr=[]
  536. month.value.forEach((item)=>{
  537. arr.push(item.key)
  538. })
  539. searchForm.value.month=arr+''
  540. }
  541. //期限
  542. const deadline = ref([{key: 'all', name: '所有'}])
  543. const deadlines = ref([
  544. {key: 'all', name: '所有'},
  545. {key: '3', name: '永久'},
  546. {key: '2', name: '30年'},
  547. {key: '1', name: '10年'}
  548. ])
  549. const deadlineClick = (item) => {
  550. deadline.value = setQueryFiltering(deadline.value, item)
  551. setTags(deadline.value,'deadline')
  552. let arr=[]
  553. deadline.value.forEach((item)=>{
  554. arr.push(item.key)
  555. })
  556. searchForm.value.storageTime=arr+''
  557. }
  558. //密级
  559. const security = ref([{key: 'all', name: '所有'}])
  560. const securitys = ref([
  561. {key: 'all', name: '所有'},
  562. {key: '1',name: '机密'},
  563. {key: '2',name: '绝密'},
  564. {key: '3',name: '秘密'},
  565. {key: '4',name: '公开'},
  566. ])
  567. const securityClick = (item) => {
  568. security.value = setQueryFiltering(security.value, item)
  569. setTags(security.value,'security')
  570. let arr=[]
  571. security.value.forEach((item)=>{
  572. arr.push(item.key)
  573. })
  574. searchForm.value.secretLevel=arr+''
  575. }
  576. //类别
  577. const classes = ref([ {key: 'all', name: '所有'},])
  578. const classess = ref([ {key: 'all', name: '所有'},])
  579. const getCarrierTypeByDictdata=async()=>{
  580. const { error, code, data } = await archiveQueryApi.getCarrierTypeByDict()
  581. tableLoading.value = false
  582. if (!error && code === 200) {
  583. let arrdata=getArrValue(data)
  584. arrdata.forEach((ele)=>{
  585. classess.value.push({key:ele.dictKey,name:ele.dictValue})
  586. })
  587. }
  588. }
  589. const classesClick = (item) => {
  590. classes.value = setQueryFiltering(classes.value, item)
  591. setTags(classes.value,'classes')
  592. let arr=[]
  593. classes.value.forEach((item)=>{
  594. arr.push(item.key)
  595. })
  596. searchForm.value.carrierType=arr+''
  597. }
  598. //设置筛选条件
  599. const setQueryFiltering = (arr, {key, name}) => {
  600. if (key === 'all') {
  601. //如果选择所有,就删除其他
  602. arr = [{key, name}]
  603. tags.value= tags.value.filter((item)=>{
  604. if(item.name.indexOf===-1){
  605. return item
  606. }
  607. })
  608. } else {
  609. //选中还是取消
  610. const index = arrIndex(arr, 'key', key)
  611. if (index !== -1) {
  612. arr.splice(index, 1)
  613. } else {
  614. arr.push({key, name})
  615. }
  616. //如果存在所有,就删除所有。
  617. if (arr.length > 1) {
  618. const isAll = arrIndex(arr, 'key', 'all')
  619. if (isAll !== -1) {
  620. arr.splice(isAll, 1)
  621. }
  622. }
  623. }
  624. return arr
  625. }
  626. //目录树
  627. const nodeTreeClick = () => {
  628. nodeTreeModal.value = true
  629. getnodeTabData()
  630. }
  631. const nodeTreeModal = ref(false)
  632. const nodeTreeModalClose = () => {
  633. nodeTreeModal.value = false
  634. activeName.value=""
  635. }
  636. //确认
  637. const nodeTreeModalSave = () => {
  638. nodeTreeModal.value = false
  639. let keys= nodetreeEl.value[treeIndex.value].getCheckedKeys()
  640. searchForm.value.nodeIds=keys.join(',')||singleId.value
  641. }
  642. //搜索筛选
  643. const filteringShow = ref('')
  644. const filteringChange = (name) => {
  645. filteringShow.value = name
  646. }
  647. //条件筛选
  648. const filteringClick = () => {
  649. if (filteringShow.value) {
  650. filteringShow.value = ''
  651. } else {
  652. filteringShow.value = 'show'
  653. }
  654. }
  655. const searchInput=ref('')
  656. //按文件查询
  657. const searchFileClick = (type) => {
  658. filteringShow.value = ''
  659. searchForm.value.searchType=type
  660. getTableData()
  661. }
  662. //按案卷查询
  663. const searchCaseClick = (type) => {
  664. filteringShow.value = ''
  665. searchForm.value.searchType=type
  666. getTableData()
  667. }
  668. //tab数据和相关处理
  669. const tabKey = ref('tab1')
  670. const tabData = ref([
  671. {key:'tab1', name: '案卷列表'},
  672. {key:'tab2', name: '档案柜'},
  673. ]);
  674. const tabChange = (item) => {
  675. tabKey.value = item?.key;
  676. }
  677. //分页被点击
  678. const pageChange = ({current, size}) => {
  679. searchForm.value.current = current
  680. searchForm.value.size = size
  681. getTableData()
  682. }
  683. //分页被点击
  684. const InpageChange = ({current, size}) => {
  685. InsearchForm.value.current = current
  686. InsearchForm.value.size = size
  687. // getTableData()
  688. }
  689. //表头
  690. const tableRef = ref(null)
  691. const tableColumn = ref([
  692. {key:'fileNumber', name: '档号', width: 180},
  693. {key:'name', name: '题名'},
  694. {key:'secretLevelValue', name: '密级', width: 120},
  695. {key:'storageTimeValue', name: '保管期限', width: 120},
  696. {key:'pageN', name: '页数', width: 120},
  697. {key:'unit', name: '立卷单位', width: 260},
  698. {key:'action', name: '操作', width: 120},
  699. ])
  700. const tableData = ref([
  701. ])
  702. const pdfUrl=ref('')
  703. const tableLoading = ref(false)
  704. const getTableData = async () => {
  705. tableLoading.value = true
  706. searchForm.value.queryValue=searchInput.value
  707. for (let key in searchForm.value) {
  708. if(searchForm.value[key]==='all'||searchForm.value[key]==='所有'){
  709. searchForm.value[key]=''
  710. }
  711. }
  712. const { error, code, data } = await archiveQueryApi.getarchiveQueryPage({
  713. ...searchForm.value,
  714. projectId: projectId.value,
  715. contractId:contractId.value
  716. })
  717. tableLoading.value = false
  718. if (!error && code === 200) {
  719. tableData.value = getArrValue(data['records'])
  720. searchForm.value.total = data['total'] || 0
  721. } else {
  722. tableData.value = []
  723. searchForm.value.total = 0
  724. }
  725. tableFileCloseClick()
  726. if(searchForm.value.searchType==='2'){
  727. if(tableData.value.length>0&&tableData.value[0]?.approvalFileList.length>0){
  728. // tableFileData.value =getArrValue( tableData.value[0]['approvalFileList'])
  729. let searchinput=searchForm.value.queryValue
  730. let allarr=getArrValue( tableData.value[0]['approvalFileList'])
  731. let filterarr=allarr.filter((item)=>{
  732. if(item.fileName.indexOf(searchinput)!=-1){
  733. return item
  734. }
  735. })
  736. tableFileData.value =getArrValue( filterarr)
  737. tableAllShow.value = true;
  738. tableFileShow.value = true;
  739. }
  740. }
  741. }
  742. //多选
  743. const tableKeys = ref([]);
  744. const tableSelection = (rows) => {
  745. tableKeys.value = rows
  746. }
  747. const tableAllShow = ref(false)
  748. const tableAllShowClick = () => {
  749. tableFileShow.value = false;
  750. tableAllShow.value = !tableAllShow.value;
  751. }
  752. //表头
  753. const tableFileRef = ref(null)
  754. const tableFileColumn = ref([
  755. {key:'fileNumber', name: '文件编号', width: 180},
  756. {key:'fileName', name: '文件题名'},
  757. {key:'fileTime', name: '文件日期', width: 120},
  758. {key:'dutyUser', name: '责任者', width: 120},
  759. {key:'filePage', name: '页数', width: 120},
  760. {key:'action', name: '操作', width: 120},
  761. ])
  762. const tableFileData = ref([
  763. ])
  764. //查看卷内文件pdf
  765. // const viewfilePdf=(row)=>{
  766. // if(row?.pdfFileUrl){
  767. // window.open(row?.pdfFileUrl, '_blank')
  768. // }else{
  769. // window.$message?.warning('文件不存在')
  770. // }
  771. // }
  772. const tableFileLoading = ref(false)
  773. const tableFileSelection = (rows) => {
  774. console.log(rows)
  775. }
  776. //表格行被点击
  777. const tableFileShow = ref(false)
  778. const tableRowClick = ({row}) => {
  779. tableAllShow.value = true;
  780. tableFileShow.value = true;
  781. tableFileData.value =getArrValue( row['approvalFileList'])
  782. cscTableData1.value=getArrValue( row['approvalFileList'])
  783. InsearchForm.value.total=row['approvalFileList'].length
  784. fileInfo.value=row
  785. // fileInfo.value.pageN=row['approvalFileList'].length||0
  786. fileInfo.value.pageNumber=row['approvalFileList'].length||0
  787. }
  788. const tableFileCloseClick = () => {
  789. tableAllShow.value = false;
  790. tableFileShow.value = false;
  791. }
  792. const consultFileClick = (row,type) => {
  793. isCarrySpotChecksDrawer.value = true
  794. console.log(row,'row');
  795. // pdfUrl.value=row.approvalFileList
  796. if(type===1){
  797. cscTableData1.value=row.approvalFileList
  798. fileInfo.value=row
  799. // fileInfo.value.pageN=row['approvalFileList'].length||0
  800. fileInfo.value.pageNumber=row['approvalFileList'].length||0
  801. }else if(type==2){
  802. checkId.value=row.id
  803. pdfUrl.value=row.pdfFileUrl
  804. }
  805. if(type===1&& cscTableData1.value.length>0&&cscTableData1.value[0]['pdfFileUrl']){
  806. checkId.value=cscTableData1.value[0].id
  807. pdfUrl.value=row.approvalFileList[0]['pdfFileUrl']
  808. }
  809. }
  810. const isCarrySpotChecksDrawer = ref(false)
  811. const fileInfo=ref({
  812. name:"",
  813. storageTimeValue:'',
  814. secretLevelValue:'',
  815. filePage:'',
  816. unit:'',
  817. time:'',
  818. pageN:0,
  819. })//案卷信息
  820. const checkId=ref('')
  821. const changePdf=(row)=>{
  822. console.log(row,'row');
  823. pdfUrl.value=row['pdfFileUrl']||''
  824. checkId.value=row.id
  825. }
  826. //类型tab数据和相关处理
  827. const tabTypeKey = ref('tab1')
  828. const tabTypeTab = ref([
  829. {key:'tab1', name: '卷内文件'},
  830. {key:'tab2', name: '竣工资料'},
  831. {key:'tab3', name: '计量资料'},
  832. {key:'tab4', name: '关联资料'},
  833. {key:'tab5', name: '元数据'},
  834. {key:'tab6', name: '验签包'},
  835. ]);
  836. const tabTypeChange = ({key}) => {
  837. tabTypeKey.value = key
  838. }
  839. const cscTableLoading = ref(false)
  840. //卷内目录
  841. const cscTableColumn1 = [
  842. {key:'name', name: '卷内文件题名', align: 'center'}
  843. ];
  844. const cscTableData1 = ref([
  845. ])
  846. //竣工资料
  847. const cscTableColumn2 = [
  848. {key:'name', name: '竣工图资料', align: 'center'}
  849. ];
  850. const cscTableData2 = ref([
  851. ])
  852. //计量资料
  853. const cscTableColumn3 = [
  854. {key:'name', name: '计量资料', align: 'center'}
  855. ];
  856. const cscTableData3 = ref([
  857. // {id: 1, name: 'ZB2-17.pdf'},
  858. // {id: 2, name: 'ZB2-18.pdf'},
  859. // {id: 3, name: 'ZB2-19.pdf'},
  860. // {id: 4, name: 'ZB2-20.pdf'},
  861. // {id: 5, name: 'ZB2-21.pdf'},
  862. // {id: 6, name: 'ZB2-22.pdf'},
  863. // {id: 7, name: 'ZB2-23.pdf'}
  864. ])
  865. //计量资料
  866. const cscTableColumn4 = [
  867. {key:'name', name: '关联文件', align: 'center'}
  868. ];
  869. const cscTableData4 = ref([
  870. // {id: 1, name: 'xxxxxxxxxxxxxxxxxxx.pdf', tag: '开工'},
  871. // {id: 2, name: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.pdf', tag: '工序'},
  872. // {id: 3, name: 'xxxxxxxxxxxxxxxxxxxxxxxxxx.pdf', tag: '评定'},
  873. // {id: 4, name: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx.pdf', tag: '交工'},
  874. // {id: 5, name: '', tag: '抽检'},
  875. // {id: 6, name: '', tag: '隐蔽'}
  876. ])
  877. //验签包
  878. const cscTableColumn5 = [
  879. {key:'user', name: '签名者'},
  880. {key:'time', name: '签名时间'},
  881. {key:'val', name: '摘要'},
  882. ];
  883. const cscTableColumn51 = [
  884. {key:'user', name: '签名者', width: 300},
  885. {key:'time', name: '签名时间', width: 200},
  886. {key:'val', name: '摘要'},
  887. ];
  888. const cscTableData5 = ref([
  889. ])
  890. //抽检意见
  891. const reform = ref({
  892. type: false, content: ''
  893. })
  894. //显示右侧目录
  895. const isCarryDataShow = ref(true)
  896. const onCarryDataShow = () => {
  897. isCarryDataShow.value = !isCarryDataShow.value
  898. }
  899. //使用弹窗查看数据
  900. const cscTableDataModal = ref(false)
  901. const cscTableDataTitle = ref('')
  902. //显示弹窗
  903. const cscTableDataModalShow = () => {
  904. const key = tabTypeKey.value;
  905. if (key === 'tab5') {
  906. cscTableDataTitle.value = '元数据'
  907. } else if (key === 'tab6') {
  908. cscTableDataTitle.value = '验签包'
  909. }
  910. cscTableDataModal.value = true
  911. }
  912. //关闭弹窗
  913. const cscTableDataModalClose = () => {
  914. cscTableDataModal.value = false
  915. }
  916. //关闭抽查
  917. const onCarrySpotChecksDrawerClose = () => {
  918. isCarrySpotChecksDrawer.value = false
  919. pdfUrl.value=''
  920. }
  921. //tab数据和相关处理
  922. const nodeTabKey = ref('1')
  923. const nodeTabData = ref([
  924. {key:'1', name: '业主档案'},
  925. {key:'2', name: '施工档案'},
  926. {key:'3', name: '监理档案'},
  927. {key:'4', name: '文书档案'},
  928. ]);
  929. const nodeTabChange = (item) => {
  930. nodeTabKey.value = item?.key;
  931. getnodeTabData()
  932. }
  933. //获取目录树getArchiveTreeByNodeType
  934. const checkColId=ref(false)
  935. const checkNodeid=ref('')
  936. const singleId=ref('')
  937. const changeCheckColId=(item)=>{
  938. let arr= nodeTreeArr.value.filter((ele)=>{
  939. if(ele.checkColId){
  940. return ele
  941. }
  942. })
  943. if(arr.length>1){
  944. nodeTreeArr.value.forEach((ele1)=>{
  945. if(ele1.id!==item.id)
  946. ele1.checkColId=false
  947. })
  948. }
  949. if(item.notExsitChild===true){
  950. singleId.value=item.id
  951. }else{
  952. if(!activeName.value){
  953. checkNodeid.value=item.id
  954. activeName.value=item.id
  955. item.checkColId=false
  956. getNodetreedata()
  957. }else{
  958. let idsarr=[]
  959. if(item.checkColId===false){
  960. nextTick(()=>{
  961. nodetreeEl?.value[treeIndex.value].setCheckedKeys([],false);
  962. })
  963. }else{
  964. nextTick(()=>{
  965. Nodetreedata?.value.forEach((item)=>{
  966. idsarr.push(item.id)
  967. })
  968. nodetreeEl?.value[treeIndex.value].setCheckedKeys(idsarr,true);
  969. })
  970. }
  971. }
  972. }
  973. }
  974. const nodeTreeArrLoad=ref(false)
  975. const getnodeTabData=async()=>{
  976. nodeTreeArrLoad.value=true
  977. const { error, code, data } = await archiveQueryApi.getArchiveTreeByNodeType({
  978. nodeType:nodeTabKey.value,
  979. projectId: projectId.value,
  980. contractId:contractId.value,
  981. })
  982. if (!error && code === 200) {
  983. console.log(data,'mulushu');
  984. nodeTreeArr.value = getArrValue(data)
  985. nodeTreeArr.value.forEach((item)=>{
  986. item.checkColId=false
  987. })
  988. nodeTreeArrLoad.value=false
  989. } else {
  990. nodeTreeArr.value = []
  991. nodeTreeArrLoad.value=false
  992. }
  993. }
  994. const defaultProps = {
  995. children: 'children',
  996. label: 'nodeName',
  997. isLeaf: 'notExsitChild'
  998. }
  999. const Nodetreedata=ref([])
  1000. const nodetreeEl=ref(null)
  1001. const activeName = ref('')
  1002. const nodeTreeArr = ref([])
  1003. const treeIndex=ref(0)
  1004. const collapseChange = (key) => {
  1005. treeIndex.value=nodeTreeArr.value.findIndex(item=>{return item.id===key})
  1006. checkNodeid.value=key
  1007. activeName.value = key.toString();
  1008. getNodetreedata()
  1009. }
  1010. const nodetreeElloading=ref(false)
  1011. const getNodetreedata=async()=>{
  1012. nodetreeElloading.value=true
  1013. const { error, code, data } = await archiveQueryApi.getChildrenNodeByNodeId({
  1014. nodeId:checkNodeid.value,
  1015. })
  1016. nodetreeElloading.value=false
  1017. if (!error && code === 200) {
  1018. Nodetreedata.value = getArrValue(data)
  1019. } else {
  1020. Nodetreedata.value = []
  1021. }
  1022. }
  1023. const checkNodeids=ref([])
  1024. const loadNode=(tree, resolve)=>{
  1025. archiveQueryApi.getChildrenNodeByNodeId({ nodeId:tree.data.id}).then((response) => {
  1026. let resdata=getArrValue(response.data)
  1027. resolve(resdata);
  1028. })
  1029. }
  1030. </script>
  1031. <style lang="scss" scoped>
  1032. @import '~style/using/scoped/query.scss';
  1033. </style>
  1034. <style lang="scss">
  1035. @import '~style/using/query.scss';
  1036. .col_tree{
  1037. font-size: 16px;
  1038. }
  1039. .hc-tag-box {
  1040. position: relative;
  1041. width: calc(100% - 40px);
  1042. overflow: hidden;
  1043. }
  1044. .scrollbar-content {
  1045. white-space: nowrap;
  1046. padding: 10px;
  1047. }
  1048. .flex_box{
  1049. display: flex;
  1050. justify-content: center;
  1051. align-items: center;
  1052. }
  1053. </style>