阅行客电子档案
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.

1178 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
  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',0)">新增</el-menu-item>
  50. <el-menu-item v-if="isTitleType !== 6" index="1-2" @click="handleForm('edit',0)">编辑</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. if (this.quickPaper) {
  294. return '案卷'
  295. } else {
  296. return '文件'
  297. }
  298. } else {
  299. return '案卷'
  300. }
  301. }
  302. } else if (this.isTitleType === 4) {
  303. return '卷内'
  304. } else if (this.isTitleType === 6) {
  305. return '原文'
  306. }
  307. return ''
  308. },
  309. collectLevel() {
  310. if (this.isTitleType === 2) {
  311. return 1
  312. } else if (this.isTitleType === 3) {
  313. if (this.selectedCategory.arrangeType === 1) {
  314. return 3
  315. } else {
  316. if (this.activeIndex === 1) {
  317. if (this.quickPaper) {
  318. return 2
  319. } else {
  320. return 3
  321. }
  322. } else {
  323. return 2
  324. }
  325. }
  326. } else if (this.isTitleType === 4) {
  327. return 3
  328. } else if (this.isTitleType === 6) {
  329. return 4
  330. }
  331. return null
  332. },
  333. classType() {
  334. if (this.isTitleType === 2) {
  335. return ''
  336. } else if (this.isTitleType === 3) {
  337. if (this.selectedCategory.arrangeType === 1) {
  338. return 'is-juannei'
  339. } else {
  340. if (this.activeIndex === 1) {
  341. return 'is-juannei'
  342. } else {
  343. return 'is-anjuan'
  344. }
  345. }
  346. } else if (this.isTitleType === 4) {
  347. return 'is-juannei'
  348. } else if (this.isTitleType === 6) {
  349. return 'is-file'
  350. }
  351. return ''
  352. },
  353. placeholderType() {
  354. if (this.isTitleType === 2) {
  355. return '输入项目名称或编号'
  356. } else if (this.isTitleType === 3 || this.isTitleType === 4) {
  357. return '输入题名或档号'
  358. }
  359. return '输入项目名称或编号'
  360. }
  361. },
  362. watch: {
  363. selectedCategory: function(newValue, oldValue) {
  364. if (newValue && newValue.id) {
  365. this.getInitArchivesClass()
  366. this.getDictsList()
  367. }
  368. },
  369. isTitleType: function(newValue, oldValue) {
  370. console.log('isTitleType', newValue)
  371. },
  372. activeIndex: function(newValue, oldValue) {
  373. console.log('activeIndex', newValue)
  374. if (newValue === 1) {
  375. this.parentsData.isTabFile = true
  376. } else {
  377. this.parentsData.isTabFile = false
  378. }
  379. }
  380. },
  381. created() {
  382. },
  383. mounted() {
  384. this.getInitArchivesClass()
  385. this.getDictsList()
  386. },
  387. methods: {
  388. resetQuery() {
  389. this.query = {
  390. 'search': null,
  391. 'project_class': null,
  392. 'archive_ctg_no': null
  393. }
  394. this.handleSearch(this.collectLevel)
  395. },
  396. // 筛选 - 档案分类
  397. getInitArchivesClass() {
  398. this.classifyOptions = []
  399. this.query = {
  400. 'search': null,
  401. 'project_class': null,
  402. 'archive_ctg_no': null
  403. }
  404. const params = {
  405. 'categoryId': this.selectedCategory.id
  406. }
  407. FetchArchivesClassTree(params).then((res) => {
  408. this.classifyOptions = JSON.parse(JSON.stringify(res))
  409. }).catch(err => {
  410. console.log(err)
  411. })
  412. },
  413. normalizer(node) {
  414. if (node.childArchivesClass === null) {
  415. delete node.childArchivesClass
  416. }
  417. return {
  418. id: node.code,
  419. label: node.name,
  420. children: node.childArchivesClass
  421. }
  422. },
  423. // 项目级别 - 阶段分类
  424. getDictsList() {
  425. this.projectOptions = []
  426. FetchDictionaryTree().then((res) => {
  427. const filterCodes = ['project_class']
  428. let filteredItems = JSON.parse(JSON.stringify(res)).filter(item => filterCodes.includes(item.dictionaryCode))
  429. filteredItems = this.addLevelToDictionaryList(filteredItems, 1)
  430. if (this.selectedCategory.arrangeType === 3 && this.isTitleType === 3) {
  431. this.projectOptions = filteredItems
  432. } else {
  433. this.projectOptions = this.filterData(filteredItems, filteredItems[0].id)
  434. }
  435. }).catch(err => {
  436. console.log(err)
  437. })
  438. },
  439. // 显示第一级和第二级
  440. filterData(data, targetId) {
  441. return data.filter(item => {
  442. if (item.id === targetId || item.dictionaryParents === targetId) {
  443. if (item.childDictionarys && item.childDictionarys.length > 0) {
  444. item.childDictionarys = this.filterData(item.childDictionarys, targetId)
  445. }
  446. return true
  447. }
  448. return false
  449. })
  450. },
  451. // 给筛选出来的数据加level 方便后面是否可点击
  452. addLevelToDictionaryList(dictionaryList, level) {
  453. dictionaryList.forEach(dictionary => {
  454. dictionary.level = level
  455. if (dictionary.childDictionarys) {
  456. dictionary.childDictionarys = this.addLevelToDictionaryList(dictionary.childDictionarys, level + 1)
  457. }
  458. })
  459. return dictionaryList
  460. },
  461. normalizerProject(node) {
  462. if ((node.childDictionarys && !node.childDictionarys.length) || node.childDictionarys === null) {
  463. delete node.childDictionarys
  464. }
  465. return {
  466. id: node.dictionaryName,
  467. label: node.dictionaryName,
  468. children: node.childDictionarys,
  469. isDisabled: this.isTitleType === 3 ? node.level !== 3 : node.level === 1
  470. }
  471. },
  472. handleSelect(key, keyPath) {
  473. console.log(key, keyPath)
  474. },
  475. // 著录界面-form/详情-api
  476. handleForm(type, isPaper) {
  477. if (type === 'add') {
  478. if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
  479. this.$message('当前档案处于归档流程中,不可操作新增,请先确认!')
  480. return false
  481. }
  482. this.arcId = null
  483. if (isPaper) {
  484. this.quickPaper = true
  485. this.formTitle = '新增案卷'
  486. } else {
  487. this.formTitle = '新增' + this.collectTitle
  488. this.quickPaper = false
  489. }
  490. } else if (type === 'edit') {
  491. this.quickPaper = false
  492. if (this.selections.length === 0) {
  493. this.$message('您还未勾选需要操作的条目,请先确认!')
  494. return false
  495. } else if (this.selections.length > 1) {
  496. this.$message('编辑操作只可勾选唯一目标条目,请先确认!')
  497. return false
  498. } else if (this.selections[0].collect_formal === 2) {
  499. this.$message('当前所选的档案处于归档流程中,不可操作编辑,请先确认!')
  500. return false
  501. }
  502. this.arcId = this.selections[0].id
  503. this.formTitle = '编辑' + this.collectTitle
  504. }
  505. // this.form.dictionaryConfigId = {}
  506. // this.formPreviewData = []
  507. // 档案预编辑获取字段
  508. this.formVisible = true
  509. this.$nextTick(() => {
  510. this.getFormInfo(type)
  511. })
  512. },
  513. getFormInfo(type) {
  514. if (type === 'edit') {
  515. const params = {
  516. 'categoryId': this.selectedCategory.id,
  517. 'categoryLevel': this.collectLevel,
  518. 'id': this.arcId
  519. }
  520. FetchDetailsById(params).then(data => {
  521. // const showFiledAll = data.showFiled.filter(item => item.isSequence).sort((a, b) => a.isSequence - b.isSequence)
  522. const showFiledAll = data.showFiled
  523. this.$nextTick(() => {
  524. this.formPreviewData = showFiledAll
  525. this.isDesFormType = 'arcives'
  526. this.$nextTick(() => {
  527. this.$refs.previewForm.archivesType = 'edit'
  528. this.$refs.previewForm.addOrUpdateForm = data.echo
  529. this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
  530. })
  531. })
  532. })
  533. } else {
  534. const params = {
  535. 'categoryId': this.selectedCategory.id,
  536. 'categoryLevel': this.collectLevel
  537. }
  538. FetchInitCategoryInputFieldByPid(params).then(data => {
  539. this.formPreviewData = data
  540. this.isDesFormType = 'arcives'
  541. this.$nextTick(() => {
  542. this.$refs.previewForm.archivesType = 'add'
  543. console.log('active', this.activeIndex)
  544. this.$refs.previewForm.activeIndex = this.activeIndex
  545. this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
  546. })
  547. })
  548. }
  549. },
  550. // form - submit
  551. handlerArchivesSubmit() {
  552. this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id, this.quickPaperArcId)
  553. },
  554. // 关闭
  555. handleClose(done) {
  556. this.formVisible = false
  557. done()
  558. },
  559. // 删除
  560. toDelete() {
  561. if (this.selections.length === 0) {
  562. this.$message('您还未勾选需要操作的条目,请先确认!')
  563. return false
  564. }
  565. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  566. if (isHasFillFormal) {
  567. this.$message('您所选的条目有正在归档流程中,不可操作删除,请先确认!')
  568. return false
  569. }
  570. if (this.collectLevel === 4) {
  571. if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
  572. this.$message('当前档案处于归档流程中,不可操作删除,请先确认!')
  573. return false
  574. }
  575. }
  576. this.deleteVisible = true
  577. },
  578. // 卷内 - 移除
  579. toMove() {
  580. if (this.selections.length === 0) {
  581. this.$message('您还未勾选需要操作的条目,请先确认!')
  582. return false
  583. }
  584. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  585. if (isHasFillFormal) {
  586. this.$message('您所选的条目有正在归档流程中,不可操作删除,请先确认!')
  587. return false
  588. }
  589. this.moveVisible = true
  590. },
  591. // 删除 - 确认
  592. handleDelConfirm() {
  593. this.delAllLoading = true
  594. if (this.collectLevel === 4) {
  595. const params = this.selections.map((item) => {
  596. const json = {}
  597. json.archivesId = item.archive_id
  598. json.categoryId = this.selectedCategory.id
  599. json.documentFileId = item.document_file_id
  600. json.documentId = item.document_id
  601. json.id = item.id
  602. return json
  603. })
  604. FetchDeleteArchivesFile(params).then((res) => {
  605. if (res === 'SUCCESS') {
  606. this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
  607. this.delAllLoading = false
  608. this.deleteVisible = false
  609. this.handleSearch(this.collectLevel)
  610. } else {
  611. this.crud.notify('删除所选电子原文失败', CRUD.NOTIFICATION_TYPE.ERROR)
  612. }
  613. }).catch(err => {
  614. this.delAllLoading = false
  615. console.log(err)
  616. })
  617. } else {
  618. const archivesIds = []
  619. this.selections.forEach(val => {
  620. archivesIds.push(val.id)
  621. })
  622. const params = {
  623. 'categoryId': this.selectedCategory.id,
  624. 'categoryLevel': this.collectLevel,
  625. 'archivesIds': archivesIds
  626. }
  627. collectDel(params).then((res) => {
  628. if (res.includes('成功')) {
  629. this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
  630. this.delAllLoading = false
  631. this.deleteVisible = false
  632. this.handleSearch(this.collectLevel)
  633. } else {
  634. this.crud.notify('删除所选档案失败', CRUD.NOTIFICATION_TYPE.ERROR)
  635. }
  636. }).catch(err => {
  637. this.delAllLoading = false
  638. console.log(err)
  639. })
  640. }
  641. },
  642. // 卷内 - 移出 确认
  643. handleMoveConfirm() {
  644. const archivesIds = []
  645. this.selections.forEach(val => {
  646. archivesIds.push(val.id)
  647. })
  648. const params = {
  649. 'categoryId': this.selectedCategory.id,
  650. 'categoryLevel': this.collectLevel,
  651. 'archivesIds': archivesIds,
  652. 'parentsId': this.parentsData.parentsAnjuanId
  653. }
  654. FetchRemoveArchivesSingle(params).then((res) => {
  655. if (res === true) {
  656. this.crud.notify('移出成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
  657. this.handleSearch(this.collectLevel)
  658. } else {
  659. this.crud.notify('移出失败', CRUD.NOTIFICATION_TYPE.ERROR)
  660. }
  661. this.moveVisible = false
  662. }).catch(err => {
  663. console.log(err)
  664. })
  665. },
  666. // 原文上传
  667. fileUpload(uploadType) {
  668. if (uploadType !== 2) {
  669. if (this.isTitleType !== 6) {
  670. if (this.selections.length === 0) {
  671. this.$message('您还未勾选需要操作的条目,请先确认!')
  672. return false
  673. }
  674. if (this.selections.length > 1) {
  675. this.$message('上传操作只可勾选唯一目标条目,请先确认!')
  676. return false
  677. }
  678. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  679. if (isHasFillFormal) {
  680. this.$message('您所选的条目有正在归档流程中,不可操作原文上传,请先确认!')
  681. return false
  682. }
  683. this.arcId = this.selections[0].id
  684. } else {
  685. if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
  686. this.$message('当前档案处于归档流程中,不可操作原文上传,请先确认!')
  687. return false
  688. }
  689. if (this.selectedCategory.arrangeType === 1) {
  690. this.arcId = this.parentsData.parentsAnjuanId
  691. } else {
  692. if (this.parentsData.isTabFile) {
  693. this.arcId = this.parentsData.parentsAnjuanId
  694. } else {
  695. this.arcId = this.parentsData.parentsJuanneiId
  696. }
  697. }
  698. }
  699. }
  700. if (uploadType === 0) {
  701. this.$refs.uploadOriginalRef.uploadTitle = '普通上传'
  702. this.$refs.uploadOriginalRef.uploadVisible = true
  703. } else if (uploadType === 1) {
  704. this.$refs.uploadBigRef.uploadBigVisible = true
  705. } else if (uploadType === 2) {
  706. this.$refs.uploadOriginalRef.uploadTitle = '原文目录上传'
  707. this.$refs.uploadOriginalRef.uploadVisible = true
  708. }
  709. if (this.$refs.uploadOriginalRef.uploadVisible) {
  710. this.$refs.uploadOriginalRef.uploadType = uploadType
  711. this.$refs.uploadOriginalRef.fileList = []
  712. }
  713. },
  714. // 批量导入
  715. handleBlukImport() {
  716. if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
  717. this.$message('当前档案处于归档流程中,不可操作批量导入,请先确认!')
  718. return false
  719. }
  720. this.$refs.blukImportRef.bulkImportVisible = true
  721. },
  722. // 批量修改
  723. handleBlukEditing() {
  724. if (this.selections.length === 0) {
  725. this.$message('您还未勾选需要操作的条目,请先确认!')
  726. return false
  727. }
  728. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  729. if (isHasFillFormal) {
  730. this.$message('您所选的条目有正在归档流程中,不可操作批量修改,请先确认!')
  731. return false
  732. }
  733. this.$nextTick(() => {
  734. this.$refs.blukEditingRef.bulkEditingVisible = true
  735. })
  736. },
  737. // 案卷/文件/卷内顺序调整
  738. handleJnSeqAdjustment(type) {
  739. if (type === 'juannei') {
  740. if (this.selections.length === 0) {
  741. this.$message('您还未勾选需要操作的条目,请先确认!')
  742. return false
  743. }
  744. if (this.selections.length > 1) {
  745. this.$message('卷内顺序调整操作只可勾选唯一目标条目,请先确认!')
  746. return false
  747. }
  748. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  749. if (isHasFillFormal) {
  750. this.$message('您所选的条目有正在归档流程中,不可操作卷内顺序调整,请先确认!')
  751. return false
  752. }
  753. this.$nextTick(() => {
  754. this.$refs.fileSeqAdjustmentRef.titleAdjustment = '卷内顺序调整'
  755. this.$refs.fileSeqAdjustmentRef.isJuannei = true
  756. })
  757. } else {
  758. if (this.selections.length < 2) {
  759. this.$message('请选择多个' + (type === 'file' ? '文件' : '案卷') + '后进行操作!')
  760. return false
  761. }
  762. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  763. if (isHasFillFormal) {
  764. this.$message('您所选的条目有正在归档流程中,不可操作案卷/文件顺序调整,请先确认!')
  765. return false
  766. }
  767. this.$nextTick(() => {
  768. if (type === 'anjuan') {
  769. this.$refs.fileSeqAdjustmentRef.titleAdjustment = '案卷顺序调整'
  770. } else {
  771. this.$refs.fileSeqAdjustmentRef.titleAdjustment = '文件顺序调整'
  772. }
  773. this.$refs.fileSeqAdjustmentRef.isJuannei = false
  774. })
  775. }
  776. this.$nextTick(() => {
  777. this.$refs.fileSeqAdjustmentRef.getDoArchivesAdjust()
  778. })
  779. },
  780. // 档号更新
  781. handleFileNumberUpdate(type) {
  782. if (this.selections.length === 0) {
  783. this.$message('您还未勾选需要操作的条目,请先确认!')
  784. return false
  785. }
  786. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  787. if (isHasFillFormal) {
  788. this.$message('您所选的条目有正在归档流程中,不可操作档号更新,请先确认!')
  789. return false
  790. }
  791. this.$confirm('此操作将会自动重新生成档号' + '<span>你是否还要继续?</span>', '提示', {
  792. confirmButtonText: '继续',
  793. cancelButtonText: '取消',
  794. type: 'warning',
  795. dangerouslyUseHTMLString: true
  796. }).then(() => {
  797. // updateType 更新类别 1.档号更新 2.卷内档号更新
  798. let updateType
  799. if (type === 0) {
  800. updateType = 1
  801. } else {
  802. updateType = 2
  803. }
  804. const archivesIds = []
  805. this.selections.forEach(val => {
  806. archivesIds.push(val.id)
  807. })
  808. const params = {
  809. 'categoryId': this.selectedCategory.id,
  810. 'categoryLevel': this.collectLevel,
  811. 'archivesIds': archivesIds,
  812. 'updateType': updateType
  813. }
  814. FetchUpdateArchivesNo(params).then((res) => {
  815. if (res.code !== 500) {
  816. this.crud.notify('档号更新成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
  817. this.handleSearch(this.collectLevel)
  818. } else {
  819. this.crud.notify(res.message, CRUD.NOTIFICATION_TYPE.ERROR)
  820. }
  821. }).catch(err => {
  822. console.log(err)
  823. })
  824. }).catch(() => {
  825. })
  826. },
  827. // 拆卷
  828. handleUncoil() {
  829. if (this.selections.length === 0) {
  830. this.$message('您还未勾选需要操作的条目,请先确认!')
  831. return false
  832. }
  833. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  834. if (isHasFillFormal) {
  835. this.$message('您所选的条目有正在归档流程中,不可操作拆卷,请先确认!')
  836. return false
  837. }
  838. this.$confirm('拆卷之后,对应的案卷数据将会自动删除' + '<span>你是否还要继续?</span>', '提示', {
  839. confirmButtonText: '继续',
  840. cancelButtonText: '取消',
  841. type: 'warning',
  842. dangerouslyUseHTMLString: true
  843. }).then(() => {
  844. const archivesIds = []
  845. this.selections.forEach(val => {
  846. archivesIds.push(val.id)
  847. })
  848. const params = {
  849. 'categoryId': this.selectedCategory.id,
  850. 'archivesIds': archivesIds
  851. }
  852. FetchDisbandArchives(params).then((res) => {
  853. if (res.code !== 500) {
  854. this.crud.notify('拆卷成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
  855. this.handleSearch(this.collectLevel)
  856. } else {
  857. this.crud.notify('拆卷失败', CRUD.NOTIFICATION_TYPE.ERROR)
  858. }
  859. }).catch(err => {
  860. console.log(err)
  861. })
  862. }).catch(() => {
  863. })
  864. },
  865. // 合卷
  866. handleCombineFile() {
  867. if (this.selections.length < 2) {
  868. this.$message('合卷操作至少勾选2个案卷,请重试!')
  869. return false
  870. }
  871. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  872. if (isHasFillFormal) {
  873. this.$message('您所选的条目有正在归档流程中,不可操作合卷,请先确认!')
  874. return false
  875. }
  876. this.$refs.combineFileRef.getTargetList()
  877. },
  878. // 插件
  879. handleInsertFile() {
  880. if (this.collectLevel === 3) {
  881. if (this.selections.length === 0) {
  882. this.$confirm('您未勾选条目,否则直接选择所有条目' + '<span>你是否还要继续?</span>', '提示', {
  883. confirmButtonText: '继续',
  884. cancelButtonText: '取消',
  885. type: 'warning',
  886. dangerouslyUseHTMLString: true
  887. }).then(() => {
  888. this.$refs.insertFileRef.fileNoSelectionData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
  889. this.$refs.insertFileRef.getInsertViewTable()
  890. }).catch(() => {
  891. })
  892. } else {
  893. this.$refs.insertFileRef.getInsertViewTable()
  894. }
  895. } else {
  896. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  897. if (this.selections.length !== 1) {
  898. this.$message('插卷操作只可勾选唯一目标条目,请先确认!')
  899. return false
  900. } else if (isHasFillFormal) {
  901. this.$message('您所选的条目有正在归档流程中,不可操作插件,请先确认!')
  902. return false
  903. } else {
  904. this.$refs.insertFileRef.getInsertViewTable()
  905. }
  906. }
  907. },
  908. // 移动
  909. handleCollectMoveFile() {
  910. if (this.selections.length === 0) {
  911. this.$message('您还未勾选需要操作的条目,请先确认!')
  912. return false
  913. }
  914. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  915. if (isHasFillFormal) {
  916. this.$message('您所选的条目有正在归档流程中,不可操作移动,请先确认!')
  917. return false
  918. }
  919. this.$refs.collectMoveFileRef.collectMoveFileVisible = true
  920. },
  921. // 归档
  922. handleFiling() {
  923. if (this.selections.length === 0) {
  924. this.$message('您还未勾选需要操作的条目,请先确认!')
  925. return false
  926. }
  927. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  928. if (isHasFillFormal) {
  929. this.$message('您所选的条目有正在归档流程中,勿重复操作,请先确认!!')
  930. return false
  931. }
  932. this.$refs.archivesFillingRef.archivesFillingVisible = true
  933. },
  934. // 退回预归档库
  935. handleReturn() {
  936. if (this.selections.length === 0) {
  937. this.$message('您还未勾选需要操作的条目,请先确认!')
  938. return false
  939. }
  940. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  941. if (isHasFillFormal) {
  942. this.$message('您所选的条目有正在归档流程中,不可操作退回预归档库,请先确认!!')
  943. return false
  944. }
  945. this.$confirm('此操作将把会所选条目退回到预归档库' + '<span>你是否还要继续?</span>', '提示', {
  946. confirmButtonText: '继续',
  947. cancelButtonText: '取消',
  948. type: 'warning',
  949. dangerouslyUseHTMLString: true
  950. }).then(() => {
  951. const archivesIds = this.selections.map(item => item.id)
  952. const params = {
  953. 'categoryId': this.selectedCategory.id,
  954. 'archivesIds': archivesIds
  955. }
  956. FetchReturnReDocument(params).then((res) => {
  957. if (res.code !== 500) {
  958. if (res === 0) {
  959. this.crud.notify('当前数据中不包含预归档数据,无法返回', CRUD.NOTIFICATION_TYPE.INFO)
  960. } else {
  961. this.crud.notify('已成功返回' + res + '条来自预归档的数据', CRUD.NOTIFICATION_TYPE.SUCCESS)
  962. }
  963. this.handleSearch(this.collectLevel)
  964. } else {
  965. this.crud.notify(res.message, CRUD.NOTIFICATION_TYPE.ERROR)
  966. }
  967. }).catch(err => {
  968. console.log(err)
  969. })
  970. }).catch(() => {
  971. })
  972. },
  973. // 导出
  974. handleExport() {
  975. if (this.selections.length === 0) {
  976. this.$message('您还未勾选需要操作的条目,请先确认!')
  977. return false
  978. }
  979. this.$confirm('此操作将导出所选数据' + '<span>你是否还要继续?</span>', '提示', {
  980. confirmButtonText: '继续',
  981. cancelButtonText: '取消',
  982. type: 'warning',
  983. dangerouslyUseHTMLString: true
  984. }).then(() => {
  985. const archivesIds = []
  986. this.selections.forEach(val => {
  987. archivesIds.push(val.id)
  988. })
  989. const params = {
  990. 'categoryId': this.selectedCategory.id,
  991. 'categoryLevel': this.collectLevel,
  992. 'archivesIds': archivesIds
  993. }
  994. exportFile(this.baseApi + '/api/collect/exportDate?' + qs.stringify(params, { indices: false }))
  995. }).catch(() => {
  996. })
  997. },
  998. // 打印
  999. handlePrint() {
  1000. if (this.selections.length === 0) {
  1001. this.$refs.printRef.form.printRange = '当页条目'
  1002. let currentTableData = []
  1003. if (this.collectLevel === 2) {
  1004. currentTableData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
  1005. } else if (this.collectLevel === 3) {
  1006. if (this.isTitleType === 3) {
  1007. currentTableData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
  1008. } else {
  1009. currentTableData = this.parentsData.$refs.juanneiEle.junneiData
  1010. }
  1011. }
  1012. this.$refs.printRef.currentTable = JSON.parse(JSON.stringify(currentTableData))
  1013. } else {
  1014. this.$refs.printRef.form.printRange = '勾选条目'
  1015. }
  1016. this.$refs.printRef.printVisible = true
  1017. },
  1018. // 四性检测
  1019. handleFourTest() {
  1020. if (this.selections.length === 0) {
  1021. this.$message('您还未勾选需要操作的条目,请先确认!')
  1022. return false
  1023. }
  1024. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1025. if (isHasFillFormal) {
  1026. this.$message('您所选的条目有正在归档流程中,不可操作四性检测,请先确认!')
  1027. return false
  1028. }
  1029. this.$refs.fourTestRef.fourTestVisible = true
  1030. this.$refs.fourTestRef.tableData = this.selections
  1031. },
  1032. // 目录下载
  1033. handleCatalogDownload() {
  1034. if (this.selections.length === 0) {
  1035. this.$message('您还未勾选需要操作的条目,请先确认!')
  1036. return false
  1037. }
  1038. this.$confirm('此操作将下载所选条目目录' + '<span>你是否还要继续?</span>', '提示', {
  1039. confirmButtonText: '继续',
  1040. cancelButtonText: '取消',
  1041. type: 'warning',
  1042. dangerouslyUseHTMLString: true
  1043. }).then(() => {
  1044. const archivesIds = []
  1045. this.selections.forEach(val => {
  1046. archivesIds.push(val.id)
  1047. })
  1048. const params = {
  1049. 'categoryId': this.selectedCategory.id,
  1050. 'categoryLevel': this.collectLevel,
  1051. 'archivesIds': archivesIds
  1052. }
  1053. exportFile(this.baseApi + '/api/collect/catalogDownload?' + qs.stringify(params, { indices: false }))
  1054. }).catch(() => {
  1055. })
  1056. },
  1057. // 快速组卷
  1058. handleQuickPaper() {
  1059. this.$refs.quickPaperRef.quickVisible = true
  1060. },
  1061. // 手工组卷
  1062. handlePaper() {
  1063. if (this.selections.length === 0) {
  1064. this.$message('您还未勾选需要操作的条目,请先确认!')
  1065. return false
  1066. }
  1067. this.quickPaperArcId = this.selections.map(item => item.id)
  1068. this.handleForm('add', 1)
  1069. },
  1070. // 原文内的附件下载
  1071. handleOriginalDownload() {
  1072. if (this.selections.length > 1 || this.selections.length === 0) {
  1073. this.$message('下载操作只可勾选唯一目标条目,请先确认!')
  1074. return false
  1075. }
  1076. const url = this.baseApi + '/downloadFile' + this.selections[0].file_path
  1077. fetch(url).then(res => res.blob()).then(blob => {
  1078. downloadFile(blob, this.selections[0].file_name.split('.')[0], this.selections[0].file_type)
  1079. }).catch(() => {
  1080. this.$message.error('下载文件失败!')
  1081. })
  1082. },
  1083. // 回收站 - 恢复
  1084. toRecover() {
  1085. if (this.selections.length === 0) {
  1086. this.$message('您还未勾选需要操作的条目,请先确认!')
  1087. return false
  1088. }
  1089. this.$confirm('此恢复将会把所选条目及其子集一并恢复' + '<span>你是否还要继续?</span>', '提示', {
  1090. confirmButtonText: '继续',
  1091. cancelButtonText: '取消',
  1092. type: 'warning',
  1093. dangerouslyUseHTMLString: true
  1094. }).then(() => {
  1095. const archivesIds = []
  1096. this.selections.forEach(val => {
  1097. archivesIds.push(val.id)
  1098. })
  1099. const params = {
  1100. 'categoryId': this.selectedCategory.id,
  1101. 'categoryLevel': this.collectLevel,
  1102. 'archivesIds': archivesIds
  1103. }
  1104. FetchRestoreArchives(params).then((res) => {
  1105. if (res.code !== 500) {
  1106. console.log(res)
  1107. this.crud.notify(res, CRUD.NOTIFICATION_TYPE.SUCCESS)
  1108. this.handleSearch(this.collectLevel)
  1109. } else {
  1110. this.crud.notify('回复所选档案失败', CRUD.NOTIFICATION_TYPE.ERROR)
  1111. }
  1112. }).catch(err => {
  1113. console.log(err)
  1114. })
  1115. }).catch(() => {
  1116. })
  1117. },
  1118. // 回收站 - 彻底删除
  1119. toCompletelyDelete() {
  1120. if (this.selections.length === 0) {
  1121. this.$message('您还未勾选需要操作的条目,请先确认!')
  1122. return false
  1123. }
  1124. this.$confirm('此删除将把会所选条目与其子集彻底删除' + '<span>你是否还要继续?</span>', '提示', {
  1125. confirmButtonText: '继续',
  1126. cancelButtonText: '取消',
  1127. type: 'warning',
  1128. dangerouslyUseHTMLString: true
  1129. }).then(() => {
  1130. const archivesIds = []
  1131. this.selections.forEach(val => {
  1132. archivesIds.push(val.id)
  1133. })
  1134. const params = {
  1135. 'categoryId': this.selectedCategory.id,
  1136. 'categoryLevel': this.collectLevel,
  1137. 'archivesIds': archivesIds
  1138. }
  1139. FetchCompleteDelArchives(params).then((res) => {
  1140. if (res.code !== 500) {
  1141. this.crud.notify(res, CRUD.NOTIFICATION_TYPE.SUCCESS)
  1142. this.handleSearch(this.collectLevel)
  1143. } else {
  1144. this.crud.notify('删除所选档案失败', CRUD.NOTIFICATION_TYPE.ERROR)
  1145. }
  1146. }).catch(err => {
  1147. console.log(err)
  1148. })
  1149. }).catch(() => {
  1150. })
  1151. },
  1152. closeDialog(data) {
  1153. this.formVisible = false
  1154. setTimeout(() => {
  1155. this.handleSearch(this.collectLevel)
  1156. })
  1157. }
  1158. }
  1159. }
  1160. </script>
  1161. <style lang='scss' scoped>
  1162. </style>