647556386
2026-01-27 1378fc4cd7abc24ed3a982e09437c2c8a74e9f2f
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue
@@ -1,38 +1,14 @@
<template>
  <view-grid
    ref="grid"
    @openPalletDialog="handleOpenPalletDialog"
    :columns="columns"
    :detail="detail"
    :editFormFields="editFormFields"
    :editFormOptions="editFormOptions"
    :searchFormFields="searchFormFields"
    :searchFormOptions="searchFormOptions"
    :table="table"
    :extend="extend"
  >
  <view-grid ref="grid" @openPalletDialog="handleOpenPalletDialog" :columns="columns" :detail="detail"
    :editFormFields="editFormFields" :editFormOptions="editFormOptions" :searchFormFields="searchFormFields"
    :searchFormOptions="searchFormOptions" :table="table" :extend="extend">
  </view-grid>
      <!-- 2. ç»„盘弹窗:确保props和事件绑定正确 -->
    <PalletDialog
      v-model:visible="palletVisible"
      :docNo="currentPalletDocNo"
      @back-success="handlePalletBackSuccess"
    ></PalletDialog>
</template>
    <script>
<script>
import extend from "@/extension/inbound/inboundOrder.js";
import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue';
import { ref, defineComponent } from "vue";
import PalletDialog from "@/extension/inbound/extend/Pallet.vue";
export default defineComponent({
   components: {
    // å…³é”®ä¿®å¤2:组件注册名与模板标签名适配(kebab-case对应view-grid)
    viewGrid: ViewGrid,  // æ³¨å†Œä¸ºkebab-case,模板用<view-grid>
    PalletDialog      // æ³¨å†Œç»„盘弹窗
  },
  setup() {
    const table = ref({
      key: "id",
@@ -57,6 +33,7 @@
          type: "select",
          dataKey: "inOrderType",
          data: [],
          hidden: true
        },
        {
          field: "inboundOrderNo",
@@ -83,16 +60,17 @@
      createType: "",
      creater: "",
      createDate: "",
      materielCode: "",
    });
    const searchFormOptions = ref([
      [
        { title: "单据编号", field: "inboundOrderNo", type: "like" },
        { title: "扫描单据或条码", field: "inboundOrderNo", type: "like" },
        { title: "上游单据编号", field: "upperOrderNo", type: "like" },
        {
          title: "单据类型",
          field: "orderType",
          title: "业务类型",
          field: "businessType",
          type: "select",
          dataKey: "inOrderType",
          dataKey: "documentTypeEmun",
          data: [],
        },
        {
@@ -113,6 +91,7 @@
        },
        { title: "创建者", field: "creater", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
        { title: "物料编号", field: "materielCode", type: "like" },
      ],
    ]);
    const columns = ref([
@@ -142,20 +121,21 @@
        align: "left",
      },
      {
          field: "warehouseId",
          title: "仓库",
          type: "string",
          width: 90,
          align: "left",
          bind:{key: "warehouses", data: []}
      },
      {
        field: "orderType",
        title: "单据类型",
        type: "string",
        width: 150,
        align: "left",
        bind: { key: "inOrderType", data: [] },
        hidden: true
      },
      {
        field: "businessType",
        title: "业务类型",
        type: "string",
        width: 150,
        align: "left",
        bind: { key: "businessType", data: [] },
      },
      {
        field: "orderStatus",
@@ -166,12 +146,39 @@
        bind: { key: "inboundState", data: [] },
      },
      {
        field: "orderStatistics",
        title: "单据物料统计",
        type: "string",
        width: 300,
        align: "left",
      },
      {
        field: "createType",
        title: "创建方式",
        type: "string",
        width: 120,
        align: "left",
        bind: { key: "createType", data: [] },
      },
      {
        field: "remark",
        title: "备注",
        type: "string",
        width: 180,
        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: "部分回传失败" },{ key: 5, value: "无需回传" }] },
      },
      {
        field: "factoryArea",
        title: "厂区",
        type: "string",
        width: 120,
        align: "left"
      },
      {
        field: "creater",
@@ -188,7 +195,7 @@
        align: "left",
      },
      {
        field: "modifier",
        field: "operator",
        title: "修改人",
        type: "string",
        width: 100,
@@ -199,13 +206,6 @@
        title: "修改时间",
        type: "datetime",
        width: 160,
        align: "left",
      },
      {
        field: "remark",
        title: "备注",
        type: "string",
        width: 100,
        align: "left",
      },
    ]);
@@ -235,24 +235,24 @@
          field: "materielCode",
          title: "物料编号",
          type: "select",
          width: 150,
          width: 120,
          align: "left",
          edit: { type: "" },
          required: true,
        },
        {
          field: "materielCode",
          field: "materielName",
          title: "物料名称",
          type: "string",
          width: 100,
          width: 150,
          align: "left",
          bind: { key: "MaterielNames", data: [] },
          bind: { key: "materielInfo", data: [] },
        },
        {
          field: "batchNo",
          title: "批次号",
          type: "decimal",
          width: 90,
          width: 150,
          align: "left",
          edit: { type: "" },
          required: true,
@@ -261,18 +261,34 @@
          field: "supplyCode",
          title: "供应商编号",
          type: "decimal",
          width: 90,
          width: 100,
          align: "left",
          edit: { type: "" },
          required: true,
        },
        {
          field: "barcode",
          title: "条码",
          field: "warehouseCode",
          title: "仓库号",
          type: "decimal",
          width: 90,
          align: "left",
          required: true
        },
        {
          field: "barcode",
          title: "条码",
          type: "decimal",
          width: 180,
          align: "left",
          edit: { type: "" },
          required: true,
        },
        {
          field: "outBoxbarcodes",
          title: "外箱条码",
          type: "decimal",
          width: 90,
          align: "left",
          required: true,
        },
        {
@@ -288,24 +304,39 @@
          field: "receiptQuantity",
          title: "组盘数量",
          type: "int",
          width: 120,
          width: 90,
          align: "left",
        },
        {
          field: "overInQuantity",
          title: "上架数量",
          type: "string",
          width: 200,
          width: 90,
          align: "left",
        },
        {
          field: "unit",
          title: "单位",
          type: "string",
          width: 90,
          align: "left",
        },
        {
          field: "orderDetailStatus",
          title: "订单明细状态",
          type: "string",
          width: 180,
          width: 100,
          align: "left",
          bind: { key: "orderDetailStatusEnum", data: [] },
        },
        // {
        //   field: "returnToMESStatus",
        //   title: "回传状态",
        //   type: "string",
        //   width: 90,
        //   align: "left",
        //   bind: { key: "returnStatus", data: [{ key: 0, value: "未回传" }, { key: 1, value: "已回传成功" }, { key: 2, value: "回传失败" }] }
        // },
        {
          field: "creater",
          title: "创建人",
@@ -345,20 +376,7 @@
      sortName: "id",
      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,
@@ -369,12 +387,12 @@
      searchFormOptions,
      columns,
      detail,
       // ç»„盘弹窗相关
      PalletDialog,    // å¼¹çª—组件(无需返回,注册即可,但变量需返回)
      palletVisible,
      currentPalletDocNo,
      handleOpenPalletDialog,
      handlePalletBackSuccess
      //  // ç»„盘弹窗相关
      // PalletDialog,    // å¼¹çª—组件(无需返回,注册即可,但变量需返回)
      // palletVisible,
      // currentPalletDocNo,
      // handleOpenPalletDialog,
      // handlePalletBackSuccess
    };
  },
});