From 1378fc4cd7abc24ed3a982e09437c2c8a74e9f2f Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期二, 27 一月 2026 19:06:32 +0800
Subject: [PATCH] 代码优化

---
 项目代码/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue |  179 +++++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 113 insertions(+), 66 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue"
index 38f1779..d972c31 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue"
@@ -1,6 +1,7 @@
 <template>
   <view-grid
-    ref="gridRef"
+    ref="grid"
+    @openPalletDialog="handleOpenPalletDialog"
     :columns="columns"
     :detail="detail"
     :editFormFields="editFormFields"
@@ -11,25 +12,33 @@
     :extend="extend"
   >
   </view-grid>
+      <!-- 2. 缁勭洏寮圭獥锛氱‘淇漰rops鍜屼簨浠剁粦瀹氭纭� -->
+    <PalletDialog
+      v-model:visible="palletVisible"  
+      :docNo="currentPalletDocNo"     
+      @back-success="handlePalletBackSuccess"  
+    ></PalletDialog>
+
 </template>
-
-<script>
-import extend from "@/extension/inbound/Dt_AllocateOrder.js"; 
-import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue';
+    <script>
+import extend from "@/extension/inbound/Dt_AllocateOrder.js";
+import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue'; 
 import { ref, defineComponent } from "vue";
