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

879 lines
31 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
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 contorl-header">
  4. <h4 :class="classType">{{ collectTitle }} </h4>
  5. <div class="collect-filter">
  6. <el-select
  7. v-if="isTitleType !== 6 && isTitleType !== 2"
  8. v-model="selectStatus"
  9. multiple
  10. collapse-tags
  11. style="margin-right: 10px; width: 160px;"
  12. placeholder="请选择"
  13. @change="handleSearch(collectLevel)"
  14. >
  15. <el-option-group
  16. v-for="group in statusOptions"
  17. v-show="!(selectedCategory.arrangeType === 2 && isTitleType===3 && (group.label === '标签状态' || group.label === '借阅状态'))"
  18. :key="group.label"
  19. :label="group.label"
  20. >
  21. <el-option
  22. v-for="item in group.options"
  23. :key="item.value"
  24. :label="item.label"
  25. :value="item.value"
  26. />
  27. </el-option-group>
  28. </el-select>
  29. <treeselect
  30. v-if="selectedCategory.arrangeType === 3 && isTitleType !== 4 && isTitleType !== 6"
  31. v-model="query.project_class"
  32. :options="projectOptions"
  33. style="width: 160px;"
  34. flat
  35. :multiple="false"
  36. :normalizer="normalizerProject"
  37. placeholder="请选择"
  38. @input="handleSearch(collectLevel)"
  39. @select="handleSearch(collectLevel)"
  40. />
  41. <treeselect
  42. v-if="isTitleType !== 6"
  43. v-model="query.archive_ctg_no"
  44. :options="classifyOptions"
  45. style="width: 160px;"
  46. flat
  47. :multiple="false"
  48. :normalizer="normalizer"
  49. placeholder="请选择档案分类"
  50. @input="handleSearch(collectLevel)"
  51. @select="handleSearch(collectLevel)"
  52. />
  53. </div>
  54. <div v-if="isTitleType !== 6" class="head-search">
  55. <!-- 搜索 -->
  56. <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)" />
  57. <el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="handleSearch(collectLevel)">搜索</el-button>
  58. <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
  59. </div>
  60. <div v-if="!isRecycle" class="collect-menu">
  61. <el-menu
  62. :default-active="activeMenuIndex"
  63. mode="horizontal"
  64. @select="handleSelect"
  65. >
  66. <el-submenu v-if="isTitleType !== 6" index="1">
  67. <template slot="title">
  68. <i class="iconfont icon-changgui" />
  69. <span>常规</span>
  70. </template>
  71. <el-menu-item-group class="collect-submenu-group">
  72. <el-menu-item v-if="isTitleType !== 6" index="1-1" @click="handleForm('edit')">编辑</el-menu-item>
  73. </el-menu-item-group>
  74. </el-submenu>
  75. <el-submenu v-if="selectedCategory.isType === 2 && isTitleType !==4 && isTitleType !== 6" index="2">
  76. <template slot="title">
  77. <i class="iconfont icon-zhengli" />
  78. <span>整理</span>
  79. </template>
  80. <el-menu-item-group class="collect-submenu-group">
  81. <el-menu-item v-if="isTitleType === 3" index="2-1" @click="bindingTag(selections)">标签绑定</el-menu-item>
  82. <el-menu-item-group v-if="isTitleType === 3" class="collect-submenu-group submenu-tree">
  83. <template slot="title">档案装盒</template>
  84. <el-menu-item index="2-2" @click="handlePackingBox(0)">装盒</el-menu-item>
  85. <el-menu-item v-if="selectedCategory.arrangeType !== 1" index="2-3" @click="handlePackingBox(1)">分卷装盒</el-menu-item>
  86. </el-menu-item-group>
  87. <el-menu-item-group v-if="selectedCategory.isType === 2" class="collect-submenu-group submenu-tree">
  88. <template slot="title">档案移交</template>
  89. <el-menu-item index="2-4" @click="handleOnlineHandover">在线移交</el-menu-item>
  90. <el-menu-item index="2-5" @click="handleOffLineHandover">离线移交</el-menu-item>
  91. </el-menu-item-group>
  92. <!-- <el-menu-item v-if="selectedCategory.isType === 2" index="2-6" @click="handleExportZip">导出ZIP包</el-menu-item> -->
  93. <el-menu-item v-if="selectedCategory.arrangeType !== 3" index="2-7" @click="handleArcReturn">档案退回</el-menu-item>
  94. <el-menu-item v-if="isTitleType === 3 " index="2-8" @click="handleJD(0)">开放审核</el-menu-item>
  95. <el-menu-item v-if="isTitleType === 3 " index="2-9" @click="handleJD(1)">销毁鉴定</el-menu-item>
  96. </el-menu-item-group>
  97. </el-submenu>
  98. <el-submenu v-if="isTitleType !== 6" index="3">
  99. <template slot="title">
  100. <i class="iconfont icon-gengduo" />
  101. <span>更多</span>
  102. </template>
  103. <el-menu-item-group class="collect-submenu-group">
  104. <el-menu-item v-if="isTitleType !== 6" index="3-1" @click="handleExport">导出</el-menu-item>
  105. <el-menu-item v-if="isTitleType === 3" index="3-2" @click="handlePrint">打印</el-menu-item>
  106. <el-menu-item v-if="isTitleType === 6" index="3-3" @click="handleOriginalDownload">下载</el-menu-item>
  107. </el-menu-item-group>
  108. </el-submenu>
  109. </el-menu>
  110. </div>
  111. <div v-if="isRecycle && (isTitleType === 2 || (isTitleType === 3 && selectedCategory.arrangeType !== 3))" class="collect-menu">
  112. <el-button class="filter-item" size="mini" type="success" @click="toRecover"><i class="iconfont icon-huifu" />恢复</el-button>
  113. <el-button class="filter-item" size="mini" type="success" @click="toCompletelyDelete"><i class="iconfont icon-shanchu" />彻底删除</el-button>
  114. <el-button class="filter-item" size="mini" type="success" :disabled="selections.length === 0" @click="handleExport"><i class="iconfont icon-daochu" />导出</el-button>
  115. </div>
  116. <!--新增 / 编辑 表单组件-->
  117. <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">
  118. <span class="dialog-right-top" />
  119. <span class="dialog-left-bottom" />
  120. <div class="setting-dialog">
  121. <PreviewForm
  122. v-if="formPreviewData.length"
  123. ref="previewForm"
  124. :is-has-code="true"
  125. :is-disabled="false"
  126. :form-preview-data.sync="formPreviewData"
  127. :selected-category="selectedCategory"
  128. :arc-id="arcId"
  129. :is-des-form-type="isDesFormType"
  130. :is-title-type="isTitleType"
  131. :collect-level="collectLevel"
  132. @close-dialog="closeDialog"
  133. />
  134. <div slot="footer" class="dialog-footer">
  135. <el-button type="primary" @click="handlerArchivesSubmit">保存</el-button>
  136. </div>
  137. </div>
  138. </el-dialog>
  139. <!-- 绑定标签 -->
  140. <binding-tag-dlg ref="bindingTag" :binding-id="selections[0] && selections[0].id" :binding-type="1" binding-txt="档案" @close-dialog="closeDialog" />
  141. <!-- 装盒 / 分卷装盒 -->
  142. <PackingBox ref="packingBox" :selected-category="selectedCategory" :selections="selections" :total-sum-all="totalSumAll" @close-dialog="closeDialog" />
  143. <!-- 在线移交 -->
  144. <OnlineHandover ref="onlineHandover" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" :total-sum-all="totalSumAll" @close-dialog="closeDialog" />
  145. <!-- 离线移交 -->
  146. <OffLineHandover ref="offLineHandover" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" :total-sum-all="totalSumAll" @close-dialog="closeDialog" />
  147. <!-- 导出zip -->
  148. <ExportZip ref="exportZip" :selected-category="selectedCategory" :selections="selections" @close-dialog="closeDialog" />
  149. <!-- 开放审核 / 销毁鉴定 -->
  150. <HandOverForm ref="formModule" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  151. <!-- 打印 -->
  152. <Print ref="printRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  153. </div>
  154. <div style="display: flex; justify-content: space-between; height: 30px; line-height: 30px; padding: 0 10px; ">
  155. <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>
  156. <div v-if="isTitleType !== 2 && !isRecycle && isTitleType !== 6" class="mangement-fixed-top">
  157. <el-checkbox v-model="parentsData.fixedStatusBar" @change="statusBarChecked">隐藏状态栏</el-checkbox>
  158. </div>
  159. </div>
  160. </div>
  161. </template>
  162. <script>
  163. import CRUD, { crud } from '@crud/crud'
  164. import { manageLibraryCrud } from '../mixins/index'
  165. import { FetchInitCategoryInputFieldByPid } from '@/api/system/category/category'
  166. import { FetchDetailsById, FetchCompleteDelArchives, FetchRestoreArchives } from '@/api/collect/collect'
  167. import { FetchArchivesClassTree } from '@/api/system/archivesClass'
  168. import { FetchDictionaryTree } from '@/api/system/dict'
  169. import Treeselect from '@riophae/vue-treeselect'
  170. import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  171. import PreviewForm from '@/views/components/category/PreviewForm'
  172. import Print from './print/index'
  173. import BindingTagDlg from '@/views/components/BindingTagDlg'
  174. import PackingBox from './packingBox/index'
  175. import OnlineHandover from './onlineHandover/index'
  176. import OffLineHandover from './offLineHandover/index'
  177. import ExportZip from './exportZip/index'
  178. import HandOverForm from './handOverForm'
  179. import qs from 'qs'
  180. import { downloadFile, exportFile } from '@/utils/index'
  181. import { mapGetters } from 'vuex'
  182. export default {
  183. name: 'CollectHeader',
  184. components: { Treeselect, PreviewForm, BindingTagDlg, Print, PackingBox, OnlineHandover, OffLineHandover, ExportZip, HandOverForm },
  185. mixins: [manageLibraryCrud, crud()],
  186. props: {
  187. selectedCategory: {
  188. type: Object,
  189. default: function() {
  190. return {}
  191. }
  192. },
  193. isTitleType: {
  194. type: Number,
  195. default: 2
  196. },
  197. test: {
  198. type: String,
  199. default: function() {
  200. return ''
  201. }
  202. },
  203. isRecycle: {
  204. type: Boolean,
  205. default: false
  206. },
  207. selections: {
  208. type: Array,
  209. default: function() {
  210. return []
  211. }
  212. }
  213. },
  214. inject: ['parentsData'],
  215. data() {
  216. return {
  217. statusOptions: [
  218. {
  219. label: '标签状态',
  220. options: [
  221. {
  222. value: 1,
  223. label: '未绑定'
  224. },
  225. {
  226. value: 2,
  227. label: '已绑定'
  228. }
  229. ]
  230. },
  231. {
  232. label: '装盒状态',
  233. options: [
  234. {
  235. value: 3,
  236. label: '未装盒'
  237. },
  238. {
  239. value: 4,
  240. label: '已装盒'
  241. }
  242. ]
  243. },
  244. {
  245. label: '入库状态',
  246. options: [
  247. {
  248. value: 5,
  249. label: '未入库'
  250. },
  251. {
  252. value: 6,
  253. label: '待入库'
  254. },
  255. {
  256. value: 7,
  257. label: '待出库'
  258. },
  259. {
  260. value: 8,
  261. label: '已入库'
  262. }
  263. ]
  264. },
  265. {
  266. label: '借阅状态',
  267. options: [
  268. {
  269. value: 9,
  270. label: '实体在库'
  271. },
  272. {
  273. value: 10,
  274. label: '实体待借'
  275. },
  276. {
  277. value: 11,
  278. label: '实体已借'
  279. }
  280. ]
  281. },
  282. {
  283. label: '实体状态',
  284. options: [
  285. {
  286. value: 12,
  287. label: '无实体'
  288. },
  289. {
  290. value: 13,
  291. label: '有实体'
  292. }
  293. ]
  294. },
  295. {
  296. label: '开放状态',
  297. options: [
  298. {
  299. value: 14,
  300. label: '未开放'
  301. },
  302. {
  303. value: 15,
  304. label: '已开放'
  305. }
  306. ]
  307. },
  308. {
  309. label: '审批锁定',
  310. options: [
  311. {
  312. value: 16,
  313. label: '空闲'
  314. },
  315. {
  316. value: 17,
  317. label: '退回'
  318. },
  319. {
  320. value: 18,
  321. label: '开放'
  322. },
  323. {
  324. value: 19,
  325. label: '销毁'
  326. }, {
  327. value: 20,
  328. label: '利用'
  329. }, {
  330. value: 21,
  331. label: '内部移交'
  332. }, {
  333. value: 22,
  334. label: '外部移交'
  335. }
  336. ]
  337. }
  338. ],
  339. selectStatus: null,
  340. activeMenuIndex: '1',
  341. formVisible: false,
  342. formTitle: '项目',
  343. formPreviewData: [], // 预览界面data
  344. projectOptions: [],
  345. classifyOptions: [],
  346. isDesFormType: 'manageArcives', // 区分是门类得还是档案得
  347. arcId: null,
  348. totalSumAll: 0
  349. }
  350. },
  351. computed: {
  352. ...mapGetters([
  353. 'baseApi'
  354. ]),
  355. collectTitle() {
  356. if (this.isTitleType === 2) {
  357. return '项目'
  358. } else if (this.isTitleType === 3) {
  359. if (this.selectedCategory.arrangeType === 1) {
  360. return '文件'
  361. } else {
  362. return '案卷'
  363. }
  364. } else if (this.isTitleType === 4) {
  365. return '卷内'
  366. } else if (this.isTitleType === 6) {
  367. return '原文'
  368. }
  369. return ''
  370. },
  371. collectLevel() {
  372. if (this.isTitleType === 2) {
  373. return 1
  374. } else if (this.isTitleType === 3) {
  375. if (this.selectedCategory.arrangeType === 1) {
  376. return 3
  377. } else {
  378. return 2
  379. }
  380. } else if (this.isTitleType === 4) {
  381. return 3
  382. } else if (this.isTitleType === 6) {
  383. return 4
  384. }
  385. return null
  386. },
  387. classType() {
  388. if (this.isTitleType === 2) {
  389. return ''
  390. } else if (this.isTitleType === 3) {
  391. return 'is-anjuan'
  392. } else if (this.isTitleType === 4) {
  393. return 'is-juannei'
  394. } else if (this.isTitleType === 6) {
  395. return 'is-file'
  396. }
  397. return ''
  398. },
  399. placeholderType() {
  400. if (this.isTitleType === 2) {
  401. return '输入项目名称或编号搜索'
  402. } else if (this.isTitleType === 3 || this.isTitleType === 4) {
  403. return '输入题名或档号搜索'
  404. }
  405. return '输入项目名称或编号搜索'
  406. }
  407. },
  408. created() {
  409. },
  410. mounted() {
  411. this.getInitArchivesClass()
  412. this.getDictsList()
  413. if (localStorage.getItem('statusBarFixedType') !== 'undefined') {
  414. this.parentsData.fixedStatusBar = JSON.parse(localStorage.getItem('statusBarFixedType')) === true
  415. }
  416. },
  417. methods: {
  418. resetQuery() {
  419. this.selectStatus = []
  420. this.query = {
  421. 'search': null,
  422. 'project_class': null,
  423. 'archive_ctg_no': null
  424. }
  425. this.handleSearch(this.collectLevel)
  426. },
  427. // 筛选 - 档案分类
  428. getInitArchivesClass() {
  429. this.classifyOptions = []
  430. this.query = {
  431. 'search': null,
  432. 'project_class': null,
  433. 'archive_ctg_no': null
  434. }
  435. const params = {
  436. 'categoryId': this.selectedCategory.id
  437. }
  438. FetchArchivesClassTree(params).then((res) => {
  439. this.classifyOptions = JSON.parse(JSON.stringify(res))
  440. }).catch(err => {
  441. console.log(err)
  442. })
  443. },
  444. normalizer(node) {
  445. if (node.childArchivesClass === null) {
  446. delete node.childArchivesClass
  447. }
  448. return {
  449. id: node.code,
  450. label: node.name,
  451. children: node.childArchivesClass
  452. }
  453. },
  454. // 项目级别 - 阶段分类
  455. getDictsList() {
  456. this.projectOptions = []
  457. FetchDictionaryTree().then((res) => {
  458. const filterCodes = ['project_class']
  459. let filteredItems = JSON.parse(JSON.stringify(res)).filter(item => filterCodes.includes(item.dictionaryCode))
  460. filteredItems = this.addLevelToDictionaryList(filteredItems, 1)
  461. if (this.selectedCategory.arrangeType === 3 && this.isTitleType === 3) {
  462. this.projectOptions = filteredItems
  463. // console.log(this.projectOptions)
  464. } else {
  465. this.projectOptions = this.filterData(filteredItems, filteredItems[0].id)
  466. }
  467. }).catch(err => {
  468. console.log(err)
  469. })
  470. },
  471. // 显示第一级和第二级
  472. filterData(data, targetId) {
  473. return data.filter(item => {
  474. if (item.id === targetId || item.dictionaryParents === targetId) {
  475. if (item.childDictionarys && item.childDictionarys.length > 0) {
  476. item.childDictionarys = this.filterData(item.childDictionarys, targetId)
  477. }
  478. return true
  479. }
  480. return false
  481. })
  482. },
  483. // 给筛选出来的数据加level 方便后面是否可点击
  484. addLevelToDictionaryList(dictionaryList, level) {
  485. dictionaryList.forEach(dictionary => {
  486. dictionary.level = level
  487. if (dictionary.childDictionarys) {
  488. dictionary.childDictionarys = this.addLevelToDictionaryList(dictionary.childDictionarys, level + 1)
  489. }
  490. })
  491. return dictionaryList
  492. },
  493. normalizerProject(node) {
  494. if ((node.childDictionarys && !node.childDictionarys.length) || node.childDictionarys === null) {
  495. delete node.childDictionarys
  496. }
  497. return {
  498. id: node.dictionaryName,
  499. label: node.dictionaryName,
  500. children: node.childDictionarys,
  501. isDisabled: this.isTitleType === 3 ? node.level !== 3 : node.level === 1
  502. }
  503. },
  504. handleSelect(key, keyPath) {
  505. console.log(key, keyPath)
  506. },
  507. // 著录界面-form/详情-api
  508. handleForm(type) {
  509. if (type === 'add') {
  510. this.formTitle = '新增' + this.collectTitle
  511. this.arcId = null
  512. } else if (type === 'edit') {
  513. console.log(this.selections)
  514. if (this.selections.length === 0) {
  515. this.$message('您还未勾选需要操作的条目,请先确认!')
  516. return false
  517. } else if (this.selections.length > 1) {
  518. this.$message('编辑操作只可勾选唯一目标条目,请先确认!')
  519. return false
  520. }
  521. this.arcId = this.selections[0].id
  522. this.formTitle = '编辑' + this.collectTitle
  523. }
  524. // this.form.dictionaryConfigId = {}
  525. // this.formPreviewData = []
  526. // 档案预编辑获取字段
  527. this.formVisible = true
  528. this.$nextTick(() => {
  529. this.getFormInfo(type)
  530. })
  531. },
  532. getFormInfo(type) {
  533. if (type === 'edit') {
  534. const params = {
  535. 'categoryId': this.selectedCategory.id,
  536. 'categoryLevel': this.collectLevel,
  537. 'id': this.arcId
  538. }
  539. FetchDetailsById(params).then(data => {
  540. // const showFiledAll = data.showFiled.filter(item => item.isSequence).sort((a, b) => a.isSequence - b.isSequence)
  541. const showFiledAll = data.showFiled
  542. this.$nextTick(() => {
  543. this.formPreviewData = showFiledAll
  544. this.isDesFormType = 'manageArcives'
  545. this.$nextTick(() => {
  546. this.$refs.previewForm.archivesType = 'edit'
  547. this.$refs.previewForm.addOrUpdateForm = data.echo
  548. this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
  549. })
  550. })
  551. })
  552. } else {
  553. const params = {
  554. 'categoryId': this.selectedCategory.id,
  555. 'categoryLevel': this.collectLevel
  556. }
  557. FetchInitCategoryInputFieldByPid(params).then(data => {
  558. this.formPreviewData = data
  559. this.isDesFormType = 'manageArcives'
  560. this.$nextTick(() => {
  561. this.$refs.previewForm.archivesType = 'add'
  562. this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
  563. })
  564. })
  565. }
  566. },
  567. // form - submit
  568. handlerArchivesSubmit() {
  569. this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id,)
  570. },
  571. handleClose(done) {
  572. this.formVisible = false
  573. done()
  574. },
  575. // 绑定标签
  576. bindingTag(data) {
  577. if (this.selections.length === 0) {
  578. this.$message('您还未勾选需要操作的条目,请先确认!')
  579. return false
  580. }
  581. if (this.selections.length > 1) {
  582. this.$message('只可勾选唯一目标条目,请先确认!')
  583. return false
  584. }
  585. if (data[0].tid) {
  586. // this.$refs.bindingTag.isBinding = true
  587. this.$refs.bindingTag.tidCode = data[0].tid
  588. this.$confirm('当前标签已被绑定,是否覆盖' + '<span>你是否还要继续?</span>', '提示', {
  589. confirmButtonText: '继续',
  590. cancelButtonText: '取消',
  591. type: 'warning',
  592. dangerouslyUseHTMLString: true
  593. }).then(() => {
  594. this.$refs.bindingTag.bindingVisible = true
  595. this.$refs.bindingTag.opened()
  596. }).catch(() => {
  597. })
  598. } else {
  599. this.$refs.bindingTag.bindingVisible = true
  600. }
  601. },
  602. // 导出
  603. handleExport() {
  604. if (this.selections.length === 0) {
  605. this.$message('您还未勾选需要操作的条目,请先确认!')
  606. return false
  607. }
  608. this.$confirm('此操作将导出所选数据' + '<span>你是否还要继续?</span>', '提示', {
  609. confirmButtonText: '继续',
  610. cancelButtonText: '取消',
  611. type: 'warning',
  612. dangerouslyUseHTMLString: true
  613. }).then(() => {
  614. const archivesIds = []
  615. this.selections.forEach(val => {
  616. archivesIds.push(val.id)
  617. })
  618. const params = {
  619. 'categoryId': this.selectedCategory.id,
  620. 'categoryLevel': this.collectLevel,
  621. 'archivesIds': archivesIds
  622. }
  623. exportFile(this.baseApi + '/api/control/exportDate?' + qs.stringify(params, { indices: false }))
  624. }).catch(() => {
  625. })
  626. },
  627. // 打印
  628. handlePrint() {
  629. if (this.selections.length === 0) {
  630. this.$refs.printRef.form.printRange = '当页条目'
  631. let currentTableData = []
  632. if (this.collectLevel === 2) {
  633. currentTableData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
  634. } else if (this.collectLevel === 3) {
  635. if (this.isTitleType === 3) {
  636. currentTableData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
  637. } else {
  638. currentTableData = this.parentsData.$refs.juanneiEle.junneiData
  639. }
  640. }
  641. this.$refs.printRef.currentTable = JSON.parse(JSON.stringify(currentTableData))
  642. } else {
  643. this.$refs.printRef.form.printRange = '勾选条目'
  644. }
  645. this.$refs.printRef.printVisible = true
  646. },
  647. // 原文内的附件下载
  648. handleOriginalDownload() {
  649. if (this.selections.length > 1 || this.selections.length === 0) {
  650. this.$message('下载操作只可勾选唯一目标条目,请先确认!')
  651. return false
  652. }
  653. const url = this.baseApi + '/downloadFile' + this.selections[0].file_path
  654. fetch(url).then(res => res.blob()).then(blob => {
  655. downloadFile(blob, this.selections[0].file_name.split('.')[0], this.selections[0].file_type)
  656. }).catch(() => {
  657. this.$message.error('下载文件失败!')
  658. })
  659. },
  660. // 回收站 - 恢复
  661. toRecover() {
  662. if (this.selections.length === 0) {
  663. this.$message('您还未勾选需要操作的条目,请先确认!')
  664. return false
  665. }
  666. this.$confirm('此恢复将会把所选条目及其子集一并恢复' + '<span>你是否还要继续?</span>', '提示', {
  667. confirmButtonText: '继续',
  668. cancelButtonText: '取消',
  669. type: 'warning',
  670. dangerouslyUseHTMLString: true
  671. }).then(() => {
  672. const archivesIds = []
  673. this.selections.forEach(val => {
  674. archivesIds.push(val.id)
  675. })
  676. const params = {
  677. 'categoryId': this.selectedCategory.id,
  678. 'categoryLevel': this.collectLevel,
  679. 'archivesIds': archivesIds
  680. }
  681. FetchRestoreArchives(params).then((res) => {
  682. if (res.code !== 500) {
  683. console.log(res)
  684. this.crud.notify(res, CRUD.NOTIFICATION_TYPE.SUCCESS)
  685. this.handleSearch(this.collectLevel)
  686. } else {
  687. this.crud.notify('回复所选档案失败', CRUD.NOTIFICATION_TYPE.ERROR)
  688. }
  689. }).catch(err => {
  690. console.log(err)
  691. })
  692. }).catch(() => {
  693. })
  694. },
  695. // 回收站 - 彻底删除
  696. toCompletelyDelete() {
  697. if (this.selections.length === 0) {
  698. this.$message('您还未勾选需要操作的条目,请先确认!')
  699. return false
  700. }
  701. this.$confirm('此删除将把会所选条目与其子集彻底删除' + '<span>你是否还要继续?</span>', '提示', {
  702. confirmButtonText: '继续',
  703. cancelButtonText: '取消',
  704. type: 'warning',
  705. dangerouslyUseHTMLString: true
  706. }).then(() => {
  707. const archivesIds = []
  708. this.selections.forEach(val => {
  709. archivesIds.push(val.id)
  710. })
  711. const params = {
  712. 'categoryId': this.selectedCategory.id,
  713. 'categoryLevel': this.collectLevel,
  714. 'archivesIds': archivesIds
  715. }
  716. FetchCompleteDelArchives(params).then((res) => {
  717. if (res.code !== 500) {
  718. this.crud.notify(res, CRUD.NOTIFICATION_TYPE.SUCCESS)
  719. this.handleSearch(this.collectLevel)
  720. } else {
  721. this.crud.notify('删除所选档案失败', CRUD.NOTIFICATION_TYPE.ERROR)
  722. }
  723. }).catch(err => {
  724. console.log(err)
  725. })
  726. }).catch(() => {
  727. })
  728. },
  729. // 装盒 / 分卷装盒
  730. handlePackingBox(type) {
  731. if (this.selections.length === 0) {
  732. this.$message('您还未勾选需要操作的条目,请先确认!')
  733. return false
  734. }
  735. if (this.selectedCategory.arrangeType === 2) {
  736. if (this.selections.length > 1) {
  737. this.$message('只可勾选唯一目标条目,请先确认!')
  738. return false
  739. }
  740. if (this.selections[0].child === 0) {
  741. this.$message.error('当前选中的档案无相关卷内文件,不可装盒!')
  742. return
  743. }
  744. }
  745. if (this.selections[0].case_no) {
  746. this.$message.error('当前档案已装盒,请勿重复操作!')
  747. return
  748. }
  749. // 后面与后端对接确定字段name
  750. // const existsNotEmpty = this.selections.some(item => item.caseNum)
  751. // if (existsNotEmpty) {
  752. // this.$message('所选条目中存在已装盒档案,请勿重复操作!')
  753. // return false
  754. // }
  755. console.log('box', this.parentsData.listCategory)
  756. this.$refs.packingBox.packingVisible = true
  757. this.$refs.packingBox.isPackingOrPartType = type
  758. this.$refs.packingBox.packFileCategory = this.parentsData.listCategory
  759. if (type === 0) {
  760. this.$refs.packingBox.packingTitle = '装盒'
  761. } else {
  762. this.$refs.packingBox.packingTitle = '分卷装盒'
  763. this.$refs.packingBox.getViewTable()
  764. }
  765. this.getTotalSumAll()
  766. },
  767. getTotalSumAll() {
  768. this.totalSumAll = 0
  769. this.selections.map((item) => { if (!isNaN(item.child)) this.totalSumAll += item.child })
  770. if (isNaN(this.totalSumAll)) {
  771. return 0
  772. }
  773. return this.totalSumAll
  774. },
  775. // 在线移交
  776. handleOnlineHandover() {
  777. if (this.selections.length === 0) {
  778. this.$message('您还未勾选需要操作的条目,请先确认!')
  779. return false
  780. }
  781. this.$refs.onlineHandover.handOverFileCategory = this.parentsData.listCategory
  782. this.$refs.onlineHandover.onlineHandoverVisible = true
  783. this.getTotalSumAll()
  784. },
  785. // 离线移交
  786. handleOffLineHandover() {
  787. if (this.selections.length === 0) {
  788. this.$message('您还未勾选需要操作的条目,请先确认!')
  789. return false
  790. }
  791. this.$refs.offLineHandover.offLineHandoverVisible = true
  792. this.getTotalSumAll()
  793. },
  794. // 导出zip包
  795. handleExportZip() {
  796. if (this.selections.length === 0) {
  797. this.$message('您还未勾选需要操作的条目,请先确认!')
  798. return false
  799. }
  800. this.$refs.exportZip.exportZipVisible = true
  801. },
  802. // 档案退回
  803. handleArcReturn() {
  804. if (this.selections.length === 0) {
  805. this.$message('您还未勾选需要操作的条目,请先确认!')
  806. return false
  807. }
  808. this.$confirm('此移出将把会所选条目退回到收集库' + '<span>你是否还要继续?</span>', '提示', {
  809. confirmButtonText: '继续',
  810. cancelButtonText: '取消',
  811. type: 'warning',
  812. dangerouslyUseHTMLString: true
  813. }).then(() => {
  814. this.$refs.formModule.overType = 2
  815. this.$refs.formModule.overDetialTitle = '退回审核-流程'
  816. this.$refs.formModule.overDetialVisible = true
  817. }).catch(() => {
  818. })
  819. },
  820. // 开放审核 / 销毁鉴定
  821. handleJD(type) {
  822. if (this.selections.length === 0) {
  823. this.$message('您还未勾选需要操作的条目,请先确认!')
  824. return false
  825. }
  826. if (type === 0) {
  827. this.$refs.formModule.overType = 3
  828. this.$refs.formModule.overDetialTitle = '开放审核-流程'
  829. } else {
  830. this.$refs.formModule.overType = 4
  831. this.$refs.formModule.overDetialTitle = '销毁鉴定-流程'
  832. }
  833. this.$refs.formModule.overDetialVisible = true
  834. },
  835. closeDialog(data) {
  836. this.formVisible = false
  837. setTimeout(() => {
  838. this.handleSearch(this.collectLevel)
  839. })
  840. }
  841. }
  842. }
  843. </script>
  844. <style lang='scss' scoped>
  845. .collect-header{
  846. border-top: none !important;
  847. padding: 20px 0 0 0 !important;
  848. }
  849. .manage-fixed-style{
  850. margin-bottom: 30px;
  851. }
  852. .contorl-header{
  853. flex-wrap: wrap;
  854. height: 94px;
  855. .head-search{
  856. margin-right: 0 !important;
  857. margin-bottom: 10px !important;
  858. }
  859. .collect-menu{
  860. width: 100%;
  861. display: flex;
  862. justify-content: flex-end;
  863. .el-submenu{
  864. margin-right: 0;
  865. margin-left: 10px;
  866. }
  867. }
  868. }
  869. </style>