Commit 3f47c15b authored by zhang's avatar zhang

fix (权限管理/单位管理)---添加类型字段,类型为企业时隐藏操作,新增或修改时增设单位类型下拉框

parent 53a8a751
...@@ -214,6 +214,7 @@ import page from '@/mixins/page' ...@@ -214,6 +214,7 @@ import page from '@/mixins/page'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import vehicleModelDialog from './components/vehicleModelDialog' import vehicleModelDialog from './components/vehicleModelDialog'
import documentReviewDialog from './components/documentReviewDialog' import documentReviewDialog from './components/documentReviewDialog'
import pageChapterOption from '@/components/Page/chapterOption.vue'
import request from '../../../utils/request' import request from '../../../utils/request'
import { Change, Float, RowHeight } from '@icon-park/vue' import { Change, Float, RowHeight } from '@icon-park/vue'
import { forEach } from 'lodash' import { forEach } from 'lodash'
......
...@@ -81,11 +81,19 @@ ...@@ -81,11 +81,19 @@
> >
<el-table-column <el-table-column
prop="deptName" prop="deptName"
label="部门名称" label="单位名称"
show-overflow-tooltip show-overflow-tooltip
width="260" width="260"
align="left" align="left"
></el-table-column> ></el-table-column>
<el-table-column
prop="deptType"
label="类型"
show-overflow-tooltip
width="200"
align="left"
:formatter="formatteDeptType"
></el-table-column>
<el-table-column <el-table-column
prop="address" prop="address"
label="地址" label="地址"
...@@ -93,7 +101,6 @@ ...@@ -93,7 +101,6 @@
width="260" width="260"
align="left" align="left"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
prop="postcode" prop="postcode"
label="邮政编码" label="邮政编码"
...@@ -128,10 +135,12 @@ ...@@ -128,10 +135,12 @@
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"
width="240"
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-show="scope.row.deptType != 'enterprise'"
v-hasPermi="['system:dept:edit']" v-hasPermi="['system:dept:edit']"
size="mini" size="mini"
type="text" type="text"
...@@ -140,6 +149,7 @@ ...@@ -140,6 +149,7 @@
>修改</el-button >修改</el-button
> >
<el-button <el-button
v-show="scope.row.deptType != 'enterprise'"
v-hasPermi="['system:dept:add']" v-hasPermi="['system:dept:add']"
size="mini" size="mini"
type="text" type="text"
...@@ -148,6 +158,7 @@ ...@@ -148,6 +158,7 @@
>新增</el-button >新增</el-button
> >
<el-button <el-button
v-show="scope.row.deptType != 'enterprise'"
v-if="scope.row.parentId !== 0" v-if="scope.row.parentId !== 0"
v-hasPermi="['system:dept:remove']" v-hasPermi="['system:dept:remove']"
size="mini" size="mini"
...@@ -255,6 +266,18 @@ ...@@ -255,6 +266,18 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-col :span="12">
<el-form-item label="单位类型" prop="deptType">
<el-select v-model="form.deptType" :disabled="title == '修改部门'" placeholder="请选择单位类型">
<el-option
v-for="item in typeOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
...@@ -320,6 +343,9 @@ export default { ...@@ -320,6 +343,9 @@ export default {
orderNum: [ orderNum: [
{ required: true, message: '显示排序不能为空', trigger: 'blur' } { required: true, message: '显示排序不能为空', trigger: 'blur' }
], ],
deptType: [
{ required: true, message: '单位类型不能为空', trigger: 'blur' }
],
email: [ email: [
{ {
type: 'email', type: 'email',
...@@ -333,14 +359,29 @@ export default { ...@@ -333,14 +359,29 @@ export default {
message: '请输入正确的手机号码', message: '请输入正确的手机号码',
trigger: 'blur' trigger: 'blur'
} }
],
},
typeOptions:[
{
label:'政府部门',
value:'government'
},
{
label:'检测机构',
value:'testing_institution'
}
] ]
}
} }
}, },
created() { created() {
this.getList() this.getList()
}, },
methods: { methods: {
formatteDeptType(val){
return val.deptType === "enterprise" ? '企业' : val.deptType === "government" ? '政府部门' : val.deptType === "testing_institution" ? '检测机构' : ''
},
/** 查询部门列表 */ /** 查询部门列表 */
getList() { getList() {
this.loading = true this.loading = true
...@@ -415,6 +456,7 @@ export default { ...@@ -415,6 +456,7 @@ export default {
this.reset() this.reset()
getDept(row.deptId).then(response => { getDept(row.deptId).then(response => {
this.form = response.data this.form = response.data
console.log(response.data)
this.open = true this.open = true
this.title = '修改部门' this.title = '修改部门'
listDeptExcludeChild(row.deptId).then(response => { listDeptExcludeChild(row.deptId).then(response => {
......
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