|
|
@@ -4,8 +4,9 @@
|
|
|
class="form-renderer-dialog"
|
|
|
style="box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);background-color: #FFFFFF; margin-left: 20px;margin-right: 20px;"
|
|
|
>
|
|
|
- <el-divider v-if="JSON.stringify(formData.responses)=='{}'" content-position="left">添加记录</el-divider>
|
|
|
- <el-divider v-else content-position="left">编辑记录</el-divider>
|
|
|
+ <el-divider v-if="editFromType == 'add'" content-position="left">添加记录</el-divider>
|
|
|
+ <el-divider v-else-if="editFromType == 'edit'" content-position="left">编辑记录</el-divider>
|
|
|
+ <el-divider v-else-if="editFromType == 'consult'" content-position="left">查阅记录</el-divider>
|
|
|
<ibps-formrender
|
|
|
v-if="formDef"
|
|
|
ref="formrender"
|
|
|
@@ -33,8 +34,9 @@
|
|
|
<span class="ibps-pr-10"> </span>
|
|
|
</template>
|
|
|
|
|
|
+ <!-- 查阅按钮用toolbarsConsult-->
|
|
|
<ibps-toolbar
|
|
|
- :actions="toolbars"
|
|
|
+ :actions="editFromType != 'consult' ? toolbars : toolbarsConsult"
|
|
|
@action-event="handleActionEvent"
|
|
|
/>
|
|
|
</div>
|
|
|
@@ -58,6 +60,10 @@ export default {
|
|
|
},
|
|
|
mode: { // 表单模式
|
|
|
type: String
|
|
|
+ },
|
|
|
+ editFromType: {
|
|
|
+ type: String,
|
|
|
+ default: 'add'
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
@@ -69,6 +75,10 @@ export default {
|
|
|
{ key: 'confirm', label: '确定' },
|
|
|
{ key: 'cancel' }
|
|
|
],
|
|
|
+ // 查阅按钮
|
|
|
+ toolbarsConsult: [
|
|
|
+ { key: 'cancel' }
|
|
|
+ ],
|
|
|
stepButtons: [],
|
|
|
curActiveStep: 0,
|
|
|
stepNum: 3,
|
|
|
@@ -107,6 +117,8 @@ export default {
|
|
|
return this.$message.warning(errorMsg)
|
|
|
}
|
|
|
this.$emit('action-event', key, this.getFormData())
|
|
|
+ // 表单提交校验成功
|
|
|
+ this.closeDialog()
|
|
|
})
|
|
|
} else {
|
|
|
this.formErrorToast()
|