query.vue 49 KB

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