| | |
| | | <el-table-column label="操作" width="250"> |
| | | <template slot-scope="scope"> |
| | | <el-button style="margin-right: 10px" type="text" @click="handleDetail(scope.row)">详情</el-button> |
| | | <el-button style="margin-right: 10px" type="text" v-if="Number(roleType) == 1" @click="handleDetail(scope.row)">编辑</el-button> |
| | | <el-button style="margin-right: 10px" type="text" |
| | | v-if="canEdit(scope.row)" |
| | | @click="handleEdit(scope.row)">编辑</el-button> |
| | | <!-- 菌种超级管理员 --> |
| | | <el-button type="text" v-if="Number(roleType) == 1" @click="handleDelete(scope.row)">删除</el-button> |
| | | </template> |
| | |
| | | tableData: [], |
| | | total: 0, |
| | | roleType: JSON.parse(sessionStorage.getItem('userInfo')).roleType || 1, // 1.超级管理员 2.审批人 3.工程师 4.实验员 |
| | | currentUserName: JSON.parse(sessionStorage.getItem('userInfo')).nickName || '', |
| | | // 模拟数据 |
| | | mockListData: [], |
| | | mockDraftData: [], |
| | |
| | | currentApprovalData: null, |
| | | }; |
| | | }, |
| | | created() { |
| | | activated() { |
| | | this.getTableData(); |
| | | }, |
| | | mounted() { |
| | | this.fetchTeamList() |
| | | }, |
| | | methods: { |
| | |
| | | // 实现撤销审批逻辑 |
| | | }, |
| | | handleEdit(row) { |
| | | // 实现编辑逻辑 |
| | | const path = row.generationType == 1 ? '/strain/add-pedigree' : '/strain/add-progenitor'; |
| | | this.$router.push({ path, query: { id: row.id, mode: 'edit', status: row.status } }); |
| | | }, |
| | | canEdit(row) { |
| | | if (Number(this.roleType) === 1) return true; |
| | | return Number(this.roleType) === 3 |
| | | && Number(row.status) === 1 |
| | | && row.createBy === this.currentUserName; |
| | | }, |
| | | handleDelete(row) { |
| | | // 实现删除逻辑 |