BOM展示组件封装

This commit is contained in:
砂糖
2025-07-29 15:16:51 +08:00
parent 3b81c26db7
commit ef7035cfbd
3 changed files with 86 additions and 17 deletions

View File

@@ -0,0 +1,41 @@
<template>
<div>
<el-descriptions :column="1" border v-if="bomInfo.length > 0">
<el-descriptions-item v-for="item in bomInfo" :key="item.attrKey" :label="item.attrKey">
{{ item.attrValue }}
</el-descriptions-item>
</el-descriptions>
<div v-else>
<el-empty description="暂无BOM信息" />
</div>
</div>
</template>
<script>
import { listBomItem } from '../../../api/wms/bomItem';
export default {
name: 'BomInfo',
props: {
bomId: {
type: [String, Number],
required: true
}
},
data() {
return {
bomInfo: []
}
},
created() {
this.getBomInfo();
},
methods: {
getBomInfo() {
listBomItem({ bomId: this.bomId }).then(res => {
this.bomInfo = res.rows;
})
}
}
}
</script>