query.vue 47 KB

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