修改:物流列表显示内容优化

This commit is contained in:
wuhui_zzw 2023-08-21 18:05:03 +08:00
parent afa9b0be6f
commit f1f2a7d1bf
4 changed files with 141 additions and 76 deletions

View File

@ -2,6 +2,7 @@
namespace Beike\Admin\Http\Resources;
use Beike\Repositories\CountryRepo;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
@ -14,15 +15,16 @@ class LogisticsResource extends JsonResource
* @return array
* @throws \Exception
*/
public function toArray($request): array
{
public function toArray($request): array{
$countryIds = (array)explode(',',$this->country_ids);
$countryList = CountryRepo::getInList($countryIds);
$countryNames = implode('',array_column($countryList,'name'));
$data = [
'id' => $this->id,
'name' => $this->name ?? '',
'warehouse_name' => $this->warehouse_name ?? '',
'country_id' => $this->country_id,
'country' => $this->country ? $this->country->name : '',
'country' => $countryNames,//$this->country ? $this->country->name : '',
'type' => $this->type,
'first_weight' => $this->first_weight,

View File

@ -3,6 +3,45 @@
@section('title', __('admin/common.logistics'))
@section('content')
<style>
.fcm-content{
width: 230px!important;
}
.fcm-content .fcm-top{
width: 100%;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
}
.fcm-content .fcm-top .fcm-top-box{
padding: 5px;
}
.fcm-content .title{
font-size: 16px;
font-weight: bold;
color: #6e6e6e;
}
.fcm-content .num{
font-size: 14px;
color: #a9a9a9;
}
.fcm-content .fcm-top .fcm-top-box:first-child{
margin-right: 15px;
}
.fcm-content .fcm-footer{
padding: 5px;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: flex-start;
}
.fcm-content .fcm-footer .title{
margin-right: 10px;
}
</style>
@if ($errors->has('error'))
<x-admin-alert type="danger" msg="{{ $errors->first('error') }}" class="mt-4" />
@endif
@ -36,13 +75,9 @@
<th>{{ __('common.id') }}</th>
<th>{{ __('admin/logistics.logistics_name') }}</th>
<th>{{ __('admin/logistics.warehouse_name') }}</th>
<th>{{ __('admin/country.index') }}</th>
<th style="max-width: 350px!important;">{{ __('admin/country.index') }}</th>
<th>{{ __('admin/logistics.type') }}</th>
<th>{{ __('admin/logistics.first_weight') }}</th>
<th>{{ __('admin/logistics.first_weight_fee') }}</th>
<th>{{ __('admin/logistics.add_weight') }}</th>
<th>{{ __('admin/logistics.continuation_weight_fee') }}</th>
<th>{{ __('admin/logistics.throwing_ratio') }}</th>
<th style="width: 230px!important;">{{ __('admin/logistics.freight_calculation_method') }}</th>
<th>{{ __('admin/logistics.day') }}</th>
<th>{{ __('common.sort_order') }}</th>
<th>{{ __('common.created_at') }}</th>
@ -58,15 +93,46 @@
<td>{{ $logistic['id'] }}</td>
<td>{{ $logistic['name'] }}</td>
<td>{{ $logistic['warehouse_name'] }}</td>
<td>{{ $logistic['country'] }}</td>
<td style="max-width: 350px!important;">{{ $logistic['country'] }}</td>
<td>{{ __('admin/logistics.type_' . $logistic['type']) }}</td>
<td>{{ $logistic['first_weight'] }}</td>
<td>{{ $logistic['first_weight_fee'] }}</td>
{{-- <td>{{ $logistic['continuation_weight_max'] }}</td>--}}
<td>{{ $logistic['add_weight'] }}</td>
<td>{{ $logistic['continuation_weight_fee'] }}</td>
{{-- <td>{{ $logistic['num_fee'] }}</td>--}}
<td>{{ $logistic['throwing_ratio'] }}</td>
<td class="fcm-content">
<div class="fcm-top">
<div class="fcm-top-box">
<div class="title">{{ __('admin/logistics.first_weight') }}</div>
<div class="num">{{ $logistic['first_weight'] }}KG</div>
</div>
<div class="fcm-top-box">
<div class="title">{{ __('admin/logistics.first_weight_fee') }}</div>
<div class="num">{{ $logistic['first_weight_fee'] }}USD</div>
</div>
</div>
<div class="fcm-top">
<div class="fcm-top-box">
<div class="title">{{ __('admin/logistics.add_weight') }}</div>
<div class="num">{{ $logistic['add_weight'] }}KG</div>
</div>
<div class="fcm-top-box">
<div class="title">{{ __('admin/logistics.continuation_weight_fee') }}</div>
<div class="num">{{ $logistic['continuation_weight_fee'] }}USD</div>
</div>
</div>
<div class="fcm-footer">
<div class="title">{{ __('admin/logistics.throwing_ratio') }}</div>
<div class="num">{{ $logistic['throwing_ratio'] }}</div>
</div>
{{--<td{{ $logistic['first_weight'] }}></td>--}}
{{--<td>{{ $logistic['first_weight_fee'] }}</td>--}}
{{-- <td>{{ $logistic['continuation_weight_max'] }}</td>--}}
{{--<td>{{ $logistic['add_weight'] }}</td>--}}
{{--<td>{{ $logistic['continuation_weight_fee'] }}</td>--}}
{{-- <td>{{ $logistic['num_fee'] }}</td>--}}
{{--<td>{{ $logistic['throwing_ratio'] }}</td>--}}
</td>
<td>{{ $logistic['day_min'] }} - {{ $logistic['day_max'] }} {{ __('admin/logistics.work_day') }}</td>
<td>{{ $logistic['position'] }}</td>
<td>{{ $logistic['created_at'] }}</td>

View File

@ -76,4 +76,5 @@ return [
'first_num_fee'=>'First num fee',
'add_num'=>'Add num',
'continuation_num_fee'=>'Continuation num fee',
'freight_calculation_method'=>'Freight calculation method',
];

View File

@ -1,14 +1,12 @@
<?php
/**
* order.php
*
* @copyright 2022 beikeshop.com - All Rights Reserved
* @link https://beikeshop.com
* @author Edward Yang <yangjin@guangda.work>
* @created 2022-08-02 14:22:41
* @modified 2022-08-02 14:22:41
*/
return [
'logistics_index' => '物流列表',
'logistics_name' => '物流名称',
@ -19,65 +17,63 @@ return [
'logistics_delete' => '删除物流',
'logistics_trashed' => '回收站',
'logistics_restore' => '恢复回收站',
'clear_restore' => '清空回收站',
'clear_restore' => '清空回收站',
'logistics_filter_index' => '查看高级筛选',
'logistics_filter_update' => '修改高级筛选',
'batch_delete' => '批量删除',
'batch_active' => '批量上架',
'batch_inactive' => '批量下架',
'basic_information' => '基础信息',
'product_details' => '物流详情',
'product_relations' => '相关物流',
'stocks' => '物流库存',
'model' => '型号',
'price' => '价格',
'origin_price' => '原价',
'cost_price' => '成本价',
'quantity' => '数量',
'enable_multi_spec' => '启用多规格',
'image_help' => '第一张图片将作为物流主图,支持同时上传多张图片,多张图片之间可随意调整位置',
'video_help' => '如果提示超出系统大小限制,请修改 php.ini 参数 post_max_size',
'add_variable' => '添加规格',
'add_variable_value' => '添加规格值',
'add_variable_image' => '添加规格图片',
'default_main_product' => '默认主物流',
'modify_order' => '双击修改、拖动调整顺序',
'weight_text' => '重量',
'length_width_height' => '长宽高',
'length' => '长',
'width' => '宽',
'height' => '高',
'weight_class' => '重量单位',
'confirm_batch_product' => '确认要批量删除选中的物流吗?',
'confirm_batch_status' => '确认要批量修改选中的物流的状态吗?',
'confirm_batch_restore' => '确认要恢复选中的物流吗?',
'confirm_delete_restore' => '确认要清空回收站吗?',
'price_setting' => '价格设置',
'price_setting_by' =>[
'batch_delete' => '批量删除',
'batch_active' => '批量上架',
'batch_inactive' => '批量下架',
'basic_information' => '基础信息',
'product_details' => '物流详情',
'product_relations' => '相关物流',
'stocks' => '物流库存',
'model' => '型号',
'price' => '价格',
'origin_price' => '原价',
'cost_price' => '成本价',
'quantity' => '数量',
'enable_multi_spec' => '启用多规格',
'image_help' => '第一张图片将作为物流主图,支持同时上传多张图片,多张图片之间可随意调整位置',
'video_help' => '如果提示超出系统大小限制,请修改 php.ini 参数 post_max_size',
'add_variable' => '添加规格',
'add_variable_value' => '添加规格值',
'add_variable_image' => '添加规格图片',
'default_main_product' => '默认主物流',
'modify_order' => '双击修改、拖动调整顺序',
'weight_text' => '重量',
'length_width_height' => '长宽高',
'length' => '长',
'width' => '宽',
'height' => '高',
'weight_class' => '重量单位',
'confirm_batch_product' => '确认要批量删除选中的物流吗?',
'confirm_batch_status' => '确认要批量修改选中的物流的状态吗?',
'confirm_batch_restore' => '确认要恢复选中的物流吗?',
'confirm_delete_restore' => '确认要清空回收站吗?',
'price_setting' => '价格设置',
'price_setting_by' => [
'sku' => '根据规格设置价格',
'num' => '根据数量设置价格',
],
'warehouse_name' => '仓库名称',
'type'=>'类型',
'first_weight'=>'首重',
'first_weight_fee'=>'首重运费',
'continuation_weight_max'=>'续重范围',
'add_weight'=>'每增加重量',
'continuation_weight_fee'=>'续重运费',
'num_fee'=>'一件价格',
'throwing_ratio'=>'计抛比',
'day_min'=>'最短时间',
'day_max'=>'最长时间',
'day'=>'时效',
'work_day'=>'工作天',
'type_weight'=>'按重量计费',
'type_num'=>'按数量计费',
'type_free'=>'商家包邮',
'first_num'=>'首件数量',
'first_num_fee'=>'首件运费',
'add_num'=>'每增加件',
'continuation_num_fee'=>'续件运费',
'warehouse_name' => '仓库名称',
'type' => '类型',
'first_weight' => '首重',
'first_weight_fee' => '首重运费',
'continuation_weight_max' => '续重范围',
'add_weight' => '每增加重量',
'continuation_weight_fee' => '续重运费',
'num_fee' => '一件价格',
'throwing_ratio' => '计抛比',
'day_min' => '最短时间',
'day_max' => '最长时间',
'day' => '时效',
'work_day' => '工作天',
'type_weight' => '按重量计费',
'type_num' => '按数量计费',
'type_free' => '商家包邮',
'first_num' => '首件数量',
'first_num_fee' => '首件运费',
'add_num' => '每增加件',
'continuation_num_fee' => '续件运费',
'freight_calculation_method' => '运费计算方式',
];