|
@ -31,7 +31,7 @@ |
|
|
:rows="item.isInputClass === 'textarea' ? 3 : ''" |
|
|
:rows="item.isInputClass === 'textarea' ? 3 : ''" |
|
|
:class="{'input-popover':(item.isInputClass === 'popover')}" |
|
|
:class="{'input-popover':(item.isInputClass === 'popover')}" |
|
|
:style="{ width: item.editLength+'px'}" |
|
|
:style="{ width: item.editLength+'px'}" |
|
|
:disabled="isDisabled" |
|
|
|
|
|
|
|
|
:disabled="isDisabled || (item.fieldName === 'archival_category_code')" |
|
|
:validate-event="!isDisabled" |
|
|
:validate-event="!isDisabled" |
|
|
@keyup.enter.native="isRepeatHandle(item)" |
|
|
@keyup.enter.native="isRepeatHandle(item)" |
|
|
@input="autoAddZero(item.isFilling, item.fieldName, addOrUpdateForm[item.fieldName], item.fillingDigit)" |
|
|
@input="autoAddZero(item.isFilling, item.fieldName, addOrUpdateForm[item.fieldName], item.fillingDigit)" |
|
@ -257,7 +257,7 @@ export default { |
|
|
delete node.childArchivesClass |
|
|
delete node.childArchivesClass |
|
|
} |
|
|
} |
|
|
return { |
|
|
return { |
|
|
id: node.id, |
|
|
|
|
|
|
|
|
id: node.name, |
|
|
label: node.name, |
|
|
label: node.name, |
|
|
children: node.childArchivesClass |
|
|
children: node.childArchivesClass |
|
|
} |
|
|
} |
|
@ -267,23 +267,11 @@ export default { |
|
|
delete node.childMenus |
|
|
delete node.childMenus |
|
|
} |
|
|
} |
|
|
return { |
|
|
return { |
|
|
id: node.id, |
|
|
|
|
|
|
|
|
id: node.fondsName, |
|
|
label: node.fondsName, |
|
|
label: node.fondsName, |
|
|
children: node.childMenus |
|
|
children: node.childMenus |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 递归查询字典名称对应的字典代码 |
|
|
|
|
|
// getNode(tree, dicName) { |
|
|
|
|
|
// for (let i = 0; i < tree.length; i++) { |
|
|
|
|
|
// if (tree[i].dicName === dicName) { |
|
|
|
|
|
// return tree[i] |
|
|
|
|
|
// } else { |
|
|
|
|
|
// if (tree[i].childMenus) { |
|
|
|
|
|
// return this.getNode(tree[i].childMenus, dicName) |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// }, |
|
|
|
|
|
// 处理vue-treeSelect回显出现unknown问题 |
|
|
// 处理vue-treeSelect回显出现unknown问题 |
|
|
getAutoNameUnknown(name) { |
|
|
getAutoNameUnknown(name) { |
|
|
if (name.lastIndexOf('unknown') > -1) { |
|
|
if (name.lastIndexOf('unknown') > -1) { |
|
@ -307,6 +295,34 @@ export default { |
|
|
}) |
|
|
}) |
|
|
return data |
|
|
return data |
|
|
}, |
|
|
}, |
|
|
|
|
|
getFondsNode(list, fondsName) { |
|
|
|
|
|
let data; |
|
|
|
|
|
(list || []).map(item => { |
|
|
|
|
|
if (item.fondsName === fondsName) { |
|
|
|
|
|
data = [item] |
|
|
|
|
|
} else { |
|
|
|
|
|
const child = this.getFondsNode(item.childMenus, fondsName) |
|
|
|
|
|
if (child) { |
|
|
|
|
|
data = child |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
return data |
|
|
|
|
|
}, |
|
|
|
|
|
getClassfiyNode(list, name) { |
|
|
|
|
|
let data; |
|
|
|
|
|
(list || []).map(item => { |
|
|
|
|
|
if (item.name === name) { |
|
|
|
|
|
data = [item] |
|
|
|
|
|
} else { |
|
|
|
|
|
const child = this.getClassfiyNode(item.childArchivesClass, name) |
|
|
|
|
|
if (child) { |
|
|
|
|
|
data = child |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
return data |
|
|
|
|
|
}, |
|
|
// 自动生成 |
|
|
// 自动生成 |
|
|
handleAuto() { |
|
|
handleAuto() { |
|
|
let string = '' |
|
|
let string = '' |
|
@ -317,33 +333,58 @@ export default { |
|
|
} else { |
|
|
} else { |
|
|
const fieldInfo = this.formPreviewData.find(element => element.fieldName === val.fieldName) |
|
|
const fieldInfo = this.formPreviewData.find(element => element.fieldName === val.fieldName) |
|
|
if (fieldInfo.isInputClass === 'select' || fieldInfo.isInputClass === 'popover') { |
|
|
if (fieldInfo.isInputClass === 'select' || fieldInfo.isInputClass === 'popover') { |
|
|
const params = { |
|
|
|
|
|
'pid': fieldInfo.dictionaryId.id |
|
|
|
|
|
} |
|
|
|
|
|
await FetchSonDictionaryList(params).then(res => { |
|
|
|
|
|
|
|
|
if (fieldInfo.mateData === 3) { |
|
|
|
|
|
await FetchSonDictionaryList({ 'pid': fieldInfo.dictionaryId.id }).then(res => { |
|
|
const option = this.getNode(res, this.addOrUpdateForm[val.fieldName]) |
|
|
const option = this.getNode(res, this.addOrUpdateForm[val.fieldName]) |
|
|
if (option) { |
|
|
if (option) { |
|
|
const obj = {} |
|
|
const obj = {} |
|
|
obj.name = val.fieldName |
|
|
obj.name = val.fieldName |
|
|
obj.val = option[0].dictionaryCode + val.connector |
|
|
obj.val = option[0].dictionaryCode + val.connector |
|
|
obj.sequence = val.sequence |
|
|
obj.sequence = val.sequence |
|
|
// string += '' + option[0].dicCode + val.connector |
|
|
|
|
|
getAutoFiledVal.push(obj) |
|
|
getAutoFiledVal.push(obj) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
if (fieldInfo.mateData === 1) { |
|
|
|
|
|
await FetchFondsAll().then(res => { |
|
|
|
|
|
const option = this.getFondsNode(res, this.addOrUpdateForm[val.fieldName]) |
|
|
|
|
|
if (option) { |
|
|
|
|
|
const obj = {} |
|
|
|
|
|
obj.name = val.fieldName |
|
|
|
|
|
obj.val = option[0].fondsNo + val.connector |
|
|
|
|
|
obj.sequence = val.sequence |
|
|
|
|
|
getAutoFiledVal.push(obj) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
if (fieldInfo.mateData === 2) { |
|
|
|
|
|
let categoryId |
|
|
|
|
|
if (this.isDesFormType !== 'mergeFile' && this.isDesFormType !== 'arcives') { |
|
|
|
|
|
categoryId = this.selectedCategory.pid |
|
|
|
|
|
} else { |
|
|
|
|
|
categoryId = this.selectedCategory.id |
|
|
|
|
|
} |
|
|
|
|
|
await FetchArchivesClassTree({ 'categoryId': categoryId }).then(res => { |
|
|
|
|
|
const option = this.getClassfiyNode(res, this.addOrUpdateForm[val.fieldName]) |
|
|
|
|
|
if (option) { |
|
|
|
|
|
const obj = {} |
|
|
|
|
|
obj.name = val.name |
|
|
|
|
|
obj.val = option[0].code + val.connector |
|
|
|
|
|
obj.sequence = val.sequence |
|
|
|
|
|
getAutoFiledVal.push(obj) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
const obj = {} |
|
|
const obj = {} |
|
|
obj.name = val.fieldName |
|
|
obj.name = val.fieldName |
|
|
obj.val = this.addOrUpdateForm[val.fieldName] + val.connector |
|
|
obj.val = this.addOrUpdateForm[val.fieldName] + val.connector |
|
|
obj.sequence = val.sequence |
|
|
obj.sequence = val.sequence |
|
|
// string += '' + this.addOrUpdateForm[val.fieldName] + val.connector |
|
|
|
|
|
getAutoFiledVal.push(obj) |
|
|
getAutoFiledVal.push(obj) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// 按照指定顺序排再拼接 |
|
|
|
|
|
getAutoFiledVal.sort(this.compare('sequence')) |
|
|
getAutoFiledVal.sort(this.compare('sequence')) |
|
|
string = getAutoFiledVal.map((item) => item.val).join('') |
|
|
string = getAutoFiledVal.map((item) => item.val).join('') |
|
|
|
|
|
|
|
|
this.formPreviewData.map(item => { |
|
|
this.formPreviewData.map(item => { |
|
|
if (item.isAutomatic) { |
|
|
if (item.isAutomatic) { |
|
|
this.$set(this.addOrUpdateForm, item.fieldName, string) |
|
|
this.$set(this.addOrUpdateForm, item.fieldName, string) |
|
@ -363,7 +404,7 @@ export default { |
|
|
FetchNoFormatField(categoryId) { |
|
|
FetchNoFormatField(categoryId) { |
|
|
getNoFormatField({ categoryId: categoryId }).then(res => { |
|
|
getNoFormatField({ categoryId: categoryId }).then(res => { |
|
|
this.autoMatic = res |
|
|
this.autoMatic = res |
|
|
// this.handleAuto() |
|
|
|
|
|
|
|
|
this.handleAuto() |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 获取对应字典子集数据 |
|
|
// 获取对应字典子集数据 |
|
@ -495,6 +536,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) |
|
|
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() |
|
@ -510,7 +552,13 @@ export default { |
|
|
}, |
|
|
}, |
|
|
// tree - select |
|
|
// tree - select |
|
|
selectTree(val) { |
|
|
selectTree(val) { |
|
|
|
|
|
if (val.fondsNo) { |
|
|
|
|
|
this.addOrUpdateForm[this.treeCurrentFiled.fieldName] = val.fondsName |
|
|
|
|
|
} else if (val.code) { |
|
|
|
|
|
this.addOrUpdateForm[this.treeCurrentFiled.fieldName] = val.name |
|
|
|
|
|
} 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('this.treeCurrentFiled.fieldName', this.treeCurrentFiled.fieldName) |
|
|
console.log('val', val) |
|
|
console.log('val', val) |
|
|
console.log('val.dictionaryName', val.dictionaryName) |
|
|
console.log('val.dictionaryName', val.dictionaryName) |
|
@ -537,6 +585,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) |
|
|
if (index !== -1) { |
|
|
if (index !== -1) { |
|
|
this.handleAuto() |
|
|
this.handleAuto() |
|
|
} |
|
|
} |
|
@ -563,9 +612,6 @@ export default { |
|
|
this.popoverVisible = false |
|
|
this.popoverVisible = false |
|
|
this.popoverClassifyVisible = false |
|
|
this.popoverClassifyVisible = false |
|
|
this.popoverFondsVisible = false |
|
|
this.popoverFondsVisible = false |
|
|
// this.popoverTableData = [] |
|
|
|
|
|
// this.popoverTableDataClassify = [] |
|
|
|
|
|
// this.popoverTableDataFonds = [] |
|
|
|
|
|
|
|
|
|
|
|
if (this.isDesFormType !== 'prearchiveLibrary' && this.isDesFormType !== 'mergeFile') { |
|
|
if (this.isDesFormType !== 'prearchiveLibrary' && this.isDesFormType !== 'mergeFile') { |
|
|
const index = this.autoMatic.findIndex(i => this.currentFieldName === i.fieldName) |
|
|
const index = this.autoMatic.findIndex(i => this.currentFieldName === i.fieldName) |
|
@ -585,10 +631,31 @@ export default { |
|
|
this.addOrUpdateForm[fieldName] = value.toString().padStart(fillingDigit, '0').slice(-1 * fillingDigit) |
|
|
this.addOrUpdateForm[fieldName] = value.toString().padStart(fillingDigit, '0').slice(-1 * fillingDigit) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 寻找pid档案门类代码 |
|
|
|
|
|
findNodeById(node, targetId) { |
|
|
|
|
|
if (node.id === targetId) { |
|
|
|
|
|
return node |
|
|
|
|
|
} |
|
|
|
|
|
if (node.children && node.children.length > 0) { |
|
|
|
|
|
for (const child of node.children) { |
|
|
|
|
|
const result = this.findNodeById(child, targetId) |
|
|
|
|
|
if (result) { |
|
|
|
|
|
return result |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return null |
|
|
|
|
|
}, |
|
|
// 动态生成表单 |
|
|
// 动态生成表单 |
|
|
editFormRow() { |
|
|
editFormRow() { |
|
|
this.rules = {} |
|
|
this.rules = {} |
|
|
console.log(this.formPreviewData) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (this.isDesFormType !== 'mergeFile' && this.isDesFormType !== 'arcives') { |
|
|
|
|
|
// targetId = this.selectedCategory.pid |
|
|
|
|
|
// } else { |
|
|
|
|
|
// targetId = this.selectedCategory.id |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
this.formPreviewData.map(item => { |
|
|
this.formPreviewData.map(item => { |
|
|
if (item.isInputClass === 'select') { |
|
|
if (item.isInputClass === 'select') { |
|
|
this.$set(item, 'options', []) |
|
|
this.$set(item, 'options', []) |
|
@ -602,6 +669,21 @@ export default { |
|
|
this.$set(this.addOrUpdateForm, item.fieldName, null) // 防止unkonwn |
|
|
this.$set(this.addOrUpdateForm, item.fieldName, null) // 防止unkonwn |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if (item.fieldName === 'archival_category_code') { |
|
|
|
|
|
let targetNode |
|
|
|
|
|
if (this.isDesFormType !== 'mergeFile' && this.isDesFormType !== 'arcives') { |
|
|
|
|
|
const targetId = this.selectedCategory.pid |
|
|
|
|
|
targetNode = this.findNodeById(this.crud.data[0], targetId) |
|
|
|
|
|
} else { |
|
|
|
|
|
targetNode = this.selectedCategory |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (targetNode) { |
|
|
|
|
|
this.$set(this.addOrUpdateForm, item.fieldName, targetNode.code) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$set(this.addOrUpdateForm, item.fieldName, '') |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
this.$set(this.rules, item.fieldName, [ |
|
|
this.$set(this.rules, item.fieldName, [ |
|
|
{ |
|
|
{ |
|
|
required: !!item.isRequired, |
|
|
required: !!item.isRequired, |
|
@ -870,6 +952,10 @@ export default { |
|
|
::v-deep .el-form-item--small .el-form-item__content { |
|
|
::v-deep .el-form-item--small .el-form-item__content { |
|
|
line-height: 30px; |
|
|
line-height: 30px; |
|
|
} |
|
|
} |
|
|
|
|
|
::v-deep .el-input.is-disabled .el-input__inner{ |
|
|
|
|
|
background-color: #f5f7fa; |
|
|
|
|
|
color: #c0c4cc; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
.preview-form-bottom{ |
|
|
.preview-form-bottom{ |
|
|
padding: 20px 20px 0 20px; |
|
|
padding: 20px 20px 0 20px; |
|
|