14 小时以前 bbce6db600e6bb0cf2a3bb78bdf5ccff70b737a8
src/views/mes/pro/workorder/data.ts
@@ -3,6 +3,7 @@
import type { MesMdProductBomApi } from '#/api/mes/md/item/productBom';
import type { MesProWorkOrderApi } from '#/api/mes/pro/workorder';
import type { MesProWorkOrderBomApi } from '#/api/mes/pro/workorder/bom';
import type { MesProWorkOrderProcessApi } from '#/api/mes/pro/workorder/process';
import { h, markRaw } from 'vue';
@@ -11,14 +12,14 @@
  MesAutoCodeRuleCode,
  MesProWorkOrderSourceTypeEnum,
  MesProWorkOrderTypeEnum,
} from '../../../../packages/constants/src';
import { getDictOptions } from '../../../../packages/effects/hooks/src';
} from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { Button } from 'ant-design-vue';
import { generateAutoCode } from '#/api/mes/md/autocode/record';
import CrmCustomerSelect from '#/components/crm-customer-select.vue';
import { getRangePickerDefaultProps } from '#/utils';
import { MdClientSelect } from '#/views/mes/md/client/components';
import {
  MdItemSelect,
  MdProductBomSelect,
@@ -189,7 +190,7 @@
    {
      fieldName: 'clientId',
      label: '客户',
      component: markRaw(MdClientSelect),
      component: markRaw(CrmCustomerSelect),
      componentProps: {
        disabled: headerReadonly,
        placeholder: '请选择客户',
@@ -292,7 +293,7 @@
    {
      fieldName: 'clientId',
      label: '客户',
      component: markRaw(MdClientSelect),
      component: markRaw(CrmCustomerSelect),
      componentProps: {
        placeholder: '请选择客户',
      },
@@ -591,7 +592,7 @@
    {
      fieldName: 'clientId',
      label: '客户',
      component: markRaw(MdClientSelect),
      component: markRaw(CrmCustomerSelect),
      componentProps: {
        placeholder: '请选择客户',
      },
@@ -734,3 +735,109 @@
    },
  ];
}
/** 订单工序列表的字段 */
export function useProcessGridColumns(
  draggable = false,
): VxeTableGridOptions<MesProWorkOrderProcessApi.WorkOrderProcess>['columns'] {
  return [
    ...(draggable
      ? [
          {
            field: 'drag',
            title: '',
            width: 40,
            fixed: 'left',
            slots: { default: 'dragHandle' },
          } as const,
        ]
      : []),
    {
      type: 'expand',
      width: 50,
    } as const,
    {
      field: 'sort',
      title: '序号',
      width: 80,
    },
    {
      field: 'processCode',
      title: '工序编码',
      width: 120,
    },
    {
      field: 'processName',
      title: '工序名称',
      minWidth: 150,
    },
    {
      field: 'nextProcessName',
      title: '下一道工序',
      width: 120,
    },
    {
      field: 'linkType',
      title: '工序关系',
      width: 100,
      formatter: ({ cellValue }) => {
        const map: Record<number, string> = {
          0: '开始-开始',
          1: '结束-结束',
          2: '开始-结束',
          3: '结束-开始',
        };
        return map[cellValue] ?? '-';
      },
    },
    {
      field: 'prepareTime',
      title: '准备时间(分)',
      width: 100,
    },
    {
      field: 'waitTime',
      title: '等待时间(分)',
      width: 100,
    },
    {
      field: 'keyFlag',
      title: '关键工序',
      width: 80,
      slots: { default: 'keyFlag' },
    },
    {
      field: 'checkFlag',
      title: '质检工序',
      width: 80,
      slots: { default: 'checkFlag' },
    },
    {
      field: 'backflushFlag',
      title: '倒冲',
      width: 80,
      slots: { default: 'backflushFlag' },
    },
    {
      field: 'outputItemCode',
      title: '产出物料编码',
      width: 120,
    },
    {
      field: 'outputItemName',
      title: '产出物料名称',
      width: 120,
    },
    {
      field: 'remark',
      title: '备注',
      minWidth: 120,
    },
    {
      title: '操作',
      width: 120,
      fixed: 'right',
      slots: { default: 'actions' },
    },
  ];
}