2025-07-28 18:25:02 +08:00
|
|
|
|
<template>
|
2025-11-15 16:04:41 +08:00
|
|
|
|
<div>
|
2025-11-24 17:21:26 +08:00
|
|
|
|
<!-- 原材料名称(仅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">
|
2025-11-18 10:14:55 +08:00
|
|
|
|
<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>
|
2025-11-24 17:21:26 +08:00
|
|
|
|
<el-descriptions-item label="材质">{{ materialFull.material || '--' }}</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="表面处理">{{ materialFull.surfaceTreatment || '--' }}</el-descriptions-item>
|
2026-01-21 17:14:07 +08:00
|
|
|
|
<el-descriptions-item label="镀层质量">{{ materialFull.zincLayer || '--' }}</el-descriptions-item>
|
2025-11-24 17:21:26 +08:00
|
|
|
|
<el-descriptions-item label="厂家">{{ materialFull.manufacturer || '--' }}</el-descriptions-item>
|
2025-07-29 15:16:51 +08:00
|
|
|
|
</el-descriptions>
|
2025-11-24 17:21:26 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 触发元素(原材料名称文本) -->
|
|
|
|
|
|
<span slot="reference" class="material-name">
|
|
|
|
|
|
<slot name="default" :material="materialFull">
|
2026-01-10 09:57:44 +08:00
|
|
|
|
{{ materialFull.rawMaterialName || '未知' }}[{{ materialFull.specification || '无规格' }}]({{ materialFull.material || '无材质' }})-{{ materialFull.manufacturer || '无厂家' }}
|
2025-11-24 17:21:26 +08:00
|
|
|
|
</slot>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</el-popover>
|
2025-07-28 18:25:02 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2025-11-24 17:21:26 +08:00
|
|
|
|
import BomInfo from './BomInfo.vue'; // 保留导入(如需使用可解除注释)
|
2025-07-29 16:57:16 +08:00
|
|
|
|
|
2025-07-28 18:25:02 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: 'RawMaterialInfo',
|
2025-07-29 16:57:16 +08:00
|
|
|
|
components: {
|
|
|
|
|
|
BomInfo
|
|
|
|
|
|
},
|
2025-07-28 18:25:02 +08:00
|
|
|
|
props: {
|
2025-11-15 16:04:41 +08:00
|
|
|
|
material: {
|
|
|
|
|
|
type: Object,
|
2025-11-15 16:39:05 +08:00
|
|
|
|
default: () => ({})
|
2025-07-28 18:25:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2025-11-24 17:21:26 +08:00
|
|
|
|
// 移除showDetail:hover触发无需弹窗控制变量
|
2025-07-28 18:25:02 +08:00
|
|
|
|
};
|
|
|
|
|
|
},
|
2025-11-18 10:14:55 +08:00
|
|
|
|
computed: {
|
|
|
|
|
|
materialFull() {
|
2025-11-24 17:21:26 +08:00
|
|
|
|
// 完整的material,确保每个字段有默认值
|
2025-11-18 10:14:55 +08:00
|
|
|
|
if (!this.material) {
|
|
|
|
|
|
return {};
|
|
|
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
|
|
|
rawMaterialId: this.material.rawMaterialId || '',
|
|
|
|
|
|
rawMaterialName: this.material.rawMaterialName || '',
|
|
|
|
|
|
rawMaterialCode: this.material.rawMaterialCode || '',
|
|
|
|
|
|
specification: this.material.specification || '',
|
|
|
|
|
|
material: this.material.material || '',
|
2026-02-06 09:08:14 +08:00
|
|
|
|
surfaceTreatment: this.material.surfaceTreatmentDesc || '',
|
2025-11-18 10:14:55 +08:00
|
|
|
|
zincLayer: this.material.zincLayer || '',
|
|
|
|
|
|
manufacturer: this.material.manufacturer || '',
|
2025-11-24 17:21:26 +08:00
|
|
|
|
};
|
2025-11-18 10:14:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-11-24 17:21:26 +08:00
|
|
|
|
methods: {
|
|
|
|
|
|
// 移除click事件相关方法:无需点击触发
|
|
|
|
|
|
},
|
|
|
|
|
|
};
|
2025-07-28 18:25:02 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.material-name {
|
|
|
|
|
|
color: #1890ff;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
text-decoration: underline;
|
2025-11-24 17:21:26 +08:00
|
|
|
|
/* 优化hover触发区域 */
|
|
|
|
|
|
padding: 2px 4px;
|
2025-07-28 18:25:02 +08:00
|
|
|
|
}
|
2025-11-24 17:21:26 +08:00
|
|
|
|
</style>
|