2 天以前 53e9b23a40186efd149fd5c5350b5eced1f69920
src/views/wls/materialstock/data.ts
@@ -8,7 +8,6 @@
import { DICT_TYPE } from '@vben/constants';
import { MdItemSelect } from '#/views/mes/md/item/components';
import { MdVendorSelect } from '#/views/mes/md/vendor/components';
import {
  WmWarehouseAreaSelect,
@@ -63,6 +62,20 @@
      },
    },
    {
      fieldName: 'stockState',
      label: '库存状态',
      component: 'Select',
      componentProps: {
        allowClear: true,
        options: [
          { label: '暂存库(待质检)', value: 10 },
          { label: '合格库(正式库存)', value: 20 },
          { label: '已出库(销售扣减)', value: 30 },
        ],
        placeholder: '请选择库存状态',
      },
    },
    {
      fieldName: 'frozen',
      label: '是否冻结',
      component: 'Select',
@@ -84,6 +97,7 @@
    newFrozen: boolean,
    row: MesWmMaterialStockApi.MaterialStock,
  ) => Promise<boolean | undefined>,
  onMove?: (row: MesWmMaterialStockApi.MaterialStock) => void,
): VxeTableGridOptions<MesWmMaterialStockApi.MaterialStock>['columns'] {
  const { hasAccessByCodes } = useAccess();
  return [
@@ -101,6 +115,21 @@
      field: 'specification',
      title: '规格型号',
      minWidth: 120,
    },
    {
      field: 'stockState',
      title: '库存状态',
      width: 150,
      cellRender: {
        name: 'CellTag',
        props: {
          options: [
            { label: '暂存库', value: 10, color: 'orange' },
            { label: '合格库', value: 20, color: 'green' },
            { label: '已出库', value: 30, color: 'default' },
          ],
        },
      },
    },
    {
      field: 'quantity',
@@ -190,6 +219,16 @@
        },
      },
    },
    ...(onMove
      ? [
          {
            title: '操作',
            width: 80,
            fixed: 'right' as const,
            slots: { default: 'actions' } as const,
          },
        ]
      : []),
  ];
}
@@ -197,19 +236,21 @@
export function useSelectGridFormSchema(): VbenFormSchema[] {
  return [
    {
      fieldName: 'itemId',
      fieldName: 'itemName',
      label: '物料',
      component: markRaw(MdItemSelect),
      component: 'Input',
      componentProps: {
        placeholder: '请选择物料',
        allowClear: true,
        placeholder: '请输入物料名称',
      },
    },
    {
      fieldName: 'vendorId',
      fieldName: 'vendorName',
      label: '供应商',
      component: markRaw(MdVendorSelect),
      component: 'Input',
      componentProps: {
        placeholder: '请选择供应商',
        allowClear: true,
        placeholder: '请输入供应商名称',
      },
    },
    {