交通管理局公文项目
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.

961 lines
34 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 weeks ago
2 months ago
3 weeks ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
1 month ago
3 weeks ago
2 months ago
2 months ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
5 days ago
2 months ago
2 months ago
4 weeks ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
4 weeks ago
2 months ago
2 months ago
1 month ago
3 weeks ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 weeks ago
2 weeks ago
2 weeks ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 weeks ago
2 months ago
3 weeks ago
2 months ago
2 months ago
2 months ago
3 weeks ago
3 weeks ago
3 weeks ago
2 months ago
3 weeks ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 weeks ago
2 months ago
2 months ago
7 days ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. <template>
  2. <div class="app-container">
  3. <!-- 门类列表 -->
  4. <div class="container-main">
  5. <div class="elect-cont-left">
  6. <TreeList ref="treeList" @nodeClick="handleNodeClick" />
  7. </div>
  8. <div v-if="selectedDocument.isType !== 1" class="elect-cont-right">
  9. <!--工具栏-->
  10. <div class="head-container" :style="isRecycle?'display:flex;justify-content: space-between; align-items: center;':'' ">
  11. <div class="head-search" :style="isRecycle?'margin: 0;':''">
  12. <!-- 搜索 -->
  13. <el-input v-model="search" clearable size="small" placeholder="输入题名搜索" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="handleSearch" />
  14. <!-- <rrOperation /> -->
  15. <el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="handleSearch">搜索</el-button>
  16. <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
  17. </div>
  18. <crudOperation v-if="!isRecycle" :permission="permission">
  19. <template v-slot:left>
  20. <!-- 新增 -->
  21. <el-button size="mini" @click="handleForm('add')"><i class="iconfont icon-xinzeng" />新增</el-button>
  22. <!-- 修改 -->
  23. <el-button size="mini" :disabled="crud.selections.length !== 1" @click="handleForm('edit')"><i class="iconfont icon-bianji" />编辑</el-button>
  24. <!-- 删除btn 多选 -->
  25. <el-button size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)"><i class="iconfont icon-shanchu" />删除</el-button>
  26. <el-button :loading="crud.downloadLoading" size="mini" :disabled="crud.selections.length === 0" @click="doExport('0',crud.selections)">
  27. <i class="iconfont icon-daochu" />
  28. 导出
  29. </el-button>
  30. <el-button v-if="selectedDocument.isType===3 || selectedDocument.isType===4" :loading="allDownloadLoading" size="mini" :disabled="crud.selections.length !== 0" @click="doExport('1')">
  31. <i class="iconfont icon-daochu" />
  32. 批量导出
  33. </el-button>
  34. </template>
  35. <template v-slot:rightButtonGroup>
  36. <div>
  37. <el-button size="mini" :disabled="crud.selections.length === 0" @click="doPrint(crud.selections)"><i class="iconfont icon-dayin" />打印处理单</el-button>
  38. </div>
  39. </template>
  40. </crudOperation>
  41. <div v-if="isRecycle">
  42. <el-button size="mini" type="success" @click="toRecover(crud.selections)"><i class="iconfont icon-huifu" />恢复</el-button>
  43. <el-button size="mini" type="success" @click="toCompletelyDelete(crud.selections)"><i class="iconfont icon-shanchu" />彻底删除</el-button>
  44. </div>
  45. </div>
  46. <!--表格渲染-->
  47. <div class="container-right">
  48. <span class="right-top-line" />
  49. <span class="left-bottom-line" />
  50. <el-table
  51. ref="table"
  52. v-loading="crud.loading"
  53. class="archives-table"
  54. :data="crud.data"
  55. style="width: 100%;"
  56. height="calc(100vh - 374px)"
  57. @row-click="clickRowHandler"
  58. @select="crud.selectChange"
  59. @select-all="crud.selectAllChange"
  60. @selection-change="crud.selectionChangeHandler"
  61. @cell-dblclick="tableDoubleClick"
  62. >
  63. <el-table-column type="selection" align="center" width="55" />
  64. <el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip>
  65. <template slot="header">
  66. <el-tooltip
  67. class="item"
  68. effect="dark"
  69. :content="field.fieldCnName"
  70. placement="top-start"
  71. >
  72. <span>{{ field.fieldCnName }}</span>
  73. </el-tooltip>
  74. </template>
  75. <template slot-scope="scope">
  76. <!-- 仅针对read_type字段添加特殊处理 -->
  77. <span
  78. v-if="field.fieldName === 'read_type'"
  79. :class="{
  80. 'row-state row-packing': scope.row.read_type === '未传阅',
  81. 'row-state row-binding state-active': scope.row.read_type === '传阅中',
  82. 'row-state row-physical state-active': scope.row.read_type === '已完成',
  83. }"
  84. >
  85. {{ scope.row[field.fieldName] }}
  86. </span>
  87. <span v-else>{{ scope.row[field.fieldName] }}</span>
  88. </template>
  89. </el-table-column>
  90. </el-table>
  91. <!--分页组件-->
  92. <pagination v-if="crud.data.length !== 0" />
  93. </div>
  94. <detail ref="archivesInfo" :selected-document="selectedDocument" :parent-info="parentInfo" :page-type="pageType" />
  95. <!--新增 / 编辑 表单组件-->
  96. <el-dialog class="preview-dialog" :modal-append-to-body="false" :close-on-click-modal="false" append-to-body :before-close="closeDialog" :visible="formVisible" :title="formTitle">
  97. <span class="dialog-right-top" />
  98. <span class="dialog-left-bottom" />
  99. <div class="setting-dialog">
  100. <PreviewForm
  101. ref="previewForm"
  102. :form-preview-data.sync="formPreviewData"
  103. :selected-category="selectedCategory"
  104. :parents-id="parentsId"
  105. :arc-id="arcId"
  106. :is-des-form-type="isDesFormType"
  107. :is-disabled="isDisabled"
  108. :selected-document="selectedDocument"
  109. :is-has-code="isHasCode"
  110. :archives-type="archivesType"
  111. :is-miod-save-bind="isMiodSaveBind"
  112. @close-dialog="closeDialog"
  113. @formLoadingShow="formLoadingShow"
  114. @refreshTree="refreshTreeList"
  115. @resetQuery="resetQuery"
  116. @getInitDocumentBind="getInitDocumentBind"
  117. />
  118. <div slot="footer" class="dialog-footer" style="margin-top: 20px !important;">
  119. <el-button type="text" @click="closeDialog">取消</el-button>
  120. <el-button :loading="archivesBtnLoading" type="primary" @click="handlerArchivesSubmit(false)">保存</el-button>
  121. <el-button v-if="archivesType === 'edit'" :loading="bindSaveLoading" type="primary" @click="handlerArchivesSubmit(true)">保存并绑定原文</el-button>
  122. </div>
  123. </div>
  124. </el-dialog>
  125. <!--表单组件-->
  126. <el-dialog class="tip-dialog" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body title="提示" :visible.sync="printVisible">
  127. <div class="setting-dialog">
  128. <div class="tip-content">
  129. <p class="tipMsg">此操作将打印所选公文库数据</p>
  130. </div>
  131. <el-radio-group v-model="printType" style="padding-left: 36px;">
  132. <el-radio :label="2">彩打</el-radio>
  133. <el-radio :label="1">套打</el-radio>
  134. </el-radio-group>
  135. <div slot="footer" class="dialog-footer">
  136. <el-button @click.native="printVisible = false">取消</el-button>
  137. <el-button type="primary" @click.native="handlePrint">确定</el-button>
  138. </div>
  139. </div>
  140. </el-dialog>
  141. </div>
  142. </div>
  143. <!-- 注册PDF对话框组件 -->
  144. <PdfDialog ref="pdfDialog" />
  145. </div>
  146. </template>
  147. <script>
  148. import CRUD, { presenter, header } from '@crud/crud'
  149. import { miodLibraryCrud } from './mixins/index'
  150. import crudDocumentArchives, { FetchDelArchives, FetchCompleteDelArchives, FetchRestoreArchives, FetchInitDistributorAllByDocumentId, FetchBorrowerdsByIds, FetchInitDocumentDetailsList, FetchReadGW, FetchBingdingLabel } from '@/api/system/documentArchives'
  151. import crudOperation from '@crud/CRUD.operation'
  152. import pagination from '@crud/Pagination'
  153. import TreeList from './treeList'
  154. import PreviewForm from '@/views/components/category/PreviewForm'
  155. import detail from './module/detail'
  156. import { exportFile } from '@/utils/index'
  157. import qs from 'qs'
  158. import { mapGetters } from 'vuex'
  159. import PdfDialog from './module/pdfDialog'
  160. export default {
  161. name: 'MiodLibrary',
  162. components: { TreeList, PreviewForm, detail, crudOperation, pagination, PdfDialog },
  163. cruds() {
  164. return [
  165. CRUD({
  166. title: '收发文', url: 'api/documentArchives/initPreDocument',
  167. crudMethod: { ...crudDocumentArchives },
  168. optShow: {
  169. add: false,
  170. edit: false,
  171. del: false,
  172. download: false,
  173. group: false,
  174. reset: false
  175. },
  176. queryOnPresenterCreated: false
  177. })
  178. ]
  179. },
  180. provide() {
  181. return {
  182. parentsData: this
  183. }
  184. },
  185. mixins: [presenter(), header(), miodLibraryCrud],
  186. props: {
  187. isRecycle: {
  188. type: Boolean,
  189. default: false
  190. },
  191. isdel: {
  192. type: Boolean,
  193. default: false
  194. }
  195. },
  196. data() {
  197. return {
  198. archivesBtnLoading: false,
  199. bindSaveLoading: false,
  200. permission: {
  201. add: ['admin', 'prearchiveLibrary:add'],
  202. edit: ['admin', 'prearchiveLibrary:edit'],
  203. del: ['admin', 'prearchiveLibrary:del'],
  204. sort: ['admin', 'prearchiveLibrary:sort']
  205. },
  206. tableDisplayFields: [], // table-list-title字段
  207. arrySort: [],
  208. selectedDocument: {},
  209. form: {},
  210. formVisible: false,
  211. formTitle: '新增文件',
  212. formPreviewData: [],
  213. selectedCategory: null,
  214. parentsId: null,
  215. arcId: null,
  216. isDesFormType: 'miodLibrary',
  217. isDisabled: false,
  218. isHasCode: false,
  219. printVisible: false,
  220. printType: 2,
  221. pdfSources: [],
  222. printSelections: [],
  223. archivesType: null,
  224. search: '',
  225. parentInfo: null,
  226. pageType: null,
  227. allDownloadLoading: false,
  228. isMiodSaveBind: null
  229. }
  230. },
  231. computed: {
  232. ...mapGetters([
  233. 'baseApi'
  234. ])
  235. },
  236. watch: {
  237. isdel: function(newValue, oldValue) {
  238. },
  239. isRecycle: function(newValue, oldValue) {
  240. }
  241. },
  242. created() {
  243. },
  244. methods: {
  245. handleSearch() {
  246. this.crud.query.search = this.search
  247. this.crud.toQuery()
  248. },
  249. refreshTreeList() {
  250. this.$refs.treeList.refreshData()
  251. },
  252. resetQuery() {
  253. this.search = ''
  254. this.crud.query.search = ''
  255. if (this.selectedDocument.isType === 3) {
  256. this.crud.query.docDepartment = this.selectedDocument.label
  257. this.crud.query.archiveYear = null
  258. } else if (this.selectedDocument.isType === 4) {
  259. this.crud.query.docDepartment = null
  260. this.crud.query.archiveYear = this.selectedDocument.label
  261. } else {
  262. this.crud.query.docDepartment = null
  263. this.crud.query.archiveYear = null
  264. }
  265. this.crud.toQuery()
  266. },
  267. [CRUD.HOOK.beforeRefresh]() {
  268. if (this.selectedDocument.isType === 2) {
  269. this.crud.query.documentId = this.selectedDocument.id
  270. } else {
  271. this.crud.query.documentId = this.selectedDocument.documentId
  272. }
  273. this.crud.query.isdel = this.isdel
  274. // this.crud.query.ignore = false
  275. this.crud.query.fondsAffiliation = this.selectedDocument.fondsId
  276. this.crud.query.sort = this.arrySort
  277. },
  278. formLoadingShow(loadingType) {
  279. this.archivesBtnLoading = loadingType
  280. },
  281. handleNodeClick(data, type) {
  282. if (type && type === 'targetNode') {
  283. console.log('非手动点击tree')
  284. } else {
  285. this.search = ''
  286. this.crud.query.search = ''
  287. }
  288. this.selectedDocument = data
  289. let documentId = null
  290. if (data.isType === 2) {
  291. documentId = data.id
  292. } else {
  293. documentId = data.documentId
  294. }
  295. this.getInitDocumentsViewTable(documentId, type)
  296. },
  297. // table字段项
  298. getInitDocumentsViewTable(documentId, type) {
  299. crudDocumentArchives.FetchInitDocumentsViewTable({ documentId: documentId }).then(data => {
  300. if (data) {
  301. this.arrySort = []
  302. this.tableDisplayFields = data
  303. const orderSortArry = this.tableDisplayFields.filter(item => item.queue).sort((a, b) => a.queue - b.queue)
  304. orderSortArry.forEach(item => {
  305. if (item.displayOrderBy) {
  306. this.arrySort.push(item.fieldName + ',' + item.displayOrderBy)
  307. }
  308. })
  309. this.$nextTick(() => {
  310. if (this.selectedDocument.isType === 3) {
  311. this.crud.query.docDepartment = this.selectedDocument.label
  312. this.crud.query.archiveYear = null
  313. } else if (this.selectedDocument.isType === 4) {
  314. this.crud.query.docDepartment = this.selectedDocument.dictionaryName
  315. this.crud.query.archiveYear = this.selectedDocument.label
  316. } else {
  317. // this.search = ''
  318. // this.crud.query.search = ''
  319. this.crud.query.docDepartment = null
  320. this.crud.query.archiveYear = null
  321. }
  322. if (type && type === 'targetNode') {
  323. this.crud.refresh()
  324. } else {
  325. this.crud.toQuery()
  326. }
  327. })
  328. }
  329. })
  330. },
  331. handleForm(type) {
  332. const { selectedDocument, crud } = this
  333. this.selectedCategory = selectedDocument
  334. this.isDesFormType = 'miodLibrary'
  335. let documentId
  336. if (selectedDocument.isType === 2) {
  337. documentId = selectedDocument.id
  338. } else {
  339. documentId = selectedDocument.documentId
  340. }
  341. const params = { documentId }
  342. if (type === 'add') {
  343. console.log('add')
  344. this.formTitle = '新增文件'
  345. params.archivesId = null
  346. } else if (type === 'edit') {
  347. console.log('edit')
  348. this.formTitle = '编辑文件'
  349. const { id: archivesId } = crud.selections[0]
  350. this.arcId = archivesId
  351. params.archivesId = archivesId
  352. }
  353. this.getFormInfo(params, type)
  354. },
  355. getFormInfo(params, type) {
  356. this.archivesType = type
  357. crudDocumentArchives.FetchDoeditDocument(params).then(data => {
  358. const showFiledAll = data.showFiled.filter(item => item.isSequence).sort((a, b) => a.isSequence - b.isSequence)
  359. this.$nextTick(() => {
  360. this.formPreviewData = showFiledAll
  361. this.formVisible = true
  362. this.$nextTick(() => {
  363. this.$refs.previewForm.fileOriginal = null
  364. this.$refs.previewForm.fileJsonString = null
  365. if (type === 'edit') {
  366. showFiledAll.map(item => {
  367. if (item.isInputClass === 'select' && item.isRadio && item.isLine) {
  368. data.echo[item.fieldName] = JSON.parse(data.echo[item.fieldName])
  369. }
  370. })
  371. this.$set(this.$refs.previewForm, 'addOrUpdateForm', data.echo)
  372. if (data.fileecho) {
  373. this.$refs.previewForm.fileOriginal = data.fileecho.file_name || null
  374. this.$refs.previewForm.fileJsonString = JSON.stringify([data.fileecho])
  375. } else {
  376. this.$refs.previewForm.fileOriginal = ''
  377. this.$refs.previewForm.fileJsonString = ''
  378. }
  379. // 获取借阅者
  380. FetchInitDistributorAllByDocumentId(params).then(res => {
  381. if (res && res.length !== 0) {
  382. console.log('res', res)
  383. this.$refs.previewForm.miodDeptsTags = res
  384. const ids = res.map(item => item.id).join(',')
  385. console.log('ids', ids)
  386. this.$set(this.$refs.previewForm.addOrUpdateForm, 'miodDepts', ids)
  387. } else {
  388. this.$set(this.$refs.previewForm.addOrUpdateForm, 'miodDepts', null)
  389. }
  390. })
  391. console.log('data.echo', data.echo)
  392. if (data.echo.host_department) {
  393. const hostParams = {
  394. 'search': data.echo.host_department
  395. }
  396. FetchBorrowerdsByIds(hostParams).then(res => {
  397. if (res && res.length !== 0) {
  398. console.log('res-hostDepartmentTags', res)
  399. this.$refs.previewForm.hostDepartmentTags = res
  400. const ids = res.map(item => item.id).join(',')
  401. this.$set(this.$refs.previewForm.addOrUpdateForm, 'host_department', ids)
  402. } else {
  403. this.$set(this.$refs.previewForm.addOrUpdateForm, 'host_department', null)
  404. }
  405. })
  406. } else {
  407. this.$refs.previewForm.hostDepartmentTags = []
  408. }
  409. } else {
  410. console.log('add')
  411. }
  412. })
  413. })
  414. })
  415. },
  416. handlerArchivesSubmit(type) {
  417. this.isMiodSaveBind = type
  418. this.$nextTick(() => {
  419. let documentId
  420. if (this.selectedDocument.isType === 2) {
  421. documentId = this.selectedDocument.id
  422. } else {
  423. documentId = this.selectedDocument.documentId
  424. }
  425. this.$refs.previewForm.submitForm('addOrUpdateForm', documentId)
  426. })
  427. },
  428. getInitDocumentBind() {
  429. this.bindSaveLoading = true
  430. let documentId
  431. if (this.selectedDocument.isType === 2) {
  432. documentId = this.selectedDocument.id
  433. } else {
  434. documentId = this.selectedDocument.documentId
  435. }
  436. const params = {
  437. documentId,
  438. archivesId: this.arcId
  439. }
  440. FetchInitDocumentDetailsList(params).then(data => {
  441. // id,parents_id,reg_no,details_type,pass_location,read_type,tid,is_destroy,create_by,create_time,update_by,update_time
  442. // id,公文id,登记号,文件类别(1.原文 2.复印件),传阅所在位置,传阅状态,tid,是否销毁,创建人,创建时间,更新人,更新时间
  443. const jsonData = this.convertData(data)
  444. const fileOriginal = jsonData.filter(item => item.details_type === 1)
  445. console.log('jsonData', jsonData)
  446. console.log('fileOriginal', fileOriginal)
  447. this.bindingTag(fileOriginal[0])
  448. }).catch(error => {
  449. console.error('获取文档详情列表失败:', error)
  450. })
  451. },
  452. convertData(data) {
  453. return data.map(item => {
  454. const fieldNames = [
  455. 'id', 'parents_id', 'reg_no', 'details_type', 'pass_location',
  456. 'read_type', 'tid', 'is_destroy', 'create_by', 'create_time',
  457. 'update_by', 'update_time'
  458. ]
  459. const obj = {}
  460. fieldNames.forEach((field, index) => {
  461. obj[field] = item[index]
  462. })
  463. return obj
  464. })
  465. },
  466. // 绑定标签
  467. bindingTag(row) {
  468. console.log('bindingTag', row)
  469. if (row.tid && (row.tid !== '' || row.tid !== null)) {
  470. this.$confirm('该原件已绑定' + '<span>是否重新绑定?</span>', '提示', {
  471. confirmButtonText: '重新绑定',
  472. cancelButtonText: '取消',
  473. type: 'warning',
  474. dangerouslyUseHTMLString: true
  475. }).then(() => {
  476. this.handlBind(row, 'hasLabel')
  477. }).catch(() => {
  478. this.closeDialog()
  479. this.crud.refresh()
  480. this.refreshTreeList()
  481. this.bindSaveLoading = false
  482. })
  483. } else {
  484. this.handlBind(row)
  485. }
  486. },
  487. handlBind(row, type) {
  488. console.log('row', row)
  489. const sDevID = process.env.NODE_ENV === 'production' ? window.g.sDevID : process.env.VUE_APP_SDEVID
  490. const param = {
  491. 'sDevID': sDevID
  492. }
  493. FetchReadGW(param).then((res) => {
  494. if (!res) {
  495. this.$message({ message: '绑定失败', type: 'error', offset: 8 })
  496. this.bindSaveLoading = false
  497. } else {
  498. const result = JSON.parse(res)
  499. console.log('result', result)
  500. if (result.code === '0') {
  501. console.log('读取成功')
  502. // let coverLabel
  503. // if (type === 'hasLabel' && row.tid === result.data[0].uid) {
  504. // coverLabel = true
  505. // } else {
  506. // coverLabel = false
  507. // }
  508. const documentId = this.selectedDocument.isType === 2
  509. ? this.selectedDocument.id
  510. : this.selectedDocument.documentId
  511. const data = {
  512. coverLabel: !!type,
  513. documentId: documentId, // 公文库id
  514. parentsId: row.id, // 需要绑定的公文id
  515. detailsType: row.details_type,
  516. labelType: 1, // 目前只能绑定公文 填1就好了
  517. tid: result.data[0].uid, // 标签读取的id
  518. eas: '1' // 这个和以前一样写吧
  519. }
  520. console.log('data', data)
  521. FetchBingdingLabel(data).then((res) => {
  522. console.log('FetchBingdingLabel', res)
  523. if (res === '当前标签已被绑定') {
  524. this.$message({ message: '当前标签已被绑定', type: 'error', offset: 8 })
  525. } else {
  526. this.$message({ message: '绑定成功', type: 'success', offset: 8 })
  527. }
  528. this.closeDialog()
  529. this.bindSaveLoading = false
  530. setTimeout(() => {
  531. const selectedItem = this.crud.selections[0]
  532. this.tableDoubleClick(selectedItem)
  533. this.refreshTreeList()
  534. this.crud.refresh()
  535. }, 500)
  536. }).catch(error => {
  537. console.error(error)
  538. this.bindSaveLoading = false
  539. })
  540. } else if (result.code === '-1') {
  541. this.$message({ message: result.message, type: 'error', offset: 8 })
  542. this.bindSaveLoading = false
  543. } else if (result.code === '-1000') {
  544. // 读写器超时未响应
  545. this.$message({ message: result.message, type: 'error', offset: 8 })
  546. this.bindSaveLoading = false
  547. }
  548. }
  549. }).catch(error => {
  550. console.error(error)
  551. this.bindSaveLoading = false
  552. })
  553. },
  554. clickRowHandler(row) {
  555. this.$refs.table.clearSelection()
  556. this.$refs.table.toggleRowSelection(row)
  557. },
  558. // 双击查看详情
  559. tableDoubleClick(row) {
  560. console.log('tableDoubleClick', row)
  561. this.parentInfo = row
  562. this.$nextTick(() => {
  563. this.$refs.archivesInfo.archivesInfoVisible = true
  564. this.$refs.archivesInfo.archivesTabIndex = 0
  565. // this.$refs.archivesInfo.parentInfo = row
  566. this.$refs.archivesInfo.getDetial()
  567. })
  568. },
  569. // 删除
  570. toDelete(datas) {
  571. this.$confirm('此操作将删除当前所选公文库数据' + '<span>你是否还要继续?</span>', '提示', {
  572. confirmButtonText: '继续',
  573. cancelButtonText: '取消',
  574. type: 'warning',
  575. dangerouslyUseHTMLString: true
  576. }).then(() => {
  577. this.crud.delAllLoading = true
  578. const ids = []
  579. datas.forEach(val => {
  580. ids.push(val.id)
  581. })
  582. let documentId
  583. if (this.selectedDocument.isType === 2) {
  584. documentId = this.selectedDocument.id
  585. } else {
  586. documentId = this.selectedDocument.documentId
  587. }
  588. const params = {
  589. 'documentId': documentId,
  590. 'archivesIds': ids
  591. }
  592. FetchDelArchives(params).then((res) => {
  593. console.log('res', res)
  594. if (res.code !== 500) {
  595. this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
  596. this.crud.refresh()
  597. } else {
  598. this.crud.notify('删除失败', CRUD.NOTIFICATION_TYPE.ERROR)
  599. }
  600. this.crud.delAllLoading = false
  601. }).catch(err => {
  602. this.crud.delAllLoading = false
  603. console.log(err)
  604. })
  605. }).catch(() => {
  606. })
  607. },
  608. // 导出
  609. doExport(type, datas) {
  610. if (type === '0') {
  611. this.crud.downloadLoading = true
  612. } else {
  613. this.allDownloadLoading = true
  614. }
  615. const tip = type === '0' ? '此操作将导出所选数据' : '此操作将批量导出所有数据'
  616. this.$confirm(tip + '<span>你是否还要继续?</span>', '提示', {
  617. confirmButtonText: '继续',
  618. cancelButtonText: '取消',
  619. type: 'warning',
  620. dangerouslyUseHTMLString: true
  621. }).then(() => {
  622. const ids = []
  623. if (type === '0') {
  624. datas.forEach(val => {
  625. ids.push(val.id)
  626. })
  627. }
  628. let documentId
  629. if (this.selectedDocument.isType === 2) {
  630. documentId = this.selectedDocument.id
  631. } else {
  632. documentId = this.selectedDocument.documentId
  633. }
  634. console.log('this.selectedDocument', this.selectedDocument)
  635. const params = {
  636. 'documentId': documentId,
  637. 'ids': ids,
  638. 'docDepartment': type === '1' ? (this.selectedDocument.isType === 4 ? this.selectedDocument.dictionaryName : this.selectedDocument.label) : null,
  639. 'archivesYear': type === '1' ? (this.selectedDocument.isType === 4 ? this.selectedDocument.label : null) : null,
  640. 'search': type === '1' ? this.search : null
  641. }
  642. console.log('exportFile', params)
  643. exportFile(this.baseApi + '/api/documentArchives/downloadDocumentArchives?' + qs.stringify(params, { indices: false, allowDots: true, skipNulls: false }))
  644. if (type === '0') {
  645. this.crud.downloadLoading = false
  646. } else {
  647. this.allDownloadLoading = false
  648. }
  649. }).catch(() => {
  650. if (type === '0') {
  651. this.crud.downloadLoading = false
  652. } else {
  653. this.allDownloadLoading = false
  654. }
  655. })
  656. },
  657. doPrint(datas) {
  658. this.printVisible = true
  659. this.printSelections = datas
  660. },
  661. handlePrint() {
  662. this.printVisible = false
  663. let documentId
  664. if (this.selectedDocument.isType === 2) {
  665. documentId = this.selectedDocument.id
  666. } else {
  667. documentId = this.selectedDocument.documentId
  668. }
  669. const ids = this.printSelections.map(item => item.id)
  670. console.log('ids', ids)
  671. const params = {
  672. 'archivesId': ids,
  673. 'documentId': documentId,
  674. 'printType': this.printType // 1 套打 2 彩打
  675. }
  676. this.$refs.pdfDialog.openDialog(params)
  677. // this.getHandleDocument()
  678. },
  679. async getHandleDocument() {
  680. try {
  681. // console.log('params', params)
  682. // FetchHandleDocument(params).then(async(res) => {
  683. // console.log(res)
  684. // this.pdfSources = res.map(item => {
  685. // // 如果后端返回的是带前缀的Base64,可以直接使用
  686. // return item.startsWith('data:application/pdf;base64,')
  687. // ? item
  688. // : `data:application/pdf;base64,${item}`
  689. // })
  690. // })
  691. } catch (error) {
  692. console.error(error)
  693. }
  694. },
  695. // 回收站 - 恢复
  696. toRecover(datas) {
  697. if (datas.length === 0) {
  698. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  699. return false
  700. }
  701. this.$confirm('此恢复将会把所选条目及其子集一并恢复' + '<span>你是否还要继续?</span>', '提示', {
  702. confirmButtonText: '继续',
  703. cancelButtonText: '取消',
  704. type: 'warning',
  705. dangerouslyUseHTMLString: true
  706. }).then(() => {
  707. const archivesIds = []
  708. datas.forEach(val => {
  709. archivesIds.push(val.id)
  710. })
  711. let documentId
  712. if (this.selectedDocument.isType === 2) {
  713. documentId = this.selectedDocument.id
  714. } else {
  715. documentId = this.selectedDocument.documentId
  716. }
  717. const params = {
  718. 'documentId': documentId,
  719. 'archivesIds': archivesIds
  720. }
  721. console.log('params', params)
  722. FetchRestoreArchives(params).then((res) => {
  723. console.log('res', res)
  724. if (res.code !== 500) {
  725. if (res.includes('成功')) {
  726. this.$message({ message: res, type: 'success', offset: 8 })
  727. this.crud.refresh()
  728. this.refreshTreeList()
  729. } else {
  730. this.$message({ message: res, type: 'error', offset: 8 })
  731. }
  732. } else {
  733. this.$message({ message: '恢复所选档案失败', type: 'error', offset: 8 })
  734. }
  735. }).catch(err => {
  736. console.log(err)
  737. })
  738. }).catch(() => {
  739. })
  740. },
  741. // 回收站 - 彻底删除
  742. toCompletelyDelete(datas) {
  743. if (datas.length === 0) {
  744. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  745. return false
  746. }
  747. this.$confirm('此删除将把会所选条目与其子集彻底删除' + '<span>你是否还要继续?</span>', '提示', {
  748. confirmButtonText: '继续',
  749. cancelButtonText: '取消',
  750. type: 'warning',
  751. dangerouslyUseHTMLString: true
  752. }).then(() => {
  753. const archivesIds = []
  754. datas.forEach(val => {
  755. archivesIds.push(val.id)
  756. })
  757. let documentId
  758. if (this.selectedDocument.isType === 2) {
  759. documentId = this.selectedDocument.id
  760. } else {
  761. documentId = this.selectedDocument.documentId
  762. }
  763. const params = {
  764. 'documentId': documentId,
  765. 'archivesIds': archivesIds
  766. }
  767. console.log('params', params)
  768. FetchCompleteDelArchives(params).then((res) => {
  769. if (res.code !== 500) {
  770. this.$message({ message: res, type: 'success', offset: 8 })
  771. this.crud.refresh()
  772. this.refreshTreeList()
  773. } else {
  774. this.$message({ message: '删除所选档案失败', type: 'error', offset: 8 })
  775. }
  776. }).catch(err => {
  777. console.log(err)
  778. })
  779. }).catch(() => {
  780. })
  781. },
  782. closeDialog() {
  783. this.formVisible = false
  784. this.$refs.previewForm.miodDeptsTags = []
  785. this.$refs.previewForm.miodDeptsSelections = []
  786. this.$refs.previewForm.hostDepartmentTags = []
  787. this.$refs.previewForm.hostDepartmentSelections = []
  788. this.$refs.previewForm.deptsValid = false
  789. if (this.$refs.previewForm.$refs['addOrUpdateForm']) {
  790. this.$refs.previewForm.$refs['addOrUpdateForm'].clearValidate()
  791. this.$refs.previewForm.$refs['addOrUpdateForm'].resetFields()
  792. }
  793. this.bindSaveLoading = false
  794. }
  795. }
  796. }
  797. </script>
  798. <style>
  799. @media print {
  800. html,body{
  801. height: inherit;
  802. }
  803. .print-container {
  804. position: absolute;
  805. top: 0;
  806. right: 0;
  807. bottom: 0;
  808. left: 0;
  809. }
  810. @page {
  811. size: A4;
  812. margin: 2cm;
  813. }
  814. }
  815. </style>
  816. <style lang='scss' scoped>
  817. @import "~@/assets/styles/collect-reorganizi.scss";
  818. @mixin management-fixed-style{
  819. [data-theme="dark"] & {
  820. background-color: #031435 !important;
  821. -webkit-box-shadow: -5px 5px 10px 1px rgba(15,164,222,.16);
  822. box-shadow: -5px 5px 10px 1px rgba(15,164,222,.16);
  823. }
  824. [data-theme="light"] & {
  825. background-color: #fff;
  826. }
  827. }
  828. .el-table {
  829. ::v-deep .el-table__fixed-right {
  830. @include management-fixed-style;
  831. }
  832. }
  833. .preview-dialog .el-dialog .preview-content {
  834. height: calc(100vh - 264px) !important;
  835. }
  836. .elect-cont-right .container-right {
  837. min-height: calc(100vh - 284px);
  838. }
  839. .dialog-footer .el-button.el-button--primary,
  840. .el-message-box__btns .el-button.el-button--primary{
  841. width: auto;
  842. height: auto;
  843. line-height:normal;
  844. padding: 6px 20px;
  845. }
  846. .tip-dialog{
  847. ::v-deep .el-dialog{
  848. width: 504px;
  849. .setting-dialog{
  850. padding: 10px 10px 0 10px;
  851. }
  852. .tip-content{
  853. padding-left: 34px;
  854. font-size: 14px;
  855. line-height: 24px;
  856. color: #0C0E1E;
  857. background: url("~@/assets/images/icon/tip-icon.png") no-repeat left top;
  858. background-size: 24px 24px;
  859. padding-bottom: 20px;
  860. span{
  861. font-size: 12px;
  862. color: #ED4A41;
  863. }
  864. }
  865. }
  866. .dialog-footer{
  867. margin-top: 27px;
  868. }
  869. }
  870. .intoExamine{
  871. position: fixed;
  872. left: 50%;
  873. top: 50%;
  874. transform: translate(-50%,-50%);
  875. z-index: 99;
  876. }
  877. /* 基础样式 */
  878. .print-container {
  879. position: fixed;
  880. left: 50%;
  881. top: 50%;
  882. transform: translate(-50%,-50%);
  883. z-index: 99;
  884. padding: 0 0 40px 0;
  885. }
  886. /* 标题样式 */
  887. .print-title {
  888. font-size: 22pt;
  889. font-family: "华文中宋";
  890. color: #ff0000;
  891. margin: 20px 0;
  892. }
  893. /* 表格样式 */
  894. .official-table {
  895. border-collapse: collapse;
  896. width: 100%;
  897. }
  898. .label-cell, .content-cell {
  899. border: 1px solid #ff0000;
  900. padding: 8px;
  901. }
  902. .label-cell {
  903. background: #ffffff;
  904. text-align: center;
  905. font-size: 12pt;
  906. color: #ff0000;
  907. vertical-align: middle;
  908. }
  909. .content-cell {
  910. background: #ffffff;
  911. font-size: 12pt;
  912. vertical-align: top;
  913. }
  914. .content-left {
  915. text-align: left;
  916. }
  917. .content-center {
  918. text-align: center;
  919. }
  920. .header-cell {
  921. border: none;
  922. padding: 20px 0;
  923. text-align: center;
  924. }
  925. .header-text {
  926. font-family: "华文中宋";
  927. font-size: 22pt;
  928. color: #ff0000;
  929. margin: 0;
  930. }
  931. </style>