diff --git a/bms-front/src/views/ar/bill/index.vue b/bms-front/src/views/ar/bill/index.vue index f40d8d0c..f7fa3bc3 100644 --- a/bms-front/src/views/ar/bill/index.vue +++ b/bms-front/src/views/ar/bill/index.vue @@ -45,6 +45,7 @@ 作废 导出明细 去核销 + 反核销 @@ -150,7 +151,7 @@ const columns = [ { label: '账单截止日', prop: 'billPeriodEnd', minWidth: 120, formatter: row => `截至 ${date(row.billPeriodEnd)}` }, { label: '订单数', prop: 'orderCount', width: 80 }, { label: '应收总额', prop: 'totalAmount', width: 120, align: 'right', slot: 'totalAmount' }, { label: '已核销', prop: 'writtenOffAmount', width: 110, align: 'right', slot: 'writtenOffAmount' }, { label: '未核销', prop: 'unwrittenAmount', width: 110, align: 'right', slot: 'unwrittenAmount' }, { label: '状态', prop: 'status', width: 110, slot: 'status' }, - { label: '账单日期', prop: 'billDate', width: 120, formatter: row => date(row.billDate) }, { label: '操作', prop: 'action', width: 330, fixed: 'right', slot: 'action', showInToolbar: false } + { label: '账单日期', prop: 'billDate', width: 120, formatter: row => date(row.billDate) }, { label: '操作', prop: 'action', width: 380, fixed: 'right', slot: 'action', showInToolbar: false } ] const searchColumns = [ { label: '账单号', prop: 'billNo', component: 'input', placeholder: '账单号', width: '180px' }, { label: '账单名称', prop: 'billName', component: 'input', placeholder: '账单名称', width: '180px' }, { label: '客户名称', prop: 'customerId', component: 'input', placeholder: '请选择客户', width: '220px' }, @@ -392,8 +393,20 @@ function canGoWriteoff(row) { || row.status === AR_BILL_STATUS.PARTIAL_WRITTEN_OFF return canWriteoffStatus && Number(row.unwrittenAmount) > 0 } +function canGoReverseWriteoff(row) { + if (!row?.customerId || !(Number(row.writtenOffAmount) > 0)) return false + return row.status === AR_BILL_STATUS.PARTIAL_WRITTEN_OFF + || row.status === AR_BILL_STATUS.WRITTEN_OFF +} function goWriteoff(row) { if (!canGoWriteoff(row)) return + goCustomerBillWriteoff(row) +} +function goReverseWriteoff(row) { + if (!canGoReverseWriteoff(row)) return + goCustomerBillWriteoff(row) +} +function goCustomerBillWriteoff(row) { router.push({ path: '/customersupplier/customer-money/index', query: {