From fda6d3c555fd317137a24e9a6c0d342eb50bfe57 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 21 四月 2026 09:33:38 +0800
Subject: [PATCH] 湟水峡 1.项目利润页面加上采购合同号字段。项目名称、增值税字段去掉 2.生产订单删掉404接口

---
 src/views/inventoryManagement/dispatchLog/index.vue |   64 +++++++++++++++++++-------------
 1 files changed, 38 insertions(+), 26 deletions(-)

diff --git a/src/views/inventoryManagement/dispatchLog/index.vue b/src/views/inventoryManagement/dispatchLog/index.vue
index 88d9984..0dcfd06 100644
--- a/src/views/inventoryManagement/dispatchLog/index.vue
+++ b/src/views/inventoryManagement/dispatchLog/index.vue
@@ -1,38 +1,50 @@
-<!-- 鍦ㄤ綘鐨勪富椤甸潰涓� -->
 <template>
   <div class="app-container">
-    <el-tabs v-model="activeTab" @tab-change="handleTabChange">
-      <el-tab-pane v-for="tab in tabs"
-                   :label="tab.label"
-                   :name="tab.name"
-                   :key="tab.name">
-        <record :type="tab.type" v-if="activeTab === tab.name" />
-      </el-tab-pane>
-    </el-tabs>
+    <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 products"
+                     :label="tab.productName"
+                     :name="tab.id"
+                     :key="tab.id">
+          <Record :product-id="tab.id" 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('qualified')
-const type = ref(0)
-const tabs = computed(() => {
-  return [
-    {
-      label: '鍚堟牸鍑哄簱',
-      name: 'qualified',
-      type: '0'
-    },
-    {
-      label: '涓嶅悎鏍煎嚭搴�',
-      name: 'unqualified',
-      type: '1'
-    }
-  ]
-})
+
+const products = ref([])
+const activeTab = ref(null)
+const loading = ref(false)
 
 const handleTabChange = (tabName) => {
   activeTab.value = tabName;
-  type.value = tabName === 'qualified' ? 0 : 1
 }
+
+const fetchProducts = async () => {
+  loading.value = true;
+  try {
+    const res = await productTreeList();
+    const productList = res.filter((item) => item.parentId === null).map(({ id, productName }) => ({ id, productName }));
+    // 灏嗙涓�涓猼ab鐨勫悕绉版敼涓�"閿�鍞�"
+    if (productList.length > 0) {
+      productList[0].productName = '閿�鍞�';
+    }
+    products.value = productList;
+    if (products.value.length > 0) {
+      activeTab.value = products.value[0].id;
+    }
+  } finally {
+    loading.value = false;
+  }
+}
+
+onMounted(() => {
+  fetchProducts();
+})
 </script>

--
Gitblit v1.9.3