Commit 6641eabb by 李伟康

修改样式

1 parent 73eba552
......@@ -274,6 +274,11 @@ import NP from 'number-precision'
import selectStore from './components/selectStore'
import pointsConfig from './components/pointsConfig.vue'
import importErrDialog from './components/importErrDialog.vue'
const truncateDecimal = (number, decimalPlaces = 2) => {
let multiplier = Math.pow(10, decimalPlaces),
truncatedNumber = Math.floor(number * multiplier) / multiplier
return truncatedNumber.toFixed(decimalPlaces)
}
export default {
components: {
selectStore,
......@@ -339,7 +344,7 @@ export default {
const { passageService } = cell,
{ passageServiceCharge } = this.chargeObject,
passageSum = passageService.reduce((acc, cur) => acc + cur, 0),
sum = NP.times(passageSum, passageServiceCharge, 0.01).toFixed(2)
sum = truncateDecimal(NP.times(passageSum, passageServiceCharge, 0.01))
return `${passageSum}*${passageServiceCharge}%=${sum}`
}
},
......@@ -350,7 +355,7 @@ export default {
const { gasService } = cell,
{ gasCardServiceCharge } = this.chargeObject,
gasCardSum = gasService.reduce((acc, cur) => acc + cur, 0),
sum = NP.times(gasCardSum, gasCardServiceCharge, 0.01).toFixed(2)
sum = truncateDecimal(NP.times(gasCardSum, gasCardServiceCharge, 0.01))
return `${gasCardSum}*${gasCardServiceCharge}%=${sum}`
}
},
......@@ -364,7 +369,7 @@ export default {
passagePrice = NP.times(passageService.reduce((acc, cur) => acc + cur, 0), passageServiceCharge, 0.01),
totalPrice = total.reduce((acc, cur) => acc + cur, 0)
return NP.plus(gasPrice, passagePrice, totalPrice).toFixed(2)
return truncateDecimal(NP.plus(gasPrice, passagePrice, totalPrice))
}
},
],
......@@ -402,12 +407,12 @@ export default {
},
{
label: '赠送油券',
minWidth: 200,
minWidth: 260,
addHtml: 'oilList'
},
{
label: '赠送自店服务',
minWidth: 200,
minWidth: 260,
addHtml: 'couponList'
},
{
......@@ -600,7 +605,7 @@ export default {
setTableHeight (detailList = []) {
const { listRef } = this.$refs,
{ id } = this.pageObject,
height = id ? 56 : 67.39
height = id ? 56 : 67.39
if (listRef) {
let length = detailList.length
listRef.tableHeightValues = `${(length > 10 ? 10 : length) * height + 56}px`
......
......@@ -133,12 +133,12 @@ export default {
},
{
label: '赠送油券',
minWidth: 150,
minWidth: 260,
addHtml: 'oilList'
},
{
label: '赠送自店服务',
minWidth: 150,
minWidth: 260,
addHtml: 'couponList'
},
{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!