import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout'; import { Head, useForm, Link } from '@inertiajs/react'; import { Button } from '@/Components/ui/button'; import { Input } from '@/Components/ui/input'; import { Label } from '@/Components/ui/label'; import { Upload, ArrowLeft, FileSpreadsheet } from 'lucide-react'; import React from 'react'; export default function SalesImportCreate() { const { data, setData, post, processing, errors } = useForm({ file: null as File | null, }); const submit = (e: React.FormEvent) => { e.preventDefault(); post(route('sales-imports.store')); }; return (

新增銷售匯入

setData('file', e.target.files ? e.target.files[0] : null)} className="absolute inset-0 w-full h-full opacity-0 cursor-pointer" />

{data.file ? data.file.name : '點擊或拖曳檔案至此'}

支援 .xlsx, .xls, .csv

{errors.file &&

{errors.file}

}

匯入說明

  • 請使用統一的 Excel 格式(商品銷貨單)。
  • 系統將自動解析機台編號、商品代號與交易時間。
  • 匯入後請至「待確認」清單檢查內容,確認無誤後再執行扣庫。
); }