|
|
@ -45,6 +45,13 @@ |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="部门" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.deptName" filterable placeholder="请选择" @change="orgChange($event, scope.row)"> |
|
|
|
<el-option v-for="item in orgList" :key="item.orgDeptSid" :label="item.orgDeptName" :value="item.orgDeptName"></el-option> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="角色名称" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.roleName" filterable placeholder="请选择" @change="roleChange($event, scope.row)"> |
|
|
@ -66,7 +73,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { fetchSid, save } from '@/api/jichuxinxi/xiaoshourangjia' |
|
|
|
import { roleList } from '@/api/dictcommons/dictcommons' |
|
|
|
import { roleList, selectOrgList } from '@/api/dictcommons/dictcommons' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'xiaoshourangjiaAdd', |
|
|
@ -76,6 +83,7 @@ export default { |
|
|
|
index: 0, |
|
|
|
tableKey: 0, |
|
|
|
role_list: [], |
|
|
|
orgList: [], |
|
|
|
// 表单数据 |
|
|
|
formobj: { |
|
|
|
sid: '', // 一条数据的sid |
|
|
@ -97,6 +105,11 @@ export default { |
|
|
|
this.role_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
selectOrgList({ userSid: window.sessionStorage.getItem('userSid'), orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.orgList = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 输入数字正则 |
|
|
|
oninput(e) { |
|
|
@ -134,6 +147,10 @@ export default { |
|
|
|
dataDelete(index) { |
|
|
|
this.formobj.baseRoleletpricepowimits.splice(index, 1) |
|
|
|
}, |
|
|
|
orgChange(value, row) { |
|
|
|
const choose = this.orgList.filter((item) => item.orgDeptName === value) |
|
|
|
row.deptSid = choose[0].orgDeptSid |
|
|
|
}, |
|
|
|
roleChange(value, row) { |
|
|
|
const choose = this.role_list.filter((item) => item.name === value) |
|
|
|
row.roleSid = choose[0].sid |
|
|
|