feat(pl): 运费结算审批分流与车辆挂车号等 PL 能力完善
拆分运费审批/出款页面,补充结算发票附件与菜单 SQL,并同步前后端模型与车辆相关展示。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
66d5a8714b
commit
98aec80d71
37 files changed
+1362
-195
No files matched your search
@@ -3,6 +3,16 @@
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="运输公司">
|
||||
<el-select v-model="searchForm.carrierId" placeholder="全部" clearable filterable>
|
||||
<el-option
|
||||
v-for="c in carrierList"
|
||||
:key="c.id"
|
||||
:label="c.carrierName"
|
||||
:value="c.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="结算单号">
|
||||
<el-input
|
||||
v-model="searchForm.q"
|
||||
@@ -15,6 +25,8 @@
|
||||
<el-select v-model="searchForm.settlementStatus" placeholder="全部" clearable>
|
||||
<el-option label="草稿" value="pending" />
|
||||
<el-option label="审批中" value="approving" />
|
||||
<el-option label="待发放" value="approved" />
|
||||
<el-option label="已发放" value="confirmed" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
@@ -56,6 +68,16 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="disburseAmount" label="发放金额(元)" min-width="130" align="right">
|
||||
<template #default="{ row }">{{
|
||||
row.disburseAmount ? formatAmount(row.disburseAmount) : '—'
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="disburseTime" label="发放时间" min-width="160" align="center">
|
||||
<template #default="{ row }">{{
|
||||
row.disburseTime ? formatDateTime(row.disburseTime) : '—'
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="currentApproverName" label="当前审批人" min-width="110" align="center">
|
||||
<template #default="{ row }">{{ row.currentApproverName || '—' }}</template>
|
||||
</el-table-column>
|
||||
@@ -78,6 +100,14 @@
|
||||
>
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.settlementStatus === 'approved'"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
<el-icon><Edit /></el-icon>发票信息
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.settlementStatus === 'pending'"
|
||||
link
|
||||
@@ -102,22 +132,6 @@
|
||||
>
|
||||
<el-icon><RefreshLeft /></el-icon>撤回
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.canApprove && row.currentApprovalId"
|
||||
link
|
||||
type="success"
|
||||
@click="handleApprove(row)"
|
||||
>
|
||||
<el-icon><CircleCheck /></el-icon>审批
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.canApprove && row.currentApprovalId"
|
||||
link
|
||||
type="danger"
|
||||
@click="handleReject(row)"
|
||||
>
|
||||
<el-icon><CircleClose /></el-icon>驳回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -143,8 +157,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
CircleCheck,
|
||||
CircleClose,
|
||||
Delete,
|
||||
Edit,
|
||||
Promotion,
|
||||
@@ -152,7 +164,7 @@ import {
|
||||
Search,
|
||||
View
|
||||
} from '@element-plus/icons-vue'
|
||||
import { freightApi, type FreightSettlement } from '@/api/pl'
|
||||
import { carrierApi, freightApi, type Carrier, type FreightSettlement } from '@/api/pl'
|
||||
import PlFreightApprovalDialog from '@/components/business/pl-freight-approval-dialog/index.vue'
|
||||
import PlFreightSettlementFormDialog from '@/components/business/pl-freight-settlement-form-dialog/index.vue'
|
||||
import PlFreightSettlementViewDialog from '@/components/business/pl-freight-settlement-view-dialog/index.vue'
|
||||
@@ -164,12 +176,14 @@ import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import { formatDateTime } from '@/utils/format'
|
||||
|
||||
const loading = ref(false)
|
||||
const carrierList = ref<Carrier[]>([])
|
||||
const settlementList = ref<FreightSettlement[]>([])
|
||||
const viewDialogRef = ref<InstanceType<typeof PlFreightSettlementViewDialog>>()
|
||||
const formDialogRef = ref<InstanceType<typeof PlFreightSettlementFormDialog>>()
|
||||
const approvalDialogRef = ref<InstanceType<typeof PlFreightApprovalDialog>>()
|
||||
|
||||
const searchForm = reactive({
|
||||
carrierId: '',
|
||||
q: '',
|
||||
settlementStatus: ''
|
||||
})
|
||||
@@ -190,6 +204,7 @@ async function fetchData() {
|
||||
try {
|
||||
const res = await freightApi.list({
|
||||
tab: 'bills',
|
||||
carrierId: searchForm.carrierId || undefined,
|
||||
q: searchForm.q || undefined,
|
||||
settlementStatus: searchForm.settlementStatus || undefined,
|
||||
page: pagination.page,
|
||||
@@ -209,12 +224,22 @@ function handleSearch() {
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
searchForm.carrierId = ''
|
||||
searchForm.q = ''
|
||||
searchForm.settlementStatus = ''
|
||||
pagination.page = 1
|
||||
fetchData()
|
||||
}
|
||||
|
||||
async function loadCarrierList() {
|
||||
try {
|
||||
const res = await carrierApi.list({ status: '1' })
|
||||
carrierList.value = (res.data ?? res) || []
|
||||
} catch {
|
||||
carrierList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
function handlePageChange() {
|
||||
fetchData()
|
||||
}
|
||||
@@ -236,16 +261,6 @@ function handleSubmit(row: FreightSettlement) {
|
||||
approvalDialogRef.value?.openSubmit(row.id)
|
||||
}
|
||||
|
||||
function handleApprove(row: FreightSettlement) {
|
||||
if (!row.currentApprovalId) return
|
||||
approvalDialogRef.value?.openApprove(row.id, row.currentApprovalId)
|
||||
}
|
||||
|
||||
function handleReject(row: FreightSettlement) {
|
||||
if (!row.currentApprovalId) return
|
||||
approvalDialogRef.value?.openReject(row.id, row.currentApprovalId)
|
||||
}
|
||||
|
||||
async function handleWithdraw(row: FreightSettlement) {
|
||||
await ElMessageBox.confirm('确定撤回该结算单的审批吗?', '提示', { type: 'warning' })
|
||||
await freightApi.withdrawApproval(row.id)
|
||||
@@ -267,6 +282,7 @@ function refresh() {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadCarrierList()
|
||||
fetchData()
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user