refactor(wms/coil/label): 统一质量状态字段的显示逻辑
将三个标签页组件的质量状态展示逻辑抽离为复用的计算属性,把原始状态码转换为易读的中文描述,A/A+/A-/B/B+/B-统一显示为合格品,其他情况保留原始值
This commit is contained in:
@@ -66,7 +66,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="info-grid-item label-cell">产品等级</div>
|
<div class="info-grid-item label-cell">产品等级</div>
|
||||||
<div class="info-grid-item value-cell">
|
<div class="info-grid-item value-cell">
|
||||||
<div class="nob">{{ content.qualityStatus || '' }}</div>
|
<div class="nob">{{ qualityStatusDisplay }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 第五行:表面处理 + 剪切要求 -->
|
<!-- 第五行:表面处理 + 剪切要求 -->
|
||||||
@@ -181,6 +181,13 @@ export default {
|
|||||||
materialWithManufacturer() {
|
materialWithManufacturer() {
|
||||||
return this.content.material
|
return this.content.material
|
||||||
},
|
},
|
||||||
|
qualityStatusDisplay() {
|
||||||
|
const status = (this.content.qualityStatus || '').trim()
|
||||||
|
if (['A', 'A+', 'A-', 'B', 'B+', 'B-'].includes(status)) {
|
||||||
|
return '合格品'
|
||||||
|
}
|
||||||
|
return status
|
||||||
|
},
|
||||||
orderUnitDisplay() {
|
orderUnitDisplay() {
|
||||||
return (this.content.orderUnit || '').replace(/有限公司/g, '')
|
return (this.content.orderUnit || '').replace(/有限公司/g, '')
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="info-grid-item label-cell">质量状态</div>
|
<div class="info-grid-item label-cell">质量状态</div>
|
||||||
<div class="info-grid-item value-cell">
|
<div class="info-grid-item value-cell">
|
||||||
<div class="nob">{{ content.qualityStatus || '' }}</div>
|
<div class="nob">{{ qualityStatusDisplay }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 第五行:表面处理 + 剪切要求 -->
|
<!-- 第五行:表面处理 + 剪切要求 -->
|
||||||
@@ -182,6 +182,13 @@ export default {
|
|||||||
materialWithManufacturer() {
|
materialWithManufacturer() {
|
||||||
return this.content.material
|
return this.content.material
|
||||||
},
|
},
|
||||||
|
qualityStatusDisplay() {
|
||||||
|
const status = (this.content.qualityStatus || '').trim()
|
||||||
|
if (['A', 'A+', 'A-', 'B', 'B+', 'B-'].includes(status)) {
|
||||||
|
return '合格品'
|
||||||
|
}
|
||||||
|
return status
|
||||||
|
},
|
||||||
orderUnitDisplay() {
|
orderUnitDisplay() {
|
||||||
return (this.content.orderUnit || '').replace(/有限公司/g, '')
|
return (this.content.orderUnit || '').replace(/有限公司/g, '')
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="info-grid-item label-cell">质量要求</div>
|
<div class="info-grid-item label-cell">质量要求</div>
|
||||||
<div class="info-grid-item value-cell">
|
<div class="info-grid-item value-cell">
|
||||||
<div class="nob">{{ content.qualityStatus || '' }}</div>
|
<div class="nob">{{ qualityStatusDisplay }}</div>
|
||||||
<!-- <input type="text" class="" :value="content.qualityStatus || ''" /> -->
|
<!-- <input type="text" class="" :value="content.qualityStatus || ''" /> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -188,6 +188,13 @@ export default {
|
|||||||
materialWithManufacturer() {
|
materialWithManufacturer() {
|
||||||
return this.content.material
|
return this.content.material
|
||||||
},
|
},
|
||||||
|
qualityStatusDisplay() {
|
||||||
|
const status = (this.content.qualityStatus || '').trim()
|
||||||
|
if (['A', 'A+', 'A-', 'B', 'B+', 'B-'].includes(status)) {
|
||||||
|
return '合格品'
|
||||||
|
}
|
||||||
|
return status
|
||||||
|
},
|
||||||
orderUnitDisplay() {
|
orderUnitDisplay() {
|
||||||
return (this.content.orderUnit || '').replace(/有限公司/g, '')
|
return (this.content.orderUnit || '').replace(/有限公司/g, '')
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user