|
|
@ -106,6 +106,15 @@ |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
<ScopeModule ref="scopeModule" @getScope="hanleScopeSelect" /> |
|
|
<ScopeModule ref="scopeModule" @getScope="hanleScopeSelect" /> |
|
|
|
|
|
<MergeIntoDocument |
|
|
|
|
|
ref="mergeIntoDocument" |
|
|
|
|
|
:selected-category="selectedDocument" |
|
|
|
|
|
:selections="selectionsArc" |
|
|
|
|
|
:display-fields="displayFields" |
|
|
|
|
|
:business-type="8" |
|
|
|
|
|
:extra-params="batchFlowParams" |
|
|
|
|
|
@close-dialog="handleBatchFlowSuccess" |
|
|
|
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
@ -117,14 +126,16 @@ import { FetchMenuByFondsId, FetchInitCategoryFieldByPid } from '@/api/system/ca |
|
|
import { FetchArchivesScopeByCategoryId } from '@/api/system/archivesScope' |
|
|
import { FetchArchivesScopeByCategoryId } from '@/api/system/archivesScope' |
|
|
import { FetchCheckRepeat } from '@/api/system/fieldMate' |
|
|
import { FetchCheckRepeat } from '@/api/system/fieldMate' |
|
|
import { FetchBatchToFile } from '@/api/prearchiveLibrary/prearchiveLibrary' |
|
|
import { FetchBatchToFile } from '@/api/prearchiveLibrary/prearchiveLibrary' |
|
|
|
|
|
import { FetchReDocumentInitFlowByCategoryId } from '@/api/system/category/process' |
|
|
import Treeselect from '@riophae/vue-treeselect' |
|
|
import Treeselect from '@riophae/vue-treeselect' |
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css' |
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css' |
|
|
// import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect' |
|
|
// import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect' |
|
|
import ScopeModule from './scope' |
|
|
import ScopeModule from './scope' |
|
|
|
|
|
import MergeIntoDocument from './mergeIntoDocument.vue' |
|
|
import { mapGetters } from 'vuex' |
|
|
import { mapGetters } from 'vuex' |
|
|
export default { |
|
|
export default { |
|
|
name: 'BatchFile', |
|
|
name: 'BatchFile', |
|
|
components: { Treeselect, ScopeModule }, |
|
|
|
|
|
|
|
|
components: { Treeselect, ScopeModule, MergeIntoDocument }, |
|
|
mixins: [preLibraryCrud], |
|
|
mixins: [preLibraryCrud], |
|
|
props: { |
|
|
props: { |
|
|
selectedDocument: { |
|
|
selectedDocument: { |
|
|
@ -132,6 +143,11 @@ export default { |
|
|
default: function() { |
|
|
default: function() { |
|
|
return {} |
|
|
return {} |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
// 档案列表列配置 |
|
|
|
|
|
displayFields: { |
|
|
|
|
|
type: Array, |
|
|
|
|
|
default: () => [] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
@ -174,7 +190,8 @@ export default { |
|
|
rightLoading: false, |
|
|
rightLoading: false, |
|
|
isCorrField: true, |
|
|
isCorrField: true, |
|
|
allCorrField: [], |
|
|
allCorrField: [], |
|
|
isTest: false |
|
|
|
|
|
|
|
|
isTest: false, |
|
|
|
|
|
batchFlowParams: {} // 批量成件流程附加参数 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
@ -598,36 +615,77 @@ export default { |
|
|
const archivesIds = this.selectionsArc.map(item => { |
|
|
const archivesIds = this.selectionsArc.map(item => { |
|
|
return item.id |
|
|
return item.id |
|
|
}) |
|
|
}) |
|
|
const params = { |
|
|
|
|
|
'archival_category_code': this.batchCategory.code, |
|
|
|
|
|
'fondsAffiliation': this.selectedDocument.fondsId, |
|
|
|
|
|
'archivesIds': archivesIds, |
|
|
|
|
|
'documentId': this.selectedDocument.id, |
|
|
|
|
|
'categoryId': this.form.categoryId, |
|
|
|
|
|
'dtos': dtos |
|
|
|
|
|
} |
|
|
|
|
|
console.log(params) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 判断批量成件审批流程是否开启 |
|
|
|
|
|
FetchReDocumentInitFlowByCategoryId({ 'documentId': null }).then((flowRes) => { |
|
|
|
|
|
const flowItem = flowRes && flowRes.length > 0 ? flowRes[0] : null |
|
|
|
|
|
if (flowItem && flowItem.status === 1) { |
|
|
|
|
|
const batchFlowParams = { |
|
|
|
|
|
'sourceDocumentId': this.selectedDocument.id, // 来源预归档门类 |
|
|
|
|
|
'purposeCategoryId': this.form.categoryId, // 目的门类 |
|
|
|
|
|
'archivalCategoryCode': this.batchCategory.code, // 目的门类code |
|
|
|
|
|
'archivesIds': archivesIds, // 预归档档案id集合 |
|
|
|
|
|
// 'estimatedArchiveNo': this.addOrUpdateForm.archive_no, // 预计档号 |
|
|
|
|
|
'dataJson': JSON.stringify(dtos) // 保存json 流程通过添加到档案 |
|
|
|
|
|
} |
|
|
|
|
|
console.log('batchFlowParams', batchFlowParams) |
|
|
|
|
|
this.batchFlowParams = batchFlowParams |
|
|
|
|
|
this.archivesBtnLoading = false |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
this.$refs.mergeIntoDocument.archivesFillingVisible = true |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
// 审批流程未开启,直接批量成件 |
|
|
|
|
|
const params = { |
|
|
|
|
|
'archival_category_code': this.batchCategory.code, |
|
|
|
|
|
'fondsAffiliation': this.selectedDocument.fondsId, |
|
|
|
|
|
'archivesIds': archivesIds, |
|
|
|
|
|
'documentId': this.selectedDocument.id, |
|
|
|
|
|
'categoryId': this.form.categoryId, |
|
|
|
|
|
'dtos': dtos |
|
|
|
|
|
} |
|
|
|
|
|
console.log(params) |
|
|
|
|
|
this.submitBatchToFile(params) |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
this.archivesBtnLoading = false |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
// 流程未开启时直接提交批量成件 |
|
|
|
|
|
submitBatchToFile(params) { |
|
|
FetchBatchToFile(params).then((res) => { |
|
|
FetchBatchToFile(params).then((res) => { |
|
|
console.log(res) |
|
|
console.log(res) |
|
|
if (res === 'SUCCESS') { |
|
|
if (res === 'SUCCESS') { |
|
|
this.$emit('refresh') |
|
|
|
|
|
this.batchVisible = false |
|
|
|
|
|
Object.assign(this.form, { |
|
|
|
|
|
ruleName: null, |
|
|
|
|
|
scope: null, |
|
|
|
|
|
documentId: null, |
|
|
|
|
|
categoryId: null |
|
|
|
|
|
}) |
|
|
|
|
|
this.selectedCategoryName = null |
|
|
|
|
|
this.selectedCategory = null |
|
|
|
|
|
this.allFieldData = [] |
|
|
|
|
|
this.allCorrField = [] |
|
|
|
|
|
this.isTest = false |
|
|
|
|
|
this.batchCategory = {} |
|
|
|
|
|
|
|
|
this.$message({ message: '批量成件成功', type: 'success', offset: 8 }) |
|
|
|
|
|
this.resetBatchForm() |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message({ message: '批量成件失败', type: 'error', offset: 8 }) |
|
|
} |
|
|
} |
|
|
this.archivesBtnLoading = false |
|
|
this.archivesBtnLoading = false |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 批量成件审批流程提交成功回调 |
|
|
|
|
|
handleBatchFlowSuccess() { |
|
|
|
|
|
this.resetBatchForm() |
|
|
|
|
|
}, |
|
|
|
|
|
// 重置批量成件表单并刷新列表 |
|
|
|
|
|
resetBatchForm() { |
|
|
|
|
|
this.$emit('refresh') |
|
|
|
|
|
this.batchVisible = false |
|
|
|
|
|
Object.assign(this.form, { |
|
|
|
|
|
ruleName: null, |
|
|
|
|
|
scope: null, |
|
|
|
|
|
documentId: null, |
|
|
|
|
|
categoryId: null |
|
|
|
|
|
}) |
|
|
|
|
|
this.selectedCategoryName = null |
|
|
|
|
|
this.selectedCategory = null |
|
|
|
|
|
this.allFieldData = [] |
|
|
|
|
|
this.allCorrField = [] |
|
|
|
|
|
this.isTest = false |
|
|
|
|
|
this.batchCategory = {} |
|
|
|
|
|
}, |
|
|
normalizer(node) { |
|
|
normalizer(node) { |
|
|
if (node.children && !node.children.length) { |
|
|
if (node.children && !node.children.length) { |
|
|
delete node.children |
|
|
delete node.children |
|
|
|