264 lines
8.5 KiB
PHP
264 lines
8.5 KiB
PHP
@php
|
|
$base = $kukaPostingBase ?? [];
|
|
$directory = $base['directory'] ?? ['fields' => [], 'empty' => '基础数据尚未导入。'];
|
|
$baseRows = $base['rows'] ?? collect();
|
|
$filters = $base['filters'] ?? [];
|
|
$periods = $base['periods'] ?? [];
|
|
$statuses = $base['statuses'] ?? [];
|
|
$stores = $base['stores'] ?? [];
|
|
$import = $base['import'] ?? null;
|
|
$summary = $base['summary'] ?? [];
|
|
$error = $base['error'] ?? null;
|
|
$resetUrl = route('business.pages.show', ['section' => 'posting-data', 'page' => 'kuka-basic-data']);
|
|
@endphp
|
|
|
|
<style>
|
|
.kuka-base-page {
|
|
--kb-gold: var(--vip-content-accent, #b9954f);
|
|
--kb-gold-dark: var(--vip-content-accent-dark, #856632);
|
|
--kb-gold-soft: var(--vip-content-accent-soft, #f7f0de);
|
|
--kb-border: var(--vip-border, #d8d2c7);
|
|
--kb-ink: var(--vip-content-ink, #171717);
|
|
--kb-muted: var(--vip-content-muted, #595959);
|
|
color: var(--kb-ink);
|
|
}
|
|
|
|
.kuka-base-page * { box-sizing: border-box; }
|
|
|
|
.kuka-base-alert {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 0.45rem;
|
|
margin-bottom: 1rem;
|
|
padding: 0.75rem 0.85rem;
|
|
border: 1px solid #dfbbbb;
|
|
border-radius: 0.6rem;
|
|
background: #fff4f4;
|
|
color: var(--vip-danger, #b80000);
|
|
font-size: 0.75rem;
|
|
line-height: 1.55;
|
|
}
|
|
|
|
.kuka-base-summary {
|
|
display: grid;
|
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
gap: 0.7rem;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.kuka-base-card {
|
|
min-width: 0;
|
|
padding: 0.8rem 0.9rem;
|
|
border: 1px solid var(--kb-border);
|
|
border-radius: 0.65rem;
|
|
background: #fffdf8;
|
|
}
|
|
|
|
.kuka-base-card span {
|
|
display: block;
|
|
color: var(--kb-muted);
|
|
font-size: 0.7rem;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.kuka-base-card strong {
|
|
display: block;
|
|
margin-top: 0.25rem;
|
|
overflow: hidden;
|
|
color: var(--kb-ink);
|
|
font-size: 1.05rem;
|
|
font-weight: 700;
|
|
line-height: 1.3;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.kuka-base-card small {
|
|
display: block;
|
|
margin-top: 0.22rem;
|
|
overflow: hidden;
|
|
color: var(--kb-muted);
|
|
font-size: 0.68rem;
|
|
line-height: 1.4;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.kuka-base-filter {
|
|
display: grid;
|
|
grid-template-columns: minmax(8rem, 0.8fr) minmax(13rem, 1.4fr) minmax(8rem, 0.8fr) minmax(15rem, 2fr) minmax(7rem, 0.7fr) auto;
|
|
align-items: end;
|
|
gap: 0.65rem;
|
|
margin-bottom: 1rem;
|
|
padding: 0.9rem 1rem;
|
|
border: 1px solid var(--kb-border);
|
|
border-radius: 0.75rem;
|
|
background: #fff;
|
|
}
|
|
|
|
.kuka-base-filter label {
|
|
display: grid;
|
|
min-width: 0;
|
|
gap: 0.28rem;
|
|
color: var(--kb-muted);
|
|
font-size: 0.7rem;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.kuka-base-filter select,
|
|
.kuka-base-filter input {
|
|
width: 100%;
|
|
height: 2.125rem;
|
|
min-width: 0;
|
|
padding: 0 0.65rem;
|
|
border: 1px solid var(--kb-border);
|
|
border-radius: 0.5rem;
|
|
background: #fff;
|
|
color: var(--kb-ink);
|
|
font: inherit;
|
|
font-size: 0.75rem;
|
|
outline: none;
|
|
}
|
|
|
|
.kuka-base-filter select:focus,
|
|
.kuka-base-filter input:focus {
|
|
border-color: var(--kb-gold-dark);
|
|
box-shadow: 0 0 0 3px rgba(133, 102, 50, 0.16);
|
|
}
|
|
|
|
.kuka-base-filter__actions {
|
|
display: flex;
|
|
gap: 0.45rem;
|
|
}
|
|
|
|
.kuka-base-filter__actions button,
|
|
.kuka-base-filter__actions a {
|
|
display: inline-flex;
|
|
height: 2.125rem;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 0 0.85rem;
|
|
border-radius: 0.5rem;
|
|
font: inherit;
|
|
font-size: 0.75rem;
|
|
text-decoration: none;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.kuka-base-filter__actions button {
|
|
border: 1px solid var(--kb-gold-dark);
|
|
background: var(--kb-gold-dark);
|
|
color: #fff;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.kuka-base-filter__actions a {
|
|
border: 1px solid var(--kb-border);
|
|
background: #fff;
|
|
color: var(--kb-ink);
|
|
}
|
|
|
|
@media (max-width: 1180px) {
|
|
.kuka-base-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
.kuka-base-filter__actions { grid-column: 1 / -1; }
|
|
}
|
|
|
|
@media (max-width: 760px) {
|
|
.kuka-base-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
.kuka-base-filter { grid-template-columns: 1fr; }
|
|
}
|
|
</style>
|
|
|
|
<div class="kuka-base-page">
|
|
@if ($error)
|
|
<div class="kuka-base-alert" role="alert">
|
|
<span class="material-icons-outlined" aria-hidden="true">error_outline</span>
|
|
<span>{{ $error }}</span>
|
|
</div>
|
|
@endif
|
|
|
|
<section class="kuka-base-summary" aria-label="基础数据汇总">
|
|
<article class="kuka-base-card">
|
|
<span>账期</span>
|
|
<strong>{{ $filters['period'] ?? '—' }}</strong>
|
|
<small>当前筛选账期</small>
|
|
</article>
|
|
<article class="kuka-base-card">
|
|
<span>原始数据行</span>
|
|
<strong>{{ number_format((int) ($summary['rows'] ?? 0)) }}</strong>
|
|
<small>当前筛选 {{ number_format((int) ($summary['filtered_rows'] ?? 0)) }} 行</small>
|
|
</article>
|
|
<article class="kuka-base-card">
|
|
<span>店铺 / 订单</span>
|
|
<strong>{{ number_format((int) ($summary['stores'] ?? 0)) }} / {{ number_format((int) ($summary['orders'] ?? 0)) }}</strong>
|
|
<small>仅包含指定店铺</small>
|
|
</article>
|
|
<article class="kuka-base-card">
|
|
<span>最近导入</span>
|
|
<strong>{{ $summary['completed_at'] ? \Illuminate\Support\Carbon::parse($summary['completed_at'])->format('Y-m-d H:i') : '尚未导入' }}</strong>
|
|
<small>{{ $import['source_sheet'] ?? '等待首次导入' }}</small>
|
|
</article>
|
|
</section>
|
|
|
|
<form class="kuka-base-filter" method="GET" action="{{ route('business.pages.show', ['section' => 'posting-data', 'page' => 'kuka-basic-data']) }}">
|
|
<label>
|
|
账期
|
|
<select name="period">
|
|
@if ($periods === [])
|
|
<option value="{{ $filters['period'] ?? '' }}">{{ $filters['period'] ?? '尚无数据' }}</option>
|
|
@endif
|
|
@foreach ($periods as $period)
|
|
<option value="{{ $period }}" @selected(($filters['period'] ?? '') === $period)>{{ $period }}</option>
|
|
@endforeach
|
|
</select>
|
|
</label>
|
|
<label>
|
|
店铺
|
|
<select name="store_name">
|
|
<option value="">全部指定店铺</option>
|
|
@foreach ($stores as $store)
|
|
<option value="{{ $store }}" @selected(($filters['store_name'] ?? '') === $store)>{{ $store }}</option>
|
|
@endforeach
|
|
</select>
|
|
</label>
|
|
<label>
|
|
订单状态
|
|
<select name="status">
|
|
<option value="">全部状态</option>
|
|
@foreach ($statuses as $status)
|
|
<option value="{{ $status }}" @selected(($filters['status'] ?? '') === $status)>{{ $status }}</option>
|
|
@endforeach
|
|
</select>
|
|
</label>
|
|
<label>
|
|
内部单号 / 线上单号 / 商品编码
|
|
<input type="search" name="keyword" value="{{ $filters['keyword'] ?? '' }}" placeholder="输入单号或商品编码" autocomplete="off">
|
|
</label>
|
|
<label>
|
|
每页
|
|
<select name="per_page">
|
|
@foreach ([50, 100, 200] as $size)
|
|
<option value="{{ $size }}" @selected((int) ($filters['per_page'] ?? 50) === $size)>{{ $size }} 行</option>
|
|
@endforeach
|
|
</select>
|
|
</label>
|
|
<div class="kuka-base-filter__actions">
|
|
<button type="submit">查询</button>
|
|
<a href="{{ $resetUrl }}">重置</a>
|
|
</div>
|
|
</form>
|
|
|
|
@include('business.pages.partials.directory-table', [
|
|
'directory' => $directory,
|
|
'rows' => $baseRows,
|
|
'section' => $section,
|
|
'page' => $page,
|
|
'upstreamError' => $error,
|
|
'showDirectoryIntro' => false,
|
|
'showDirectoryIndex' => false,
|
|
'enableColumnResize' => true,
|
|
'columnWidths' => config('kuka_posting.field_widths', []),
|
|
'columnPreferenceVersion' => 'kuka-shipment-columns-v4',
|
|
])
|
|
</div>
|