forked from erp-dev/erp
feat: shipment patch
This commit is contained in:
@@ -112,7 +112,7 @@ class ShipmentListCreateView(ListModelMixin, GenericAPIView):
|
||||
|
||||
支持过滤参数(可选):
|
||||
- customer: 客户ID
|
||||
- status: 状态(1/2/3)
|
||||
- status: 状态(1=草稿, 2=已发布, 3=已取消, 4=已驳回, 5=已审核)
|
||||
- external_id: 外部订单号(精确匹配)
|
||||
- shipment_date_from: 出货日期起始(YYYY-MM-DD)
|
||||
- shipment_date_to: 出货日期结束(YYYY-MM-DD,包含整天)
|
||||
@@ -217,7 +217,13 @@ class ShipmentDetailView(RetrieveModelMixin, GenericAPIView):
|
||||
merchant = getattr(emp, "merchant", None) if emp else None
|
||||
if not merchant:
|
||||
return Shipment.objects.none()
|
||||
return qs.filter(merchant=merchant)
|
||||
qs = qs.filter(merchant=merchant)
|
||||
|
||||
status_val = self.request.query_params.get("status")
|
||||
if status_val:
|
||||
qs = qs.filter(status=status_val)
|
||||
|
||||
return qs
|
||||
|
||||
def get(self, request, pk: int):
|
||||
return self.retrieve(request, pk=pk)
|
||||
@@ -446,8 +452,9 @@ class SalesItemByPrintingOrderView(APIView):
|
||||
from shipment.services import get_sales_items_by_printing_order
|
||||
|
||||
sales_items = get_sales_items_by_printing_order(
|
||||
printing_order_id=printing_order.id,
|
||||
printing_order_id=printing_order_id,
|
||||
include_already_has_shipment=include_already_has_shipment,
|
||||
merchant=printing_order.merchant,
|
||||
)
|
||||
|
||||
# 序列化返回
|
||||
|
||||
Reference in New Issue
Block a user