feat: 棒管检验明细
This commit is contained in:
parent
297adfa3cd
commit
5f9c810502
|
@ -0,0 +1,33 @@
|
|||
# Generated by Django 3.2.12 on 2023-11-03 10:14
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inm', '0008_auto_20231103_1359'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='mioitem',
|
||||
name='is_bgtest_ok',
|
||||
field=models.BooleanField(default=True, verbose_name='配套件是否合格'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='mioitema',
|
||||
name='b_zuidawaijing',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='最大外径'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='mioitema',
|
||||
name='g_zuidaneijing',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='最大内径'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='mioitema',
|
||||
name='zhuidu',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='锥度'),
|
||||
),
|
||||
]
|
|
@ -119,6 +119,8 @@ class MIOItem(BaseModel):
|
|||
count_n_jsqx = models.PositiveIntegerField('结石气线', default=0)
|
||||
count_n_qt = models.PositiveIntegerField('其他', default=0)
|
||||
|
||||
is_bgtest_ok = models.BooleanField('配套件是否合格', default=True)
|
||||
|
||||
|
||||
class MIOItemA(BaseModel):
|
||||
"""
|
||||
|
@ -130,3 +132,7 @@ class MIOItemA(BaseModel):
|
|||
rate = models.PositiveIntegerField('比例', default=1)
|
||||
mioitem = models.ForeignKey(
|
||||
MIOItem, verbose_name='关联出入库明细', on_delete=models.CASCADE, related_name='a_mioitem')
|
||||
|
||||
zhuidu = models.FloatField('锥度', null=True, blank=True)
|
||||
b_zuidawaijing = models.FloatField('最大外径', null=True, blank=True)
|
||||
g_zuidaneijing = models.FloatField('最大内径', null=True, blank=True)
|
||||
|
|
|
@ -81,7 +81,8 @@ class MIOListSerializer(CustomModelSerializer):
|
|||
class MIOItemACreateSerializer(CustomModelSerializer):
|
||||
class Meta:
|
||||
model = MIOItem
|
||||
fields = ['material', 'batch']
|
||||
fields = ['material', 'batch', 'zhuidu',
|
||||
'b_zuidawaijing', 'g_zuidaneijing']
|
||||
|
||||
|
||||
class MIOItemCreateSerializer(CustomModelSerializer):
|
||||
|
@ -90,7 +91,8 @@ class MIOItemCreateSerializer(CustomModelSerializer):
|
|||
|
||||
class Meta:
|
||||
model = MIOItem
|
||||
fields = ['mio', 'warehouse', 'material', 'batch', 'count', 'assemb']
|
||||
fields = ['mio', 'warehouse', 'material',
|
||||
'batch', 'count', 'assemb', 'is_bgtest_ok']
|
||||
|
||||
def create(self, validated_data):
|
||||
mio = validated_data['mio']
|
||||
|
@ -109,7 +111,7 @@ class MIOItemCreateSerializer(CustomModelSerializer):
|
|||
if k in assemb_dict:
|
||||
mia = assemb_dict[k]
|
||||
MIOItemA.objects.create(
|
||||
mioitem=instance, material=mia['material'], batch=mia['batch'], rate=v)
|
||||
mioitem=instance, rate=v, **mia)
|
||||
else:
|
||||
raise ParseError('缺少组合件')
|
||||
return instance
|
||||
|
|
Loading…
Reference in New Issue