From 15d5e5cc0878c746139f7853c04f1c15184007d4 Mon Sep 17 00:00:00 2001 From: Czw996 <459749926@qq.com> Date: Sat, 12 Mar 2022 23:01:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/data/serializers.py | 3 +-- apps/data/views.py | 2 +- apps/goods/views.py | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) 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']: