gaoluyang
2026-08-12 c64bb94c7e1758f47e8c946e4656a71bb5fd53e8
src/views/mes/md/workstation/modules/form.vue
@@ -6,7 +6,7 @@
  import { computed, ref } from "vue";
  import { useVbenModal } from "@vben/common-ui";
  import { BarcodeBizTypeEnum } from "@vben/constants";
  // import { BarcodeBizTypeEnum } from "@vben/constants";
  import { Button, message, Tabs } from "ant-design-vue";
@@ -17,7 +17,7 @@
    updateWorkstation,
  } from "#/api/mes/md/workstation";
  import { $t } from "#/locales";
  import { BarcodeDetail } from "#/views/wls/barcode/components";
  // import { BarcodeDetail } from "#/views/wls/barcode/components";
  import { useFormSchema } from "../data";
  import MachineList from "./machine-list.vue";
@@ -28,7 +28,7 @@
  const formType = ref<FormType>("create"); // 表单模式
  const subTabsName = ref("machine"); // 当前资源页签
  const formData = ref<MesMdWorkstationApi.Workstation>();
  const barcodeDetailRef = ref<InstanceType<typeof BarcodeDetail>>(); // 条码详情弹窗
  // const barcodeDetailRef = ref<InstanceType<typeof BarcodeDetail>>(); // 条码详情弹窗
  const isDetail = computed(() => formType.value === "detail"); // 是否查看模式
  const getTitle = computed(() => {
@@ -53,17 +53,17 @@
  });
  /** 查看工作站条码 */
  function handleBarcode() {
    if (!formData.value?.id) {
      return;
    }
    barcodeDetailRef.value?.openByBusiness(
      formData.value.id,
      BarcodeBizTypeEnum.WORKSTATION,
      formData.value.code,
      formData.value.name
    );
  }
  // function handleBarcode() {
  //   if (!formData.value?.id) {
  //     return;
  //   }
  //   barcodeDetailRef.value?.openByBusiness(
  //     formData.value.id,
  //     BarcodeBizTypeEnum.WORKSTATION,
  //     formData.value.code,
  //     formData.value.name
  //   );
  // }
  const [Modal, modalApi] = useVbenModal({
    async onConfirm() {
@@ -146,13 +146,13 @@
    </Tabs>
    <template #prepend-footer>
      <div class="flex flex-auto items-center">
        <Button v-if="isDetail && formData?.id"
        <!-- <Button v-if="isDetail && formData?.id"
                type="primary"
                @click="handleBarcode">
          查看条码
        </Button>
        </Button> -->
      </div>
    </template>
    <BarcodeDetail ref="barcodeDetailRef" />
    <!-- <BarcodeDetail ref="barcodeDetailRef" /> -->
  </Modal>
</template>