阅行客电子档案
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1160 lines
48 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div>
  3. <div class="collect-header">
  4. <h4 :class="classType">{{ collectTitle }} </h4>
  5. <div class="collect-filter">
  6. <treeselect
  7. v-if="selectedCategory.arrangeType === 3 && isTitleType !== 4 && isTitleType !== 6 && activeIndex !== 1"
  8. v-model="query.project_class"
  9. :options="projectOptions"
  10. style="width: 180px;"
  11. flat
  12. :multiple="false"
  13. :normalizer="normalizerProject"
  14. placeholder="请选择"
  15. @input="handleSearch(collectLevel)"
  16. @select="handleSearch(collectLevel)"
  17. />
  18. <treeselect
  19. v-if="isTitleType !== 6"
  20. v-model="query.archive_ctg_no"
  21. :options="classifyOptions"
  22. style="width: 180px;"
  23. flat
  24. :multiple="false"
  25. :normalizer="normalizer"
  26. placeholder="请选择档案分类"
  27. @input="handleSearch(collectLevel)"
  28. @select="handleSearch(collectLevel)"
  29. />
  30. </div>
  31. <div v-if="isTitleType !== 6" class="head-search">
  32. <!-- 搜索 -->
  33. <el-input v-model="query.search" clearable size="small" :placeholder="placeholderType" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="handleSearch(collectLevel)" @clear="handleSearch(collectLevel)" />
  34. <el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="handleSearch(collectLevel)">搜索</el-button>
  35. <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
  36. </div>
  37. <div v-if="!isRecycle" class="collect-menu">
  38. <el-menu
  39. :default-active="activeMenuIndex"
  40. mode="horizontal"
  41. @select="handleSelect"
  42. >
  43. <el-submenu index="1">
  44. <template slot="title">
  45. <i class="iconfont icon-changgui" />
  46. <span>常规</span>
  47. </template>
  48. <el-menu-item-group class="collect-submenu-group">
  49. <el-menu-item v-if="isTitleType !== 6" index="1-1" @click="handleForm('add')">新增</el-menu-item>
  50. <el-menu-item v-if="isTitleType !== 6" index="1-2" @click="handleForm('edit')">编辑</el-menu-item>
  51. <el-menu-item v-if="isTitleType !== 4" index="1-3" @click="toDelete">删除</el-menu-item>
  52. <el-menu-item v-if="isTitleType === 4" index="1-4" @click="toMove">移出</el-menu-item>
  53. </el-menu-item-group>
  54. <el-menu-item-group v-if="(isTitleType === 3 && selectedCategory.arrangeType === 1) || isTitleType === 4 || isTitleType === 6 || (isTitleType === 3 && activeIndex === 1)" class="collect-submenu-group submenu-tree">
  55. <template slot="title">原文上传</template>
  56. <el-menu-item index="1-5" @click="fileUpload(0)">普通上传</el-menu-item>
  57. <el-menu-item index="1-6" @click="fileUpload(1)">大文件上传</el-menu-item>
  58. </el-menu-item-group>
  59. </el-submenu>
  60. <el-submenu v-if="isTitleType !== 6" index="2">
  61. <template slot="title">
  62. <i class="iconfont icon-zhengli" />
  63. <span>整理</span>
  64. </template>
  65. <el-menu-item-group class="collect-submenu-group">
  66. <el-menu-item v-if="isTitleType !== 2" index="2-1" @click="handleBlukImport">批量导入</el-menu-item>
  67. <!-- 项目 / 案卷 / 卷内 / 文件-->
  68. <el-menu-item v-if="activeIndex !== 1 || (isTitleType === 3 && selectedCategory.arrangeType === 1 && activeIndex === 1)" index="2-2" @click="handleBlukEditing">批量修改</el-menu-item>
  69. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1" index="2-3" @click="handleJnSeqAdjustment('anjuan')">案卷顺序调整</el-menu-item>
  70. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1 " index="2-12" @click="handleJnSeqAdjustment('juannei')">卷内顺序调整</el-menu-item>
  71. <el-menu-item v-if="isTitleType === 3 && selectedCategory.arrangeType === 1" index="2-3" @click="handleJnSeqAdjustment('file')">文件顺序调整</el-menu-item>
  72. <el-menu-item v-if="isTitleType !== 2 && !(isTitleType === 3 && (selectedCategory.arrangeType === 1|| selectedCategory.arrangeType === 2) && activeIndex === 1) && isTitleType !== 4" index="2-4" @click="handleFileNumberUpdate(0)">档号更新</el-menu-item>
  73. <!-- 案卷 -->
  74. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1 " index="2-5" @click="handleFileNumberUpdate(1)">卷内档号更新</el-menu-item>
  75. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1" index="2-6" @click="handleUncoil">拆卷</el-menu-item>
  76. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1" index="2-7" @click="handleCombineFile">合卷</el-menu-item>
  77. <el-menu-item v-if="isTitleType === 3 && selectedCategory.arrangeType !== 1" index="2-8" @click="handleInsertFile">插件</el-menu-item>
  78. <!-- 案卷 / 卷内 / 文件 -->
  79. <el-menu-item v-if="isTitleType !== 2" index="2-9" @click="handleCollectMoveFile">移动</el-menu-item>
  80. <!-- 案卷 -->
  81. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0" index="2-10" @click="handleFiling">归档</el-menu-item>
  82. <!-- 文件 -->
  83. <el-menu-item v-if="(isTitleType === 3 && selectedCategory.arrangeType === 1) || (isTitleType === 3 && activeIndex === 1)" index="2-11" @click="handleReturn">退回预归档库</el-menu-item>
  84. </el-menu-item-group>
  85. <el-menu-item-group v-if="isTitleType === 3 && activeIndex === 1 && selectedCategory.arrangeType !== 1" class="collect-submenu-group submenu-tree">
  86. <template slot="title">组卷</template>
  87. <el-menu-item index="2-12" @click="handleQuickPaper">快速组卷</el-menu-item>
  88. <el-menu-item index="2-13" @click="handlePaper">手工组卷</el-menu-item>
  89. </el-menu-item-group>
  90. </el-submenu>
  91. <el-submenu index="3">
  92. <template slot="title">
  93. <i class="iconfont icon-gengduo" />
  94. <span>更多</span>
  95. </template>
  96. <el-menu-item-group class="collect-submenu-group">
  97. <el-menu-item v-if="isTitleType !== 6" index="3-1" @click="handleExport">导出</el-menu-item>
  98. <el-menu-item v-if="!(isTitleType === 3 && (selectedCategory.arrangeType === 3 || selectedCategory.arrangeType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 6)" index="3-2" @click="handlePrint">打印</el-menu-item>
  99. <el-menu-item v-if="!(isTitleType === 3 && (selectedCategory.arrangeType === 3 || selectedCategory.arrangeType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 6) && isTitleType !== 4" index="3-3" @click="handleFourTest">四性检测</el-menu-item>
  100. <el-menu-item v-if="isTitleType === 6" index="3-4" @click="handleOriginalDownload">下载</el-menu-item>
  101. </el-menu-item-group>
  102. <el-menu-item-group v-if="!(isTitleType === 3 && (selectedCategory.arrangeType === 3 || selectedCategory.arrangeType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 4 && isTitleType !== 6)" class="collect-submenu-group submenu-tree">
  103. <template slot="title">电子文件目录</template>
  104. <el-menu-item index="3-5" @click="handleCatalogDownload">目录下载</el-menu-item>
  105. <el-menu-item index="3-6" @click="fileUpload(2)">目录上传</el-menu-item>
  106. </el-menu-item-group>
  107. </el-submenu>
  108. </el-menu>
  109. </div>
  110. <div v-if="isRecycle && (isTitleType === 2 || (isTitleType === 3 && selectedCategory.arrangeType !== 3))" class="collect-menu">
  111. <el-button class="filter-item" size="mini" type="success" @click="toRecover"><i class="iconfont icon-huifu" />恢复</el-button>
  112. <el-button class="filter-item" size="mini" type="success" @click="toCompletelyDelete"><i class="iconfont icon-shanchu" />彻底删除</el-button>
  113. </div>
  114. <!--新增 / 编辑 表单组件-->
  115. <el-dialog class="preview-dialog" :modal-append-to-body="false" :close-on-click-modal="false" append-to-body :before-close="handleClose" :visible="formVisible" :title="formTitle">
  116. <span class="dialog-right-top" />
  117. <span class="dialog-left-bottom" />
  118. <div class="setting-dialog">
  119. <!-- form @emitTableList="getTableList" -->
  120. <PreviewForm
  121. v-if="formPreviewData.length"
  122. ref="previewForm"
  123. :is-has-code="true"
  124. :is-disabled="false"
  125. :form-preview-data.sync="formPreviewData"
  126. :selected-category="selectedCategory"
  127. :arc-id="arcId"
  128. :is-des-form-type="isDesFormType"
  129. :is-title-type="isTitleType"
  130. :collect-level="collectLevel"
  131. @close-dialog="closeDialog"
  132. />
  133. <div slot="footer" class="dialog-footer">
  134. <el-button type="primary" @click="handlerArchivesSubmit">保存</el-button>
  135. </div>
  136. </div>
  137. </el-dialog>
  138. <!--删除对话框组件-->
  139. <el-dialog class="tip-dialog" title="提示" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="deleteVisible">
  140. <div class="setting-dialog">
  141. <div class="tip-content">
  142. <p class="tipMsg">此删除将把会所选条目与其子集放入回收站</p>
  143. <span>你是否还要继续?</span>
  144. </div>
  145. <div slot="footer" class="dialog-footer">
  146. <el-button type="text" @click="deleteVisible = false">取消</el-button>
  147. <el-button type="primary" @click.native="handleDelConfirm">确定</el-button>
  148. </div>
  149. </div>
  150. </el-dialog>
  151. <!--卷内移出 组件-->
  152. <el-dialog class="tip-dialog" title="提示" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="moveVisible">
  153. <div class="setting-dialog">
  154. <div class="tip-content">
  155. <p class="tipMsg">此移出将把会所选条目返还到未整理列表</p>
  156. <span>你是否还要继续?</span>
  157. </div>
  158. <div slot="footer" class="dialog-footer">
  159. <el-button type="text" @click="moveVisible = false">取消</el-button>
  160. <el-button type="primary" @click.native="handleMoveConfirm">确定</el-button>
  161. </div>
  162. </div>
  163. </el-dialog>
  164. <!-- 原文上传 -->
  165. <UploadOriginal ref="uploadOriginalRef" :selected-category="selectedCategory" :arc-id="arcId" @close-dialog="closeDialog" />
  166. <!-- 大文件上传 -->
  167. <BigUpload ref="uploadBigRef" :selected-category="selectedCategory" :arc-id="arcId" @close-dialog="closeDialog" />
  168. <!-- 批量导入 -->
  169. <BlukImport ref="blukImportRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  170. <!-- 批量修改 -->
  171. <BlukEditing ref="blukEditingRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  172. <!-- 档案调整 -->
  173. <!-- <FileNumberAdjustment ref="fileNumberAdjustmentRef" :selected-category="selectedCategory" :collect-level="collectLevel" /> -->
  174. <!-- 案卷/文件/卷内 顺序调整 -->
  175. <FileSeqAdjustment ref="fileSeqAdjustmentRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  176. <!-- 合卷 -->
  177. <CombineFile ref="combineFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  178. <!-- 插件 -->
  179. <InsertFile ref="insertFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  180. <!-- 移动 -->
  181. <CollectMoveFile ref="collectMoveFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  182. <!-- 打印 -->
  183. <Print ref="printRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  184. <!-- 四性检测 -->
  185. <FourTest ref="fourTestRef" :selected-category="selectedCategory" :collect-level="collectLevel" @close-dialog="closeDialog" />
  186. <!-- 快速组卷 -->
  187. <QuickPaper ref="quickPaperRef" :selected-category="selectedCategory" :arc-id="arcId" :collect-level="collectLevel" @close-dialog="closeDialog" />
  188. <!-- 归档 -->
  189. <ArchivesFilling ref="archivesFillingRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  190. </div>
  191. <div style="display: flex; justify-content: space-between; height: 30px; line-height: 30px; padding: 0 20px; ">
  192. <span v-if="(isTitleType !== 2 && selectedCategory.arrangeType === 3 ) || ((isTitleType === 4 || isTitleType === 6) && selectedCategory.arrangeType === 2) || (isTitleType === 6 && selectedCategory.arrangeType === 1)" style="font-size: 12px;">{{ test }}</span>
  193. <div v-if="isTitleType !== 2 && !isRecycle && isTitleType !== 6 && !(isTitleType === 3 && activeIndex === 1 && selectedCategory.arrangeType !== 1 )" class="mangement-fixed-top">
  194. <el-checkbox v-model="parentsData.fixedStatusBar" @change="statusBarChecked">隐藏状态栏</el-checkbox>
  195. </div>
  196. </div>
  197. </div>
  198. </template>
  199. <script>
  200. import CRUD, { crud } from '@crud/crud'
  201. import { collectionLibraryCrud } from '../mixins/index'
  202. import { FetchInitCategoryInputFieldByPid } from '@/api/system/category/category'
  203. // FetchBecomeDocumentConfirm
  204. import { FetchDetailsById, collectDel, FetchRemoveArchivesSingle, FetchDeleteArchivesFile, FetchUpdateArchivesNo, FetchDisbandArchives, FetchReturnReDocument, FetchCompleteDelArchives, FetchRestoreArchives } from '@/api/collect/collect'
  205. import { FetchArchivesClassTree } from '@/api/system/archivesClass'
  206. import { FetchDictionaryTree } from '@/api/system/dict'
  207. import Treeselect from '@riophae/vue-treeselect'
  208. import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  209. import PreviewForm from '@/views/components/category/PreviewForm'
  210. import UploadOriginal from './uploadOriginal/index'
  211. import BigUpload from './uploadOriginal/bigUpload'
  212. import BlukImport from './bulkImport/index'
  213. import BlukEditing from './blukEditing/index'
  214. import FileSeqAdjustment from './fileSeqAdjustment/index'
  215. import CombineFile from './combineFile/index'
  216. import InsertFile from './insertFile/index'
  217. import CollectMoveFile from './collectMoveFile/index'
  218. import Print from './print/index'
  219. import FourTest from './fourTest/index'
  220. import QuickPaper from './quickPaper/index'
  221. import ArchivesFilling from './archivesFilling/index'
  222. import qs from 'qs'
  223. import { downloadFile, exportFile } from '@/utils/index'
  224. import { mapGetters } from 'vuex'
  225. export default {
  226. name: 'CollectHeader',
  227. components: { Treeselect, PreviewForm, UploadOriginal, BigUpload, BlukImport, BlukEditing, FileSeqAdjustment, CombineFile, InsertFile, CollectMoveFile, Print, FourTest, QuickPaper, ArchivesFilling },
  228. mixins: [collectionLibraryCrud, crud()],
  229. props: {
  230. selectedCategory: {
  231. type: Object,
  232. default: function() {
  233. return {}
  234. }
  235. },
  236. isTitleType: {
  237. type: Number,
  238. default: 2
  239. },
  240. selections: {
  241. type: Array,
  242. default: () => []
  243. },
  244. activeIndex: {
  245. type: Number,
  246. default: 0
  247. },
  248. isTabFile: {
  249. type: Boolean,
  250. default: false
  251. },
  252. isRecycle: {
  253. type: Boolean,
  254. default: false
  255. },
  256. test: {
  257. type: String,
  258. default: ''
  259. }
  260. },
  261. inject: ['parentsData'],
  262. data() {
  263. return {
  264. activeMenuIndex: '1',
  265. formVisible: false,
  266. formTitle: '项目',
  267. formPreviewData: [], // 预览界面data
  268. projectOptions: [],
  269. classifyOptions: [],
  270. delAllLoading: false,
  271. deleteVisible: false,
  272. moveVisible: false,
  273. recoverVisible: false,
  274. completelyDeleteVisible: false,
  275. isDesFormType: 'arcives', // 区分是门类得还是档案得
  276. arcId: null,
  277. quickPaper: false,
  278. quickPaperArcId: []
  279. }
  280. },
  281. computed: {
  282. ...mapGetters([
  283. 'baseApi'
  284. ]),
  285. collectTitle() {
  286. if (this.isTitleType === 2) {
  287. return '项目'
  288. } else if (this.isTitleType === 3) {
  289. if (this.selectedCategory.arrangeType === 1) {
  290. return '文件'
  291. } else {
  292. if (this.activeIndex === 1) {
  293. return '文件'
  294. } else {
  295. return '案卷'
  296. }
  297. }
  298. } else if (this.isTitleType === 4) {
  299. return '卷内'
  300. } else if (this.isTitleType === 6) {
  301. return '原文'
  302. }
  303. return ''
  304. },
  305. collectLevel() {
  306. if (this.isTitleType === 2) {
  307. return 1
  308. } else if (this.isTitleType === 3) {
  309. if (this.selectedCategory.arrangeType === 1) {
  310. return 3
  311. } else {
  312. if (this.activeIndex === 1) {
  313. return 3
  314. } else {
  315. return 2
  316. }
  317. }
  318. } else if (this.isTitleType === 4) {
  319. return 3
  320. } else if (this.isTitleType === 6) {
  321. return 4
  322. }
  323. return null
  324. },
  325. classType() {
  326. if (this.isTitleType === 2) {
  327. return ''
  328. } else if (this.isTitleType === 3) {
  329. if (this.selectedCategory.arrangeType === 1) {
  330. return 'is-juannei'
  331. } else {
  332. if (this.activeIndex === 1) {
  333. return 'is-juannei'
  334. } else {
  335. return 'is-anjuan'
  336. }
  337. }
  338. } else if (this.isTitleType === 4) {
  339. return 'is-juannei'
  340. } else if (this.isTitleType === 6) {
  341. return 'is-file'
  342. }
  343. return ''
  344. },
  345. placeholderType() {
  346. if (this.isTitleType === 2) {
  347. return '输入项目名称或编号'
  348. } else if (this.isTitleType === 3 || this.isTitleType === 4) {
  349. return '输入题名或档号'
  350. }
  351. return '输入项目名称或编号'
  352. }
  353. },
  354. watch: {
  355. selectedCategory: function(newValue, oldValue) {
  356. if (newValue && newValue.id) {
  357. this.getInitArchivesClass()
  358. this.getDictsList()
  359. }
  360. },
  361. isTitleType: function(newValue, oldValue) {
  362. console.log('isTitleType', newValue)
  363. },
  364. activeIndex: function(newValue, oldValue) {
  365. console.log('activeIndex', newValue)
  366. if (newValue === 1) {
  367. this.parentsData.isTabFile = true
  368. } else {
  369. this.parentsData.isTabFile = false
  370. }
  371. }
  372. },
  373. created() {
  374. },
  375. mounted() {
  376. this.getInitArchivesClass()
  377. this.getDictsList()
  378. },
  379. methods: {
  380. resetQuery() {
  381. this.query = {
  382. 'search': null,
  383. 'project_class': null,
  384. 'archive_ctg_no': null
  385. }
  386. this.handleSearch(this.collectLevel)
  387. },
  388. // 筛选 - 档案分类
  389. getInitArchivesClass() {
  390. this.classifyOptions = []
  391. this.query = {
  392. 'search': null,
  393. 'project_class': null,
  394. 'archive_ctg_no': null
  395. }
  396. const params = {
  397. 'categoryId': this.selectedCategory.id
  398. }
  399. FetchArchivesClassTree(params).then((res) => {
  400. this.classifyOptions = JSON.parse(JSON.stringify(res))
  401. }).catch(err => {
  402. console.log(err)
  403. })
  404. },
  405. normalizer(node) {
  406. if (node.childArchivesClass === null) {
  407. delete node.childArchivesClass
  408. }
  409. return {
  410. id: node.code,
  411. label: node.name,
  412. children: node.childArchivesClass
  413. }
  414. },
  415. // 项目级别 - 阶段分类
  416. getDictsList() {
  417. this.projectOptions = []
  418. FetchDictionaryTree().then((res) => {
  419. const filterCodes = ['project_class']
  420. let filteredItems = JSON.parse(JSON.stringify(res)).filter(item => filterCodes.includes(item.dictionaryCode))
  421. filteredItems = this.addLevelToDictionaryList(filteredItems, 1)
  422. if (this.selectedCategory.arrangeType === 3 && this.isTitleType === 3) {
  423. this.projectOptions = filteredItems
  424. } else {
  425. this.projectOptions = this.filterData(filteredItems, filteredItems[0].id)
  426. }
  427. }).catch(err => {
  428. console.log(err)
  429. })
  430. },
  431. // 显示第一级和第二级
  432. filterData(data, targetId) {
  433. return data.filter(item => {
  434. if (item.id === targetId || item.dictionaryParents === targetId) {
  435. if (item.childDictionarys && item.childDictionarys.length > 0) {
  436. item.childDictionarys = this.filterData(item.childDictionarys, targetId)
  437. }
  438. return true
  439. }
  440. return false
  441. })
  442. },
  443. // 给筛选出来的数据加level 方便后面是否可点击
  444. addLevelToDictionaryList(dictionaryList, level) {
  445. dictionaryList.forEach(dictionary => {
  446. dictionary.level = level
  447. if (dictionary.childDictionarys) {
  448. dictionary.childDictionarys = this.addLevelToDictionaryList(dictionary.childDictionarys, level + 1)
  449. }
  450. })
  451. return dictionaryList
  452. },
  453. normalizerProject(node) {
  454. if ((node.childDictionarys && !node.childDictionarys.length) || node.childDictionarys === null) {
  455. delete node.childDictionarys
  456. }
  457. return {
  458. id: node.dictionaryName,
  459. label: node.dictionaryName,
  460. children: node.childDictionarys,
  461. isDisabled: this.isTitleType === 3 ? node.level !== 3 : node.level === 1
  462. }
  463. },
  464. handleSelect(key, keyPath) {
  465. console.log(key, keyPath)
  466. },
  467. // 著录界面-form/详情-api
  468. handleForm(type) {
  469. if (type === 'add') {
  470. if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
  471. this.$message('当前档案处于归档流程中,不可操作新增,请先确认!')
  472. return false
  473. }
  474. this.formTitle = '新增' + this.collectTitle
  475. this.arcId = null
  476. } else if (type === 'edit') {
  477. if (this.selections.length === 0) {
  478. this.$message('您还未勾选需要操作的条目,请先确认!')
  479. return false
  480. } else if (this.selections.length > 1) {
  481. this.$message('编辑操作只可勾选唯一目标条目,请先确认!')
  482. return false
  483. } else if (this.selections[0].collect_formal === 2) {
  484. this.$message('当前所选的档案处于归档流程中,不可操作编辑,请先确认!')
  485. return false
  486. }
  487. this.arcId = this.selections[0].id
  488. this.formTitle = '编辑' + this.collectTitle
  489. }
  490. // this.form.dictionaryConfigId = {}
  491. // this.formPreviewData = []
  492. // 档案预编辑获取字段
  493. this.formVisible = true
  494. this.$nextTick(() => {
  495. this.getFormInfo(type)
  496. })
  497. },
  498. getFormInfo(type) {
  499. if (type === 'edit') {
  500. const params = {
  501. 'categoryId': this.selectedCategory.id,
  502. 'categoryLevel': this.collectLevel,
  503. 'id': this.arcId
  504. }
  505. FetchDetailsById(params).then(data => {
  506. // const showFiledAll = data.showFiled.filter(item => item.isSequence).sort((a, b) => a.isSequence - b.isSequence)
  507. const showFiledAll = data.showFiled
  508. this.$nextTick(() => {
  509. this.formPreviewData = showFiledAll
  510. this.isDesFormType = 'arcives'
  511. this.$nextTick(() => {
  512. this.$refs.previewForm.archivesType = 'edit'
  513. this.$refs.previewForm.addOrUpdateForm = data.echo
  514. this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
  515. })
  516. })
  517. })
  518. } else {
  519. const params = {
  520. 'categoryId': this.selectedCategory.id,
  521. 'categoryLevel': this.collectLevel
  522. }
  523. FetchInitCategoryInputFieldByPid(params).then(data => {
  524. this.formPreviewData = data
  525. this.isDesFormType = 'arcives'
  526. this.$nextTick(() => {
  527. this.$refs.previewForm.archivesType = 'add'
  528. this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
  529. })
  530. })
  531. }
  532. },
  533. // form - submit
  534. handlerArchivesSubmit() {
  535. this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id, this.quickPaperArcId)
  536. },
  537. // 关闭
  538. handleClose(done) {
  539. this.formVisible = false
  540. done()
  541. },
  542. // 删除
  543. toDelete() {
  544. if (this.selections.length === 0) {
  545. this.$message('您还未勾选需要操作的条目,请先确认!')
  546. return false
  547. }
  548. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  549. if (isHasFillFormal) {
  550. this.$message('您所选的条目有正在归档流程中,不可操作删除,请先确认!')
  551. return false
  552. }
  553. if (this.collectLevel === 4) {
  554. if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
  555. this.$message('当前档案处于归档流程中,不可操作删除,请先确认!')
  556. return false
  557. }
  558. }
  559. this.deleteVisible = true
  560. },
  561. // 卷内 - 移除
  562. toMove() {
  563. if (this.selections.length === 0) {
  564. this.$message('您还未勾选需要操作的条目,请先确认!')
  565. return false
  566. }
  567. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  568. if (isHasFillFormal) {
  569. this.$message('您所选的条目有正在归档流程中,不可操作删除,请先确认!')
  570. return false
  571. }
  572. this.moveVisible = true
  573. },
  574. // 删除 - 确认
  575. handleDelConfirm() {
  576. this.delAllLoading = true
  577. if (this.collectLevel === 4) {
  578. const params = this.selections.map((item) => {
  579. const json = {}
  580. json.archivesId = item.archive_id
  581. json.categoryId = this.selectedCategory.id
  582. json.documentFileId = item.document_file_id
  583. json.documentId = item.document_id
  584. json.id = item.id
  585. return json
  586. })
  587. FetchDeleteArchivesFile(params).then((res) => {
  588. if (res === 'SUCCESS') {
  589. this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
  590. this.delAllLoading = false
  591. this.deleteVisible = false
  592. this.handleSearch(this.collectLevel)
  593. } else {
  594. this.crud.notify('删除所选电子原文失败', CRUD.NOTIFICATION_TYPE.ERROR)
  595. }
  596. }).catch(err => {
  597. this.delAllLoading = false
  598. console.log(err)
  599. })
  600. } else {
  601. const archivesIds = []
  602. this.selections.forEach(val => {
  603. archivesIds.push(val.id)
  604. })
  605. const params = {
  606. 'categoryId': this.selectedCategory.id,
  607. 'categoryLevel': this.collectLevel,
  608. 'archivesIds': archivesIds
  609. }
  610. collectDel(params).then((res) => {
  611. if (res.includes('成功')) {
  612. this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
  613. this.delAllLoading = false
  614. this.deleteVisible = false
  615. this.handleSearch(this.collectLevel)
  616. } else {
  617. this.crud.notify('删除所选档案失败', CRUD.NOTIFICATION_TYPE.ERROR)
  618. }
  619. }).catch(err => {
  620. this.delAllLoading = false
  621. console.log(err)
  622. })
  623. }
  624. },
  625. // 卷内 - 移出 确认
  626. handleMoveConfirm() {
  627. const archivesIds = []
  628. this.selections.forEach(val => {
  629. archivesIds.push(val.id)
  630. })
  631. const params = {
  632. 'categoryId': this.selectedCategory.id,
  633. 'categoryLevel': this.collectLevel,
  634. 'archivesIds': archivesIds,
  635. 'parentsId': this.parentsData.parentsAnjuanId
  636. }
  637. FetchRemoveArchivesSingle(params).then((res) => {
  638. if (res === true) {
  639. this.crud.notify('移出成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
  640. this.handleSearch(this.collectLevel)
  641. } else {
  642. this.crud.notify('移出失败', CRUD.NOTIFICATION_TYPE.ERROR)
  643. }
  644. this.moveVisible = false
  645. }).catch(err => {
  646. console.log(err)
  647. })
  648. },
  649. // 原文上传
  650. fileUpload(uploadType) {
  651. if (uploadType !== 2) {
  652. if (this.isTitleType !== 6) {
  653. if (this.selections.length === 0) {
  654. this.$message('您还未勾选需要操作的条目,请先确认!')
  655. return false
  656. }
  657. if (this.selections.length > 1) {
  658. this.$message('上传操作只可勾选唯一目标条目,请先确认!')
  659. return false
  660. }
  661. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  662. if (isHasFillFormal) {
  663. this.$message('您所选的条目有正在归档流程中,不可操作原文上传,请先确认!')
  664. return false
  665. }
  666. this.arcId = this.selections[0].id
  667. } else {
  668. if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
  669. this.$message('当前档案处于归档流程中,不可操作原文上传,请先确认!')
  670. return false
  671. }
  672. if (this.selectedCategory.arrangeType === 1) {
  673. this.arcId = this.parentsData.parentsAnjuanId
  674. } else {
  675. if (this.parentsData.isTabFile) {
  676. this.arcId = this.parentsData.parentsAnjuanId
  677. } else {
  678. this.arcId = this.parentsData.parentsJuanneiId
  679. }
  680. }
  681. }
  682. }
  683. if (uploadType === 0) {
  684. this.$refs.uploadOriginalRef.uploadTitle = '普通上传'
  685. this.$refs.uploadOriginalRef.uploadVisible = true
  686. } else if (uploadType === 1) {
  687. this.$refs.uploadBigRef.uploadBigVisible = true
  688. } else if (uploadType === 2) {
  689. this.$refs.uploadOriginalRef.uploadTitle = '原文目录上传'
  690. this.$refs.uploadOriginalRef.uploadVisible = true
  691. }
  692. if (this.$refs.uploadOriginalRef.uploadVisible) {
  693. this.$refs.uploadOriginalRef.uploadType = uploadType
  694. this.$refs.uploadOriginalRef.fileList = []
  695. }
  696. },
  697. // 批量导入
  698. handleBlukImport() {
  699. if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
  700. this.$message('当前档案处于归档流程中,不可操作批量导入,请先确认!')
  701. return false
  702. }
  703. this.$refs.blukImportRef.bulkImportVisible = true
  704. },
  705. // 批量修改
  706. handleBlukEditing() {
  707. if (this.selections.length === 0) {
  708. this.$message('您还未勾选需要操作的条目,请先确认!')
  709. return false
  710. }
  711. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  712. if (isHasFillFormal) {
  713. this.$message('您所选的条目有正在归档流程中,不可操作批量修改,请先确认!')
  714. return false
  715. }
  716. this.$nextTick(() => {
  717. this.$refs.blukEditingRef.bulkEditingVisible = true
  718. })
  719. },
  720. // 案卷/文件/卷内顺序调整
  721. handleJnSeqAdjustment(type) {
  722. if (type === 'juannei') {
  723. if (this.selections.length === 0) {
  724. this.$message('您还未勾选需要操作的条目,请先确认!')
  725. return false
  726. }
  727. if (this.selections.length > 1) {
  728. this.$message('卷内顺序调整操作只可勾选唯一目标条目,请先确认!')
  729. return false
  730. }
  731. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  732. if (isHasFillFormal) {
  733. this.$message('您所选的条目有正在归档流程中,不可操作卷内顺序调整,请先确认!')
  734. return false
  735. }
  736. this.$nextTick(() => {
  737. this.$refs.fileSeqAdjustmentRef.titleAdjustment = '卷内顺序调整'
  738. this.$refs.fileSeqAdjustmentRef.isJuannei = true
  739. })
  740. } else {
  741. if (this.selections.length < 2) {
  742. this.$message('请选择多个' + (type === 'file' ? '文件' : '案卷') + '后进行操作!')
  743. return false
  744. }
  745. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  746. if (isHasFillFormal) {
  747. this.$message('您所选的条目有正在归档流程中,不可操作案卷/文件顺序调整,请先确认!')
  748. return false
  749. }
  750. this.$nextTick(() => {
  751. if (type === 'anjuan') {
  752. this.$refs.fileSeqAdjustmentRef.titleAdjustment = '案卷顺序调整'
  753. } else {
  754. this.$refs.fileSeqAdjustmentRef.titleAdjustment = '文件顺序调整'
  755. }
  756. this.$refs.fileSeqAdjustmentRef.isJuannei = false
  757. })
  758. }
  759. this.$nextTick(() => {
  760. this.$refs.fileSeqAdjustmentRef.getDoArchivesAdjust()
  761. })
  762. },
  763. // 档号更新
  764. handleFileNumberUpdate(type) {
  765. if (this.selections.length === 0) {
  766. this.$message('您还未勾选需要操作的条目,请先确认!')
  767. return false
  768. }
  769. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  770. if (isHasFillFormal) {
  771. this.$message('您所选的条目有正在归档流程中,不可操作档号更新,请先确认!')
  772. return false
  773. }
  774. this.$confirm('此操作将会自动重新生成档号' + '<span>你是否还要继续?</span>', '提示', {
  775. confirmButtonText: '继续',
  776. cancelButtonText: '取消',
  777. type: 'warning',
  778. dangerouslyUseHTMLString: true
  779. }).then(() => {
  780. // updateType 更新类别 1.档号更新 2.卷内档号更新
  781. let updateType
  782. if (type === 0) {
  783. updateType = 1
  784. } else {
  785. updateType = 2
  786. }
  787. const archivesIds = []
  788. this.selections.forEach(val => {
  789. archivesIds.push(val.id)
  790. })
  791. const params = {
  792. 'categoryId': this.selectedCategory.id,
  793. 'categoryLevel': this.collectLevel,
  794. 'archivesIds': archivesIds,
  795. 'updateType': updateType
  796. }
  797. FetchUpdateArchivesNo(params).then((res) => {
  798. if (res.code !== 500) {
  799. this.crud.notify('档号更新成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
  800. this.handleSearch(this.collectLevel)
  801. } else {
  802. this.crud.notify(res.message, CRUD.NOTIFICATION_TYPE.ERROR)
  803. }
  804. }).catch(err => {
  805. console.log(err)
  806. })
  807. }).catch(() => {
  808. })
  809. },
  810. // 拆卷
  811. handleUncoil() {
  812. if (this.selections.length === 0) {
  813. this.$message('您还未勾选需要操作的条目,请先确认!')
  814. return false
  815. }
  816. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  817. if (isHasFillFormal) {
  818. this.$message('您所选的条目有正在归档流程中,不可操作拆卷,请先确认!')
  819. return false
  820. }
  821. this.$confirm('拆卷之后,对应的案卷数据将会自动删除' + '<span>你是否还要继续?</span>', '提示', {
  822. confirmButtonText: '继续',
  823. cancelButtonText: '取消',
  824. type: 'warning',
  825. dangerouslyUseHTMLString: true
  826. }).then(() => {
  827. const archivesIds = []
  828. this.selections.forEach(val => {
  829. archivesIds.push(val.id)
  830. })
  831. const params = {
  832. 'categoryId': this.selectedCategory.id,
  833. 'archivesIds': archivesIds
  834. }
  835. FetchDisbandArchives(params).then((res) => {
  836. if (res.code !== 500) {
  837. this.crud.notify('拆卷成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
  838. this.handleSearch(this.collectLevel)
  839. } else {
  840. this.crud.notify('拆卷失败', CRUD.NOTIFICATION_TYPE.ERROR)
  841. }
  842. }).catch(err => {
  843. console.log(err)
  844. })
  845. }).catch(() => {
  846. })
  847. },
  848. // 合卷
  849. handleCombineFile() {
  850. if (this.selections.length < 2) {
  851. this.$message('合卷操作至少勾选2个案卷,请重试!')
  852. return false
  853. }
  854. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  855. if (isHasFillFormal) {
  856. this.$message('您所选的条目有正在归档流程中,不可操作合卷,请先确认!')
  857. return false
  858. }
  859. this.$refs.combineFileRef.getTargetList()
  860. },
  861. // 插件
  862. handleInsertFile() {
  863. if (this.collectLevel === 3) {
  864. if (this.selections.length === 0) {
  865. this.$confirm('您未勾选条目,否则直接选择所有条目' + '<span>你是否还要继续?</span>', '提示', {
  866. confirmButtonText: '继续',
  867. cancelButtonText: '取消',
  868. type: 'warning',
  869. dangerouslyUseHTMLString: true
  870. }).then(() => {
  871. this.$refs.insertFileRef.fileNoSelectionData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
  872. this.$refs.insertFileRef.getInsertViewTable()
  873. }).catch(() => {
  874. })
  875. } else {
  876. this.$refs.insertFileRef.getInsertViewTable()
  877. }
  878. } else {
  879. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  880. if (this.selections.length !== 1) {
  881. this.$message('插卷操作只可勾选唯一目标条目,请先确认!')
  882. return false
  883. } else if (isHasFillFormal) {
  884. this.$message('您所选的条目有正在归档流程中,不可操作插件,请先确认!')
  885. return false
  886. } else {
  887. this.$refs.insertFileRef.getInsertViewTable()
  888. }
  889. }
  890. },
  891. // 移动
  892. handleCollectMoveFile() {
  893. if (this.selections.length === 0) {
  894. this.$message('您还未勾选需要操作的条目,请先确认!')
  895. return false
  896. }
  897. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  898. if (isHasFillFormal) {
  899. this.$message('您所选的条目有正在归档流程中,不可操作移动,请先确认!')
  900. return false
  901. }
  902. this.$refs.collectMoveFileRef.collectMoveFileVisible = true
  903. },
  904. // 归档
  905. handleFiling() {
  906. if (this.selections.length === 0) {
  907. this.$message('您还未勾选需要操作的条目,请先确认!')
  908. return false
  909. }
  910. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  911. if (isHasFillFormal) {
  912. this.$message('您所选的条目有正在归档流程中,勿重复操作,请先确认!!')
  913. return false
  914. }
  915. this.$refs.archivesFillingRef.archivesFillingVisible = true
  916. },
  917. // 退回预归档库
  918. handleReturn() {
  919. if (this.selections.length === 0) {
  920. this.$message('您还未勾选需要操作的条目,请先确认!')
  921. return false
  922. }
  923. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  924. if (isHasFillFormal) {
  925. this.$message('您所选的条目有正在归档流程中,不可操作退回预归档库,请先确认!!')
  926. return false
  927. }
  928. this.$confirm('此操作将把会所选条目退回到预归档库' + '<span>你是否还要继续?</span>', '提示', {
  929. confirmButtonText: '继续',
  930. cancelButtonText: '取消',
  931. type: 'warning',
  932. dangerouslyUseHTMLString: true
  933. }).then(() => {
  934. const archivesIds = this.selections.map(item => item.id)
  935. const params = {
  936. 'categoryId': this.selectedCategory.id,
  937. 'archivesIds': archivesIds
  938. }
  939. FetchReturnReDocument(params).then((res) => {
  940. if (res.code !== 500) {
  941. if (res === 0) {
  942. this.crud.notify('当前数据中不包含预归档数据,无法返回', CRUD.NOTIFICATION_TYPE.INFO)
  943. } else {
  944. this.crud.notify('已成功返回' + res + '条来自预归档的数据', CRUD.NOTIFICATION_TYPE.SUCCESS)
  945. }
  946. this.handleSearch(this.collectLevel)
  947. } else {
  948. this.crud.notify(res.message, CRUD.NOTIFICATION_TYPE.ERROR)
  949. }
  950. }).catch(err => {
  951. console.log(err)
  952. })
  953. }).catch(() => {
  954. })
  955. },
  956. // 导出
  957. handleExport() {
  958. if (this.selections.length === 0) {
  959. this.$message('您还未勾选需要操作的条目,请先确认!')
  960. return false
  961. }
  962. this.$confirm('此操作将导出所选数据' + '<span>你是否还要继续?</span>', '提示', {
  963. confirmButtonText: '继续',
  964. cancelButtonText: '取消',
  965. type: 'warning',
  966. dangerouslyUseHTMLString: true
  967. }).then(() => {
  968. const archivesIds = []
  969. this.selections.forEach(val => {
  970. archivesIds.push(val.id)
  971. })
  972. const params = {
  973. 'categoryId': this.selectedCategory.id,
  974. 'categoryLevel': this.collectLevel,
  975. 'archivesIds': archivesIds
  976. }
  977. exportFile(this.baseApi + '/api/collect/exportDate?' + qs.stringify(params, { indices: false }))
  978. }).catch(() => {
  979. })
  980. },
  981. // 打印
  982. handlePrint() {
  983. if (this.selections.length === 0) {
  984. this.$refs.printRef.form.printRange = '当页条目'
  985. let currentTableData = []
  986. if (this.collectLevel === 2) {
  987. currentTableData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
  988. } else if (this.collectLevel === 3) {
  989. if (this.isTitleType === 3) {
  990. currentTableData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
  991. } else {
  992. currentTableData = this.parentsData.$refs.juanneiEle.junneiData
  993. }
  994. }
  995. this.$refs.printRef.currentTable = JSON.parse(JSON.stringify(currentTableData))
  996. } else {
  997. this.$refs.printRef.form.printRange = '勾选条目'
  998. }
  999. this.$refs.printRef.printVisible = true
  1000. },
  1001. // 四性检测
  1002. handleFourTest() {
  1003. if (this.selections.length === 0) {
  1004. this.$message('您还未勾选需要操作的条目,请先确认!')
  1005. return false
  1006. }
  1007. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1008. if (isHasFillFormal) {
  1009. this.$message('您所选的条目有正在归档流程中,不可操作四性检测,请先确认!')
  1010. return false
  1011. }
  1012. this.$refs.fourTestRef.fourTestVisible = true
  1013. this.$refs.fourTestRef.tableData = this.selections
  1014. },
  1015. // 目录下载
  1016. handleCatalogDownload() {
  1017. if (this.selections.length === 0) {
  1018. this.$message('您还未勾选需要操作的条目,请先确认!')
  1019. return false
  1020. }
  1021. this.$confirm('此操作将下载所选条目目录' + '<span>你是否还要继续?</span>', '提示', {
  1022. confirmButtonText: '继续',
  1023. cancelButtonText: '取消',
  1024. type: 'warning',
  1025. dangerouslyUseHTMLString: true
  1026. }).then(() => {
  1027. const archivesIds = []
  1028. this.selections.forEach(val => {
  1029. archivesIds.push(val.id)
  1030. })
  1031. const params = {
  1032. 'categoryId': this.selectedCategory.id,
  1033. 'categoryLevel': this.collectLevel,
  1034. 'archivesIds': archivesIds
  1035. }
  1036. exportFile(this.baseApi + '/api/collect/catalogDownload?' + qs.stringify(params, { indices: false }))
  1037. }).catch(() => {
  1038. })
  1039. },
  1040. // 快速组卷
  1041. handleQuickPaper() {
  1042. this.$refs.quickPaperRef.quickVisible = true
  1043. },
  1044. // 手工组卷
  1045. handlePaper() {
  1046. if (this.selections.length === 0) {
  1047. this.$message('您还未勾选需要操作的条目,请先确认!')
  1048. return false
  1049. }
  1050. this.quickPaper = true
  1051. this.quickPaperArcId = this.selections.map(item => item.id)
  1052. this.handleForm('add')
  1053. },
  1054. // 原文内的附件下载
  1055. handleOriginalDownload() {
  1056. if (this.selections.length > 1 || this.selections.length === 0) {
  1057. this.$message('下载操作只可勾选唯一目标条目,请先确认!')
  1058. return false
  1059. }
  1060. const url = this.baseApi + '/downloadFile' + this.selections[0].file_path
  1061. fetch(url).then(res => res.blob()).then(blob => {
  1062. downloadFile(blob, this.selections[0].file_name.split('.')[0], this.selections[0].file_type)
  1063. }).catch(() => {
  1064. this.$message.error('下载文件失败!')
  1065. })
  1066. },
  1067. // 回收站 - 恢复
  1068. toRecover() {
  1069. if (this.selections.length === 0) {
  1070. this.$message('您还未勾选需要操作的条目,请先确认!')
  1071. return false
  1072. }
  1073. this.$confirm('此恢复将会把所选条目及其子集一并恢复' + '<span>你是否还要继续?</span>', '提示', {
  1074. confirmButtonText: '继续',
  1075. cancelButtonText: '取消',
  1076. type: 'warning',
  1077. dangerouslyUseHTMLString: true
  1078. }).then(() => {
  1079. const archivesIds = []
  1080. this.selections.forEach(val => {
  1081. archivesIds.push(val.id)
  1082. })
  1083. const params = {
  1084. 'categoryId': this.selectedCategory.id,
  1085. 'categoryLevel': this.collectLevel,
  1086. 'archivesIds': archivesIds
  1087. }
  1088. FetchRestoreArchives(params).then((res) => {
  1089. if (res.code !== 500) {
  1090. console.log(res)
  1091. this.crud.notify(res, CRUD.NOTIFICATION_TYPE.SUCCESS)
  1092. this.handleSearch(this.collectLevel)
  1093. } else {
  1094. this.crud.notify('回复所选档案失败', CRUD.NOTIFICATION_TYPE.ERROR)
  1095. }
  1096. }).catch(err => {
  1097. console.log(err)
  1098. })
  1099. }).catch(() => {
  1100. })
  1101. },
  1102. // 回收站 - 彻底删除
  1103. toCompletelyDelete() {
  1104. if (this.selections.length === 0) {
  1105. this.$message('您还未勾选需要操作的条目,请先确认!')
  1106. return false
  1107. }
  1108. this.$confirm('此删除将把会所选条目与其子集彻底删除' + '<span>你是否还要继续?</span>', '提示', {
  1109. confirmButtonText: '继续',
  1110. cancelButtonText: '取消',
  1111. type: 'warning',
  1112. dangerouslyUseHTMLString: true
  1113. }).then(() => {
  1114. const archivesIds = []
  1115. this.selections.forEach(val => {
  1116. archivesIds.push(val.id)
  1117. })
  1118. const params = {
  1119. 'categoryId': this.selectedCategory.id,
  1120. 'categoryLevel': this.collectLevel,
  1121. 'archivesIds': archivesIds
  1122. }
  1123. FetchCompleteDelArchives(params).then((res) => {
  1124. if (res.code !== 500) {
  1125. this.crud.notify(res, CRUD.NOTIFICATION_TYPE.SUCCESS)
  1126. this.handleSearch(this.collectLevel)
  1127. } else {
  1128. this.crud.notify('删除所选档案失败', CRUD.NOTIFICATION_TYPE.ERROR)
  1129. }
  1130. }).catch(err => {
  1131. console.log(err)
  1132. })
  1133. }).catch(() => {
  1134. })
  1135. },
  1136. closeDialog(data) {
  1137. this.formVisible = false
  1138. setTimeout(() => {
  1139. this.handleSearch(this.collectLevel)
  1140. })
  1141. }
  1142. }
  1143. }
  1144. </script>
  1145. <style lang='scss' scoped>
  1146. </style>