Commit fff35e9c authored by forevertyler's avatar forevertyler

fix:行政区划修改

parent 2ca1f140
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="head-container"> <div class="head-container">
<div v-if="crud.props.searchToggle"> <div v-if="crud.props.searchToggle">
<!-- 搜索 --> <!-- 搜索 -->
<el-input v-model="query.name" clearable size="small" placeholder="输入部门名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" /> <el-input v-model="query.name" clearable size="small" placeholder="输入行政区划名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<date-range-picker v-model="query.createTime" class="date-item" /> <date-range-picker v-model="query.createTime" class="date-item" />
<el-select v-model="query.enabled" clearable size="small" placeholder="状态" class="filter-item" style="width: 90px" @change="crud.toQuery"> <el-select v-model="query.enabled" clearable size="small" placeholder="状态" class="filter-item" style="width: 90px" @change="crud.toQuery">
<el-option v-for="item in enabledTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" /> <el-option v-for="item in enabledTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
<crudOperation :permission="permission" /> <crudOperation :permission="permission" />
</div> </div>
<!--表单组件--> <!--表单组件-->
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> <el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="600px">
<el-form ref="form" inline :model="form" :rules="rules" size="small" label-width="80px"> <el-form ref="form" inline :model="form" :rules="rules" size="small" label-width="120px">
<el-form-item label="部门名称" prop="name"> <el-form-item label="行政区划名称" prop="name">
<el-input v-model="form.name" style="width: 370px;" /> <el-input v-model="form.name" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="部门排序" prop="deptSort"> <el-form-item label="行政区划排序" prop="deptSort">
<el-input-number <el-input-number
v-model.number="form.deptSort" v-model.number="form.deptSort"
:min="0" :min="0"
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
style="width: 370px;" style="width: 370px;"
/> />
</el-form-item> </el-form-item>
<el-form-item label="顶级部门"> <el-form-item label="顶级行政区划">
<el-radio-group v-model="form.isTop" style="width: 140px"> <el-radio-group v-model="form.isTop" style="width: 140px">
<el-radio label="1"></el-radio> <el-radio label="1"></el-radio>
<el-radio label="0"></el-radio> <el-radio label="0"></el-radio>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<el-form-item label="状态" prop="enabled"> <el-form-item label="状态" prop="enabled">
<el-radio v-for="item in dict.dept_status" :key="item.id" v-model="form.enabled" :label="item.value">{{ item.label }}</el-radio> <el-radio v-for="item in dict.dept_status" :key="item.id" v-model="form.enabled" :label="item.value">{{ item.label }}</el-radio>
</el-form-item> </el-form-item>
<el-form-item v-if="form.isTop === '0'" style="margin-bottom: 0;" label="上级部门" prop="pid"> <el-form-item v-if="form.isTop === '0'" style="margin-bottom: 0;" label="上级行政区划" prop="pid">
<treeselect <treeselect
v-model="form.pid" v-model="form.pid"
:load-options="loadDepts" :load-options="loadDepts"
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
name: 'Dept', name: 'Dept',
components: { Treeselect, crudOperation, rrOperation, udOperation, DateRangePicker }, components: { Treeselect, crudOperation, rrOperation, udOperation, DateRangePicker },
cruds() { cruds() {
return CRUD({ title: '部门', url: 'api/dept', crudMethod: { ...crudDept }}) return CRUD({ title: '行政区划', url: 'api/dept', crudMethod: { ...crudDept }})
}, },
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
// 设置数据字典 // 设置数据字典
...@@ -188,7 +188,7 @@ export default { ...@@ -188,7 +188,7 @@ export default {
}) })
}) })
}, },
// 获取弹窗内部门数据 // 获取弹窗内行政区划数据
loadDepts({ action, parentNode, callback }) { loadDepts({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) { if (action === LOAD_CHILDREN_OPTIONS) {
crudDept.getDepts({ enabled: true, pid: parentNode.id }).then(res => { crudDept.getDepts({ enabled: true, pid: parentNode.id }).then(res => {
...@@ -208,7 +208,7 @@ export default { ...@@ -208,7 +208,7 @@ export default {
[CRUD.HOOK.afterValidateCU]() { [CRUD.HOOK.afterValidateCU]() {
if (this.form.pid !== null && this.form.pid === this.form.id) { if (this.form.pid !== null && this.form.pid === this.form.id) {
this.$message({ this.$message({
message: '上级部门不能为空', message: '上级行政区划不能为空',
type: 'warning' type: 'warning'
}) })
return false return false
...@@ -220,7 +220,7 @@ export default { ...@@ -220,7 +220,7 @@ export default {
}, },
// 改变状态 // 改变状态
changeEnabled(data, val) { changeEnabled(data, val) {
this.$confirm('此操作将 "' + this.dict.label.dept_status[val] + '" ' + data.name + '部门, 是否继续?', '提示', { this.$confirm('此操作将 "' + this.dict.label.dept_status[val] + '" ' + data.name + '行政区划, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment