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

915 lines
36 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
  1. <template>
  2. <div>
  3. <div class="collect-header">
  4. <h4 :class="classType">{{ collectTitle }} </h4>
  5. <!-- :class="[!(isRecycle && (isTitleType === 2 || (isTitleType === 3 && selectedCategory.arrangeType !== 3))) ? 'head-search is-recycle':'head-search']" -->
  6. <div class="collect-filter">
  7. <treeselect
  8. v-if="selectedCategory.arrangeType === 3 && isTitleType !== 4 && isTitleType !== 6 && activeIndex !== 1"
  9. v-model="query.projectClass"
  10. :options="projectOptions"
  11. style="width: 180px;"
  12. flat
  13. :multiple="false"
  14. :normalizer="normalizerProject"
  15. placeholder="请选择"
  16. />
  17. <treeselect
  18. v-if="isTitleType !== 6"
  19. v-model="query.classify"
  20. :options="classifyOptions"
  21. style="width: 180px;"
  22. flat
  23. :multiple="false"
  24. :normalizer="normalizer"
  25. placeholder="请选择档案分类"
  26. />
  27. </div>
  28. <div v-if="isTitleType !== 6" class="head-search">
  29. <!-- 搜索 -->
  30. <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)" />
  31. <el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="handleSearch(collectLevel)">搜索</el-button>
  32. <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left">重置</el-button>
  33. </div>
  34. <div v-if="!isRecycle" class="collect-menu">
  35. <el-menu
  36. :default-active="activeMenuIndex"
  37. mode="horizontal"
  38. @select="handleSelect"
  39. >
  40. <el-submenu index="1">
  41. <template slot="title">
  42. <i class="iconfont icon-changgui" />
  43. <span>常规</span>
  44. </template>
  45. <el-menu-item-group class="collect-submenu-group">
  46. <el-menu-item v-if="isTitleType !== 6" index="1-1" @click="handleForm('add')">新增</el-menu-item>
  47. <el-menu-item v-if="isTitleType !== 6" index="1-2" @click="handleForm('edit')">编辑</el-menu-item>
  48. <el-menu-item v-if="isTitleType !== 4" index="1-3" @click="toDelete">删除</el-menu-item>
  49. <el-menu-item v-if="isTitleType === 4" index="1-4" @click="toMove">移出</el-menu-item>
  50. </el-menu-item-group>
  51. <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">
  52. <template slot="title">原文上传</template>
  53. <el-menu-item index="1-5" @click="fileUpload(0)">普通上传</el-menu-item>
  54. <el-menu-item index="1-6" @click="fileUpload(1)">大文件上传</el-menu-item>
  55. </el-menu-item-group>
  56. </el-submenu>
  57. <el-submenu v-if="isTitleType !== 6" index="2">
  58. <template slot="title">
  59. <i class="iconfont icon-zhengli" />
  60. <span>整理</span>
  61. </template>
  62. <el-menu-item-group class="collect-submenu-group">
  63. <el-menu-item v-if="isTitleType !== 2" index="2-1" @click="handleBlukImport">批量导入</el-menu-item>
  64. <!-- 项目 / 案卷 / 卷内 / 文件-->
  65. <el-menu-item v-if="activeIndex !== 1 || (isTitleType === 3 && selectedCategory.arrangeType === 1 && activeIndex === 1)" index="2-2" @click="handleBlukEditing">批量修改</el-menu-item>
  66. <el-menu-item v-if="(isTitleType === 3 && selectedCategory.arrangeType === 2) && activeIndex === 0" index="2-3" @click="handleAdjustment('anjuan')">案卷顺序调整</el-menu-item>
  67. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1 " index="2-12" @click="handleJnSeqAdjustment">卷内顺序调整</el-menu-item>
  68. <el-menu-item v-if="isTitleType === 3 && selectedCategory.arrangeType === 1" index="2-3" @click="handleAdjustment('file')">文件顺序调整</el-menu-item>
  69. <el-menu-item v-if="isTitleType !== 2 && !(isTitleType === 3 && (selectedCategory.arrangeType === 1|| selectedCategory.arrangeType === 2) && activeIndex === 1)" index="2-4" @click="handleFileNumberUpdate">档号更新</el-menu-item>
  70. <!-- 案卷 -->
  71. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1 " index="2-5" @click="handleFileNumberUpdate">卷内档号更新</el-menu-item>
  72. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1" index="2-6" @click="handleUncoil">拆卷</el-menu-item>
  73. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1" index="2-7" @click="handleCombineFile">合卷</el-menu-item>
  74. <el-menu-item v-if="isTitleType === 3 && selectedCategory.arrangeType !== 1" index="2-8" @click="handleInsertFile">插件</el-menu-item>
  75. <!-- 案卷 / 卷内 / 文件 -->
  76. <el-menu-item v-if="isTitleType !== 2" index="2-9" @click="handleCollectMoveFile">移动</el-menu-item>
  77. <!-- 案卷 -->
  78. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0" index="2-10" @click="handleFiling">归档</el-menu-item>
  79. <!-- 文件 -->
  80. <el-menu-item v-if="(isTitleType === 3 && selectedCategory.arrangeType === 1) || (isTitleType === 3 && activeIndex === 1)" index="2-11" @click="handleReturn">退回预归档库</el-menu-item>
  81. </el-menu-item-group>
  82. <el-menu-item-group v-if="isTitleType === 3 && activeIndex === 1 && selectedCategory.arrangeType !== 1" class="collect-submenu-group submenu-tree">
  83. <template slot="title">组卷</template>
  84. <el-menu-item index="2-12" @click="handleQuickPaper">快速组卷</el-menu-item>
  85. <el-menu-item index="2-13" @click="handlePaper">手工组卷</el-menu-item>
  86. </el-menu-item-group>
  87. </el-submenu>
  88. <el-submenu index="3">
  89. <template slot="title">
  90. <i class="iconfont icon-gengduo" />
  91. <span>更多</span>
  92. </template>
  93. <el-menu-item-group class="collect-submenu-group">
  94. <el-menu-item v-if="isTitleType !== 6" index="3-1" @click="handleExport">导出</el-menu-item>
  95. <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>
  96. <el-menu-item v-if="!(isTitleType === 3 && (selectedCategory.arrangeType === 3 || selectedCategory.arrangeType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 6)" index="3-3" @click="handleFourTest">四性检测</el-menu-item>
  97. <el-menu-item v-if="isTitleType === 6" index="3-4" @click="handleOriginalDownload">下载</el-menu-item>
  98. </el-menu-item-group>
  99. <el-menu-item-group v-if="!(isTitleType === 3 && (selectedCategory.arrangeType === 3 || selectedCategory.arrangeType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 6)" class="collect-submenu-group submenu-tree">
  100. <template slot="title">电子文件目录</template>
  101. <el-menu-item index="3-5" @click="handleCatalogDownload">目录下载</el-menu-item>
  102. <el-menu-item index="3-6" @click="fileUpload(2)">目录上传</el-menu-item>
  103. </el-menu-item-group>
  104. </el-submenu>
  105. </el-menu>
  106. </div>
  107. <div v-if="isRecycle && (isTitleType === 2 || (isTitleType === 3 && selectedCategory.arrangeType !== 3))" class="collect-menu">
  108. <el-button class="filter-item" size="mini" type="success" @click="toRecover"><i class="iconfont icon-huifu" />恢复</el-button>
  109. <el-button class="filter-item" size="mini" type="success" @click="toCompletelyDelete"><i class="iconfont icon-shanchu" />彻底删除</el-button>
  110. </div>
  111. <!--新增 / 编辑 表单组件-->
  112. <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">
  113. <span class="dialog-right-top" />
  114. <span class="dialog-left-bottom" />
  115. <div class="setting-dialog">
  116. <!-- form @emitTableList="getTableList" -->
  117. <PreviewForm
  118. v-if="formPreviewData.length"
  119. ref="previewForm"
  120. :is-has-code="true"
  121. :is-disabled="false"
  122. :form-preview-data.sync="formPreviewData"
  123. :selected-category="selectedCategory"
  124. :arc-id="arcId"
  125. :is-des-form-type="isDesFormType"
  126. :is-title-type="isTitleType"
  127. :collect-level="collectLevel"
  128. @close-dialog="closeDialog"
  129. />
  130. <div slot="footer" class="dialog-footer">
  131. <el-button type="primary" @click="handlerArchivesSubmit">保存</el-button>
  132. </div>
  133. </div>
  134. </el-dialog>
  135. <!--删除对话框组件-->
  136. <el-dialog class="tip-dialog" title="提示" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="deleteVisible">
  137. <div class="setting-dialog">
  138. <div class="tip-content">
  139. <p class="tipMsg">此删除将把会所选条目与其子集放入回收站</p>
  140. <span>你是否还要继续?</span>
  141. </div>
  142. <div slot="footer" class="dialog-footer">
  143. <el-button type="text" @click="deleteVisible = false">取消</el-button>
  144. <el-button type="primary" @click.native="handleDelConfirm">确定</el-button>
  145. </div>
  146. </div>
  147. </el-dialog>
  148. <!--卷内移出 组件-->
  149. <el-dialog class="tip-dialog" title="提示" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="moveVisible">
  150. <div class="setting-dialog">
  151. <div class="tip-content">
  152. <p class="tipMsg">此移出将把会所选条目返还到未整理列表</p>
  153. <span>你是否还要继续?</span>
  154. </div>
  155. <div slot="footer" class="dialog-footer">
  156. <el-button type="text" @click="moveVisible = false">取消</el-button>
  157. <el-button type="primary" @click.native="handleMoveConfirm">确定</el-button>
  158. </div>
  159. </div>
  160. </el-dialog>
  161. <!-- 原文上传 -->
  162. <UploadOriginal ref="uploadOriginalRef" />
  163. <!-- 批量导入 -->
  164. <BlukImport ref="blukImportRef" />
  165. <!-- 批量修改 -->
  166. <BlukEditing ref="blukEditingRef" />
  167. <!-- 档案调整 -->
  168. <FileNumberAdjustment ref="fileNumberAdjustmentRef" :selected-category="selectedCategory" />
  169. <!-- 档号更新 -->
  170. <el-dialog class="tip-dialog" title="档号更新" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="updateVisible">
  171. <div class="setting-dialog">
  172. <div class="tip-content">
  173. <p class="tipMsg">此操作将会自动重新生成档号</p>
  174. <span>你是否还要继续?</span>
  175. </div>
  176. <div slot="footer" class="dialog-footer">
  177. <el-button type="text" @click="updateVisible = false">取消</el-button>
  178. <el-button type="primary" @click.native="handleUpdateConfirm">确定</el-button>
  179. </div>
  180. </div>
  181. </el-dialog>
  182. <!-- 卷内顺序调整 -->
  183. <FileSeqAdjustment ref="fileSeqAdjustmentRef" :selected-category="selectedCategory" />
  184. <!-- 拆卷 -->
  185. <el-dialog class="tip-dialog" title="拆卷" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="uncoilVisible">
  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="uncoilVisible = false">取消</el-button>
  193. <el-button type="primary" @click.native="handleUncoilConfirm">确定</el-button>
  194. </div>
  195. </div>
  196. </el-dialog>
  197. <!-- 合卷 -->
  198. <CombineFile ref="combineFileRef" />
  199. <!-- 插件 -->
  200. <InsertFile ref="insertFileRef" />
  201. <!-- 移动 -->
  202. <CollectMoveFile ref="collectMoveFileRef" />
  203. <!-- 归档 -->
  204. <el-dialog class="tip-dialog" title="归档" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="filingVisible">
  205. <div class="setting-dialog">
  206. <div class="tip-content">
  207. <p class="tipMsg">此操作将会把所选条目提交归档</p>
  208. <span>你是否还要继续?</span>
  209. </div>
  210. <div slot="footer" class="dialog-footer">
  211. <el-button type="text" @click="filingVisible = false">取消</el-button>
  212. <el-button type="primary" @click.native="handleFilingConfirm">确定</el-button>
  213. </div>
  214. </div>
  215. </el-dialog>
  216. <!-- 退回预归档库 -->
  217. <el-dialog class="tip-dialog" title="退回预归档库" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="returnVisible">
  218. <div class="setting-dialog">
  219. <div class="tip-content">
  220. <p class="tipMsg">此移出将把会所选条目退回到预归档库</p>
  221. <span>你是否还要继续?</span>
  222. </div>
  223. <div slot="footer" class="dialog-footer">
  224. <el-button type="text" @click="returnVisible = false">取消</el-button>
  225. <el-button type="primary" @click.native="handleReturnConfirm">确定</el-button>
  226. </div>
  227. </div>
  228. </el-dialog>
  229. <!-- 导出 -->
  230. <el-dialog class="tip-dialog" title="导出" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="exportVisible">
  231. <div class="setting-dialog">
  232. <div class="tip-content">
  233. <p class="tipMsg">此操作将导出所选数据</p>
  234. <span>你是否还要继续?</span>
  235. </div>
  236. <div slot="footer" class="dialog-footer">
  237. <el-button type="text" @click="downloadVisible = false">取消</el-button>
  238. <el-button v-loading="delAllLoading" type="primary" @click.native="handleExportConfirm">确定</el-button>
  239. </div>
  240. </div>
  241. </el-dialog>
  242. <!-- 打印 -->
  243. <Print ref="printRef" />
  244. <!-- 四性检测 -->
  245. <FourTest ref="fourTestRef" />
  246. <!-- 目录下载 -->
  247. <el-dialog class="tip-dialog" title="目录下载" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="downloadVisible">
  248. <div class="setting-dialog">
  249. <div class="tip-content">
  250. <p class="tipMsg">此操作将下载所选条目目录</p>
  251. <span>你是否还要继续?</span>
  252. </div>
  253. <div slot="footer" class="dialog-footer">
  254. <el-button type="text" @click="downloadVisible = false">取消</el-button>
  255. <el-button type="primary" @click.native="handleCatDownloadConfirm">确定</el-button>
  256. </div>
  257. </div>
  258. </el-dialog>
  259. <!-- 快速组卷 -->
  260. <QuickPaper ref="quickPaperRef" />
  261. <!-- 回收站 - 恢复 -->
  262. <el-dialog class="tip-dialog" title="提示" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="recoverVisible">
  263. <div class="setting-dialog">
  264. <div class="tip-content">
  265. <p class="tipMsg">此恢复将会把所选条目及其子集一并恢复</p>
  266. <span>你是否还要继续?</span>
  267. </div>
  268. <div slot="footer" class="dialog-footer">
  269. <el-button type="text" @click="recoverVisible = false">取消</el-button>
  270. <el-button type="primary" @click.native="handleRecover">确定</el-button>
  271. </div>
  272. </div>
  273. </el-dialog>
  274. <!-- 回收站 - 彻底删除 -->
  275. <el-dialog class="tip-dialog" title="提示" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="completelyDeleteVisible">
  276. <div class="setting-dialog">
  277. <div class="tip-content">
  278. <p class="tipMsg">此删除将把会所选条目与其子集彻底删除</p>
  279. <span>你是否还要继续?</span>
  280. </div>
  281. <div slot="footer" class="dialog-footer">
  282. <el-button type="text" @click="completelyDeleteVisible = false">取消</el-button>
  283. <el-button type="primary" @click.native="handleCompletelyDelete">确定</el-button>
  284. </div>
  285. </div>
  286. </el-dialog>
  287. </div>
  288. <div style="height: 30px; line-height: 30px; padding: 0 20px; font-size: 12px;"> <span v-if="(isTitleType !== 2 && selectedCategory.arrangeType === 3 ) || ((isTitleType === 4 || isTitleType === 6) && selectedCategory.arrangeType === 2) || (isTitleType === 6 && selectedCategory.arrangeType === 1)">{{ test }}</span></div>
  289. </div>
  290. </template>
  291. <script>
  292. import CRUD, { crud } from '@crud/crud'
  293. import { collectionLibraryCrud } from '../mixins/index'
  294. import { FetchInitCategoryInputFieldByPid } from '@/api/system/category/category'
  295. import { FetchDetailsById, collectDel, FetchRemoveArchivesSingle } from '@/api/collect/collect'
  296. import { FetchArchivesClassTree } from '@/api/system/archivesClass'
  297. import { FetchDictionaryTree } from '@/api/system/dict'
  298. import Treeselect from '@riophae/vue-treeselect'
  299. import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  300. // import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
  301. import PreviewForm from '@/views/components/category/PreviewForm'
  302. import UploadOriginal from './uploadOriginal/index'
  303. import BlukImport from './bulkImport/index'
  304. import BlukEditing from './blukEditing/index'
  305. import FileNumberAdjustment from './fileNumberAdjustment/index'
  306. import FileSeqAdjustment from './fileSeqAdjustment/index'
  307. import CombineFile from './combineFile/index'
  308. import InsertFile from './insertFile/index'
  309. import CollectMoveFile from './collectMoveFile/index'
  310. import Print from './print/index'
  311. import FourTest from './fourTest/index'
  312. import QuickPaper from './quickPaper/index'
  313. // import { exportFile } from '@/utils/index'
  314. import { mapGetters } from 'vuex'
  315. export default {
  316. name: 'CollectHeader',
  317. components: { Treeselect, PreviewForm, UploadOriginal, BlukImport, BlukEditing, FileNumberAdjustment, FileSeqAdjustment, CombineFile, InsertFile, CollectMoveFile, Print, FourTest, QuickPaper },
  318. mixins: [collectionLibraryCrud, crud()],
  319. props: {
  320. selectedCategory: {
  321. type: Object,
  322. default: function() {
  323. return {}
  324. }
  325. },
  326. isTitleType: {
  327. type: Number,
  328. default: 2
  329. },
  330. selections: {
  331. type: Array,
  332. default: () => []
  333. },
  334. activeIndex: {
  335. type: Number,
  336. default: 0
  337. },
  338. test: {
  339. type: String,
  340. default: function() {
  341. return ''
  342. }
  343. },
  344. isRecycle: {
  345. type: Boolean,
  346. default: false
  347. }
  348. },
  349. inject: ['parentsData'],
  350. data() {
  351. return {
  352. activeMenuIndex: '1',
  353. formVisible: false,
  354. formTitle: '项目',
  355. formPreviewData: [], // 预览界面data
  356. query: {
  357. projectClass: null,
  358. classify: null
  359. },
  360. projectOptions: [],
  361. classifyOptions: [],
  362. delAllLoading: false,
  363. deleteVisible: false,
  364. moveVisible: false,
  365. updateVisible: false,
  366. uncoilVisible: false,
  367. filingVisible: false,
  368. exportVisible: false,
  369. returnVisible: false,
  370. downloadVisible: false,
  371. recoverVisible: false,
  372. completelyDeleteVisible: false,
  373. isDesFormType: 'arcives', // 区分是门类得还是档案得
  374. arcId: null
  375. }
  376. },
  377. computed: {
  378. ...mapGetters([
  379. 'baseApi'
  380. ]),
  381. collectTitle() {
  382. if (this.isTitleType === 2) {
  383. return '项目'
  384. } else if (this.isTitleType === 3) {
  385. if (this.selectedCategory.arrangeType === 1) {
  386. return '文件'
  387. } else {
  388. if (this.activeIndex === 1) {
  389. return '文件'
  390. } else {
  391. return '案卷'
  392. }
  393. }
  394. } else if (this.isTitleType === 4) {
  395. return '卷内'
  396. } else if (this.isTitleType === 6) {
  397. return '原文'
  398. }
  399. return ''
  400. },
  401. collectLevel() {
  402. if (this.isTitleType === 2) {
  403. return 1
  404. } else if (this.isTitleType === 3) {
  405. if (this.selectedCategory.arrangeType === 1) {
  406. return 3
  407. } else {
  408. if (this.activeIndex === 1) {
  409. return 3
  410. } else {
  411. return 2
  412. }
  413. }
  414. } else if (this.isTitleType === 4) {
  415. return 3
  416. } else if (this.isTitleType === 6) {
  417. return 4
  418. }
  419. return null
  420. },
  421. classType() {
  422. if (this.isTitleType === 2) {
  423. return ''
  424. } else if (this.isTitleType === 3) {
  425. return 'is-anjuan'
  426. } else if (this.isTitleType === 4) {
  427. return 'is-juannei'
  428. } else if (this.isTitleType === 6) {
  429. return 'is-file'
  430. }
  431. return ''
  432. },
  433. placeholderType() {
  434. if (this.isTitleType === 2) {
  435. return '输入项目名称或编号'
  436. } else if (this.isTitleType === 3 || this.isTitleType === 4) {
  437. return '输入题名或档号'
  438. }
  439. return '输入项目名称或编号'
  440. }
  441. },
  442. watch: {
  443. selectedCategory: function(newValue, oldValue) {
  444. if (newValue && newValue.id) {
  445. this.getInitArchivesClass()
  446. this.getDictsList()
  447. }
  448. },
  449. isTitleType: function(newValue, oldValue) {
  450. console.log('newValue', newValue)
  451. }
  452. },
  453. created() {
  454. },
  455. mounted() {
  456. this.getInitArchivesClass()
  457. this.getDictsList()
  458. },
  459. methods: {
  460. // 筛选 - 档案分类
  461. getInitArchivesClass() {
  462. this.classifyOptions = []
  463. const params = {
  464. 'categoryId': this.selectedCategory.id
  465. }
  466. FetchArchivesClassTree(params).then((res) => {
  467. this.classifyOptions = JSON.parse(JSON.stringify(res))
  468. }).catch(err => {
  469. console.log(err)
  470. })
  471. },
  472. normalizer(node) {
  473. if (node.childArchivesClass === null) {
  474. delete node.childArchivesClass
  475. }
  476. return {
  477. id: node.code,
  478. label: node.name,
  479. children: node.childArchivesClass
  480. }
  481. },
  482. // 项目级别 - 阶段分类
  483. getDictsList() {
  484. this.projectOptions = []
  485. FetchDictionaryTree().then((res) => {
  486. const filterCodes = ['project_class']
  487. let filteredItems = JSON.parse(JSON.stringify(res)).filter(item => filterCodes.includes(item.dictionaryCode))
  488. filteredItems = this.addLevelToDictionaryList(filteredItems, 1)
  489. if (this.selectedCategory.arrangeType === 3 && this.isTitleType === 3) {
  490. this.projectOptions = filteredItems
  491. // console.log(this.projectOptions)
  492. } else {
  493. this.projectOptions = this.filterData(filteredItems, filteredItems[0].id)
  494. }
  495. }).catch(err => {
  496. console.log(err)
  497. })
  498. },
  499. // 显示第一级和第二级
  500. filterData(data, targetId) {
  501. return data.filter(item => {
  502. if (item.id === targetId || item.dictionaryParents === targetId) {
  503. if (item.childDictionarys && item.childDictionarys.length > 0) {
  504. item.childDictionarys = this.filterData(item.childDictionarys, targetId)
  505. }
  506. return true
  507. }
  508. return false
  509. })
  510. },
  511. // 给筛选出来的数据加level 方便后面是否可点击
  512. addLevelToDictionaryList(dictionaryList, level) {
  513. dictionaryList.forEach(dictionary => {
  514. dictionary.level = level
  515. if (dictionary.childDictionarys) {
  516. dictionary.childDictionarys = this.addLevelToDictionaryList(dictionary.childDictionarys, level + 1)
  517. }
  518. })
  519. return dictionaryList
  520. },
  521. normalizerProject(node) {
  522. if ((node.childDictionarys && !node.childDictionarys.length) || node.childDictionarys === null) {
  523. delete node.childDictionarys
  524. }
  525. return {
  526. id: node.dictionaryCode,
  527. label: node.dictionaryName,
  528. children: node.childDictionarys,
  529. isDisabled: this.isTitleType === 3 ? node.level !== 3 : node.level === 1
  530. }
  531. },
  532. handleSelect(key, keyPath) {
  533. console.log(key, keyPath)
  534. },
  535. // 著录界面-form/详情-api
  536. handleForm(type) {
  537. if (type === 'add') {
  538. this.formTitle = '新增' + this.collectTitle
  539. this.arcId = null
  540. } else if (type === 'edit') {
  541. console.log(this.selections)
  542. this.arcId = this.selections[0].id
  543. if (this.selections.length === 0) {
  544. this.$message('您还未勾选需要操作的条目,请先确认!')
  545. return false
  546. } else if (this.selections.length > 1) {
  547. this.$message('编辑操作只可勾选唯一目标条目,请先确认!')
  548. return false
  549. }
  550. this.formTitle = '编辑' + this.collectTitle
  551. }
  552. // this.form.dictionaryConfigId = {}
  553. // this.formPreviewData = []
  554. // 档案预编辑获取字段
  555. this.formVisible = true
  556. this.$nextTick(() => {
  557. this.getFormInfo(type)
  558. })
  559. },
  560. getFormInfo(type) {
  561. if (type === 'edit') {
  562. const params = {
  563. 'categoryId': this.selectedCategory.id,
  564. 'categoryLevel': this.collectLevel,
  565. 'id': this.arcId
  566. }
  567. FetchDetailsById(params).then(data => {
  568. const showFiledAll = data.showFiled.filter(item => item.isSequence).sort((a, b) => a.isSequence - b.isSequence)
  569. this.$nextTick(() => {
  570. this.formPreviewData = showFiledAll
  571. this.isDesFormType = 'arcives'
  572. this.$nextTick(() => {
  573. this.$refs.previewForm.archivesType = 'edit'
  574. this.$refs.previewForm.addOrUpdateForm = data.echo
  575. this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
  576. })
  577. })
  578. })
  579. } else {
  580. const params = {
  581. 'categoryId': this.selectedCategory.id,
  582. 'categoryLevel': this.collectLevel
  583. }
  584. FetchInitCategoryInputFieldByPid(params).then(data => {
  585. this.formPreviewData = data
  586. this.isDesFormType = 'arcives'
  587. this.$nextTick(() => {
  588. this.$refs.previewForm.archivesType = 'add'
  589. this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
  590. })
  591. })
  592. }
  593. },
  594. // form - submit
  595. handlerArchivesSubmit() {
  596. this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id,)
  597. },
  598. // 删除 - 关闭
  599. handleClose(done) {
  600. this.formVisible = false
  601. done()
  602. },
  603. // 删除
  604. toDelete() {
  605. if (this.selections.length === 0) {
  606. this.$message('您还未勾选需要操作的条目,请先确认!')
  607. return false
  608. }
  609. this.deleteVisible = true
  610. },
  611. // 卷内 - 移除
  612. toMove() {
  613. if (this.selections.length === 0) {
  614. this.$message('您还未勾选需要操作的条目,请先确认!')
  615. return false
  616. }
  617. this.moveVisible = true
  618. },
  619. // 删除 - 确认
  620. handleDelConfirm() {
  621. this.delAllLoading = true
  622. const archivesIds = []
  623. this.selections.forEach(val => {
  624. archivesIds.push(val.id)
  625. })
  626. const params = {
  627. 'categoryId': this.selectedCategory.id,
  628. 'categoryLevel': this.collectLevel,
  629. 'archivesIds': archivesIds
  630. }
  631. console.log(params)
  632. collectDel(params).then(() => {
  633. this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
  634. this.deleteVisible = false
  635. this.crud.refresh()
  636. this.delAllLoading = false
  637. }).catch(err => {
  638. this.delAllLoading = false
  639. console.log(err)
  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. console.log(params)
  655. FetchRemoveArchivesSingle(params).then((res) => {
  656. console.log(res)
  657. if (res.code !== 500) {
  658. this.crud.notify('移出成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
  659. this.handleSearch(this.collectLevel)
  660. } else {
  661. this.crud.notify('移出失败', CRUD.NOTIFICATION_TYPE.SUCCESS)
  662. }
  663. this.moveVisible = false
  664. }).catch(err => {
  665. console.log(err)
  666. })
  667. },
  668. // 原文上传
  669. fileUpload(uploadType) {
  670. if (this.isTitleType !== 6) {
  671. if (this.selections.length === 0) {
  672. this.$message('您还未勾选需要操作的条目,请先确认!')
  673. return false
  674. }
  675. if (this.selections.length > 1) {
  676. this.$message('上传操作只可勾选唯一目标条目,请先确认!')
  677. return false
  678. }
  679. }
  680. if (uploadType === 0) {
  681. this.$refs.uploadOriginalRef.uploadTitle = '普通上传'
  682. } else if (uploadType === 1) {
  683. this.$refs.uploadOriginalRef.uploadTitle = '大文件上传'
  684. } else if (uploadType === 2) {
  685. this.$refs.uploadOriginalRef.uploadTitle = '原文目录上传'
  686. }
  687. this.$refs.uploadOriginalRef.uploadVisible = true
  688. this.$refs.uploadOriginalRef.uploadType = uploadType
  689. this.$refs.uploadOriginalRef.fileList = []
  690. },
  691. // 批量导入
  692. handleBlukImport() {
  693. this.$refs.blukImportRef.bulkImportVisible = true
  694. },
  695. // 批量修改
  696. handleBlukEditing() {
  697. if (this.selections.length === 0) {
  698. this.$message('您还未勾选需要操作的条目,请先确认!')
  699. return false
  700. }
  701. this.$refs.blukEditingRef.bulkEditingVisible = true
  702. },
  703. // 案卷/文件顺序调整
  704. handleAdjustment(type) {
  705. if (this.selections.length < 2) {
  706. this.$message('请选择多个案卷后进行操作!')
  707. return false
  708. }
  709. if (type === 'anjuan') {
  710. this.$refs.fileNumberAdjustmentRef.titleAdjustment = '案卷顺序调整'
  711. } else {
  712. this.$refs.fileNumberAdjustmentRef.titleAdjustment = '文件顺序调整'
  713. }
  714. this.$refs.fileNumberAdjustmentRef.adjustmentVisible = true
  715. // if (this.selections.length === 0) {
  716. // this.$refs.fileNumberAdjustmentRef.adjustmentTipVisible = true
  717. // } else {
  718. // this.$refs.fileNumberAdjustmentRef.adjustmentVisible = true
  719. // }
  720. },
  721. // 卷内顺序调整
  722. handleJnSeqAdjustment() {
  723. if (this.selections.length === 0) {
  724. this.$message('您还未勾选需要操作的条目,请先确认!')
  725. return false
  726. }
  727. if (this.selections.length > 1) {
  728. this.$message('顺序调整操作只可勾选唯一目标条目,请先确认!')
  729. return false
  730. }
  731. this.$refs.fileSeqAdjustmentRef.adjustmentVisible = true
  732. },
  733. // 档号更新
  734. handleFileNumberUpdate() {
  735. if (this.selections.length === 0) {
  736. this.$message('您还未勾选需要操作的条目,请先确认!')
  737. return false
  738. }
  739. this.updateVisible = true
  740. },
  741. handleUpdateConfirm() {
  742. this.updateVisible = false
  743. },
  744. // 拆卷
  745. handleUncoil() {
  746. if (this.selections.length === 0) {
  747. this.$message('您还未勾选需要操作的条目,请先确认!')
  748. return false
  749. }
  750. this.uncoilVisible = true
  751. },
  752. handleUncoilConfirm() {
  753. this.uncoilVisible = false
  754. },
  755. // 合卷
  756. handleCombineFile() {
  757. if (this.selections.length < 2) {
  758. this.$message('合卷操作至少勾选2个案卷,请重试!')
  759. return false
  760. }
  761. this.$refs.combineFileRef.combineFileVisible = true
  762. },
  763. // 插件
  764. handleInsertFile() {
  765. if (this.selections.length !== 1) {
  766. this.$message('插卷操作只可勾选唯一目标条目,请先确认!')
  767. return false
  768. }
  769. this.$refs.insertFileRef.insertFileVisible = true
  770. },
  771. // 移动
  772. handleCollectMoveFile() {
  773. if (this.selections.length === 0) {
  774. this.$message('您还未勾选需要操作的条目,请先确认!')
  775. return false
  776. }
  777. this.$refs.collectMoveFileRef.collectMoveFileVisible = true
  778. },
  779. // 归档
  780. handleFiling() {
  781. if (this.selections.length === 0) {
  782. this.$message('您还未勾选需要操作的条目,请先确认!')
  783. return false
  784. }
  785. this.filingVisible = true
  786. },
  787. handleFilingConfirm() {
  788. this.filingVisible = false
  789. },
  790. // 退回预归档库
  791. handleReturn() {
  792. if (this.selections.length > 1 || this.selections.length === 0) {
  793. this.$message('该操作只可勾选唯一目标条目,请先确认!')
  794. return false
  795. }
  796. this.returnVisible = true
  797. },
  798. handleReturnConfirm() {
  799. this.returnVisible = false
  800. },
  801. // 导出
  802. handleExport() {
  803. this.exportVisible = true
  804. },
  805. handleExportConfirm() {
  806. this.exportVisible = false
  807. },
  808. // 打印
  809. handlePrint() {
  810. if (this.selections.length === 0) {
  811. this.$refs.printRef.form.printRange = '当页条目'
  812. } else {
  813. this.$refs.printRef.form.printRange = '勾选条目'
  814. }
  815. this.$refs.printRef.printVisible = true
  816. },
  817. // 四性检测
  818. handleFourTest() {
  819. if (this.selections.length === 0) {
  820. this.$message('您还未勾选需要操作的条目,请先确认!')
  821. return false
  822. }
  823. this.$refs.fourTestRef.fourTestVisible = true
  824. this.$refs.fourTestRef.tableData = this.selections
  825. },
  826. // 目录下载
  827. handleCatalogDownload() {
  828. if (this.selections.length === 0) {
  829. this.$message('您还未勾选需要操作的条目,请先确认!')
  830. return false
  831. }
  832. this.downloadVisible = true
  833. },
  834. handleCatDownloadConfirm() {
  835. // const params = {
  836. // 'orderNo': id
  837. // }
  838. // exportFile(this.baseApi + '/api/arrange/exportArrange?' + qs.stringify(params, { indices: false }))
  839. this.downloadVisible = false
  840. },
  841. // 快速组卷
  842. handleQuickPaper() {
  843. this.$refs.quickPaperRef.quickVisible = true
  844. },
  845. // 手工组卷
  846. handlePaper() {
  847. if (this.selections.length === 0) {
  848. this.$message('您还未勾选需要操作的条目,请先确认!')
  849. return false
  850. }
  851. this.handleForm('add')
  852. },
  853. // 原文内的附件下载
  854. handleOriginalDownload() {
  855. if (this.selections.length > 1 || this.selections.length === 0) {
  856. this.$message('下载操作只可勾选唯一目标条目,请先确认!')
  857. return false
  858. }
  859. },
  860. // 回收站 - 恢复
  861. toRecover() {
  862. if (this.selections.length === 0) {
  863. this.$message('您还未勾选需要操作的条目,请先确认!')
  864. return false
  865. }
  866. this.recoverVisible = true
  867. },
  868. handleRecover() {
  869. this.recoverVisible = false
  870. },
  871. // 回收站 - 彻底删除
  872. toCompletelyDelete() {
  873. if (this.selections.length === 0) {
  874. this.$message('您还未勾选需要操作的条目,请先确认!')
  875. return false
  876. }
  877. this.completelyDeleteVisible = true
  878. },
  879. handleCompletelyDelete() {
  880. this.completelyDeleteVisible = false
  881. },
  882. closeDialog(data) {
  883. this.formVisible = false
  884. this.$parent.$parent.getTableDisplayFieldsLoading = true
  885. setTimeout(() => {
  886. this.getViewTableList(this.collectLevel, 'search', data)
  887. })
  888. console.log('this', this)
  889. }
  890. }
  891. }
  892. </script>
  893. <style lang='scss' scoped>
  894. </style>