银川
1.销售订单生产状态不匹配,
2.采购订单中没有退货状态字段,筛选项有退货状态
3.采购申请添加查看订单、查看审批功能
4.物料管理与mes产品管理的联动逻辑修改
已修改21个文件
194 ■■■■■ 文件已修改
src/api/erp/purchase/request/index.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mdm/item/index.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mes/pro/task/index.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/file-preview/file-preview-modal.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/mdm/data.ts 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/mdm/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/purchase/order/data.ts 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/purchase/order/index.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/purchase/request/index.vue 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/sale/order/data.ts 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/sale/order/index.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/pro/task/data.ts 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/pro/task/index.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/pro/task/modules/schedule-form.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/pro/task/modules/task-form.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/pro/task/modules/task-list.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/pro/workorder-center/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/pro/workorder/modules/form.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/qc/iqc/index.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/workbench/components/TaskListPanel.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/wls/arrivalnotice/modules/line-list.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/erp/purchase/request/index.ts
@@ -25,6 +25,7 @@
    productNames?: string; // 产品名称列表
    orderId?: number; // 生成的采购订单编号
    orderNo?: string; // 生成的采购订单号
    processInstanceId?: number; // 审批流程实例编号
    items?: PurchaseRequestItem[]; // 申请明细
    createTime?: string; // 创建时间
  }
src/api/mdm/item/index.ts
@@ -39,6 +39,7 @@
    createTime?: string;
    // 同步相关字段
    syncMes?: boolean;
    syncedMes?: boolean; // 是否已同步到 MES
    // 批次属性配置字段
    produceDateFlag?: boolean;
    expireDateFlag?: boolean;
src/api/mes/pro/task/index.ts
@@ -39,6 +39,7 @@
    colorCode?: string; // 甘特图显示颜色
    status?: number; // 任务状态
    checkFlag?: boolean; // 是否质检(派生自工艺路线工序)
    backflushFlag?: boolean; // 是否倒冲(派生自工艺路线工序)
    remark?: string; // 备注
  }
