increments('id')->comment('采购单ID'); $table->string('purchase_no', 32)->unique()->comment('采购单编号'); $table->date('purchase_date')->comment('采购日期'); $table->integer('status')->default(0)->comment('采购单状态(0待发送 1部分发送 2全部发送 3已完成)'); $table->decimal('total_quantity', 10, 2)->default(0)->comment('采购总量'); $table->decimal('total_weight', 10, 3)->default(0)->comment('采购总重量'); $table->decimal('estimate_amount', 10, 2)->default(0)->comment('预估金额(按订货汇总)'); $table->decimal('actual_amount', 10, 2)->default(0)->comment('实际采购金额'); $table->integer('operator_id')->default(0)->comment('采购员(系统用户ID)'); $table->string('remark', 255)->default('')->nullable()->comment('备注'); $table->timestamps(); $table->index(['purchase_date', 'status'], 'purchase_order_date_status_index'); $table->comment('采购单表'); }); } } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('purchase_order'); } };