優化: 門市叫貨模組 UI 調整、權限標籤中文化及調撥單動態導覽

This commit is contained in:
2026-02-13 10:39:10 +08:00
parent 882091ce5f
commit 097708aab7
17 changed files with 2359 additions and 6 deletions

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* 門市叫貨申請主表
*/
public function up(): void
{
Schema::create('store_requisitions', function (Blueprint $table) {
$table->id();
$table->string('doc_no')->unique()->comment('單號 SR-YYYYMMDD-XX');
$table->unsignedBigInteger('store_warehouse_id')->comment('申請倉庫(任意類型)');
$table->unsignedBigInteger('supply_warehouse_id')->nullable()->comment('供貨倉庫(審核時填入)');
$table->enum('status', ['draft', 'pending', 'approved', 'rejected', 'completed', 'cancelled'])
->default('draft');
$table->text('remark')->nullable()->comment('申請備註');
$table->text('reject_reason')->nullable()->comment('駁回原因');
$table->unsignedBigInteger('created_by')->comment('申請人');
$table->unsignedBigInteger('approved_by')->nullable()->comment('審核人');
$table->timestamp('submitted_at')->nullable()->comment('提交時間');
$table->timestamp('approved_at')->nullable()->comment('審核時間');
$table->unsignedBigInteger('transfer_order_id')->nullable()->comment('關聯調撥單');
$table->timestamps();
$table->index('status');
$table->index('store_warehouse_id');
$table->index('created_by');
});
}
public function down(): void
{
Schema::dropIfExists('store_requisitions');
}
};

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* 門市叫貨申請明細表
*/
public function up(): void
{
Schema::create('store_requisition_items', function (Blueprint $table) {
$table->id();
$table->foreignId('store_requisition_id')->constrained()->cascadeOnDelete();
$table->unsignedBigInteger('product_id');
$table->decimal('requested_qty', 12, 2)->comment('需求數量');
$table->decimal('approved_qty', 12, 2)->nullable()->comment('核准數量(審核時填入)');
$table->text('remark')->nullable();
$table->timestamps();
$table->index('product_id');
});
}
public function down(): void
{
Schema::dropIfExists('store_requisition_items');
}
};