main_count统一为count
This commit is contained in:
parent
cede23d7e2
commit
a5af3cd71d
|
@ -0,0 +1,38 @@
|
||||||
|
# Generated by Django 3.2.9 on 2021-12-29 06:29
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('pm', '0021_auto_20211229_1408'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='subproductionplan',
|
||||||
|
old_name='main_count',
|
||||||
|
new_name='count',
|
||||||
|
),
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='subproductionplan',
|
||||||
|
old_name='main_count_notok',
|
||||||
|
new_name='count_notok',
|
||||||
|
),
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='subproductionplan',
|
||||||
|
old_name='main_count_ok',
|
||||||
|
new_name='count_ok',
|
||||||
|
),
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='subproductionplan',
|
||||||
|
old_name='main_count_real',
|
||||||
|
new_name='count_real',
|
||||||
|
),
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='subproductionplan',
|
||||||
|
old_name='main_product',
|
||||||
|
new_name='product',
|
||||||
|
),
|
||||||
|
]
|
|
@ -73,11 +73,11 @@ class SubProductionPlan(CommonAModel):
|
||||||
workshop = models.ForeignKey(Organization, verbose_name='生产车间', on_delete=models.CASCADE)
|
workshop = models.ForeignKey(Organization, verbose_name='生产车间', on_delete=models.CASCADE)
|
||||||
process = models.ForeignKey(Process, verbose_name='关联大工序', on_delete=models.CASCADE)
|
process = models.ForeignKey(Process, verbose_name='关联大工序', on_delete=models.CASCADE)
|
||||||
|
|
||||||
main_product = models.ForeignKey(Material, verbose_name='主要产品', on_delete=models.CASCADE, null=True, blank=True)
|
product = models.ForeignKey(Material, verbose_name='主要产品', on_delete=models.CASCADE, null=True, blank=True)
|
||||||
main_count = models.PositiveIntegerField('应产出数', default=0)
|
count = models.PositiveIntegerField('应产出数', default=0)
|
||||||
main_count_real = models.PositiveIntegerField('实际产出数', default=0)
|
count_real = models.PositiveIntegerField('实际产出数', default=0)
|
||||||
main_count_ok = models.PositiveIntegerField('合格数', default=0)
|
count_ok = models.PositiveIntegerField('合格数', default=0)
|
||||||
main_count_notok = models.PositiveIntegerField('不合格数量', default=0)
|
count_notok = models.PositiveIntegerField('不合格数量', default=0)
|
||||||
|
|
||||||
steps = models.JSONField('工艺步骤', default=list)
|
steps = models.JSONField('工艺步骤', default=list)
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,6 @@ from apps.pm.models import ProductionPlan, SubProductionPlan
|
||||||
from apps.mtm.serializers import MaterialSimpleSerializer, ProcessSimpleSerializer
|
from apps.mtm.serializers import MaterialSimpleSerializer, ProcessSimpleSerializer
|
||||||
|
|
||||||
class SubplanGanttSerializer(serializers.ModelSerializer):
|
class SubplanGanttSerializer(serializers.ModelSerializer):
|
||||||
count = serializers.IntegerField(source='main_count')
|
|
||||||
count_real = serializers.IntegerField(source='main_count_real')
|
|
||||||
count_ok = serializers.IntegerField(source='main_count_ok')
|
|
||||||
process_ = ProcessSimpleSerializer(source='process', read_only=True)
|
process_ = ProcessSimpleSerializer(source='process', read_only=True)
|
||||||
product_ = MaterialSimpleSerializer(source='main_product', read_only=True)
|
product_ = MaterialSimpleSerializer(source='main_product', read_only=True)
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
Loading…
Reference in New Issue