src/components/file-preview/file-preview-modal.vue
@@ -14,8 +14,7 @@
const VueOfficeExcel = defineAsyncComponent(() => import('@vue-office/excel'));
const VueOfficePptx = defineAsyncComponent(() => import('@vue-office/pptx'));
// @vue-office/excel 需要额外导入 CSS
import '@vue-office/excel/lib/v3/style.css';
// @vue-office/excel CSS 通过 vite.config.ts 的 css.preprocessorOptions 注入
const props = withDefaults(
  defineProps<{
src/views/basicData/mdm/data.ts
@@ -282,17 +282,6 @@
      rules: z.boolean().default(false),
    },
    {
      component: "Switch",
      fieldName: "syncMes",
      label: "同步到 MES",
      componentProps: {
        class: "w-auto",
        checkedChildren: "是",
        unCheckedChildren: "否",
      },
      rules: z.boolean().default(false),
    },
    {
      component: "InputNumber",
      fieldName: "expiryDay",
      label: "有效期(天)",
@@ -552,27 +541,36 @@
      },
    },
    {
      field: "isBatchManaged",
      title: "批次管理",
      minWidth: 80,
      slots: { default: "isBatchManaged" },
    },
    {
      field: "status",
      title: "状态",
      minWidth: 80,
      cellRender: {
        name: "CellDict",
        props: { type: DICT_TYPE.COMMON_STATUS },
      },
    },
    {
      field: "createTime",
      title: "创建时间",
      minWidth: 180,
      formatter: "formatDateTime",
    },
    {
      field: "isBatchManaged",
      title: "批次管理",
      width: 80,
      fixed: "right",
      slots: { default: "isBatchManaged" },
    },
    {
      field: "syncedMes",
      title: "同步状态",
      width: 90,
      fixed: "right",
      slots: { default: "syncedMes" },
    },
    {
      field: "status",
      title: "状态",
      width: 80,
      fixed: "right",
      cellRender: {
        name: "CellDict",
        props: { type: DICT_TYPE.COMMON_STATUS },
      },
    },
    {
      title: "操作",
      width: 180,
      fixed: "right",
src/views/basicData/mdm/index.vue
@@ -231,6 +231,10 @@
        <Tag v-if="row.isBatchManaged" color="success">是</Tag>
        <Tag v-else>否</Tag>
      </template>
      <template #syncedMes="{ row }">
        <Tag v-if="row.syncedMes" color="success">已同步</Tag>
        <Tag v-else color="default">未同步</Tag>
      </template>
      <template #actions="{ row }">
        <TableAction
          :actions="[
src/views/erp/purchase/order/data.ts
@@ -330,20 +330,6 @@
        allowClear: true,
      },
    },
    {
      fieldName: 'returnStatus',
      label: '退货状态',
      component: 'Select',
      componentProps: {
        options: [
          { label: '未退货', value: 0 },
          { label: '部分退货', value: 1 },
          { label: '全部退货', value: 2 },
        ],
        placeholder: '请选择退货状态',
        allowClear: true,
      },
    },
  ];
}
src/views/erp/purchase/order/index.vue
@@ -2,7 +2,8 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { ErpPurchaseOrderApi } from '#/api/erp/purchase/order';
import { ref } from 'vue';
import { onMounted, ref } from 'vue';
import { useRoute } from 'vue-router';
import { Page, useVbenModal } from '@vben/common-ui';
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
@@ -24,6 +25,8 @@
/** ERP 采购订单列表 */
defineOptions({ name: 'ErpPurchaseOrder' });
const route = useRoute();
const [FormModal, formModalApi] = useVbenModal({
  connectedComponent: Form,
@@ -146,6 +149,13 @@
    checkboxChange: handleRowCheckboxChange,
  },
});
onMounted(() => {
  const id = route.query.id;
  if (id) {
    formModalApi.setData({ formType: 'detail', id: Number(id) }).open();
  }
});
</script>
<template>
src/views/erp/purchase/request/index.vue
@@ -3,6 +3,7 @@
import type { ErpPurchaseRequestApi } from '#/api/erp/purchase/request';
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import { confirm, Page, useVbenModal } from '@vben/common-ui';
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
@@ -26,6 +27,8 @@
/** ERP 采购申请列表 */
defineOptions({ name: 'ErpPurchaseRequest' });
const router = useRouter();
const [FormModal, formModalApi] = useVbenModal({
  connectedComponent: Form,
@@ -115,6 +118,16 @@
/** 查看详情 */
function handleDetail(row: ErpPurchaseRequestApi.PurchaseRequest) {
  formModalApi.setData({ formType: 'detail', id: row.id }).open();
}
/** 查看审批详情 */
function handleViewProcess(row: ErpPurchaseRequestApi.PurchaseRequest) {
  router.push({ name: 'BpmProcessInstanceDetail', query: { id: row.processInstanceId } });
}
/** 查看采购订单 */
function handleViewOrder(row: ErpPurchaseRequestApi.PurchaseRequest) {
  router.push({ name: 'ErpPurchaseOrder', query: { id: row.orderId } });
}
const [Grid, gridApi] = useVbenVxeGrid({
@@ -234,6 +247,18 @@
              onClick: handleGenerateOrder.bind(null, row),
            },
            {
              label: '查看审批',
              type: 'link',
              ifShow: () => row.status !== 0,
              onClick: handleViewProcess.bind(null, row),
            },
            {
              label: '查看订单',
              type: 'link',
              ifShow: () => !!row.orderId,
              onClick: handleViewOrder.bind(null, row),
            },
            {
              label: $t('common.delete'),
              type: 'link',
              danger: true,
src/views/erp/sale/order/data.ts
@@ -399,24 +399,11 @@
      component: 'Select',
      componentProps: {
        options: [
          { label: '无需生产', value: -1 },
          { label: '未完成', value: 0 },
          { label: '已完成', value: 1 },
        ],
        placeholder: '请选择生产状态',
        allowClear: true,
      },
    },
    {
      fieldName: 'returnStatus',
      label: '退货状态',
      component: 'Select',
      componentProps: {
        options: [
          { label: '未退货', value: 0 },
          { label: '部分退货', value: 1 },
          { label: '全部退货', value: 2 },
        ],
        placeholder: '请选择退货状态',
        allowClear: true,
      },
    },
src/views/erp/sale/order/index.vue
@@ -174,10 +174,19 @@
    proxyConfig: {
      ajax: {
        query: async ({ page }, formValues) => {
          // 生产状态搜索参数转换:-1(无需生产) → needProduction=0
          const { productionStatus, ...rest } = formValues;
          const params: Record<string, any> = { ...rest };
          if (productionStatus === -1) {
            params.needProduction = 0;
          } else if (productionStatus != null) {
            params.productionStatus = productionStatus;
            params.needProduction = 1;
          }
          return await getSaleOrderPage({
            pageNo: page.currentPage,
            pageSize: page.pageSize,
            ...formValues,
            ...params,
          });
        },
      },
src/views/mes/pro/task/data.ts
@@ -3,6 +3,8 @@
import type { MesProTaskApi } from '#/api/mes/pro/task';
import type { MesProWorkOrderApi } from '#/api/mes/pro/workorder';
import type { Ref } from 'vue';
import { markRaw } from 'vue';
import { DICT_TYPE } from '@vben/constants';
@@ -166,7 +168,7 @@
    },
    {
      title: '操作',
      width: 100,
      width: 160,
      fixed: 'right',
      slots: { default: 'actions' },
    },
@@ -376,7 +378,7 @@
}
/** 生产任务新增/修改的表单 */
export function useTaskFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
export function useTaskFormSchema(formApi?: VbenFormApi, workOrderQuantity?: Ref<number | undefined>): VbenFormSchema[] {
  return [
    {
      fieldName: 'workstationId',
@@ -391,6 +393,7 @@
      fieldName: 'quantity',
      label: '排产数量',
      component: 'InputNumber',
      description: () => workOrderQuantity?.value != null ? `订单数量:${workOrderQuantity.value}` : '',
      componentProps: {
        class: '!w-full',
        min: 0.01,
src/views/mes/pro/task/index.vue
@@ -166,13 +166,6 @@
              ifShow: row.status === MesProWorkOrderStatusEnum.CONFIRMED,
              onClick: handleSchedule.bind(null, row),
            },
            {
              label: '一键排产',
              type: 'link',
              auth: ['mes:pro-task:create'],
              ifShow: row.status === MesProWorkOrderStatusEnum.CONFIRMED,
              onClick: handleAutoSchedulePreview.bind(null, row),
            },
          ]"
        />
      </template>
src/views/mes/pro/task/modules/schedule-form.vue
@@ -144,6 +144,7 @@
          :process-id="rp.processId!"
          :route-id="currentRouteId"
          :work-order-id="workOrder.id!"
          :work-order-quantity="workOrder.quantity"
        />
      </Card>
    </template>
src/views/mes/pro/task/modules/task-form.vue
@@ -15,6 +15,7 @@
const emit = defineEmits(['success']);
const formData = ref<MesProTaskApi.Task>();
const workOrderQuantity = ref<number>(); // 订单数量(用于提示)
const context = ref<{
  colorCode?: string;
  itemId?: number;
@@ -67,16 +68,18 @@
  async onOpenChange(isOpen: boolean) {
    if (!isOpen) {
      formData.value = undefined;
      workOrderQuantity.value = undefined;
      context.value = {};
      return;
    }
    formApi.setState({ schema: useTaskFormSchema(formApi) });
    formApi.setState({ schema: useTaskFormSchema(formApi, workOrderQuantity) });
    // 加载数据
    const data = modalApi.getData<{
      colorCode?: string;
      id?: number;
      itemId?: number;
      processId?: number;
      quantity?: number;
      routeId?: number;
      workOrderId?: number;
    }>();
@@ -98,9 +101,11 @@
      routeId: data.routeId,
      workOrderId: data.workOrderId,
    };
    workOrderQuantity.value = data.quantity;
    await formApi.setValues({
      colorCode: data.colorCode || '#00AEF3',
      duration: 1,
      quantity: data.quantity,
    });
  },
});
src/views/mes/pro/task/modules/task-list.vue
@@ -22,6 +22,7 @@
  processId: number;
  routeId: number;
  workOrderId: number;
  workOrderQuantity?: number;
}>();
const editable = computed(() => !props.disabled); // 是否可维护任务
@@ -43,6 +44,7 @@
      colorCode: props.colorCode,
      itemId: props.itemId,
      processId: props.processId,
      quantity: props.workOrderQuantity,
      routeId: props.routeId,
      workOrderId: props.workOrderId,
    })
