|
|
@ -32,7 +32,7 @@ |
|
|
|
<div class="title"> |
|
|
|
<div>本月上传核对情况(按返利类型统计)</div> |
|
|
|
</div> |
|
|
|
<el-table :key="tableKey" :data="formobj.scmWhenVehrebateCheckapplydetailDetails" :index="index" border style="width: 100%"> |
|
|
|
<el-table :key="tableKey" :data="formobj.scmWhenVehrebateCheckapplydetailDetails" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries"> |
|
|
|
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/> |
|
|
|
<el-table-column prop="rebateTypeValue" label="返利类型" align="center" /> |
|
|
|
<el-table-column prop="num" label="数量" align="center" /> |
|
|
@ -44,7 +44,7 @@ |
|
|
|
<el-table-column prop="adjustmentMoney" label="调整金额" align="center" /> |
|
|
|
<el-table-column label="明细" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="primary" size="mini" @click="handleLook(scope.row)">查看</el-button> |
|
|
|
<el-button type="primary" v-show="formobj.sid !== ''" size="mini" @click="handleLook(scope.row)">查看</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -61,7 +61,7 @@ |
|
|
|
<el-table-column prop="adjustmentMoney" label="调整金额" align="center" /> |
|
|
|
<el-table-column label="明细" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="primary" size="mini" @click="handleLook(scope.row)">查看</el-button> |
|
|
|
<el-button type="primary" v-show="formobj.sid !== ''" size="mini" @click="handleLook(scope.row)">查看</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -187,7 +187,7 @@ export default { |
|
|
|
return |
|
|
|
} |
|
|
|
this.viewState = 2 |
|
|
|
this.$refs['divSelect'].showData(this.formobj.scmVehrebateCheckapplydetailList, this.formobj.createOrgSid, this.formobj.brandSid) |
|
|
|
this.$refs['divSelect'].showData(this.formobj.scmWhenVehrebateCheckapplydetailDetails, this.formobj.createOrgSid, this.formobj.brandSid) |
|
|
|
}, |
|
|
|
backData(val) { |
|
|
|
this.viewState = 1 |
|
|
@ -366,6 +366,91 @@ export default { |
|
|
|
resetState() { |
|
|
|
this.viewState = 1 |
|
|
|
}, |
|
|
|
// 合计 |
|
|
|
getSummaries(param) { |
|
|
|
const { columns, data } = param |
|
|
|
const sums = [] |
|
|
|
columns.forEach((column, index) => { |
|
|
|
if (index === 0) { |
|
|
|
sums[index] = '合计' |
|
|
|
return |
|
|
|
} |
|
|
|
const values = data.map(item => Number(item[column.property])) |
|
|
|
if (column.property === 'num') { |
|
|
|
sums[index] = values.reduce((prev, curr) => { |
|
|
|
const value = Number(curr) |
|
|
|
if (!isNaN(value)) { |
|
|
|
return prev + curr |
|
|
|
} else { |
|
|
|
return prev |
|
|
|
} |
|
|
|
}, 0) |
|
|
|
sums[index] += '' |
|
|
|
this.formobj.withRebateTotal = sums[index] += '' |
|
|
|
} else if (column.property === 'withRebate') { |
|
|
|
sums[index] = values.reduce((prev, curr) => { |
|
|
|
const value = Number(curr) |
|
|
|
if (!isNaN(value)) { |
|
|
|
return prev + curr |
|
|
|
} else { |
|
|
|
return prev |
|
|
|
} |
|
|
|
}, 0) |
|
|
|
sums[index] += '' |
|
|
|
} else if (column.property === 'withholdCost') { |
|
|
|
sums[index] = values.reduce((prev, curr) => { |
|
|
|
const value = Number(curr) |
|
|
|
if (!isNaN(value)) { |
|
|
|
return prev + curr |
|
|
|
} else { |
|
|
|
return prev |
|
|
|
} |
|
|
|
}, 0) |
|
|
|
sums[index] += '' |
|
|
|
} else if (column.property === 'uploadMoney') { |
|
|
|
sums[index] = values.reduce((prev, curr) => { |
|
|
|
const value = Number(curr) |
|
|
|
if (!isNaN(value)) { |
|
|
|
return prev + curr |
|
|
|
} else { |
|
|
|
return prev |
|
|
|
} |
|
|
|
}, 0) |
|
|
|
sums[index] += '' |
|
|
|
} else if (column.property === 'stayDetermineMoney') { |
|
|
|
sums[index] = values.reduce((prev, curr) => { |
|
|
|
const value = Number(curr) |
|
|
|
if (!isNaN(value)) { |
|
|
|
return prev + curr |
|
|
|
} else { |
|
|
|
return prev |
|
|
|
} |
|
|
|
}, 0) |
|
|
|
sums[index] += '' |
|
|
|
} else if (column.property === 'money') { |
|
|
|
sums[index] = values.reduce((prev, curr) => { |
|
|
|
const value = Number(curr) |
|
|
|
if (!isNaN(value)) { |
|
|
|
return prev + curr |
|
|
|
} else { |
|
|
|
return prev |
|
|
|
} |
|
|
|
}, 0) |
|
|
|
sums[index] += '' |
|
|
|
} else if (column.property === 'adjustmentMoney') { |
|
|
|
sums[index] = values.reduce((prev, curr) => { |
|
|
|
const value = Number(curr) |
|
|
|
if (!isNaN(value)) { |
|
|
|
return prev + curr |
|
|
|
} else { |
|
|
|
return prev |
|
|
|
} |
|
|
|
}, 0) |
|
|
|
sums[index] += '' |
|
|
|
} |
|
|
|
}) |
|
|
|
return sums |
|
|
|
}, |
|
|
|
save() { |
|
|
|
console.log(this.formobj) |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|