647556386
2026-01-27 1378fc4cd7abc24ed3a982e09437c2c8a74e9f2f
ÏîÄ¿´úÂë/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",
    });
@@ -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: "供应商ID", 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: "供应商ID",
        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
    };
  },
});