feat: 新增商品 Excel 匯入功能與修復 HTTPS 混合內容問題
1. 新增商品 Excel 匯入功能 (ProductImport, Export Template) 2. 調整商品代號驗證規則為 1-5 碼 (Controller & Import) 3. 修正 HTTPS Mixed Content 問題 (AppServiceProvider)
This commit is contained in:
36
app/Modules/Inventory/Exports/ProductTemplateExport.php
Normal file
36
app/Modules/Inventory/Exports/ProductTemplateExport.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Modules\Inventory\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
|
||||
class ProductTemplateExport implements WithHeadings, WithColumnFormatting
|
||||
{
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'商品代號',
|
||||
'條碼',
|
||||
'商品名稱',
|
||||
'類別名稱',
|
||||
'品牌',
|
||||
'規格',
|
||||
'基本單位',
|
||||
'大單位',
|
||||
'換算率',
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'A' => NumberFormat::FORMAT_TEXT, // 商品代號
|
||||
'B' => NumberFormat::FORMAT_TEXT, // 條碼
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user