pan
6 天以前 a7b15461d3dc6d07c18e065fa3a6acd234c2d7c8
ÏîÄ¿´úÂë/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. ç»„盘弹窗:确保props和事件绑定正确 -->
    <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:组件注册名与模板标签名适配(kebab-case对应view-grid)
    viewGrid: ViewGrid,  // æ³¨å†Œä¸ºkebab-case,模板用<view-grid>
    PalletDialog      // æ³¨å†Œç»„盘弹窗
  },
  setup() {
    const table = ref({
      key: "id",
      footer: "Foots",
      cnName: "调拨单",
      name: "allocateOrder",
      url: "/allocateOrder/",
      name: "AllocateOrder",
      url: "/AllocateOrder/",
      sortName: "id",
    });
@@ -193,7 +202,6 @@
        type: "string",
        width: 120,
        align: "left",
        link: true,
      },
      {
        field: "upperOrderNo",
@@ -455,6 +463,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 +486,13 @@
      searchFormFields,
      searchFormOptions,
      columns,
      detail,
      detail,
       // ç»„盘弹窗相关
      PalletDialog,    // å¼¹çª—组件(无需返回,注册即可,但变量需返回)
      palletVisible,
      currentPalletDocNo,
      handleOpenPalletDialog,
      handlePalletBackSuccess,
      gridRef
      handlePalletBackSuccess
    };
  },
});