From 3dee44aee9e5b8b55b5b8c2dd577042a35a24c66 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期一, 23 三月 2026 16:53:55 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_银川_中盛建材' into dev_银川_中盛建材

---
 src/views/costAccounting/stdVsActCostAnalysis/index.vue                |  133 ++++++++++++++----
 src/views/productionManagement/productionReporting/index.vue           |   42 +++--
 src/views/costAccounting/productionCostAccounting/index.vue            |   94 +-----------
 src/views/productionManagement/productionReporting/reportingDialog.vue |  110 ++++++++++++---
 4 files changed, 224 insertions(+), 155 deletions(-)

diff --git a/src/views/costAccounting/productionCostAccounting/index.vue b/src/views/costAccounting/productionCostAccounting/index.vue
index 8fc60c2..6efd289 100644
--- a/src/views/costAccounting/productionCostAccounting/index.vue
+++ b/src/views/costAccounting/productionCostAccounting/index.vue
@@ -100,13 +100,9 @@
           <div class="kpi-label">鎬荤敓浜ф垚鏈�</div>
           <div class="kpi-value">楼{{ formatMoney(overview.totalCost) }}</div>
         </div>
-        <div class="kpi-item kpi-raw">
-          <div class="kpi-label">鍘熸枡鎴愭湰</div>
-          <div class="kpi-value">楼{{ formatMoney(overview.rawCost) }}</div>
-        </div>
-        <div class="kpi-item kpi-aux">
-          <div class="kpi-label">杈呮枡鎴愭湰</div>
-          <div class="kpi-value">楼{{ formatMoney(overview.auxCost) }}</div>
+        <div class="kpi-item kpi-avg">
+          <div class="kpi-label">姣忚鍗曞钩鍧囨垚鏈�</div>
+          <div class="kpi-value">楼{{ formatMoney(overview.avgCostPerOrder) }}</div>
         </div>
         <div class="kpi-item kpi-order">
           <div class="kpi-label">璁㈠崟鏁伴噺</div>
@@ -125,17 +121,7 @@
           </template>
           <el-table :data="categorySummary" stripe class="lux-table" height="260">
             <el-table-column prop="category" label="浜у搧绫诲埆" min-width="140" />
