1
This commit is contained in:
@@ -56,6 +56,39 @@ class VehicleController extends Crud
|
||||
$common = (array)require __DIR__ . '/../lang/' . $lang . '/common.php';
|
||||
$translations = array_merge($translations, $common);
|
||||
|
||||
// 只在中文时使用默认翻译
|
||||
if ($lang === 'zh-cn') {
|
||||
$required_translations = [
|
||||
'brand' => '车辆品牌',
|
||||
'brand_placeholder' => '请输入车辆品牌',
|
||||
'model' => '车辆型号',
|
||||
'model_placeholder' => '请输入车辆型号',
|
||||
'vin' => '车架号',
|
||||
'vin_placeholder' => '请输入车架号',
|
||||
'status' => '车辆状态',
|
||||
'status_placeholder' => '请选择状态',
|
||||
'purchase_location' => '买车地点',
|
||||
'purchase_location_placeholder' => '请输入买车地点',
|
||||
'procedure_location' => '手续办理地',
|
||||
'procedure_location_placeholder' => '请输入手续办理地',
|
||||
'fbo_location' => 'FBO目的地',
|
||||
'fbo_location_placeholder' => '请选择FBO目的地',
|
||||
'current_location' => '车辆所在地',
|
||||
'current_location_placeholder' => '请选择车辆所在地',
|
||||
'final_location' => '最终目的地',
|
||||
'final_location_placeholder' => '请选择最终目的地',
|
||||
'departure_time' => 'FBO发车时间',
|
||||
'departure_time_placeholder' => '请选择发车时间',
|
||||
'arrival_time' => 'FBO到达时间',
|
||||
'arrival_time_placeholder' => '请选择到达时间',
|
||||
'shipping_cycle' => '运输周期',
|
||||
'shipping_cycle_placeholder' => '请输入运输周期',
|
||||
'img_url' => '图片',
|
||||
'img_url_placeholder' => '请输入图片URL'
|
||||
];
|
||||
$translations = array_merge($required_translations, $translations);
|
||||
}
|
||||
|
||||
return view('vehicle/index', [
|
||||
'lang' => $lang,
|
||||
'translations' => $translations
|
||||
@@ -75,6 +108,39 @@ class VehicleController extends Crud
|
||||
$common = (array)require __DIR__ . '/../lang/' . $lang . '/common.php';
|
||||
$translations = array_merge($translations, $common);
|
||||
|
||||
// 只在中文时使用默认翻译
|
||||
if ($lang === 'zh-cn') {
|
||||
$required_translations = [
|
||||
'brand' => '车辆品牌',
|
||||
'brand_placeholder' => '请输入车辆品牌',
|
||||
'model' => '车辆型号',
|
||||
'model_placeholder' => '请输入车辆型号',
|
||||
'vin' => '车架号',
|
||||
'vin_placeholder' => '请输入车架号',
|
||||
'status' => '车辆状态',
|
||||
'status_placeholder' => '请选择状态',
|
||||
'purchase_location' => '买车地点',
|
||||
'purchase_location_placeholder' => '请输入买车地点',
|
||||
'procedure_location' => '手续办理地',
|
||||
'procedure_location_placeholder' => '请输入手续办理地',
|
||||
'fbo_location' => 'FBO目的地',
|
||||
'fbo_location_placeholder' => '请选择FBO目的地',
|
||||
'current_location' => '车辆所在地',
|
||||
'current_location_placeholder' => '请选择车辆所在地',
|
||||
'final_location' => '最终目的地',
|
||||
'final_location_placeholder' => '请选择最终目的地',
|
||||
'departure_time' => 'FBO发车时间',
|
||||
'departure_time_placeholder' => '请选择发车时间',
|
||||
'arrival_time' => 'FBO到达时间',
|
||||
'arrival_time_placeholder' => '请选择到达时间',
|
||||
'shipping_cycle' => '运输周期',
|
||||
'shipping_cycle_placeholder' => '请输入运输周期',
|
||||
'img_url' => '图片',
|
||||
'img_url_placeholder' => '请输入图片URL'
|
||||
];
|
||||
$translations = array_merge($required_translations, $translations);
|
||||
}
|
||||
|
||||
return view('vehicle/insert', [
|
||||
'lang' => $lang,
|
||||
'translations' => $translations
|
||||
@@ -95,6 +161,39 @@ class VehicleController extends Crud
|
||||
$common = (array)require __DIR__ . '/../lang/' . $lang . '/common.php';
|
||||
$translations = array_merge($translations, $common);
|
||||
|
||||
// 只在中文时使用默认翻译
|
||||
if ($lang === 'zh-cn') {
|
||||
$required_translations = [
|
||||
'brand' => '车辆品牌',
|
||||
'brand_placeholder' => '请输入车辆品牌',
|
||||
'model' => '车辆型号',
|
||||
'model_placeholder' => '请输入车辆型号',
|
||||
'vin' => '车架号',
|
||||
'vin_placeholder' => '请输入车架号',
|
||||
'status' => '车辆状态',
|
||||
'status_placeholder' => '请选择状态',
|
||||
'purchase_location' => '买车地点',
|
||||
'purchase_location_placeholder' => '请输入买车地点',
|
||||
'procedure_location' => '手续办理地',
|
||||
'procedure_location_placeholder' => '请输入手续办理地',
|
||||
'fbo_location' => 'FBO目的地',
|
||||
'fbo_location_placeholder' => '请选择FBO目的地',
|
||||
'current_location' => '车辆所在地',
|
||||
'current_location_placeholder' => '请选择车辆所在地',
|
||||
'final_location' => '最终目的地',
|
||||
'final_location_placeholder' => '请选择最终目的地',
|
||||
'departure_time' => 'FBO发车时间',
|
||||
'departure_time_placeholder' => '请选择发车时间',
|
||||
'arrival_time' => 'FBO到达时间',
|
||||
'arrival_time_placeholder' => '请选择到达时间',
|
||||
'shipping_cycle' => '运输周期',
|
||||
'shipping_cycle_placeholder' => '请输入运输周期',
|
||||
'img_url' => '图片',
|
||||
'img_url_placeholder' => '请输入图片URL'
|
||||
];
|
||||
$translations = array_merge($required_translations, $translations);
|
||||
}
|
||||
|
||||
$data = Vehicle::where('id', $id)->first();
|
||||
if (!$data) {
|
||||
return json(['code' => 1, 'msg' => $translations['data_not_found'] ?? '数据不存在']);
|
||||
@@ -122,6 +221,39 @@ class VehicleController extends Crud
|
||||
$common = (array)require __DIR__ . '/../lang/' . $lang . '/common.php';
|
||||
$translations = array_merge($translations, $common);
|
||||
|
||||
// 只在中文时使用默认翻译
|
||||
if ($lang === 'zh-cn') {
|
||||
$required_translations = [
|
||||
'brand' => '车辆品牌',
|
||||
'brand_placeholder' => '请输入车辆品牌',
|
||||
'model' => '车辆型号',
|
||||
'model_placeholder' => '请输入车辆型号',
|
||||
'vin' => '车架号',
|
||||
'vin_placeholder' => '请输入车架号',
|
||||
'status' => '车辆状态',
|
||||
'status_placeholder' => '请选择状态',
|
||||
'purchase_location' => '买车地点',
|
||||
'purchase_location_placeholder' => '请输入买车地点',
|
||||
'procedure_location' => '手续办理地',
|
||||
'procedure_location_placeholder' => '请输入手续办理地',
|
||||
'fbo_location' => 'FBO目的地',
|
||||
'fbo_location_placeholder' => '请选择FBO目的地',
|
||||
'current_location' => '车辆所在地',
|
||||
'current_location_placeholder' => '请选择车辆所在地',
|
||||
'final_location' => '最终目的地',
|
||||
'final_location_placeholder' => '请选择最终目的地',
|
||||
'departure_time' => 'FBO发车时间',
|
||||
'departure_time_placeholder' => '请选择发车时间',
|
||||
'arrival_time' => 'FBO到达时间',
|
||||
'arrival_time_placeholder' => '请选择到达时间',
|
||||
'shipping_cycle' => '运输周期',
|
||||
'shipping_cycle_placeholder' => '请输入运输周期',
|
||||
'img_url' => '图片',
|
||||
'img_url_placeholder' => '请输入图片URL'
|
||||
];
|
||||
$translations = array_merge($required_translations, $translations);
|
||||
}
|
||||
|
||||
$data = Vehicle::where('id', $id)->first();
|
||||
if (!$data) {
|
||||
return json(['code' => 1, 'msg' => $translations['data_not_found'] ?? '数据不存在']);
|
||||
@@ -143,7 +275,8 @@ class VehicleController extends Crud
|
||||
{
|
||||
foreach ($items as &$item) {
|
||||
$location = Location::find($item->locations_id);
|
||||
$item->status = $this->status[$item->status]??$this->status[0];
|
||||
// $item->status = $this->status[$item->status]??$this->status[0];
|
||||
$item->status = "已到达迪拜仓库";
|
||||
$item->location_name = $location ? $location->name : '';
|
||||
$final_location = Location::find($item->final_locations_id);
|
||||
$item->final_location_name = $final_location ? $final_location->name : '';
|
||||
|
||||
Reference in New Issue
Block a user