|
@ -11,6 +11,7 @@ |
|
|
v-model="addOrUpdateForm[item.fieldName]" |
|
|
v-model="addOrUpdateForm[item.fieldName]" |
|
|
:options="item.options" |
|
|
:options="item.options" |
|
|
:normalizer="normalizer" |
|
|
:normalizer="normalizer" |
|
|
|
|
|
:clearable="false" |
|
|
placeholder="" |
|
|
placeholder="" |
|
|
:style="{ width: item.editLength+'px'}" |
|
|
:style="{ width: item.editLength+'px'}" |
|
|
:disabled="isDisabled" |
|
|
:disabled="isDisabled" |
|
@ -134,15 +135,18 @@ export default { |
|
|
parentsId: function(newValue, oldValue) { |
|
|
parentsId: function(newValue, oldValue) { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
|
|
|
|
|
|
created() { |
|
|
this.editFormRow() |
|
|
this.editFormRow() |
|
|
|
|
|
}, |
|
|
|
|
|
mounted() { |
|
|
this.FetchNoFormatField() |
|
|
this.FetchNoFormatField() |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
getAuto() { |
|
|
|
|
|
|
|
|
// 自动生成 |
|
|
|
|
|
handleAuto() { |
|
|
let string = '' |
|
|
let string = '' |
|
|
this.autoMatic.forEach(val => { |
|
|
this.autoMatic.forEach(val => { |
|
|
if (this.addOrUpdateForm[val.fieldName] === '' || this.addOrUpdateForm[val.fieldName] === null) { |
|
|
|
|
|
|
|
|
if (!this.addOrUpdateForm[val.fieldName]) { |
|
|
string += '' |
|
|
string += '' |
|
|
} else { |
|
|
} else { |
|
|
string += '' + this.addOrUpdateForm[val.fieldName] + val.connector |
|
|
string += '' + this.addOrUpdateForm[val.fieldName] + val.connector |
|
@ -154,10 +158,11 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 获取档号组成项 |
|
|
FetchNoFormatField() { |
|
|
FetchNoFormatField() { |
|
|
getNoFormatField({ categoryId: this.selectedCategory.id }).then(res => { |
|
|
getNoFormatField({ categoryId: this.selectedCategory.id }).then(res => { |
|
|
this.autoMatic = res |
|
|
this.autoMatic = res |
|
|
this.getAuto() |
|
|
|
|
|
|
|
|
this.handleAuto() |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 获取对应字典子集数据 |
|
|
// 获取对应字典子集数据 |
|
@ -176,7 +181,7 @@ export default { |
|
|
handlerIsRepeat(params, item) { |
|
|
handlerIsRepeat(params, item) { |
|
|
FetchDoeditIsRepeat(params).then(res => { |
|
|
FetchDoeditIsRepeat(params).then(res => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
this.$message.error(item.fieldCnName + '字段不可重复,请重新输入或选择') |
|
|
|
|
|
|
|
|
this.$message.error(item.fieldCnName + '不可重复') |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
@ -193,7 +198,7 @@ export default { |
|
|
this.handlerIsRepeat(params, item) |
|
|
this.handlerIsRepeat(params, item) |
|
|
} |
|
|
} |
|
|
if (!item.isAutomatic) { |
|
|
if (!item.isAutomatic) { |
|
|
this.getAuto() |
|
|
|
|
|
|
|
|
this.handleAuto() |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// tree - open |
|
|
// tree - open |
|
@ -205,6 +210,7 @@ export default { |
|
|
// tree - select |
|
|
// tree - select |
|
|
selectTree(val) { |
|
|
selectTree(val) { |
|
|
this.addOrUpdateForm[this.treeCurrentFiled.fieldName] = val.dicName |
|
|
this.addOrUpdateForm[this.treeCurrentFiled.fieldName] = val.dicName |
|
|
|
|
|
this.treeName = val.dicName |
|
|
// 自动重复字段 - 是否重复 - treeSelect方式 |
|
|
// 自动重复字段 - 是否重复 - treeSelect方式 |
|
|
if (this.treeCurrentFiled.isRepeat) { |
|
|
if (this.treeCurrentFiled.isRepeat) { |
|
|
const params = { |
|
|
const params = { |
|
@ -215,8 +221,7 @@ export default { |
|
|
} |
|
|
} |
|
|
this.handlerIsRepeat(params, this.treeCurrentFiled) |
|
|
this.handlerIsRepeat(params, this.treeCurrentFiled) |
|
|
} |
|
|
} |
|
|
console.log(val) |
|
|
|
|
|
this.getAuto() |
|
|
|
|
|
|
|
|
this.handleAuto() |
|
|
}, |
|
|
}, |
|
|
// popover - table 单选 |
|
|
// popover - table 单选 |
|
|
clickRowHandler(row) { |
|
|
clickRowHandler(row) { |
|
@ -230,7 +235,7 @@ export default { |
|
|
} |
|
|
} |
|
|
this.$refs.popoverTable.clearSelection() |
|
|
this.$refs.popoverTable.clearSelection() |
|
|
this.popoverVisible = false |
|
|
this.popoverVisible = false |
|
|
this.getAuto() |
|
|
|
|
|
|
|
|
this.handleAuto() |
|
|
}, |
|
|
}, |
|
|
// popover - 当前选中得 |
|
|
// popover - 当前选中得 |
|
|
handleCurrentFieldName(item) { |
|
|
handleCurrentFieldName(item) { |
|
@ -242,13 +247,17 @@ export default { |
|
|
editFormRow() { |
|
|
editFormRow() { |
|
|
this.rules = {} |
|
|
this.rules = {} |
|
|
this.formPreviewData.map(item => { |
|
|
this.formPreviewData.map(item => { |
|
|
|
|
|
if (item.isInputClass === 'select') { |
|
|
|
|
|
this.$set(item, 'options', []) |
|
|
|
|
|
this.$set(this.addOrUpdateForm, item.fieldName, null) // 防止unkonwn |
|
|
|
|
|
} |
|
|
if (item.isDefaultValue !== '') { |
|
|
if (item.isDefaultValue !== '') { |
|
|
this.$set(this.addOrUpdateForm, item.fieldName, item.isDefaultValue) |
|
|
this.$set(this.addOrUpdateForm, item.fieldName, item.isDefaultValue) |
|
|
} else { |
|
|
} else { |
|
|
this.$set(this.addOrUpdateForm, item.fieldName, '') |
|
|
this.$set(this.addOrUpdateForm, item.fieldName, '') |
|
|
} |
|
|
|
|
|
if (item.isInputClass === 'select') { |
|
|
|
|
|
this.$set(this.addOrUpdateForm, item.fieldName, null) // 防止unkonwn |
|
|
|
|
|
|
|
|
if (item.isInputClass === 'select') { |
|
|
|
|
|
this.$set(this.addOrUpdateForm, item.fieldName, null) // 防止unkonwn |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
this.rules[item.fieldName] = [ |
|
|
this.rules[item.fieldName] = [ |
|
|
{ |
|
|
{ |
|
@ -306,14 +315,10 @@ export default { |
|
|
'parentsId': this.setParentsId, |
|
|
'parentsId': this.setParentsId, |
|
|
'jsonString': JSON.stringify(this.addOrUpdateForm) |
|
|
'jsonString': JSON.stringify(this.addOrUpdateForm) |
|
|
} |
|
|
} |
|
|
console.log(params) |
|
|
|
|
|
|
|
|
// console.log(this.addOrUpdateForm) |
|
|
edit(params).then(res => { |
|
|
edit(params).then(res => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
this.$notify({ |
|
|
|
|
|
title: res, |
|
|
|
|
|
type: 'success', |
|
|
|
|
|
duration: 2500 |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
this.$message.success(res) |
|
|
this.$emit('emitTableList') |
|
|
this.$emit('emitTableList') |
|
|
this.crud.refresh() |
|
|
this.crud.refresh() |
|
|
} |
|
|
} |
|
@ -335,8 +340,6 @@ export default { |
|
|
</script> |
|
|
</script> |
|
|
<style rel="stylesheet/scss" lang="scss" scoped> |
|
|
<style rel="stylesheet/scss" lang="scss" scoped> |
|
|
.preview-content { |
|
|
.preview-content { |
|
|
// width: 640px !important; |
|
|
|
|
|
// height: calc(100vh - 312px); |
|
|
|
|
|
padding: 20px 0 0 0 !important; |
|
|
padding: 20px 0 0 0 !important; |
|
|
margin-top: 0 !important; |
|
|
margin-top: 0 !important; |
|
|
border-radius: 4px; |
|
|
border-radius: 4px; |
|
|