|
|
@ -3,7 +3,7 @@ |
|
|
<el-form label-position="top" style="margin-top: 1px; margin-left: 0px;"> |
|
|
<el-form label-position="top" style="margin-top: 1px; margin-left: 0px;"> |
|
|
<el-form :inline="true" label-position="top" style="margin-top: 0px"> |
|
|
<el-form :inline="true" label-position="top" style="margin-top: 0px"> |
|
|
<el-button type="primary" @click="searchTable()">查询</el-button> |
|
|
<el-button type="primary" @click="searchTable()">查询</el-button> |
|
|
<!-- <el-button type="primary" @click="addModal()">新增</el-button>--> |
|
|
|
|
|
|
|
|
<el-button type="primary" @click="addModal()">新增</el-button> |
|
|
<download-excel |
|
|
<download-excel |
|
|
:fields="fields()" |
|
|
:fields="fields()" |
|
|
:data="exportData" |
|
|
:data="exportData" |
|
|
@ -50,8 +50,8 @@ |
|
|
label="操作"> |
|
|
label="操作"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<a type="text" size="small" @click="accessModel(scope.row)">岗位授权</a> |
|
|
<a type="text" size="small" @click="accessModel(scope.row)">岗位授权</a> |
|
|
<!-- <a type="text" size="small" @click="updateModel(scope.row)">修改</a>--> |
|
|
|
|
|
<!-- <a type="text" size="small" @click="deleteData(scope.row)">删除</a>--> |
|
|
|
|
|
|
|
|
<a type="text" size="small" @click="updateModel(scope.row)">修改</a> |
|
|
|
|
|
<a type="text" size="small" @click="deleteData(scope.row)">删除</a> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
@ -113,6 +113,32 @@ |
|
|
</div> |
|
|
</div> |
|
|
</span> |
|
|
</span> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog :title="modalData.title" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="495px"> |
|
|
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
|
|
<el-form-item label="岗位编码" prop="roleNo" :rules="rules.roleNo"> |
|
|
|
|
|
<el-input v-model="modalData.roleNo" :disabled="modalDisableFlag" style="width: 221px"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="岗位名称" prop="roleDesc" :rules="rules.roleDesc"> |
|
|
|
|
|
<el-input v-model="modalData.roleDesc" style="width: 221px"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
|
|
<el-form-item label="是否在用" prop="active" :rules="rules.active"> |
|
|
|
|
|
<el-select v-model="modalData.active" style="width: 221px"> |
|
|
|
|
|
<el-option label="是" value="Y"></el-option> |
|
|
|
|
|
<el-option label="否" value="N"></el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="类别" prop="type" :rules="rules.type"> |
|
|
|
|
|
<el-input v-model="modalData.type" style="width: 221px"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
<el-footer style="height:30px;margin-top: 20px;text-align:center"> |
|
|
|
|
|
<el-button type="primary" @click="saveData()">保存</el-button> |
|
|
|
|
|
<el-button type="primary" @click="modalFlag = false">关闭</el-button> |
|
|
|
|
|
</el-footer> |
|
|
|
|
|
</el-dialog> |
|
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
@ -126,6 +152,7 @@ |
|
|
saveAccessBuListForBu, |
|
|
saveAccessBuListForBu, |
|
|
} from "@/api/base/site.js" |
|
|
} from "@/api/base/site.js" |
|
|
import Chooselist from '@/views/modules/common/Chooselist' |
|
|
import Chooselist from '@/views/modules/common/Chooselist' |
|
|
|
|
|
import {roleInformationDelete, roleInformationEdit, roleInformationSave} from "../../../api/base/site"; |
|
|
export default { |
|
|
export default { |
|
|
components: { |
|
|
components: { |
|
|
Chooselist |
|
|
Chooselist |
|
|
@ -142,7 +169,48 @@ |
|
|
site:this.$store.state.user.site, |
|
|
site:this.$store.state.user.site, |
|
|
username: this.$store.state.user.name, |
|
|
username: this.$store.state.user.name, |
|
|
}, |
|
|
}, |
|
|
|
|
|
modalData: { |
|
|
|
|
|
flag: '', |
|
|
|
|
|
title: '', |
|
|
|
|
|
site: '', |
|
|
|
|
|
roleNo: '', |
|
|
|
|
|
roleDesc: '', |
|
|
|
|
|
active: '', |
|
|
|
|
|
type: '' |
|
|
|
|
|
}, |
|
|
|
|
|
rules:{ |
|
|
|
|
|
roleNo:[ |
|
|
|
|
|
{ |
|
|
|
|
|
required: true, |
|
|
|
|
|
message: ' ', |
|
|
|
|
|
trigger: 'change' |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
|
|
|
roleDesc:[ |
|
|
|
|
|
{ |
|
|
|
|
|
required: true, |
|
|
|
|
|
message: ' ', |
|
|
|
|
|
trigger: 'change' |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
|
|
|
active:[ |
|
|
|
|
|
{ |
|
|
|
|
|
required: true, |
|
|
|
|
|
message: ' ', |
|
|
|
|
|
trigger: 'change' |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
|
|
|
type:[ |
|
|
|
|
|
{ |
|
|
|
|
|
required: true, |
|
|
|
|
|
message: ' ', |
|
|
|
|
|
trigger: 'change' |
|
|
|
|
|
} |
|
|
|
|
|
] |
|
|
|
|
|
}, |
|
|
visible:false, |
|
|
visible:false, |
|
|
|
|
|
modalFlag:false, |
|
|
|
|
|
modalDisableFlag: false, |
|
|
dataListLoading: false, |
|
|
dataListLoading: false, |
|
|
currentRow:'', |
|
|
currentRow:'', |
|
|
columnList1:[ |
|
|
columnList1:[ |
|
|
@ -463,6 +531,107 @@ |
|
|
|
|
|
|
|
|
return s |
|
|
return s |
|
|
}, |
|
|
}, |
|
|
|
|
|
addModal(){ |
|
|
|
|
|
this.modalData = { |
|
|
|
|
|
flag: '1', |
|
|
|
|
|
title: '岗位新增', |
|
|
|
|
|
site: this.$store.state.user.site, |
|
|
|
|
|
roleNo: '', |
|
|
|
|
|
roleDesc: '', |
|
|
|
|
|
active: 'Y', |
|
|
|
|
|
type: '' |
|
|
|
|
|
} |
|
|
|
|
|
this.modalDisableFlag = false |
|
|
|
|
|
this.modalFlag = true |
|
|
|
|
|
}, |
|
|
|
|
|
updateModel (row) { |
|
|
|
|
|
this.modalData = { |
|
|
|
|
|
flag: '2', |
|
|
|
|
|
title: '岗位编辑', |
|
|
|
|
|
site: row.site, |
|
|
|
|
|
id: row.id, |
|
|
|
|
|
roleNo: row.roleNo, |
|
|
|
|
|
roleDesc: row.roleDesc, |
|
|
|
|
|
active: row.active, |
|
|
|
|
|
type: '' |
|
|
|
|
|
} |
|
|
|
|
|
this.modalDisableFlag = true |
|
|
|
|
|
this.modalFlag = true |
|
|
|
|
|
}, |
|
|
|
|
|
deleteData (row) { |
|
|
|
|
|
this.$confirm(`是否删除这条岗位信息?`, '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
roleInformationDelete(row).then(({data}) => { |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
this.searchTable() |
|
|
|
|
|
this.partSelections = [] |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: '操作成功', |
|
|
|
|
|
type: 'success', |
|
|
|
|
|
duration: 1500, |
|
|
|
|
|
onClose: () => {} |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
|
|
confirmButtonText: '确定' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
saveData () { |
|
|
|
|
|
if (this.modalData.roleNo === '' || this.modalData.roleNo == null) { |
|
|
|
|
|
this.$message.warning('请填写岗位编码!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if (this.modalData.roleDesc === '' || this.modalData.roleDesc == null) { |
|
|
|
|
|
this.$message.warning('请填写岗位名称!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if (this.modalData.active === '' || this.modalData.active == null) { |
|
|
|
|
|
this.$message.warning('请选择是否可用!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if (this.modalData.flag === '1') { |
|
|
|
|
|
roleInformationSave(this.modalData).then(({data}) => { |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
this.searchTable() |
|
|
|
|
|
this.modalFlag = false |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: '操作成功', |
|
|
|
|
|
type: 'success', |
|
|
|
|
|
duration: 1500, |
|
|
|
|
|
onClose: () => {} |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
|
|
confirmButtonText: '确定' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
roleInformationEdit(this.modalData).then(({data}) => { |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
this.searchTable() |
|
|
|
|
|
this.modalFlag = false |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: '操作成功', |
|
|
|
|
|
type: 'success', |
|
|
|
|
|
duration: 1500, |
|
|
|
|
|
onClose: () => {} |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
|
|
confirmButtonText: '确定' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|