From 679c5b64e0dcbee2ea29c38c9c55c3ff1d4b6258 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 02 十一月 2026 10:51:36 +0800
Subject: [PATCH] 诚发五金:入库/调整/移库/调拨/盘点表单去掉库区库位选择,改由后端默认库区库位兜底

---
 src/views/mes/pro/task/modules/schedule-form.vue |   87 +++++++++++++++++++++++--------------------
 1 files changed, 47 insertions(+), 40 deletions(-)

diff --git a/src/views/mes/pro/task/modules/schedule-form.vue b/src/views/mes/pro/task/modules/schedule-form.vue
index e51d7b7..9fff99d 100644
--- a/src/views/mes/pro/task/modules/schedule-form.vue
+++ b/src/views/mes/pro/task/modules/schedule-form.vue
@@ -1,4 +1,4 @@
-锘�<script lang="ts" setup>
+<script lang="ts" setup>
 import type { MesProWorkOrderApi } from '#/api/mes/pro/workorder';
 import type { MesProWorkOrderProcessApi } from '#/api/mes/pro/workorder/process';
 
@@ -43,23 +43,20 @@
   wrapperClass: 'grid-cols-3',
 });
 
-/** 鍔犺浇宸ュ崟宸ュ簭鍒楄〃锛堜粎浣跨敤宸ュ崟宸ュ簭锛屼笉鍥為��鍒板伐鑹鸿矾绾挎ā鏉匡級 */
+/** 鍔犺浇宸ュ崟宸ュ簭鍒楄〃锛涙湭閰嶇疆宸ュ簭鏃舵寜鍗曞伐搴忕敓浜у鐞� */
 async function loadRouteProcesses(workOrderId: number, productId: number) {
   const woProcesses = await getWorkOrderProcessListByWorkOrderId(workOrderId);
-  if (!woProcesses || woProcesses.length === 0) {
-    message.warning('褰撳墠璁㈠崟鏈厤缃伐搴忥紝璇峰厛鍦ㄥ伐鍗曚腑缁存姢宸ュ簭淇℃伅');
-    return;
+  // 纭畾宸ヨ壓璺嚎ID锛氭湁宸ュ簭鏃舵寜浜у搧璺嚎甯﹀嚭锛涙湭閰嶇疆宸ュ簭鏃舵寜鍗曞伐搴忕敓浜�
+  let tempRouteId = 0;
+  if (woProcesses && woProcesses.length > 0) {
+    const processes = await getRouteProcessListByProduct(productId);
+    tempRouteId = processes?.[0]?.routeId ?? 0;
   }
-  routeProcessList.value = [...woProcesses].toSorted(
+  currentRouteId.value = tempRouteId;
+
+  routeProcessList.value = [...(woProcesses ?? [])].toSorted(
     (a, b) => (a.sort ?? 0) - (b.sort ?? 0),
   );
-  // 纭畾宸ヨ壓璺嚎ID锛氬伐鍗曡矾绾� 鈫� 浜у搧璺嚎
-  if (workOrder.value?.routeId) {
-    currentRouteId.value = workOrder.value.routeId;
-  } else {
-    const processes = await getRouteProcessListByProduct(productId);
-    currentRouteId.value = processes?.[0]?.routeId ?? 0;
-  }
 }
 
 /** 瀹屾垚璁㈠崟 */
@@ -118,32 +115,46 @@
   <Modal :title="getTitle" class="w-4/5">
     <Form class="mx-4" />
     <!-- 宸ュ簭姝ラ瀵艰埅 + 褰撳墠宸ュ簭浠诲姟鍒楄〃 -->
-    <template v-if="routeProcessList.length > 0 && workOrder?.id">
-      <Steps
-        v-model:current="activeProcessStep"
-        class="my-4 px-4"
-        size="small"
-        type="navigation"
-      >
-        <Steps.Step
-          v-for="rp in routeProcessList"
-          :key="rp.processId"
-          :title="rp.processName"
-        />
-      </Steps>
-      <Card
-        v-for="(rp, index) in routeProcessList"
-        v-show="activeProcessStep === index"
-        :key="rp.processId"
-        class="mx-4"
-      >
+    <template v-if="workOrder?.id">
+      <template v-if="routeProcessList.length > 0">
+        <Steps
+          v-model:current="activeProcessStep"
+          class="my-4 px-4"
+          size="small"
+          type="navigation"
+        >
+          <Steps.Step
+            v-for="rp in routeProcessList"
+            :key="rp.processId"
+            :title="rp.processName"
+            :description="rp.paramTemplateId ? `鍙傛暟妯℃澘 #${rp.paramTemplateId}` : '鏈厤缃弬鏁版ā鏉�'"
+          />
+        </Steps>
+        <template v-for="(rp, index) in routeProcessList" :key="rp.processId">
+          <Card
+            v-if="activeProcessStep === index"
+            class="mx-4"
+          >
+            <TaskList
+              :color-code="rp.colorCode"
+              :disabled="isReadonly"
+              :item-id="rp.outputItemId || workOrder.productId"
+              :process-id="rp.processId!"
+              :route-id="currentRouteId"
+              :work-order-id="workOrder.id!"
+              :work-order-quantity="workOrder.quantity"
+            />
+          </Card>
+        </template>
+      </template>
+      <!-- 鏈厤缃伐搴�/宸ヨ壓璺嚎锛氭暣寮犲伐鍗曟寜鍗曞伐搴忔帓浜� -->
+      <Card v-else class="mx-4">
         <TaskList
-          :color-code="rp.colorCode"
           :disabled="isReadonly"
-          :item-id="rp.outputItemId || workOrder.productId"
-          :process-id="rp.processId!"
-          :route-id="currentRouteId"
+          :item-id="workOrder.productId"
+          :route-id="currentRouteId || undefined"
           :work-order-id="workOrder.id!"
+          :work-order-quantity="workOrder.quantity"
         />
       </Card>
     </template>
@@ -151,15 +162,11 @@
       <div class="flex flex-auto items-center gap-2">
         <template v-if="formType === 'schedule'">
           <Popconfirm
-            v-if="routeProcessList.length > 0"
             title="纭瑕佸畬鎴愯璁㈠崟鍚楋紵瀹屾垚鍚庤鍗曚笅鎵�鏈変换鍔″皢鏍囪涓哄凡瀹屾垚銆�"
             @confirm="handleFinish"
           >
             <Button type="primary">瀹屾垚</Button>
           </Popconfirm>
-          <span v-else class="text-gray-400 text-sm">
-            褰撳墠璁㈠崟鏈厤缃伐搴忥紝璇峰厛鍦ㄥ伐鍗曚腑缁存姢宸ュ簭淇℃伅鍚庡啀瀹屾垚
-          </span>
         </template>
       </div>
     </template>

--
Gitblit v1.9.3