|  | @ -111,9 +111,9 @@ | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  | <script> |  |  | <script> | 
		
	
		
			
				|  |  | import { preLibraryCrud } from '../mixins/index' |  |  | import { preLibraryCrud } from '../mixins/index' | 
		
	
		
			
				|  |  | import { FetchInitFieldMate, FetchMateByDocumentId, FetchDetailsByDocumentIdAndCategoryId } from '@/api/system/fieldMate' |  |  |  | 
		
	
		
			
				|  |  |  |  |  | import { FetchInitFieldMate, FetchMateByDocumentIdShow, FetchDetailsByDocumentIdAndCategoryId } from '@/api/system/fieldMate' | 
		
	
		
			
				|  |  | import { FetchInitDocumentFieldByPid } from '@/api/system/fileLibrary/fileLibrary' |  |  | import { FetchInitDocumentFieldByPid } from '@/api/system/fileLibrary/fileLibrary' | 
		
	
		
			
				|  |  | import { FetchCategoryMenu, FetchInitCategoryFieldByPid } from '@/api/system/category/category' |  |  |  | 
		
	
		
			
				|  |  |  |  |  | import { FetchMenuByFondsId, FetchInitCategoryFieldByPid } from '@/api/system/category/category' | 
		
	
		
			
				|  |  | 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' | 
		
	
	
		
			
				|  | @ -197,9 +197,10 @@ export default { | 
		
	
		
			
				|  |  |     // 根据预归档库获取对应规则 |  |  |     // 根据预归档库获取对应规则 | 
		
	
		
			
				|  |  |     getMateByDocumentId() { |  |  |     getMateByDocumentId() { | 
		
	
		
			
				|  |  |       const params = { |  |  |       const params = { | 
		
	
		
			
				|  |  |         'documentId': this.selectedDocument.id |  |  |  | 
		
	
		
			
				|  |  |  |  |  |         'documentId': this.selectedDocument.id, | 
		
	
		
			
				|  |  |  |  |  |         'fondsId': this.selectedDocument.fondsId | 
		
	
		
			
				|  |  |       } |  |  |       } | 
		
	
		
			
				|  |  |       FetchMateByDocumentId(params).then(res => { |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       FetchMateByDocumentIdShow(params).then(res => { | 
		
	
		
			
				|  |  |         this.rulesOptions = res.map(item => { |  |  |         this.rulesOptions = res.map(item => { | 
		
	
		
			
				|  |  |           const json = {} |  |  |           const json = {} | 
		
	
		
			
				|  |  |           json.label = item.ruleName |  |  |           json.label = item.ruleName | 
		
	
	
		
			
				|  | @ -211,13 +212,31 @@ export default { | 
		
	
		
			
				|  |  |     getInitDetail(id) { |  |  |     getInitDetail(id) { | 
		
	
		
			
				|  |  |       FetchInitFieldMate({ 'id': id }).then((res) => { |  |  |       FetchInitFieldMate({ 'id': id }).then((res) => { | 
		
	
		
			
				|  |  |         this.selectedCategoryName = res.categoryName |  |  |         this.selectedCategoryName = res.categoryName | 
		
	
		
			
				|  |  |         this.batchCategory = res.fieldMateDetails[0].pid.categoryId |  |  |  | 
		
	
		
			
				|  |  |         this.form.categoryId = res.fieldMateDetails[0].pid.categoryId.pid |  |  |         this.form.categoryId = res.fieldMateDetails[0].pid.categoryId.pid | 
		
	
		
			
				|  |  |         this.getArchivesScopeByCategoryId() |  |  |         this.getArchivesScopeByCategoryId() | 
		
	
		
			
				|  |  |  |  |  |         const targetNode = this.findNodeWithId(this.categoryTree, this.form.categoryId) | 
		
	
		
			
				|  |  |  |  |  |         this.batchCategory = targetNode | 
		
	
		
			
				|  |  |  |  |  |         console.log(targetNode) | 
		
	
		
			
				|  |  |  |  |  |         console.log('batchCategory', this.batchCategory) | 
		
	
		
			
				|  |  |       }).catch(err => { |  |  |       }).catch(err => { | 
		
	
		
			
				|  |  |         console.log(err) |  |  |         console.log(err) | 
		
	
		
			
				|  |  |       }) |  |  |       }) | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     findNodeWithId(tree, targetId) { | 
		
	
		
			
				|  |  |  |  |  |       for (const node of tree) { | 
		
	
		
			
				|  |  |  |  |  |         if (node.id === targetId) { | 
		
	
		
			
				|  |  |  |  |  |           return node | 
		
	
		
			
				|  |  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |  |         if (node.children && node.children.length > 0) { | 
		
	
		
			
				|  |  |  |  |  |           const result = this.findNodeWithId(node.children, targetId) | 
		
	
		
			
				|  |  |  |  |  |           if (result) { | 
		
	
		
			
				|  |  |  |  |  |             return result | 
		
	
		
			
				|  |  |  |  |  |           } | 
		
	
		
			
				|  |  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |  |       return null | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  |     selectRules(val) { |  |  |     selectRules(val) { | 
		
	
		
			
				|  |  |       this.getInitDetail(val) |  |  |       this.getInitDetail(val) | 
		
	
		
			
				|  |  |       this.selectStatus = [] |  |  |       this.selectStatus = [] | 
		
	
	
		
			
				|  | @ -228,8 +247,12 @@ export default { | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     // 目标门类 |  |  |     // 目标门类 | 
		
	
		
			
				|  |  |     getCategoryDataTree() { |  |  |     getCategoryDataTree() { | 
		
	
		
			
				|  |  |       FetchCategoryMenu().then(res => { |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       const params = { | 
		
	
		
			
				|  |  |  |  |  |         'fondsId': this.selectedDocument.fondsId | 
		
	
		
			
				|  |  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |  |       FetchMenuByFondsId(params).then(res => { | 
		
	
		
			
				|  |  |         this.categoryTree = this.filterData(res) |  |  |         this.categoryTree = this.filterData(res) | 
		
	
		
			
				|  |  |  |  |  |         console.log('this.categoryTree', this.categoryTree) | 
		
	
		
			
				|  |  |       }) |  |  |       }) | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     // 根据pid获取门类字段 |  |  |     // 根据pid获取门类字段 | 
		
	
	
		
			
				|  | @ -252,6 +275,7 @@ export default { | 
		
	
		
			
				|  |  |       // 门类字段 |  |  |       // 门类字段 | 
		
	
		
			
				|  |  |       this.rightLoading = true |  |  |       this.rightLoading = true | 
		
	
		
			
				|  |  |       FetchInitCategoryFieldByPid({ categoryId: categoryId, categoryLevel: 3, isType: 2 }).then((res) => { |  |  |       FetchInitCategoryFieldByPid({ categoryId: categoryId, categoryLevel: 3, isType: 2 }).then((res) => { | 
		
	
		
			
				|  |  |  |  |  |         console.log('this.allCorrField') | 
		
	
		
			
				|  |  |         this.allCorrField = res.sort((a, b) => { |  |  |         this.allCorrField = res.sort((a, b) => { | 
		
	
		
			
				|  |  |           if (a.isInput !== b.isInput) { |  |  |           if (a.isInput !== b.isInput) { | 
		
	
		
			
				|  |  |             return a.isInput ? -1 : 1 |  |  |             return a.isInput ? -1 : 1 | 
		
	
	
		
			
				|  | @ -262,15 +286,19 @@ export default { | 
		
	
		
			
				|  |  |         res.forEach((item, index) => { |  |  |         res.forEach((item, index) => { | 
		
	
		
			
				|  |  |           this.selectStatus.push({ mode: true, fiedType: 1, value: '', field: item, isInput: item.isInput }) |  |  |           this.selectStatus.push({ mode: true, fiedType: 1, value: '', field: item, isInput: item.isInput }) | 
		
	
		
			
				|  |  |         }) |  |  |         }) | 
		
	
		
			
				|  |  |  |  |  |         console.log('his.selectStatus', this.selectStatus) | 
		
	
		
			
				|  |  |         if (this.form.scope) { |  |  |         if (this.form.scope) { | 
		
	
		
			
				|  |  |           const indexClass = res.findIndex(item => item.fieldName === 'archive_ctg_no') |  |  |           const indexClass = res.findIndex(item => item.fieldName === 'archive_ctg_no') | 
		
	
		
			
				|  |  |  |  |  |           console.log('indexClass', indexClass) | 
		
	
		
			
				|  |  |           const indexRetention = res.findIndex(item => item.fieldName === 'retention') |  |  |           const indexRetention = res.findIndex(item => item.fieldName === 'retention') | 
		
	
		
			
				|  |  |  |  |  |           console.log('indexRetention', indexRetention) | 
		
	
		
			
				|  |  |           if (indexClass !== -1 && this.scopeSelection[0].archivesClass !== null) { |  |  |           if (indexClass !== -1 && this.scopeSelection[0].archivesClass !== null) { | 
		
	
		
			
				|  |  |             this.selectStatus.splice(indexClass, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].archivesClass.name, field: this.allCorrField[indexClass], isInput: this.allCorrField[indexClass].isInput }) |  |  |             this.selectStatus.splice(indexClass, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].archivesClass.name, field: this.allCorrField[indexClass], isInput: this.allCorrField[indexClass].isInput }) | 
		
	
		
			
				|  |  |           } |  |  |           } | 
		
	
		
			
				|  |  |           if (indexRetention !== -1 && this.scopeSelection[0].retention !== '') { |  |  |           if (indexRetention !== -1 && this.scopeSelection[0].retention !== '') { | 
		
	
		
			
				|  |  |             this.selectStatus.splice(indexRetention, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].retention, field: this.allCorrField[indexRetention], isInput: this.allCorrField[indexRetention].isInput }) |  |  |             this.selectStatus.splice(indexRetention, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].retention, field: this.allCorrField[indexRetention], isInput: this.allCorrField[indexRetention].isInput }) | 
		
	
		
			
				|  |  |           } |  |  |           } | 
		
	
		
			
				|  |  |  |  |  |           console.log('his.selectStatus222', this.selectStatus) | 
		
	
		
			
				|  |  |         } |  |  |         } | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  |         this.rightLoading = false |  |  |         this.rightLoading = false | 
		
	
	
		
			
				|  | @ -289,16 +317,19 @@ export default { | 
		
	
		
			
				|  |  |         res.forEach((item, index) => { |  |  |         res.forEach((item, index) => { | 
		
	
		
			
				|  |  |           this.selectStatus.push({ mode: false, fiedType: item.categoryFieldId && item.categoryFieldId.isDefaultValue === '' ? 1 : 2, value: item.categoryFieldId && item.categoryFieldId.isDefaultValue === '' ? (item.documentFieldId && item.documentFieldId.fieldCnName) : item.categoryFieldId && item.categoryFieldId.isDefaultValue, field: item.documentFieldId, isInput: item.documentFieldId && item.documentFieldId.isInput }) |  |  |           this.selectStatus.push({ mode: false, fiedType: item.categoryFieldId && item.categoryFieldId.isDefaultValue === '' ? 1 : 2, value: item.categoryFieldId && item.categoryFieldId.isDefaultValue === '' ? (item.documentFieldId && item.documentFieldId.fieldCnName) : item.categoryFieldId && item.categoryFieldId.isDefaultValue, field: item.documentFieldId, isInput: item.documentFieldId && item.documentFieldId.isInput }) | 
		
	
		
			
				|  |  |         }) |  |  |         }) | 
		
	
		
			
				|  |  | 
 |  |  |  | 
		
	
		
			
				|  |  |  |  |  |         console.log('this.selectStatus444444444', this.selectStatus) | 
		
	
		
			
				|  |  |         if (this.form.scope) { |  |  |         if (this.form.scope) { | 
		
	
		
			
				|  |  |           const indexClass = res.findIndex(item => item.categoryFieldId.fieldName === 'archive_ctg_no') |  |  |           const indexClass = res.findIndex(item => item.categoryFieldId.fieldName === 'archive_ctg_no') | 
		
	
		
			
				|  |  |  |  |  |           console.log('indexClass', indexClass) | 
		
	
		
			
				|  |  |           const indexRetention = res.findIndex(item => item.categoryFieldId.fieldName === 'retention') |  |  |           const indexRetention = res.findIndex(item => item.categoryFieldId.fieldName === 'retention') | 
		
	
		
			
				|  |  |  |  |  |           console.log('indexRetention', indexRetention) | 
		
	
		
			
				|  |  |           if (indexClass !== -1 && this.scopeSelection[0].archivesClass !== null) { |  |  |           if (indexClass !== -1 && this.scopeSelection[0].archivesClass !== null) { | 
		
	
		
			
				|  |  |             this.selectStatus.splice(indexClass, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].archivesClass.name, field: this.allFieldData[indexClass].documentFieldId, isInput: this.allFieldData[indexClass].documentFieldId.isInput }) |  |  |             this.selectStatus.splice(indexClass, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].archivesClass.name, field: this.allFieldData[indexClass].documentFieldId, isInput: this.allFieldData[indexClass].documentFieldId.isInput }) | 
		
	
		
			
				|  |  |           } |  |  |           } | 
		
	
		
			
				|  |  |           if (indexRetention !== -1 && this.scopeSelection[0].retention !== '') { |  |  |           if (indexRetention !== -1 && this.scopeSelection[0].retention !== '') { | 
		
	
		
			
				|  |  |             this.selectStatus.splice(indexRetention, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].retention, field: this.allFieldData[indexRetention].documentFieldId, isInput: this.allFieldData[indexRetention].documentFieldId.isInput }) |  |  |             this.selectStatus.splice(indexRetention, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].retention, field: this.allFieldData[indexRetention].documentFieldId, isInput: this.allFieldData[indexRetention].documentFieldId.isInput }) | 
		
	
		
			
				|  |  |           } |  |  |           } | 
		
	
		
			
				|  |  |  |  |  |           console.log('his.selectStatus555555', this.selectStatus) | 
		
	
		
			
				|  |  |         } |  |  |         } | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  |         this.fieldLoading = false |  |  |         this.fieldLoading = false | 
		
	
	
		
			
				|  | @ -345,6 +376,7 @@ export default { | 
		
	
		
			
				|  |  |     // 归档范围选择 |  |  |     // 归档范围选择 | 
		
	
		
			
				|  |  |     selectScope() { |  |  |     selectScope() { | 
		
	
		
			
				|  |  |       this.$refs.scopeModule.scopeVisible = true |  |  |       this.$refs.scopeModule.scopeVisible = true | 
		
	
		
			
				|  |  |  |  |  |       this.$refs.scopeModule.opened(this.selectedDocument) | 
		
	
		
			
				|  |  |       this.$nextTick(() => { |  |  |       this.$nextTick(() => { | 
		
	
		
			
				|  |  |         if (this.form.categoryId) { |  |  |         if (this.form.categoryId) { | 
		
	
		
			
				|  |  |           this.$refs.scopeModule.$refs.tree2.setCurrentKey(this.form.categoryId) |  |  |           this.$refs.scopeModule.$refs.tree2.setCurrentKey(this.form.categoryId) | 
		
	
	
		
			
				|  | @ -477,10 +509,12 @@ export default { | 
		
	
		
			
				|  |  |       } |  |  |       } | 
		
	
		
			
				|  |  |       const indices = getIndicesByMode(false) |  |  |       const indices = getIndicesByMode(false) | 
		
	
		
			
				|  |  |       console.log(indices) |  |  |       console.log(indices) | 
		
	
		
			
				|  |  |  |  |  |       console.log('allCorrField', this.allCorrField) | 
		
	
		
			
				|  |  |       const filteredFields = indices.map(index => this.selectStatus[index]) |  |  |       const filteredFields = indices.map(index => this.selectStatus[index]) | 
		
	
		
			
				|  |  |       const categoryCorrField = indices.map(index => this.allCorrField[index]) |  |  |       const categoryCorrField = indices.map(index => this.allCorrField[index]) | 
		
	
		
			
				|  |  |       console.log('filteredFields', filteredFields) |  |  |       console.log('filteredFields', filteredFields) | 
		
	
		
			
				|  |  |       console.log('categoryCorrField', categoryCorrField) |  |  |       console.log('categoryCorrField', categoryCorrField) | 
		
	
		
			
				|  |  |  |  |  |       console.log('this.allFieldData', this.allFieldData) | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  |       let dtos |  |  |       let dtos | 
		
	
		
			
				|  |  |       if (!this.isCorrField) { |  |  |       if (!this.isCorrField) { | 
		
	
	
		
			
				|  | @ -512,9 +546,15 @@ export default { | 
		
	
		
			
				|  |  |         }) |  |  |         }) | 
		
	
		
			
				|  |  |       } else { |  |  |       } else { | 
		
	
		
			
				|  |  |         dtos = this.allFieldData.map((item, index) => { |  |  |         dtos = this.allFieldData.map((item, index) => { | 
		
	
		
			
				|  |  |  |  |  |           if (this.selectStatus[index].fiedType === 2) { | 
		
	
		
			
				|  |  |  |  |  |             console.log('this.selectStatus[index].field.fieldName', this.selectStatus[index]) | 
		
	
		
			
				|  |  |  |  |  |             console.log('this.selectStatus[index].field.fieldName', this.selectStatus[index].field.fieldName) | 
		
	
		
			
				|  |  |  |  |  |           } | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  |           return { |  |  |           return { | 
		
	
		
			
				|  |  |             'categoryValue': item.categoryFieldId.fieldName, |  |  |             'categoryValue': item.categoryFieldId.fieldName, | 
		
	
		
			
				|  |  |             'documentValue': this.selectStatus[index].fiedType === 2 ? item.categoryFieldId.isDefaultValue : this.selectStatus[index].field.fieldName, |  |  |  | 
		
	
		
			
				|  |  |  |  |  |             // 'documentValue': this.selectStatus[index].fiedType === 2 ? item.categoryFieldId.isDefaultValue : this.selectStatus[index].field.fieldName, | 
		
	
		
			
				|  |  |  |  |  |             'documentValue': this.selectStatus[index].fiedType === 2 && this.selectStatus[index].value !== '' ? this.selectStatus[index].value : item.categoryFieldId.isDefaultValue, | 
		
	
		
			
				|  |  |             'getType': this.selectStatus[index].fiedType, |  |  |             'getType': this.selectStatus[index].fiedType, | 
		
	
		
			
				|  |  |             'isRequired': item.categoryFieldId.isRequired |  |  |             'isRequired': item.categoryFieldId.isRequired | 
		
	
		
			
				|  |  |           } |  |  |           } | 
		
	
	
		
			
				|  | @ -524,7 +564,8 @@ export default { | 
		
	
		
			
				|  |  |         return item.id |  |  |         return item.id | 
		
	
		
			
				|  |  |       }) |  |  |       }) | 
		
	
		
			
				|  |  |       const params = { |  |  |       const params = { | 
		
	
		
			
				|  |  |         'fondsAffiliation': this.user.fonds.id.toString(), |  |  |  | 
		
	
		
			
				|  |  |  |  |  |         'archival_category_code': this.batchCategory.code, | 
		
	
		
			
				|  |  |  |  |  |         'fondsAffiliation': this.selectedDocument.fondsId, | 
		
	
		
			
				|  |  |         'archivesIds': archivesIds, |  |  |         'archivesIds': archivesIds, | 
		
	
		
			
				|  |  |         'documentId': this.selectedDocument.id, |  |  |         'documentId': this.selectedDocument.id, | 
		
	
		
			
				|  |  |         'categoryId': this.form.categoryId, |  |  |         'categoryId': this.form.categoryId, | 
		
	
	
		
			
				|  | 
 |