子生产计划按大工序排序

This commit is contained in:
caoqianming 2021-10-15 09:09:55 +08:00
parent d4ecdfb192
commit 0b58bf7b2a
2 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@ class SubProductionPlan(CommonAModel):
end_date = models.DateField('计划完工日期') end_date = models.DateField('计划完工日期')
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)
steps = models.JSONField('工艺步骤', default=list)
class Meta: class Meta:
verbose_name = '子生产计划' verbose_name = '子生产计划'
verbose_name_plural = verbose_name verbose_name_plural = verbose_name

View File

@ -84,8 +84,8 @@ class SubProductionPlanViewSet(CreateUpdateModelAMixin, ListModelMixin, UpdateMo
queryset = SubProductionPlan.objects.select_related('process', 'workshop') queryset = SubProductionPlan.objects.select_related('process', 'workshop')
search_fields = [] search_fields = []
filterset_fields = ['production_plan'] filterset_fields = ['production_plan']
ordering_fields = ['id'] ordering_fields = ['process__number']
ordering = ['-id'] ordering = ['process__number']
def get_serializer_class(self): def get_serializer_class(self):
if self.action == 'list': if self.action == 'list':