|
@@ -47,7 +47,7 @@
|
|
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
<el-row>
|
|
|
- <!-- <el-col :span="24" v-if="form.pid !== 0">
|
|
|
+ <!-- <el-col :span="24">
|
|
|
<el-form-item label="分类菜单" prop="pid">
|
|
|
<treeselect v-model="form.pid" :options="deptOptions" :normalizer="normalizer" placeholder="选择分类菜单" />
|
|
|
</el-form-item>
|
|
@@ -57,6 +57,16 @@
|
|
|
<el-input v-model="form.typeName" placeholder="请输入分类名称" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="科目" prop="typeName">
|
|
|
+ <el-select v-model="form.subject" placeholder="请选择科目">
|
|
|
+ <el-option label="科目一" :value="1"> </el-option>
|
|
|
+ <el-option label="科目二" :value="2"> </el-option>
|
|
|
+ <el-option label="科目三" :value="3"> </el-option>
|
|
|
+ <el-option label="科目四" :value="4"> </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="显示排序" prop="typeSort">
|
|
|
<el-input-number v-model="form.typeSort" controls-position="right" :min="0" />
|
|
@@ -106,19 +116,19 @@ export default {
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
typeName: undefined,
|
|
|
- status: undefined
|
|
|
+ status: undefined,
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
|
|
|
- }
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.getList()
|
|
|
- this.getDicts('sys_normal_disable').then(response => {
|
|
|
+ this.getDicts('sys_normal_disable').then((response) => {
|
|
|
this.statusOptions = response.data
|
|
|
})
|
|
|
},
|
|
@@ -126,7 +136,7 @@ export default {
|
|
|
/** 查询部门列表 */
|
|
|
getList() {
|
|
|
this.loading = true
|
|
|
- listDept(this.queryParams).then(response => {
|
|
|
+ listDept(this.queryParams).then((response) => {
|
|
|
this.deptList = this.handleTree(response.data, 'id')
|
|
|
this.loading = false
|
|
|
})
|
|
@@ -139,7 +149,7 @@ export default {
|
|
|
return {
|
|
|
id: node.id,
|
|
|
label: node.typeName,
|
|
|
- children: node.children
|
|
|
+ children: node.children,
|
|
|
}
|
|
|
},
|
|
|
// 字典状态字典翻译
|
|
@@ -158,7 +168,7 @@ export default {
|
|
|
pid: undefined,
|
|
|
typeName: undefined,
|
|
|
typeSort: undefined,
|
|
|
- status: '0'
|
|
|
+ status: '0',
|
|
|
}
|
|
|
this.resetForm('form')
|
|
|
},
|
|
@@ -182,34 +192,34 @@ export default {
|
|
|
}
|
|
|
this.open = true
|
|
|
this.title = '添加分类'
|
|
|
- listDept().then(response => {
|
|
|
+ listDept().then((response) => {
|
|
|
this.deptOptions = this.handleTree(response.data, 'id', 'pid')
|
|
|
})
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
this.reset()
|
|
|
- getDept(row.id).then(response => {
|
|
|
+ getDept(row.id).then((response) => {
|
|
|
this.form = response.data
|
|
|
this.open = true
|
|
|
this.title = '修改分类'
|
|
|
})
|
|
|
- listDept().then(response => {
|
|
|
+ listDept().then((response) => {
|
|
|
this.deptOptions = this.handleTree(response.data, 'id', 'pid')
|
|
|
})
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
- submitForm: function() {
|
|
|
- this.$refs['form'].validate(valid => {
|
|
|
+ submitForm: function () {
|
|
|
+ this.$refs['form'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.form.id != undefined) {
|
|
|
- updateDept(this.form).then(response => {
|
|
|
+ updateDept(this.form).then((response) => {
|
|
|
this.msgSuccess('修改成功')
|
|
|
this.open = false
|
|
|
this.getList()
|
|
|
})
|
|
|
} else {
|
|
|
- addDept(this.form).then(response => {
|
|
|
+ addDept(this.form).then((response) => {
|
|
|
this.msgSuccess('新增成功')
|
|
|
this.open = false
|
|
|
this.getList()
|
|
@@ -223,16 +233,16 @@ export default {
|
|
|
this.$confirm('是否确认删除名称为"' + row.typeName + '"的数据项?', '警告', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
+ type: 'warning',
|
|
|
})
|
|
|
- .then(function() {
|
|
|
+ .then(function () {
|
|
|
return delDept(row.id)
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.getList()
|
|
|
this.msgSuccess('删除成功')
|
|
|
})
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
}
|
|
|
</script>
|