|
@ -132,6 +132,7 @@ export default { |
|
|
name: 'PreviewForm', |
|
|
name: 'PreviewForm', |
|
|
components: { draggable, Treeselect }, |
|
|
components: { draggable, Treeselect }, |
|
|
mixins: [crud()], |
|
|
mixins: [crud()], |
|
|
|
|
|
inject: ['parentsData'], |
|
|
props: { |
|
|
props: { |
|
|
isDisabled: { |
|
|
isDisabled: { |
|
|
type: Boolean, |
|
|
type: Boolean, |
|
@ -157,10 +158,6 @@ export default { |
|
|
type: String, |
|
|
type: String, |
|
|
default: '' |
|
|
default: '' |
|
|
}, |
|
|
}, |
|
|
parentsId: { |
|
|
|
|
|
type: String, |
|
|
|
|
|
default: '' |
|
|
|
|
|
}, |
|
|
|
|
|
isHasCode: { |
|
|
isHasCode: { |
|
|
type: Boolean, |
|
|
type: Boolean, |
|
|
required: true |
|
|
required: true |
|
@ -176,8 +173,13 @@ export default { |
|
|
collectLevel: { |
|
|
collectLevel: { |
|
|
type: Number, |
|
|
type: Number, |
|
|
default: 1 |
|
|
default: 1 |
|
|
|
|
|
}, |
|
|
|
|
|
isTitleType: { |
|
|
|
|
|
type: Number, |
|
|
|
|
|
default: 2 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
fileOriginal: null, |
|
|
fileOriginal: null, |
|
@ -196,7 +198,6 @@ export default { |
|
|
currentFieldName: null, // popover 当前fieldName |
|
|
currentFieldName: null, // popover 当前fieldName |
|
|
treeCurrentFiled: null, |
|
|
treeCurrentFiled: null, |
|
|
categoryId: null, |
|
|
categoryId: null, |
|
|
setParentsId: null, |
|
|
|
|
|
result: null, |
|
|
result: null, |
|
|
autoMatic: null, |
|
|
autoMatic: null, |
|
|
// isType: 'category', |
|
|
// isType: 'category', |
|
@ -211,7 +212,8 @@ export default { |
|
|
fileJsonString: null, |
|
|
fileJsonString: null, |
|
|
mergeFileArcIds: null, |
|
|
mergeFileArcIds: null, |
|
|
mergeFileCategory: null, |
|
|
mergeFileCategory: null, |
|
|
archivesType: null |
|
|
|
|
|
|
|
|
archivesType: null, |
|
|
|
|
|
setParentsId: null |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
@ -226,10 +228,16 @@ export default { |
|
|
}, |
|
|
}, |
|
|
arcId: function(newValue, oldValue) { |
|
|
arcId: function(newValue, oldValue) { |
|
|
}, |
|
|
}, |
|
|
parentsId: function(newValue, oldValue) { |
|
|
|
|
|
}, |
|
|
|
|
|
isDesFormType: function(newValue, oldValue) { |
|
|
isDesFormType: function(newValue, oldValue) { |
|
|
}, |
|
|
}, |
|
|
|
|
|
parentsId: { |
|
|
|
|
|
handler(newValue, oldValue) { |
|
|
|
|
|
console.log(newValue) |
|
|
|
|
|
this.setParentsId = newValue |
|
|
|
|
|
}, |
|
|
|
|
|
immediate: true, |
|
|
|
|
|
deep: true |
|
|
|
|
|
}, |
|
|
formPreviewData: function() { |
|
|
formPreviewData: function() { |
|
|
this.editFormRow() |
|
|
this.editFormRow() |
|
|
// 区分 门类著录项 和 档案管理 |
|
|
// 区分 门类著录项 和 档案管理 |
|
@ -245,6 +253,7 @@ export default { |
|
|
// if (this.isType !== 'arcives') { |
|
|
// if (this.isType !== 'arcives') { |
|
|
// this.FetchNoFormatField(this.selectedCategory.id) |
|
|
// this.FetchNoFormatField(this.selectedCategory.id) |
|
|
// } |
|
|
// } |
|
|
|
|
|
console.log('parentsId-in', this.parentsData.parentsId) |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
normalizer(node) { |
|
|
normalizer(node) { |
|
@ -330,7 +339,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
// 自动生成 |
|
|
// 自动生成 |
|
|
handleAuto() { |
|
|
handleAuto() { |
|
|
console.log('isTableType', this.isTableType) |
|
|
|
|
|
|
|
|
// console.log('isTableType', this.isTableType) |
|
|
let string = '' |
|
|
let string = '' |
|
|
const getAutoFiledVal = [] |
|
|
const getAutoFiledVal = [] |
|
|
this.autoMatic.forEach(async val => { |
|
|
this.autoMatic.forEach(async val => { |
|
@ -355,7 +364,7 @@ export default { |
|
|
await FetchFondsAll().then(res => { |
|
|
await FetchFondsAll().then(res => { |
|
|
const option = this.getFondsNode(res, this.addOrUpdateForm[val.fieldName]) |
|
|
const option = this.getFondsNode(res, this.addOrUpdateForm[val.fieldName]) |
|
|
if (option) { |
|
|
if (option) { |
|
|
console.log('option', option) |
|
|
|
|
|
|
|
|
// console.log('option', option) |
|
|
const obj = {} |
|
|
const obj = {} |
|
|
obj.name = val.fieldName |
|
|
obj.name = val.fieldName |
|
|
obj.val = option[0].fondsNo + val.connector |
|
|
obj.val = option[0].fondsNo + val.connector |
|
@ -416,7 +425,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
// 获取对应字典子集数据 |
|
|
// 获取对应字典子集数据 |
|
|
getAllSubset(item) { |
|
|
getAllSubset(item) { |
|
|
console.log('item', item) |
|
|
|
|
|
|
|
|
// console.log('item', item) |
|
|
if (item.mateData === 1) { |
|
|
if (item.mateData === 1) { |
|
|
this.getFondsDatas(item) |
|
|
this.getFondsDatas(item) |
|
|
} else if (item.mateData === 2) { |
|
|
} else if (item.mateData === 2) { |
|
@ -457,7 +466,7 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
getClassifyTree(item) { |
|
|
getClassifyTree(item) { |
|
|
console.log('666', this.selectedCategory) |
|
|
|
|
|
|
|
|
// console.log('666', this.selectedCategory) |
|
|
this.isTableType = 2 |
|
|
this.isTableType = 2 |
|
|
this.tableTitle = '分类列表' |
|
|
this.tableTitle = '分类列表' |
|
|
let categoryId |
|
|
let categoryId |
|
@ -543,7 +552,7 @@ export default { |
|
|
|
|
|
|
|
|
if (this.isDesFormType !== 'prearchiveLibrary' && this.isDesFormType !== 'mergeFile') { |
|
|
if (this.isDesFormType !== 'prearchiveLibrary' && this.isDesFormType !== 'mergeFile') { |
|
|
if (!item.isAutomatic) { |
|
|
if (!item.isAutomatic) { |
|
|
console.log('this.autoMatic', this.autoMatic) |
|
|
|
|
|
|
|
|
// console.log('this.autoMatic', this.autoMatic) |
|
|
const index = this.autoMatic.findIndex(i => item.fieldName === i.fieldName) |
|
|
const index = this.autoMatic.findIndex(i => item.fieldName === i.fieldName) |
|
|
if (index !== -1) { |
|
|
if (index !== -1) { |
|
|
this.handleAuto() |
|
|
this.handleAuto() |
|
@ -566,9 +575,9 @@ export default { |
|
|
} else { |
|
|
} else { |
|
|
this.addOrUpdateForm[this.treeCurrentFiled.fieldName] = val.dictionaryName |
|
|
this.addOrUpdateForm[this.treeCurrentFiled.fieldName] = val.dictionaryName |
|
|
} |
|
|
} |
|
|
console.log('this.treeCurrentFiled.fieldName', this.treeCurrentFiled.fieldName) |
|
|
|
|
|
console.log('val', val) |
|
|
|
|
|
console.log('val.dictionaryName', val.dictionaryName) |
|
|
|
|
|
|
|
|
// console.log('this.treeCurrentFiled.fieldName', this.treeCurrentFiled.fieldName) |
|
|
|
|
|
// console.log('val', val) |
|
|
|
|
|
// console.log('val.dictionaryName', val.dictionaryName) |
|
|
// this.treeName = val.dictionaryName |
|
|
// this.treeName = val.dictionaryName |
|
|
// 自动重复字段 - 是否重复 - treeSelect方式 |
|
|
// 自动重复字段 - 是否重复 - treeSelect方式 |
|
|
if (this.treeCurrentFiled.isRepeat) { |
|
|
if (this.treeCurrentFiled.isRepeat) { |
|
@ -592,7 +601,7 @@ export default { |
|
|
} |
|
|
} |
|
|
if (this.isDesFormType !== 'prearchiveLibrary' && this.isDesFormType !== 'mergeFile') { |
|
|
if (this.isDesFormType !== 'prearchiveLibrary' && this.isDesFormType !== 'mergeFile') { |
|
|
const index = this.autoMatic.findIndex(i => this.treeCurrentFiled.fieldName === i.fieldName) |
|
|
const index = this.autoMatic.findIndex(i => this.treeCurrentFiled.fieldName === i.fieldName) |
|
|
console.log('index', index) |
|
|
|
|
|
|
|
|
// console.log('index', index) |
|
|
if (index !== -1) { |
|
|
if (index !== -1) { |
|
|
this.handleAuto() |
|
|
this.handleAuto() |
|
|
} |
|
|
} |
|
@ -605,7 +614,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
// popover - table 选中得项 |
|
|
// popover - table 选中得项 |
|
|
handleSelectionChange(val) { |
|
|
handleSelectionChange(val) { |
|
|
console.log(val) |
|
|
|
|
|
|
|
|
// console.log(val) |
|
|
if (val.length > 0) { |
|
|
if (val.length > 0) { |
|
|
if (this.isTableType === 1) { |
|
|
if (this.isTableType === 1) { |
|
|
this.addOrUpdateForm[this.currentFieldName] = val[0].fondsNo |
|
|
this.addOrUpdateForm[this.currentFieldName] = val[0].fondsNo |
|
@ -719,7 +728,7 @@ export default { |
|
|
this.formPreviewData[newIndex] = index |
|
|
this.formPreviewData[newIndex] = index |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
submitForm(formName, categoryId) { |
|
|
|
|
|
|
|
|
submitForm(formName, categoryId, parentArc) { |
|
|
// 时间格式化 |
|
|
// 时间格式化 |
|
|
this.formPreviewData.map(item => { |
|
|
this.formPreviewData.map(item => { |
|
|
if (item.isInputClass === 'date') { |
|
|
if (item.isInputClass === 'date') { |
|
@ -728,16 +737,6 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if (this.selectedCategory.isType !== 4 || this.selectedCategory.isType !== 3) { |
|
|
|
|
|
this.setParentsId = this.parentsId |
|
|
|
|
|
} else { |
|
|
|
|
|
const parent_id = this.selectedCategory.pid |
|
|
|
|
|
if (parseInt(parent_id) === 0) { |
|
|
|
|
|
this.setParentsId = null |
|
|
|
|
|
} else { |
|
|
|
|
|
this.setParentsId = parent_id |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
delete this.addOrUpdateForm.id |
|
|
delete this.addOrUpdateForm.id |
|
|
this.$refs[formName].validate((valid) => { |
|
|
this.$refs[formName].validate((valid) => { |
|
|
if (valid) { |
|
|
if (valid) { |
|
@ -758,7 +757,7 @@ export default { |
|
|
'jsonString': JSON.stringify(this.addOrUpdateForm), |
|
|
'jsonString': JSON.stringify(this.addOrUpdateForm), |
|
|
'fileJsonString': this.fileJsonString |
|
|
'fileJsonString': this.fileJsonString |
|
|
} |
|
|
} |
|
|
console.log('params', params) |
|
|
|
|
|
|
|
|
// console.log('params', params) |
|
|
prearchEdit(params).then(res => { |
|
|
prearchEdit(params).then(res => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
this.$message.success(res) |
|
|
this.$message.success(res) |
|
@ -775,7 +774,7 @@ export default { |
|
|
'categoryId': this.mergeFileCategory, |
|
|
'categoryId': this.mergeFileCategory, |
|
|
'jsonString': JSON.stringify(this.addOrUpdateForm) |
|
|
'jsonString': JSON.stringify(this.addOrUpdateForm) |
|
|
} |
|
|
} |
|
|
console.log('params', params) |
|
|
|
|
|
|
|
|
// console.log('params', params) |
|
|
FetchMergeToFile(params).then(res => { |
|
|
FetchMergeToFile(params).then(res => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
this.$message.success(res) |
|
|
this.$message.success(res) |
|
@ -785,28 +784,50 @@ export default { |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
// 收集库 |
|
|
// 收集库 |
|
|
|
|
|
let parentsId = null |
|
|
|
|
|
console.log('this.isTitleType', this.isTitleType) |
|
|
|
|
|
// 2 项目 3 案卷 /文件 4 卷内 6 文件 |
|
|
|
|
|
if (this.isTitleType === 2) { |
|
|
|
|
|
parentsId = null |
|
|
|
|
|
} else if (this.isTitleType === 3) { |
|
|
|
|
|
if (this.selectedCategory.arrangeType === 1) { |
|
|
|
|
|
parentsId = null |
|
|
|
|
|
} else { |
|
|
|
|
|
parentsId = this.parentsData.parentsProjectId |
|
|
|
|
|
} |
|
|
|
|
|
} else if (this.isTitleType === 4) { |
|
|
|
|
|
// 卷内 |
|
|
|
|
|
parentsId = this.parentsData.parentsAnjuanId |
|
|
|
|
|
} else if (this.isTitleType === 6) { |
|
|
|
|
|
// 原文 |
|
|
|
|
|
parentsId = this.parentsData.parentsJuanneiId |
|
|
|
|
|
} |
|
|
|
|
|
console.log('hhhparentsId', parentsId) |
|
|
const params = { |
|
|
const params = { |
|
|
'archivesId': this.arcId, |
|
|
'archivesId': this.arcId, |
|
|
'categoryId': categoryId, |
|
|
'categoryId': categoryId, |
|
|
|
|
|
'parentsId': parentsId, |
|
|
'categoryLevel': this.collectLevel, |
|
|
'categoryLevel': this.collectLevel, |
|
|
'jsonString': JSON.stringify(this.addOrUpdateForm) |
|
|
'jsonString': JSON.stringify(this.addOrUpdateForm) |
|
|
} |
|
|
} |
|
|
|
|
|
console.log('submitparentsId', this.parentsData.parentsId) |
|
|
console.log(this.addOrUpdateForm) |
|
|
console.log(this.addOrUpdateForm) |
|
|
console.log(params) |
|
|
console.log(params) |
|
|
if (this.archivesType === 'add') { |
|
|
if (this.archivesType === 'add') { |
|
|
collectAdd(params).then(res => { |
|
|
collectAdd(params).then(res => { |
|
|
if (res.code === 200) { |
|
|
if (res.code === 200) { |
|
|
this.$message.success(res) |
|
|
this.$message.success(res) |
|
|
this.$emit('close-dialog') |
|
|
|
|
|
this.crud.refresh() |
|
|
|
|
|
|
|
|
this.$emit('close-dialog', parentsId) |
|
|
|
|
|
// this.crud.refresh() |
|
|
|
|
|
// this.getCommonData(this.isTitleType, parentsId) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
collectEdit(params).then(res => { |
|
|
collectEdit(params).then(res => { |
|
|
if (res.code === 200) { |
|
|
if (res.code === 200) { |
|
|
this.$message.success(res) |
|
|
this.$message.success(res) |
|
|
this.$emit('close-dialog') |
|
|
|
|
|
this.crud.refresh() |
|
|
|
|
|
|
|
|
this.$emit('close-dialog', parentsId) |
|
|
|
|
|
// this.crud.refresh() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
@ -869,10 +890,10 @@ export default { |
|
|
} |
|
|
} |
|
|
const arrayUpload = [] |
|
|
const arrayUpload = [] |
|
|
arrayUpload.push(json) |
|
|
arrayUpload.push(json) |
|
|
console.log(arrayUpload) |
|
|
|
|
|
|
|
|
// console.log(arrayUpload) |
|
|
this.fileOriginal = this.fileNames |
|
|
this.fileOriginal = this.fileNames |
|
|
this.fileJsonString = JSON.stringify(arrayUpload) |
|
|
this.fileJsonString = JSON.stringify(arrayUpload) |
|
|
console.log(this.fileJsonString) |
|
|
|
|
|
|
|
|
// console.log(this.fileJsonString) |
|
|
}, |
|
|
}, |
|
|
// 将上传的图片转为base64 |
|
|
// 将上传的图片转为base64 |
|
|
getBase64(file) { |
|
|
getBase64(file) { |
|
|