From 2de633725d5e5d843853240933f63220dc4e4cb2 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 03 十二月 2025 16:53:57 +0800
Subject: [PATCH] fix: 导体会存在每隔一段距离需要标记的情况,需要通知工人进行标记。

---
 src/pages/production/list/index.vue |   54 ++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/src/pages/production/list/index.vue b/src/pages/production/list/index.vue
index eb7adaa..bd6f0e4 100644
--- a/src/pages/production/list/index.vue
+++ b/src/pages/production/list/index.vue
@@ -14,9 +14,11 @@
         v-for="(item, index) in list"
         :key="index"
         :data="item"
+        :map="map"
         @click="toDetail(item.id, item.type)"
       />
     </z-paging>
+    <wd-toast />
   </view>
 </template>
 
@@ -25,9 +27,23 @@
 import ProductCard from "@/components/product_card/index.vue";
 import { useUserStore } from "@/store/modules/user";
 import zPaging from "@/components/z-paging/z-paging.vue";
+import { useToast } from "wot-design-uni";
+
+const toast = useToast();
 const userStore = useUserStore();
 const userInfo: any = computed(() => userStore.userInfo);
 const pagingRef = ref();
+const map = reactive({
+  deviceModel: "deviceModel",
+  model: "model",
+  systemNo: "systemNo",
+  totalAmount: "totalAmount",
+  amount: "amount",
+  unAmount: "unAmount",
+  unit: "unit",
+  poleModel: "poleModel",
+  contractNo: "contractNo",
+});
 const props = defineProps({
   api: {
     type: Function,
@@ -37,12 +53,17 @@
     type: String,
     default: "",
   },
+  search: {
+    type: String,
+    default: "",
+  },
 });
 
 const emits = defineEmits(["ok"]);
 const list = ref<any[]>([]);
 
 const toDetail = (id: number, type: string) => {
+  // toast.show("鐐瑰嚮鍗$墖");
   if (type == "鎷変笣") {
     uni.navigateTo({
       url: `/pages/production/detail/wireDetail?id=${id}`,
@@ -55,25 +76,46 @@
 };
 
 const getList = async (pageNo: number, pageSize: number) => {
-  const { code, data } = await props.api({
+  const params: any = {
     userName: userInfo.value.userName,
     state: props.state,
     current: pageNo,
     size: pageSize,
-  });
+  };
+  if (props.search) {
+    params.search = props.search;
+  }
+  const { code, data } = await props.api(params);
   if (code == 200) {
-    if (data.total == 0) {
+    if (data.type == "缁炵嚎") {
+      map.deviceModel = "deviceModel";
+      map.model = "model";
+      map.systemNo = "systemNo";
+      map.totalAmount = "totalLength";
+      map.amount = "length";
+      map.unAmount = "unLength";
+    } else if (data.type == "鎷変笣") {
+      map.deviceModel = "deviceModel";
+      map.model = "model";
+      map.systemNo = "systemNo";
+      map.totalAmount = "totalAmount";
+      map.amount = "amount";
+      map.unAmount = "unAmount";
+      map.poleModel = "poleModel";
+      map.contractNo = "contractNo";
+    }
+    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>
 
 <style lang="scss" scoped>
 .card_box {
-  height: calc(100vh - 140px);
+  height: calc(100vh - 120px);
 }
 </style>

--
Gitblit v1.9.3