feat: mioitem添加js,qx字段
This commit is contained in:
parent
a737343d3a
commit
0e0262d170
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 3.2.12 on 2024-03-22 06:51
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inm', '0013_mio_materials'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='mioitem',
|
||||
name='count_n_js',
|
||||
field=models.PositiveIntegerField(default=0, verbose_name='结石'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='mioitem',
|
||||
name='count_n_qx',
|
||||
field=models.PositiveIntegerField(default=0, verbose_name='气线'),
|
||||
),
|
||||
]
|
|
@ -124,6 +124,8 @@ class MIOItem(BaseModel):
|
|||
count_n_dl = models.PositiveIntegerField('断裂', default=0)
|
||||
count_n_pb = models.PositiveIntegerField('偏壁', default=0)
|
||||
count_n_dxt = models.PositiveIntegerField('大小头', default=0)
|
||||
count_n_js = models.PositiveIntegerField('结石', default=0)
|
||||
count_n_qx = models.PositiveIntegerField('气线', default=0)
|
||||
count_n_jsqx = models.PositiveIntegerField('结石气线', default=0)
|
||||
count_n_qt = models.PositiveIntegerField('其他', default=0)
|
||||
|
||||
|
|
|
@ -139,6 +139,7 @@ class MIOItemSerializer(CustomModelSerializer):
|
|||
material_name = serializers.StringRelatedField(
|
||||
source='material', read_only=True)
|
||||
inout_date = serializers.DateField(source='mio.inout_date', read_only=True)
|
||||
test_user_name = serializers.CharField(source='test_user.name', read_only=True)
|
||||
|
||||
class Meta:
|
||||
model = MIOItem
|
||||
|
@ -243,7 +244,7 @@ class MIOItemTestSerializer(CustomModelSerializer):
|
|||
class Meta:
|
||||
model = MIOItem
|
||||
fields = ['id', 'test_date', 'test_user', 'count_notok', 'count_n_zw', 'count_n_tw',
|
||||
'count_n_qp', 'count_n_wq', 'count_n_dl', 'count_n_pb', 'count_n_dxt', 'count_n_jsqx', 'count_n_qt']
|
||||
'count_n_qp', 'count_n_wq', 'count_n_dl', 'count_n_pb', 'count_n_dxt', 'count_n_js', 'count_n_qx', 'count_n_qt']
|
||||
extra_kwargs = {
|
||||
'test_date': {'required': True},
|
||||
'test_user': {'required': True}
|
||||
|
|
|
@ -217,7 +217,7 @@ class MIOItemViewSet(ListModelMixin, BulkCreateModelMixin, BulkDestroyModelMixin
|
|||
queryset = MIOItem.objects.all()
|
||||
serializer_class = MIOItemSerializer
|
||||
create_serializer_class = MIOItemCreateSerializer
|
||||
select_related_fields = ['warehouse', 'mio', 'material']
|
||||
select_related_fields = ['warehouse', 'mio', 'material', 'test_user']
|
||||
filterset_fields = {
|
||||
"warehouse": ["exact"],
|
||||
"mio": ["exact"],
|
||||
|
|
Loading…
Reference in New Issue