feat: 员工自助注册+审核流程

- 新增 registration_packages 表:管理员配置注册套餐(名称/角色)
- AuthController 新增 register() 和 registrationPackages() 公开接口
- UserController 新增 approve() / reject() 审核接口
- StoreController 新增 publicList() 公开门店列表
- 前端 /register 注册页:选门店→选岗位套餐→填信息→提交
- 前端 system/registration-packages:套餐 CRUD
- 用户管理页:待审核状态展示 + 通过/拒绝快捷操作
- 登录页底部加「申请注册」跳转链接
- 路由白名单加 /register
This commit is contained in:
li
2026-03-14 17:39:50 +08:00
parent 4a68855a88
commit ee2b1757d0
105 changed files with 7859 additions and 2469 deletions
@@ -0,0 +1,25 @@
<?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('approval_nodes', function (Blueprint $table) {
$table->string('node_label', 100)->nullable()->after('node_order')->comment('节点名称');
$table->string('role', 50)->nullable()->after('node_label')->comment('节点角色标识');
// approver_id 改为可空(无模板时无法预指定审批人)
$table->unsignedBigInteger('approver_id')->nullable()->change();
});
}
public function down(): void
{
Schema::table('approval_nodes', function (Blueprint $table) {
$table->dropColumn(['node_label', 'role']);
});
}
};
@@ -0,0 +1,47 @@
<?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('transfer_orders', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('store_id')->index();
$table->string('transfer_no', 50)->unique();
$table->unsignedBigInteger('from_warehouse_id');
$table->unsignedBigInteger('to_warehouse_id');
$table->json('items')->nullable();
$table->tinyInteger('status')->default(0)->comment('0待确认1已确认2已取消');
$table->unsignedBigInteger('operator_id')->nullable();
$table->string('remark', 500)->nullable();
$table->timestamps();
$table->foreign('from_warehouse_id')->references('id')->on('warehouses');
$table->foreign('to_warehouse_id')->references('id')->on('warehouses');
});
Schema::create('inventory_checks', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('store_id')->index();
$table->string('check_no', 50)->unique();
$table->unsignedBigInteger('warehouse_id');
$table->json('items')->nullable()->comment('[{material_id,book_qty,actual_qty,diff_qty,remark}]');
$table->tinyInteger('status')->default(0)->comment('0草稿1盘点中2已完成');
$table->string('finish_remark', 500)->nullable();
$table->unsignedBigInteger('operator_id')->nullable();
$table->timestamps();
$table->foreign('warehouse_id')->references('id')->on('warehouses');
});
}
public function down(): void
{
Schema::dropIfExists('inventory_checks');
Schema::dropIfExists('transfer_orders');
}
};
@@ -0,0 +1,29 @@
<?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('registration_packages', function (Blueprint $table) {
$table->id();
$table->foreignId('store_id')->constrained()->comment('所属门店');
$table->string('name', 50)->comment('套餐名称,如:销售、店长');
$table->string('description', 255)->nullable()->comment('套餐说明');
$table->json('role_ids')->nullable()->comment('关联角色ID数组');
$table->tinyInteger('status')->default(1)->comment('1启用 0停用');
$table->unsignedSmallInteger('sort')->default(0)->comment('排序');
$table->timestamps();
$table->index('store_id');
});
}
public function down(): void
{
Schema::dropIfExists('registration_packages');
}
};