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

693 lines
26 KiB

3 years ago
7 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
7 months ago
3 years ago
3 years ago
3 years ago
3 years ago
7 months ago
7 months ago
3 years ago
7 months ago
3 years ago
7 months ago
7 months ago
6 months ago
7 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
1 year ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 months ago
3 years ago
1 year ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
7 months ago
7 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
5 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
7 months ago
3 years ago
3 years ago
1 year ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
6 months ago
3 years ago
3 years ago
3 years ago
1 year ago
1 year ago
4 months ago
1 year ago
4 months ago
4 months ago
3 years ago
3 years ago
7 months ago
3 years ago
7 months ago
3 years ago
3 years ago
3 years ago
3 years ago
7 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
1 year ago
3 years ago
1 year ago
3 years ago
3 years ago
3 years ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
1 year ago
7 months ago
7 months ago
1 year ago
  1. <template>
  2. <div class="app-container">
  3. <!-- 门类列表 -->
  4. <div class="container-main">
  5. <div class="elect-cont-left">
  6. <TreeList @nodeClick="handleNodeClick" />
  7. </div>
  8. <div class="elect-cont-right" style="position: relative;">
  9. <!--工具栏-->
  10. <div class="head-container">
  11. <div class="head-search" style=" align-items: center;">
  12. <!-- 搜索 -->
  13. <el-input v-model="query.search" clearable size="small" placeholder="输入题名搜索" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
  14. <rrOperation />
  15. <el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="showAdvancedSearch">高级检索</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 v-if="crud.query.intelligenceSearch" class="advanced-search-result">
  18. <span style="font-size: 12px; color: #666;">高级检索</span>
  19. <span style="font-size: 12px; color: #409EFF; margin-right: 10px; cursor: pointer;" @click="showAdvancedSearch">{{ advancedSearchDisplayText }}</span>
  20. </div>
  21. </div>
  22. <crudOperation :permission="permission">
  23. <template v-slot:left>
  24. <!-- 新增 -->
  25. <el-button size="mini" @click="handleForm('add')"><i class="iconfont icon-xinzeng" />新增</el-button>
  26. <!-- 修改 -->
  27. <el-button size="mini" :disabled="crud.selections.length !== 1" @click="handleForm('edit')"><i class="iconfont icon-bianji" />编辑</el-button>
  28. <!-- 删除btn 多选 -->
  29. <el-button size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)"><i class="iconfont icon-shanchu" />删除</el-button>
  30. <el-button :loading="crud.downloadLoading" size="mini" :disabled="crud.selections.length === 0" @click="doExport(crud.selections)">
  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 !== 1" @click="handleTestFile(1)"><i class="iconfont icon-shangchuan2" />原文上传</el-button> -->
  38. <el-button size="mini" :disabled="crud.selections.length === 0" @click="handleBatch(crud.selections)"><i class="iconfont icon-piliangchengjian" />批量成件</el-button>
  39. <el-button size="mini" :disabled="crud.selections.length === 0" @click="handelMerge(crud.selections)"><i class="iconfont icon-hebingchengjian" />合并成件</el-button>
  40. <el-button size="mini" :disabled="crud.selections.length === 0" @click="handleMove"><i class="iconfont icon-yidong" />移动</el-button>
  41. </div>
  42. </template>
  43. </crudOperation>
  44. </div>
  45. <!--表格渲染-->
  46. <div class="container-right">
  47. <span class="right-top-line" />
  48. <span class="left-bottom-line" />
  49. <el-table
  50. ref="table"
  51. v-loading="crud.loading"
  52. :data="crud.data"
  53. style="width: 100%;"
  54. @row-click="clickRowHandler"
  55. @select="crud.selectChange"
  56. @select-all="crud.selectAllChange"
  57. @selection-change="crud.selectionChangeHandler"
  58. @cell-dblclick="tableDoubleClick"
  59. @mousedown.native="onMouseDown"
  60. @mouseup.native="onMouseUp"
  61. >
  62. <el-table-column type="selection" align="center" width="55" />
  63. <el-table-column label="序号" width="55" align="center" show-overflow-tooltip>
  64. <template slot-scope="scope">
  65. <span>{{ (crud.page.page-1) * crud.page.size + scope.$index + 1 }}</span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="原文" prop="filesNum" width="55" align="center">
  69. <template slot-scope="scope">
  70. {{ scope.row.filesNum === '' ? 0 : scope.row.filesNum }}
  71. </template>
  72. </el-table-column>
  73. <el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip>
  74. <template slot="header">
  75. <el-tooltip
  76. class="item"
  77. effect="dark"
  78. :content="field.fieldCnName"
  79. placement="top-start"
  80. >
  81. <span>{{ field.fieldCnName }}</span>
  82. </el-tooltip>
  83. </template>
  84. <template slot-scope="scope">
  85. {{ scope.row[field.fieldName] }}
  86. </template>
  87. </el-table-column>
  88. </el-table>
  89. <!--分页组件-->
  90. <pagination v-if="crud.data.length !== 0" />
  91. </div>
  92. <File ref="fileEle" :selected-document="selectedDocument" />
  93. <detail ref="archivesInfo" :selected-document="selectedDocument" />
  94. <!-- 批量成件 -->
  95. <batchFile ref="batchForm" :selected-document="selectedDocument" @refresh="crud.refresh" />
  96. <!-- 移动 -->
  97. <moveFile ref="moveForm" :selected-document="selectedDocument" @refresh="crud.refresh" />
  98. <!-- 合并成件 -->
  99. <el-dialog class="dialog-middle" :modal-append-to-body="false" :close-on-click-modal="false" :before-close="closeDialog" :visible="mergeVisible" title="合并成件">
  100. <span class="dialog-right-top" />
  101. <span class="dialog-left-bottom" />
  102. <div class="setting-dialog">
  103. <el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px">
  104. <el-form-item label="档案门类" prop="categoryId">
  105. <treeselect
  106. v-model="form.categoryId"
  107. :options="categoryTree"
  108. style="width: 400px;"
  109. :normalizer="normalizer"
  110. flat
  111. :multiple="false"
  112. :default-expand-level="6"
  113. placeholder="请选择档案门类"
  114. @select="handleSelectCategory"
  115. />
  116. </el-form-item>
  117. </el-form>
  118. <div slot="footer" class="dialog-footer">
  119. <el-button type="text" @click="closeDialog">取消</el-button>
  120. <el-button type="primary" @click="handleFormMerge()">确定</el-button>
  121. </div>
  122. </div>
  123. </el-dialog>
  124. <!--新增 / 编辑 表单组件-->
  125. <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">
  126. <span class="dialog-right-top" />
  127. <span class="dialog-left-bottom" />
  128. <div class="setting-dialog">
  129. <PreviewForm
  130. ref="previewForm"
  131. :form-preview-data.sync="formPreviewData"
  132. :selected-category="selectedCategory"
  133. :parents-id="parentsId"
  134. :arc-id="arcId"
  135. :is-des-form-type="isDesFormType"
  136. :is-disabled="isDisabled"
  137. :selected-document="selectedDocument"
  138. :is-has-code="isHasCode"
  139. @close-dialog="closeDialog"
  140. @formLoadingShow="formLoadingShow"
  141. />
  142. <div slot="footer" class="dialog-footer" :style="{ marginTop: isDesFormType === 'mergeFile' ? '85px !important' : '20px !important' }">
  143. <el-button type="text" @click="closeDialog">取消</el-button>
  144. <el-button :loading="archivesBtnLoading" type="primary" @click="handlerArchivesSubmit">确定</el-button>
  145. </div>
  146. </div>
  147. </el-dialog>
  148. <!--高级检索模态框-->
  149. <AdvancedSearchModal
  150. :visible.sync="advancedSearchVisible"
  151. :selected-document="selectedDocument"
  152. :initial-conditions="advancedSearchConditions"
  153. @search="handleAdvancedSearch"
  154. />
  155. </div>
  156. </div>
  157. </div>
  158. </template>
  159. <script>
  160. import CRUD, { presenter, header } from '@crud/crud'
  161. import { preLibraryCrud } from './mixins/index'
  162. import { FetchMenuByFondsId, FetchInitCategoryInputFieldByPid } from '@/api/system/category/category'
  163. import PrearchiveCrud from '@/api/prearchiveLibrary/prearchiveLibrary'
  164. import rrOperation from '@crud/RR.operation'
  165. import crudOperation from '@crud/CRUD.operation'
  166. import pagination from '@crud/Pagination'
  167. import Treeselect from '@riophae/vue-treeselect'
  168. import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  169. import TreeList from './treeList'
  170. import PreviewForm from '@/views/components/category/PreviewForm'
  171. import batchFile from './module/batchFile'
  172. import moveFile from './module/moveFile'
  173. import detail from './module/detail'
  174. import File from './file/index'
  175. import AdvancedSearchModal from './advancedSearchModal'
  176. import { exportFile } from '@/utils/index'
  177. import qs from 'qs'
  178. import { mapGetters } from 'vuex'
  179. export default {
  180. name: 'PrearchiveLibrary',
  181. components: { TreeList, PreviewForm, batchFile, moveFile, detail, Treeselect, rrOperation, crudOperation, pagination, File, AdvancedSearchModal },
  182. cruds() {
  183. return [
  184. CRUD({
  185. title: '预归档库', url: 'api/re-document/initPreDocument',
  186. crudMethod: { ...PrearchiveCrud },
  187. optShow: {
  188. add: false,
  189. edit: false,
  190. del: false,
  191. download: false,
  192. group: false,
  193. reset: false
  194. },
  195. queryOnPresenterCreated: false
  196. })
  197. ]
  198. },
  199. provide() {
  200. return {
  201. parentsData: this
  202. }
  203. },
  204. mixins: [presenter(), header(), preLibraryCrud],
  205. data() {
  206. return {
  207. archivesBtnLoading: false,
  208. permission: {},
  209. tableDisplayFields: [], // table-list-title字段
  210. arrySort: [],
  211. selectedDocument: {},
  212. mergeVisible: false,
  213. categoryTree: [],
  214. form: {},
  215. loadSource: [],
  216. rules: {
  217. target: [
  218. { required: true, message: '请选择档案门类', trigger: 'input' }
  219. ]
  220. },
  221. formVisible: false,
  222. formTitle: '新增文件',
  223. formPreviewData: [],
  224. selectedCategory: null,
  225. parentsId: null,
  226. arcId: null,
  227. isDesFormType: 'prearchiveLibrary',
  228. isDisabled: false,
  229. isHasCode: false,
  230. selectedCategoryMerge: null,
  231. timer: null,
  232. mousedownTime: 0,
  233. mousedownX: 0,
  234. mousedownY: 0,
  235. fileOriginal: null,
  236. fileOneVisible: false,
  237. advancedSearchVisible: false,
  238. advancedSearchConditions: []
  239. }
  240. },
  241. computed: {
  242. ...mapGetters([
  243. 'baseApi'
  244. ]),
  245. // 格式化高级检索条件显示文案
  246. advancedSearchDisplayText() {
  247. if (!this.advancedSearchConditions || this.advancedSearchConditions.length === 0) {
  248. return ''
  249. }
  250. return this.advancedSearchConditions.map(item => {
  251. if (item.field) {
  252. // 字段条件
  253. let keywordDisplay = item.keyWord
  254. if (item.symbol === '包含' || item.symbol === '不包含') {
  255. keywordDisplay = `'%${item.keyWord}%'`
  256. } else if (item.keyWord && isNaN(parseInt(item.keyWord))) {
  257. keywordDisplay = `'${item.keyWord}'`
  258. }
  259. return `${item.field} ${item.symbol} ${keywordDisplay}`
  260. } else if (item.connector) {
  261. // 连接符
  262. return item.connector
  263. } else if (item.bracket) {
  264. // 括号
  265. return item.bracket
  266. }
  267. return ''
  268. }).join(' ')
  269. }
  270. },
  271. created() {
  272. },
  273. methods: {
  274. [CRUD.HOOK.beforeRefresh]() {
  275. this.crud.query.documentId = this.selectedDocument.id
  276. this.crud.query.fondsAffiliation = this.selectedDocument.fondsId
  277. this.crud.query.sort = this.arrySort
  278. },
  279. formLoadingShow(loadingType) {
  280. this.archivesBtnLoading = loadingType
  281. },
  282. handleNodeClick(data) {
  283. this.selectedDocument = data
  284. this.getInitDocumentsViewTable()
  285. },
  286. // 显示高级检索弹窗
  287. showAdvancedSearch() {
  288. this.advancedSearchVisible = true
  289. },
  290. // 处理高级检索
  291. handleAdvancedSearch(data) {
  292. this.advancedSearchVisible = false
  293. this.crud.query.intelligenceSearch = data.sql
  294. this.advancedSearchConditions = data.conditions || []
  295. this.crud.toQuery()
  296. },
  297. // 清除高级检索条件
  298. clearAdvancedSearch() {
  299. this.crud.query.intelligenceSearch = null
  300. this.advancedSearchConditions = []
  301. this.crud.toQuery()
  302. },
  303. // 重置查询
  304. resetQuery() {
  305. this.advancedSearchConditions = []
  306. this.crud.resetQuery()
  307. },
  308. // 字段项
  309. getInitDocumentsViewTable() {
  310. PrearchiveCrud.FetchInitDocumentsViewTable({ documentId: this.selectedDocument.id }).then(data => {
  311. if (data) {
  312. this.arrySort = []
  313. this.tableDisplayFields = data
  314. const orderSortArry = this.tableDisplayFields.filter(item => item.queue).sort((a, b) => a.queue - b.queue)
  315. orderSortArry.forEach(item => {
  316. if (item.displayOrderBy) {
  317. this.arrySort.push(item.fieldName + ',' + item.displayOrderBy)
  318. }
  319. })
  320. this.$nextTick(() => {
  321. this.crud.toQuery()
  322. })
  323. }
  324. })
  325. },
  326. // 著录界面-form/详情-api
  327. handleForm(type) {
  328. if (this.$refs.previewForm) {
  329. this.$refs.previewForm.resetForm()
  330. }
  331. // 清空formPreviewData
  332. this.formPreviewData = []
  333. this.mergeVisible = false
  334. this.selectedCategory = this.selectedDocument
  335. this.isDesFormType = 'prearchiveLibrary'
  336. let params
  337. if (type === 'add') {
  338. this.formTitle = '新增文件'
  339. params = {
  340. documentId: this.selectedDocument.id,
  341. archivesId: null
  342. }
  343. } else if (type === 'edit') {
  344. this.formTitle = '编辑文件'
  345. this.arcId = this.crud.selections[0].id
  346. params = {
  347. documentId: this.selectedDocument.id,
  348. archivesId: this.crud.selections[0].id
  349. }
  350. }
  351. this.getFormInfo(params, type)
  352. },
  353. getFormInfo(params, type) {
  354. PrearchiveCrud.FetchDoeditDocument(params).then(data => {
  355. console.log('data', data)
  356. const showFiledAll = data.showFiled.filter(item => item.isSequence).sort((a, b) => a.isSequence - b.isSequence)
  357. this.$nextTick(() => {
  358. this.formPreviewData = showFiledAll
  359. this.formVisible = true
  360. this.$nextTick(() => {
  361. this.$refs.previewForm.fileOriginal = null
  362. this.$refs.previewForm.fileJsonString = null
  363. if (type === 'edit') {
  364. this.$refs.previewForm.archivesType = 'edit'
  365. this.$refs.previewForm.addOrUpdateForm = data.echo
  366. // if (data.fileecho) {
  367. // const fileecho = []
  368. // fileecho.push(data.fileecho)
  369. // this.$refs.previewForm.fileOriginal = fileecho[0].file_name
  370. // this.$refs.previewForm.fileJsonString = JSON.stringify(fileecho)
  371. // } else {
  372. // this.$refs.previewForm.fileOriginal = ''
  373. // this.$refs.previewForm.fileJsonString = ''
  374. // }
  375. const fileecho = data.fileecho
  376. let fileOriginal = ''
  377. let fileJsonString = ''
  378. if (Array.isArray(fileecho) && fileecho.length > 0) {
  379. fileOriginal = fileecho
  380. .filter(item => item && item.file_name)
  381. .map(item => item.file_name)
  382. .join(',')
  383. fileJsonString = JSON.stringify(fileecho)
  384. } else if (typeof fileecho === 'object' && fileecho !== null && Object.keys(fileecho).length > 0) {
  385. fileOriginal = fileecho.file_name || ''
  386. fileJsonString = JSON.stringify([fileecho])
  387. }
  388. // 赋值给表单
  389. this.$refs.previewForm.fileOriginal = fileOriginal
  390. this.$refs.previewForm.fileJsonString = fileJsonString
  391. console.log('fileJsonString', JSON.parse(fileJsonString))
  392. console.log('fileJsonString', JSON.parse(fileJsonString).length)
  393. } else {
  394. this.$refs.previewForm.archivesType = 'add'
  395. }
  396. })
  397. })
  398. })
  399. },
  400. handleFormMerge() {
  401. console.log('this.selectedDocumentmMerge', this.selectedDocument)
  402. this.selectedCategory = this.selectedCategoryMerge
  403. this.selectedCategory.fondsId = this.selectedDocument.fondsId
  404. this.selectedCategory.fondsNo = this.selectedDocument.fondsNo
  405. this.selectedCategory.fondName = this.selectedDocument.fondsName
  406. console.log('this.selectedCategory', this.selectedCategory)
  407. // let categoryLevel
  408. // if (this.selectedCategoryMerge.arrangeType === 1) {
  409. // categoryLevel = 3
  410. // } else if (this.selectedCategoryMerge.arrangeType === 2) {
  411. // categoryLevel = 2
  412. // } else {
  413. // categoryLevel = 1
  414. // }
  415. FetchInitCategoryInputFieldByPid({
  416. categoryId: this.selectedCategoryMerge.id,
  417. categoryLevel: 3,
  418. istype: 2
  419. }).then((data) => {
  420. // // 1. 过滤并排序有isSequence的字段
  421. // const showFiledAll = data.filter(item => item.isSequence).sort((a, b) => a.isSequence - b.isSequence)
  422. // // 2. 查找fieldName为is_entity的字段
  423. // const entityField = data.find(item => item.fieldName === 'is_entity')
  424. // // 3. 如果找到该字段,就添加到列表末尾
  425. // if (entityField) {
  426. // showFiledAll.push(entityField)
  427. // }
  428. this.$nextTick(() => {
  429. this.formPreviewData = data
  430. this.formVisible = true
  431. this.mergeVisible = false
  432. this.isDesFormType = 'mergeFile'
  433. this.$nextTick(() => {
  434. this.$refs.previewForm.archivesType = 'add'
  435. this.$refs.previewForm.mergeFileArcIds = this.crud.selections.map(item => item.id)
  436. this.$refs.previewForm.mergeFileCategory = this.selectedCategoryMerge.id
  437. })
  438. })
  439. })
  440. },
  441. handlerArchivesSubmit() {
  442. this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedDocument.id)
  443. },
  444. clickRowHandler(row) {
  445. // this.$refs.table.clearSelection()
  446. // this.$refs.table.toggleRowSelection(row)
  447. if (this.timer) {
  448. clearTimeout(this.timer)
  449. }
  450. const clickTime = Date.now()
  451. const clickX = event.clientX
  452. const clickY = event.clientY
  453. const timeDiff = clickTime - this.mousedownTime
  454. const distance = Math.sqrt(
  455. Math.pow(clickX - this.mousedownX, 2) + Math.pow(clickY - this.mousedownY, 2)
  456. )
  457. // 时间差较短且鼠标移动距离较小,判定为点击操作
  458. if (timeDiff < 300 && distance < 10) {
  459. this.timer = setTimeout(() => {
  460. this.parentsId = row.id
  461. this.openJuannei('所属文件:' + row.maintitle, this.parentsId, row)
  462. }, 300)
  463. }
  464. },
  465. openJuannei(data, parentId, parentRow) {
  466. this.$refs.fileEle.fileDrawer = true
  467. this.$nextTick(() => {
  468. this.$refs.fileEle.test = data
  469. this.$refs.fileEle.parentInfo = parentRow
  470. this.$refs.fileEle.getFile()
  471. })
  472. },
  473. onMouseDown(event) {
  474. this.mousedownTime = Date.now()
  475. this.mousedownX = event.clientX
  476. this.mousedownY = event.clientY
  477. },
  478. onMouseUp() {
  479. // 可以在这里添加更多逻辑,比如清除临时数据等
  480. },
  481. // 双击查看详情
  482. tableDoubleClick(row) {
  483. if (this.timer) {
  484. clearTimeout(this.timer)
  485. }
  486. console.log('tableDoubleClick', row)
  487. this.$refs.archivesInfo.archivesInfoVisible = true
  488. this.$refs.archivesInfo.archivesTabIndex = 0
  489. this.$refs.archivesInfo.parentInfo = row
  490. this.$refs.archivesInfo.getDetial(row.id)
  491. },
  492. // 删除
  493. toDelete(datas) {
  494. this.$confirm('此操作将删除当前所选预归档数据' + '<span>你是否还要继续?</span>', '提示', {
  495. confirmButtonText: '继续',
  496. cancelButtonText: '取消',
  497. type: 'warning',
  498. dangerouslyUseHTMLString: true
  499. }).then(() => {
  500. this.crud.delAllLoading = true
  501. const ids = []
  502. datas.forEach(val => {
  503. ids.push(val.id)
  504. })
  505. const params = {
  506. 'documentId': this.selectedDocument.id,
  507. 'ids': ids
  508. }
  509. PrearchiveCrud.del(params).then(() => {
  510. this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
  511. this.crud.delAllLoading = false
  512. this.crud.refresh()
  513. }).catch(err => {
  514. this.crud.delAllLoading = false
  515. console.log(err)
  516. })
  517. }).catch(() => {
  518. })
  519. },
  520. // 导出
  521. doExport(datas) {
  522. this.crud.downloadLoading = true
  523. this.$confirm('此操作将导出所选数据' + '<span>你是否还要继续?</span>', '提示', {
  524. confirmButtonText: '继续',
  525. cancelButtonText: '取消',
  526. type: 'warning',
  527. dangerouslyUseHTMLString: true
  528. }).then(() => {
  529. const ids = []
  530. datas.forEach(val => {
  531. ids.push(val.id)
  532. })
  533. const params = {
  534. 'documentId': this.selectedDocument.id,
  535. 'ids': ids
  536. }
  537. exportFile(this.baseApi + '/api/re-document/download?' + qs.stringify(params, { indices: false }))
  538. this.crud.downloadLoading = false
  539. }).catch(() => {
  540. this.crud.downloadLoading = false
  541. })
  542. },
  543. preUplpadClose() {
  544. this.$refs.preUploadRefs.handleClearData()
  545. },
  546. handleSuccessResource(filePath, fileName, jsonArrayToSend) {
  547. console.log('handleSuccessResource', filePath)
  548. console.log('handleSuccessResource', fileName)
  549. console.log('handleSuccessResource', jsonArrayToSend)
  550. console.log('handleSuccessResource', jsonArrayToSend[0].fileJsonString)
  551. this.fileOriginal = fileName
  552. const fileJson = JSON.parse(jsonArrayToSend[0].fileJsonString)
  553. fileJson[0].file_path = '/' + filePath
  554. fileJson[0].is_quote = null
  555. fileJson[0].last_modified = jsonArrayToSend[0].last_modified
  556. this.fileJsonString = JSON.stringify(fileJson)
  557. },
  558. handleTestFile(type) {
  559. if (type === 1) {
  560. this.fileUpload(1)
  561. } else {
  562. this.arcId = this.crud.selections[0].id
  563. this.fileOneVisible = true
  564. }
  565. },
  566. handleErrorResource(res) {
  567. console.log('handleErrorResource', res)
  568. },
  569. // 原文上传
  570. fileUpload(uploadType) {
  571. console.log('dddd')
  572. console.log('this.selectedDocument', this.selectedDocument)
  573. this.arcId = this.crud.selections[0].id
  574. this.$refs.uploadBigRef.updateUploadOptions(uploadType)
  575. this.$refs.uploadBigRef.fileList = []
  576. // if (this.$refs.uploadOriginalRef.uploadVisible) {
  577. // this.$refs.uploadOriginalRef.uploadType = uploadType
  578. // this.$refs.uploadOriginalRef.fileList = []
  579. // }
  580. },
  581. // 批量成件
  582. handleBatch() {
  583. this.$refs.batchForm.batchVisible = true
  584. this.$refs.batchForm.selectionsArc = this.crud.selections
  585. this.$nextTick(() => {
  586. this.$refs.batchForm.getMateByDocumentId()
  587. })
  588. },
  589. // 合并成件
  590. handelMerge() {
  591. this.mergeVisible = true
  592. this.getCategoryDataTree()
  593. },
  594. // 移动
  595. handleMove() {
  596. this.$refs.moveForm.moveVisible = true
  597. this.$refs.moveForm.moveArc = this.crud.selections
  598. },
  599. getCategoryDataTree() {
  600. const params = {
  601. 'fondsId': this.selectedDocument.fondsId
  602. }
  603. FetchMenuByFondsId(params).then(res => {
  604. this.categoryTree = this.filterData(res)
  605. console.log('this.categoryTree222', this.categoryTree)
  606. })
  607. },
  608. handleSelectCategory(val) {
  609. this.selectedCategoryMerge = val
  610. },
  611. normalizer(node) {
  612. if (node.children && !node.children.length) {
  613. delete node.children
  614. }
  615. return {
  616. id: node.id,
  617. label: node.cnName,
  618. children: node.children,
  619. isDisabled: node.isType !== 2
  620. }
  621. },
  622. // handleClose(done) {
  623. // this.mergeVisible = false
  624. // this.formVisible = false
  625. // this.$refs.previewForm.preUplpadClose()
  626. // done()
  627. // },
  628. closeDialog() {
  629. // this.fileOneVisible = false
  630. this.mergeVisible = false
  631. this.formVisible = false
  632. if (this.$refs.previewForm.$refs['addOrUpdateForm']) {
  633. this.$refs.previewForm.$refs['addOrUpdateForm'].clearValidate()
  634. this.$refs.previewForm.$refs['addOrUpdateForm'].resetFields()
  635. }
  636. this.$refs.previewForm.fileOriginal = null
  637. this.$refs.previewForm.fileJsonString = null
  638. this.$refs.previewForm.preUplpadClose()
  639. }
  640. }
  641. }
  642. </script>
  643. <style lang='scss' scoped>
  644. @import "~@/assets/styles/collect-reorganizi.scss";
  645. @mixin management-fixed-style{
  646. [data-theme="dark"] & {
  647. background-color: #031435 !important;
  648. -webkit-box-shadow: -5px 5px 10px 1px rgba(15,164,222,.16);
  649. box-shadow: -5px 5px 10px 1px rgba(15,164,222,.16);
  650. }
  651. [data-theme="light"] & {
  652. background-color: #fff;
  653. }
  654. }
  655. .el-table {
  656. ::v-deep .el-table__fixed-right {
  657. @include management-fixed-style;
  658. }
  659. }
  660. .preview-dialog .el-dialog .preview-content {
  661. height: calc(100vh - 264px) !important;
  662. }
  663. .dialog-middle{
  664. ::v-deep .el-dialog{
  665. width: 536px;
  666. }
  667. }
  668. </style>