提交
This commit is contained in:
1 parent
e56d227fe8
commit
4611dbc2b2
237 files changed
+1384060
-24942
No files matched your search
@@ -0,0 +1,333 @@
|
||||
<template>
|
||||
<div class="pl-plan-stops-split">
|
||||
<div class="pl-plan-stops-split__main">
|
||||
<div class="pl-plan-stops-split__pane pl-plan-stops-split__pane--load">
|
||||
<header class="pl-plan-stops-split__hd">
|
||||
<h4 class="pl-plan-stops-split__title">
|
||||
<span class="pl-plan-stops-split__dot pl-plan-stops-split__dot--load" />
|
||||
装货信息
|
||||
</h4>
|
||||
<div class="pl-plan-stops-split__hd-actions">
|
||||
<slot name="load-actions" />
|
||||
</div>
|
||||
</header>
|
||||
<div class="pl-plan-stops-split__bd">
|
||||
<slot name="load" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pl-plan-flow-bridge" aria-hidden="true">
|
||||
<span class="pl-plan-flow-bridge__label">运输</span>
|
||||
<span class="pl-plan-flow-bridge__arrow">
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||
<path
|
||||
d="M5 12h11.5"
|
||||
stroke="currentColor"
|
||||
stroke-width="2.75"
|
||||
stroke-linecap="round"
|
||||
/>
|
||||
<path
|
||||
d="M13.5 8.5 18.5 12l-5 3.5"
|
||||
stroke="currentColor"
|
||||
stroke-width="2.75"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="pl-plan-stops-split__pane pl-plan-stops-split__pane--delivery">
|
||||
<header class="pl-plan-stops-split__hd">
|
||||
<h4 class="pl-plan-stops-split__title">
|
||||
<span class="pl-plan-stops-split__dot pl-plan-stops-split__dot--delivery" />
|
||||
送货信息
|
||||
</h4>
|
||||
<div class="pl-plan-stops-split__hd-actions">
|
||||
<slot name="delivery-actions" />
|
||||
</div>
|
||||
</header>
|
||||
<div class="pl-plan-stops-split__bd">
|
||||
<slot name="delivery" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer v-if="showBalance" class="pl-plan-stops-split__balance">
|
||||
<span class="pl-plan-stops-split__balance-item">
|
||||
计划总量 <strong>{{ formatQty(planTotalQty) }}{{ unitSuffix }}</strong>
|
||||
</span>
|
||||
<span class="pl-plan-stops-split__balance-item">
|
||||
装货合计 <strong>{{ formatQty(loadTotalQty) }}{{ unitSuffix }}</strong>
|
||||
</span>
|
||||
<span class="pl-plan-stops-split__balance-item">
|
||||
送货合计 <strong>{{ formatQty(deliveryTotalQty) }}{{ unitSuffix }}</strong>
|
||||
</span>
|
||||
<span
|
||||
class="pl-plan-stops-split__balance-status"
|
||||
:class="isBalanced ? 'is-ok' : 'is-warn'"
|
||||
>
|
||||
{{ isBalanced ? '✓ 数量平衡' : '数量不平衡(可暂存)' }}
|
||||
</span>
|
||||
<span v-if="deliveryBreakdown" class="pl-plan-stops-split__balance-extra">
|
||||
{{ deliveryBreakdown }}
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
planTotalQty?: number
|
||||
loadTotalQty?: number
|
||||
deliveryTotalQty?: number
|
||||
unitLabel?: string
|
||||
showBalance?: boolean
|
||||
/** 送货各段数量摘要,如「10 + 15 + 5 = 30」 */
|
||||
deliveryBreakdown?: string
|
||||
qtyPrecision?: number
|
||||
}>(),
|
||||
{
|
||||
planTotalQty: 0,
|
||||
loadTotalQty: 0,
|
||||
deliveryTotalQty: 0,
|
||||
unitLabel: '',
|
||||
showBalance: true,
|
||||
deliveryBreakdown: '',
|
||||
qtyPrecision: 3
|
||||
}
|
||||
)
|
||||
|
||||
const unitSuffix = computed(() => (props.unitLabel ? props.unitLabel : ''))
|
||||
|
||||
const isBalanced = computed(() => {
|
||||
const plan = roundQty(props.planTotalQty)
|
||||
const load = roundQty(props.loadTotalQty)
|
||||
const delivery = roundQty(props.deliveryTotalQty)
|
||||
if (plan <= 0 && load <= 0 && delivery <= 0) return true
|
||||
return plan === load && load === delivery
|
||||
})
|
||||
|
||||
function roundQty(value: number) {
|
||||
const p = props.qtyPrecision
|
||||
return Number(Number(value || 0).toFixed(p))
|
||||
}
|
||||
|
||||
function formatQty(value: number) {
|
||||
const n = Number(value || 0)
|
||||
if (!Number.isFinite(n)) return '—'
|
||||
return String(parseFloat(n.toFixed(props.qtyPrecision)))
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pl-plan-stops-split {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
min-height: 360px;
|
||||
}
|
||||
|
||||
.pl-plan-stops-split__main {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.pl-plan-stops-split__pane {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
border: 1px solid #d9e8e2;
|
||||
border-radius: 10px;
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.pl-plan-flow-bridge {
|
||||
flex: 0 0 88px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
padding: 0 8px;
|
||||
align-self: center;
|
||||
background: transparent;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.pl-plan-flow-bridge__label {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--primary-dark, #168f45);
|
||||
letter-spacing: 0.06em;
|
||||
padding: 4px 10px;
|
||||
border-radius: 999px;
|
||||
background: #e6f8ed;
|
||||
border: 1px solid #a8e0b8;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.pl-plan-flow-bridge__arrow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 50%;
|
||||
color: var(--primary-dark, #168f45);
|
||||
background: linear-gradient(145deg, #e6f8ed 0%, #d4f0de 100%);
|
||||
border: 1px solid #a8e0b8;
|
||||
box-shadow: 0 2px 8px rgba(28, 168, 81, 0.14);
|
||||
|
||||
svg {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.pl-plan-stops-split__hd {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
height: 38px;
|
||||
min-height: 38px;
|
||||
padding: 0 12px;
|
||||
border-bottom: 1px solid #d9e8e2;
|
||||
flex-shrink: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.pl-plan-stops-split__hd-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
min-height: 0;
|
||||
gap: 4px;
|
||||
|
||||
&:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:deep(.el-button) {
|
||||
height: 26px !important;
|
||||
padding: 0 8px !important;
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
border-radius: 6px;
|
||||
font-weight: 600;
|
||||
|
||||
.el-icon {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pl-plan-stops-split__pane--load .pl-plan-stops-split__hd {
|
||||
background: linear-gradient(180deg, #ecfdf5 0%, #f8fffc 100%);
|
||||
}
|
||||
|
||||
.pl-plan-stops-split__pane--delivery .pl-plan-stops-split__hd {
|
||||
background: linear-gradient(180deg, #f0f9ff 0%, #f8fcff 100%);
|
||||
}
|
||||
|
||||
.pl-plan-stops-split__title {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: #1e293b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.pl-plan-stops-split__dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
|
||||
&--load {
|
||||
background: #10b981;
|
||||
}
|
||||
|
||||
&--delivery {
|
||||
background: #0284c7;
|
||||
}
|
||||
}
|
||||
|
||||
.pl-plan-stops-split__bd {
|
||||
padding: 12px;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.pl-plan-stops-split__balance {
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 10px 16px;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #d9e8e2;
|
||||
border-radius: 10px;
|
||||
background: #f8fafc;
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.pl-plan-stops-split__balance-item strong {
|
||||
color: #1e293b;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.pl-plan-stops-split__balance-status {
|
||||
font-weight: 600;
|
||||
|
||||
&.is-ok {
|
||||
color: #059669;
|
||||
}
|
||||
|
||||
&.is-warn {
|
||||
color: #d97706;
|
||||
}
|
||||
}
|
||||
|
||||
.pl-plan-stops-split__balance-extra {
|
||||
margin-left: auto;
|
||||
font-size: 11px;
|
||||
color: #94a3b8;
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.pl-plan-stops-split__main {
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.pl-plan-flow-bridge {
|
||||
flex: 0 0 auto;
|
||||
flex-direction: row;
|
||||
gap: 12px;
|
||||
padding: 10px 0;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.pl-plan-flow-bridge__arrow {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user