Commit 1330ab72 authored by 吴滔's avatar 吴滔

订单增加优惠功能

parent a05bc4f6
......@@ -18,6 +18,15 @@ export function updateReceipt(data) {
})
}
// 获取收款单列表
export function getReceiptList(query) {
return request({
url: '/ecw/receipt/page',
method: 'get',
params: query
})
}
// 获取应收款列表
export function getReceivableList(query) {
return request({
......@@ -36,10 +45,19 @@ export function getReceivableInfoByIds(query) {
})
}
// 获取收款单列表
export function getReceiptList(query) {
// 修改优惠信息
export function updateReceivableDiscountById(query) {
return request({
url: '/ecw/receipt/page',
url: '/ecw/receivable/updateReceivableDiscountById',
method: 'post',
data: query
})
}
// 得到应收优惠的最后操作人
export function getReceivableDiscountLogById(query) {
return request({
url: '/ecw/receivable/getReceivableDiscountLogById',
method: 'get',
params: query
})
......
This diff is collapsed.
......@@ -46,6 +46,11 @@
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
</template>
</el-table-column>
<el-table-column label="优惠金额" align="center">
<template slot-scope="scope">
{{ scope.row.discountTotal ? `${scope.row.discountTotal}(${scope.row.discountRemark})` : 0 }}
</template>
</el-table-column>
</el-table>
<el-descriptions :column="2" border class="card">
<!-- <el-descriptions-item v-for="(v, index) in form.platformAccountIdList" :label="`收款账户${index + 1}`" :key="index">
......@@ -156,7 +161,12 @@
<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" />
</template>
</el-table-column>
<el-table-column label="应收金额" align="center" prop="receivableAmount" />
<!-- <el-table-column label="应收金额" align="center" prop="receivableAmount" /> -->
<el-table-column label="应收金额" align="center" prop="receivableAmount">
<template slot-scope="scope" v-if="scope.row.type !== 'total'">
{{ `${scope.row.receivableAmount - scope.row.discountTotal}(${scope.row.receivableAmount} - ${scope.row.discountTotal})` }}
</template>
</el-table-column>
<el-table-column align="center" width="220">
<template #header>
核销基准币种(<dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" />)汇率
......@@ -509,6 +519,22 @@ export default {
res.data[res.data.length -1].collectionAmount = [dollar, rmb, naira]
// this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList])
const dollarListByList = this.list.filter(v => v.currencyId === 1)
const discountDollar = dollarListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const d = res.data.find(v => v.currencyId == 1)
d && (d.discountTotal = discountDollar)
const rmbListByList = this.list.filter(v => v.currencyId === 2)
const discountRmb = rmbListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const r = res.data.find(v => v.currencyId == 2)
r && (r.discountTotal = discountRmb)
const nairaListByList = this.list.filter(v => v.currencyId === 3)
const discountNaira = nairaListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const n = res.data.find(v => v.currencyId == 3)
n && (n.discountTotal = discountNaira)
this.$set(this.form, 'receiptAccountList', [...res.data])
this.$nextTick(() => {
// this.form.receiptAccountList.forEach((item, index) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment