2021-11-04 23:49:56 +08:00
|
|
|
from django_filters.rest_framework import FilterSet
|
|
|
|
from django_filters.filters import *
|
2021-11-12 22:07:49 +08:00
|
|
|
from apps.sales.models import *
|
2021-11-04 23:49:56 +08:00
|
|
|
|
|
|
|
|
2021-11-12 22:07:49 +08:00
|
|
|
class SalesOrderFilter(FilterSet):
|
|
|
|
start_date = DateFilter(field_name='create_time', lookup_expr='gte', label='开始日期')
|
|
|
|
end_date = DateFilter(field_name='create_time', lookup_expr='lt', label='结束日期')
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = SalesOrder
|
|
|
|
fields = ['number', 'warehouse', 'client', 'handler', 'is_void', 'creator',
|
|
|
|
'start_date', 'end_date']
|
2021-11-04 23:49:56 +08:00
|
|
|
|
2021-11-12 22:07:49 +08:00
|
|
|
|
2021-11-14 18:10:56 +08:00
|
|
|
class SalesReturnOrderFilter(FilterSet):
|
|
|
|
start_date = DateFilter(field_name='create_time', lookup_expr='gte', label='开始日期')
|
|
|
|
end_date = DateFilter(field_name='create_time', lookup_expr='lt', label='结束日期')
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = SalesReturnOrder
|
|
|
|
fields = ['number', 'sales_order', 'warehouse', 'supplier', 'handler',
|
|
|
|
'is_void', 'creator', 'start_date', 'end_date']
|
|
|
|
|
|
|
|
|
2021-11-12 22:07:49 +08:00
|
|
|
__all__ = [
|
2021-11-14 18:10:56 +08:00
|
|
|
'SalesOrderFilter', 'SalesReturnOrderFilter',
|
2021-11-04 23:49:56 +08:00
|
|
|
]
|