query.vue 31 KB

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