-            <el-table-column prop="rawCost" label="鍘熸枡鎴愭湰(鍏�)" align="right">
-              <template #default="scope">
-                <span class="price-value">{{ formatMoney(scope.row.rawCost) }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column prop="auxCost" label="杈呮枡鎴愭湰(鍏�)" align="right">
-              <template #default="scope">
-                <span class="price-value">{{ formatMoney(scope.row.auxCost) }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column prop="totalCost" label="鎬绘垚鏈�(鍏�)" align="right">
+            <el-table-column prop="totalCost" label="鎴愭湰(鍏�)" align="right">
               <template #default="scope">
                 <span class="cost-value">楼{{ formatMoney(scope.row.totalCost) }}</span>
               </template>
@@ -175,17 +161,7 @@
         <el-table-column prop="timeLabel" :label="timeColumnLabel" min-width="110" />
         <el-table-column prop="category" label="浜у搧绫诲埆" min-width="120" />
         <el-table-column prop="orderNo" label="鐢熶骇璁㈠崟" min-width="150" />
-        <el-table-column prop="rawCost" label="鍘熸枡鎴愭湰(鍏�)" align="right">
-          <template #default="scope">
-            <span class="price-value">{{ formatMoney(scope.row.rawCost) }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column prop="auxCost" label="杈呮枡鎴愭湰(鍏�)" align="right">
-          <template #default="scope">
-            <span class="price-value">{{ formatMoney(scope.row.auxCost) }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column prop="totalCost" label="鎬绘垚鏈�(鍏�)" align="right">
+        <el-table-column prop="totalCost" label="鎴愭湰(鍏�)" align="right">
           <template #default="scope">
             <span class="cost-value">楼{{ formatMoney(scope.row.totalCost) }}</span>
           </template>
@@ -234,16 +210,6 @@
       </div>
       <el-table :data="detailMaterials" class="lux-table" stripe>
         <el-table-column prop="materialName" label="鐗╂枡鍚嶇О" min-width="120" />
-        <el-table-column prop="materialType" label="绫诲瀷" width="94">
-          <template #default="scope">
-            <span
-              class="material-type-tag"
-              :class="scope.row.materialType === '鍘熸枡' ? 'is-raw' : 'is-aux'"
-            >
-              {{ scope.row.materialType }}
-            </span>
-          </template>
-        </el-table-column>
         <el-table-column prop="quantity" label="鎶曞叆閲�" align="right" min-width="140">
           <template #default="scope">
             <span class="quantity-cell">
@@ -264,16 +230,8 @@
         </el-table-column>
       </el-table>
       <div class="drawer-foot">
-        <div class="foot-item">
-          <span class="foot-label">鍘熸枡</span>
-          <span class="foot-value no-wrap-money">楼{{ formatMoney(detailRawCost) }}</span>
-        </div>
-        <div class="foot-item">
-          <span class="foot-label">杈呮枡</span>
-          <span class="foot-value no-wrap-money">楼{{ formatMoney(detailAuxCost) }}</span>
-        </div>
         <div class="foot-item total">
-          <span class="foot-label">鍚堣</span>
+          <span class="foot-label">鎴愭湰鍚堣</span>
           <span class="foot-value no-wrap-money">楼{{ formatMoney(detailTotalCost) }}</span>
         </div>
       </div>
@@ -402,15 +360,11 @@
     const key = keyFn(item);
     if (!map.has(key)) {
       map.set(key, {
-        rawCost: 0,
-        auxCost: 0,
         totalCost: 0,
         materials: [],
       });
     }
     const bucket = map.get(key);
-    if (item.materialType === "鍘熸枡") bucket.rawCost += item.cost;
-    if (item.materialType === "杈呮枡") bucket.auxCost += item.cost;
     bucket.totalCost += item.cost;
     bucket.materials.push(item);
   }
@@ -433,8 +387,6 @@
       timeLabel,
       category,
       orderNo,
-      rawCost: val.rawCost,
-      auxCost: val.auxCost,
       totalCost: val.totalCost,
       materials: val.materials,
     });
@@ -458,8 +410,6 @@
   for (const [category, val] of map) {
     rows.push({
       category,
-      rawCost: val.rawCost,
-      auxCost: val.auxCost,
       totalCost: val.totalCost,
     });
   }
@@ -480,18 +430,12 @@
 });
 
 const overview = computed(() => {
-  const rawCost = filteredRecords.value
-    .filter((item) => item.materialType === "鍘熸枡")
-    .reduce((sum, item) => sum + item.cost, 0);
-  const auxCost = filteredRecords.value
-    .filter((item) => item.materialType === "杈呮枡")
-    .reduce((sum, item) => sum + item.cost, 0);
   const orderCount = new Set(filteredRecords.value.map((item) => item.orderNo)).size;
+  const totalCost = filteredRecords.value.reduce((sum, item) => sum + item.cost, 0);
   return {
-    rawCost,
-    auxCost,
-    totalCost: rawCost + auxCost,
+    totalCost,
     orderCount,
+    avgCostPerOrder: orderCount === 0 ? 0 : totalCost / orderCount,
   };
 });
 
@@ -500,16 +444,6 @@
 
 const detailMaterials = computed(() => detailRow.value?.materials || []);
 
-const detailRawCost = computed(() =>
-  detailMaterials.value
-    .filter((item) => item.materialType === "鍘熸枡")
-    .reduce((sum, item) => sum + item.cost, 0)
-);
-const detailAuxCost = computed(() =>
-  detailMaterials.value
-    .filter((item) => item.materialType === "杈呮枡")
-    .reduce((sum, item) => sum + item.cost, 0)
-);
 const detailTotalCost = computed(() =>
   detailMaterials.value.reduce((sum, item) => sum + item.cost, 0)
 );
