Files
klp-oa/klp-ui/src/components/KLPService/Renderer/RawMaterialInfo.vue
砂糖 ae68b40ee6 refactor(wms): 重构物料信息展示逻辑,移除冗余组件
重构物料信息展示逻辑,统一使用itemName等字段替代原有的product和rawMaterial嵌套结构
删除不再使用的BomInfo、CategoryRenderer等冗余组件
新增report模块配置集中管理
优化代码结构,提升可维护性
2026-03-24 13:55:10 +08:00

79 lines
2.7 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div>
<!-- 原材料名称仅hover触发popover -->
<el-popover
trigger="hover"
placement="top"
width="400"
:visible-arrow="true"
append-to-body
popper-class="raw-material-info-popover"
>
<!-- popover 内容两列布局的描述列表 -->
<el-descriptions :column="2" class="popover-content">
<el-descriptions-item label="原材料名称">{{ materialFull.rawMaterialName || '--' }}</el-descriptions-item>
<!-- <el-descriptions-item label="原材料编码">{{ materialFull.rawMaterialCode || '--' }}</el-descriptions-item> -->
<el-descriptions-item label="规格">{{ materialFull.specification || '--' }}</el-descriptions-item>
<el-descriptions-item label="材质">{{ materialFull.material || '--' }}</el-descriptions-item>
<el-descriptions-item label="表面处理">{{ materialFull.surfaceTreatment || '--' }}</el-descriptions-item>
<el-descriptions-item label="镀层质量">{{ materialFull.zincLayer || '--' }}</el-descriptions-item>
<el-descriptions-item label="厂家">{{ materialFull.manufacturer || '--' }}</el-descriptions-item>
</el-descriptions>
<!-- 触发元素原材料名称文本 -->
<span slot="reference" class="material-name">
<slot name="default" :material="materialFull">
{{ materialFull.rawMaterialName || '未知' }}[{{ materialFull.specification || '无规格' }}]({{ materialFull.material || '无材质' }})-{{ materialFull.manufacturer || '无厂家' }}-{{ materialFull.zincLayer || '无镀层' }}
</slot>
</span>
</el-popover>
</div>
</template>
<script>
export default {
name: 'RawMaterialInfo',
props: {
material: {
type: Object,
default: () => ({})
}
},
data() {
return {
// 移除showDetailhover触发无需弹窗控制变量
};
},
computed: {
materialFull() {
// 完整的material确保每个字段有默认值
if (!this.material) {
return {};
}
return {
rawMaterialId: this.material.itemId || '',
rawMaterialName: this.material.itemName || '',
// rawMaterialCode: this.material.rawMaterialCode || '',
specification: this.material.specification || '',
material: this.material.material || '',
surfaceTreatment: this.material.surfaceTreatmentDesc || '',
zincLayer: this.material.zincLayer || '',
manufacturer: this.material.manufacturer || '',
};
}
},
methods: {
// 移除click事件相关方法无需点击触发
},
};
</script>
<style scoped>
.material-name {
color: #1890ff;
cursor: pointer;
text-decoration: underline;
/* 优化hover触发区域 */
padding: 2px 4px;
}
</style>