Browse Source

公文新增编辑列表优化

master
xuhuajiao 2 weeks ago
parent
commit
f843a2605c
  1. 22
      src/views/archivesMIOD/miodLibrary/index.vue
  2. 7
      src/views/archivesMIOD/miodLibrary/treeList.vue
  3. 9
      src/views/components/category/PreviewForm.vue

22
src/views/archivesMIOD/miodLibrary/index.vue

@ -111,6 +111,7 @@
@close-dialog="closeDialog" @close-dialog="closeDialog"
@formLoadingShow="formLoadingShow" @formLoadingShow="formLoadingShow"
@refreshTree="refreshTreeList" @refreshTree="refreshTreeList"
@resetQuery="resetQuery"
/> />
<div slot="footer" class="dialog-footer" style="margin-top: 20px !important;"> <div slot="footer" class="dialog-footer" style="margin-top: 20px !important;">
<el-button type="text" @click="closeDialog">取消</el-button> <el-button type="text" @click="closeDialog">取消</el-button>
@ -277,7 +278,13 @@ export default {
formLoadingShow(loadingType) { formLoadingShow(loadingType) {
this.archivesBtnLoading = loadingType this.archivesBtnLoading = loadingType
}, },
handleNodeClick(data) {
handleNodeClick(data, type) {
if (type && type === 'targetNode') {
console.log('非手动点击tree')
} else {
this.search = ''
this.crud.query.search = ''
}
this.selectedDocument = data this.selectedDocument = data
let documentId = null let documentId = null
if (data.isType === 2) { if (data.isType === 2) {
@ -285,10 +292,10 @@ export default {
} else { } else {
documentId = data.documentId documentId = data.documentId
} }
this.getInitDocumentsViewTable(documentId)
this.getInitDocumentsViewTable(documentId, type)
}, },
// table // table
getInitDocumentsViewTable(documentId) {
getInitDocumentsViewTable(documentId, type) {
crudDocumentArchives.FetchInitDocumentsViewTable({ documentId: documentId }).then(data => { crudDocumentArchives.FetchInitDocumentsViewTable({ documentId: documentId }).then(data => {
if (data) { if (data) {
this.arrySort = [] this.arrySort = []
@ -307,12 +314,16 @@ export default {
this.crud.query.docDepartment = this.selectedDocument.dictionaryName this.crud.query.docDepartment = this.selectedDocument.dictionaryName
this.crud.query.archiveYear = this.selectedDocument.label this.crud.query.archiveYear = this.selectedDocument.label
} else { } else {
this.search = ''
this.crud.query.search = ''
// this.search = ''
// this.crud.query.search = ''
this.crud.query.docDepartment = null this.crud.query.docDepartment = null
this.crud.query.archiveYear = null this.crud.query.archiveYear = null
} }
if (type && type === 'targetNode') {
this.crud.refresh()
} else {
this.crud.toQuery() this.crud.toQuery()
}
}) })
} }
}) })
@ -346,7 +357,6 @@ export default {
this.getFormInfo(params, type) this.getFormInfo(params, type)
}, },
getFormInfo(params, type) { getFormInfo(params, type) {
this.archivesType = type this.archivesType = type
crudDocumentArchives.FetchDoeditDocument(params).then(data => { crudDocumentArchives.FetchDoeditDocument(params).then(data => {

7
src/views/archivesMIOD/miodLibrary/treeList.vue

@ -177,7 +177,7 @@ export default {
console.log('111') console.log('111')
console.log(targetNode.id) console.log(targetNode.id)
this.$refs.tree.setCurrentKey(targetNode.id) this.$refs.tree.setCurrentKey(targetNode.id)
this.handleNodeClick(targetNode)
this.handleNodeClick(targetNode, 'targetNode')
} }
// //
@ -270,11 +270,10 @@ export default {
return null // return null //
}, },
// //
handleNodeClick(val) {
console.log('val', val)
handleNodeClick(val, type) {
if (val) { if (val) {
this.currentTreeVal = val this.currentTreeVal = val
this.$emit('nodeClick', val)
this.$emit('nodeClick', val, type)
} }
} }
} }

9
src/views/components/category/PreviewForm.vue

@ -679,6 +679,9 @@ export default {
refreshTreeList() { refreshTreeList() {
this.$emit('refreshTree') this.$emit('refreshTree')
}, },
resetQuery() {
this.$emit('resetQuery')
},
// //
currentYear() { currentYear() {
return new Date().getFullYear() return new Date().getFullYear()
@ -1555,7 +1558,13 @@ export default {
if (res) { if (res) {
this.$message({ message: res.message, type: 'success', offset: 8 }) this.$message({ message: res.message, type: 'success', offset: 8 })
this.$emit('close-dialog') this.$emit('close-dialog')
if (this.archivesType === 'edit') {
this.crud.refresh() this.crud.refresh()
} else {
this.resetQuery()
this.crud.toQuery()
}
// this.fileOriginal = null // this.fileOriginal = null
this.refreshTreeList() this.refreshTreeList()
} }

Loading…
Cancel
Save