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

475 lines
18 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
  1. <template>
  2. <div>
  3. <div :class="[ isTitleType === 6 || isTitleType === 2 ? 'collect-header manage-fixed-style' : 'collect-header']">
  4. <h4 :class="classType">{{ collectTitle }} <span v-if="isTitleType !== 2 && !(isTitleType === 3 && (selectedCategory.arrangeType === 1 || selectedCategory.arrangeType === 2) )"> > {{ test }}</span></h4>
  5. <div class="head-search">
  6. <el-select
  7. v-if="isTitleType === 3 && selectedCategory.arrangeType !== 3"
  8. v-model="selectStatus"
  9. multiple
  10. collapse-tags
  11. style="margin-right: 10px;"
  12. placeholder="请选择"
  13. >
  14. <el-option
  15. v-for="item in options"
  16. :key="item.value"
  17. :label="item.label"
  18. :value="item.value"
  19. />
  20. </el-select>
  21. <!-- 搜索 -->
  22. <div v-if="isTitleType !== 6">
  23. <el-input v-model="query.search" clearable size="small" :placeholder="placeholderType" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" />
  24. <el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="handleSearch">搜索</el-button>
  25. <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left">重置</el-button>
  26. </div>
  27. </div>
  28. <div v-if="!isRecycle" class="collect-menu">
  29. <el-menu
  30. :default-active="activeMenuIndex"
  31. mode="horizontal"
  32. @select="handleSelect"
  33. >
  34. <el-submenu v-if="isTitleType !== 6" index="1">
  35. <template slot="title">
  36. <i class="iconfont icon-changgui" />
  37. <span>常规</span>
  38. </template>
  39. <el-menu-item-group class="collect-submenu-group">
  40. <el-menu-item v-if="isTitleType !== 6" index="1-1" @click="handleForm('edit')">编辑</el-menu-item>
  41. </el-menu-item-group>
  42. </el-submenu>
  43. <el-submenu v-if="selectedCategory.isType === 2 && isTitleType !==4 && isTitleType !== 6" index="2">
  44. <template slot="title">
  45. <i class="iconfont icon-zhengli" />
  46. <span>整理</span>
  47. </template>
  48. <el-menu-item-group class="collect-submenu-group">
  49. <el-menu-item v-if="isTitleType === 3" index="2-1" @click="bindingTag(selections)">标签绑定</el-menu-item>
  50. <el-menu-item-group v-if="isTitleType === 3" class="collect-submenu-group submenu-tree">
  51. <template slot="title">档案装盒</template>
  52. <el-menu-item index="2-2">装盒</el-menu-item>
  53. <el-menu-item v-if="selectedCategory.arrangeType !== 1" index="2-3">分卷装盒</el-menu-item>
  54. </el-menu-item-group>
  55. <el-menu-item-group v-if="selectedCategory.isType === 2" class="collect-submenu-group submenu-tree">
  56. <template slot="title">档案移交</template>
  57. <el-menu-item index="2-4">在线移交</el-menu-item>
  58. <el-menu-item index="2-5">离线移交</el-menu-item>
  59. </el-menu-item-group>
  60. <el-menu-item v-if="selectedCategory.isType === 2" index="2-6">导出ZIP包</el-menu-item>
  61. <el-menu-item v-if="selectedCategory.isType === 2" index="2-7">档案退回</el-menu-item>
  62. <el-menu-item v-if="isTitleType === 3 " index="2-8">开放鉴定</el-menu-item>
  63. <el-menu-item v-if="isTitleType === 3 " index="2-9">销毁鉴定</el-menu-item>
  64. </el-menu-item-group>
  65. </el-submenu>
  66. <el-submenu index="3">
  67. <template slot="title">
  68. <i class="iconfont icon-gengduo" />
  69. <span>更多</span>
  70. </template>
  71. <el-menu-item-group class="collect-submenu-group">
  72. <el-menu-item v-if="isTitleType !== 6" index="3-1" @click="handleExport">导出</el-menu-item>
  73. <el-menu-item v-if="isTitleType === 3" index="3-2" @click="handlePrint">打印</el-menu-item>
  74. <el-menu-item v-if="isTitleType === 6" index="3-3" @click="handleOriginalDownload">下载</el-menu-item>
  75. </el-menu-item-group>
  76. </el-submenu>
  77. </el-menu>
  78. </div>
  79. <div v-if="isRecycle && (isTitleType === 2 || (isTitleType === 3 && selectedCategory.arrangeType !== 3))" class="collect-menu">
  80. <el-button class="filter-item" size="mini" type="success" @click="toRecover"><i class="iconfont icon-huifu" />恢复</el-button>
  81. <el-button class="filter-item" size="mini" type="success" @click="toCompletelyDelete"><i class="iconfont icon-shanchu" />彻底删除</el-button>
  82. </div>
  83. <!--新增 / 编辑 表单组件-->
  84. <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">
  85. <span class="dialog-right-top" />
  86. <span class="dialog-left-bottom" />
  87. <div class="setting-dialog">
  88. <!-- @emitTableList="getTableList" -->
  89. <PreviewForm v-if="formPreviewData.length" ref="previewForm" :is-has-code="true" :is-disabled="false" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :parents-id="parentsId" :arc-id="arcId" :is-des-form-type="isDesFormType" />
  90. <div slot="footer" class="dialog-footer">
  91. <el-button type="primary" @click="handlerArchivesSubmit">保存</el-button>
  92. </div>
  93. </div>
  94. </el-dialog>
  95. <!-- 绑定标签 -->
  96. <binding-tag-dlg ref="bindingTag" :binding-id="selections[0] && selections[0].id" :binding-type="1" binding-txt="档案" />
  97. <!--删除对话框组件-->
  98. <el-dialog class="tip-dialog" title="提示" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="deleteVisible">
  99. <div class="setting-dialog">
  100. <div class="tip-content">
  101. <p class="tipMsg">此删除将把会所选条目与其子集放入回收站</p>
  102. <span>你是否还要继续?</span>
  103. </div>
  104. <div slot="footer" class="dialog-footer">
  105. <el-button type="text" @click="deleteVisible = false">取消</el-button>
  106. <el-button type="primary" @click.native="handleDelConfirm">确定</el-button>
  107. </div>
  108. </div>
  109. </el-dialog>
  110. <!-- 导出 -->
  111. <el-dialog class="tip-dialog" title="导出" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="exportVisible">
  112. <div class="setting-dialog">
  113. <div class="tip-content">
  114. <p class="tipMsg">此操作将导出所选数据</p>
  115. <span>你是否还要继续?</span>
  116. </div>
  117. <div slot="footer" class="dialog-footer">
  118. <el-button type="text" @click="downloadVisible = false">取消</el-button>
  119. <el-button type="primary" @click.native="handleExportConfirm">确定</el-button>
  120. </div>
  121. </div>
  122. </el-dialog>
  123. <!-- 打印 -->
  124. <Print ref="printRef" />
  125. <!-- 回收站 - 恢复 -->
  126. <el-dialog class="tip-dialog" title="提示" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="recoverVisible">
  127. <div class="setting-dialog">
  128. <div class="tip-content">
  129. <p class="tipMsg">此恢复将会把所选条目及其子集一并恢复</p>
  130. <span>你是否还要继续?</span>
  131. </div>
  132. <div slot="footer" class="dialog-footer">
  133. <el-button type="text" @click="recoverVisible = false">取消</el-button>
  134. <el-button type="primary" @click.native="handleRecover">确定</el-button>
  135. </div>
  136. </div>
  137. </el-dialog>
  138. <!-- 回收站 - 彻底删除 -->
  139. <el-dialog class="tip-dialog" title="提示" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="completelyDeleteVisible">
  140. <div class="setting-dialog">
  141. <div class="tip-content">
  142. <p class="tipMsg">此删除将把会所选条目与其子集彻底删除</p>
  143. <span>你是否还要继续?</span>
  144. </div>
  145. <div slot="footer" class="dialog-footer">
  146. <el-button type="text" @click="completelyDeleteVisible = false">取消</el-button>
  147. <el-button type="primary" @click.native="handleCompletelyDelete">确定</el-button>
  148. </div>
  149. </div>
  150. </el-dialog>
  151. </div>
  152. <!-- v-if="selectedCategory.isType !== 1 && !isRecycle" :class="['archives-top', {'archives-fixed-top': selectedCategory.isType === 2 || selectedCategory.isType === 4 }]" -->
  153. <div v-if="isTitleType !== 2 && !isRecycle && isTitleType !== 6" class="mangement-fixed-top">
  154. <el-checkbox v-model="fixedStatusBar" @change="statusBarChecked">隐藏状态栏</el-checkbox>
  155. </div>
  156. </div>
  157. </template>
  158. <script>
  159. import { manageLibraryCrud } from '../mixins/index'
  160. import { FetchInitCategoryInputFieldByPid } from '@/api/system/category/category'
  161. import PreviewForm from '@/views/components/category/PreviewForm'
  162. import Print from './print/index'
  163. import BindingTagDlg from '@/views/components/BindingTagDlg'
  164. // import { exportFile } from '@/utils/index'
  165. import { mapGetters } from 'vuex'
  166. export default {
  167. name: 'CollectHeader',
  168. components: { PreviewForm, BindingTagDlg, Print },
  169. mixins: [manageLibraryCrud],
  170. props: {
  171. selectedCategory: {
  172. type: Object,
  173. default: function() {
  174. return {}
  175. }
  176. },
  177. isTitleType: {
  178. type: Number,
  179. default: 2
  180. },
  181. arcId: {
  182. type: String,
  183. default: function() {
  184. return ''
  185. }
  186. },
  187. test: {
  188. type: String,
  189. default: function() {
  190. return ''
  191. }
  192. },
  193. isRecycle: {
  194. type: Boolean,
  195. default: false
  196. },
  197. selections: {
  198. type: Array,
  199. default: function() {
  200. return []
  201. }
  202. }
  203. },
  204. data() {
  205. return {
  206. options: [
  207. {
  208. value: '未装盒',
  209. label: '未装盒'
  210. },
  211. {
  212. value: '已装盒',
  213. label: '已装盒'
  214. },
  215. {
  216. value: '未入库',
  217. label: '未入库'
  218. },
  219. {
  220. value: '已入库',
  221. label: '已入库'
  222. },
  223. {
  224. value: '无实体',
  225. label: '无实体'
  226. },
  227. {
  228. value: '有实体',
  229. label: '有实体'
  230. },
  231. {
  232. value: '实体在库',
  233. label: '实体在库'
  234. },
  235. {
  236. value: '实体待借',
  237. label: '实体待借'
  238. },
  239. {
  240. value: '实体已借',
  241. label: '实体已借'
  242. }
  243. ],
  244. selectStatus: null,
  245. activeMenuIndex: '1',
  246. formVisible: false,
  247. formTitle: '项目',
  248. formPreviewData: [], // 预览界面data
  249. deleteVisible: false,
  250. moveVisible: false,
  251. exportVisible: false,
  252. downloadVisible: false,
  253. recoverVisible: false,
  254. completelyDeleteVisible: false,
  255. parentsId: null, // 父id
  256. isDesFormType: null // 区分是门类得还是档案得
  257. }
  258. },
  259. computed: {
  260. ...mapGetters([
  261. 'baseApi'
  262. ]),
  263. collectTitle() {
  264. if (this.isTitleType === 2) {
  265. return '项目'
  266. } else if (this.isTitleType === 3) {
  267. if (this.selectedCategory.arrangeType === 1) {
  268. return '文件'
  269. } else {
  270. return '案卷'
  271. // if (this.activeIndex === 1) {
  272. // return '文件'
  273. // } else {
  274. // return '案卷'
  275. // }
  276. }
  277. } else if (this.isTitleType === 4) {
  278. return '卷内'
  279. } else if (this.isTitleType === 6) {
  280. return '原文'
  281. }
  282. return ''
  283. },
  284. classType() {
  285. if (this.isTitleType === 2) {
  286. return ''
  287. } else if (this.isTitleType === 3) {
  288. return 'is-anjuan'
  289. } else if (this.isTitleType === 4) {
  290. return 'is-juannei'
  291. } else if (this.isTitleType === 6) {
  292. return 'is-file'
  293. }
  294. return ''
  295. },
  296. placeholderType() {
  297. if (this.isTitleType === 2) {
  298. return '输入项目名称或项目编号搜索'
  299. } else if (this.isTitleType === 3 || this.isTitleType === 4) {
  300. return '输入题名或档号搜索'
  301. }
  302. return '输入项目名称或项目编号搜索'
  303. }
  304. },
  305. created() {
  306. },
  307. mounted() {
  308. if (localStorage.getItem('statusBarFixedType') !== 'undefined') {
  309. this.fixedStatusBar = JSON.parse(localStorage.getItem('statusBarFixedType')) === true
  310. this.$emit('status-bar-checked-changed', this.fixedStatusBar)
  311. }
  312. },
  313. methods: {
  314. // 缓存用户对于固定栏操作习惯
  315. statusBarChecked(val) {
  316. console.log('statusVal', val)
  317. this.fixedStatusBar = val
  318. this.$emit('status-bar-checked-changed', this.fixedStatusBar)
  319. localStorage.setItem('statusBarFixedType', val)
  320. },
  321. handleSelect(key, keyPath) {
  322. console.log(key, keyPath)
  323. },
  324. // 著录界面-form/详情-api
  325. handleForm(type) {
  326. if (type === 'add') {
  327. this.formVisible = true
  328. this.formTitle = '新增' + this.collectTitle
  329. // this.arcId = null
  330. } else if (type === 'edit') {
  331. console.log(this.selections)
  332. // this.arcId = this.selections[0].id
  333. if (this.selections.length === 0) {
  334. this.$message('您还未勾选需要操作的条目,请先确认!')
  335. return false
  336. } else if (this.selections.length > 1) {
  337. this.$message('编辑操作只可勾选唯一目标条目,请先确认!')
  338. return false
  339. }
  340. this.formVisible = true
  341. this.formTitle = '编辑' + this.collectTitle
  342. }
  343. // this.form.dictionaryConfigId = {}
  344. // this.formPreviewData = []
  345. // 档案预编辑获取字段
  346. this.getFormInfo(type)
  347. },
  348. getFormInfo(type) {
  349. FetchInitCategoryInputFieldByPid({ categoryId: this.selectedCategory.id }).then(data => {
  350. this.formPreviewData = data
  351. this.$nextTick(() => {
  352. if (type === 'edit') {
  353. this.$refs.previewForm.addOrUpdateForm = data.echo
  354. } else {
  355. // if (this.recycleMain.selectedCategory.isType !== 5) {
  356. // 新增时拿到项目和案卷的相同的字段的值
  357. // this.formPreviewData.forEach(item => {
  358. // if (isAnOrJuan === 1) {
  359. // if (this.recycleMain.selectedCategory.isType !== 3) {
  360. // if (this.recycleMain.projectSelection[item.fieldName]) {
  361. // this.$refs.previewForm.addOrUpdateForm = JSON.parse(JSON.stringify(this.recycleMain.projectSelection))
  362. // }
  363. // }
  364. // } else if (isAnOrJuan === 2) {
  365. // if (this.recycleMain.anjuanSelection[item.fieldName]) {
  366. // this.$refs.previewForm.addOrUpdateForm = JSON.parse(JSON.stringify(this.recycleMain.anjuanSelection))
  367. // }
  368. // }
  369. // })
  370. // }
  371. }
  372. this.isDesFormType = 'arcives'
  373. this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
  374. })
  375. })
  376. },
  377. // form - submit
  378. handlerArchivesSubmit() {
  379. this.formVisible = false
  380. this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id)
  381. this.selections = []
  382. },
  383. // 删除 - 关闭
  384. handleClose(done) {
  385. this.formVisible = false
  386. done()
  387. },
  388. // 删除
  389. // toDelete() {
  390. // if (this.selections.length === 0) {
  391. // this.$message('您还未勾选需要操作的条目,请先确认!')
  392. // return false
  393. // }
  394. // this.deleteVisible = true
  395. // },
  396. // 删除 - 确认
  397. handleDelConfirm() {
  398. this.deleteVisible = false
  399. },
  400. // 绑定标签
  401. bindingTag(data) {
  402. if (data[0].tid) {
  403. this.$refs.bindingTag.isBinding = true
  404. this.$refs.bindingTag.tidCode = data[0].tid
  405. }
  406. this.$refs.bindingTag.bindingVisible = true
  407. },
  408. // 导出
  409. handleExport() {
  410. this.exportVisible = true
  411. },
  412. handleExportConfirm() {
  413. this.exportVisible = false
  414. },
  415. // 打印
  416. handlePrint() {
  417. if (this.selections.length === 0) {
  418. this.$refs.printRef.form.printRange = '当页条目'
  419. } else {
  420. this.$refs.printRef.form.printRange = '勾选条目'
  421. }
  422. this.$refs.printRef.printVisible = true
  423. },
  424. // 原文内的附件下载
  425. handleOriginalDownload() {
  426. if (this.selections.length > 1 || this.selections.length === 0) {
  427. this.$message('下载操作只可勾选唯一目标条目,请先确认!')
  428. return false
  429. }
  430. },
  431. // 回收站 - 恢复
  432. toRecover() {
  433. if (this.selections.length === 0) {
  434. this.$message('您还未勾选需要操作的条目,请先确认!')
  435. return false
  436. }
  437. this.recoverVisible = true
  438. },
  439. handleRecover() {
  440. this.recoverVisible = false
  441. },
  442. // 回收站 - 彻底删除
  443. toCompletelyDelete() {
  444. if (this.selections.length === 0) {
  445. this.$message('您还未勾选需要操作的条目,请先确认!')
  446. return false
  447. }
  448. this.completelyDeleteVisible = true
  449. },
  450. handleCompletelyDelete() {
  451. this.completelyDeleteVisible = false
  452. }
  453. }
  454. }
  455. </script>
  456. <style lang='scss' scoped>
  457. .collect-header{
  458. border-top: none !important;
  459. padding: 20px 0 0 0 !important;
  460. }
  461. .manage-fixed-style{
  462. margin-bottom: 30px;
  463. }
  464. </style>