From da7c76e6a45796f9b3952a1e18481600837502ed Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 23 三月 2026 15:10:01 +0800
Subject: [PATCH] 新增报工产量信息计算,报工表格白班夜班区分

---
 src/views/productionManagement/productionReporting/index.vue           |   42 ++++++++-----
 src/views/productionManagement/productionReporting/reportingDialog.vue |  110 ++++++++++++++++++++++++++++--------
 2 files changed, 110 insertions(+), 42 deletions(-)

diff --git a/src/views/productionManagement/productionReporting/index.vue b/src/views/productionManagement/productionReporting/index.vue
index a919973..08fc2a6 100644
--- a/src/views/productionManagement/productionReporting/index.vue
+++ b/src/views/productionManagement/productionReporting/index.vue
@@ -11,11 +11,19 @@
                     @keyup.enter="handleQuery" />
         </el-form-item>
         <el-form-item label="鐝粍:">
-          <el-input v-model="searchForm.teamName"
-                    placeholder="璇疯緭鍏�"
-                    clearable
-                    style="width: 160px;"
-                    @keyup.enter="handleQuery" />
+          <el-select v-model="searchForm.teamName"
+                     placeholder="璇烽�夋嫨"
+                     clearable
+                     style="width: 160px;"
+                     @keyup.enter="handleQuery">
+            <el-option label="鐧界彮"
+                       value="鐧界彮" />
+            <el-option label="澶滅彮"
+                       value="澶滅彮" />
+          </el-select>
+          <!-- <el-input v-model="searchForm.teamName"
+                    placeholder="璇疯緭鍏�""
+                    @keyup.enter="handleQuery" /> -->
         </el-form-item>
         <el-form-item label="浜у搧鍚嶇О:">
           <el-input v-model="searchForm.productName"
