From e0fc86fda41a8777a0cec5a9de7aa9f1474f5dc8 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期四, 08 十月 2026 17:09:52 +0800
Subject: [PATCH] fix: 库存操作原型绘制。单丝领用,添加字段

---
 src/pages/production/twist/components/MonofilCard.vue |   27 ++++++++++++++++++++++-----
 1 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/src/pages/production/twist/components/MonofilCard.vue b/src/pages/production/twist/components/MonofilCard.vue
index 972c910..a1ffcbc 100644
--- a/src/pages/production/twist/components/MonofilCard.vue
+++ b/src/pages/production/twist/components/MonofilCard.vue
@@ -9,10 +9,12 @@
     >
       <wd-card>
         <wd-cell-group :border="true">
-          <wd-cell title="鍗曚笣缂栧彿" :value="data.monofilamentNumber" />
-          <wd-cell title="鐞嗚闀垮害" :value="data.amount + ' (m)'" />
-          <wd-cell title="鐢熶骇闀垮害" :value="data.actuallyLength + ' (m)'" />
-          <wd-cell title="閲嶉噺" :value="data.actuallyWeight + ' (kg)'" />
+          <wd-cell title="鍗曚笣缂栧彿" :value="data.monofilamentNumber || '-'" />
+          <wd-cell title="鍗曚笣鐩橀暱搴�" :value="reelLengthText" />
+          <wd-cell title="缁炲眰" :value="layerText" />
+          <wd-cell title="瑙勬牸鍨嬪彿" :value="specificationText" />
+          <wd-cell title="鐞嗚闀垮害" :value="amountText" />
+          <wd-cell title="閲嶉噺" :value="weightText" />
         </wd-cell-group>
       </wd-card>
     </view>
@@ -23,7 +25,7 @@
 </template>
 
 <script setup lang="ts">
-import { ref } from "vue";
+import { ref, computed } from "vue";
 
 const props = defineProps({
   data: {
@@ -32,6 +34,21 @@
   },
 });
 
+/** 鏈夊�兼墠鎷煎崟浣嶏紝绌哄�兼樉绀� "-"锛岄伩鍏嶅嚭鐜� "undefined (m)" */
+const withUnit = (value: any, unit: string) =>
+  value === undefined || value === null || value === "" ? "-" : `${value} (${unit})`;
+
+/** 鍗曚笣鐩橀暱搴︼細瀵瑰簲鍘熸潵鐨勫疄闄呴暱搴� actuallyLength */
+const reelLengthText = computed(() => withUnit(props.data?.actuallyLength, "m"));
+const amountText = computed(() => withUnit(props.data?.amount, "m"));
+const weightText = computed(() => withUnit(props.data?.actuallyWeight, "kg"));
+/** 缁炲眰锛氫紭鍏� twistedLayer锛屽厹搴� layer */
+const layerText = computed(() => props.data?.twistedLayer || props.data?.layer || "-");
+/** 瑙勬牸鍨嬪彿锛氫紭鍏� specificationModel锛屽厹搴� model */
+const specificationText = computed(
+  () => props.data?.specificationModel || props.data?.model || "-"
+);
+
 const emit = defineEmits(["delete", "swipe-open"]);
 
 const translateX = ref(0);

--
Gitblit v1.9.3