hookehuyr

fix 默认获取物资逻辑顺序修复

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-09-06 14:18:22 4 + * @LastEditTime: 2024-09-12 13:14:50
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 -->
...@@ -77,6 +77,8 @@ onMounted(async () => { ...@@ -77,6 +77,8 @@ onMounted(async () => {
77 if (code) { 77 if (code) {
78 tabList.value = data; 78 tabList.value = data;
79 if (tabList.value.length) { 79 if (tabList.value.length) {
80 + // 没有指定的组别,默认选中第一个
81 + dept_id.value = tabList.value[0]['dept_id'];
80 // 默认选中组别ID 82 // 默认选中组别ID
81 tabList.value.forEach((item, index) => { 83 tabList.value.forEach((item, index) => {
82 if (item.is_my_dept) { // 指定组别 84 if (item.is_my_dept) { // 指定组别
...@@ -84,8 +86,6 @@ onMounted(async () => { ...@@ -84,8 +86,6 @@ onMounted(async () => {
84 active.value = index; 86 active.value = index;
85 } 87 }
86 }); 88 });
87 - // 没有指定的组别,默认选中第一个
88 - dept_id.value = tabList.value[0]['dept_id'];
89 } 89 }
90 } 90 }
91 }); 91 });
......