src/views/mes/pro/workorder-center/index.vue
@@ -35,7 +35,7 @@
  destroyOnClose: true,
});
const [SchedulePreviewModal, schedulePreviewModalApi] = useVbenModal({
const [SchedulePreviewModalWrap, schedulePreviewModalApi] = useVbenModal({
  connectedComponent: SchedulePreviewModal,
  destroyOnClose: true,
});
@@ -164,7 +164,7 @@
<template>
  <Page auto-content-height>
    <QuickFeedbackModal @success="handleFeedbackSuccess" />
    <SchedulePreviewModal @success="handleRefresh" />
    <SchedulePreviewModalWrap @success="handleRefresh" />
    <Grid table-title="工单中心">
      <template #toolbar-tools>
src/views/mes/pro/workorder/modules/form.vue
@@ -110,7 +110,9 @@
        ? '确认'
        : isFinish.value
          ? '完成'
          : undefined,
          : isCreateMode.value
            ? '新增'
            : undefined,
    });
  }
src/views/mes/qc/iqc/index.vue
@@ -2,6 +2,9 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MesQcIqcApi } from '#/api/mes/qc/iqc';
import { onMounted } from 'vue';
import { useRoute } from 'vue-router';
import { Page, useVbenModal } from '@vben/common-ui';
import { MesQcStatusEnum } from '@vben/constants';
import { downloadFileFromBlobPart } from '@vben/utils';
@@ -14,6 +17,10 @@
import { useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
defineOptions({ name: 'MesQcIqc' });
const route = useRoute();
const [FormModal, formModalApi] = useVbenModal({
  connectedComponent: Form,
@@ -90,6 +97,13 @@
    },
  } as VxeTableGridOptions<MesQcIqcApi.Iqc>,
});
onMounted(() => {
  const id = route.query.id;
  if (id) {
    formModalApi.setData({ formType: 'detail', id: Number(id) }).open();
  }
});
</script>
<template>
src/views/mes/workbench/components/TaskListPanel.vue
@@ -19,13 +19,13 @@
const searchKeyword = ref('');
/** 先按工作站工序过滤,再按搜索关键字匹配 */
const filteredList = computed(() => {
  const kw = searchKeyword.value.trim().toLowerCase();
  if (!kw) return props.list;
  return props.list.filter((row) => {
    const fields = [
      row.code,
      row.name,
      row.workOrderCode,
      row.workOrderName,
      row.itemCode,
@@ -86,6 +86,13 @@
            >
              质检
            </Tag>
            <Tag
              v-if="item.backflushFlag"
              color="purple"
              class="task-card__check-tag"
            >
              倒冲
            </Tag>
            <span
              class="task-card__rate"
              :style="{ color: getProgressColor(item.feedbackRate) }"
src/views/wls/arrivalnotice/modules/line-list.vue
@@ -72,7 +72,7 @@
/** 跳转 IQC 检验单详情 */
function handleOpenIqc(row: MesWmArrivalNoticeLineApi.ArrivalNoticeLine) {
  if (row.iqcId) {
    router.push({ path: '/mes/qc/iqc', query: { id: row.iqcId } });
    router.push({ name: 'MesQcIqc', query: { id: row.iqcId } });
  }
}