feat: 挂载ImportDialog + 修复路由白屏

## 页面挂载
- buyOdoo.vue: 新增「批量导入」按钮(新增旁边), ImportDialog material
- list.vue: 新增「批量导入」按钮, ImportDialog material
- BomManage.vue: 新增「导入BOM」按钮(新建BOM左边), ImportDialog bom

## 白屏修复
- AppMain.vue: 移除 transition mode=out-in 动画包裹(导致首次访问白屏)
  改为 :key=route.fullPath 强制创建新实例
This commit is contained in:
yueli
2026-07-16 14:00:44 +08:00
parent ebe79be9cb
commit 382b461b68
4 changed files with 31 additions and 7 deletions

View File

@ -19,6 +19,7 @@
</el-input>
<el-button @click="expandAllGroups" size="small" style="margin-right: 6px;">全部展开</el-button>
<el-button @click="collapseAllGroups" size="small" style="margin-right: 10px;">全部折叠</el-button>
<el-button v-if="userStore.hasPermission('bom_manage:operation')" type="success" plain :icon="Upload" @click="showImportDialog = true" style="margin-right:10px">导入BOM</el-button>
<el-button v-if="userStore.hasPermission('bom_manage:operation')" type="primary" :icon="Plus" @click="handleCreate">新建 BOM</el-button>
</div>
</div>
@ -249,15 +250,20 @@
</template>
</el-dialog>
</div>
<!-- 批量导入弹窗 -->
<ImportDialog v-model="showImportDialog" import-type="bom" @success="fetchBomSummary" />
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, computed, nextTick, watch } from 'vue'
import { useRoute } from 'vue-router'
import { ElMessage, ElMessageBox, FormInstance, FormRules } from 'element-plus'
import { Plus, Search, EditPen } from '@element-plus/icons-vue'
import { Plus, Search, EditPen, Upload } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router'
import { getBomList, getBomSummary, getBomDetail, saveBom, deleteBom, getDraftDetail, saveDraft, publishDraft } from '@/api/bom'
import ImportDialog from '@/components/ImportDialog.vue'
import { searchMaterialBase } from '@/api/inbound/buy'
import { useUserStore } from '@/stores/user'
@ -303,6 +309,7 @@ const getDraftHash = () => {
}
const userStore = useUserStore()
const showImportDialog = ref(false)
const route = useRoute()
const router = useRouter()
const loading = ref(false)