| | |
| | | <div class="select-member-content-right-header"> |
| | | <div class="select-member-content-right-header-text">人员列表</div> |
| | | <div class="select-member-content-right-header-search"> |
| | | <el-input clearable v-model="nickNameOrPhone" placeholder="请输入姓名" /> |
| | | <el-input clearable v-model="nickNameOrPhone" placeholder="请输入姓名" /> |
| | | <el-button type="primary" @click="searchUserList(null)">搜索</el-button> |
| | | </div> |
| | | </div> |
| | | <Table ref="memberTable" :height="500" :row-key="row => row.userId" :data="tableData" |
| | | :total="0" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName"> |
| | | <Table ref="memberTable" :height="500" :row-key="row => row.userId" :data="tableData" :total="0" |
| | | @selection-change="handleSelectionChange" :row-class-name="tableRowClassName"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column label="角色" prop="roleId" > |
| | | <el-table-column label="角色" prop="roleId"> |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.roleId == 1">超级管理员</span> |
| | | <span v-if="scope.row.roleId == 2">审批人</span> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="姓名" prop="nickName" /> |
| | | <el-table-column label="头像" prop="avatar" > |
| | | <el-table-column label="头像" prop="avatar"> |
| | | <template #default="scope"> |
| | | <img :src="scope.row.avatar || require('../../assets/login/img1111.png')" style="width: 50px;height: 50px;border-radius: 50%;" /> |
| | | <img :src="scope.row.avatar || require('../../assets/login/img1111.png')" |
| | | style="width: 50px;height: 50px;border-radius: 50%;" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="创建时间" prop="createTime" /> |
| | |
| | | projectId: { |
| | | type: [String, Number], |
| | | default: null |
| | | } |
| | | }, |
| | | roleType: { |
| | | type: [String, Number], |
| | | default: null |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | searchRole(){ |
| | | if(this.search){ |
| | | this.roleList=this.roleList.filter(item=> item.roleName.includes(this.search)) |
| | | }else{ |
| | | searchRole() { |
| | | if (this.search) { |
| | | this.roleList = this.roleList.filter(item => item.roleName.includes(this.search)) |
| | | } else { |
| | | getRoleList().then(res => { |
| | | if (this.projectId) { |
| | | // 过滤出实验员和化验师角色 |
| | | this.roleList = res.filter(item => item.roleId == 4 || item.roleId == 5); |
| | | } else { |
| | | this.roleList = res; |
| | | } |
| | | }); |
| | | if (this.projectId) { |
| | | // 过滤出实验员和化验师角色 |
| | | this.roleList = res.filter(item => item.roleId == 4 || item.roleId == 5); |
| | | } else { |
| | | this.roleList = res; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | }, |
| | | setSelection(selected) { |
| | | this.selectData = selected; |
| | |
| | | if (this.projectId) { |
| | | // 过滤出实验员和化验师角色 |
| | | this.roleList = res.filter(item => item.roleId == 4 || item.roleId == 5); |
| | | } else if (this.roleType) { |
| | | this.roleList = res.filter(item => item.roleId == this.roleType); |
| | | } else { |
| | | this.roleList = res; |
| | | } |
| | |
| | | pageNum: 1 |
| | | }; |
| | | if (this.projectId) { |
| | | params={ |
| | | params = { |
| | | ...params, |
| | | roleId: roleId?roleId:'', |
| | | roleId: roleId ? roleId : '', |
| | | projectId: this.projectId, |
| | | nickName: this.nickNameOrPhone, |
| | | } |
| | | delete params.roleIds; |
| | | // TODO: 这里需要替换为新的接口调用 |
| | | const res = await listByRole(params); |
| | | this.tableData = res.filter(item => item.status==0 && (item.roleId == 4 || item.roleId == 5)); |
| | | this.tableData = res.filter(item => item.status == 0 && (item.roleId == 4 || item.roleId == 5)); |
| | | } else if (this.roleType) { |
| | | params = { |
| | | ...params, |
| | | roleIds: [this.roleType], |
| | | } |
| | | const res = await getUserList(params); |
| | | this.tableData = res.records; |
| | | } else { |
| | | const res = await getUserList(params); |
| | | this.tableData = res.records.filter(item=> item.status==0); |
| | | this.tableData = res.records.filter(item => item.status == 0); |
| | | } |
| | | // 数据加载完成后重新应用选中状态 |
| | | this.setSelection(this.selectData) |