From 6eb2429eafd0ed40bf10df64258bc541d8b16512 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期二, 24 三月 2026 14:06:29 +0800
Subject: [PATCH] 实际合格率低于【合格率】时,每个【生产工单】、【生产报工】台账需要标红显示

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

diff --git a/src/views/productionManagement/workOrder/index.vue b/src/views/productionManagement/workOrder/index.vue
index 901a7dc..cc1d6e3 100644
--- a/src/views/productionManagement/workOrder/index.vue
+++ b/src/views/productionManagement/workOrder/index.vue
@@ -25,6 +25,7 @@
                 :tableData="tableData"
                 :page="page"
                 :tableLoading="tableLoading"
+                :rowClassName="rowClassName"
                 @pagination="pagination">
         <template #completionStatus="{ row }">
           <el-progress :percentage="toProgressPercentage(row?.completionStatus)"
@@ -234,6 +235,12 @@
         :isEdit="true"
         :row="currentReportRowData"
         @refreshData="getList"/>
+    <GranulationForm
+        v-if="granulationFormVisible"
+        v-model:isShow="granulationFormVisible"
+        :isEdit="true"
+        :row="currentReportRowData"
+        @refreshData="getList"/>
   </div>
 </template>
 
@@ -261,6 +268,7 @@
 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: "浼樺厛绾�",
@@ -282,7 +290,7 @@
   //   width: "80",
   // },
   {
-    label: "宸ュ崟缂栧彿",
+    label: "宸ュ崟缂栧彿1",
     prop: "workOrderNo",
     width: "140",
   },
@@ -388,6 +396,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("");
@@ -450,6 +459,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
@@ -665,6 +681,10 @@
     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;
@@ -697,7 +717,7 @@
 
 const handleReport = async () => {
   const data = await productionRecordFormRef.value.submitData()
-  reportForm.otherData.rows = JSON.stringify(data || {});
+  reportForm.otherData.rows = data || [];
   reportFormRef.value?.validate((valid) => {
     if (!valid) {
       return false;
@@ -749,7 +769,8 @@
     const submitData = {
       ...reportForm,
       quantity: quantity,
-      scrapQty: scrapQty
+      scrapQty: scrapQty,
+      otherData: JSON.stringify(reportForm.otherData)
     };
 
     // console.log(submitData);
@@ -862,7 +883,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