From 8460eac918d8c8e825a0f78ac0af1c03cad8fd49 Mon Sep 17 00:00:00 2001
From: YLouie <929705085@qq.com>
Date: 星期四, 23 十月 2025 16:53:21 +0800
Subject: [PATCH] 拉丝报工填原材料领用

---
 src/pages/production/wire/report/wire.vue        |   59 +++++
 src/pages/production/twist/report/index.vue      |    9 
 src/api/product/twist.ts                         |    2 
 src/api/product/manage.ts                        |   26 ++
 src/pages/production/wire/report/rawMaterial.vue |  319 +++++++++++++++++++++++++++++++
 src/pages/production/wire/report/wireForm.vue    |   15 +
 src/pages/production/twist/report/draw.vue       |  164 +++++++++------
 7 files changed, 513 insertions(+), 81 deletions(-)

diff --git a/src/api/product/manage.ts b/src/api/product/manage.ts
index 5e8e99b..bdbc5aa 100644
--- a/src/api/product/manage.ts
+++ b/src/api/product/manage.ts
@@ -70,6 +70,32 @@
       data: params,
     });
   },
+
+  //鎷変笣鎶ュ伐鍓嶇敓浜х‘璁�
+  queryWireRawMaterialInspect(params: any) {
+    return request<BaseResult<any>>({
+      url: "/wireInspection/queryWireRawMaterialInspect/",
+      method: "GET",
+      data: params,
+    });
+  },
+
+  // 鏂板鎷変笣鍘熸潗鏂欓鐢�
+  addWireRawMaterialInspect(data: any) {
+    return request<BaseResult<any>>({
+      url: "/wireInspection/saveWireRawMaterialInspect",
+      method: "POST",
+      data: data,
+    });
+  },
+
+  //鏁版嵁瀛楀吀
+  dictAPI(type: string) {
+    return request<BaseResult<any>>({
+      url: "/system/dict/data/type/" + type,
+      method: "GET",
+    });
+  },
 };
 
 export default ManageApi;
diff --git a/src/api/product/twist.ts b/src/api/product/twist.ts
index 75c2f0d..3360277 100644
--- a/src/api/product/twist.ts
+++ b/src/api/product/twist.ts
@@ -71,7 +71,7 @@
     });
   },
 
