From f825462aead9ccfaedbc2b822d0114a807b7fe43 Mon Sep 17 00:00:00 2001
From: 曹睿 <360930172@qq.com>
Date: 星期三, 23 四月 2025 14:05:00 +0800
Subject: [PATCH] feat: 完成新增

---
 src/pages/production/twist/receive/plate/form.vue     |   12 +++++++++++-
 src/pages/production/twist/receive/steelCore/form.vue |   12 +++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/pages/production/twist/receive/plate/form.vue b/src/pages/production/twist/receive/plate/form.vue
index 4a1cf6d..8358eba 100644
--- a/src/pages/production/twist/receive/plate/form.vue
+++ b/src/pages/production/twist/receive/plate/form.vue
@@ -44,6 +44,7 @@
 import { useToast } from "wot-design-uni";
 
 const emits = defineEmits(["refresh"]);
+const paramsId = ref();
 const toast = useToast();
 const { form: model } = useFormData({
   diskMaterial: undefined, // 鐩樺叿绫诲瀷
@@ -54,7 +55,12 @@
 });
 
 const submit = async () => {
-  const { code } = await TwistApi.addStrandedWireDish([model]);
+  const { code } = await TwistApi.addStrandedWireDish([
+    {
+      wireId: paramsId.value,
+      ...model,
+    },
+  ]);
   if (code == 200) {
     toast.success("鏂板鎴愬姛");
     emits("refresh");
@@ -62,6 +68,10 @@
   }
 };
 
+onLoad((options: any) => {
+  paramsId.value = options.id;
+});
+
 defineExpose({
   submit,
 });
diff --git a/src/pages/production/twist/receive/steelCore/form.vue b/src/pages/production/twist/receive/steelCore/form.vue
index 88dab37..d0e4c2c 100644
--- a/src/pages/production/twist/receive/steelCore/form.vue
+++ b/src/pages/production/twist/receive/steelCore/form.vue
@@ -43,6 +43,7 @@
 import { useToast } from "wot-design-uni";
 
 const emits = defineEmits(["refresh"]);
+const paramsId = ref();
 const toast = useToast();
 const { form: model } = useFormData({
   model: undefined, // 瑙勬牸鍨嬪彿
@@ -53,7 +54,12 @@
 });
 
 const submit = async () => {
-  const { code } = await TwistApi.addStrandedWireDish([model]);
+  const { code } = await TwistApi.addStrandedWireDish([
+    {
+      wireId: paramsId.value,
+      ...model,
+    },
+  ]);
   if (code == 200) {
     toast.success("鏂板鎴愬姛");
     emits("refresh");
@@ -61,6 +67,10 @@
   }
 };
 
+onLoad((options: any) => {
+  paramsId.value = options.id;
+});
+
 defineExpose({
   submit,
 });

--
Gitblit v1.9.3