<template>
|
<div class="edit-department">
|
<el-dialog
|
:title="editDepartmentConfig.title"
|
:visible.sync="editConfig.visible"
|
:width="dialogWidth"
|
:before-close="handleClose"
|
>
|
<el-form ref="form" :model="editConfig.infomation" :rules="rules" label-width="100px" size="mini">
|
<!-- 信息 -->
|
<div class="basic-info">
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="部门名称" prop="departmentName">
|
<el-input v-model="editConfig.infomation.departmentName"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="部门编号" prop="departmentNumber">
|
<el-input v-model="editConfig.infomation.departmentNumber"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="24">
|
<el-form-item label="备注" prop="notes">
|
<el-input
|
type="textarea"
|
:autosize="{ minRows: 1, maxRows: 4 }"
|
placeholder="请输入内容"
|
v-model="editConfig.infomation.notes"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</div>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button type="primary" size="small" @click="editConfig.visible = false">保 存</el-button>
|
<el-button size="small" @click="editConfig.visible = false">取 消</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
name: "EditDepartmentDialog",
|
props: {
|
editDepartmentConfig: {
|
type: Object,
|
default: () => {
|
return {
|
visible: false,
|
title: "新建",
|
infomation: {
|
departmentName: "",
|
departmentNumber: "",
|
notes: ""
|
}
|
}
|
}
|
}
|
},
|
components: {},
|
computed: {},
|
data() {
|
return {
|
dialogWidth: "40%",
|
editConfig: this.editDepartmentConfig,
|
rules: {
|
departmentName: [{ required: true, message: "请输入", trigger: "blur" }],
|
departmentNumber: [{ required: true, message: "请输入", trigger: "blur" }]
|
}
|
}
|
},
|
created() {
|
this.isActive = true
|
},
|
methods: {
|
handleClose() {
|
this.editConfig.visible = false
|
}
|
}
|
}
|
</script>
|
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<style lang="scss" scoped>
|
.edit-department {
|
.basic-info {
|
padding: 20px;
|
}
|
.dialog-footer {
|
background-color: #f5f5f5;
|
height: 55px;
|
line-height: 55px;
|
}
|
}
|
::v-deep {
|
.el-dialog__wrapper {
|
margin-top: 20vh;
|
}
|
}
|
</style>
|