@@ -548,14 +482,12 @@
 };
 
 const handleExport = () => {
-  const headers = [timeColumnLabel.value, "浜у搧绫诲埆", "鐢熶骇璁㈠崟", "鍘熸枡鎴愭湰", "杈呮枡鎴愭湰", "鎬绘垚鏈�"];
+  const headers = [timeColumnLabel.value, "浜у搧绫诲埆", "鐢熶骇璁㈠崟", "鎴愭湰(鍏�)"];
   const lines = tableData.value.map((row) =>
     [
       row.timeLabel,
       row.category,
       row.orderNo,
-      row.rawCost.toFixed(2),
-      row.auxCost.toFixed(2),
       row.totalCost.toFixed(2),
     ].join(",")
   );
@@ -694,7 +626,7 @@
 
 .kpi-strip {
   display: grid;
-  grid-template-columns: repeat(4, minmax(0, 1fr));
+  grid-template-columns: repeat(3, minmax(0, 1fr));
   gap: 12px;
 }
 
@@ -712,8 +644,8 @@
   background: linear-gradient(135deg, rgba(22, 163, 74, 0.1), rgba(255, 255, 255, 0.86));
 }
 
-.kpi-aux {
-  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(255, 255, 255, 0.86));
+.kpi-avg {
+  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(255, 255, 255, 0.86));
 }
 
 .kpi-order {
diff --git a/src/views/costAccounting/stdVsActCostAnalysis/index.vue b/src/views/costAccounting/stdVsActCostAnalysis/index.vue
index e0da789..8fa9f16 100644
--- a/src/views/costAccounting/stdVsActCostAnalysis/index.vue
+++ b/src/views/costAccounting/stdVsActCostAnalysis/index.vue
@@ -271,35 +271,103 @@
 const largeChartVisible = ref(false);
 const currentChartOption = ref(null);
 
-const actualCostSource = ref([
-  { month: "2026-01", category: "鐡风爾", costType: "鑳借�楁垚鏈�", actualCost: 182000 },
-  { month: "2026-01", category: "鐡风爾", costType: "鐢熶骇鎴愭湰", actualCost: 465000 },
-  { month: "2026-01", category: "姘存偿", costType: "鑳借�楁垚鏈�", actualCost: 138500 },
-  { month: "2026-01", category: "姘存偿", costType: "鐢熶骇鎴愭湰", actualCost: 398000 },
-  { month: "2026-02", category: "鐡风爾", costType: "鑳借�楁垚鏈�", actualCost: 191500 },
-  { month: "2026-02", category: "鐡风爾", costType: "鐢熶骇鎴愭湰", actualCost: 472500 },
-  { month: "2026-02", category: "姘存偿", costType: "鑳借�楁垚鏈�", actualCost: 142300 },
-  { month: "2026-02", category: "姘存偿", costType: "鐢熶骇鎴愭湰", actualCost: 407000 },
-  { month: "2026-03", category: "鐮傛祮", costType: "鑳借�楁垚鏈�", actualCost: 95800 },
-  { month: "2026-03", category: "鐮傛祮", costType: "鐢熶骇鎴愭湰", actualCost: 265400 },
-  { month: "2026-03", category: "鐡风爾", costType: "鑳借�楁垚鏈�", actualCost: 189800 },
-  { month: "2026-03", category: "鐡风爾", costType: "鐢熶骇鎴愭湰", actualCost: 469900 },
-]);
+// ------------------------------
+// 鍋囨暟鎹細鐢ㄤ簬鍏堣仈璋冮〉闈㈡覆鏌�
+// ------------------------------
+const actualCostSource = ref([]);
+const standardCostSource = ref([]);
 
-const standardCostSource = ref([
-  { month: "2026-01", category: "鐡风爾", costType: "鑳借�楁垚鏈�", standardCost: 176000 },
-  { month: "2026-01", category: "鐡风爾", costType: "鐢熶骇鎴愭湰", standardCost: 452000 },
-  { month: "2026-01", category: "姘存偿", costType: "鑳借�楁垚鏈�", standardCost: 136000 },
-  { month: "2026-01", category: "姘存偿", costType: "鐢熶骇鎴愭湰", standardCost: 392000 },
-  { month: "2026-02", category: "鐡风爾", costType: "鑳借�楁垚鏈�", standardCost: 186000 },
-  { month: "2026-02", category: "鐡风爾", costType: "鐢熶骇鎴愭湰", standardCost: 458000 },
-  { month: "2026-02", category: "姘存偿", costType: "鑳借�楁垚鏈�", standardCost: 139000 },
-  { month: "2026-02", category: "姘存偿", costType: "鐢熶骇鎴愭湰", standardCost: 401000 },
-  { month: "2026-03", category: "鐮傛祮", costType: "鑳借�楁垚鏈�", standardCost: 93000 },
-  { month: "2026-03", category: "鐮傛祮", costType: "鐢熶骇鎴愭湰", standardCost: 259000 },
-  { month: "2026-03", category: "鐡风爾", costType: "鑳借�楁垚鏈�", standardCost: 185000 },
-  { month: "2026-03", category: "鐡风爾", costType: "鐢熶骇鎴愭湰", standardCost: 461000 },
-]);
+const fakeMonths = ["2026-01", "2026-02", "2026-03"];
+const fakeCategories = [
+  "绮夌叅鐏�",
+  "鐭崇伆",
+  "姘存偿",
+  "閾濈矇鑶�",
+  "鑴辨ā鍓�",
+  "鐭宠啅",
+  "鎵撳寘甯�",
+  "闃茶厫鍓傦紙鏉挎潗鐢級",
+  "姘у寲闀侊紙鏉挎潗鐢級",
+  "鍐锋尋涓濓紙鏉挎潗鐢級",
+  "鍗℃墸锛堟澘鏉愮敤锛�",
+  "鏉愭枡灏忚",
+  "姘�",
+  "鐢�",
+  "钂告苯",
+];
+
+const fakeCostType = (category) => (["姘�", "鐢�", "钂告苯"].includes(category) ? "鑳借�楁垚鏈�" : "鐢熶骇鎴愭湰");
+
+// 姣忎釜绫诲埆鐨勬爣鍑嗘垚鏈熀鍑嗗�硷紙浠呯敤浜庡亣鏁版嵁锛�
+const baseStandardCostByCategory = {
+  绮夌叅鐏�: 98000,
+  鐭崇伆: 52000,
+  姘存偿: 175000,
+  閾濈矇鑶�: 32000,
+  鑴辨ā鍓�: 21000,
+  鐭宠啅: 41000,
+  鎵撳寘甯�: 14500,
+  "闃茶厫鍓傦紙鏉挎潗鐢級": 12500,
+  "姘у寲闀侊紙鏉挎潗鐢級": 22000,
+  "鍐锋尋涓濓紙鏉挎潗鐢級": 9800,
+  "鍗℃墸锛堟澘鏉愮敤锛�": 8600,
+  鏉愭枡灏忚: 420000,
+  姘�: 6800,
+  鐢�: 26000,
+  钂告苯: 52000,
+};
+
+// 鏈堜唤娉㈠姩绯绘暟锛堣鍥捐〃鐪嬭捣鏉ユ洿鈥滅湡瀹炩�濅竴浜涳級
+const monthFactorByMonth = {
+  "2026-01": 1.0,
+  "2026-02": 1.06,
+  "2026-03": 0.97,
+};
+
+// 瀹為檯鎴愭湰鐩稿鏍囧噯鎴愭湰鐨勫亸绉绘瘮渚嬶紙鐢ㄤ簬娴嬭瘯姝h礋宸紓灞曠ず锛�
+const diffRatioByCategory = {
+  绮夌叅鐏�: 0.05,
+  鐭崇伆: -0.01,
+  姘存偿: 0.03,
+  閾濈矇鑶�: 0.0,
+  鑴辨ā鍓�: -0.04,
+  鐭宠啅: 0.02,
+  鎵撳寘甯�: -0.03,
+  "闃茶厫鍓傦紙鏉挎潗鐢級": 0.06,
+  "姘у寲闀侊紙鏉挎潗鐢級": -0.02,
+  "鍐锋尋涓濓紙鏉挎潗鐢級": 0.01,
+  "鍗℃墸锛堟澘鏉愮敤锛�": -0.05,
+  鏉愭枡灏忚: 0.02,
+  姘�: -0.01,
+  鐢�: 0.04,
+  钂告苯: -0.03,
+};
+
+const buildFakeSources = () => {
+  const stdRows = [];
+  const actRows = [];
+
+  for (const month of fakeMonths) {
+    const monthFactor = monthFactorByMonth[month] ?? 1;
+    const monthAdj = month === "2026-02" ? 0.005 : month === "2026-03" ? -0.006 : 0;
+
+    for (const category of fakeCategories) {
+      const costType = fakeCostType(category);
+      const base = baseStandardCostByCategory[category] ?? 0;
+      const standardCost = Math.round(base * monthFactor);
+      const diffRatio = (diffRatioByCategory[category] ?? 0) + monthAdj;
+      const actualCost = Math.round(standardCost * (1 + diffRatio));
+
+      stdRows.push({ month, category, costType, standardCost });
+      actRows.push({ month, category, costType, actualCost });
+    }
+  }
+
+  standardCostSource.value = stdRows;
+  actualCostSource.value = actRows;
+};
+
+buildFakeSources();
 
 const categoryOptions = computed(() => {
   const all = [...actualCostSource.value, ...standardCostSource.value];
@@ -614,10 +682,11 @@
 
 const downloadTemplate = () => {
   const sample = [
-    { 鏈堜唤: "2026-03", 浜у搧绫诲埆: "鐡风爾", 鎴愭湰绫诲瀷: "鏍囧噯鑳借�楁垚鏈�", 鏍囧噯鎴愭湰: 185000 },
-    { 鏈堜唤: "2026-03", 浜у搧绫诲埆: "鐡风爾", 鎴愭湰绫诲瀷: "鏍囧噯鐢熶骇鎴愭湰", 鏍囧噯鎴愭湰: 461000 },
-    { 鏈堜唤: "2026-03", 浜у搧绫诲埆: "姘存偿", 鎴愭湰绫诲瀷: "鏍囧噯鑳借�楁垚鏈�", 鏍囧噯鎴愭湰: 140000 },
-    { 鏈堜唤: "2026-03", 浜у搧绫诲埆: "姘存偿", 鎴愭湰绫诲瀷: "鏍囧噯鐢熶骇鎴愭湰", 鏍囧噯鎴愭湰: 405000 },
+    { 鏈堜唤: "2026-03", 浜у搧绫诲埆: "绮夌叅鐏�", 鎴愭湰绫诲瀷: "鏍囧噯鐢熶骇鎴愭湰", 鏍囧噯鎴愭湰: 98000 },
+    { 鏈堜唤: "2026-03", 浜у搧绫诲埆: "姘存偿", 鎴愭湰绫诲瀷: "鏍囧噯鐢熶骇鎴愭湰", 鏍囧噯鎴愭湰: 175000 },
+    { 鏈堜唤: "2026-03", 浜у搧绫诲埆: "鐢�", 鎴愭湰绫诲瀷: "鏍囧噯鑳借�楁垚鏈�", 鏍囧噯鎴愭湰: 26000 },
+    { 鏈堜唤: "2026-03", 浜у搧绫诲埆: "钂告苯", 鎴愭湰绫诲瀷: "鏍囧噯鑳借�楁垚鏈�", 鏍囧噯鎴愭湰: 52000 },
+    { 鏈堜唤: "2026-03", 浜у搧绫诲埆: "姘�", 鎴愭湰绫诲瀷: "鏍囧噯鑳借�楁垚鏈�", 鏍囧噯鎴愭湰: 6800 },
   ];
   const ws = XLSX.utils.json_to_sheet(sample);
   const wb = XLSX.utils.book_new();
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