|
|
@ -282,7 +282,7 @@ |
|
|
|
import CRUD, { crud } from '@crud/crud' |
|
|
|
import { collectionLibraryCrud } from '../mixins/index' |
|
|
|
import { FetchInitCategoryInputFieldByPid, FetchCategoryMenu } from '@/api/system/category/category' |
|
|
|
import { FetchDetailsById, collectDel, FetchRemoveArchivesSingle, FetchDeleteArchivesFile, FetchUpdateArchivesNo, FetchDisbandArchives, FetchReturnReDocument, FetchCompleteDelArchives, FetchRestoreArchives } from '@/api/collect/collect' |
|
|
|
import { FetchDetailsById, collectDel, FetchRemoveArchivesSingle, FetchDeleteArchivesFile, FetchUpdateArchivesNo, FetchDisbandArchives, FetchReturnReDocument, FetchCompleteDelArchives, FetchRestoreArchives, FetchMaxItemNoByParentId } from '@/api/collect/collect' |
|
|
|
import { FetchInitAssistEnter, FetchDoHandleEnterAnalysis } from '@/api/ai/ai' |
|
|
|
import { FetchArchivesClassTree } from '@/api/system/archivesClass' |
|
|
|
import Treeselect from '@riophae/vue-treeselect' |
|
|
@ -529,6 +529,7 @@ export default { |
|
|
|
if (this.parentsData.parentsProjectId && this.isTitleType === 3) { |
|
|
|
console.log('项目下的案卷') |
|
|
|
} else { |
|
|
|
console.log('111') |
|
|
|
if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) { |
|
|
|
this.$message({ message: '当前档案处于归档流程中,不可操作新增,请先确认!', offset: 8 }) |
|
|
|
return false |
|
|
@ -539,6 +540,7 @@ export default { |
|
|
|
this.quickPaper = true |
|
|
|
this.formTitle = '新增案卷' |
|
|
|
} else { |
|
|
|
console.log('222') |
|
|
|
this.formTitle = '新增' + this.collectTitle |
|
|
|
this.quickPaper = false |
|
|
|
} |
|
|
@ -603,7 +605,11 @@ export default { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.previewForm.archivesType = 'add' |
|
|
|
this.$refs.previewForm.activeIndex = this.activeIndex |
|
|
|
console.log('this.parentsData.parentsAnjuanRow ', this.parentsData.parentsAnjuanRow) |
|
|
|
console.log('this.collectTitle', this.collectTitle) |
|
|
|
const savePrevFromData = JSON.parse(localStorage.getItem('savePrevFromData')) |
|
|
|
console.log('savePrevFromData', savePrevFromData) |
|
|
|
|
|
|
|
if (savePrevFromData) { |
|
|
|
if ('record_no' in savePrevFromData && 'item_no' in savePrevFromData) { |
|
|
|
if (savePrevFromData.item_no && !isNaN(Number(savePrevFromData.item_no))) { |
|
|
@ -618,7 +624,6 @@ export default { |
|
|
|
savePrevFromData.item_no = (parseInt(savePrevFromData.item_no) + 1).toString() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 查找 item_no 或 record_no 字段并进行补零操作 |
|
|
|
const findAndPadField = (fieldName) => { |
|
|
|
const field = this.formPreviewData.find(item => item.fieldName === fieldName) |
|
|
@ -634,12 +639,54 @@ export default { |
|
|
|
findAndPadField('record_no') |
|
|
|
|
|
|
|
this.$refs.previewForm.addOrUpdateForm = savePrevFromData |
|
|
|
} else if (this.collectTitle === '卷内' && this.parentsData.parentsAnjuanRow) { |
|
|
|
// 全宗fonds_no、门类archival_category_code、档案分类archive_ctg_no、年度archive_year、保管期限retention、案卷号record_no、责任者signer |
|
|
|
const rowAjData = this.parentsData.parentsAnjuanRow |
|
|
|
const fields = ['fonds_no', 'archive_ctg_no', 'archive_year', 'retention', 'record_no', 'signer'] |
|
|
|
const result = { is_entity: 1, archival_category_code: this.selectedCategory.code } |
|
|
|
|
|
|
|
fields.forEach(field => { |
|
|
|
if (rowAjData.hasOwnProperty(field)) { |
|
|
|
result[field] = rowAjData[field] |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
const params = { |
|
|
|
'archivesId': this.parentsData.parentsAnjuanRow.id |
|
|
|
} |
|
|
|
FetchMaxItemNoByParentId(params).then((res) => { |
|
|
|
if (res) { |
|
|
|
const field = this.formPreviewData.find(item => item.fieldName === 'item_no') |
|
|
|
if (field && field.isFilling) { |
|
|
|
const fillingDigit = field.fillingDigit |
|
|
|
result.item_no = (parseInt(res) + 1).toString().padStart(fillingDigit, '0') |
|
|
|
} else { |
|
|
|
result.item_no = this.incrementString(res) |
|
|
|
} |
|
|
|
} else { |
|
|
|
result.item_no = '' |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
console.log('result', result) |
|
|
|
this.$refs.previewForm.addOrUpdateForm = result |
|
|
|
} |
|
|
|
|
|
|
|
this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
incrementString(str) { |
|
|
|
const num = parseInt(str, 10) |
|
|
|
const incrementedNum = num + 1 |
|
|
|
const numLength = str.length |
|
|
|
if (/^0+$/.test(str.replace(/\d/g, '0'))) { |
|
|
|
return incrementedNum.toString().padStart(numLength, '0') |
|
|
|
} |
|
|
|
return incrementedNum.toString() |
|
|
|
}, |
|
|
|
// form - submit |
|
|
|
handlerArchivesSubmit(type) { |
|
|
|
this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id, this.quickPaperArcId, type) |
|
|
|