CaiWuXiTong/resources/views/business/pages/courier-payables/partials/accessory-reship-configs.blade.php

64 lines
7.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="reship-config-workspace">
<div class="reship-heading"><div><h2>快递公司配置</h2><p>按首发快递名称精确匹配配置,扣款金额=补发运费×扣款比例。</p></div></div>
@if (session('reship_config_message'))<div class="reship-notice" role="status">{{ session('reship_config_message') }}</div>@endif
@if ($errors->any())<div class="reship-error" role="alert">{{ $errors->first() }}</div>@endif
<form method="GET" class="reship-toolbar" aria-label="快递配置查询">
<input type="hidden" name="reship_view" value="config">
<label>创建时间从<input type="date" name="created_from" value="{{ $configFilters['created_from'] }}"></label>
<label>至<input type="date" name="created_to" value="{{ $configFilters['created_to'] }}"></label>
<label>快递公司<input name="courier_name" maxlength="191" value="{{ $configFilters['courier_name'] }}" placeholder="输入快递名称"></label>
<label>创建人<input name="creator" maxlength="191" value="{{ $configFilters['creator'] }}"></label>
<label>删除状态<select name="deleted_status"><option value="active" @selected($configFilters['deleted_status'] === 'active')>正常</option><option value="deleted" @selected($configFilters['deleted_status'] === 'deleted')>已删除</option><option value="all" @selected($configFilters['deleted_status'] === 'all')>全部</option></select></label>
<button class="reship-primary" type="submit">查询</button>
<a class="reship-button" data-reship-tab href="{{ route('business.pages.show', ['section'=>'courier-payables','page'=>'accessory-reship-deductions','reship_view'=>'config']) }}">重置</a>
</form>
<div class="reship-toolbar">
<button class="reship-primary" type="button" data-config-new>新增</button>
<button type="button" data-config-import>导入Excel</button>
<a class="reship-button" href="{{ route('business.accessory-reship-configs.export', $configFilters) }}">导出配置</a>
<button type="button" data-config-refresh>刷新</button>
<span class="reship-config-hint">比例范围0%~100%,0%表示不扣款。删除可恢复,已删除配置不参与核算。</span>
</div>
<section class="reship-panel" data-finance-table-surface>
<div class="reship-table-scroll"><table><thead><tr><th>创建时间</th><th>快递公司</th><th>快递代码</th><th>扣款比例(%)</th><th>创建人</th><th>删除状态</th><th>操作</th></tr></thead><tbody>
@forelse ($configRows as $config)
<tr><td>{{ $config->source_created_at ?: $config->created_at }}</td><td>{{ $config->courier_name }}</td><td>{{ $config->courier_code }}</td><td class="reship-money">{{ number_format($config->rate_basis_points / 100, 2) }}%</td><td>{{ $config->creator }}</td><td>{{ $config->deleted_at ? '已删除' : '正常' }}</td><td class="reship-config-actions">
@if (!$config->deleted_at)
<button type="button" data-config-edit data-record="{{ json_encode(['courier_code'=>$config->courier_code,'courier_name'=>$config->courier_name,'rate_percent'=>number_format($config->rate_basis_points/100,2,'.','')]) }}" data-url="{{ route('business.accessory-reship-configs.update', $config->id) }}">编辑</button>
<form method="POST" action="{{ route('business.accessory-reship-configs.destroy', $config->id) }}" data-config-delete>@csrf @method('DELETE')<button type="submit">删除</button></form>
@else
<form method="POST" action="{{ route('business.accessory-reship-configs.restore', $config->id) }}">@csrf<button type="submit">恢复</button></form>
@endif
</td></tr>
@empty<tr><td colspan="7" class="reship-empty">暂无符合条件的快递配置。</td></tr>@endforelse
</tbody></table></div>
<div class="reship-footer">共 {{ $configRows->total() }} 条,每页20条 {{ $configRows->links() }}</div>
</section>
<h3 class="reship-config-log-title">操作日志</h3>
<section class="reship-panel"><div class="reship-table-scroll"><table><thead><tr><th>操作时间</th><th>操作用户</th><th>系统功能</th><th>操作类型</th><th>执行结果</th><th>执行结果描述</th></tr></thead><tbody>
@forelse ($configEvents as $event)<tr><td>{{ $event->created_at }}</td><td>{{ $event->actor }}</td><td>配件补发扣款配置</td><td>{{ ['create'=>'新增','update'=>'编辑','delete'=>'删除','restore'=>'恢复','import'=>'导入'][$event->action] ?? $event->action }}</td><td>成功</td><td>{{ $event->description }}</td></tr>@empty<tr><td colspan="6" class="reship-empty">暂无操作记录。</td></tr>@endforelse
</tbody></table></div><div class="reship-footer">{{ $configEvents->links() }}</div></section>
<dialog class="reship-config-dialog" data-config-editor>
<form method="POST" action="{{ route('business.accessory-reship-configs.store') }}" data-create-url="{{ route('business.accessory-reship-configs.store') }}">
@csrf<input type="hidden" name="_method" value="POST">
<h3 data-editor-title>新增快递配置</h3>
<label>快递公司<input name="courier_name" required maxlength="191" autocomplete="off"></label>
<label>快递代码<input name="courier_code" required maxlength="64" autocomplete="off"></label>
<label>扣款比例(%)<input name="rate_percent" type="number" min="0" max="100" step="0.01" required placeholder="例如50表示50%"></label>
<p>补发运费按此比例核算。0%不扣款,配置修改后核对清单重新计算。</p>
<div class="reship-toolbar"><button type="submit" class="reship-primary">保存</button><button type="button" data-dialog-close>取消</button></div>
</form>
</dialog>
<dialog class="reship-config-dialog" data-config-importer>
<form method="POST" enctype="multipart/form-data" action="{{ route('business.accessory-reship-configs.import') }}">@csrf
<h3>导入快递配置</h3><p>列名:快递代码、快递公司、创建时间、创建人、扣款比率(%)。保留原始创建时间和创建人。</p>
<input type="file" name="file" accept=".xlsx" required>
<p>相同配置重复导入会跳过;代码或名称冲突时整批不导入,不覆盖现有配置。</p>
<div class="reship-toolbar"><button class="reship-primary" type="submit">导入</button><button type="button" data-dialog-close>取消</button></div>
</form>
</dialog>
</div>
<style>
.reship-toolbar select{height:34px;padding:0 10px;border:1px solid #D8D2C7;background:#fff;border-radius:8px}.reship-config-hint{font-size:12px;color:#595959;align-self:center}.reship-config-actions{white-space:nowrap}.reship-config-actions form{display:inline}.reship-config-actions button{border:1px solid #D8D2C7;border-radius:4px;background:#fff;color:#856632;padding:4px 8px;margin-right:6px;cursor:pointer}.reship-config-dialog{width:min(460px,90vw);border:1px solid #D8D2C7;border-radius:12px;background:#fff;color:#171717;padding:24px}.reship-config-dialog::backdrop{background:#0006}.reship-config-dialog h3{font-size:16px;margin:0 0 16px}.reship-config-dialog label{display:grid;gap:8px;margin:12px 0;font-size:13px}.reship-config-dialog label input{height:34px;border:1px solid #D8D2C7;border-radius:8px;padding:0 10px}.reship-config-dialog p{font-size:12px;color:#595959;line-height:1.7;margin:12px 0}.reship-config-log-title{font-size:14px;margin:24px 0 12px}
</style>