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

1543 lines
63 KiB

2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months 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
4 months ago
4 months 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 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year 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 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
2 years ago
1 year ago
1 year ago
1 year ago
4 months 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. :default-expand-level="Infinity"
  15. :placeholder="projectPlaceholder"
  16. @input="handleSearch(collectLevel)"
  17. @select="handleSearch(collectLevel)"
  18. >
  19. <p
  20. slot="option-label"
  21. slot-scope="{node}"
  22. style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; width: 100%; padding-left: 10px;"
  23. :title="node.label"
  24. >
  25. <template> {{ node.label }} </template>
  26. </p>
  27. </treeselect>
  28. <treeselect
  29. v-if="isTitleType !== 6 && isTitleType !== 2"
  30. v-model="query.archive_ctg_no"
  31. :options="classifyOptions"
  32. style="width: 180px;"
  33. flat
  34. :multiple="false"
  35. :normalizer="normalizer"
  36. placeholder="请选择档案分类"
  37. @input="handleSearch(collectLevel)"
  38. @select="handleSearch(collectLevel)"
  39. >
  40. <p
  41. slot="option-label"
  42. slot-scope="{node}"
  43. style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; width: 100%; padding-left: 10px;"
  44. :title="node.label"
  45. >
  46. <template> {{ node.label }} </template>
  47. </p>
  48. </treeselect>
  49. </div>
  50. <div v-if="isTitleType !== 6" class="head-search">
  51. <!-- 搜索 -->
  52. <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)" />
  53. <el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="handleSearch(collectLevel)">搜索</el-button>
  54. <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
  55. </div>
  56. <div v-if="!isRecycle" class="collect-menu">
  57. <el-menu
  58. :default-active="activeMenuIndex"
  59. mode="horizontal"
  60. @select="handleSelect"
  61. >
  62. <el-submenu index="1">
  63. <template slot="title">
  64. <i class="iconfont icon-changgui" />
  65. <span>常规</span>
  66. </template>
  67. <el-menu-item-group class="collect-submenu-group">
  68. <el-menu-item v-if="isTitleType !== 6" index="1-1" @click="handleForm('add',0)">新增</el-menu-item>
  69. <el-menu-item v-if="isTitleType !== 6" index="1-2" @click="handleForm('edit',0)">编辑</el-menu-item>
  70. <el-menu-item v-if="isTitleType !== 4" index="1-3" @click="toDelete">删除</el-menu-item>
  71. <el-menu-item v-if="isTitleType === 4" index="1-4" @click="toMove">移出</el-menu-item>
  72. </el-menu-item-group>
  73. <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">
  74. <template slot="title">原文上传</template>
  75. <el-menu-item index="1-5" @click="fileUpload(0)">普通上传</el-menu-item>
  76. <el-menu-item index="1-6" @click="fileUpload(1)">大文件上传</el-menu-item>
  77. </el-menu-item-group>
  78. </el-submenu>
  79. <el-submenu v-if="isTitleType !== 6" index="2">
  80. <template slot="title">
  81. <i class="iconfont icon-zhengli" />
  82. <span>整理</span>
  83. </template>
  84. <el-menu-item-group class="collect-submenu-group">
  85. <el-menu-item v-if="isTitleType !== 2" index="2-1" @click="handleBlukImport">批量导入</el-menu-item>
  86. <!-- 项目 / 案卷 / 卷内 / 文件-->
  87. <el-menu-item v-if="activeIndex !== 1 || (isTitleType === 3 && selectedCategory.arrangeType === 1 && activeIndex === 1)" index="2-2" @click="handleBlukEditing">批量修改</el-menu-item>
  88. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1" index="2-3" @click="handleJnSeqAdjustment('anjuan')">案卷顺序调整</el-menu-item>
  89. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1 " index="2-12" @click="handleJnSeqAdjustment('juannei')">卷内顺序调整</el-menu-item>
  90. <el-menu-item v-if="isTitleType === 3 && selectedCategory.arrangeType === 1" index="2-3" @click="handleJnSeqAdjustment('file')">文件顺序调整</el-menu-item>
  91. <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>
  92. <!-- 案卷 -->
  93. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1 " index="2-5" @click="handleFileNumberUpdate(1)">卷内档号更新</el-menu-item>
  94. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1" index="2-6" @click="handleUncoil">拆卷</el-menu-item>
  95. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1" index="2-7" @click="handleCombineFile">合卷</el-menu-item>
  96. <el-menu-item v-if="isTitleType === 3 && selectedCategory.arrangeType !== 1" index="2-8" @click="handleInsertFile">插件</el-menu-item>
  97. <!-- 案卷 / 卷内 / 文件 -->
  98. <el-menu-item v-if="isTitleType !== 2" index="2-9" @click="handleCollectMoveFile">移动</el-menu-item>
  99. <!-- 案卷 -->
  100. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0" index="2-10" @click="handleFiling">归档</el-menu-item>
  101. <!-- 文件 -->
  102. <el-menu-item v-if="(isTitleType === 3 && selectedCategory.arrangeType === 1) || (isTitleType === 3 && activeIndex === 1)" index="2-11" @click="handleReturn">退回预归档库</el-menu-item>
  103. </el-menu-item-group>
  104. <el-menu-item-group v-if="isTitleType === 3 && activeIndex === 1 && selectedCategory.arrangeType !== 1" class="collect-submenu-group submenu-tree">
  105. <template slot="title">组卷</template>
  106. <el-menu-item index="2-12" @click="handleQuickPaper">快速组卷</el-menu-item>
  107. <el-menu-item index="2-13" @click="handlePaper">手工组卷</el-menu-item>
  108. </el-menu-item-group>
  109. <el-menu-item-group v-if="isTitleType !== 4" class="collect-submenu-group submenu-tree">
  110. <template slot="title">档案装盒</template>
  111. <el-menu-item index="2-2" @click="handlePackingBox(0)">装盒</el-menu-item>
  112. <el-menu-item v-if="selectedCategory.arrangeType !== 1 " index="2-3" @click="handlePackingBox(1)">分卷装盒</el-menu-item>
  113. </el-menu-item-group>
  114. </el-submenu>
  115. <el-submenu index="3">
  116. <template slot="title">
  117. <i class="iconfont icon-gengduo" />
  118. <span>更多</span>
  119. </template>
  120. <el-menu-item-group class="collect-submenu-group">
  121. <el-menu-item v-if="isTitleType !== 6" index="3-1" @click="handleExport">导出</el-menu-item>
  122. <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>
  123. <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>
  124. <el-menu-item v-if="isTitleType === 6" index="3-4" @click="handleOriginalDownload">下载</el-menu-item>
  125. </el-menu-item-group>
  126. <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">
  127. <template slot="title">电子文件目录</template>
  128. <el-menu-item index="3-5" @click="handleCatalogDownload">目录下载</el-menu-item>
  129. <el-menu-item index="3-6" @click="fileUpload(2)">目录上传</el-menu-item>
  130. </el-menu-item-group>
  131. </el-submenu>
  132. </el-menu>
  133. </div>
  134. <div v-if="isRecycle && (isTitleType === 2 || isTitleType === 3)" class="collect-menu">
  135. <el-button class="filter-item" size="mini" type="success" @click="toRecover"><i class="iconfont icon-huifu" />恢复</el-button>
  136. <el-button class="filter-item" size="mini" type="success" @click="toCompletelyDelete"><i class="iconfont icon-shanchu" />彻底删除</el-button>
  137. </div>
  138. <!--新增 / 编辑 表单组件-->
  139. <el-dialog :class="isAiAutoCategory ? 'preview-dialog ai-preview-dialog' :'preview-dialog'" :modal-append-to-body="false" :close-on-click-modal="false" append-to-body :before-close="handleClose" :visible="formVisible" :title="formTitle">
  140. <span class="dialog-right-top" />
  141. <span class="dialog-left-bottom" />
  142. <div class="setting-dialog">
  143. <!-- form @emitTableList="getTableList" -->
  144. <div style="display: flex; justify-content: flex-start;">
  145. <PreviewForm
  146. v-if="formPreviewData.length"
  147. ref="previewForm"
  148. :is-has-code="true"
  149. :is-disabled="false"
  150. :form-preview-data.sync="formPreviewData"
  151. :selected-category="selectedCategory"
  152. :arc-id="arcId"
  153. :is-des-form-type="isDesFormType"
  154. :is-title-type="isTitleType"
  155. :collect-level="collectLevel"
  156. :category-menu="categoryMenu"
  157. @close-dialog="closeDialog"
  158. />
  159. <div v-if="isAiAutoCategory" style="flex: 1; margin-left: 10px; ">
  160. <!-- AI辅助著录内容 -->
  161. <!-- style="display: flex; justify-content: flex-start;" -->
  162. <!-- <div> -->
  163. <div class="upload-btn">
  164. <input id="upFile" type="file" name="upFile" multiple @change="changeAiFile($event)">
  165. <el-button :loading="aiLoading" size="small" type="primary"><i :class="['iconfont', aiLoading ? 'icon-huoqu' : 'icon-shangchuan']" />{{ aiLoading ? 'AI辅助著录识别中' : '选择文件' }}</el-button>
  166. </div>
  167. <!-- margin-left: 10px; line-height: 34px; height: 106px; overflow: hidden; overflow-y: scroll; -->
  168. <div style="flex: 1; padding: 10px 0; font-size: 12px; ">
  169. <div v-for="item in fileList" :key="item.name" class="file-list">
  170. <i class="iconfont icon-xiaowenjian" style="font-size: 14px;" />
  171. {{ item.name }}
  172. </div>
  173. </div>
  174. <!-- </div> -->
  175. <pre v-if="aiJsonData" ref="typingContainer" v-highlightjs="displayedText">{{ displayedText }}</pre>
  176. </div>
  177. </div>
  178. <div slot="footer" class="dialog-footer" style="margin-top: 85px !important;">
  179. <el-button type="primary" style="width: 84px;" @click="handleAiCategory">AI辅助著录</el-button>
  180. <el-button type="primary" @click="handlerArchivesSubmit">保存</el-button>
  181. </div>
  182. </div>
  183. </el-dialog>
  184. <!--卷内移出 组件-->
  185. <el-dialog class="tip-dialog" title="提示" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="moveVisible">
  186. <div class="setting-dialog">
  187. <div class="tip-content">
  188. <p class="tipMsg">此移出将把会所选条目返还到未整理列表</p>
  189. <span>你是否还要继续?</span>
  190. </div>
  191. <div slot="footer" class="dialog-footer">
  192. <el-button type="text" @click="moveVisible = false">取消</el-button>
  193. <el-button type="primary" @click.native="handleMoveConfirm">确定</el-button>
  194. </div>
  195. </div>
  196. </el-dialog>
  197. <!-- 原文上传 -->
  198. <UploadOriginal ref="uploadOriginalRef" :selected-category="selectedCategory" :arc-id="arcId" @close-dialog="closeDialog" />
  199. <!-- 大文件上传 -->
  200. <BigUpload ref="uploadBigRef" :selected-category="selectedCategory" :arc-id="arcId" @close-dialog="closeDialog" />
  201. <!-- 批量导入 -->
  202. <BlukImport ref="blukImportRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  203. <!-- 批量修改 -->
  204. <BlukEditing ref="blukEditingRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  205. <!-- 档案调整 -->
  206. <!-- <FileNumberAdjustment ref="fileNumberAdjustmentRef" :selected-category="selectedCategory" :collect-level="collectLevel" /> -->
  207. <!-- 案卷/文件/卷内 顺序调整 -->
  208. <FileSeqAdjustment ref="fileSeqAdjustmentRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  209. <!-- 合卷 -->
  210. <CombineFile ref="combineFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  211. <!-- 插件 -->
  212. <InsertFile ref="insertFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  213. <!-- 移动 -->
  214. <CollectMoveFile ref="collectMoveFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  215. <!-- 打印 -->
  216. <Print ref="printRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  217. <!-- 四性检测 -->
  218. <FourTest ref="fourTestRef" :selected-category="selectedCategory" :collect-level="collectLevel" @close-dialog="closeDialog" />
  219. <!-- 快速组卷 -->
  220. <QuickPaper ref="quickPaperRef" :selected-category="selectedCategory" :arc-id="arcId" :collect-level="collectLevel" @close-dialog="closeDialog" />
  221. <!-- 归档 -->
  222. <ArchivesFilling ref="archivesFillingRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  223. <!-- 装盒 / 分卷装盒 -->
  224. <PackingBox ref="packingBox" :selected-category="selectedCategory" :selections="selections" :total-sum-all="totalSumAll" @close-dialog="closeDialog" />
  225. </div>
  226. <div style="display: flex; justify-content: space-between; height: 30px; line-height: 30px; padding: 0 20px; ">
  227. <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>
  228. <div v-if="isTitleType !== 2 && !isRecycle && isTitleType !== 6 && !(isTitleType === 3 && activeIndex === 1 && selectedCategory.arrangeType !== 1 )" class="mangement-fixed-top">
  229. <el-checkbox v-model="parentsData.fixedStatusBar" @change="statusBarChecked">隐藏状态栏</el-checkbox>
  230. </div>
  231. </div>
  232. </div>
  233. </template>
  234. <script>
  235. import CRUD, { crud } from '@crud/crud'
  236. import { collectionLibraryCrud } from '../mixins/index'
  237. import { FetchInitCategoryInputFieldByPid, FetchCategoryMenu } from '@/api/system/category/category'
  238. import { FetchDetailsById, collectDel, FetchRemoveArchivesSingle, FetchDeleteArchivesFile, FetchUpdateArchivesNo, FetchDisbandArchives, FetchReturnReDocument, FetchCompleteDelArchives, FetchRestoreArchives } from '@/api/collect/collect'
  239. import { FetchArchivesClassTree } from '@/api/system/archivesClass'
  240. import Treeselect from '@riophae/vue-treeselect'
  241. import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  242. import PreviewForm from '@/views/components/category/PreviewForm'
  243. import UploadOriginal from './uploadOriginal/index'
  244. import BigUpload from './uploadOriginal/bigUpload'
  245. import BlukImport from './bulkImport/index'
  246. import BlukEditing from './blukEditing/index'
  247. import FileSeqAdjustment from './fileSeqAdjustment/index'
  248. import CombineFile from './combineFile/index'
  249. import InsertFile from './insertFile/index'
  250. import CollectMoveFile from './collectMoveFile/index'
  251. import Print from './print/index'
  252. import FourTest from './fourTest/index'
  253. import QuickPaper from './quickPaper/index'
  254. import PackingBox from './packingBox/index'
  255. import ArchivesFilling from './archivesFilling/index'
  256. import qs from 'qs'
  257. import { archivesUpload } from '@/utils/upload'
  258. import { downloadFile, exportFile, getCurrentTime } from '@/utils/index'
  259. import { mapGetters } from 'vuex'
  260. export default {
  261. name: 'CollectHeader',
  262. components: { Treeselect, PreviewForm, UploadOriginal, BigUpload, BlukImport, BlukEditing, FileSeqAdjustment, CombineFile, InsertFile, CollectMoveFile, Print, FourTest, QuickPaper, PackingBox, ArchivesFilling },
  263. mixins: [collectionLibraryCrud, crud()],
  264. props: {
  265. selectedCategory: {
  266. type: Object,
  267. default: function() {
  268. return {}
  269. }
  270. },
  271. isTitleType: {
  272. type: Number,
  273. default: 2
  274. },
  275. selections: {
  276. type: Array,
  277. default: () => []
  278. },
  279. activeIndex: {
  280. type: Number,
  281. default: 0
  282. },
  283. isTabFile: {
  284. type: Boolean,
  285. default: false
  286. },
  287. isRecycle: {
  288. type: Boolean,
  289. default: false
  290. },
  291. test: {
  292. type: String,
  293. default: ''
  294. }
  295. },
  296. inject: ['parentsData'],
  297. data() {
  298. return {
  299. activeMenuIndex: '1',
  300. formVisible: false,
  301. formTitle: '项目',
  302. formPreviewData: [], // 预览界面data
  303. projectOptions: [],
  304. classifyOptions: [],
  305. moveVisible: false,
  306. recoverVisible: false,
  307. isDesFormType: 'arcives', // 区分是门类得还是档案得
  308. arcId: null,
  309. quickPaper: false,
  310. quickPaperArcId: [],
  311. totalSumAll: 0,
  312. categoryMenu: [],
  313. isAiAutoCategory: false,
  314. aiLoading: false,
  315. nowDate: '',
  316. fileList: [],
  317. aiJsonData: null,
  318. displayedText: '',
  319. typingInterval: null,
  320. typingFinished: false,
  321. currentLineIndex: 0
  322. }
  323. },
  324. computed: {
  325. ...mapGetters([
  326. 'baseApi'
  327. ]),
  328. collectTitle() {
  329. if (this.isTitleType === 2) {
  330. return '项目'
  331. } else if (this.isTitleType === 3) {
  332. if (this.selectedCategory.arrangeType === 1) {
  333. return '文件'
  334. } else {
  335. if (this.activeIndex === 1) {
  336. return '文件'
  337. } else {
  338. return '案卷'
  339. }
  340. }
  341. } else if (this.isTitleType === 4) {
  342. return '卷内'
  343. } else if (this.isTitleType === 6) {
  344. return '原文'
  345. }
  346. return ''
  347. },
  348. collectLevel() {
  349. if (this.isTitleType === 2) {
  350. return 1
  351. } else if (this.isTitleType === 3) {
  352. if (this.selectedCategory.arrangeType === 1) {
  353. return 3
  354. } else {
  355. if (this.activeIndex === 1) {
  356. if (this.quickPaper) {
  357. return 2
  358. } else {
  359. return 3
  360. }
  361. } else {
  362. return 2
  363. }
  364. }
  365. } else if (this.isTitleType === 4) {
  366. return 3
  367. } else if (this.isTitleType === 6) {
  368. return 4
  369. }
  370. return null
  371. },
  372. classType() {
  373. if (this.isTitleType === 2) {
  374. return ''
  375. } else if (this.isTitleType === 3) {
  376. if (this.selectedCategory.arrangeType === 1) {
  377. return 'is-juannei'
  378. } else {
  379. if (this.activeIndex === 1) {
  380. return 'is-juannei'
  381. } else {
  382. return 'is-anjuan'
  383. }
  384. }
  385. } else if (this.isTitleType === 4) {
  386. return 'is-juannei'
  387. } else if (this.isTitleType === 6) {
  388. return 'is-file'
  389. }
  390. return ''
  391. },
  392. placeholderType() {
  393. if (this.isTitleType === 2) {
  394. return '输入项目名称或编号'
  395. } else if (this.isTitleType === 3 || this.isTitleType === 4) {
  396. return '输入题名或档号'
  397. }
  398. return '输入项目名称或编号'
  399. },
  400. projectPlaceholder() {
  401. if (this.isTitleType === 2) {
  402. return '请选择项目分类'
  403. } else if (this.isTitleType === 3) {
  404. return '请选择项目阶段'
  405. }
  406. return '请选择项目分类'
  407. }
  408. },
  409. watch: {
  410. selectedCategory: function(newValue, oldValue) {
  411. if (newValue && newValue.id) {
  412. this.getInitArchivesClass()
  413. }
  414. },
  415. isTitleType: function(newValue, oldValue) {
  416. console.log('isTitleType', newValue)
  417. },
  418. activeIndex: function(newValue, oldValue) {
  419. if (newValue === 1) {
  420. this.parentsData.isTabFile = true
  421. } else {
  422. this.parentsData.isTabFile = false
  423. }
  424. }
  425. },
  426. created() {
  427. },
  428. mounted() {
  429. this.getInitArchivesClass()
  430. this.getCategoryDataTree()
  431. },
  432. methods: {
  433. getCategoryDataTree() {
  434. FetchCategoryMenu().then(res => {
  435. this.categoryMenu = res
  436. })
  437. },
  438. resetQuery() {
  439. this.query = {
  440. 'search': null,
  441. 'project_class': null,
  442. 'archive_ctg_no': null
  443. }
  444. this.handleSearch(this.collectLevel)
  445. },
  446. // 筛选 - 档案分类
  447. getInitArchivesClass() {
  448. this.classifyOptions = []
  449. this.query = {
  450. 'search': null,
  451. 'project_class': null,
  452. 'archive_ctg_no': null
  453. }
  454. const params = {
  455. 'categoryId': this.selectedCategory.id
  456. }
  457. FetchArchivesClassTree(params).then((res) => {
  458. this.classifyOptions = JSON.parse(JSON.stringify(res))
  459. }).catch(err => {
  460. console.log(err)
  461. })
  462. },
  463. normalizer(node) {
  464. if (node.childArchivesClass === null) {
  465. delete node.childArchivesClass
  466. }
  467. return {
  468. id: node.code,
  469. label: `${node.name} - ${node.code}`,
  470. children: node.childArchivesClass
  471. }
  472. },
  473. handleSelect(key, keyPath) {
  474. console.log(key, keyPath)
  475. },
  476. // 著录界面-form/详情-api
  477. handleForm(type, isPaper) {
  478. if (type === 'add') {
  479. if (this.parentsData.parentsProjectId && this.isTitleType === 3) {
  480. console.log('项目下的案卷')
  481. } else {
  482. if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
  483. this.$message({ message: '当前档案处于归档流程中,不可操作新增,请先确认!', offset: 8 })
  484. return false
  485. }
  486. }
  487. this.arcId = null
  488. if (isPaper) {
  489. this.quickPaper = true
  490. this.formTitle = '新增案卷'
  491. } else {
  492. this.formTitle = '新增' + this.collectTitle
  493. this.quickPaper = false
  494. }
  495. } else if (type === 'edit') {
  496. this.quickPaper = false
  497. if (this.selections.length === 0) {
  498. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  499. return false
  500. } else if (this.selections.length > 1) {
  501. this.$message({ message: '编辑操作只可勾选唯一目标条目,请先确认!', offset: 8 })
  502. return false
  503. } else if (this.selections[0].collect_formal === 2) {
  504. this.$message({ message: '当前所选的档案处于归档流程中,不可操作编辑,请先确认!', offset: 8 })
  505. return false
  506. }
  507. this.arcId = this.selections[0].id
  508. this.formTitle = '编辑' + this.collectTitle
  509. }
  510. // this.form.dictionaryConfigId = {}
  511. // this.formPreviewData = []
  512. // 档案预编辑获取字段
  513. this.formVisible = true
  514. this.$nextTick(() => {
  515. this.getFormInfo(type)
  516. })
  517. },
  518. getFormInfo(type) {
  519. if (type === 'edit') {
  520. const params = {
  521. 'categoryId': this.selectedCategory.id,
  522. 'categoryLevel': this.collectLevel,
  523. 'id': this.arcId
  524. }
  525. FetchDetailsById(params).then(data => {
  526. // const showFiledAll = data.showFiled.filter(item => item.isSequence).sort((a, b) => a.isSequence - b.isSequence)
  527. const showFiledAll = data.showFiled
  528. this.$nextTick(() => {
  529. this.formPreviewData = showFiledAll
  530. this.isDesFormType = 'arcives'
  531. this.$nextTick(() => {
  532. this.$refs.previewForm.archivesType = 'edit'
  533. this.$refs.previewForm.addOrUpdateForm = data.echo
  534. this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
  535. })
  536. })
  537. })
  538. } else {
  539. const params = {
  540. 'categoryId': this.selectedCategory.id,
  541. 'categoryLevel': this.collectLevel
  542. }
  543. FetchInitCategoryInputFieldByPid(params).then(data => {
  544. this.formPreviewData = data
  545. this.isDesFormType = 'arcives'
  546. this.$nextTick(() => {
  547. this.$refs.previewForm.archivesType = 'add'
  548. this.$refs.previewForm.activeIndex = this.activeIndex
  549. this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
  550. })
  551. })
  552. }
  553. },
  554. // form - submit
  555. handlerArchivesSubmit() {
  556. this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id, this.quickPaperArcId)
  557. },
  558. // 关闭
  559. handleClose(done) {
  560. this.formVisible = false
  561. this.quickPaper = false
  562. this.isAiAutoCategory = false
  563. this.aiJsonData = null
  564. this.currentLineIndex = 0
  565. this.displayedText = ''
  566. this.typingFinished = false
  567. if (this.typingInterval) {
  568. clearInterval(this.typingInterval)
  569. }
  570. this.fileList = []
  571. done()
  572. },
  573. // 删除
  574. toDelete() {
  575. if (this.selections.length === 0) {
  576. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  577. return false
  578. }
  579. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  580. if (isHasFillFormal) {
  581. this.$message({ message: '您所选的条目有正在归档流程中,不可操作删除,请先确认!', offset: 8 })
  582. return false
  583. }
  584. if (this.collectLevel === 4) {
  585. if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
  586. this.$message({ message: '当前档案处于归档流程中,不可操作删除,请先确认!', offset: 8 })
  587. return false
  588. }
  589. }
  590. let messageTip
  591. if (this.activeIndex === 1) {
  592. messageTip = '此删除将把会所选条目与其子集彻底删除'
  593. } else {
  594. messageTip = '此删除将把会所选条目与其子集放入回收站'
  595. }
  596. this.$confirm(messageTip + '<span>你是否还要继续?</span>', '提示', {
  597. confirmButtonText: '继续',
  598. cancelButtonText: '取消',
  599. type: 'warning',
  600. dangerouslyUseHTMLString: true
  601. }).then(() => {
  602. if (this.activeIndex === 1) {
  603. const archivesIds = []
  604. this.selections.forEach(val => {
  605. archivesIds.push(val.id)
  606. })
  607. const params = {
  608. 'categoryId': this.selectedCategory.id,
  609. 'categoryLevel': this.collectLevel,
  610. 'archivesIds': archivesIds
  611. }
  612. FetchCompleteDelArchives(params).then((res) => {
  613. if (res.code !== 500) {
  614. this.$message({ message: res, type: 'success', offset: 8 })
  615. this.handleSearch(this.collectLevel)
  616. } else {
  617. this.$message({ message: '删除所选档案失败', type: 'error', offset: 8 })
  618. }
  619. }).catch(err => {
  620. console.log(err)
  621. })
  622. } else {
  623. this.handleDelConfirm()
  624. }
  625. }).catch(() => {
  626. })
  627. },
  628. // 卷内 - 移除
  629. toMove() {
  630. if (this.selections.length === 0) {
  631. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  632. return false
  633. }
  634. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  635. if (isHasFillFormal) {
  636. this.$message({ message: '您所选的条目有正在归档流程中,不可操作删除,请先确认!', offset: 8 })
  637. return false
  638. }
  639. this.moveVisible = true
  640. },
  641. // 删除 - 确认
  642. handleDelConfirm() {
  643. if (this.collectLevel === 4) {
  644. const params = this.selections.map((item) => {
  645. const json = {}
  646. json.archivesId = item.archive_id
  647. json.categoryId = this.selectedCategory.id
  648. json.documentFileId = item.document_file_id
  649. json.documentId = item.document_id
  650. json.id = item.id
  651. return json
  652. })
  653. FetchDeleteArchivesFile(params).then((res) => {
  654. if (res === 'SUCCESS') {
  655. this.$message({ message: '删除成功', type: 'success', offset: 8 })
  656. this.handleSearch(this.collectLevel)
  657. } else {
  658. this.$message({ message: '删除所选电子原文失败', type: 'error', offset: 8 })
  659. }
  660. }).catch(err => {
  661. console.log(err)
  662. })
  663. } else {
  664. const archivesIds = []
  665. this.selections.forEach(val => {
  666. archivesIds.push(val.id)
  667. })
  668. const params = {
  669. 'categoryId': this.selectedCategory.id,
  670. 'categoryLevel': this.collectLevel,
  671. 'archivesIds': archivesIds
  672. }
  673. collectDel(params).then((res) => {
  674. if (res.includes('成功')) {
  675. this.$message({ message: '删除成功', type: 'success', offset: 8 })
  676. this.handleSearch(this.collectLevel)
  677. } else {
  678. this.$message({ message: res, type: 'error', offset: 8 })
  679. }
  680. }).catch(err => {
  681. console.log(err)
  682. })
  683. }
  684. },
  685. // 卷内 - 移出 确认
  686. handleMoveConfirm() {
  687. const archivesIds = []
  688. this.selections.forEach(val => {
  689. archivesIds.push(val.id)
  690. })
  691. const params = {
  692. 'categoryId': this.selectedCategory.id,
  693. 'categoryLevel': this.collectLevel,
  694. 'archivesIds': archivesIds,
  695. 'parentsId': this.parentsData.parentsAnjuanId
  696. }
  697. FetchRemoveArchivesSingle(params).then((res) => {
  698. if (res === true) {
  699. this.$message({ message: '移出成功', type: 'success', offset: 8 })
  700. this.handleSearch(this.collectLevel)
  701. } else {
  702. this.$message({ message: '移出失败', type: 'error', offset: 8 })
  703. }
  704. this.moveVisible = false
  705. }).catch(err => {
  706. console.log(err)
  707. })
  708. },
  709. // 原文上传
  710. fileUpload(uploadType) {
  711. if (uploadType !== 2) {
  712. if (this.isTitleType !== 6) {
  713. if (this.selections.length === 0) {
  714. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  715. return false
  716. }
  717. if (this.selections.length > 1) {
  718. this.$message({ message: '上传操作只可勾选唯一目标条目,请先确认!', offset: 8 })
  719. return false
  720. }
  721. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  722. if (isHasFillFormal) {
  723. this.$message({ message: '您所选的条目有正在归档流程中,不可操作原文上传,请先确认!', offset: 8 })
  724. return false
  725. }
  726. this.arcId = this.selections[0].id
  727. } else {
  728. if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
  729. this.$message({ message: '当前档案处于归档流程中,不可操作原文上传,请先确认!', offset: 8 })
  730. return false
  731. }
  732. if (this.selectedCategory.arrangeType === 1) {
  733. this.arcId = this.parentsData.parentsAnjuanId
  734. } else {
  735. if (this.parentsData.isTabFile) {
  736. this.arcId = this.parentsData.parentsAnjuanId
  737. } else {
  738. this.arcId = this.parentsData.parentsJuanneiId
  739. }
  740. }
  741. }
  742. }
  743. if (uploadType === 0) {
  744. this.$refs.uploadOriginalRef.uploadTitle = '普通上传'
  745. this.$refs.uploadOriginalRef.uploadVisible = true
  746. } else if (uploadType === 1) {
  747. this.$refs.uploadBigRef.uploadBigVisible = true
  748. } else if (uploadType === 2) {
  749. this.$refs.uploadOriginalRef.uploadTitle = '原文目录上传'
  750. this.$refs.uploadOriginalRef.uploadVisible = true
  751. }
  752. if (this.$refs.uploadOriginalRef.uploadVisible) {
  753. this.$refs.uploadOriginalRef.uploadType = uploadType
  754. this.$refs.uploadOriginalRef.fileList = []
  755. }
  756. },
  757. // 批量导入
  758. handleBlukImport() {
  759. if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
  760. this.$message({ message: '当前档案处于归档流程中,不可操作批量导入,请先确认!', offset: 8 })
  761. return false
  762. }
  763. this.$refs.blukImportRef.bulkImportVisible = true
  764. },
  765. // 批量修改
  766. handleBlukEditing() {
  767. if (this.selections.length === 0) {
  768. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  769. return false
  770. }
  771. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  772. if (isHasFillFormal) {
  773. this.$message({ message: '您所选的条目有正在归档流程中,不可操作批量修改,请先确认!', offset: 8 })
  774. return false
  775. }
  776. this.$nextTick(() => {
  777. this.$refs.blukEditingRef.bulkEditingVisible = true
  778. })
  779. },
  780. // 案卷/文件/卷内顺序调整
  781. handleJnSeqAdjustment(type) {
  782. if (type === 'juannei') {
  783. if (this.selections.length === 0) {
  784. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  785. return false
  786. }
  787. if (this.selections.length > 1) {
  788. this.$message({ message: '卷内顺序调整操作只可勾选唯一目标条目,请先确认!', offset: 8 })
  789. return false
  790. }
  791. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  792. if (isHasFillFormal) {
  793. this.$message({ message: '您所选的条目有正在归档流程中,不可操作卷内顺序调整,请先确认!', offset: 8 })
  794. return false
  795. }
  796. this.$nextTick(() => {
  797. this.$refs.fileSeqAdjustmentRef.titleAdjustment = '卷内顺序调整'
  798. this.$refs.fileSeqAdjustmentRef.isJuannei = true
  799. })
  800. } else {
  801. if (this.selections.length < 2) {
  802. this.$message({ message: '请选择多个' + (type === 'file' ? '文件' : '案卷') + '后进行操作!', offset: 8 })
  803. return false
  804. }
  805. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  806. if (isHasFillFormal) {
  807. this.$message({ message: '您所选的条目有正在归档流程中,不可操作案卷/文件顺序调整,请先确认!', offset: 8 })
  808. return false
  809. }
  810. this.$nextTick(() => {
  811. if (type === 'anjuan') {
  812. this.$refs.fileSeqAdjustmentRef.titleAdjustment = '案卷顺序调整'
  813. } else {
  814. this.$refs.fileSeqAdjustmentRef.titleAdjustment = '文件顺序调整'
  815. }
  816. this.$refs.fileSeqAdjustmentRef.isJuannei = false
  817. })
  818. }
  819. this.$nextTick(() => {
  820. this.$refs.fileSeqAdjustmentRef.getDoArchivesAdjust()
  821. })
  822. },
  823. // 档号更新
  824. handleFileNumberUpdate(type) {
  825. if (this.selections.length === 0) {
  826. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  827. return false
  828. }
  829. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  830. if (isHasFillFormal) {
  831. this.$message({ message: '您所选的条目有正在归档流程中,不可操作档号更新,请先确认!', offset: 8 })
  832. return false
  833. }
  834. this.$confirm('此操作将会自动重新生成档号' + '<span>你是否还要继续?</span>', '提示', {
  835. confirmButtonText: '继续',
  836. cancelButtonText: '取消',
  837. type: 'warning',
  838. dangerouslyUseHTMLString: true
  839. }).then(() => {
  840. // updateType 更新类别 1.档号更新 2.卷内档号更新
  841. let updateType
  842. if (type === 0) {
  843. updateType = 1
  844. } else {
  845. updateType = 2
  846. }
  847. const archivesIds = []
  848. this.selections.forEach(val => {
  849. archivesIds.push(val.id)
  850. })
  851. const params = {
  852. 'categoryId': this.selectedCategory.id,
  853. 'categoryLevel': this.collectLevel,
  854. 'archivesIds': archivesIds,
  855. 'updateType': updateType
  856. }
  857. FetchUpdateArchivesNo(params).then((res) => {
  858. if (res.code !== 500) {
  859. this.$message({ message: '档号更新成功', type: 'success', offset: 8 })
  860. this.handleSearch(this.collectLevel)
  861. } else {
  862. this.$message({ message: res.message, type: 'error', offset: 8 })
  863. }
  864. }).catch(err => {
  865. console.log(err)
  866. })
  867. }).catch(() => {
  868. })
  869. },
  870. // 拆卷
  871. handleUncoil() {
  872. if (this.selections.length === 0) {
  873. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  874. return false
  875. }
  876. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  877. if (isHasFillFormal) {
  878. this.$message({ message: '您所选的条目有正在归档流程中,不可操作拆卷,请先确认!', offset: 8 })
  879. return false
  880. }
  881. this.$confirm('拆卷之后,对应的案卷数据将会自动删除' + '<span>你是否还要继续?</span>', '提示', {
  882. confirmButtonText: '继续',
  883. cancelButtonText: '取消',
  884. type: 'warning',
  885. dangerouslyUseHTMLString: true
  886. }).then(() => {
  887. const archivesIds = []
  888. this.selections.forEach(val => {
  889. archivesIds.push(val.id)
  890. })
  891. const params = {
  892. 'categoryId': this.selectedCategory.id,
  893. 'archivesIds': archivesIds
  894. }
  895. FetchDisbandArchives(params).then((res) => {
  896. if (res.code !== 500) {
  897. this.$message({ message: '拆卷成功', type: 'success', offset: 8 })
  898. this.handleSearch(this.collectLevel)
  899. } else {
  900. this.$message({ message: '拆卷失败', type: 'error', offset: 8 })
  901. }
  902. }).catch(err => {
  903. console.log(err)
  904. })
  905. }).catch(() => {
  906. })
  907. },
  908. // 合卷
  909. handleCombineFile() {
  910. if (this.selections.length < 2) {
  911. this.$message({ message: '合卷操作至少勾选2个案卷,请重试!', offset: 8 })
  912. return false
  913. }
  914. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  915. if (isHasFillFormal) {
  916. this.$message({ message: '您所选的条目有正在归档流程中,不可操作合卷,请先确认!', offset: 8 })
  917. return false
  918. }
  919. this.$refs.combineFileRef.getTargetList()
  920. },
  921. // 插件
  922. handleInsertFile() {
  923. if (this.collectLevel === 3) {
  924. if (this.selections.length === 0) {
  925. this.$confirm('您未勾选条目,否则直接选择所有条目' + '<span>你是否还要继续?</span>', '提示', {
  926. confirmButtonText: '继续',
  927. cancelButtonText: '取消',
  928. type: 'warning',
  929. dangerouslyUseHTMLString: true
  930. }).then(() => {
  931. this.$refs.insertFileRef.fileNoSelectionData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
  932. this.$refs.insertFileRef.getInsertViewTable()
  933. }).catch(() => {
  934. })
  935. } else {
  936. this.$refs.insertFileRef.getInsertViewTable()
  937. }
  938. } else {
  939. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  940. if (this.selections.length !== 1) {
  941. this.$message({ message: '插卷操作只可勾选唯一目标条目,请先确认!', offset: 8 })
  942. return false
  943. } else if (isHasFillFormal) {
  944. this.$message({ message: '您所选的条目有正在归档流程中,不可操作插件,请先确认!', offset: 8 })
  945. return false
  946. } else {
  947. this.$refs.insertFileRef.getInsertViewTable()
  948. }
  949. }
  950. },
  951. // 移动
  952. handleCollectMoveFile() {
  953. if (this.selections.length === 0) {
  954. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  955. return false
  956. }
  957. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  958. if (isHasFillFormal) {
  959. this.$message({ message: '您所选的条目有正在归档流程中,不可操作移动,请先确认!', offset: 8 })
  960. return false
  961. }
  962. this.$refs.collectMoveFileRef.collectMoveFileVisible = true
  963. },
  964. // 归档
  965. handleFiling() {
  966. if (this.selections.length === 0) {
  967. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  968. return false
  969. }
  970. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  971. if (isHasFillFormal) {
  972. this.$message({ message: '您所选的条目有正在归档流程中,勿重复操作,请先确认!!', offset: 8 })
  973. return false
  974. }
  975. this.$refs.archivesFillingRef.archivesFillingVisible = true
  976. },
  977. // 退回预归档库
  978. handleReturn() {
  979. if (this.selections.length === 0) {
  980. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  981. return false
  982. }
  983. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  984. if (isHasFillFormal) {
  985. this.$message({ message: '您所选的条目有正在归档流程中,不可操作退回预归档库,请先确认!!', offset: 8 })
  986. return false
  987. }
  988. this.$confirm('此操作将把会所选条目退回到预归档库' + '<span>你是否还要继续?</span>', '提示', {
  989. confirmButtonText: '继续',
  990. cancelButtonText: '取消',
  991. type: 'warning',
  992. dangerouslyUseHTMLString: true
  993. }).then(() => {
  994. const archivesIds = this.selections.map(item => item.id)
  995. const params = {
  996. 'categoryId': this.selectedCategory.id,
  997. 'archivesIds': archivesIds
  998. }
  999. FetchReturnReDocument(params).then((res) => {
  1000. if (res.code !== 500) {
  1001. if (res === 0) {
  1002. this.crud.notify('', CRUD.NOTIFICATION_TYPE.INFO)
  1003. this.$message({ message: '当前数据中不包含预归档数据,无法返回', offset: 8 })
  1004. } else {
  1005. this.$message({ message: '已成功返回' + res + '条来自预归档的数据', type: 'success', offset: 8 })
  1006. }
  1007. this.handleSearch(this.collectLevel)
  1008. } else {
  1009. this.$message({ message: res.message, type: 'error', offset: 8 })
  1010. }
  1011. }).catch(err => {
  1012. console.log(err)
  1013. })
  1014. }).catch(() => {
  1015. })
  1016. },
  1017. // 导出
  1018. handleExport() {
  1019. if (this.selections.length === 0) {
  1020. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1021. return false
  1022. }
  1023. this.$confirm('此操作将导出所选数据' + '<span>你是否还要继续?</span>', '提示', {
  1024. confirmButtonText: '继续',
  1025. cancelButtonText: '取消',
  1026. type: 'warning',
  1027. dangerouslyUseHTMLString: true
  1028. }).then(() => {
  1029. const archivesIds = []
  1030. this.selections.forEach(val => {
  1031. archivesIds.push(val.id)
  1032. })
  1033. const params = {
  1034. 'categoryId': this.selectedCategory.id,
  1035. 'categoryLevel': this.collectLevel,
  1036. 'archivesIds': archivesIds
  1037. }
  1038. exportFile(this.baseApi + '/api/collect/exportDate?' + qs.stringify(params, { indices: false }))
  1039. }).catch(() => {
  1040. })
  1041. },
  1042. // 打印
  1043. handlePrint() {
  1044. if (this.selections.length === 0) {
  1045. this.$refs.printRef.form.printRange = '当页条目'
  1046. let currentTableData = []
  1047. if (this.collectLevel === 2) {
  1048. currentTableData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
  1049. } else if (this.collectLevel === 3) {
  1050. if (this.isTitleType === 3) {
  1051. currentTableData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
  1052. } else {
  1053. currentTableData = this.parentsData.$refs.juanneiEle.junneiData
  1054. }
  1055. }
  1056. this.$refs.printRef.currentTable = JSON.parse(JSON.stringify(currentTableData))
  1057. } else {
  1058. this.$refs.printRef.form.printRange = '勾选条目'
  1059. }
  1060. this.$refs.printRef.printVisible = true
  1061. },
  1062. // 四性检测
  1063. handleFourTest() {
  1064. if (this.selections.length === 0) {
  1065. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1066. return false
  1067. }
  1068. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1069. if (isHasFillFormal) {
  1070. this.$message({ message: '您所选的条目有正在归档流程中,不可操作四性检测,请先确认!', offset: 8 })
  1071. return false
  1072. }
  1073. this.$refs.fourTestRef.fourTestVisible = true
  1074. this.selections.forEach((item, index) => {
  1075. this.$set(this.selections[index], 'reportResult', {})
  1076. })
  1077. this.$refs.fourTestRef.tableData = this.selections
  1078. },
  1079. // 目录下载
  1080. handleCatalogDownload() {
  1081. if (this.selections.length === 0) {
  1082. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1083. return false
  1084. }
  1085. this.$confirm('此操作将下载所选条目目录' + '<span>你是否还要继续?</span>', '提示', {
  1086. confirmButtonText: '继续',
  1087. cancelButtonText: '取消',
  1088. type: 'warning',
  1089. dangerouslyUseHTMLString: true
  1090. }).then(() => {
  1091. const archivesIds = []
  1092. this.selections.forEach(val => {
  1093. archivesIds.push(val.id)
  1094. })
  1095. const params = {
  1096. 'categoryId': this.selectedCategory.id,
  1097. 'categoryLevel': this.collectLevel,
  1098. 'archivesIds': archivesIds
  1099. }
  1100. exportFile(this.baseApi + '/api/collect/catalogDownload?' + qs.stringify(params, { indices: false }))
  1101. }).catch(() => {
  1102. })
  1103. },
  1104. // 快速组卷
  1105. handleQuickPaper() {
  1106. this.$refs.quickPaperRef.quickVisible = true
  1107. },
  1108. // 手工组卷
  1109. handlePaper() {
  1110. if (this.selections.length === 0) {
  1111. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1112. return false
  1113. }
  1114. this.quickPaperArcId = this.selections.map(item => item.id)
  1115. this.handleForm('add', 1)
  1116. },
  1117. // 装盒 / 分卷装盒
  1118. handlePackingBox(type) {
  1119. if (this.selections.length === 0) {
  1120. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1121. return false
  1122. }
  1123. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1124. if (isHasFillFormal) {
  1125. this.$message({ message: '您所选的条目有正在归档流程中,不可操作装盒,请先确认!!', offset: 8 })
  1126. return false
  1127. }
  1128. if (this.selectedCategory.arrangeType === 2) {
  1129. if (type === 1) {
  1130. if (this.selections.length > 1) {
  1131. this.$message({ message: '只可勾选唯一目标条目,请先确认!', offset: 8 })
  1132. return false
  1133. }
  1134. }
  1135. if (this.selections[0].child === 0) {
  1136. this.$message({ message: '当前选中的档案无相关卷内文件,不可装盒!', type: 'error', offset: 8 })
  1137. return
  1138. }
  1139. }
  1140. if (this.selections[0].case_no) {
  1141. this.$message({ message: '当前档案已装盒,请勿重复操作!', type: 'error', offset: 8 })
  1142. return
  1143. }
  1144. // 后面与后端对接确定字段name
  1145. // const existsNotEmpty = this.selections.some(item => item.caseNum)
  1146. // if (existsNotEmpty) {
  1147. // this.$message('所选条目中存在已装盒档案,请勿重复操作!')
  1148. // return false
  1149. // }
  1150. this.$refs.packingBox.packingVisible = true
  1151. this.$refs.packingBox.isPackingOrPartType = type
  1152. this.$refs.packingBox.packFileCategory = this.parentsData.listCategory
  1153. if (type === 0) {
  1154. this.$refs.packingBox.packingTitle = '装盒'
  1155. } else {
  1156. this.$refs.packingBox.packingTitle = '分卷装盒'
  1157. this.$refs.packingBox.getViewTable()
  1158. }
  1159. this.getTotalSumAll()
  1160. },
  1161. getTotalSumAll() {
  1162. this.totalSumAll = 0
  1163. this.selections.map((item) => { if (!isNaN(item.child)) this.totalSumAll += item.child })
  1164. if (isNaN(this.totalSumAll)) {
  1165. return 0
  1166. }
  1167. return this.totalSumAll
  1168. },
  1169. // 原文内的附件下载
  1170. handleOriginalDownload() {
  1171. if (this.selections.length > 1 || this.selections.length === 0) {
  1172. this.$message({ message: '下载操作只可勾选唯一目标条目,请先确认!', offset: 8 })
  1173. return false
  1174. }
  1175. const url = this.baseApi + '/downloadFile' + this.selections[0].file_path
  1176. fetch(url).then(res => res.blob()).then(blob => {
  1177. downloadFile(blob, this.selections[0].file_name.split('.')[0], this.selections[0].file_type)
  1178. }).catch(() => {
  1179. this.$message({ message: '下载文件失败!', type: 'error', offset: 8 })
  1180. })
  1181. },
  1182. // 回收站 - 恢复
  1183. toRecover() {
  1184. if (this.selections.length === 0) {
  1185. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1186. return false
  1187. }
  1188. this.$confirm('此恢复将会把所选条目及其子集一并恢复' + '<span>你是否还要继续?</span>', '提示', {
  1189. confirmButtonText: '继续',
  1190. cancelButtonText: '取消',
  1191. type: 'warning',
  1192. dangerouslyUseHTMLString: true
  1193. }).then(() => {
  1194. const archivesIds = []
  1195. this.selections.forEach(val => {
  1196. archivesIds.push(val.id)
  1197. })
  1198. const params = {
  1199. 'categoryId': this.selectedCategory.id,
  1200. 'categoryLevel': this.collectLevel,
  1201. 'archivesIds': archivesIds,
  1202. 'collectFormal': this.isTitleType === 2 ? 1 : null
  1203. }
  1204. FetchRestoreArchives(params).then((res) => {
  1205. if (res.code !== 500) {
  1206. if (res.includes('成功')) {
  1207. this.$message({ message: res, type: 'success', offset: 8 })
  1208. } else {
  1209. this.$message({ message: res, type: 'error', offset: 8 })
  1210. }
  1211. this.handleSearch(this.collectLevel)
  1212. } else {
  1213. this.$message({ message: '恢复所选档案失败', type: 'error', offset: 8 })
  1214. }
  1215. }).catch(err => {
  1216. console.log(err)
  1217. })
  1218. }).catch(() => {
  1219. })
  1220. },
  1221. // 回收站 - 彻底删除
  1222. toCompletelyDelete() {
  1223. if (this.selections.length === 0) {
  1224. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1225. return false
  1226. }
  1227. this.$confirm('此删除将把会所选条目与其子集彻底删除' + '<span>你是否还要继续?</span>', '提示', {
  1228. confirmButtonText: '继续',
  1229. cancelButtonText: '取消',
  1230. type: 'warning',
  1231. dangerouslyUseHTMLString: true
  1232. }).then(() => {
  1233. const archivesIds = []
  1234. this.selections.forEach(val => {
  1235. archivesIds.push(val.id)
  1236. })
  1237. const params = {
  1238. 'categoryId': this.selectedCategory.id,
  1239. 'categoryLevel': this.collectLevel,
  1240. 'archivesIds': archivesIds
  1241. }
  1242. FetchCompleteDelArchives(params).then((res) => {
  1243. if (res.code !== 500) {
  1244. this.$message({ message: res, type: 'success', offset: 8 })
  1245. this.handleSearch(this.collectLevel)
  1246. } else {
  1247. this.$message({ message: '删除所选档案失败', type: 'error', offset: 8 })
  1248. }
  1249. }).catch(err => {
  1250. console.log(err)
  1251. })
  1252. }).catch(() => {
  1253. })
  1254. },
  1255. closeDialog(data) {
  1256. this.formVisible = false
  1257. this.quickPaper = false
  1258. setTimeout(() => {
  1259. this.handleSearch(this.collectLevel)
  1260. })
  1261. },
  1262. handleAiCategory() {
  1263. this.isAiAutoCategory = !this.isAiAutoCategory
  1264. if (!this.isAiAutoCategory) {
  1265. this.fileList = []
  1266. }
  1267. },
  1268. async changeAiFile(e) {
  1269. // 替换文件时清空 aiJsonData
  1270. this.aiJsonData = null
  1271. this.currentLineIndex = 0
  1272. this.displayedText = ''
  1273. this.typingFinished = false
  1274. this.typingInterval = null
  1275. // if (this.typingInterval) {
  1276. // clearInterval(this.typingInterval);
  1277. // }
  1278. const selectedFiles = Array.from(e.target.files)
  1279. const imageFiles = selectedFiles.filter(file => file.type.startsWith('image/'))
  1280. const nonImageFiles = selectedFiles.filter(file => !file.type.startsWith('image/'))
  1281. // 不允许同时选择图片和非图片文件
  1282. if (imageFiles.length > 0 && nonImageFiles.length > 0) {
  1283. this.$message.error('不能同时选择图片和其他类型文件,请重新选择')
  1284. return
  1285. }
  1286. const existingImageFiles = this.fileList.filter(item => item.formatType === 'image')
  1287. const existingNonImageFiles = this.fileList.filter(item => item.formatType !== 'image')
  1288. if (imageFiles.length > 0) {
  1289. if (existingImageFiles.length > 0) {
  1290. if (existingImageFiles.length + imageFiles.length > 3) {
  1291. // 若加入新图片会超过 3 张,清空已有图片
  1292. this.fileList = this.fileList.filter(item => item.formatType !== 'image')
  1293. }
  1294. } else if (existingNonImageFiles.length > 0) {
  1295. // 若已有非图片文件,清空已有非图片文件
  1296. this.fileList = this.fileList.filter(item => item.formatType === 'image')
  1297. }
  1298. // 检查图片文件数量
  1299. if (imageFiles.length > 3) {
  1300. this.$message.error('图片文件最多只能选择 3 个,请重新选择')
  1301. return
  1302. }
  1303. for (const file of imageFiles) {
  1304. // 检查文件是否已存在
  1305. if (this.fileList.some(item => item.name === file.name)) {
  1306. this.$message.warning(`文件 ${file.name} 已存在,请勿重复上传`)
  1307. continue
  1308. }
  1309. const fileInfo = {
  1310. file: file,
  1311. size: file.size,
  1312. formatType: file.type.substring(0, file.type.indexOf('/')),
  1313. name: file.name,
  1314. postfix: file.name.substring(
  1315. file.name.lastIndexOf('.') + 1,
  1316. file.name.length
  1317. ),
  1318. px: ''
  1319. }
  1320. const fileBase64 = await this.getBase64(file)
  1321. const res = await this.getImgPx(fileBase64)
  1322. fileInfo.px = res.width + 'px*' + res.height + 'px'
  1323. this.fileList.push(fileInfo)
  1324. }
  1325. this.FetchAiFileUplaod(this.fileList)
  1326. } else if (nonImageFiles.length > 0) {
  1327. if (existingNonImageFiles.length > 0) {
  1328. // 若已有非图片文件,直接替换
  1329. this.fileList = this.fileList.filter(item => item.formatType === 'image')
  1330. } else if (existingImageFiles.length > 0) {
  1331. // 若已有图片文件,清空已有图片文件
  1332. this.fileList = this.fileList.filter(item => item.formatType !== 'image')
  1333. }
  1334. // 检查非图片文件数量
  1335. if (nonImageFiles.length > 1) {
  1336. this.$message.error('非图片文件最多只能选择 1 个,请重新选择')
  1337. return
  1338. }
  1339. for (const file of nonImageFiles) {
  1340. // 检查文件是否已存在
  1341. if (this.fileList.some(item => item.name === file.name)) {
  1342. this.$message.warning(`文件 ${file.name} 已存在,请勿重复上传`)
  1343. continue
  1344. }
  1345. const fileInfo = {
  1346. file: file,
  1347. size: file.size,
  1348. formatType: file.type.substring(0, file.type.indexOf('/')),
  1349. name: file.name,
  1350. postfix: file.name.substring(
  1351. file.name.lastIndexOf('.') + 1,
  1352. file.name.length
  1353. ),
  1354. px: ''
  1355. }
  1356. this.fileList.push(fileInfo)
  1357. }
  1358. this.FetchAiFileUplaod(this.fileList)
  1359. }
  1360. },
  1361. FetchAiFileUplaod(files) {
  1362. this.nowDate = getCurrentTime()
  1363. const promiseArray = files.map(async(item, index) => {
  1364. const json = {}
  1365. json.file_name = item.name
  1366. json.file_size = item.size
  1367. json.file_type = item.postfix
  1368. // json.file_path = this.filePath[index].path
  1369. json.file_path = ''
  1370. json.archive_id = this.arcId
  1371. json.file_dpi = item.px
  1372. json.file_thumbnail = ''
  1373. json.create_time = this.nowDate
  1374. json.id = null
  1375. json.last_modified = item.file.lastModified
  1376. // json.digital_summary = null
  1377. // json.public_key = null
  1378. // json.private_key = null
  1379. return json
  1380. })
  1381. console.log('promiseArray', promiseArray)
  1382. // 原始得上传文件二进制
  1383. const fileDefault = files.map(item => item.file)
  1384. Promise.all(promiseArray)
  1385. .then((arrayUpload) => {
  1386. // 上传附件
  1387. archivesUpload(this.baseApi + '/api/collect/uploadAssistEnterFiles',
  1388. fileDefault,
  1389. this.selectedCategory.id,
  1390. this.arcId,
  1391. JSON.stringify(arrayUpload)
  1392. ).then(res => {
  1393. if (res.data.code === 200) {
  1394. this.$message({ message: res.data.data, type: 'success', offset: 8 })
  1395. // this.aiJsonData = res.data;
  1396. // this.startTypingEffect();
  1397. } else {
  1398. this.$message({ message: '上传附件失败', type: 'error', offset: 8 })
  1399. }
  1400. // this.handleClose()
  1401. })
  1402. })
  1403. .catch((error) => {
  1404. console.error(error)
  1405. })
  1406. },
  1407. startTypingEffect() {
  1408. const lines = this.aiJsonData.split('\n')
  1409. this.currentLineIndex = 0
  1410. this.displayedText = ''
  1411. this.typingFinished = false
  1412. this.typingInterval = setInterval(() => {
  1413. if (this.currentLineIndex < lines.length) {
  1414. this.displayedText += lines[this.currentLineIndex] + '\n'
  1415. this.currentLineIndex++
  1416. } else {
  1417. clearInterval(this.typingInterval)
  1418. setTimeout(() => {
  1419. this.typingFinished = true
  1420. if (this.aiJsonData) {
  1421. // this.$refs.previewForm.archivesType = 'add'
  1422. this.$refs.previewForm.addOrUpdateForm = JSON.parse(this.aiJsonData)
  1423. this.aiLoading = false
  1424. }
  1425. }, 1000)
  1426. }
  1427. // 滚动条始终保持在底部
  1428. const container = this.$refs.typingContainer
  1429. if (container) {
  1430. container.scrollTop = container.scrollHeight
  1431. }
  1432. }, 200)
  1433. },
  1434. // 将上传的图片转为base64
  1435. getBase64(file) {
  1436. const reader = new FileReader()
  1437. reader.readAsDataURL(file)
  1438. return new Promise((resolve) => {
  1439. reader.onload = () => {
  1440. resolve(reader.result)
  1441. }
  1442. })
  1443. },
  1444. // 获取图片的分辨率
  1445. getImgPx(img) {
  1446. const image = new Image()
  1447. image.src = img
  1448. return new Promise((resolve) => {
  1449. image.onload = () => {
  1450. const width = image.width
  1451. const height = image.height
  1452. resolve({ width, height })
  1453. }
  1454. })
  1455. }
  1456. }
  1457. }
  1458. </script>
  1459. <style lang='scss' scoped>
  1460. ::v-deep .vue-treeselect__list-item{
  1461. width: 220px;
  1462. }
  1463. ::v-deep .vue-treeselect__menu {
  1464. padding: 20px 0;
  1465. }
  1466. ::v-deep .vue-treeselect__option--highlight{
  1467. background: #f5f9fc !important;
  1468. color: #0348f3 !important;
  1469. }
  1470. ::v-deep .vue-treeselect__option-arrow-container .vue-treeselect__option-arrow{
  1471. color: #1c1c1c !important;
  1472. }
  1473. ::v-deep .vue-treeselect__placeholder{
  1474. font-size: 14px;
  1475. }
  1476. ::v-deep .vue-treeselect__label-container{
  1477. font-size: 14px;
  1478. height: 34px;
  1479. line-height: 34px;
  1480. color: #1c1c1c;
  1481. }
  1482. ::v-deep .vue-treeselect__option.vue-treeselect__option--disabled{
  1483. .vue-treeselect__label-container{
  1484. color: #545b65 !important;
  1485. }
  1486. }
  1487. ::v-deep.vue-treeselect--has-value .vue-treeselect__single-value{
  1488. font-size: 14px;
  1489. }
  1490. .ai-preview-dialog{
  1491. ::v-deep .el-dialog{
  1492. width: 1300px !important;
  1493. .preview-content{
  1494. width: 728px !important;
  1495. }
  1496. }
  1497. }
  1498. pre {
  1499. background-color: #f4f4f4;
  1500. padding: 10px;
  1501. border: 1px solid #ccc;
  1502. border-radius: 4px;
  1503. white-space: pre-wrap;
  1504. word-wrap: break-word;
  1505. height: calc(100vh - 430px);
  1506. overflow: hidden;
  1507. overflow-y: auto;
  1508. }
  1509. </style>