diff --git a/apps/data/serializers.py b/apps/data/serializers.py index 14181cf..37b8bdd 100644 --- a/apps/data/serializers.py +++ b/apps/data/serializers.py @@ -125,7 +125,6 @@ class SupplierSerializer(BaseSerializer): class SupplierImportExportSerializer(BaseSerializer): number = CharField(label='编号(必填唯一)') name = CharField(label='名称(必填唯一)') - level = CharField(required=False, label='等级[0/1/2/3](默认: 0)') contact = CharField(required=False, label='联系人') phone = CharField(required=False, label='手机号') email = CharField(required=False, label='邮箱') @@ -138,7 +137,7 @@ class SupplierImportExportSerializer(BaseSerializer): class Meta: model = Supplier - fields = ['number', 'name', 'level', 'contact', 'phone', 'email', 'address', 'bank_account', + fields = ['number', 'name', 'contact', 'phone', 'email', 'address', 'bank_account', 'bank_name', 'remark', 'order', 'is_active'] diff --git a/apps/data/views.py b/apps/data/views.py index cdb3d97..5075bb0 100644 --- a/apps/data/views.py +++ b/apps/data/views.py @@ -189,7 +189,7 @@ class ClientViewSet(ModelViewSet, DataProtectMixin, ExportMixin, ImportMixin): client_items = import_serializer.validated_data client_numbers = {item['number'] for item in client_items} - client_set = client.objects.filter(number__in=client_numbers, team=self.team) + client_set = Client.objects.filter(number__in=client_numbers, team=self.team) create_client_set = [] update_client_set = [] diff --git a/apps/goods/views.py b/apps/goods/views.py index 83359a8..5af90b1 100644 --- a/apps/goods/views.py +++ b/apps/goods/views.py @@ -205,7 +205,7 @@ class GoodsViewSet(ModelViewSet, DataProtectMixin, ExportMixin, ImportMixin): for goods_item in goods_items: goods_item['team'] = self.team - category_item = goods_items.pop('category', None) + category_item = goods_item.pop('category', None) if category_item: for category in category_set: if category.name == category_item['name']: @@ -214,7 +214,7 @@ class GoodsViewSet(ModelViewSet, DataProtectMixin, ExportMixin, ImportMixin): else: raise ValidationError(f'分类缺失[{category_item["name"]}]') - unit_item = goods_items.pop('unit', None) + unit_item = goods_item.pop('unit', None) if unit_item: for unit in unit_set: if unit.name == unit_item['name']: