From 5519cbf2e00c7ba4c650a542d98da99978124a30 Mon Sep 17 00:00:00 2001
From: 曹睿 <360930172@qq.com>
Date: 星期四, 24 四月 2025 16:43:01 +0800
Subject: [PATCH] test: 测试生产管理

---
 src/pages/production/list/index.vue |   34 +++++++++++++++++++++++++++-------
 1 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/src/pages/production/list/index.vue b/src/pages/production/list/index.vue
index 2fb4362..e64a901 100644
--- a/src/pages/production/list/index.vue
+++ b/src/pages/production/list/index.vue
@@ -14,6 +14,7 @@
         v-for="(item, index) in list"
         :key="index"
         :data="item"
+        :map="map"
         @click="toDetail(item.id, item.type)"
       />
     </z-paging>
@@ -25,8 +26,16 @@
 import ProductCard from "@/components/product_card/index.vue";
 import { useUserStore } from "@/store/modules/user";
 import zPaging from "@/components/z-paging/z-paging.vue";
-
+const userStore = useUserStore();
+const userInfo: any = computed(() => userStore.userInfo);
 const pagingRef = ref();
+const map = reactive({
+  deviceModel: "deviceModel",
+  model: "model",
+  totalAmount: "totalAmount",
+  amount: "amount",
+  unAmount: "unAmount",
+});
 const props = defineProps({
   api: {
     type: Function,
@@ -54,21 +63,32 @@
 };
 
 const getList = async (pageNo: number, pageSize: number) => {
-  const userStore = useUserStore();
-  const userInfo: any = computed(() => userStore.userInfo);
   const { code, data } = await props.api({
-    userName: userInfo.value.user?.userName,
+    userName: userInfo.value.userName,
     state: props.state,
     current: pageNo,
     size: pageSize,
   });
   if (code == 200) {
-    if (data.total == 0) {
+    if (data.type == "缁炵嚎") {
+      map.deviceModel = "deviceModel";
+      map.model = "model";
+      map.totalAmount = "totalLength";
+      map.amount = "length";
+      map.unAmount = "unLength";
+    } else if (data.type == "鎷変笣") {
+      map.deviceModel = "deviceModel";
+      map.model = "model";
+      map.totalAmount = "totalAmount";
+      map.amount = "amount";
+      map.unAmount = "unAmount";
+    }
+    if (data.data.total == 0) {
       pagingRef.value.complete(true);
     } else {
-      pagingRef.value.complete(data.records);
+      pagingRef.value.complete(data.data.records);
     }
-    emits("ok", data.total);
+    emits("ok", data.data.total);
   }
 };
 </script>

--
Gitblit v1.9.3