From ada2de76afaa9c884a860786ea97992f97dadff0 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 11 六月 2026 09:22:54 +0800
Subject: [PATCH] Merge branch 'dev_河南_鹤壁天沐玻璃厂' of http://114.132.189.42:9002/r/product-inventory-management into dev_河南_鹤壁天沐玻璃厂

---
 src/views/salesManagement/salesLedger/components/ProcessFlowConfigSelectDialog.vue |   92 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 87 insertions(+), 5 deletions(-)

diff --git a/src/views/salesManagement/salesLedger/components/ProcessFlowConfigSelectDialog.vue b/src/views/salesManagement/salesLedger/components/ProcessFlowConfigSelectDialog.vue
index f3c33b5..f400877 100644
--- a/src/views/salesManagement/salesLedger/components/ProcessFlowConfigSelectDialog.vue
+++ b/src/views/salesManagement/salesLedger/components/ProcessFlowConfigSelectDialog.vue
@@ -8,10 +8,28 @@
   >
     <el-row :gutter="20">
       <el-col :span="24">
-        <div style="font-weight: 600; margin-bottom: 8px;">閰嶇疆</div>
-        <div style="font-size: 12px; margin-bottom: 8px;">
-          <span v-if="boundRouteName" style="color: #67c23a;">宸茬粦瀹氾細{{ boundRouteName }}</span>
-          <span v-else style="color: #e6a23c;">鏈粦瀹�</span>
+        <div class="dialog-topbar">
+          <div>
+            <div style="font-weight: 600; margin-bottom: 8px;">閰嶇疆</div>
+            <div style="font-size: 12px; margin-bottom: 8px;">
+              <span v-if="boundRouteName" style="color: #67c23a;">宸茬粦瀹氾細{{ boundRouteName }}</span>
+              <span v-else style="color: #e6a23c;">鏈粦瀹�</span>
+            </div>
+          </div>
+          <div class="export-toolbar">
+            <el-date-picker
+              v-model="exportDateRange"
+              type="daterange"
+              value-format="YYYY-MM-DD"
+              format="YYYY-MM-DD"
+              range-separator="鑷�"
+              start-placeholder="寮�濮嬫棩鏈�"
+              end-placeholder="缁撴潫鏃ユ湡"
+              clearable
+              style="width: 280px;"
+            />
+            <el-button type="success" plain @click="exportSelectedSteps">瀵煎嚭宸插嬀閫�</el-button>
+          </div>
         </div>
         <el-select
           v-model="selectedRouteId"
@@ -46,6 +64,11 @@
             class="process-diagram-segment"
           >
             <div class="process-diagram-node">
+              <el-checkbox
+                v-model="step.checked"
+                class="process-diagram-checkbox"
+                @change="() => handleStepCheckedChange(step)"
+              />
               <div class="process-diagram-index">{{ idx + 1 }}</div>
               <div class="process-diagram-name">{{ step.processName }}</div>
             </div>
@@ -97,6 +120,7 @@
 const routeList = ref([]);
 const selectedRouteId = ref(null);
 const steps = ref([]);
+const exportDateRange = ref([]);
 const saving = ref(false);
 
 const normalizeStepsFromApi = (list) => {
@@ -106,6 +130,8 @@
     processId: s.processId ?? s.process_id ?? s.id ?? null,
     processName: s.processName ?? s.process_name ?? s.name ?? "",
     sortNo: s.sortNo ?? idx + 1,
+    isCompleted: Number(s.isCompleted ?? s.completed ?? 0),
+    checked: Boolean(s.checked ?? false),
   }));
 };
 
@@ -163,6 +189,10 @@
   await fetchRouteSteps(selectedRouteId.value);
 };
 
+const handleStepCheckedChange = step => {
+  step.checked = Boolean(step.checked);
+};
+
 const handleClose = () => {
   emit("update:visible", false);
   saving.value = false;
@@ -182,6 +212,38 @@
   } finally {
     saving.value = false;
   }
+};
+
+const exportSelectedSteps = () => {
+  const selectedSteps = steps.value.filter(step => step.checked);
+  if (selectedSteps.length === 0) {
+    proxy?.$modal?.msgWarning?.("璇峰厛鍕鹃�夎瀵煎嚭鐨勫伐搴�");
+    return;
+  }
+  const payload = {
+    exportDateRange: Array.isArray(exportDateRange.value) ? exportDateRange.value : [],
+    routeId: selectedRouteId.value,
+    routeName: routeList.value.find(item => String(item.routeId) === String(selectedRouteId.value))?.processRouteName || "",
+    steps: selectedSteps.map(step => ({
+      processId: step.processId,
+      processName: step.processName,
+      sortNo: step.sortNo,
+      isCompleted: Number(step.isCompleted ?? 0),
+    })),
+  };
+  const blob = new Blob([JSON.stringify(payload, null, 2)], {
+    type: "application/json;charset=utf-8",
+  });
+  const url = URL.createObjectURL(blob);
+  const a = document.createElement("a");
+  const dateText =
+    Array.isArray(exportDateRange.value) && exportDateRange.value.length === 2
+      ? `${exportDateRange.value[0]}_${exportDateRange.value[1]}`
+      : "all";
+  a.href = url;
+  a.download = `宸ヨ壓璺嚎瀵煎嚭_${dateText}.json`;
+  a.click();
+  URL.revokeObjectURL(url);
 };
 </script>
 
@@ -213,6 +275,13 @@
   padding: 10px 12px;
   margin-right: 10px;
   box-sizing: border-box;
+  position: relative;
+}
+
+.process-diagram-checkbox {
+  position: absolute;
+  top: 8px;
+  right: 8px;
 }
 
 .process-diagram-index {
@@ -251,5 +320,18 @@
   justify-content: flex-end;
   gap: 10px;
 }
-</style>
 
+.dialog-topbar {
+  display: flex;
+  justify-content: space-between;
+  align-items: flex-start;
+  gap: 16px;
+}
+
+.export-toolbar {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  flex-wrap: wrap;
+}
+</style>

--
Gitblit v1.9.3