From 23fc9eb0f2a9d3822cf21894ff25f551751f7d4e Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期四, 28 五月 2026 21:37:57 +0800
Subject: [PATCH] Revert "feat: 合并"
---
src/views/inventoryManagement/dispatchLog/index.vue | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 deletions(-)
diff --git a/src/views/inventoryManagement/dispatchLog/index.vue b/src/views/inventoryManagement/dispatchLog/index.vue
new file mode 100644
index 0000000..458e9ec
--- /dev/null
+++ b/src/views/inventoryManagement/dispatchLog/index.vue
@@ -0,0 +1,55 @@
+<!-- 鍦ㄤ綘鐨勪富椤甸潰涓� -->
+<template>
+ <div class="app-container">
+ <div v-loading="loading" element-loading-text="鍔犺浇涓�..." style="min-height: 80vh;">
+ <el-tabs v-model="activeTab" @tab-change="handleTabChange" v-if="!loading">
+ <el-tab-pane v-for="tab in tabs"
+ :label="tab.productName"
+ :name="tab.id"
+ :key="tab.id">
+ <Record v-bind="{ type: tab.type, topParentProductId: activeTab }" v-if="tab.id === activeTab" />
+ </el-tab-pane>
+ </el-tabs>
+ </div>
+ </div>
+</template>
+
+<script setup>
+import { ref, onMounted } from 'vue';
+import { productTreeList } from "@/api/basicData/product.js";
+import Record from "@/views/inventoryManagement/dispatchLog/Record.vue";
+const activeTab = ref(null)
+const tabs = ref([])
+const loading = ref(false)
+
+const resolveTypeByName = (name) => {
+ return String(name || "").includes("涓嶅悎鏍�") ? "1" : "0";
+};
+
+const handleTabChange = (tabName) => {
+ activeTab.value = tabName;
+}
+
+const fetchProducts = async () => {
+ loading.value = true;
+ try {
+ const res = await productTreeList();
+ tabs.value = res
+ .filter((item) => item.parentId === null)
+ .map(({ id, productName }) => ({
+ id,
+ productName,
+ type: resolveTypeByName(productName),
+ }));
+ if (tabs.value.length > 0) {
+ activeTab.value = tabs.value[0].id;
+ }
+ } finally {
+ loading.value = false;
+ }
+}
+
+onMounted(() => {
+ fetchProducts();
+})
+</script>
--
Gitblit v1.9.3