应付账单初始化
This commit is contained in:
@@ -137,6 +137,9 @@
|
||||
<el-empty v-else description="暂无应收明细" :image-size="64" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="应付" name="pay">
|
||||
<div v-if="!readonly" class="pay-generate">
|
||||
<el-button type="primary" plain size="small" v-hasPermi="['price:billing:bill']" @click="handlePayBill">生成应付</el-button>
|
||||
</div>
|
||||
<el-table v-if="payFees.length" :data="payFees" border size="small" class="fee-table">
|
||||
<el-table-column label="费用名称" min-width="140" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ displayFeeName(row) }}</template>
|
||||
@@ -190,7 +193,9 @@
|
||||
<script setup>
|
||||
import AddIncomeFeeDialog from './AddIncomeFeeDialog.vue'
|
||||
import EditChargeWeightDialog from './EditChargeWeightDialog.vue'
|
||||
import { deleteIncomeBillFee } from '@/api/price/billing'
|
||||
import { deleteIncomeBillFee, getBill } from '@/api/price/billing'
|
||||
import { generatePayBill } from '@/api/price/pay'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
@@ -226,6 +231,26 @@ watch(() => props.detail, () => {
|
||||
feeTab.value = 'income'
|
||||
})
|
||||
|
||||
function handlePayBill() {
|
||||
const billId = props.detail?.billId
|
||||
if (!billId) return
|
||||
ElMessageBox.confirm('按订单的渠道服务商和已配置的应付产品计算应付?', '生成应付', { type: 'warning' })
|
||||
.then(() => generatePayBill(billId))
|
||||
.then(res => {
|
||||
const data = res.data || {}
|
||||
if (data.skipped && data.skipped.length) {
|
||||
ElMessageBox.alert(data.skipped.join('\n'), data.message || '应付已生成', { type: 'warning' })
|
||||
} else {
|
||||
ElMessage.success(data.message || '应付已生成')
|
||||
}
|
||||
return getBill(billId)
|
||||
})
|
||||
.then(res => {
|
||||
if (res && res.data) emit('updated', res.data)
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
function canEditManualFee(row) {
|
||||
return row && String(row.manualFlag) === '1' && row.arBillStatus !== 'BILLED'
|
||||
}
|
||||
@@ -439,6 +464,9 @@ function refundLabel(status) {
|
||||
.bill-detail-wrap {
|
||||
min-height: 240px;
|
||||
}
|
||||
.pay-generate {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.bill-detail {
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user