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
@@ -0,0 +1,184 @@
|
||||
<template>
|
||||
<div class="freight-tab-panel">
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="结算单号">
|
||||
<el-input
|
||||
v-model="searchForm.q"
|
||||
placeholder="搜索结算单号"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="filter-actions">
|
||||
<div class="filter-actions-end">
|
||||
<el-button class="btn-ghost" :loading="loading" @click="handleReset">
|
||||
<el-icon><RefreshLeft /></el-icon>重置
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" :loading="loading" @click="handleSearch">
|
||||
<el-icon><Search /></el-icon>搜索
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="list-toolbar">
|
||||
<div class="list-toolbar-row">
|
||||
<div class="list-toolbar-selected">已选 <span class="sel-num">0</span> 项</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<el-table class="list-table" :data="settlementList" v-loading="loading" stripe row-key="id">
|
||||
<el-table-column prop="settlementNo" label="结算单号" min-width="180" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-link type="primary" @click="handleView(row)">{{ row.settlementNo }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="totalFreight" label="运费合计(元)" min-width="130" align="right">
|
||||
<template #default="{ row }">{{ formatAmount(row.totalFreight) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="planCount" label="关联计划数" min-width="110" align="center" />
|
||||
<el-table-column prop="licensePlateSummary" label="车牌摘要" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="currentApproverName" label="当前审批人" min-width="110" align="center">
|
||||
<template #default="{ row }">{{ row.currentApproverName || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="submitterName" label="提交人" min-width="100" align="center">
|
||||
<template #default="{ row }">{{ row.submitterName || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="提交时间" min-width="160" align="center">
|
||||
<template #default="{ row }">{{ formatDateTime(row.createTime) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="260" fixed="right" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" @click="handleView(row)">
|
||||
<el-icon><View /></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>
|
||||
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
v-model:current-page="pagination.page"
|
||||
v-model:page-size="pagination.pageSize"
|
||||
:total="pagination.total"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handlePageChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PlFreightSettlementViewDialog ref="viewDialogRef" />
|
||||
<PlFreightApprovalDialog ref="approvalDialogRef" @success="fetchData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { CircleCheck, CircleClose, RefreshLeft, Search, View } from '@element-plus/icons-vue'
|
||||
import { freightApi, type FreightSettlement } from '@/api/pl'
|
||||
import PlFreightApprovalDialog from '@/components/business/pl-freight-approval-dialog/index.vue'
|
||||
import PlFreightSettlementViewDialog from '@/components/business/pl-freight-settlement-view-dialog/index.vue'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import { formatDateTime } from '@/utils/format'
|
||||
|
||||
const loading = ref(false)
|
||||
const settlementList = ref<FreightSettlement[]>([])
|
||||
const viewDialogRef = ref<InstanceType<typeof PlFreightSettlementViewDialog>>()
|
||||
const approvalDialogRef = ref<InstanceType<typeof PlFreightApprovalDialog>>()
|
||||
|
||||
const searchForm = reactive({ q: '' })
|
||||
|
||||
const pagination = reactive({
|
||||
page: 1,
|
||||
pageSize: 20,
|
||||
total: 0
|
||||
})
|
||||
|
||||
function formatAmount(amount: number) {
|
||||
if (!amount) return '¥0.00'
|
||||
return formatMoneyDisplay(amount)
|
||||
}
|
||||
|
||||
async function fetchData() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await freightApi.list({
|
||||
tab: 'approval_pending',
|
||||
q: searchForm.q || undefined,
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize
|
||||
})
|
||||
const data = res.data ?? res
|
||||
settlementList.value = data.list || []
|
||||
pagination.total = data.total || 0
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
pagination.page = 1
|
||||
fetchData()
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
searchForm.q = ''
|
||||
pagination.page = 1
|
||||
fetchData()
|
||||
}
|
||||
|
||||
function handlePageChange() {
|
||||
fetchData()
|
||||
}
|
||||
|
||||
function handleSizeChange() {
|
||||
pagination.page = 1
|
||||
fetchData()
|
||||
}
|
||||
|
||||
function handleView(row: FreightSettlement) {
|
||||
viewDialogRef.value?.open(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)
|
||||
}
|
||||
|
||||
function refresh() {
|
||||
fetchData()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchData()
|
||||
})
|
||||
|
||||
defineExpose({ refresh })
|
||||
</script>
|
||||
Reference in new issue
Block a user