Browse Source

单价显示后四位小数

master
qiankanghui 1 week ago
parent
commit
c14d8a1632
  1. 11
      src/views/modules/supplier/supplierPartMoqPrice.vue
  2. 6
      src/views/modules/supplier/supplierPartMoqPriceView.vue
  3. 6
      src/views/modules/supplier/supplierPartTierPriceHistory.vue

11
src/views/modules/supplier/supplierPartMoqPrice.vue

@ -133,7 +133,7 @@
>
<el-table-column prop="qtyStart" label="开始数量" min-width="100" header-align="center" align="right" :formatter="formatNumberCell" />
<el-table-column prop="qtyEnd" label="结束数量" min-width="100" header-align="center" align="right" :formatter="formatNumberCell" />
<el-table-column prop="unitPrice" label="单价" min-width="120" header-align="center" align="right" :formatter="formatNumberCell" />
<el-table-column prop="unitPrice" label="单价" min-width="120" header-align="center" align="right" :formatter="formatPriceCell" />
<el-table-column prop="priceDate" label="价格日期" min-width="130" header-align="center" align="center" />
<el-table-column prop="remark" label="备注" min-width="180" header-align="center" align="left" show-overflow-tooltip />
</el-table>
@ -414,7 +414,7 @@
</el-table-column>
<el-table-column label="单价" min-width="150" header-align="center" align="right">
<template slot-scope="scope">
<el-input-number v-model="scope.row.unitPrice" :step="0.0001" :min="0" :controls="false" style="width: 98%" />
<el-input-number v-model="scope.row.unitPrice" :step="0.0001" :precision="4" :min="0" :controls="false" style="width: 98%" />
</template>
</el-table-column>
<el-table-column label="备注" min-width="220" header-align="center" align="left">
@ -1043,6 +1043,10 @@ export default {
formatNumberCell (row, column, cellValue) {
return String(this.normalizeNumberValue(cellValue, 0))
},
formatPriceCell (row, column, cellValue) {
// 单价固定显示后四位小数
return this.normalizeNumberValue(cellValue, 0).toFixed(4)
},
validateTierRows () {
if (!this.tierForm.priceDate) {
this.$message.warning('价格日期不能为空')
@ -1104,7 +1108,8 @@ export default {
tierPriceList: this.tierForm.tierPriceList.map(item => ({
qtyStart: item.qtyStart,
qtyEnd: item.qtyEnd,
unitPrice: item.unitPrice,
// 与界面显示保持一致:单价固定按后四位小数提交(如 0.1 → 0.1000)
unitPrice: this.normalizeNumberValue(item.unitPrice, 0).toFixed(4),
remark: item.remark || ''
}))
}

6
src/views/modules/supplier/supplierPartMoqPriceView.vue

@ -122,7 +122,7 @@
>
<el-table-column prop="qtyStart" label="开始数量" min-width="100" header-align="center" align="right" :formatter="formatNumberCell" />
<el-table-column prop="qtyEnd" label="结束数量" min-width="100" header-align="center" align="right" :formatter="formatNumberCell" />
<el-table-column prop="unitPrice" label="单价" min-width="120" header-align="center" align="right" :formatter="formatNumberCell" />
<el-table-column prop="unitPrice" label="单价" min-width="120" header-align="center" align="right" :formatter="formatPriceCell" />
<el-table-column prop="priceDate" label="价格日期" min-width="130" header-align="center" align="center" />
<el-table-column prop="remark" label="备注" min-width="180" header-align="center" align="left" show-overflow-tooltip />
</el-table>
@ -345,6 +345,10 @@ export default {
},
formatNumberCell (row, column, cellValue) {
return String(this.normalizeNumberValue(cellValue, 0))
},
formatPriceCell (row, column, cellValue) {
// 单价固定显示后四位小数
return this.normalizeNumberValue(cellValue, 0).toFixed(4)
}
}
}

6
src/views/modules/supplier/supplierPartTierPriceHistory.vue

@ -114,7 +114,7 @@
>
<el-table-column prop="qtyStart" label="开始数量" min-width="110" header-align="center" align="right" :formatter="formatNumberCell" />
<el-table-column prop="qtyEnd" label="结束数量" min-width="110" header-align="center" align="right" :formatter="formatNumberCell" />
<el-table-column prop="unitPrice" label="单价" min-width="120" header-align="center" align="right" :formatter="formatNumberCell" />
<el-table-column prop="unitPrice" label="单价" min-width="120" header-align="center" align="right" :formatter="formatPriceCell" />
<el-table-column prop="remark" label="备注" min-width="200" header-align="center" align="left" show-overflow-tooltip />
</el-table>
@ -380,6 +380,10 @@ export default {
formatNumberCell (row, column, cellValue) {
return String(this.normalizeNumberValue(cellValue, 0))
},
formatPriceCell (row, column, cellValue) {
// 单价固定显示后四位小数
return this.normalizeNumberValue(cellValue, 0).toFixed(4)
},
formatCurrencyDesc (row) {
if (!row) return ''
return row.currencyDesc || row.currency || ''

Loading…
Cancel
Save