增加操作类型

This commit is contained in:
2025-11-27 18:03:20 +08:00
parent ef82203ed7
commit 19d4dd64d4

View File

@@ -12,6 +12,11 @@
{{ formatRFC3339(scope.row.last_updated) }}
</template>
</el-table-column>
<el-table-column prop="last_operation_source_type" label="上次操作类型">
<template #default="scope">
{{ StockLogSourceType[scope.row.last_operation_source_type] || '--' }}
</template>
</el-table-column>
<el-table-column label="操作" width="120">
<template #default="scope">
<el-button size="small" type="primary" @click="handleAdjust(scope.row)">调整库存</el-button>
@@ -34,7 +39,8 @@
import { ref, onMounted, watch } from 'vue';
import { InventoryApi } from '../../api/inventory';
import { ElMessage } from 'element-plus';
import { formatRFC3339, formatWeight } from '../../utils/format'; // 导入 formatWeight
import { formatRFC3339, formatWeight } from '../../utils/format';
import { StockLogSourceType } from '../../enums'; // 导入 StockLogSourceType
export default {
name: 'StockListTable',
@@ -122,8 +128,9 @@ export default {
handleSizeChange,
handleCurrentChange,
formatRFC3339,
formatWeight, // 暴露给模板
handleAdjust, // 暴露给模板
formatWeight,
handleAdjust,
StockLogSourceType, // 暴露 StockLogSourceType 给模板
};
},
};