Commit 6641eabb by 李伟康

修改样式

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