From 78c565e37520fad100693c4e298e30e7c916d1bb Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 28 十月 2025 16:21:40 +0800
Subject: [PATCH] fix: 领用二维码异常提示,原材料自检重构

---
 src/pages/production/twist/receive/plate/edit.vue |   40 ++++++++++++++++++++++++++++++++++++++--
 1 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/src/pages/production/twist/receive/plate/edit.vue b/src/pages/production/twist/receive/plate/edit.vue
index da1ad01..f4ce69a 100644
--- a/src/pages/production/twist/receive/plate/edit.vue
+++ b/src/pages/production/twist/receive/plate/edit.vue
@@ -1,7 +1,7 @@
 <template>
   <view>
     <CardTitle title="缁炵嚎鐩樺叿棰嗙敤" :hideAction="false" />
-    <PlateForm class="mx-4" />
+    <PlateForm ref="formRef" class="mx-4" />
     <view class="footer">
       <wd-button
         class="submit_btn"
@@ -15,12 +15,48 @@
       </wd-button>
     </view>
   </view>
+  <wd-toast />
 </template>
 <script lang="ts" setup>
 import CardTitle from "@/components/card-title/index.vue";
 import PlateForm from "./form.vue";
+import { useToast } from "wot-design-uni";
+import { onLoad, onUnload } from "@dcloudio/uni-app";
 
-const handleSubmit = () => {};
+const formRef = ref();
+const toast = useToast();
+
+const handleSubmit = async () => {
+  const success = await formRef.value.submitEdit();
+  if (success) {
+    setTimeout(() => {
+      uni.navigateBack();
+    }, 500);
+  }
+};
+
+// 鎺ユ敹鍒楄〃椤典紶閫掔殑鏁版嵁
+const receiveEditData = (data: any) => {
+  console.log("receiveEditData 鎺ユ敹鍒扮殑鏁版嵁:", data);
+  if (data && formRef.value) {
+    // 纭繚 list 鍜� editId 閮藉瓨鍦�
+    if (data.list && data.editId) {
+      formRef.value.setFormData(data.list, data.editId);
+    } else {
+      console.error("鏁版嵁鏍煎紡閿欒:", data);
+    }
+  }
+};
+
+onLoad((options: any) => {
+  // 鐩戝惉鏁版嵁浼犻�掍簨浠�
+  uni.$on("plateEditData", receiveEditData);
+});
+
+onUnload(() => {
+  // 椤甸潰鍗歌浇鏃剁Щ闄ょ洃鍚�
+  uni.$off("plateEditData", receiveEditData);
+});
 </script>
 <style lang="scss" scoped>
 .footer {

--
Gitblit v1.9.3