From fc940d1939db4b832f2fad50aeea1cdeb4a638f3 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 26 三月 2026 12:00:25 +0800
Subject: [PATCH] 报工页面改为两列

---
 src/views/productionManagement/workOrder/index.vue |  120 +++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 79 insertions(+), 41 deletions(-)

diff --git a/src/views/productionManagement/workOrder/index.vue b/src/views/productionManagement/workOrder/index.vue
index 3b193f8..b6c4300 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)"
@@ -170,47 +182,57 @@
     </el-dialog>
     <el-dialog v-model="reportDialogVisible"
                title="鎶ュ伐"
-               width="500px">
+               width="800px">
       <el-form ref="reportFormRef"
                :model="reportForm"
                :rules="reportFormRules"
                label-width="120px">
-        <el-form-item label="寰呯敓浜ф暟閲�">
-          <el-input v-model="reportForm.planQuantity"
-                    readonly
-                    style="width: 300px"/>
-        </el-form-item>
-        <el-form-item label="鏈鐢熶骇鏁伴噺" prop="quantity">
-          <el-input v-model.number="reportForm.quantity"
-                    type="number"
-                    min="1"
-                    step="1"
-                    style="width: 300px"
-                    placeholder="璇疯緭鍏ユ湰娆$敓浜ф暟閲�"
-                    @input="handleQuantityInput"/>
-        </el-form-item>
-        <el-form-item label="鎶ュ簾鏁伴噺" prop="scrapQty">
-          <el-input v-model.number="reportForm.scrapQty"
-                    type="number"
-                    min="0"
-                    step="1"
-                    style="width: 300px"
-                    placeholder="璇疯緭鍏ユ姤搴熸暟閲�"
-                    @input="handleScrapQtyInput"/>
-        </el-form-item>
-        <el-form-item label="鐝粍淇℃伅">
-          <el-select v-model="reportForm.userId"
-                     style="width: 300px"
-                     placeholder="璇烽�夋嫨鐝粍淇℃伅"
-                     clearable
-                     filterable
-                     @change="handleUserChange">
-            <el-option v-for="user in userOptions"
-                       :key="user.userId"
-                       :label="user.userName"
-                       :value="user.userId"/>
-          </el-select>
-        </el-form-item>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="寰呯敓浜ф暟閲�">
+              <el-input v-model="reportForm.planQuantity"
+                        readonly
+                        style="width: 100%"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鏈鐢熶骇鏁伴噺" prop="quantity">
+              <el-input v-model.number="reportForm.quantity"
+                        type="number"
+                        min="1"
+                        step="1"
+                        style="width: 100%"
+                        placeholder="璇疯緭鍏ユ湰娆$敓浜ф暟閲�"
+                        @input="handleQuantityInput"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鎶ュ簾鏁伴噺" prop="scrapQty">
+              <el-input v-model.number="reportForm.scrapQty"
+                        type="number"
+                        min="0"
+                        step="1"
+                        style="width: 100%"
+                        placeholder="璇疯緭鍏ユ姤搴熸暟閲�"
+                        @input="handleScrapQtyInput"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鐝粍淇℃伅">
+              <el-select v-model="reportForm.userId"
+                         style="width: 100%"
+                         placeholder="璇烽�夋嫨鐝粍淇℃伅"
+                         clearable
+                         filterable
+                         @change="handleUserChange">
+                <el-option v-for="user in userOptions"
+                           :key="user.userId"
+                           :label="user.userName"
+                           :value="user.userId"/>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
         <ProductionRecordForm ref="productionRecordFormRef" :list="processParamList"/>
       </el-form>
       <template #footer>
@@ -460,6 +482,13 @@
   ]
 };
 
+const rowClassName = ({row}) => {
+  if (Number(row.completionStatus) > 0 && Number(row.actualQualifiedRate) < Number(row.processQualifiedRate)) {
+    return 'danger-row';
+  }
+  return '';
+};
+
 // 澶勭悊鏈鐢熶骇鏁伴噺杈撳叆锛岄檺鍒跺繀椤诲ぇ浜庣瓑浜�1
 const handleQuantityInput = (value) => {
   if (value === '' || value === null || value === undefined) {
@@ -523,6 +552,7 @@
 const data = reactive({
   searchForm: {
     workOrderNo: "",
+    productOrderNpsNo: "",
   },
 });
 const {searchForm} = toRefs(data);
@@ -709,7 +739,10 @@
 
 const handleReport = async () => {
   const data = await productionRecordFormRef.value.submitData()
-  reportForm.otherData.rows = JSON.stringify(data || {});
+  if (!data) {
+    return;
+  }
+  reportForm.otherData.rows = data || [];
   reportFormRef.value?.validate((valid) => {
     if (!valid) {
       return false;
@@ -761,7 +794,8 @@
     const submitData = {
       ...reportForm,
       quantity: quantity,
-      scrapQty: scrapQty
+      scrapQty: scrapQty,
+      otherData: JSON.stringify(reportForm.otherData)
     };
 
     // console.log(submitData);
@@ -874,7 +908,11 @@
 }
 </style>
 
-<style lang="scss">
+<style lang="scss" scoped>
+:deep(.danger-row td) {
+  color: #e95a66 !important;
+}
+
 @media print {
   @page {
     size: landscape;
@@ -958,4 +996,4 @@
     height: 140px !important;
   }
 }
-</style>
+</style>
\ No newline at end of file

--
Gitblit v1.9.3