From 79210c2f29c65499e5ff8e4abc0c802b7b1c4065 Mon Sep 17 00:00:00 2001
From: 曹睿 <360930172@qq.com>
Date: 星期四, 24 四月 2025 16:43:07 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/yuanwang-mes-uniapp

---
 src/pages/production/list/index.vue |   35 +++++++++++++++++++++++++----------
 1 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/src/pages/production/list/index.vue b/src/pages/production/list/index.vue
index 7d6c9ac..e64a901 100644
--- a/src/pages/production/list/index.vue
+++ b/src/pages/production/list/index.vue
@@ -13,13 +13,8 @@
       <ProductCard
         v-for="(item, index) in list"
         :key="index"
-        :data="{
-          deviceModel: item.deviceModel,
-          model: item.model,
-          totalAmount: item.totalLength,
-          amount: item.length,
-          unAmount: item.unLength,
-        }"
+        :data="item"
+        :map="map"
         @click="toDetail(item.id, item.type)"
       />
     </z-paging>
@@ -34,6 +29,13 @@
 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,
@@ -68,12 +70,25 @@
     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