material_manage_system/frontend/src/components/business/StatusBadge.vue
2026-09-21 14:13:30 +08:00

33 lines
999 B
Vue

<template>
<el-tag :type="tagType" size="small">{{ label }}</el-tag>
</template>
<script setup>
import { computed } from 'vue'
const props = defineProps({
status: {
type: String,
required: true
}
})
const statusMap = {
pending: { type: 'warning', label: '待处理' },
processing: { type: '', label: '处理中' },
completed: { type: 'success', label: '已完成' },
rejected: { type: 'danger', label: '已拒绝' },
approved: { type: 'success', label: '已通过' },
cancelled: { type: 'info', label: '已取消' },
inbound: { type: 'success', label: '入库' },
outbound: { type: 'warning', label: '出库' },
stock_check: { type: 'info', label: '盘点' },
CREATE: { type: 'success', label: '新增' },
UPDATE: { type: 'primary', label: '更新' },
DELETE: { type: 'danger', label: '删除' }
}
const tagType = computed(() => statusMap[props.status]?.type || 'info')
const label = computed(() => statusMap[props.status]?.label || props.status)
</script>