heshaofeng
2025-12-26 32898366256ac7a99c4ecdd094e05e54f8a7e621
ÏîÄ¿´úÂë/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,7 +33,7 @@
          type: "select",
          dataKey: "inOrderType",
          data: [],
          hidden:true
          hidden: true
        },
        {
          field: "inboundOrderNo",
@@ -79,7 +55,7 @@
    const searchFormFields = ref({
      inboundOrderNo: "",
      upperOrderNo: "",
      orderType: "0",
      orderType: "",
      orderStatus: "",
      createType: "",
      creater: "",
@@ -87,15 +63,14 @@
    });
    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",
          data: [0],
          hidden:true
          dataKey: "documentTypeEmun",
          data: [],
        },
        {
          title: "单据状态",
@@ -150,7 +125,7 @@
        width: 150,
        align: "left",
        bind: { key: "inOrderType", data: [] },
        hidden:true
        hidden: true
      },
      {
        field: "businessType",
@@ -169,12 +144,32 @@
        bind: { key: "inboundState", data: [] },
      },
      {
        field: "orderStatistics",
        title: "单据物料统计",
        type: "string",
        width: 230,
        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: "回传失败" }] },
      },
      {
        field: "factoryArea",
@@ -211,13 +206,6 @@
        width: 160,
        align: "left",
      },
      {
        field: "remark",
        title: "备注",
        type: "string",
        width: 100,
        align: "left",
      },
    ]);
    const detail = ref({
      cnName: "入库单明细",
@@ -245,24 +233,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,
@@ -271,7 +259,7 @@
          field: "supplyCode",
          title: "供应商编号",
          type: "decimal",
          width: 90,
          width: 100,
          align: "left",
          edit: { type: "" },
          required: true,
@@ -288,7 +276,7 @@
          field: "barcode",
          title: "条码",
          type: "decimal",
          width: 90,
          width: 180,
          align: "left",
          edit: { type: "" },
          required: true,
@@ -306,24 +294,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: "创建人",
@@ -363,20 +366,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,
@@ -387,12 +377,12 @@
      searchFormOptions,
      columns,
      detail,
       // ç»„盘弹窗相关
      PalletDialog,    // å¼¹çª—组件(无需返回,注册即可,但变量需返回)
      palletVisible,
      currentPalletDocNo,
      handleOpenPalletDialog,
      handlePalletBackSuccess
      //  // ç»„盘弹窗相关
      // PalletDialog,    // å¼¹çª—组件(无需返回,注册即可,但变量需返回)
      // palletVisible,
      // currentPalletDocNo,
      // handleOpenPalletDialog,
      // handlePalletBackSuccess
    };
  },
});