query.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  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. <HcNoData v-if="nodeTreeArr.length==0"/>
  251. </HcDialog>
  252. </div>
  253. </template>
  254. <script setup>
  255. import {ref, nextTick, onMounted, watch} from "vue";
  256. import {useAppStore} from "~src/store";
  257. import MetaTable from "../transfer/components/meta-table.vue"
  258. import HcNodeTree from "./components/query/hc-tree.vue"
  259. // import HcNodeTree from "~src/components/tree/hc-tree-1.vue"
  260. import {getArrValue, arrIndex, isArrIndex} from "js-fast-way"
  261. import website from '~src/config/index'
  262. import archiveQueryApi from "~api/using/query.js";
  263. //变量
  264. const useAppState = useAppStore()
  265. const projectId = ref(useAppState.getProjectId);
  266. const contractId = ref(useAppState.getContractId);
  267. const projectInfo = ref(useAppState.getProjectInfo);
  268. const isBubble = ref(useAppState.getBubble);
  269. const userRoleId = ref(useAppState.getRoleId);
  270. const hoverHand = ref(true)
  271. //监听
  272. watch(() => [
  273. useAppState.getBubble,
  274. ], ([bubble]) => {
  275. isBubble.value = bubble
  276. })
  277. //渲染完成
  278. onMounted(() => {
  279. getCarrierTypeByDictdata()
  280. setAnnuals()
  281. setMonths()
  282. getTableData()
  283. })
  284. //搜索表单
  285. const searchForm = ref({
  286. current: 1, size: 20, total: 0,searchType:"1"
  287. })
  288. //卷内文件
  289. const InsearchForm = ref({
  290. current: 1, size: 20, total: 0
  291. })
  292. //热门搜索词汇
  293. const hotInputlist=ref([
  294. {name:'文件名'},
  295. {name:'案卷名'},
  296. {name:'档号'},
  297. {name:'单位'},
  298. ])
  299. const clickHottitle=(item)=>{
  300. searchInput.value=item.name
  301. searchForm.value.queryValue=item.name
  302. }
  303. //年度
  304. const annuals = ref([])
  305. const setAnnuals = () => {
  306. let annualArr = [{key: 'all', name: '所有'}]
  307. const year = new Date().getFullYear()
  308. for (let i = 0; i < 8; i++) {
  309. const item = year - i + ''
  310. annualArr.push({
  311. key: item,
  312. name: item+'年'
  313. })
  314. }
  315. annuals.value = annualArr
  316. }
  317. const annual = ref([{key: 'all', name: '所有'}])
  318. const annualClick = (item) => {
  319. annual.value = setQueryFiltering(annual.value, item)
  320. searchForm.value.year=item.name
  321. let arr=[]
  322. annual.value.forEach((item)=>{
  323. arr.push(item.key)
  324. })
  325. searchForm.value.year=arr+''
  326. }
  327. //月份
  328. const months = ref([])
  329. const setMonths = () => {
  330. let monthArr = [{key: 'all', name: '所有'}]
  331. for (let i = 0; i < 12; i++) {
  332. let item = (i + 1) + ''
  333. item.length === 1 && (item = item)
  334. monthArr.push({
  335. key: item,
  336. name: item + '月'
  337. })
  338. }
  339. months.value = monthArr
  340. }
  341. const month = ref([{key: 'all', name: '所有'}])
  342. const monthClick = (item) => {
  343. month.value = setQueryFiltering(month.value, item)
  344. let arr=[]
  345. month.value.forEach((item)=>{
  346. arr.push(item.key)
  347. })
  348. searchForm.value.month=arr+''
  349. }
  350. //期限
  351. const deadline = ref([{key: 'all', name: '所有'}])
  352. const deadlines = ref([
  353. {key: 'all', name: '所有'},
  354. {key: '3', name: '永久'},
  355. {key: '2', name: '30年'},
  356. {key: '1', name: '10年'}
  357. ])
  358. const deadlineClick = (item) => {
  359. deadline.value = setQueryFiltering(deadline.value, item)
  360. let arr=[]
  361. deadline.value.forEach((item)=>{
  362. arr.push(item.key)
  363. })
  364. searchForm.value.storageTime=arr+''
  365. }
  366. //密级
  367. const security = ref([{key: 'all', name: '所有'}])
  368. const securitys = ref([
  369. {key: 'all', name: '所有'},
  370. {key: '1',name: '机密'},
  371. {key: '2',name: '绝密'},
  372. {key: '3',name: '秘密'},
  373. {key: '4',name: '公开'},
  374. ])
  375. const securityClick = (item) => {
  376. security.value = setQueryFiltering(security.value, item)
  377. let arr=[]
  378. security.value.forEach((item)=>{
  379. arr.push(item.key)
  380. })
  381. searchForm.value.secretLevel=arr+''
  382. }
  383. //类别
  384. const classes = ref([ {key: 'all', name: '所有'},])
  385. const classess = ref([ {key: 'all', name: '所有'},])
  386. const getCarrierTypeByDictdata=async()=>{
  387. const { error, code, data } = await archiveQueryApi.getCarrierTypeByDict()
  388. tableLoading.value = false
  389. if (!error && code === 200) {
  390. let arrdata=getArrValue(data)
  391. arrdata.forEach((ele)=>{
  392. classess.value.push({key:ele.dictKey,name:ele.dictValue})
  393. })
  394. }
  395. }
  396. const classesClick = (item) => {
  397. classes.value = setQueryFiltering(classes.value, item)
  398. let arr=[]
  399. classes.value.forEach((item)=>{
  400. arr.push(item.key)
  401. })
  402. searchForm.value.carrierType=arr+''
  403. }
  404. //设置筛选条件
  405. const setQueryFiltering = (arr, {key, name}) => {
  406. if (key === 'all') {
  407. //如果选择所有,就删除其他
  408. arr = [{key, name}]
  409. } else {
  410. //选中还是取消
  411. const index = arrIndex(arr, 'key', key)
  412. if (index !== -1) {
  413. arr.splice(index, 1)
  414. } else {
  415. arr.push({key, name})
  416. }
  417. //如果存在所有,就删除所有。
  418. if (arr.length > 1) {
  419. const isAll = arrIndex(arr, 'key', 'all')
  420. if (isAll !== -1) {
  421. arr.splice(isAll, 1)
  422. }
  423. }
  424. }
  425. return arr
  426. }
  427. //目录树
  428. const nodeTreeClick = () => {
  429. nodeTreeModal.value = true
  430. getnodeTabData()
  431. }
  432. const nodeTreeModal = ref(false)
  433. const nodeTreeModalClose = () => {
  434. nodeTreeModal.value = false
  435. activeName.value=""
  436. }
  437. //确认
  438. const nodeTreeModalSave = () => {
  439. nodeTreeModal.value = false
  440. let keys= nodetreeEl.value[treeIndex.value].getCheckedKeys()
  441. searchForm.value.nodeIds=keys.join(',')||singleId.value
  442. }
  443. //搜索筛选
  444. const filteringShow = ref('')
  445. const filteringChange = (name) => {
  446. filteringShow.value = name
  447. }
  448. //条件筛选
  449. const filteringClick = () => {
  450. if (filteringShow.value) {
  451. filteringShow.value = ''
  452. } else {
  453. filteringShow.value = 'show'
  454. }
  455. }
  456. const searchInput=ref('')
  457. //按文件查询
  458. const searchFileClick = (type) => {
  459. filteringShow.value = ''
  460. searchForm.value.searchType=type
  461. getTableData()
  462. }
  463. //按案卷查询
  464. const searchCaseClick = (type) => {
  465. filteringShow.value = ''
  466. searchForm.value.searchType=type
  467. getTableData()
  468. }
  469. //tab数据和相关处理
  470. const tabKey = ref('tab1')
  471. const tabData = ref([
  472. {key:'tab1', name: '案卷列表'},
  473. {key:'tab2', name: '档案柜'},
  474. ]);
  475. const tabChange = (item) => {
  476. tabKey.value = item?.key;
  477. }
  478. //分页被点击
  479. const pageChange = ({current, size}) => {
  480. searchForm.value.current = current
  481. searchForm.value.size = size
  482. getTableData()
  483. }
  484. //分页被点击
  485. const InpageChange = ({current, size}) => {
  486. InsearchForm.value.current = current
  487. InsearchForm.value.size = size
  488. // getTableData()
  489. }
  490. //表头
  491. const tableRef = ref(null)
  492. const tableColumn = ref([
  493. {key:'fileNumber', name: '档号', width: 180},
  494. {key:'name', name: '题名'},
  495. {key:'secretLevelValue', name: '密级', width: 120},
  496. {key:'storageTimeValue', name: '保管期限', width: 120},
  497. {key:'pageN', name: '页数', width: 120},
  498. {key:'filingUnit', name: '立卷单位', width: 260},
  499. {key:'action', name: '操作', width: 120},
  500. ])
  501. const tableData = ref([
  502. ])
  503. const pdfUrl=ref('')
  504. const tableLoading = ref(false)
  505. const getTableData = async () => {
  506. tableLoading.value = true
  507. searchForm.value.queryValue=searchInput.value
  508. for (let key in searchForm.value) {
  509. if(searchForm.value[key]==='all'||searchForm.value[key]==='所有'){
  510. searchForm.value[key]=''
  511. }
  512. }
  513. const { error, code, data } = await archiveQueryApi.getarchiveQueryPage({
  514. ...searchForm.value,
  515. projectId: projectId.value,
  516. contractId:contractId.value
  517. })
  518. tableLoading.value = false
  519. if (!error && code === 200) {
  520. tableData.value = getArrValue(data['records'])
  521. searchForm.value.total = data['total'] || 0
  522. } else {
  523. tableData.value = []
  524. searchForm.value.total = 0
  525. }
  526. tableFileCloseClick()
  527. if(searchForm.value.searchType==='2'){
  528. if(tableData.value.length>0&&tableData.value[0]?.approvalFileList.length>0){
  529. tableFileData.value =getArrValue( tableData.value[0]['approvalFileList'])
  530. tableAllShow.value = true;
  531. tableFileShow.value = true;
  532. }
  533. }
  534. }
  535. //多选
  536. const tableKeys = ref([]);
  537. const tableSelection = (rows) => {
  538. tableKeys.value = rows
  539. }
  540. const tableAllShow = ref(false)
  541. const tableAllShowClick = () => {
  542. tableFileShow.value = false;
  543. tableAllShow.value = !tableAllShow.value;
  544. }
  545. //表头
  546. const tableFileRef = ref(null)
  547. const tableFileColumn = ref([
  548. {key:'fileNumber', name: '文件编号', width: 180},
  549. {key:'fileName', name: '文件题名'},
  550. {key:'fileTime', name: '文件日期', width: 120},
  551. {key:'dutyUser', name: '责任者', width: 120},
  552. {key:'filePage', name: '页数', width: 120},
  553. {key:'action', name: '操作', width: 120},
  554. ])
  555. const tableFileData = ref([
  556. ])
  557. const tableFileLoading = ref(false)
  558. const tableFileSelection = (rows) => {
  559. console.log(rows)
  560. }
  561. //表格行被点击
  562. const tableFileShow = ref(false)
  563. const tableRowClick = ({row}) => {
  564. tableAllShow.value = true;
  565. tableFileShow.value = true;
  566. tableFileData.value =getArrValue( row['approvalFileList'])
  567. cscTableData1.value=getArrValue( row['approvalFileList'])
  568. InsearchForm.value.total=row['approvalFileList'].length
  569. fileInfo.value=row
  570. fileInfo.value.pageN=row['approvalFileList'].length||0
  571. }
  572. const tableFileCloseClick = () => {
  573. tableAllShow.value = false;
  574. tableFileShow.value = false;
  575. }
  576. const consultFileClick = (row,type) => {
  577. isCarrySpotChecksDrawer.value = true
  578. console.log(row,'row');
  579. // pdfUrl.value=row.approvalFileList
  580. if(type===1){
  581. cscTableData1.value=row.approvalFileList
  582. fileInfo.value=row
  583. fileInfo.value.pageN=row['approvalFileList'].length||0
  584. }else if(type==2){
  585. checkId.value=row.id
  586. pdfUrl.value=row.pdfFileUrl
  587. }
  588. if(type===1&& cscTableData1.value.length>0&&cscTableData1.value[0]['pdfFileUrl']){
  589. checkId.value=cscTableData1.value[0].id
  590. pdfUrl.value=row.approvalFileList[0]['pdfFileUrl']
  591. }
  592. }
  593. const isCarrySpotChecksDrawer = ref(false)
  594. const fileInfo=ref({
  595. name:"",
  596. storageTimeValue:'',
  597. secretLevelValue:'',
  598. filePage:'',
  599. unit:'',
  600. time:'',
  601. pageN:0,
  602. })//案卷信息
  603. const checkId=ref('')
  604. const changePdf=(row)=>{
  605. console.log(row,'row');
  606. pdfUrl.value=row['pdfFileUrl']||''
  607. checkId.value=row.id
  608. }
  609. //类型tab数据和相关处理
  610. const tabTypeKey = ref('tab1')
  611. const tabTypeTab = ref([
  612. {key:'tab1', name: '卷内文件'},
  613. {key:'tab2', name: '竣工资料'},
  614. {key:'tab3', name: '计量资料'},
  615. {key:'tab4', name: '关联资料'},
  616. {key:'tab5', name: '元数据'},
  617. {key:'tab6', name: '验签包'},
  618. ]);
  619. const tabTypeChange = ({key}) => {
  620. tabTypeKey.value = key
  621. }
  622. const cscTableLoading = ref(false)
  623. //卷内目录
  624. const cscTableColumn1 = [
  625. {key:'name', name: '卷内文件题名', align: 'center'}
  626. ];
  627. const cscTableData1 = ref([
  628. ])
  629. //竣工资料
  630. const cscTableColumn2 = [
  631. {key:'name', name: '竣工图资料', align: 'center'}
  632. ];
  633. const cscTableData2 = ref([
  634. ])
  635. //计量资料
  636. const cscTableColumn3 = [
  637. {key:'name', name: '计量资料', align: 'center'}
  638. ];
  639. const cscTableData3 = ref([
  640. // {id: 1, name: 'ZB2-17.pdf'},
  641. // {id: 2, name: 'ZB2-18.pdf'},
  642. // {id: 3, name: 'ZB2-19.pdf'},
  643. // {id: 4, name: 'ZB2-20.pdf'},
  644. // {id: 5, name: 'ZB2-21.pdf'},
  645. // {id: 6, name: 'ZB2-22.pdf'},
  646. // {id: 7, name: 'ZB2-23.pdf'}
  647. ])
  648. //计量资料
  649. const cscTableColumn4 = [
  650. {key:'name', name: '关联文件', align: 'center'}
  651. ];
  652. const cscTableData4 = ref([
  653. // {id: 1, name: 'xxxxxxxxxxxxxxxxxxx.pdf', tag: '开工'},
  654. // {id: 2, name: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.pdf', tag: '工序'},
  655. // {id: 3, name: 'xxxxxxxxxxxxxxxxxxxxxxxxxx.pdf', tag: '评定'},
  656. // {id: 4, name: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx.pdf', tag: '交工'},
  657. // {id: 5, name: '', tag: '抽检'},
  658. // {id: 6, name: '', tag: '隐蔽'}
  659. ])
  660. //验签包
  661. const cscTableColumn5 = [
  662. {key:'user', name: '签名者'},
  663. {key:'time', name: '签名时间'},
  664. {key:'val', name: '摘要'},
  665. ];
  666. const cscTableColumn51 = [
  667. {key:'user', name: '签名者', width: 300},
  668. {key:'time', name: '签名时间', width: 200},
  669. {key:'val', name: '摘要'},
  670. ];
  671. const cscTableData5 = ref([
  672. ])
  673. //抽检意见
  674. const reform = ref({
  675. type: false, content: ''
  676. })
  677. //显示右侧目录
  678. const isCarryDataShow = ref(true)
  679. const onCarryDataShow = () => {
  680. isCarryDataShow.value = !isCarryDataShow.value
  681. }
  682. //使用弹窗查看数据
  683. const cscTableDataModal = ref(false)
  684. const cscTableDataTitle = ref('')
  685. //显示弹窗
  686. const cscTableDataModalShow = () => {
  687. const key = tabTypeKey.value;
  688. if (key === 'tab5') {
  689. cscTableDataTitle.value = '元数据'
  690. } else if (key === 'tab6') {
  691. cscTableDataTitle.value = '验签包'
  692. }
  693. cscTableDataModal.value = true
  694. }
  695. //关闭弹窗
  696. const cscTableDataModalClose = () => {
  697. cscTableDataModal.value = false
  698. }
  699. //关闭抽查
  700. const onCarrySpotChecksDrawerClose = () => {
  701. isCarrySpotChecksDrawer.value = false
  702. pdfUrl.value=''
  703. }
  704. //tab数据和相关处理
  705. const nodeTabKey = ref('1')
  706. const nodeTabData = ref([
  707. {key:'1', name: '业主档案'},
  708. {key:'2', name: '施工档案'},
  709. {key:'3', name: '监理档案'},
  710. {key:'4', name: '文书档案'},
  711. ]);
  712. const nodeTabChange = (item) => {
  713. nodeTabKey.value = item?.key;
  714. getnodeTabData()
  715. }
  716. //获取目录树getArchiveTreeByNodeType
  717. const checkColId=ref(false)
  718. const checkNodeid=ref('')
  719. const singleId=ref('')
  720. const changeCheckColId=(item)=>{
  721. let arr= nodeTreeArr.value.filter((ele)=>{
  722. if(ele.checkColId){
  723. return ele
  724. }
  725. })
  726. if(arr.length>1){
  727. nodeTreeArr.value.forEach((ele1)=>{
  728. if(ele1.id!==item.id)
  729. ele1.checkColId=false
  730. })
  731. }
  732. if(item.notExsitChild===true){
  733. singleId.value=item.id
  734. }else{
  735. if(!activeName.value){
  736. checkNodeid.value=item.id
  737. activeName.value=item.id
  738. item.checkColId=false
  739. getNodetreedata()
  740. }else{
  741. let idsarr=[]
  742. if(item.checkColId===false){
  743. nextTick(()=>{
  744. nodetreeEl?.value[treeIndex.value].setCheckedKeys([],false);
  745. })
  746. }else{
  747. nextTick(()=>{
  748. Nodetreedata?.value.forEach((item)=>{
  749. idsarr.push(item.id)
  750. })
  751. nodetreeEl?.value[treeIndex.value].setCheckedKeys(idsarr,true);
  752. })
  753. }
  754. }
  755. }
  756. }
  757. const nodeTreeArrLoad=ref(false)
  758. const getnodeTabData=async()=>{
  759. nodeTreeArrLoad.value=true
  760. const { error, code, data } = await archiveQueryApi.getArchiveTreeByNodeType({
  761. nodeType:nodeTabKey.value,
  762. projectId: projectId.value,
  763. contractId:contractId.value,
  764. })
  765. if (!error && code === 200) {
  766. console.log(data,'mulushu');
  767. nodeTreeArr.value = getArrValue(data)
  768. nodeTreeArr.value.forEach((item)=>{
  769. item.checkColId=false
  770. })
  771. nodeTreeArrLoad.value=false
  772. } else {
  773. nodeTreeArr.value = []
  774. nodeTreeArrLoad.value=false
  775. }
  776. }
  777. const defaultProps = {
  778. children: 'children',
  779. label: 'nodeName',
  780. isLeaf: 'notExsitChild'
  781. }
  782. const Nodetreedata=ref([])
  783. const nodetreeEl=ref(null)
  784. const activeName = ref('')
  785. const nodeTreeArr = ref([])
  786. const treeIndex=ref(0)
  787. const collapseChange = (key) => {
  788. treeIndex.value=nodeTreeArr.value.findIndex(item=>{return item.id===key})
  789. checkNodeid.value=key
  790. activeName.value = key.toString();
  791. getNodetreedata()
  792. }
  793. const nodetreeElloading=ref(false)
  794. const getNodetreedata=async()=>{
  795. nodetreeElloading.value=true
  796. const { error, code, data } = await archiveQueryApi.getChildrenNodeByNodeId({
  797. nodeId:checkNodeid.value,
  798. })
  799. nodetreeElloading.value=false
  800. if (!error && code === 200) {
  801. Nodetreedata.value = getArrValue(data)
  802. } else {
  803. Nodetreedata.value = []
  804. }
  805. }
  806. const checkNodeids=ref([])
  807. const loadNode=(tree, resolve)=>{
  808. archiveQueryApi.getChildrenNodeByNodeId({ nodeId:tree.data.id}).then((response) => {
  809. let resdata=getArrValue(response.data)
  810. resolve(resdata);
  811. })
  812. }
  813. </script>
  814. <style lang="scss" scoped>
  815. @import '~style/using/scoped/query.scss';
  816. </style>
  817. <style lang="scss">
  818. @import '~style/using/query.scss';
  819. .col_tree{
  820. font-size: 16px;
  821. }
  822. </style>