feat(sales): replace import page with dialog UI and support template download
This commit is contained in:
37
app/Modules/Sales/Exports/SalesImportTemplateExport.php
Normal file
37
app/Modules/Sales/Exports/SalesImportTemplateExport.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Modules\Sales\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithTitle;
|
||||
use Maatwebsite\Excel\Concerns\WithStyles;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
class SalesImportTemplateExport implements WithHeadings, WithTitle, WithStyles
|
||||
{
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'機台編號',
|
||||
'交易時間',
|
||||
'商品代號',
|
||||
'數量',
|
||||
'單價',
|
||||
'總金額',
|
||||
'貨道', // 新增欄位
|
||||
'狀態', // 原始狀態
|
||||
];
|
||||
}
|
||||
|
||||
public function title(): string
|
||||
{
|
||||
return '銷售單匯入範本';
|
||||
}
|
||||
|
||||
public function styles(Worksheet $sheet)
|
||||
{
|
||||
return [
|
||||
1 => ['font' => ['bold' => true]],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user