| | |
| | | } from '#/api/mdm/item'; |
| | | import { $t } from '#/locales'; |
| | | |
| | | import { useGridColumns, useGridFormSchema } from './data'; |
| | | import { useGridColumns, useGridFormSchema, ITEM_TYPE_MAP, ITEM_TYPE_COLOR_MAP } from './data'; |
| | | import Form from './modules/form.vue'; |
| | | |
| | | defineOptions({ name: 'MdmItem' }); |
| | |
| | | ]" |
| | | /> |
| | | </template> |
| | | <template #itemType="{ row }"> |
| | | <Tag v-if="row.itemType === 1" color="green">原料</Tag> |
| | | <Tag v-else-if="row.itemType === 2" color="orange">半成品</Tag> |
| | | <Tag v-else-if="row.itemType === 3" color="blue">成品</Tag> |
| | | <Tag v-else-if="row.itemType === 4" color="purple">辅料</Tag> |
| | | </template> |
| | | <template #isBatchManaged="{ row }"> |
| | | <Tag v-if="row.isBatchManaged" color="success">是</Tag> |
| | | <Tag v-else>否</Tag> |
| | |
| | | icon: ACTION_ICON.EDIT, |
| | | auth: ['mdm:item:update'], |
| | | onClick: handleEdit.bind(null, row), |
| | | }, |
| | | { |
| | | label: row.status === 0 ? '停用' : '启用', |
| | | type: 'link', |
| | | auth: ['mdm:item:update'], |
| | | onClick: handleStatusChange.bind(null, row, row.status === 0), |
| | | }, |
| | | { |
| | | label: $t('common.delete'), |