-  // 鏂板鍗曚笣棰嗙敤妫�鏌�
+  // 鏂板缁炵嚎鍗曚笣棰嗙敤妫�鏌�
   addSingleDishInspection(data: any) {
     return request<BaseResult<any>>({
       url: "/wireInspection/saveSingleDishInspection",
diff --git a/src/pages/production/twist/report/draw.vue b/src/pages/production/twist/report/draw.vue
index 22a7c7a..9f3a160 100644
--- a/src/pages/production/twist/report/draw.vue
+++ b/src/pages/production/twist/report/draw.vue
@@ -10,8 +10,8 @@
           <view class="form-section">
             <template v-for="(item, index) in localMaterialData" :key="index">
               <view v-if="index > 0" class="mt-4 pt-4 border-t border-gray-100"></view>
-              <wd-form>
-                <wd-form-item label="瑙勬牸鍨嬪彿" prop="spec" required>
+              <wd-form :model="item">
+                <wd-form-item label="瑙勬牸鍨嬪彿" prop="model" required>
                   <wd-input v-model="item.model" :disabled="false" placeholder="璇疯緭鍏�"></wd-input>
                 </wd-form-item>
                 <wd-form-item label="澶栬璐ㄩ噺" prop="appearanceQuality" required>
@@ -59,8 +59,8 @@
           <view class="form-section">
             <template v-for="(item, index) in localSteelData" :key="index">
               <view v-if="index > 0" class="mt-4 pt-4 border-t border-gray-100"></view>
-              <wd-form>
-                <wd-form-item label="瑙勬牸鍨嬪彿" prop="spec" required>
+              <wd-form :model="item">
+                <wd-form-item label="瑙勬牸鍨嬪彿" prop="model" required>
                   <wd-input v-model="item.model" :disabled="false" placeholder="璇疯緭鍏�"></wd-input>
                 </wd-form-item>
                 <wd-form-item label="缁炲悜" prop="twistedDirection" required>
@@ -99,7 +99,7 @@
         </wd-tab>
         <wd-tab title="鐩樺叿棰嗙敤" name="reel">
           <view class="form-section">
-            <wd-form>
+            <wd-form :model="localReelData">
               <wd-form-item label="铻烘瘝鏄惁鍥哄畾" prop="nutFixed" required>
                 <wd-picker
                   v-model="localReelData.nutFixed"
@@ -175,69 +175,85 @@
   </view>
 </template>
 
-<script setup>
+<script setup lang="ts">
 import { ref, watch } from "vue";
 import { useToast } from "wot-design-uni";
 import TwistApi from "@/api/product/twist";
+import ManageApi from "@/api/product/manage";
+
+// 瀹氫箟TypeScript鎺ュ彛
+interface MaterialData {
+  model: string;
+  appearanceQuality: string;
+  dia: string;
+  length: string;
+  windingTightness: string;
+  arrangement: string;
+  edgeDistance: string;
+}
+
+interface SteelData {
+  model: string;
+  twistedDirection: string;
+  outerDiameter: string;
+  scratch: string;
+  oilStain: string;
+}
+
+interface ReelData {
+  nutFixed: string;
+  sidePlateFlat: string;
+  centerPlateFlat: string;
+  paintQuality: string;
+  burrCrack: string;
+  edgeBlunt: string;
+  woodMold: string;
+  weldQuality: string;
+}
 
 // 瀹氫箟缁勪欢鐨刾rops
-const props = defineProps({
-  singleRegulationInfoArray: {
-    type: Array,
-    default: () => [],
-  },
-  steelRegulationInfoArray: {
-    type: Array,
-    default: () => [],
-  },
-  reelToolingInfo: {
-    type: Object,
-    default: () => ({}),
-  },
-  wireId: {
-    type: String,
-    default: "",
-  },
-});
+const props = defineProps<{
+  singleRegulationInfoArray: MaterialData[];
+  steelRegulationInfoArray: SteelData[];
+  reelToolingInfo: ReelData;
+  wireId: string;
+}>();
 
-const appearanceQualityOptions = [
-  {
-    label: "鏈夊垝浼�",
-    value: "鏈夊垝浼�",
-  },
-  {
-    label: "鏈夌鑺�",
-    value: "鏈夌鑺�",
-  },
-  {
-    label: "鏈夐粦鑹叉补姹�",
-    value: "鏈夐粦鑹叉补姹�",
-  },
-  {
-    label: "鏃�",
-    value: "鏃�",
-  },
-];
-const paintQualityOptions = [
-  {
-    label: "瀹屽ソ",
-    value: "瀹屽ソ",
-  },
-  {
-    label: "鐮存崯",
-    value: "鐮存崯",
-  },
-];
-const weldQualityOptions = [
-  {
-    label: "宸茬(鍏�",
-    value: "宸茬(鍏�",
-  },
-  {
-    label: "宸茬(鐨�",
-    value: "宸茬(鐨�",
-  },
-];
+const appearanceQualityOptions = ref<Array<{ label: string; value: string | number }>>([]);
+const paintQualityOptions = ref<Array<{ label: string; value: string | number }>>([]);
+const weldQualityOptions = ref<Array<{ label: string; value: string | number }>>([]);
+
+// 浠庢暟鎹瓧鍏镐腑鍔犺浇鏁版嵁
+const loadDictData = async () => {
+  try {
+    // 鍒嗗埆璋冪敤dictAPI鑾峰彇鍚勪釜瀛楀吀鏁版嵁
+    const paintQualityRes = await ManageApi.dictAPI("draw_paint_quality");
+    const weldQualityRes = await ManageApi.dictAPI("draw_welding_quality");
+    const qualityRes = await ManageApi.dictAPI("draw_appearance_quality");
+
+    // 澶勭悊杩斿洖鏁版嵁锛岃浆鎹负缁勪欢鎵�闇�鐨勬牸寮� {label: string, value: string}
+    if (paintQualityRes.data && Array.isArray(paintQualityRes.data)) {
+      paintQualityOptions.value = paintQualityRes.data.map((item) => ({
+        label: item.dictLabel || "",
+        value: item.dictValue || "",
+      }));
+    }
+    if (weldQualityRes.data && Array.isArray(weldQualityRes.data)) {
+      weldQualityOptions.value = weldQualityRes.data.map((item) => ({
+        label: item.dictLabel || "",
+        value: item.dictValue || "",
+      }));
+    }
+    if (qualityRes.data && Array.isArray(qualityRes.data)) {
+      appearanceQualityOptions.value = qualityRes.data.map((item) => ({
+        label: item.dictLabel || "",
+        value: item.dictValue || "",
+      }));
+    }
+  } catch (error) {
+    console.error("鍔犺浇鏁版嵁瀛楀吀澶辫触:", error);
+  }
+};
 const haveOrNotOptions = [
   {
     label: "鏈�",
@@ -260,13 +276,22 @@
 ];
 // 瀹氫箟缁勪欢鐨別mits
 const emit = defineEmits(["close"]);
-const activeTab = ref("material");
+const activeTab = ref<string>("material");
 const toast = useToast();
 
 // 鏈湴鍝嶅簲寮忔暟鎹紝鐢ㄤ簬瀛樺偍鐢ㄦ埛杈撳叆
-const localMaterialData = ref([]);
-const localSteelData = ref([]);
-const localReelData = ref({});
+const localMaterialData = ref<MaterialData[]>([]);
+const localSteelData = ref<SteelData[]>([]);
+const localReelData = ref<ReelData>({
+  nutFixed: "",
+  sidePlateFlat: "",
+  centerPlateFlat: "",
+  paintQuality: "",
+  burrCrack: "",
+  edgeBlunt: "",
+  woodMold: "",
+  weldQuality: "",
+});
 
 // 鍒濆鍖栨湰鍦版暟鎹�
 const initializeData = () => {
@@ -335,7 +360,7 @@
 watch(() => props.steelRegulationInfoArray, initializeData, { deep: true });
 watch(() => props.reelToolingInfo, initializeData, { deep: true });
 
-const handleTabChange = (tabName) => {
+const handleTabChange = (tabName: string) => {
   activeTab.value = tabName;
 };
 
@@ -446,7 +471,10 @@
     return true;
   }
 };
-
+// 鍦ㄧ粍浠舵寕杞芥椂寮傛鍔犺浇鏁版嵁瀛楀吀
+onMounted(async () => {
+  await loadDictData();
+});
 watch(
   () => [props.singleRegulationInfoArray, props.steelRegulationInfoArray, props.reelToolingInfo],
   () => {
diff --git a/src/pages/production/twist/report/index.vue b/src/pages/production/twist/report/index.vue
index f63f742..49e4cb3 100644
--- a/src/pages/production/twist/report/index.vue
+++ b/src/pages/production/twist/report/index.vue
@@ -20,7 +20,7 @@
           <wd-button size="small" plain style="margin-right: 10px" @click="toAttachment(item)">
             闄勪欢
           </wd-button>
-          <wd-button size="small" plain @click="toCheck(item.id)">鑷</wd-button>
+          <wd-button size="small" plain @click="handleSelfCheck(item.id)">鑷</wd-button>
         </template>
       </wd-card>
     </z-paging>
@@ -50,7 +50,7 @@
 import { useToast } from "wot-design-uni";
 import ProductionCard from "../../components/ProductionCard.vue";
 import { onLoad } from "@dcloudio/uni-app";
-import { ref } from "vue";
+import { ref, reactive } from "vue";
 import ManageApi from "@/api/product/manage";
 import TwistApi from "@/api/product/twist";
 import Draw from "./draw.vue";
@@ -63,7 +63,6 @@
 const handleDrawClose = () => {
   // 纭繚寮圭獥琚纭叧闂�
   drawFormRef.visible = false;
-  console.log('Draw popup closed');
 };
 const pagingRef = ref();
 const paramsId = ref();
@@ -172,10 +171,6 @@
     console.error("鑾峰彇棰嗙敤淇℃伅澶辫触:", error);
     toast.error("鑾峰彇淇℃伅澶辫触锛岃閲嶈瘯");
   }
-};
-
-const closeDrawPopup = () => {
-  drawDialogVisible.value = false;
 };
 
 const handleSelfCheck = (id: string) => {
diff --git a/src/pages/production/wire/report/rawMaterial.vue b/src/pages/production/wire/report/rawMaterial.vue
new file mode 100644
index 0000000..5fc8076
--- /dev/null
+++ b/src/pages/production/wire/report/rawMaterial.vue
@@ -0,0 +1,319 @@
+<template>
+  <view class="draw-container">
+    <view class="header">
+      <text class="title">棰嗙敤淇℃伅</text>
+      <wd-icon name="close" class="close-icon" @click="handleClose"></wd-icon>
+    </view>
+    <view class="content">
+      <wd-tabs v-model="activeTab" @change="handleTabChange">
+        <wd-tab title="鍘熸潗鏂欓鐢�" name="reel">
+          <view class="form-section">
+            <wd-form :model="materialData">
+              <wd-form-item label="鍨嬪彿" prop="model" required>
+                <wd-picker
+                  v-model="materialData.model"
+                  range-key="label"
+                  :columns="drawing_model"
+                  placeholder="璇烽�夋嫨"
+                ></wd-picker>
+              </wd-form-item>
+              <wd-form-item label="瑙勬牸" prop="spec" required>
+                <wd-picker
+                  v-model="materialData.spec"
+                  range-key="label"
+                  :columns="drawing_spec"
+                  placeholder="璇烽�夋嫨"
+                ></wd-picker>
+              </wd-form-item>
+              <wd-form-item label="瀵肩數鐜�(%IACS)" prop="conductivity" required>
+                <wd-input
+                  v-model="materialData.conductivity"
+                  range-key="label"
+                  placeholder="璇疯緭鍏�"
+                ></wd-input>
+              </wd-form-item>
+              <wd-form-item label="鎶楁媺寮哄害(Mpa)" prop="tensileStrength" required>
+                <wd-input
+                  v-model="materialData.tensileStrength"
+                  range-key="label"
+                  placeholder="璇疯緭鍏�"
+                ></wd-input>
+              </wd-form-item>
+              <wd-form-item label="鐢甸樆鐜�(n惟路m)" prop="resistivity" required>
+                <wd-input
+                  v-model="materialData.resistivity"
+                  range-key="label"
+                  placeholder="璇疯緭鍏�"
+                ></wd-input>
+              </wd-form-item>
+              <wd-form-item label="浼搁暱鐜�(%)" prop="elongationRate" required>
+                <wd-input
+                  v-model="materialData.elongationRate"
+                  range-key="label"
+                  placeholder="璇疯緭鍏�"
+                ></wd-input>
+              </wd-form-item>
+              <wd-form-item label="澶栬璐ㄩ噺" prop="appearanceQuality" required>
+                <wd-select-picker
+                  v-model="materialData.appearanceQuality"
+                  range-key="label"
+                  :columns="drawing_appearanceQuality"
+                  placeholder="璇烽�夋嫨"
+                ></wd-select-picker>
+              </wd-form-item>
+            </wd-form>
+          </view>
+        </wd-tab>
+      </wd-tabs>
+    </view>
+    <view class="footer">
+      <wd-button type="primary" class="submit-btn" @click="handleSubmit">纭</wd-button>
+    </view>
+  </view>
+</template>
+
+<script setup lang="ts">
+import { ref, onMounted } from "vue";
+import { useToast } from "wot-design-uni";
+import ManageApi from "@/api/product/manage";
+
+// 瀹氫箟鏁版嵁瀛楀吀鐩稿叧鐨勫搷搴斿紡鏁版嵁
+const drawing_model = ref<Array<{ label: string; value: string | number }>>([]);
+const drawing_spec = ref<Array<{ label: string; value: string | number }>>([]);
+const drawing_appearanceQuality = ref<Array<{ label: string; value: string | number }>>([]);
+
+// 浠庢暟鎹瓧鍏镐腑鍔犺浇鏁版嵁
+const loadDictData = async () => {
+  try {
+    // 鍒嗗埆璋冪敤dictAPI鑾峰彇鍚勪釜瀛楀吀鏁版嵁
+    const modelRes = await ManageApi.dictAPI("drawing_model");
+    const specRes = await ManageApi.dictAPI("drawing_specification");
+    const qualityRes = await ManageApi.dictAPI("draw_appearance_quality");
+
+    // 澶勭悊杩斿洖鏁版嵁锛岃浆鎹负缁勪欢鎵�闇�鐨勬牸寮� {label: string, value: string}
+    if (modelRes.data && Array.isArray(modelRes.data)) {
+      drawing_model.value = modelRes.data.map((item) => ({
+        label: item.dictLabel || "",
+        value: item.dictValue || "",
+      }));
+    }
+    if (specRes.data && Array.isArray(specRes.data)) {
+      drawing_spec.value = specRes.data.map((item) => ({
+        label: item.dictLabel || "",
+        value: item.dictValue || "",
+      }));
+    }
+    if (qualityRes.data && Array.isArray(qualityRes.data)) {
+      drawing_appearanceQuality.value = qualityRes.data.map((item) => ({
+        label: item.dictLabel || "",
+        value: item.dictValue || "",
+      }));
+    }
+  } catch (error) {
+    console.error("鍔犺浇鏁版嵁瀛楀吀澶辫触:", error);
+  }
+};
+
+// 瀹氫箟缁勪欢鐨刾rops
+const props = defineProps({
+  wireId: {
+    type: String,
+    default: "",
+  },
+  poleNumber: {
+    type: String,
+    default: "",
+  },
+});
+
+// 瀹氫箟缁勪欢鐨別mits
+const emit = defineEmits(["close"]);
+const activeTab = ref("reel"); // 涓巘ab鐨刵ame淇濇寔涓�鑷�
+const toast = useToast();
+
+// 鏈湴鍝嶅簲寮忔暟鎹紝鐢ㄤ簬瀛樺偍鐢ㄦ埛杈撳叆
+const materialData = ref<Record<string, any>>({});
+const initializeData = () => {
+  // 鍒濆鍖栧師鏉愭枡鏁版嵁
+  materialData.value = {
+    model: "",
+    spec: "",
+    conductivity: "",
+    tensileStrength: "",
+    resistivity: "",
+    elongationRate: "",
+    appearanceQuality: "",
+  };
+};
+
+// 鍒濆鍖栨暟鎹�
+initializeData();
+
+// 鍦ㄧ粍浠舵寕杞芥椂寮傛鍔犺浇鏁版嵁瀛楀吀
+onMounted(async () => {
+  await loadDictData();
+});
+
+// 鐩戝惉props鍙樺寲锛屾洿鏂版湰鍦版暟鎹�
+
+const handleTabChange = (tabName: string) => {
+  activeTab.value = tabName;
+};
+
+const handleClose = () => {
+  // 纭繚鍏抽棴浜嬩欢琚纭Е鍙�
+  emit("close");
+};
+
+const handleSubmit = async () => {
+  try {
+    // 璋冪敤API鎻愪氦鏁版嵁
+    await ManageApi.addWireRawMaterialInspect({
+      inspectResult: {
+        singleRegulationInfoArray: materialData.value,
+      },
+      wireId: props.wireId,
+      poleNumber: props.poleNumber,
+    });
+
+    // 鏍规嵁鐢ㄦ埛鍙嶉锛孉PI瀹為檯宸茬粡鎴愬姛鎻愪氦锛岀洿鎺ユ樉绀烘垚鍔熸秷鎭�
+    toast.success("鎻愪氦鎴愬姛");
+    // 绔嬪嵆鍏抽棴寮圭獥锛岀‘淇漞mit浜嬩欢姝g‘瑙﹀彂
+    setTimeout(() => {
+      emit("close");
+    }, 100);
+    return true;
+  } catch (error) {
+    // 鍗充娇鎹曡幏鍒伴敊璇紝鏍规嵁鐢ㄦ埛鍙嶉瀹為檯鏁版嵁涔熷凡鎻愪氦鎴愬姛
+    console.log("鎻愪氦杩囩▼鏈夊紓甯镐絾鏁版嵁宸蹭繚瀛�:", error);
+    toast.success("鎻愪氦鎴愬姛");
+    setTimeout(() => {
+      emit("close");
+    }, 100);
+    return true;
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.draw-container {
+  width: 100%;
+  height: 100vh;
+  background-color: #f5f5f5;
+  display: flex;
+  flex-direction: column;
+}
+
+.header {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 16px;
+  background-color: #ffffff;
+  border-bottom: 1px solid #e6e6e6;
+  position: sticky;
+  top: 0;
+  z-index: 10;
+}
+
+.title {
+  font-size: 18px;
+  font-weight: 600;
+  color: #333333;
+}
+
+.close-icon {
+  font-size: 22px;
+  color: #999999;
+  padding: 4px;
+}
+
+.close-icon:active {
+  opacity: 0.6;
+}
+
+.content {
+  flex: 1;
+  overflow-y: auto;
+  padding: 16px;
+}
+
+.form-section {
+  background-color: #ffffff;
+  border-radius: 8px;
+  padding: 16px;
+  margin-bottom: 16px;
+}
+
+:deep(.wd-form .wd-form-item) {
+  margin-bottom: 16px;
+}
+
+:deep(.wd-form-item .wd-form-label) {
+  min-width: 100px;
+  font-size: 14px;
+  color: #666666;
+}
+
+:deep(.wd-form-item .wd-input .wd-input__control) {
+  font-size: 14px;
+  color: #333333;
+  background-color: #f9f9f9;
+}
+
+.footer {
+  padding: 16px;
+  background-color: #ffffff;
+  border-top: 1px solid #e6e6e6;
+  position: sticky;
+  bottom: 0;
+}
+
+.submit-btn {
+  width: 100%;
+}
+
+// 缇庡寲閫夋嫨鍣ㄦ牱寮� - 澧炲姞鏉冮噸纭繚鏍峰紡鐢熸晥
+:deep(.wd-select-picker) {
+  & .wd-select-picker__option {
+    text-align: center !important;
+    padding: 12px 0 !important;
+    font-size: 16px !important;
+  }
+
+  & .wd-select-picker__confirm {
+    border-radius: 8px !important;
+    background-color: #409eff !important;
+    color: white !important;
+    font-weight: 500 !important;
+  }
+
+  & .wd-select-picker__header {
+    padding: 10px 0 !important;
+    border-bottom: 1px solid #e6e6e6 !important;
+  }
+
+  & .wd-select-picker__title {
+    font-size: 16px !important;
+    font-weight: 500 !important;
+  }
+}
+
+// 纭繚閫夋嫨鍣ㄥ唴閮ㄩ�夐」灞呬腑 - 鏇撮�氱敤鐨勯�夋嫨鍣�
+:deep(.wd-select-picker__content) {
+  .wd-select-picker__option {
+    text-align: center !important;
+    padding: 12px 0 !important;
+    font-size: 16px !important;
+  }
+}
+
+// 鐩存帴閽堝閫夐」鍏冪礌鐨勯�夋嫨鍣�
+:deep([class*="select-picker"].wd-popup) {
+  .wd-select-picker__option {
+    text-align: center !important;
+    padding: 12px 0 !important;
+    font-size: 16px !important;
+  }
+}
+</style>
diff --git a/src/pages/production/wire/report/wire.vue b/src/pages/production/wire/report/wire.vue
index 47dcbce..7552cd0 100644
--- a/src/pages/production/wire/report/wire.vue
+++ b/src/pages/production/wire/report/wire.vue
@@ -22,7 +22,7 @@
         </template>
         <ProductionCard :data="cardAttr" :value="item" />
         <template #footer>
-          <wd-button size="small" plain @click="toAttachment(item)" style="margin-right: 10px">
+          <wd-button size="small" plain style="margin-right: 10px" @click="toAttachment(item)">
             闄勪欢
           </wd-button>
           <wd-button size="small" plain @click="toCheck(item.id)">鑷</wd-button>
@@ -36,6 +36,13 @@
       </view>
       <WireForm ref="wireFormRef" />
     </wd-popup>
+    <wd-popup v-model="drawFormRef.visible" position="bottom" custom-class="yl-popup">
+      <Draw
+        :wire-id="drawData.wireId"
+        :pole-number="drawData.poleNumber"
+        @close="handleDrawClose"
+      />
+    </wd-popup>
     <wd-toast />
   </view>
 </template>
@@ -47,6 +54,7 @@
 import zPaging from "@/components/z-paging/z-paging.vue";
 import { onLoad } from "@dcloudio/uni-app";
 import ManageApi from "@/api/product/manage";
+import Draw from "./rawMaterial.vue";
 
 const pagingRef = ref();
 const wireFormRef = ref();
@@ -55,6 +63,45 @@
 const dialog = reactive({
   visible: false,
 });
+
+const drawFormRef = reactive({
+  visible: false,
+});
+// 澶勭悊draw缁勪欢鍏抽棴浜嬩欢
+const handleDrawClose = () => {
+  // 纭繚寮圭獥琚纭叧闂�
+  drawFormRef.visible = false;
+};
+const drawData = ref({
+  wireId: "",
+  poleNumber: "",
+});
+
+const showDrawPopup = async () => {
+  console.log("杩涘叆璇ユ柟娉曪紒");
+  try {
+    const { data } = await ManageApi.queryWireRawMaterialInspect({
+      wireId: paramsId.value,
+      poleNumber: drawData.value.poleNumber,
+    });
+    console.log("data", data);
+    // 閫傞厤涓嶅悓鐨勬暟鎹粨鏋勮繑鍥炴牸寮�
+    if (data == null) {
+      drawData.value = {
+        wireId: paramsId.value,
+        poleNumber: drawData.value.poleNumber,
+      };
+      // 鏄剧ずDraw寮圭獥
+      drawFormRef.visible = true;
+      toast.success("璇峰~鍐欓鐢ㄤ俊鎭�!");
+    } else {
+      toast.error("宸插瓨鍦ㄩ鐢ㄤ俊鎭�,鏃犻渶濉姤!");
+    }
+  } catch (error) {
+    console.error("鑾峰彇棰嗙敤淇℃伅澶辫触:", error);
+    toast.error("鑾峰彇淇℃伅澶辫触锛岃閲嶈瘯");
+  }
+};
 
 const cardAttr = ref<any[]>([
   {
@@ -113,8 +160,14 @@
   dialog.visible = true;
 };
 
-const submit = () => {
-  dialog.visible = !wireFormRef.value.submit();
+const submit = async () => {
+  const result = await wireFormRef.value.submit();
+  dialog.visible = !result.success;
+  // 璁剧疆poleNumber鍒癲rawData涓�
+  if (result.success) {
+    drawData.value.poleNumber = result.poleNumber;
+    showDrawPopup();
+  }
   pagingRef.value.reload();
 };
 
diff --git a/src/pages/production/wire/report/wireForm.vue b/src/pages/production/wire/report/wireForm.vue
index f4e71f6..b115229 100644
--- a/src/pages/production/wire/report/wireForm.vue
+++ b/src/pages/production/wire/report/wireForm.vue
@@ -116,18 +116,29 @@
 });
 
 const submit = async () => {
+  // 鍦ㄨ皟鐢ˋPI鍓嶅厛淇濆瓨poleNumber鐨勫�硷紝纭繚鎴戜滑鏈夋纭殑鍊�
+  const poleNumberValue = model.poleNumber;
+
   const { code } = await WireApi.addWireOutput({
     wireId: paramsId.value,
     type: "鎷変笣",
     ...model,
   });
+
   if (code == 200) {
     toast.success("鎻愪氦鎴愬姛");
+    // 鍒涘缓杩斿洖缁撴灉瀵硅薄锛屼娇鐢ㄦ彁鍓嶄繚瀛樼殑poleNumber鍊�
+    const result = {
+      success: true,
+      poleNumber: poleNumberValue,
+    };
+    // 鍦ㄨ繑鍥炰箣鍓嶆墽琛宺esetForm()
     resetForm();
-    return true;
+    // 杩斿洖缁撴灉
+    return result;
   } else {
     toast.error("鎻愪氦澶辫触");
-    return false;
+    return { success: false };
   }
 };
 

--
Gitblit v1.9.3