Commit 8f58bfc8 by 李伟康

修复

1 parent 8d94f76a
...@@ -76,17 +76,19 @@ ...@@ -76,17 +76,19 @@
>下载模板</a> >下载模板</a>
</div> </div>
<template v-if="importObject.detailList"> <template v-if="importObject.detailList">
<div class="file-info flex">
<template v-if="importObject.name"> <template v-if="importObject.name">
<div class="file-info flex">
<div class="el-icon-success"></div> <div class="el-icon-success"></div>
文件格式正确({{ importObject.name }}) 文件格式正确({{ importObject.name }})
</template>
</div> </div>
</template>
<div class="table-box"> <div class="table-box">
<div class="table">
<GLTable <GLTable
:tableData="importObject.detailList" :tableData="importObject.detailList"
:tableParams="tableParams" :tableParams="tableParams"
:hasPage="false" :hasPage="false"
ref="listRef"
> >
<template <template
slot="cashBackValue" slot="cashBackValue"
...@@ -191,6 +193,7 @@ ...@@ -191,6 +193,7 @@
</template> </template>
</template> </template>
</GLTable> </GLTable>
</div>
<div <div
class="total" class="total"
:key="totalKey" :key="totalKey"
...@@ -257,10 +260,6 @@ import NP from 'number-precision' ...@@ -257,10 +260,6 @@ 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'
let chargeObject = {
gasCardServiceCharge: 0,
passageServiceCharge: 0
}
export default { export default {
components: { components: {
selectStore, selectStore,
...@@ -324,9 +323,9 @@ export default { ...@@ -324,9 +323,9 @@ export default {
name: 'passageServiceCharge', name: 'passageServiceCharge',
formatter: (cell) => { formatter: (cell) => {
const { passageService } = cell, const { passageService } = cell,
{ passageServiceCharge } = chargeObject, { passageServiceCharge } = this.chargeObject,
passageSum = passageService.reduce((acc, cur) => acc + cur, 0), passageSum = passageService.reduce((acc, cur) => acc + cur, 0),
sum = NP.times(passageSum, NP.divide(passageServiceCharge, 100)).toFixed(2) sum = NP.times(passageSum, passageServiceCharge, 0.01).toFixed(2)
return `${passageSum}*${passageServiceCharge}%=${sum}` return `${passageSum}*${passageServiceCharge}%=${sum}`
} }
}, },
...@@ -335,9 +334,9 @@ export default { ...@@ -335,9 +334,9 @@ export default {
name: 'gasCardServiceCharge', name: 'gasCardServiceCharge',
formatter: (cell) => { formatter: (cell) => {
const { gasService } = cell, const { gasService } = cell,
{ gasCardServiceCharge } = chargeObject, { gasCardServiceCharge } = this.chargeObject,
gasCardSum = gasService.reduce((acc, cur) => acc + cur, 0), gasCardSum = gasService.reduce((acc, cur) => acc + cur, 0),
sum = NP.times(gasCardSum, NP.divide(gasCardServiceCharge, 100)).toFixed(2) sum = NP.times(gasCardSum, gasCardServiceCharge, 0.01).toFixed(2)
return `${gasCardSum}*${gasCardServiceCharge}%=${sum}` return `${gasCardSum}*${gasCardServiceCharge}%=${sum}`
} }
}, },
...@@ -346,9 +345,9 @@ export default { ...@@ -346,9 +345,9 @@ export default {
name: 'sum', name: 'sum',
formatter: (cell) => { formatter: (cell) => {
const { total, gasService, passageService } = cell, const { total, gasService, passageService } = cell,
{ gasCardServiceCharge, passageServiceCharge } = chargeObject, { gasCardServiceCharge, passageServiceCharge } = this.chargeObject,
gasPrice = NP.times(gasService.reduce((acc, cur) => acc + cur, 0), NP.divide(gasCardServiceCharge, 100)), gasPrice = NP.times(gasService.reduce((acc, cur) => acc + cur, 0), gasCardServiceCharge, 0.01),
passagePrice = NP.times(passageService.reduce((acc, cur) => acc + cur, 0), NP.divide(passageServiceCharge, 100)), 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 NP.plus(gasPrice, passagePrice, totalPrice).toFixed(2)
...@@ -360,7 +359,7 @@ export default { ...@@ -360,7 +359,7 @@ export default {
{ {
label: '保单号', label: '保单号',
prop: 'policyNo', prop: 'policyNo',
minWidth: 100 minWidth: 200
}, },
{ {
label: '用户姓名', label: '用户姓名',
...@@ -370,7 +369,7 @@ export default { ...@@ -370,7 +369,7 @@ export default {
{ {
label: '身份证号', label: '身份证号',
prop: 'idCardNo', prop: 'idCardNo',
minWidth: 100 minWidth: 200
}, },
{ {
label: '用户手机号', label: '用户手机号',
...@@ -379,13 +378,13 @@ export default { ...@@ -379,13 +378,13 @@ export default {
}, },
{ {
label: '返现金额', label: '返现金额',
minWidth: 200, minWidth: 128,
addHtml: 'cashBackValue', addHtml: 'cashBackValue',
}, },
{ {
label: '商品兑换积分', label: '商品兑换积分',
addHtml: 'buyValue', addHtml: 'buyValue',
minWidth: 200 minWidth: 128
}, },
{ {
label: '赠送油券', label: '赠送油券',
...@@ -414,7 +413,7 @@ export default { ...@@ -414,7 +413,7 @@ export default {
{ {
label: '商户名称', label: '商户名称',
prop: 'merchantName', prop: 'merchantName',
minWidth: 100 minWidth: 300
}, },
] ]
}, },
...@@ -429,6 +428,10 @@ export default { ...@@ -429,6 +428,10 @@ export default {
disabled: false, disabled: false,
batchNo: '', batchNo: '',
status: '' status: ''
},
chargeObject: {
gasCardServiceCharge: 0,
passageServiceCharge: 0
} }
} }
}, },
...@@ -462,6 +465,7 @@ export default { ...@@ -462,6 +465,7 @@ export default {
detailList detailList
} }
this.loading = false this.loading = false
this.setTableHeight(detailList)
} catch (error) { } catch (error) {
this.loading = false this.loading = false
setTimeout(() => this.$router.go(-1), 1e3) setTimeout(() => this.$router.go(-1), 1e3)
...@@ -534,12 +538,14 @@ export default { ...@@ -534,12 +538,14 @@ export default {
const reader = new FileReader() const reader = new FileReader()
reader.readAsDataURL(file) reader.readAsDataURL(file)
reader.onload = async event => { reader.onload = async event => {
this.loading = true
this.$refs.file.value = '' this.$refs.file.value = ''
const imgFile = event.target.result, const imgFile = event.target.result,
[, arrBase64] = imgFile.split(','), [, arrBase64] = imgFile.split(','),
splitStr = file.name.split('.'), splitStr = file.name.split('.'),
fileUrl = splitStr.at(-1) + '@' + arrBase64, fileUrl = splitStr.at(-1) + '@' + arrBase64,
{ code, message, data } = await this.$apis.points.importCustomerIntegral({ file: fileUrl }) { code, message, data } = await this.$apis.points.importCustomerIntegral({ file: fileUrl })
this.loading = false
if (code == 0) { if (code == 0) {
const { importStatue, const { importStatue,
detailList, detailList,
...@@ -560,6 +566,7 @@ export default { ...@@ -560,6 +566,7 @@ export default {
}) })
this.totalForm.customerTotal = detailList.length this.totalForm.customerTotal = detailList.length
this.validateField('table') this.validateField('table')
this.setTableHeight(detailList)
} else this.importObj = { } else this.importObj = {
errorCount, errorCount,
errorUrl, errorUrl,
...@@ -567,14 +574,25 @@ export default { ...@@ -567,14 +574,25 @@ export default {
show: true show: true
} }
} }
else throw message || '' else this.$message.error(message)
} }
} catch (error) { } catch (error) {
this.loading = false
this.$refs.file.value = '' this.$refs.file.value = ''
if (error) this.$message.error(error) if (error) this.$message.error(error)
} }
}, },
setTableHeight (detailList = []) {
const { listRef } = this.$refs
if (listRef) {
let length = detailList.length
listRef.tableHeightValues = `${(length > 10 ? 10 : length) * 56 + 48}px`
} else setTimeout(() => {
this.setTableHeight(detailList)
}, 100)
},
// 选择门店 // 选择门店
handleRelateStoreClose () { handleRelateStoreClose () {
this.relateStoreVisible = false this.relateStoreVisible = false
...@@ -592,10 +610,12 @@ export default { ...@@ -592,10 +610,12 @@ export default {
if (res) { if (res) {
this.totalFormData.map(e => { this.totalFormData.map(e => {
if (['gasCardServiceCharge', 'passageServiceCharge'].includes(e.name)) { if (['gasCardServiceCharge', 'passageServiceCharge'].includes(e.name)) {
e.label = e.label.replace(/\d+/g, res[e.name] || 0) const val = res[e.name] || 0
chargeObject[e.name] = res[e.name] || 0 e.label = e.label.replace(/\d+/g, val)
this.chargeObject[e.name] = val
} }
}) })
console.log(this.totalFormData)
this.updateView() this.updateView()
} }
} catch (error) { } catch (error) {
...@@ -775,20 +795,24 @@ export default { ...@@ -775,20 +795,24 @@ export default {
margin-top: 10px; margin-top: 10px;
} }
.file-info { .file-info {
height: 32px; height: 20px;
font-size: 14px; font-size: 14px;
color: #999999; color: #999999;
align-items: center;
margin-top: 10px;
.el-icon-success { .el-icon-success {
color: #67c23a; color: #67c23a;
line-height: 32px; line-height: 20px;
margin-right: 4px; margin-right: 4px;
} }
} }
.table-box { .table-box {
width: 864px; min-width: 864px;
max-width: calc(100vw - 446px);
background: #f9f9f9; background: #f9f9f9;
border-radius: 4px; border-radius: 4px;
padding: 20px; padding: 20px;
margin-top: 10px;
/deep/ .el-input { /deep/ .el-input {
width: 100%; width: 100%;
} }
......
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
{ {
label: '保单号', label: '保单号',
prop: 'policyNo', prop: 'policyNo',
minWidth: 100 minWidth: 200
}, },
{ {
label: '用户姓名', label: '用户姓名',
...@@ -103,7 +103,7 @@ export default { ...@@ -103,7 +103,7 @@ export default {
}, },
{ {
label: '身份证号', label: '身份证号',
minWidth: 100, minWidth: 200,
prop: 'idCardNo', prop: 'idCardNo',
}, },
{ {
...@@ -150,7 +150,7 @@ export default { ...@@ -150,7 +150,7 @@ export default {
methods: { methods: {
beforeSearchFn () { beforeSearchFn () {
return new Promise(resolve => { return new Promise(resolve => {
this.searchForm.batchNo = this.detailObj.batchNo this.searchForm.recordId = this.detailObj.recordId
this.loading = false this.loading = false
resolve() resolve()
}) })
......
...@@ -13,8 +13,9 @@ ...@@ -13,8 +13,9 @@
type="default" type="default"
plain plain
@click="jump" @click="jump"
size="small"
>门店客户积分充值</el-button> >门店客户积分充值</el-button>
<el-button @click="handleExport">导出 <el-button @click="handleExport" size="small">导出
</el-button> </el-button>
</div> </div>
<div class="tabelList"> <div class="tabelList">
...@@ -31,7 +32,7 @@ ...@@ -31,7 +32,7 @@
> >
<div <div
class="link" class="link"
@click="openDetail(scope.scope.batchNo)" @click="openDetail(scope.scope.id)"
>{{scope.scope.customerNumber}}</div> >{{scope.scope.customerNumber}}</div>
</template> </template>
<template <template
...@@ -282,10 +283,10 @@ export default { ...@@ -282,10 +283,10 @@ export default {
} }
}) })
}, },
openDetail (batchNo) { openDetail (recordId) {
this.detailObj = { this.detailObj = {
show: true, show: true,
batchNo recordId
} }
}, },
editForm (row, type = '') { editForm (row, type = '') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!