query.vue 32 KB

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