@@ -80,13 +88,15 @@
     {
       label: "鐢熶骇璁㈠崟鍙�",
       prop: "orderNo",
-      width: "150px",
     },
     {
       label: "鐝粍",
       prop: "teamName",
       width: "120px",
       dataType: "tag",
+      formatType: params => {
+        return params === "鐧界彮" ? "primary" : "warning";
+      },
     },
     {
       label: "浜у搧缂栫爜",
@@ -189,7 +199,7 @@
     {
       id: 1,
       orderNo: "PO202401001",
-      teamName: "鐢熶骇涓�缁�",
+      teamName: "鐧界彮",
       materialCode: "PC001",
       productName: "鏍囧噯鐮屽潡",
       specification: "600脳240脳200",
@@ -202,7 +212,7 @@
     {
       id: 2,
       orderNo: "PO202401002",
-      teamName: "鐢熶骇浜岀粍",
+      teamName: "澶滅彮",
       materialCode: "PC002",
       productName: "鏍囧噯鐮屽潡",
       specification: "600脳240脳200",
@@ -215,7 +225,7 @@
     {
       id: 3,
       orderNo: "PO202401003",
-      teamName: "鐢熶骇涓夌粍",
+      teamName: "鐧界彮",
       materialCode: "PC003",
       productName: "鍔犳皵鐮屽潡",
       specification: "600脳240脳250",
@@ -228,7 +238,7 @@
     {
       id: 4,
       orderNo: "PO202401004",
-      teamName: "鐢熶骇涓�缁�",
+      teamName: "鐧界彮",
       materialCode: "PC004",
       productName: "鏍囧噯鐮屽潡",
       specification: "600脳240脳200",
@@ -241,7 +251,7 @@
     {
       id: 5,
       orderNo: "PO202401005",
-      teamName: "鐢熶骇浜岀粍",
+      teamName: "澶滅彮",
       materialCode: "PC005",
       productName: "鍔犳皵鐮屽潡",
       specification: "600脳240脳250",
@@ -254,7 +264,7 @@
     {
       id: 6,
       orderNo: "PO202401006",
-      teamName: "鐢熶骇涓夌粍",
+      teamName: "鐧界彮",
       materialCode: "PC006",
       productName: "鏍囧噯鐮屽潡",
       specification: "600脳240脳200",
@@ -267,7 +277,7 @@
     {
       id: 7,
       orderNo: "PO202401007",
-      teamName: "鐢熶骇涓�缁�",
+      teamName: "鐧界彮",
       materialCode: "PC007",
       productName: "鍔犳皵鐮屽潡",
       specification: "600脳240脳250",
@@ -280,7 +290,7 @@
     {
       id: 8,
       orderNo: "PO202401008",
-      teamName: "鐢熶骇浜岀粍",
+      teamName: "澶滅彮",
       materialCode: "PC008",
       productName: "鏍囧噯鐮屽潡",
       specification: "600脳240脳200",
@@ -293,7 +303,7 @@
     {
       id: 9,
       orderNo: "PO202401009",
-      teamName: "鐢熶骇涓夌粍",
+      teamName: "鐧界彮",
       materialCode: "PC009",
       productName: "鍔犳皵鐮屽潡",
       specification: "600脳240脳250",
@@ -306,7 +316,7 @@
     {
       id: 10,
       orderNo: "PO202401010",
-      teamName: "鐢熶骇涓�缁�",
+      teamName: "鐧界彮",
       materialCode: "PC010",
       productName: "鏍囧噯鐮屽潡",
       specification: "600脳240脳200",
diff --git a/src/views/productionManagement/productionReporting/reportingDialog.vue b/src/views/productionManagement/productionReporting/reportingDialog.vue
index 9b8b107..1c8ad3f 100644
--- a/src/views/productionManagement/productionReporting/reportingDialog.vue
+++ b/src/views/productionManagement/productionReporting/reportingDialog.vue
@@ -117,19 +117,6 @@
                         v-model="form.npsNo"
                         class="form-input" />
             </el-form-item>
-            <el-form-item label="鐝粍"
-                          prop="teamName"
-                          required
-                          class="form-item">
-              <el-select v-model="form.teamName"
-                         placeholder="璇烽�夋嫨鐝粍"
-                         class="form-select">
-                <el-option label="鐧界彮"
-                           value="鐧界彮" />
-                <el-option label="澶滅彮"
-                           value="澶滅彮" />
-              </el-select>
-            </el-form-item>
             <el-form-item label="浜у搧缂栫爜"
                           prop="materialCode"
                           class="form-item">
@@ -151,6 +138,28 @@
                         v-model="form.specification"
                         class="form-input" />
             </el-form-item>
+            <el-form-item label="鍒涘缓鏃堕棿"
+                          prop="createTime"
+                          class="form-item">
+              <el-date-picker disabled
+                              v-model="form.createTime"
+                              type="datetime"
+                              placeholder="璇烽�夋嫨鍒涘缓鏃堕棿"
+                              class="form-input" />
+            </el-form-item>
+            <el-form-item label="鐝粍"
+                          prop="teamName"
+                          required
+                          class="form-item">
+              <el-select v-model="form.teamName"
+                         placeholder="璇烽�夋嫨鐝粍"
+                         class="form-select">
+                <el-option label="鐧界彮"
+                           value="鐧界彮" />
+                <el-option label="澶滅彮"
+                           value="澶滅彮" />
+              </el-select>
+            </el-form-item>
             <el-form-item label="鍒涘缓浜�"
                           prop="createBy"
                           required
@@ -164,15 +173,6 @@
                            :label="user.nickName || user.userName"
                            :value="user.nickName || user.userName" />
               </el-select>
-            </el-form-item>
-            <el-form-item label="鍒涘缓鏃堕棿"
-                          prop="createTime"
-                          class="form-item">
-              <el-date-picker disabled
-                              v-model="form.createTime"
-                              type="datetime"
-                              placeholder="璇烽�夋嫨鍒涘缓鏃堕棿"
-                              class="form-input" />
             </el-form-item>
           </div>
         </el-form>
@@ -357,6 +357,9 @@
                                       :key="param.id"
                                       :label="param.paramName"
                                       :label-width="120"
+                                      :required="param.isRequired"
+                                      :prop="`paramGroups.${activeProcessId}.${index}.${param.id}`"
+                                      :rules="param.isRequired ? [{ required: true, message: `璇疯緭鍏�${param.paramName}`, trigger: 'blur' }] : []"
                                       class="param-item">
                           <template v-if="param.paramType == '1'">
                             <!-- 鏁板瓧绫诲瀷 -->
@@ -454,8 +457,10 @@
                     <!-- 鍙傛暟鍒� -->
                     <el-table-column v-for="param in params"
                                      :key="param.id"
-                                     :label="param.paramName"
-                                     min-width="200">
+                                     :min-width="200">
+                      <template #header>
+                        <span :class="{ 'required-label': param.isRequired }">{{ param.paramName }}</span>
+                      </template>
                       <template #default="{ row }">
                         <template v-if="param.paramType == '1'">
                           <!-- 鏁板瓧绫诲瀷 -->
@@ -560,6 +565,7 @@
                 <el-input-number v-model="form.outputVolume"
                                  :min="0"
                                  :precision="2"
+                                 @change="handleVolumeChange"
                                  class="volume-input" />
                 <span class="volume-unit">鏂�</span>
               </div>
@@ -572,6 +578,7 @@
                 <el-input-number v-model="form.unqualifiedVolume"
                                  :min="0"
                                  :precision="2"
+                                 @change="handleVolumeChange"
                                  class="volume-input" />
                 <span class="volume-unit">鏂�</span>
               </div>
@@ -658,7 +665,7 @@
     id: data.id || undefined,
     orderId: data.orderId || "",
     npsNo: data.npsNo || "",
-    teamName: data.teamName || "",
+    teamName: data.teamName || "鐧界彮",
     materialCode: data.materialCode || "",
     productName: data.productName || "",
     specification: data.specification || "",
@@ -695,6 +702,9 @@
       .finally(() => {
         orderLoading.value = false;
       });
+  };
+  const handleVolumeChange = () => {
+    form.completedVolume = form.outputVolume - form.unqualifiedVolume;
   };
 
   // 澶勭悊鐢熶骇璁㈠崟閫夋嫨
@@ -926,7 +936,48 @@
         }
       });
     } else if (activeStep.value === 2) {
-      // 绗笁姝ワ細鐩存帴杩涘叆绗洓姝�
+      // 绗笁姝ワ細楠岃瘉鍙傛暟蹇呭~椤�
+      let isValid = true;
+      let errorMessage = "";
+
+      // 閬嶅巻鎵�鏈夊伐搴�
+      for (const process of processList.value) {
+        const processId = process.processId;
+        const paramGroups = form.paramGroups[processId] || [];
+        const processParams = process.orderRouteItemParaVos || [];
+
+        // 鑾峰彇蹇呭~鍙傛暟
+        const requiredParams = processParams.filter(p => p.isRequired);
+
+        if (requiredParams.length > 0) {
+          // 妫�鏌ユ瘡涓弬鏁扮粍涓殑蹇呭~鍙傛暟
+          for (
+            let groupIndex = 0;
+            groupIndex < paramGroups.length;
+            groupIndex++
+          ) {
+            const group = paramGroups[groupIndex];
+            for (const param of requiredParams) {
+              const value = group[param.id];
+              if (value === undefined || value === null || value === "") {
+                isValid = false;
+                errorMessage = `宸ュ簭銆�${process.processName}銆戝弬鏁扮粍${
+                  groupIndex + 1
+                }鐨勩��${param.paramName}銆戜负蹇呭~椤筦;
+                break;
+              }
+            }
+            if (!isValid) break;
+          }
+        }
+        if (!isValid) break;
+      }
+
+      if (!isValid) {
+        ElMessage.error(errorMessage);
+        return;
+      }
+
       activeStep.value = 3;
     }
   };
@@ -1220,6 +1271,13 @@
     white-space: nowrap;
   }
 
+  /* 蹇呭~鏍囪瘑鏍峰紡 */
+  .required-label::before {
+    content: "*";
+    color: #f56c6c;
+    margin-right: 4px;
+  }
+
   .form-grid {
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));

--
Gitblit v1.9.3