Commit 323601ef by 李伟康

提交

1 parent c391efc8
......@@ -276,7 +276,7 @@ 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
truncatedNumber = Math.floor(number * multiplier) / multiplier
return truncatedNumber.toFixed(decimalPlaces)
}
export default {
......@@ -368,7 +368,6 @@ export default {
gasPrice = NP.times(gasService.reduce((acc, cur) => acc + cur, 0), gasCardServiceCharge, 0.01),
passagePrice = NP.times(passageService.reduce((acc, cur) => acc + cur, 0), passageServiceCharge, 0.01),
totalPrice = total.reduce((acc, cur) => acc + cur, 0)
return truncateDecimal(NP.plus(gasPrice, passagePrice, totalPrice))
}
},
......@@ -478,6 +477,9 @@ export default {
this.handleRelateStoreConfirm({
merchantId: res.merchantId,
merchantName: res.merchantName
}, {
gasCardServiceCharge: res.oilCouponRate,
passageServiceCharge: res.integralRate
})
this.totalForm.customerTotal = detailList.length
this.importObject = {
......@@ -608,7 +610,7 @@ export default {
height = id ? 56 : 67.39
if (listRef) {
let length = detailList.length
listRef.tableHeightValues = `${(length > 10 ? 10 : length) * height + 56}px`
listRef.tableHeightValues = `${(length > 10 ? 10 : length) * 56 + 56}px`
} else setTimeout(() => {
this.setTableHeight(detailList)
}, 100)
......@@ -621,13 +623,13 @@ export default {
validateField (id) {
this.$refs.fromRef.$refs.formRef.validateField(id)
},
async handleRelateStoreConfirm (selectedData) {
async handleRelateStoreConfirm (selectedData, isEdit) {
selectedData.merchantId && (this.$set(this.configForm, 'merchantId', selectedData.merchantId))
selectedData.merchantName && (this.$set(this.configForm, 'merchantName', selectedData.merchantName))
this.validateField('merchantId')
this.handleRelateStoreClose()
try {
const res = await this.$apis.points.getMerchantCharge({ merchantId: selectedData.merchantId })
const res = isEdit ? isEdit : await this.$apis.points.getMerchantCharge({ merchantId: selectedData.merchantId })
if (res) {
this.totalFormData.map(e => {
if (['gasCardServiceCharge', 'passageServiceCharge'].includes(e.name)) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!