heshaofeng
7 天以前 461524a7a1def4532b9af4ab40733f899f360db7
ÏîÄ¿´úÂë/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",
@@ -47,22 +23,20 @@
      inboundOrderNo: "",
      upperOrderNo: "",
      remark: "",
      orderStatus: "",
      warehouseId: "",
      supplierId: "",
      createType: "",
      isTestMaterials: "",
      operator: "",
    });
    const editFormOptions = ref([
      [
        {
          title: "单据类型",
          required: true,
          field: "orderType",
          type: "select",
          dataKey: "inOrderType",
          data: [],
          hidden:true
        },
        {
          field: "inboundOrderNo",
          title: "单据编号",
          type: "string",
          readonly: true,
        },
        {
          title: "上游单据编号",
@@ -75,27 +49,50 @@
          type: "textarea",
        },
      ],
      [
        {
          title: "业务类型",
          field: "businessType",
          type: "select",
          dataKey: "businessType",
          data: [],
          require: true,
        },
        {
          title: "是否分批",
          field: "isBatch",
          type: "select",
          dataKey: "enable",
          data: [],
          require: true,
        },
        {
          title: "厂区",
          field: "factoryArea",
          type: "string",
        },
      ]
    ]);
    const searchFormFields = ref({
      inboundOrderNo: "",
      upperOrderNo: "",
      orderType: "0",
      orderType: "",
      orderStatus: "",
      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",
          data: [0],
          hidden:true
          dataKey: "inboundbusinessType",
          data: [],
        },
        {
          title: "单据状态",
@@ -115,6 +112,7 @@
        },
        { title: "创建者", field: "creater", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
        { title: "物料编号", field: "materielCode", type: "like" },
      ],
    ]);
    const columns = ref([
@@ -150,7 +148,7 @@
        width: 150,
        align: "left",
        bind: { key: "inOrderType", data: [] },
        hidden:true
        hidden: true
      },
      {
        field: "businessType",
@@ -169,6 +167,13 @@
        bind: { key: "inboundState", data: [] },
      },
      {
        field: "orderStatistics",
        title: "单据物料统计",
        type: "string",
        width: 300,
        align: "left",
      },
      {
        field: "createType",
        title: "创建方式",
        type: "string",
@@ -177,11 +182,30 @@
        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: "isTestMaterials",
        title: "是否试产",
        width: 120,
        bind: { key: "isTestMaterials", data: [{ key: 0, value: "非试产物料" }, { key: 1, value: "试产物料" }] },
      },
      {
        field: "creater",
@@ -198,7 +222,7 @@
        align: "left",
      },
      {
        field: "modifier",
        field: "operator",
        title: "修改人",
        type: "string",
        width: 100,
@@ -209,13 +233,6 @@
        title: "修改时间",
        type: "datetime",
        width: 160,
        align: "left",
      },
      {
        field: "remark",
        title: "备注",
        type: "string",
        width: 100,
        align: "left",
      },
    ]);
@@ -251,12 +268,12 @@
          required: true,
        },
        {
          field: "materielCode",
          field: "materielName",
          title: "物料名称",
          type: "string",
          width: 120,
          width: 150,
          align: "left",
          bind: { key: "MaterielNames", data: [] },
          edit: { type: "" },
        },
        {
          field: "batchNo",
@@ -282,6 +299,7 @@
          type: "decimal",
          width: 90,
          align: "left",
          edit: { type: "" },
          required: true
        },
        {
@@ -294,12 +312,38 @@
          required: true,
        },
        {
          field: "outBoxbarcodes",
          title: "外箱条码",
          type: "decimal",
          width: 90,
          align: "left",
          edit: { type: "" },
        },
        {
          field: "orderQuantity",
          title: "单据数量",
          type: "decimal",
          width: 90,
          align: "left",
          edit: { type: "number" },
          required: true,
        },
        {
          field: "barcodeQty",
          title: "条码数量",
          type: "decimal",
          width: 90,
          align: "left",
          edit: { type: "number" },
          required: true,
        },
        {
          field: "barcodeUnit",
          title: "条码单位",
          type: "string",
          width: 90,
          align: "left",
          edit: { type: "" },
          required: true,
        },
        {
@@ -317,12 +361,28 @@
          align: "left",
        },
        {
          field: "unit",
          title: "单位",
          type: "string",
          width: 90,
          align: "left",
          edit: { type: "" },
          required: true,
        },
        {
          field: "orderDetailStatus",
          title: "订单明细状态",
          type: "string",
          width: 100,
          align: "left",
          bind: { key: "orderDetailStatusEnum", data: [] },
        },
        {
          field: "palletCode",
          title: "已组托盘号",
          type: "string",
          width: 100,
          align: "left",
        },
        {
          field: "creater",
@@ -363,20 +423,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 +434,12 @@
      searchFormOptions,
      columns,
      detail,
       // ç»„盘弹窗相关
      PalletDialog,    // å¼¹çª—组件(无需返回,注册即可,但变量需返回)
      palletVisible,
      currentPalletDocNo,
      handleOpenPalletDialog,
      handlePalletBackSuccess
      //  // ç»„盘弹窗相关
      // PalletDialog,    // å¼¹çª—组件(无需返回,注册即可,但变量需返回)
      // palletVisible,
      // currentPalletDocNo,
      // handleOpenPalletDialog,
      // handlePalletBackSuccess
    };
  },
});