-
+import PalletDialog from "@/extension/inbound/extend/AllocatedPallet.vue";
 export default defineComponent({
-  components: {
-    viewGrid: ViewGrid,
-    PalletDialog
+   components: {
+    // 鍏抽敭淇2锛氱粍浠舵敞鍐屽悕涓庢ā鏉挎爣绛惧悕閫傞厤锛坘ebab-case瀵瑰簲view-grid锛�
+    viewGrid: ViewGrid,  // 娉ㄥ唽涓簁ebab-case锛屾ā鏉跨敤<view-grid>
+    PalletDialog      // 娉ㄥ唽缁勭洏寮圭獥
+ 
   },
   setup() {
     const table = ref({
       key: "id",
       footer: "Foots",
       cnName: "璋冩嫧鍗�",
-      name: "allocateOrder",
-      url: "/allocateOrder/",
+      name: "AllocateOrder",
+      url: "/AllocateOrder/",
       sortName: "id",
     });
 
@@ -119,58 +128,90 @@
     ]);
 
     
+    // const searchFormFields = ref({
+    //   orderNo: "",
+    //   upperOrderNo: "",
+    //   orderType: "117",
+    //   orderStatus: "",
+    //   createType: "",
+    //   fromWarehouse: "",
+    //   toWarehouse: "",
+    //   factoryArea: "",
+    //   creater: "",
+    //   createDate: "",
+    // });
+
+   
+    // const searchFormOptions = ref([
+    //   [
+    //     { title: "涓婄骇鍗曟嵁缂栧彿", field: "upperOrderNo", type: "like" },
+    //     {
+    //       title: "鍗曟嵁鐘舵��",
+    //       field: "orderStatus",
+    //       type: "select",
+    //       dataKey: "allocateOrderStatus", 
+    //       data: [],
+    //     },
+    //     {
+    //       title: "鍗曟嵁绫诲瀷",
+    //       field: "orderType",
+    //       type: "select",
+    //       dataKey: "outOrderType",
+    //       data: [],
+    //     },
+    //   ],
+    //   [
+    //     {
+    //       title: "鍒涘缓绫诲瀷",
+    //       field: "createType",
+    //       type: "select",
+    //       dataKey: "createType",
+    //       data: [],
+    //     },
+    //     { title: "鏉ユ簮浠撳簱", field: "fromWarehouse", type: "like" },
+    //     { title: "鐩爣浠撳簱", field: "toWarehouse", type: "like" },
+    //   ],
+    //   [
+    //     { title: "鍘傚尯", field: "factoryArea", type: "like" },
+    //     { title: "鍒涘缓鑰�", field: "creater", type: "like" },
+    //     { title: "鍒涘缓鏃堕棿", field: "createDate", type: "datetime" },
+    //   ],
+    // ]);
     const searchFormFields = ref({
       orderNo: "",
       upperOrderNo: "",
-      supplierId: "",
-      orderType: "",
+      orderType: "117",
       orderStatus: "",
       createType: "",
-      businessType: "",
-      fromWarehouse: "",
-      toWarehouse: "",
-      factoryArea: "",
       creater: "",
       createDate: "",
     });
-
-   
     const searchFormOptions = ref([
       [
         { title: "鍗曟嵁缂栧彿", field: "orderNo", type: "like" },
-        { title: "涓婄骇鍗曟嵁缂栧彿", field: "upperOrderNo", type: "like" },
-        { title: "渚涘簲鍟咺D", field: "supplierId", type: "like" },
         {
-          title: "璁㈠崟绫诲瀷",
+          title: "鍗曟嵁绫诲瀷",
           field: "orderType",
           type: "select",
-          dataKey: "allocateOrderType",
+          dataKey: "outOrderType",
+          data: [],
+        },
+        {
+          title: "鍗曟嵁鐘舵��",
+          field: "orderStatus",
+          type: "select",
+          dataKey: "outboundStatusEnum",
           data: [],
         },
       ],
       [
         {
-          title: "鍗曟嵁鐘舵��",
-          field: "orderStatus",
-          type: "select",
-          dataKey: "allocateOrderStatus", 
-          data: [],
-        },
-        {
-          title: "鍒涘缓绫诲瀷",
+          title: "鍒涘缓鏂瑰紡",
           field: "createType",
           type: "select",
           dataKey: "createType",
           data: [],
         },
-        { title: "涓氬姟绫诲瀷", field: "businessType", type: "like" },
-      ],
-      [
-        { title: "鏉ユ簮浠撳簱", field: "fromWarehouse", type: "like" },
-        { title: "鐩爣浠撳簱", field: "toWarehouse", type: "like" },
-        { title: "鍘傚尯", field: "factoryArea", type: "like" },
-      ],
-      [
         { title: "鍒涘缓鑰�", field: "creater", type: "like" },
         { title: "鍒涘缓鏃堕棿", field: "createDate", type: "datetime" },
       ],
@@ -193,7 +234,6 @@
         type: "string",
         width: 120,
         align: "left",
-        link: true, 
       },
       {
         field: "upperOrderNo",
@@ -203,19 +243,12 @@
         align: "left",
       },
       {
-        field: "supplierId",
-        title: "渚涘簲鍟咺D",
-        type: "string",
-        width: 120,
-        align: "left",
-      },
-      {
         field: "orderType",
         title: "璁㈠崟绫诲瀷",
         type: "int",
         width: 120,
         align: "left",
-        bind: { key: "allocateOrderType", data: [] },
+        bind: { key: "outOrderType", data: [] },
       },
       {
         field: "orderStatus",
@@ -223,7 +256,7 @@
         type: "int",
         width: 120,
         align: "left",
-        bind: { key: "allocateOrderStatus", data: [] },
+        bind: { key: "inboundState", data: [] },
       },
       {
         field: "createType",
@@ -233,20 +266,20 @@
         align: "left",
         bind: { key: "createType", data: [] },
       },
-      {
-        field: "businessType",
-        title: "涓氬姟绫诲瀷",
-        type: "string",
-        width: 120,
-        align: "left",
-      },
+      // {
+      //   field: "businessType",
+      //   title: "涓氬姟绫诲瀷",
+      //   type: "string",
+      //   width: 120,
+      //   align: "left",
+      //   bind: { key: "businessType", data: [] },
+      // },
       {
         field: "fromWarehouse",
         title: "鏉ユ簮浠撳簱",
         type: "string",
         width: 120,
         align: "left",
-        bind: { key: "warehouses", data: [] },
       },
       {
         field: "toWarehouse",
@@ -254,14 +287,12 @@
         type: "string",
         width: 120,
         align: "left",
-        bind: { key: "warehouses", data: [] },
       },
       {
-        field: "isBatch",
-        title: "鏄惁鎵规",
-        type: "bool",
-        width: 100,
-        align: "left",
+        field: "returnToMESStatus",
+        title: "鍥炰紶MES鐘舵��",
+        width: 120,
+        bind: { key: "createType", data: [{ key: 0, value: "鏈洖浼�" }, { key: 1, value: "宸插洖浼犳垚鍔�" }, { key: 2, value: "鍥炰紶澶辫触" },{ key: 3, value: "閮ㄥ垎鍥炰紶鎴愬姛" },{ key: 4, value: "閮ㄥ垎鍥炰紶澶辫触" }] },
       },
       {
         field: "factoryArea",
@@ -455,6 +486,21 @@
       key: "id",
     });
 
+    // 6. 缁勭洏寮圭獥鑱斿姩锛堟墍鏈夊彉閲忓繀椤昏繑鍥烇級
+    const palletVisible = ref(false);
+    const currentPalletDocNo = ref("");
+
+    const handleOpenPalletDialog = (docNo) => {
+      console.log('涓荤粍浠舵敹鍒扮粍鐩樹簨浠讹紝鍗曟嵁鍙凤細', docNo);
+      currentPalletDocNo.value = docNo;
+      palletVisible.value = true;
+    };
+
+    const handlePalletBackSuccess = () => {
+      console.log('缁勭洏鍥炰紶鎴愬姛锛屽埛鏂拌〃鏍�');
+      grid.value?.refresh();  // 姝ゆ椂gridRef宸叉寕杞斤紝鍙皟鐢ㄦ柟娉�
+    };
+
     return {
       table,
       extend,
@@ -463,12 +509,13 @@
       searchFormFields,
       searchFormOptions,
       columns,
-      detail, 
+      detail,
+       // 缁勭洏寮圭獥鐩稿叧
+      PalletDialog,    // 寮圭獥缁勪欢锛堟棤闇�杩斿洖锛屾敞鍐屽嵆鍙紝浣嗗彉閲忛渶杩斿洖锛�
       palletVisible,
       currentPalletDocNo,
       handleOpenPalletDialog,
-      handlePalletBackSuccess,
-      gridRef
+      handlePalletBackSuccess
     };
   },
 });

--
Gitblit v1.9.3