gaoluyang
2026-08-12 c64bb94c7e1758f47e8c946e4656a71bb5fd53e8
src/views/mes/pro/workorder/index.vue
@@ -6,7 +6,6 @@
  import { Page, useVbenModal } from "@vben/common-ui";
  import {
    BarcodeBizTypeEnum,
    MesProWorkOrderStatusEnum,
    MesProWorkOrderTypeEnum,
  } from "@vben/constants";
@@ -22,7 +21,8 @@
    getWorkOrderPage,
  } from "#/api/mes/pro/workorder";
  import { $t } from "#/locales";
  import { BarcodeDetail } from "#/views/wls/barcode/components";
  import ArchiveDetail from '#/views/mes/pd/archive/modules/detail.vue';
// import { BarcodeDetail } from '#/views/wls/barcode/components';
  import { useGridColumns, useGridFormSchema } from "./data";
  import Form from "./modules/form.vue";
@@ -32,7 +32,8 @@
    destroyOnClose: true,
  });
  const barcodeDetailRef = ref<InstanceType<typeof BarcodeDetail>>(); // 条码详情弹窗
  const archiveDetailRef = ref<InstanceType<typeof ArchiveDetail>>();
// const barcodeDetailRef = ref<InstanceType<typeof BarcodeDetail>>(); // 条码详情弹窗
  /** 刷新表格 */
  function handleRefresh() {
@@ -87,14 +88,14 @@
  }
  /** 查看订单条码 */
  function handleBarcode(row: MesProWorkOrderApi.WorkOrder) {
    barcodeDetailRef.value?.openByBusiness(
      row.id!,
      BarcodeBizTypeEnum.WORKORDER,
      row.code,
      row.name
    );
  }
  // function handleBarcode(row: MesProWorkOrderApi.WorkOrder) {
  //   barcodeDetailRef.value?.openByBusiness(
  //     row.id!,
  //     BarcodeBizTypeEnum.WORKORDER,
  //     row.code,
  //     row.name
  //   );
  // }
  /** 导出表格 */
  async function handleExport() {
@@ -203,7 +204,9 @@
              label: '完成',
              type: 'link',
              auth: ['mes:pro-work-order:update'],
              ifShow: row.status === MesProWorkOrderStatusEnum.CONFIRMED,
              ifShow:
                row.status === MesProWorkOrderStatusEnum.CONFIRMED &&
                !!row.quantityProduced,
              onClick: handleFinish.bind(null, row),
            },
            {
@@ -217,15 +220,21 @@
                confirm: handleCancel.bind(null, row),
              },
            },
            // {
            //   label: '条码',
            //   type: 'link',
            //   auth: ['mes:pro-work-order:query'],
            //   onClick: handleBarcode.bind(null, row),
            // },
            {
              label: '条码',
              label: '归档',
              type: 'link',
              auth: ['mes:pro-work-order:query'],
              onClick: handleBarcode.bind(null, row),
              onClick: () => archiveDetailRef.value?.open(row.productCode),
            },
          ]" />
      </template>
    </Grid>
    <BarcodeDetail ref="barcodeDetailRef" />
    <!-- <BarcodeDetail ref="barcodeDetailRef" /> -->
    <ArchiveDetail ref="archiveDetailRef" />
  </Page>
</template>