[FEAT] 新增生產工單實際產量欄位與 UI 規範
- 新增 database/migrations/tenant 實際產量與耗損原因 - ProductionOrder API 狀態推進與實際產量計算 - 完工入庫新增實際產出數量原生數字輸入框 (step=1) - Create.tsx 補上前端資料驗證與狀態保護 - 建立並更新 UI 數字輸入框設計規範
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?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::table('production_orders', function (Blueprint $table) {
|
||||
$table->decimal('actual_output_quantity', 10, 2)
|
||||
->nullable()
|
||||
->after('output_quantity')
|
||||
->comment('實際產出數量(預設等於 output_quantity,可於完工時調降)');
|
||||
|
||||
$table->string('loss_reason', 255)
|
||||
->nullable()
|
||||
->after('actual_output_quantity')
|
||||
->comment('耗損原因說明');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('production_orders', function (Blueprint $table) {
|
||||
$table->dropColumn(['actual_output_quantity', 'loss_reason']);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user