feat: [商品管理] 優化商品匯入邏輯,支援 13 碼條碼自動生成、Upsert 更新機制與 Excel 說明工作表
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Has been skipped
Koori-ERP-Deploy-System / deploy-production (push) Successful in 1m7s

This commit is contained in:
2026-02-06 09:26:50 +08:00
parent e1aa452b3c
commit 906b094c18
7 changed files with 187 additions and 44 deletions

View File

@@ -62,8 +62,11 @@ export default function ProductForm({
};
const generateRandomBarcode = () => {
const randomDigits = Math.floor(Math.random() * 9000000000) + 1000000000;
setData("barcode", randomDigits.toString());
let result = "";
for (let i = 0; i < 13; i++) {
result += Math.floor(Math.random() * 10).toString();
}
setData("barcode", result);
};
const generateRandomCode = () => {
@@ -150,7 +153,7 @@ export default function ProductForm({
<div className="space-y-2">
<Label htmlFor="barcode">
<span className="text-red-500">*</span>
<span className="text-gray-400 font-normal">()</span>
</Label>
<div className="flex gap-2">
<Input