From 74f21d10c2f29e4631ff1c17d07e3bd6b73ca0b8 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期五, 20 三月 2026 17:54:14 +0800
Subject: [PATCH] 造粒报工

---
 src/views/productionManagement/workOrder/index.vue |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 55 insertions(+), 4 deletions(-)

diff --git a/src/views/productionManagement/workOrder/index.vue b/src/views/productionManagement/workOrder/index.vue
index 2750dba..3b193f8 100644
--- a/src/views/productionManagement/workOrder/index.vue
+++ b/src/views/productionManagement/workOrder/index.vue
@@ -211,6 +211,7 @@
                        :value="user.userId"/>
           </el-select>
         </el-form-item>
+        <ProductionRecordForm ref="productionRecordFormRef" :list="processParamList"/>
       </el-form>
       <template #footer>
         <span class="dialog-footer">
@@ -224,6 +225,18 @@
     <CopperPrintingForm
         v-if="copperPrintingFormVisible"
         v-model:isShow="copperPrintingFormVisible"
+        :isEdit="true"
+        :row="currentReportRowData"
+        @refreshData="getList"/>
+    <VoltageSortingForm
+        v-if="voltageSortingFormVisible"
+        v-model:isShow="voltageSortingFormVisible"
+        :isEdit="true"
+        :row="currentReportRowData"
+        @refreshData="getList"/>
+    <GranulationForm
+        v-if="granulationFormVisible"
+        v-model:isShow="granulationFormVisible"
         :isEdit="true"
         :row="currentReportRowData"
         @refreshData="getList"/>
@@ -244,11 +257,17 @@
 import QRCode from "qrcode";
 import {getCurrentInstance, reactive, toRefs} from "vue";
 import FilesDia from "./components/filesDia.vue";
+import {
+  listPage as listProcessParamPage,
+} from "@/api/productionManagement/productProcessParameter.js";
 
 const {proxy} = getCurrentInstance();
 const {priority_type} = proxy.useDict("priority_type");
 
 const CopperPrintingForm = defineAsyncComponent(() => import("./components/CopperPrintingForm.vue"));
+const VoltageSortingForm = defineAsyncComponent(() => import("./components/VoltageSortingForm.vue"));
+const ProductionRecordForm = defineAsyncComponent(() => import("./components/ProductionRecordForm.vue"));
+const GranulationForm = defineAsyncComponent(() => import("./components/GranulationForm.vue"));
 const tableColumn = ref([
   {
     label: "浼樺厛绾�",
@@ -364,7 +383,7 @@
         clickFun: row => {
           showReportDialog(row);
         },
-        disabled: row => row.planQuantity <= 0,
+        disabled: row => !row.isCanReport || row.planQuantity <= 0,
       },
     ],
   },
@@ -375,6 +394,8 @@
 const qrRowData = ref(null);
 const editDialogVisible = ref(false);
 const copperPrintingFormVisible = ref(false);
+const voltageSortingFormVisible = ref(false);
+const granulationFormVisible = ref(false);
 const transferCardVisible = ref(false);
 const transferCardData = ref([]);
 const transferCardQrUrl = ref("");
@@ -393,7 +414,11 @@
   productProcessRouteItemId: "",
   userId: "",
   productMainId: null,
+  otherData: {
+    rows: [],
+  }
 });
+const productionRecordFormRef = ref();
 
 // 鏈鐢熶骇鏁伴噺楠岃瘉瑙勫垯
 const validateQuantity = (rule, value, callback) => {
@@ -623,12 +648,36 @@
       });
 };
 
-const showReportDialog = row => {
+const processParamPage = reactive({
+  current: 1,
+  size: 9999,
+  total: 0,
+});
+const getProcessParamList = async (row) => {
+  const params = {
+    processId: row.processId,
+    ...processParamPage,
+  };
+  const res = await listProcessParamPage(params)
+  return res.data.records
+};
+
+const processParamList = ref([])
+const showReportDialog = async row => {
   currentReportRowData.value = row;
-  if (row.processName === '鍗伴摐') {
+  if (row.processName === '鍗伴摐' || row.processName === '鍗伴摱') {
     copperPrintingFormVisible.value = true
     return
   }
+  if (row.processName === '鐢靛帇鍒嗛��') {
+    voltageSortingFormVisible.value = true
+    return;
+  }
+  if (row.processName === '閫犵矑') {
+    granulationFormVisible.value = true
+    return;
+  }
+  processParamList.value = await getProcessParamList(row)
   reportForm.planQuantity = row.planQuantity;
   reportForm.quantity = row.quantity !== undefined && row.quantity !== null ? row.quantity : null;
   reportForm.productProcessRouteItemId = row.productProcessRouteItemId;
@@ -658,7 +707,9 @@
   workOrderFilesRef.value?.openDialog(row);
 };
 
-const handleReport = () => {
+const handleReport = async () => {
+  const data = await productionRecordFormRef.value.submitData()
+  reportForm.otherData.rows = JSON.stringify(data || {});
   reportFormRef.value?.validate((valid) => {
     if (!valid) {
       return false;

--
Gitblit v1.9.3