From a1f37f9b5be8978fce0cd670f4e455e2fb2c6d9b Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期二, 24 三月 2026 14:54:37 +0800
Subject: [PATCH] 生产工单加上生产订单搜索框

---
 src/views/productionManagement/workOrder/index.vue |   74 ++++++++++++++++++++++++++++++++++--
 1 files changed, 69 insertions(+), 5 deletions(-)

diff --git a/src/views/productionManagement/workOrder/index.vue b/src/views/productionManagement/workOrder/index.vue
index da42a3f..3fcfea6 100644
--- a/src/views/productionManagement/workOrder/index.vue
+++ b/src/views/productionManagement/workOrder/index.vue
@@ -12,6 +12,17 @@
                     clearable
                     prefix-icon="Search"/>
         </div>
+
+        <div class="search-item">
+          <span class="search_title">鐢熶骇璁㈠崟鍙凤細</span>
+          <el-input v-model="searchForm.productOrderNpsNo"
+                    style="width: 240px"
+                    placeholder="璇疯緭鍏�"
+                    @change="handleQuery"
+                    clearable
+                    prefix-icon="Search"/>
+        </div>
+
         <div class="search-item">
           <el-button type="primary"
                      @click="handleQuery">鎼滅储
@@ -25,6 +36,7 @@
                 :tableData="tableData"
                 :page="page"
                 :tableLoading="tableLoading"
+                :rowClassName="rowClassName"
                 @pagination="pagination">
         <template #completionStatus="{ row }">
           <el-progress :percentage="toProgressPercentage(row?.completionStatus)"
@@ -211,6 +223,7 @@
                        :value="user.userId"/>
           </el-select>
         </el-form-item>
+        <ProductionRecordForm ref="productionRecordFormRef" :list="processParamList"/>
       </el-form>
       <template #footer>
         <span class="dialog-footer">
@@ -233,6 +246,12 @@
         :isEdit="true"
         :row="currentReportRowData"
         @refreshData="getList"/>
+    <GranulationForm
+        v-if="granulationFormVisible"
+        v-model:isShow="granulationFormVisible"
+        :isEdit="true"
+        :row="currentReportRowData"
+        @refreshData="getList"/>
   </div>
 </template>
 
@@ -250,12 +269,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: "浼樺厛绾�",
@@ -277,7 +301,7 @@
   //   width: "80",
   // },
   {
-    label: "宸ュ崟缂栧彿",
+    label: "宸ュ崟缂栧彿1",
     prop: "workOrderNo",
     width: "140",
   },
@@ -383,6 +407,7 @@
 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("");
@@ -401,7 +426,11 @@
   productProcessRouteItemId: "",
   userId: "",
   productMainId: null,
+  otherData: {
+    rows: [],
+  }
 });
+const productionRecordFormRef = ref();
 
 // 鏈鐢熶骇鏁伴噺楠岃瘉瑙勫垯
 const validateQuantity = (rule, value, callback) => {
@@ -441,6 +470,13 @@
   scrapQty: [
     {validator: validateScrapQty, trigger: 'blur'}
   ]
+};
+
+const rowClassName = ({row}) => {
+  if (Number(row.completionStatus) > 0 && Number(row.actualQualifiedRate) < Number(row.processQualifiedRate)) {
+    return 'danger-row';
+  }
+  return '';
 };
 
 // 澶勭悊鏈鐢熶骇鏁伴噺杈撳叆锛岄檺鍒跺繀椤诲ぇ浜庣瓑浜�1
@@ -506,6 +542,7 @@
 const data = reactive({
   searchForm: {
     workOrderNo: "",
+    productOrderNpsNo: "",
   },
 });
 const {searchForm} = toRefs(data);
@@ -631,7 +668,22 @@
       });
 };
 
-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 === '鍗伴摐' || row.processName === '鍗伴摱') {
     copperPrintingFormVisible.value = true
@@ -641,6 +693,11 @@
     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;
@@ -670,7 +727,9 @@
   workOrderFilesRef.value?.openDialog(row);
 };
 
-const handleReport = () => {
+const handleReport = async () => {
+  const data = await productionRecordFormRef.value.submitData()
+  reportForm.otherData.rows = data || [];
   reportFormRef.value?.validate((valid) => {
     if (!valid) {
       return false;
@@ -722,7 +781,8 @@
     const submitData = {
       ...reportForm,
       quantity: quantity,
-      scrapQty: scrapQty
+      scrapQty: scrapQty,
+      otherData: JSON.stringify(reportForm.otherData)
     };
 
     // console.log(submitData);
@@ -835,7 +895,11 @@
 }
 </style>
 
-<style lang="scss">
+<style lang="scss" scoped>
+:deep(.danger-row td) {
+  color: #e95a66 !important;
+}
+
 @media print {
   @page {
     size: landscape;

--
Gitblit v1.9.3