✨ 支持客户账单状态多选并修正有效金额汇总
This commit is contained in:
@@ -114,6 +114,7 @@
|
|||||||
coalesce(sum(unwritten_amount), 0) as unwritten_amount
|
coalesce(sum(unwritten_amount), 0) as unwritten_amount
|
||||||
from ar_bill b
|
from ar_bill b
|
||||||
<include refid="arBillListFilter"/>
|
<include refid="arBillListFilter"/>
|
||||||
|
and status in ('CONFIRMED', 'PARTIAL_WRITTEN_OFF', 'WRITTEN_OFF')
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectArBillById" parameterType="long" resultMap="ArBillResult">
|
<select id="selectArBillById" parameterType="long" resultMap="ArBillResult">
|
||||||
|
|||||||
+10
-7
@@ -29,9 +29,9 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #pagination-extra>
|
<template #pagination-extra>
|
||||||
<div class="bill-summary">
|
<div class="bill-summary">
|
||||||
<span>应收总额:<b class="amount">{{ money(billSummary.totalAmount) }}</b></span>
|
<span>有效账单金额:<b class="amount">{{ money(billSummary.totalAmount) }}</b></span>
|
||||||
<span>已核销:<b class="written">{{ money(billSummary.writtenOffAmount) }}</b></span>
|
<span>已核销:<b class="written">{{ money(billSummary.writtenOffAmount) }}</b></span>
|
||||||
<span>未核销:<b class="unwritten">{{ money(billSummary.unwrittenAmount) }}</b></span>
|
<span>当前未核销:<b class="unwritten">{{ money(billSummary.unwrittenAmount) }}</b></span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #col-status="{ row }">
|
<template #col-status="{ row }">
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
<span class="written">{{ money(row.writtenOffAmount) }}</span>
|
<span class="written">{{ money(row.writtenOffAmount) }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #col-unwrittenAmount="{ row }">
|
<template #col-unwrittenAmount="{ row }">
|
||||||
<span class="unwritten">{{ money(row.unwrittenAmount) }}</span>
|
<span class="unwritten">{{ isCurrentReceivable(row.status) ? money(row.unwrittenAmount) : '-' }}</span>
|
||||||
</template>
|
</template>
|
||||||
</basic-table>
|
</basic-table>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { computed, getCurrentInstance, ref } from 'vue'
|
import { computed, getCurrentInstance, ref } from 'vue'
|
||||||
import { listCustomerBills } from '@/api/customersuppliermanagement/customermoney/customerbill'
|
import { listCustomerBills } from '@/api/customersuppliermanagement/customermoney/customerbill'
|
||||||
import { AR_BILL_STATUS_OPTIONS, AR_BILL_STATUS_TYPES } from '@/constants/ar/bill'
|
import { AR_BILL_STATUS, AR_BILL_STATUS_OPTIONS, AR_BILL_STATUS_TYPES } from '@/constants/ar/bill'
|
||||||
import { arEnumLabel } from '@/constants/ar/enums'
|
import { arEnumLabel } from '@/constants/ar/enums'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -86,16 +86,16 @@ const columns = [
|
|||||||
{ label: '客户编码', prop: 'customerCode', minWidth: 120, showOverflowTooltip: true },
|
{ label: '客户编码', prop: 'customerCode', minWidth: 120, showOverflowTooltip: true },
|
||||||
{ label: '账单截止日', prop: 'billPeriodEnd', minWidth: 120, formatter: row => `截至 ${date(row.billPeriodEnd)}` },
|
{ label: '账单截止日', prop: 'billPeriodEnd', minWidth: 120, formatter: row => `截至 ${date(row.billPeriodEnd)}` },
|
||||||
{ label: '订单数', prop: 'orderCount', width: 80 },
|
{ label: '订单数', prop: 'orderCount', width: 80 },
|
||||||
{ label: '应收总额', prop: 'totalAmount', width: 120, align: 'right', slot: 'totalAmount' },
|
{ label: '账单金额', prop: 'totalAmount', width: 120, align: 'right', slot: 'totalAmount' },
|
||||||
{ label: '已核销', prop: 'writtenOffAmount', width: 110, align: 'right', slot: 'writtenOffAmount' },
|
{ label: '已核销', prop: 'writtenOffAmount', width: 110, align: 'right', slot: 'writtenOffAmount' },
|
||||||
{ label: '未核销', prop: 'unwrittenAmount', width: 110, align: 'right', slot: 'unwrittenAmount' },
|
{ label: '当前未核销', prop: 'unwrittenAmount', width: 110, align: 'right', slot: 'unwrittenAmount' },
|
||||||
{ label: '状态', prop: 'status', width: 110, slot: 'status' },
|
{ label: '状态', prop: 'status', width: 110, slot: 'status' },
|
||||||
{ label: '账单日期', prop: 'billDate', width: 120, formatter: row => date(row.billDate) }
|
{ label: '账单日期', prop: 'billDate', width: 120, formatter: row => date(row.billDate) }
|
||||||
]
|
]
|
||||||
const searchColumns = [
|
const searchColumns = [
|
||||||
{ label: '账单号', prop: 'billNo', component: 'input', placeholder: '账单号', width: '180px' },
|
{ label: '账单号', prop: 'billNo', component: 'input', placeholder: '账单号', width: '180px' },
|
||||||
{ label: '账单名称', prop: 'billName', component: 'input', placeholder: '账单名称', width: '180px' },
|
{ label: '账单名称', prop: 'billName', component: 'input', placeholder: '账单名称', width: '180px' },
|
||||||
{ label: '状态', prop: 'status', component: 'select', options: statusOptions, placeholder: '全部状态', width: '150px' },
|
{ label: '状态', prop: 'statuses', component: 'select', options: statusOptions, placeholder: '全部状态', width: '190px', props: { multiple: true, clearable: true, collapseTags: true, collapseTagsTooltip: true } },
|
||||||
{ label: '账单日期', prop: 'billDateRange', component: 'daterange', width: '300px' },
|
{ label: '账单日期', prop: 'billDateRange', component: 'daterange', width: '300px' },
|
||||||
{ label: '账单截止日', prop: 'billPeriodEnd', component: 'date', width: '160px' }
|
{ label: '账单截止日', prop: 'billPeriodEnd', component: 'date', width: '160px' }
|
||||||
]
|
]
|
||||||
@@ -142,6 +142,9 @@ function money(value) {
|
|||||||
}
|
}
|
||||||
function statusText(value) { return arEnumLabel(AR_BILL_STATUS_OPTIONS, value) }
|
function statusText(value) { return arEnumLabel(AR_BILL_STATUS_OPTIONS, value) }
|
||||||
function statusType(value) { return AR_BILL_STATUS_TYPES[value] || 'info' }
|
function statusType(value) { return AR_BILL_STATUS_TYPES[value] || 'info' }
|
||||||
|
function isCurrentReceivable(status) {
|
||||||
|
return [AR_BILL_STATUS.CONFIRMED, AR_BILL_STATUS.PARTIAL_WRITTEN_OFF, AR_BILL_STATUS.WRITTEN_OFF].includes(status)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user