feat(wms/coil/label): 优化多规格标签的订货单位显示适配
1. 修复订货单位截断逻辑,保留完整客户名称 2. 新增根据订货单位长度动态调整字体大小的功能,适配长文本显示
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
<!-- 第一行:订货单位 + 合同号 -->
|
<!-- 第一行:订货单位 + 合同号 -->
|
||||||
<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" contenteditable>{{ content.orderUnit || '' }}</div>
|
<div class="nob" contenteditable :style="{ fontSize: orderUnitFontSize }">{{ content.orderUnit || '' }}</div>
|
||||||
<!-- <input type="text" :value="content.orderUnit || ''" /> -->
|
<!-- <input type="text" :value="content.orderUnit || ''" /> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="info-grid-item label-cell">合同号</div>
|
<div class="info-grid-item label-cell">合同号</div>
|
||||||
@@ -180,6 +180,14 @@ export default {
|
|||||||
// 材质展示信息,额外带上厂家的首字母
|
// 材质展示信息,额外带上厂家的首字母
|
||||||
materialWithManufacturer() {
|
materialWithManufacturer() {
|
||||||
return this.content.material
|
return this.content.material
|
||||||
|
},
|
||||||
|
orderUnitFontSize() {
|
||||||
|
const len = (this.content.orderUnit || '').length
|
||||||
|
if (len < 10) return '1.2em'
|
||||||
|
if (len <= 14) return '1em'
|
||||||
|
if (len <= 18) return '0.88em'
|
||||||
|
if (len <= 24) return '0.78em'
|
||||||
|
return '0.68em'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<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">
|
||||||
<!-- <input type="text" class="nob" :value="content.orderUnit || ''" /> -->
|
<!-- <input type="text" class="nob" :value="content.orderUnit || ''" /> -->
|
||||||
<div class="nob" contenteditable>{{ content.orderUnit || '' }}</div>
|
<div class="nob" contenteditable :style="{ fontSize: orderUnitFontSize }">{{ content.orderUnit || '' }}</div>
|
||||||
</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">
|
||||||
@@ -181,6 +181,14 @@ export default {
|
|||||||
// 材质展示信息,额外带上厂家的首字母
|
// 材质展示信息,额外带上厂家的首字母
|
||||||
materialWithManufacturer() {
|
materialWithManufacturer() {
|
||||||
return this.content.material
|
return this.content.material
|
||||||
|
},
|
||||||
|
orderUnitFontSize() {
|
||||||
|
const len = (this.content.orderUnit || '').length
|
||||||
|
if (len < 10) return '1.2em'
|
||||||
|
if (len <= 14) return '1em'
|
||||||
|
if (len <= 18) return '0.88em'
|
||||||
|
if (len <= 24) return '0.78em'
|
||||||
|
return '0.68em'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<!-- 第一行:订货单位 + 合同号 -->
|
<!-- 第一行:订货单位 + 合同号 -->
|
||||||
<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" contenteditable>{{ content.orderUnit || '' }}</div>
|
<div class="nob" contenteditable :style="{ fontSize: orderUnitFontSize }">{{ content.orderUnit || '' }}</div>
|
||||||
<!-- <input type="text" class="nob" :value="content.orderUnit || ''" /> -->
|
<!-- <input type="text" class="nob" :value="content.orderUnit || ''" /> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="info-grid-item label-cell">合同号</div>
|
<div class="info-grid-item label-cell">合同号</div>
|
||||||
@@ -187,6 +187,14 @@ export default {
|
|||||||
// 材质展示信息,额外带上厂家的首字母
|
// 材质展示信息,额外带上厂家的首字母
|
||||||
materialWithManufacturer() {
|
materialWithManufacturer() {
|
||||||
return this.content.material
|
return this.content.material
|
||||||
|
},
|
||||||
|
orderUnitFontSize() {
|
||||||
|
const len = (this.content.orderUnit || '').length
|
||||||
|
if (len < 10) return '1.2em'
|
||||||
|
if (len <= 14) return '1em'
|
||||||
|
if (len <= 18) return '0.88em'
|
||||||
|
if (len <= 24) return '0.78em'
|
||||||
|
return '0.68em'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -162,8 +162,9 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.innerContent = {
|
this.innerContent = {
|
||||||
...res.data,
|
...res.data,
|
||||||
|
orderUnit: res.data.orderList?.[0]?.customer,
|
||||||
// 保留前10个字符的订货单位
|
// 保留前10个字符的订货单位
|
||||||
orderUnit: res.data.orderList?.[0]?.customer?.substring(0, 12) || '',
|
// orderUnit: res.data.orderList?.[0]?.customer?.substring(0, 12) || '',
|
||||||
contractNumber: res.data.orderList?.[0]?.contractCode || '',
|
contractNumber: res.data.orderList?.[0]?.contractCode || '',
|
||||||
} || {};
|
} || {};
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user