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/wire/report/wireForm.vue |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/pages/production/wire/report/wireForm.vue b/src/pages/production/wire/report/wireForm.vue
index 4fb91c4..b248788 100644
--- a/src/pages/production/wire/report/wireForm.vue
+++ b/src/pages/production/wire/report/wireForm.vue
@@ -58,23 +58,47 @@
         placeholder="璇疯緭鍏ュ疄闄呴噸閲�"
       />
     </wd-cell-group>
+    <wd-toast />
   </wd-form>
 </template>
 
 <script lang="ts" setup>
 import useFormData from "@/hooks/useFormData";
+import { useToast } from "wot-design-uni";
+import WireApi from "@/api/product/wire";
 
+const paramsId = ref();
+const toast = useToast();
 const { form: model } = useFormData({
   poleNumber: undefined, // 棰嗙敤鏉嗗彿
   poleWeight: undefined, // 瀹㈡埛鍚嶇О
   monofilamentNumber: undefined, // 鍗曚笣鐩樺彿
   model: undefined, // 瑙勬牸鍨嬪彿
-  ontLength: undefined, // 鐩橀暱
+  oneLength: undefined, // 鐩橀暱
   singleDisc: undefined, // 鍗曚笣鐩橀暱
 });
 
+const submit = async () => {
+  const { code } = await WireApi.addWireOutput({
+    wireId: paramsId.value,
+    type: "鎷変笣",
+    ...model,
+  });
+  if (code == 200) {
+    toast.success("鎻愪氦鎴愬姛");
+    return true;
+  } else {
+    toast.error("鎻愪氦澶辫触");
+    return false;
+  }
+};
+
+onLoad((options: any) => {
+  paramsId.value = options.id;
+});
+
 defineExpose({
-  model,
+  submit,
 });
 </script>
 

--
Gitblit v1.9.3