添加市场

This commit is contained in:
liu
2026-08-20 15:39:39 +08:00
parent cd7007bc49
commit 22237a47e7
20 changed files with 134 additions and 239 deletions
@@ -35,6 +35,7 @@ class ProductController extends BaseController
'name' => 'like',
'category_id' => '=',
'supplier_id' => '=',
'market' => 'like',
'status' => '=',
];
@@ -134,6 +134,7 @@ class PurchaseOrderController extends BaseController
'unit' => $first->unit, // 单位
'supplier_id' => (int) $first->supplier_id, // 供应商id
'supplier' => $supplier, // 供应商
'market' => (string) ($product?->market ?? ''), // 市场(取商品档案)
'cost_price' => $first->cost_price, // 成本价
'quantity' => $quantity,
'weight' => (float) $weight,
@@ -22,6 +22,7 @@ class ProductFormRequest extends BaseFormRequest
return [
'category_id' => ['required','integer', new Exists(ProductCategoryModel::class,'id')],
'supplier_id' => ['nullable','integer', 'exclude_if:supplier_id,0', new Exists(SupplierModel::class,'id')],
'market' => 'nullable|string|max:50',
'name' => 'required|string|max:100',
'spec' => 'nullable|string|max:100',
'unit' => 'nullable|string|max:20',