This commit is contained in:
zlwu committed 2026-08-21 09:35:11 +08:00
1 parent b9ff9c9d67
commit 44749ae716
87 files changed
+35089 -21918

No files matched your search

+129 -64
View File
@@ -1,12 +1,8 @@
<!-- eslint-disable vue/no-v-model-argument -->
<!-- 运输计划合同完善:仅缺合同计划,行内展开分侧保存 -->
<template>
<div class="page-container">
<section class="panel">
<div class="panel-top pl-plan-contract-panel-top">
<h2 class="title-bar-heading">运输计划合同完善</h2>
<span class="pl-plan-contract-stat">待完善 {{ pagination.total }} 条</span>
</div>
<div class="filter-block">
<el-form :model="searchForm" class="filter-form" @submit.prevent>
<div class="filter-grid">
@@ -77,6 +73,7 @@
<el-button class="btn-ghost" :loading="loading" @click="fetchData">
<el-icon><Refresh /></el-icon>刷新
</el-button>
<span class="pl-plan-contract-stat">待完善 {{ pagination.total }} 条</span>
</div>
</div>
@@ -92,7 +89,7 @@
@expand-change="handleExpandChange"
@row-dblclick="handleView"
>
<el-table-column type="expand" min-width="48">
<el-table-column type="expand" class-name="pl-contract-expand-col" width="1">
<template #default="{ row }">
<div class="pl-contract-expand" v-if="expandDraft[row.id]">
<div class="pl-contract-expand__grid">
@@ -200,6 +197,52 @@
{{ getPlanTypeLabel(row.planType) }}
</template>
</el-table-column>
<el-table-column
label="合同缺口"
min-width="260"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="{ row }">
<div class="pl-gap-contract-cell">
<div class="pl-plan-contract-cell">
<div
v-for="(line, index) in planContractLines(row)"
:key="`${line.side}-${line.no}-${index}`"
class="pl-plan-contract-cell__row"
>
<span class="pl-plan-contract-cell__side">{{ line.side }}</span>
<span
class="pl-plan-contract-cell__no"
:class="{ 'is-pending': line.pending }"
>{{ line.no }}</span>
</div>
</div>
<el-button
link
type="warning"
class="pl-gap-contract-cell__action"
@click.stop="toggleExpand(row)"
>
<el-icon><EditPen /></el-icon>
{{ isExpanded(row.id) ? '收起' : '补充' }}
</el-button>
</div>
</template>
</el-table-column>
<el-table-column prop="followStatus" label="跟进状态" min-width="110" align="center">
<template #default="{ row }">
<el-tag
:type="getPlPlanFollowStatusTagType(row.followStatus)"
size="small"
effect="dark"
>
{{ getPlPlanFollowStatusLabel(row.followStatus) }}
</el-tag>
</template>
</el-table-column>
<el-table-column
prop="supplierName"
label="供方"
@@ -234,7 +277,7 @@
</el-table-column>
<el-table-column
label="产品名称"
min-width="240"
min-width="160"
align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
@@ -268,39 +311,6 @@
<PlPlanListProductCell :products="row.products" field="actualQty" />
</template>
</el-table-column>
<el-table-column label="合同缺口" min-width="130" align="center">
<template #default="{ row }">
<el-tag :type="gapTag(row).type" size="small" effect="dark">
{{ gapTag(row).text }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="followStatus" label="跟进状态" min-width="110" align="center">
<template #default="{ row }">
<el-tag
:type="getPlPlanFollowStatusTagType(row.followStatus)"
size="small"
effect="dark"
>
{{ getPlPlanFollowStatusLabel(row.followStatus) }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" min-width="200" align="center">
<template #default="{ row }">
<el-button
link
type="warning"
@click="toggleExpand(row)"
>
<el-icon><EditPen /></el-icon>
{{ isExpanded(row.id) ? '收起' : '展开补充' }}
</el-button>
<el-button link type="primary" @click="handleView(row)">
<el-icon><View /></el-icon>查看计划
</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination list-pager-bar">
@@ -327,7 +337,7 @@
</template>
<script setup lang="ts">
import { Check, EditPen, Refresh, RefreshLeft, Search, View } from '@element-plus/icons-vue'
import { Check, EditPen, Refresh, RefreshLeft, Search } from '@element-plus/icons-vue'
import {
planApi,
type PlanContractGapItem,
@@ -343,6 +353,7 @@ import {
getPlPlanFollowStatusLabel,
getPlPlanFollowStatusTagType
} from '@/utils/pl-display'
import { planContractLines } from '@/utils/pl-plan-contract-display'
import { refreshMenuBadges } from '@/utils/menu-badge-registry'
import { useMenuStore } from '@/store/modules/menu'
@@ -395,20 +406,6 @@ function linksFingerprint(links: PlanContractLink[]) {
.join(',')
}
function gapTag(row: PlanContractGapItem) {
const sides = row.gapSides || []
if (sides.includes('supplier') && sides.includes('demander')) {
return { text: '两侧均缺', type: 'danger' as const }
}
if (sides.includes('supplier')) {
return { text: '缺供方合同', type: 'warning' as const }
}
if (sides.includes('demander')) {
return { text: '缺需方合同', type: 'warning' as const }
}
return { text: '—', type: 'info' as const }
}
function getPlanTypeLabel(type?: string | null) {
const map: Record<string, string> = {
direct: '直销单',
@@ -422,11 +419,11 @@ function partySubText(row: PlanContractGapItem, side: 'supplier' | 'demander') {
if (side === 'supplier') {
if (row.supplierContractExempt) return '内置 · 合同可免'
const n = row.supplierContracts?.length || 0
return n ? `已关联 ${n} 份` : '未关联'
return n ? `已关联${n}份合同` : '未关联合同'
}
if (row.demanderContractExempt) return '内置 · 合同可免'
const n = row.demanderContracts?.length || 0
return n ? `已关联 ${n} 份` : '未关联'
return n ? `已关联${n}份合同` : '未关联合同'
}
function sideBoxClass(row: PlanContractGapItem, side: 'supplier' | 'demander') {
@@ -647,18 +644,24 @@ onMounted(() => {
</script>
<style scoped lang="scss">
.pl-plan-contract-panel-top {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 16px 20px 12px;
border-bottom: 1px solid #eef2f6;
.pl-plan-list-toolbar-row {
flex-wrap: nowrap;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
> .list-toolbar-date-shortcuts,
> .quick-search-input,
> .quick-search-group,
> .el-button,
> .pl-plan-contract-stat {
flex-shrink: 0;
}
}
.pl-plan-contract-stat {
display: inline-flex;
align-items: center;
margin-left: auto;
padding: 4px 10px;
border-radius: 8px;
font-size: 12px;
@@ -755,4 +758,66 @@ onMounted(() => {
gap: 8px;
margin-top: 10px;
}
:deep(.pl-contract-expand-col) {
.cell {
padding: 0 !important;
}
.el-table__expand-icon {
display: none;
}
}
.pl-gap-contract-cell {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 10px;
width: 100%;
}
.pl-gap-contract-cell__action {
flex-shrink: 0;
margin-top: 0;
}
.pl-plan-contract-cell {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 8px;
min-width: 0;
flex: 1;
text-align: left;
}
.pl-plan-contract-cell__row {
display: flex;
align-items: baseline;
gap: 6px;
width: 100%;
min-width: 0;
font-size: 13px;
line-height: 1.5;
color: var(--text, #1e293b);
}
.pl-plan-contract-cell__side {
flex-shrink: 0;
font-weight: 600;
color: var(--mint-text-muted, #64748b);
}
.pl-plan-contract-cell__no {
min-width: 0;
white-space: normal;
word-break: break-word;
overflow-wrap: anywhere;
&.is-pending {
font-weight: 600;
color: #d97706;
}
}
</style>
+40 -53
View File
@@ -268,29 +268,15 @@
show-overflow-tooltip
/>
<el-table-column
v-if="isColumnVisible('contractSummary')"
label="合同"
min-width="220"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
v-if="isColumnVisible('licensePlate')"
prop="licensePlate"
label="车牌号"
min-width="160"
show-overflow-tooltip
align="center"
>
<template #default="{ row }">
<div
v-if="planContractLines(row).length"
class="pl-plan-contract-cell"
>
<div
v-for="(line, index) in planContractLines(row)"
:key="`${line.side}-${line.no}-${index}`"
class="pl-plan-contract-cell__row"
>
<span class="pl-plan-contract-cell__side">{{ line.side }}</span>
<span class="pl-plan-contract-cell__no">{{ line.no }}</span>
</div>
</div>
<span v-else class="pl-plan-contract-cell__empty">—</span>
{{ formatPlVehiclePlateDisplay(row.licensePlate, row.trailerNo) }}
</template>
</el-table-column>
<el-table-column
@@ -374,18 +360,6 @@
<PlPlanListCertCell :products="row.products" compact hide-product />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('licensePlate')"
prop="licensePlate"
label="车牌号"
min-width="160"
show-overflow-tooltip
align="center"
>
<template #default="{ row }">
{{ formatPlVehiclePlateDisplay(row.licensePlate, row.trailerNo) }}
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('personnelSummary')"
prop="personnelSummary"
@@ -405,6 +379,31 @@
min-width="100"
align="center"
/>
<el-table-column
v-if="isColumnVisible('contractSummary')"
label="合同"
min-width="220"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="{ row }">
<div class="pl-plan-contract-cell">
<div
v-for="(line, index) in planContractLines(row)"
:key="`${line.side}-${line.no}-${index}`"
class="pl-plan-contract-cell__row"
>
<span class="pl-plan-contract-cell__side">{{ line.side }}</span>
<span
class="pl-plan-contract-cell__no"
:class="{ 'is-pending': line.pending }"
>{{ line.no }}</span>
</div>
</div>
</template>
</el-table-column>
</ListTable>
<ListColumnStatsRow
ref="planStatsRowRef"
@@ -568,6 +567,7 @@ import ListToolbarDateShortcuts from '@/components/core/list-toolbar-date-shortc
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
import { useListDateShortcut } from '@/composables/useListDateShortcut'
import { canBatchPrintSlip } from '@/utils/pl-batch-print'
import { planContractLines } from '@/utils/pl-plan-contract-display'
import {
canPrintSlipCommand,
formatPlVehiclePlateDisplay,
@@ -607,7 +607,7 @@ const listColumnDefs = [
{ prop: 'planType', label: '单据类型' },
{ prop: 'supplierName', label: '供方' },
{ prop: 'customerName', label: '需方' },
{ prop: 'contractSummary', label: '合同' },
{ prop: 'licensePlate', label: '车牌号' },
{ prop: 'productName', label: '产品名称' },
{ prop: 'productSpec', label: '型号/规格' },
{ prop: 'productPackageSpec', label: '包装规格' },
@@ -615,9 +615,9 @@ const listColumnDefs = [
{ prop: 'productPlanQty', label: '计划数量' },
{ prop: 'productActualQty', label: '实际数量' },
{ prop: 'planAttachments', label: '计划附件' },
{ prop: 'licensePlate', label: '车牌号' },
{ prop: 'personnelSummary', label: '人员' },
{ prop: 'followUserName', label: '跟进人', defaultVisible: false }
{ prop: 'followUserName', label: '跟进人', defaultVisible: false },
{ prop: 'contractSummary', label: '合同' }
]
const {
@@ -785,20 +785,6 @@ function getPlanTypeLabel(type?: string | null) {
return map[type] || type
}
/** 合同列:供/需合同各占一行展示 */
function planContractLines(plan: Plan): Array<{ side: string; no: string }> {
const lines: Array<{ side: string; no: string }> = []
for (const item of plan.supplierContracts || []) {
const no = item.contractNo || item.contractId
if (no) lines.push({ side: '供', no: String(no) })
}
for (const item of plan.demanderContracts || []) {
const no = item.contractNo || item.contractId
if (no) lines.push({ side: '需', no: String(no) })
}
return lines
}
async function fetchData() {
loading.value = true
try {
@@ -1190,9 +1176,10 @@ async function openArrangeFromQuery() {
white-space: normal;
word-break: break-word;
overflow-wrap: anywhere;
}
.pl-plan-contract-cell__empty {
color: var(--mint-text-muted, #64748b);
&.is-pending {
font-weight: 600;
color: #d97706;
}
}
</style>
@@ -260,7 +260,12 @@
<el-input v-model="formData.licensePlate" placeholder="请输入车牌号" maxlength="20" />
</el-form-item>
<el-form-item label="挂车号" prop="trailerNo">
<el-input v-model="formData.trailerNo" placeholder="请输入挂车号" maxlength="20" clearable />
<el-input
v-model="formData.trailerNo"
placeholder="必填;无挂车可填「货拉拉」"
maxlength="20"
clearable
/>
</el-form-item>
<el-form-item label="载重(吨)" prop="loadCapacity">
<el-input-number
@@ -621,6 +626,7 @@ const formData = reactive({
const formRules = {
licensePlate: [{ required: true, message: '请输入车牌号', trigger: 'blur' }],
trailerNo: [{ required: true, message: '请输入挂车号', trigger: 'blur' }],
vehicleStatus: [{ required: true, message: '请选择车辆状态', trigger: 'change' }],
carrierId: [{ required: true, message: '请选择承运商', trigger: 'change' }]
}
+9 -3
View File
@@ -268,7 +268,12 @@
<el-input v-model="formData.licensePlate" placeholder="请输入车牌号" maxlength="20" />
</el-form-item>
<el-form-item label="挂车号" prop="trailerNo">
<el-input v-model="formData.trailerNo" placeholder="请输入挂车号" maxlength="20" clearable />
<el-input
v-model="formData.trailerNo"
placeholder="必填;无挂车可填「货拉拉」"
maxlength="20"
clearable
/>
</el-form-item>
<el-form-item label="载重(吨)" prop="loadCapacity">
<el-input-number
@@ -398,7 +403,7 @@
:cert-name-options="certNameOptions"
layout="table"
:enforce-self-vehicle-required="false"
:enforce-carrier-vehicle-required="false"
enforce-carrier-vehicle-required
/>
</el-form>
<template #footer>
@@ -640,7 +645,8 @@ const formData = reactive({
})
const formRules = {
licensePlate: [{ required: true, message: '请输入车牌号', trigger: 'blur' }]
licensePlate: [{ required: true, message: '请输入车牌号', trigger: 'blur' }],
trailerNo: [{ required: true, message: '请输入挂车号', trigger: 'blur' }]
}
function getStatusTagType(status: string) {