Showing
1 changed file
with
10 additions
and
2 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-07-23 10:50:38 | 2 | * @Date: 2024-07-23 10:50:38 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-08-03 13:29:35 | 4 | + * @LastEditTime: 2024-09-06 14:18:22 |
| 5 | * @FilePath: /temple_material_request/src/views/material_list.vue | 5 | * @FilePath: /temple_material_request/src/views/material_list.vue |
| 6 | * @Description: 物资情况页面 | 6 | * @Description: 物资情况页面 |
| 7 | --> | 7 | --> |
| ... | @@ -76,7 +76,15 @@ onMounted(async () => { | ... | @@ -76,7 +76,15 @@ onMounted(async () => { |
| 76 | const { data, code } = await getActivityDeptsAPI({ activity_id, is_previous: 0, only_my_dept: 0 }); | 76 | const { data, code } = await getActivityDeptsAPI({ activity_id, is_previous: 0, only_my_dept: 0 }); |
| 77 | if (code) { | 77 | if (code) { |
| 78 | tabList.value = data; | 78 | tabList.value = data; |
| 79 | - if (tabList.value.length) { // 默认选中组别ID | 79 | + if (tabList.value.length) { |
| 80 | + // 默认选中组别ID | ||
| 81 | + tabList.value.forEach((item, index) => { | ||
| 82 | + if (item.is_my_dept) { // 指定组别 | ||
| 83 | + dept_id.value = tabList.value[index]['dept_id']; | ||
| 84 | + active.value = index; | ||
| 85 | + } | ||
| 86 | + }); | ||
| 87 | + // 没有指定的组别,默认选中第一个 | ||
| 80 | dept_id.value = tabList.value[0]['dept_id']; | 88 | dept_id.value = tabList.value[0]['dept_id']; |
| 81 | } | 89 | } |
| 82 | } | 90 | } | ... | ... |
-
Please register or login to post a comment