diff --git a/src/components/customField/AddForm.vue b/src/components/customField/AddForm.vue index 43c2b354..fdd3bcee 100644 --- a/src/components/customField/AddForm.vue +++ b/src/components/customField/AddForm.vue @@ -35,7 +35,7 @@ v-model="formInline[item.dbFieldName]" :filedName="item.dbFieldName" @nameChange="userSelectNameChange" - :nameStr="formInline[item.dbFieldName + '_name']" + :nameStr="formInline[item.dbFieldName + '_dictText']" type="radio" :disabled="disabled || disabledFieldList.includes(item.dbFieldName)" /> @@ -104,6 +104,7 @@ - +
@@ -372,7 +373,8 @@ export default { this.loading = false return } - this.getDocumentInfoFunc({ id: item.id }).then((res) => { + // type标识是新增表单还是详情页 + this.getDocumentInfoFunc({ id: item.id, type: this.type }).then((res) => { if (res.success) { // 处理树结构多选回显 const formList = Object.values(this.dataList).reduce((acc, cur) => acc.concat(cur), []) @@ -390,6 +392,10 @@ export default { this.formInline[field.dbFieldName] = valueArr } }) + const dictField = formList.filter(tt => tt.fieldShowType === FieldType.OPTION_SINGLE.value) + dictField.forEach(field => { + this.formInline[field.dbFieldName] = this.formInline[field.dbFieldName] || null + }) this.loading = false } else { this.loading = false @@ -455,7 +461,6 @@ export default { rules[res.dbFieldName] = rule } }) - console.log(rules) this.rules = rules this.isFormInline = true this.confirmLoading = false @@ -508,7 +513,7 @@ export default { }, // 选择用户得到用户名 userSelectNameChange (value, fieldName) { - this.formInline[fieldName + '_name'] = value + this.formInline[fieldName + '_dictText'] = value }, submit () { this.$refs.ruleForm.validate(valid => { @@ -539,8 +544,6 @@ export default {