Skip to content

Commit

Permalink
[#17] 采购模块 (#278)
Browse files Browse the repository at this point in the history
* [#17] 采购模块
修改一个字段、给前端展示相应字段的中文

* 为供应商文件和供应商报价单提供了filter
  • Loading branch information
eyeeco authored and Time1ess committed Jan 17, 2018
1 parent 77e6744 commit 1c8860d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Procurement/api/supplier.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ class SupplierDocumentViewSet(viewsets.ModelViewSet):
pagination_class = SmallResultsSetPagination
queryset = SupplierDocument.objects.all().order_by('-pk')
serializer_class = serializers.SupplierDocumentSerializer
filter_class = filters.SupplyDocumentFilter


# 供应商报价单
class QuotationViewSet(viewsets.ModelViewSet):
pagination_class = SmallResultsSetPagination
queryset = Quotation.objects.all().order_by('-pk')
serializer_class = serializers.QuotationSerializer
filter_class = filters.SupplyQuotationFilter


# 供应商标单关系
Expand Down
6 changes: 4 additions & 2 deletions Procurement/filters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

from .bidding import (BiddingSheetFilter, BiddingApplicationFilter)

from .supplier import (SupplyRelationshipFilter, )
from .supplier import (SupplyRelationshipFilter, SupplyDocumentFilter,
SupplyQuotationFilter)

from .status_change import (StatusChangeFilter, )

Expand All @@ -13,4 +14,5 @@
__all__ = ['PurchaseOrderFilter', 'BiddingSheetFilter',
'BiddingApplicationFilter', 'SupplyRelationshipFilter',
'StatusChangeFilter', 'ProcurementMaterialFilter',
'MaterialSubApplyFilter', 'MaterialExcutionFilter']
'MaterialSubApplyFilter', 'MaterialExcutionFilter',
'SupplyDocumentFilter', 'SupplyQuotationFilter']
14 changes: 14 additions & 0 deletions Procurement/filters/supplier.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,17 @@ class SupplyRelationshipFilter(filters.FilterSet):
class Meta:
model = models.SupplyRelationship
fields = ('status', 'bidding_sheet', 'supplier', 'supplier_code')


class SupplyDocumentFilter(filters.FilterSet):

class Meta:
model = models.SupplierDocument
fields = ('supplier',)


class SupplyQuotationFilter(filters.FilterSet):

class Meta:
model = models.Quotation
fields = ('supplier',)

0 comments on commit 1c8860d

Please sign in to comment.