Commit 51e7269c by 李伟康

修改样式

1 parent 356d66c2
......@@ -278,9 +278,11 @@ 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)
let [integer, decimals] = String(number).split('.')
if (!decimals) decimals = '00'
if (decimals.length > 2) decimals = decimals.substring(0, decimalPlaces)
if (decimals.length == 1) decimals += '0'
return `${integer}.${decimals}`
}
export default {
components: {
......@@ -461,6 +463,7 @@ export default {
}
},
mounted () {
console.log(truncateDecimal(3196.88 * 10 / 100))
const { id, type } = this.$route.query
if (id) this.getDetail(id, type)
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!