query.vue 38 KB

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