| | |
| | | name: string; |
| | | barCode?: string; |
| | | specification?: string; |
| | | color?: string; // 颜色 |
| | | categoryId?: number; |
| | | categoryName?: string; |
| | | unitMeasureId?: number; |
| | |
| | | export interface PageParams extends PageParam { |
| | | code?: string; |
| | | name?: string; |
| | | color?: string; // 颜色(模糊匹配) |
| | | categoryId?: number; |
| | | itemType?: number; |
| | | status?: number; |
| | |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'color', |
| | | label: '颜色', |
| | | component: 'Input', |
| | | componentProps: { allowClear: true, placeholder: '请输入颜色' }, |
| | | }, |
| | | { |
| | | fieldName: 'categoryId', |
| | | label: '物料分类', |
| | | component: 'ApiSelect', |
| | |
| | | align: 'left', |
| | | }, |
| | | { |
| | | field: 'color', |
| | | title: '颜色', |
| | | minWidth: 100, |
| | | align: 'left', |
| | | }, |
| | | { |
| | | field: 'categoryId', |
| | | title: '物料分类', |
| | | minWidth: 120, |
| | |
| | | const hovering = ref(false); // 是否悬停 |
| | | const selectedItem = ref<MdmItemApi.Item>(); // 当前选中物料 |
| | | |
| | | const displayLabel = computed(() => selectedItem.value?.name ?? props.label ?? ''); // 选择器展示名称 |
| | | const displayLabel = computed(() => selectedItem.value |
| | | ? [selectedItem.value.name, selectedItem.value.specification, selectedItem.value.color].filter(Boolean).join(' ') |
| | | : props.label ?? ''); |
| | | const showClear = computed( |
| | | () => |
| | | props.allowClear && |
| | |
| | | <div>编码:{{ selectedItem.code || '-' }}</div> |
| | | <div>名称:{{ selectedItem.name || '-' }}</div> |
| | | <div>规格:{{ selectedItem.specification || '-' }}</div> |
| | | <div>颜色:{{ selectedItem.color || '-' }}</div> |
| | | <div>单位:{{ selectedItem.unitMeasureName || '-' }}</div> |
| | | </div> |
| | | </template> |
| | |
| | | }, |
| | | }, |
| | | { |
| | | component: "Input", |
| | | fieldName: "color", |
| | | label: "颜色", |
| | | componentProps: { |
| | | placeholder: "如:红色、金EF6F45", |
| | | allowClear: true, |
| | | }, |
| | | }, |
| | | { |
| | | component: "ApiSelect", |
| | | fieldName: "unitMeasureId", |
| | | label: "计量单位", |
| | |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: "color", |
| | | label: "颜色", |
| | | component: "Input", |
| | | componentProps: { |
| | | placeholder: "请输入颜色(模糊匹配)", |
| | | allowClear: true, |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: "status", |
| | | label: "状态", |
| | | component: "Select", |
| | |
| | | minWidth: 150, |
| | | }, |
| | | { |
| | | field: "color", |
| | | title: "颜色", |
| | | width: 120, |
| | | }, |
| | | { |
| | | field: "categoryName", |
| | | title: "物料分类", |
| | | minWidth: 120, |
| | |
| | | // 新增模式 |
| | | formData.value = undefined; |
| | | await formApi.resetForm(); |
| | | // 动态设置 schema 后 resetForm 不会自动带入字段默认值。 |
| | | await formApi.setValues({ isBatchManaged: false, syncMes: true, status: 0 }); |
| | | } |
| | | }, |
| | | }); |