xiaoyi
6 天以前 872bd2916ea03acf1467e5df73071c49e8317693
feat(mes): 物料新增颜色字段 - 表单/列表/搜索/选择弹窗/BOM 全链路展示

1. 物料表单新增「颜色」输入项,列表新增颜色列,搜索条件支持按颜色筛选

2. 物料选择弹窗(生产流程各处选料)新增颜色列与颜色搜索,选中回显与 Tooltip 均显示颜色

3. 产品 BOM 子表新增颜色列
已修改3个文件
46 ■■■■■ 文件已修改
src/api/mes/md/item/index.ts 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/md/item/components/select.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/md/item/data.ts 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mes/md/item/index.ts
@@ -9,6 +9,7 @@
    code?: string; // 物料编码
    name?: string; // 物料名称
    specification?: string; // 规格型号
    color?: string; // 颜色
    unitMeasureId?: number; // 计量单位编号
    unitMeasureName?: string; // 计量单位名称
    itemTypeId?: number; // 物料分类编号
src/views/mes/md/item/components/select.vue
@@ -43,7 +43,9 @@
const displayLabel = computed(() => {
  if (selectedItems.value.length === 0) return '';
  return selectedItems.value.map(item =>
    [item.name, item.specification, item.code ? `(${item.code})` : ''].filter(Boolean).join(' '),
    [item.name, item.specification, item.color, item.code ? `(${item.code})` : '']
      .filter(Boolean)
      .join(' '),
  ).join('、');
});
const showClear = computed(
@@ -150,6 +152,7 @@
          <div>编码:{{ selectedItems[0].code || '-' }}</div>
          <div>名称:{{ selectedItems[0].name || '-' }}</div>
          <div>规格:{{ selectedItems[0].specification || '-' }}</div>
          <div>颜色:{{ selectedItems[0].color || '-' }}</div>
          <div>单位:{{ selectedItems[0].unitMeasureName || '-' }}</div>
        </div>
        <div v-else-if="selectedItems.length > 1" class="leading-6">
@@ -157,6 +160,7 @@
            <div>编码:{{ item.code || '-' }}</div>
            <div>名称:{{ item.name || '-' }}</div>
            <div>规格:{{ item.specification || '-' }}</div>
            <div>颜色:{{ item.color || '-' }}</div>
            <div>单位:{{ item.unitMeasureName || '-' }}</div>
          </div>
        </div>
src/views/mes/md/item/data.ts
@@ -83,6 +83,15 @@
      },
    },
    {
      fieldName: 'color',
      label: '颜色',
      component: 'Input',
      componentProps: {
        maxLength: 64,
        placeholder: '请输入颜色,用于区分同型号不同颜色的物料',
      },
    },
    {
      fieldName: 'unitMeasureId',
      label: '单位',
      component: markRaw(MdUnitMeasureSelect),
@@ -226,6 +235,12 @@
      componentProps: { allowClear: true, placeholder: '请输入规格型号' },
    },
    {
      fieldName: 'color',
      label: '颜色',
      component: 'Input',
      componentProps: { allowClear: true, placeholder: '请输入颜色' },
    },
    {
      fieldName: 'status',
      label: '状态',
      component: 'Select',
@@ -280,6 +295,12 @@
      field: 'specification',
      title: '规格型号',
      minWidth: 160,
    },
    {
      field: 'color',
      title: '颜色',
      width: 110,
      align: 'center',
    },
    {
      field: 'unitMeasureName',
@@ -365,6 +386,12 @@
      component: 'Input',
      componentProps: { allowClear: true, placeholder: '请输入规格型号' },
    },
    {
      fieldName: 'color',
      label: '颜色',
      component: 'Input',
      componentProps: { allowClear: true, placeholder: '请输入颜色' },
    },
  ];
}
@@ -390,6 +417,12 @@
      title: '规格型号',
      minWidth: 140,
      align: 'left',
    },
    {
      field: 'color',
      title: '颜色',
      width: 100,
      align: 'center',
    },
    {
      field: 'unitMeasureName',
@@ -447,6 +480,12 @@
        align: 'center',
      },
      {
        field: 'bomItemColor',
        title: '颜色',
        width: 100,
        align: 'center',
      },
      {
        field: 'unitMeasureName',
        title: '单位',
        width: 80,