232 lines
7.5 KiB
PHP
232 lines
7.5 KiB
PHP
@php
|
|
$quotation = $kukaQuotation ?? [];
|
|
$directory = $quotation['directory'] ?? ['fields' => [], 'empty' => '顾家报价单尚未导入。'];
|
|
$rows = $quotation['rows'] ?? collect();
|
|
$filters = $quotation['filters'] ?? [];
|
|
$statuses = $quotation['statuses'] ?? [];
|
|
$summary = $quotation['summary'] ?? [];
|
|
$import = $quotation['import'] ?? [];
|
|
$error = $quotation['error'] ?? null;
|
|
$resetUrl = route('business.pages.show', [
|
|
'section' => 'posting-data',
|
|
'page' => 'kuka-basic-data',
|
|
'submenu' => 'quotation',
|
|
]);
|
|
$statusCount = array_sum(array_map('intval', (array) ($import['statuses'] ?? [])));
|
|
@endphp
|
|
|
|
<style>
|
|
.kuka-quotation-page {
|
|
--kq-gold-dark: var(--vip-content-accent-dark, #856632);
|
|
--kq-border: var(--vip-border, #d8d2c7);
|
|
--kq-muted: var(--vip-content-muted, #595959);
|
|
display: grid;
|
|
gap: 12px;
|
|
color: var(--vip-content-ink, #171717);
|
|
}
|
|
.kuka-quotation-alert {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 10px 12px;
|
|
border: 1px solid #dfbbbb;
|
|
border-radius: 8px;
|
|
background: #fff4f4;
|
|
color: var(--vip-danger, #b80000);
|
|
font-size: 12px;
|
|
}
|
|
.kuka-quotation-alert .material-icons-outlined { font-size: 18px; }
|
|
.kuka-quotation-cards {
|
|
display: grid;
|
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
gap: 10px;
|
|
}
|
|
.kuka-quotation-card {
|
|
min-width: 0;
|
|
padding: 13px 15px;
|
|
border: 1px solid var(--kq-border);
|
|
border-radius: 12px;
|
|
background: #fffdf8;
|
|
}
|
|
.kuka-quotation-card span {
|
|
display: block;
|
|
color: var(--kq-muted);
|
|
font-size: 11px;
|
|
line-height: 1.4;
|
|
}
|
|
.kuka-quotation-card strong {
|
|
display: block;
|
|
margin-top: 4px;
|
|
overflow: hidden;
|
|
font-size: 18px;
|
|
font-weight: 700;
|
|
line-height: 1.3;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
.kuka-quotation-card small {
|
|
display: block;
|
|
margin-top: 4px;
|
|
color: var(--kq-muted);
|
|
font-size: 10px;
|
|
line-height: 1.4;
|
|
}
|
|
.kuka-quotation-filter {
|
|
display: grid;
|
|
grid-template-columns: minmax(18rem, 1fr) minmax(9rem, 0.35fr) minmax(7rem, 0.25fr) auto;
|
|
align-items: end;
|
|
gap: 10px;
|
|
padding: 12px 14px;
|
|
border: 1px solid var(--kq-border);
|
|
border-radius: 12px;
|
|
background: #fff;
|
|
}
|
|
.kuka-quotation-filter label {
|
|
display: grid;
|
|
min-width: 0;
|
|
gap: 5px;
|
|
color: var(--kq-muted);
|
|
font-size: 11px;
|
|
font-weight: 500;
|
|
}
|
|
.kuka-quotation-filter input,
|
|
.kuka-quotation-filter select {
|
|
width: 100%;
|
|
height: 34px;
|
|
min-width: 0;
|
|
padding: 0 10px;
|
|
border: 1px solid var(--kq-border);
|
|
border-radius: 8px;
|
|
background: #fff;
|
|
color: var(--vip-content-ink, #171717);
|
|
font: inherit;
|
|
font-size: 12px;
|
|
}
|
|
.kuka-quotation-filter input:focus,
|
|
.kuka-quotation-filter select:focus {
|
|
border-color: var(--kq-gold-dark);
|
|
box-shadow: 0 0 0 3px rgba(133, 102, 50, 0.16);
|
|
outline: 0;
|
|
}
|
|
.kuka-quotation-filter__actions {
|
|
display: flex;
|
|
gap: 8px;
|
|
}
|
|
.kuka-quotation-filter__actions button,
|
|
.kuka-quotation-filter__actions a {
|
|
display: inline-flex;
|
|
height: 34px;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 0 14px;
|
|
border-radius: 8px;
|
|
font: inherit;
|
|
font-size: 12px;
|
|
text-decoration: none;
|
|
white-space: nowrap;
|
|
}
|
|
.kuka-quotation-filter__actions button {
|
|
border: 1px solid var(--kq-gold-dark);
|
|
background: var(--kq-gold-dark);
|
|
color: #fff;
|
|
}
|
|
.kuka-quotation-filter__actions a {
|
|
border: 1px solid var(--kq-border);
|
|
background: #fff;
|
|
color: var(--vip-content-ink, #171717);
|
|
}
|
|
@media (max-width: 900px) {
|
|
.kuka-quotation-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
.kuka-quotation-filter { grid-template-columns: 1fr 1fr; }
|
|
}
|
|
@media (max-width: 600px) {
|
|
.kuka-quotation-cards { grid-template-columns: 1fr; }
|
|
.kuka-quotation-filter { grid-template-columns: 1fr; }
|
|
}
|
|
</style>
|
|
|
|
<div class="kuka-quotation-page">
|
|
@if ($error)
|
|
<div class="kuka-quotation-alert" role="alert">
|
|
<span class="material-icons-outlined" aria-hidden="true">error_outline</span>
|
|
<span>{{ $error }}</span>
|
|
</div>
|
|
@endif
|
|
|
|
<section class="kuka-quotation-cards" aria-label="顾家报价单汇总">
|
|
<article class="kuka-quotation-card">
|
|
<span>报价记录</span>
|
|
<strong>{{ number_format((int) ($summary['rows'] ?? 0)) }}</strong>
|
|
<small>当前共享镜像</small>
|
|
</article>
|
|
<article class="kuka-quotation-card">
|
|
<span>唯一物料</span>
|
|
<strong>{{ number_format((int) ($summary['materials'] ?? 0)) }}</strong>
|
|
<small>按物料编码去重</small>
|
|
</article>
|
|
<article class="kuka-quotation-card">
|
|
<span>生效记录</span>
|
|
<strong>{{ number_format($statusCount) }}</strong>
|
|
<small>{{ implode(' / ', array_keys((array) ($import['statuses'] ?? []))) ?: '状态待同步' }}</small>
|
|
</article>
|
|
<article class="kuka-quotation-card">
|
|
<span>价格有效期</span>
|
|
<strong>
|
|
{{ $summary['valid_from'] ? substr((string) $summary['valid_from'], 0, 10) : '—' }}
|
|
~
|
|
{{ $summary['valid_to'] ? substr((string) $summary['valid_to'], 0, 10) : '—' }}
|
|
</strong>
|
|
<small>最早开始至最晚结束</small>
|
|
</article>
|
|
</section>
|
|
|
|
<form
|
|
class="kuka-quotation-filter"
|
|
method="GET"
|
|
action="{{ route('business.pages.show', ['section' => 'posting-data', 'page' => 'kuka-basic-data']) }}"
|
|
>
|
|
<input type="hidden" name="submenu" value="quotation">
|
|
<label>
|
|
物料编码 / 物料描述 / 供应商
|
|
<input
|
|
type="search"
|
|
name="keyword"
|
|
value="{{ $filters['keyword'] ?? '' }}"
|
|
placeholder="输入关键词查询"
|
|
autocomplete="off"
|
|
>
|
|
</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>
|
|
每页
|
|
<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-quotation-filter__actions">
|
|
<button type="submit">查询</button>
|
|
<a href="{{ $resetUrl }}">重置</a>
|
|
</div>
|
|
</form>
|
|
|
|
@include('business.pages.partials.directory-table', [
|
|
'directory' => $directory,
|
|
'rows' => $rows,
|
|
'section' => $section,
|
|
'page' => $page,
|
|
'upstreamError' => $error,
|
|
'directoryTableKey' => 'kuka-quotation',
|
|
'showDirectoryIntro' => false,
|
|
])
|
|
</div>
|