diff --git a/hb_server/apps/qm/models.py b/hb_server/apps/qm/models.py index a0368f8..ed7e582 100644 --- a/hb_server/apps/qm/models.py +++ b/hb_server/apps/qm/models.py @@ -78,7 +78,7 @@ class TestRecordItem(BaseModel): """ 记录表格字段值 """ - form_field = models.ForeignKey(RecordFormField, verbose_name='关联字段', on_delete=models.CASCADE, db_constraint=False) + form_field = models.ForeignKey(RecordFormField, verbose_name='关联自定义表格字段', on_delete=models.CASCADE, db_constraint=False) field_name = models.CharField('字段名', max_length=50) field_key = models.CharField('字段标识', max_length=50) field_type = models.CharField('字段类型', choices=RecordForm.type_choices, max_length=50) diff --git a/hb_server/apps/wf/models.py b/hb_server/apps/wf/models.py index 127b18d..5d6625d 100644 --- a/hb_server/apps/wf/models.py +++ b/hb_server/apps/wf/models.py @@ -213,18 +213,6 @@ class Ticket(CommonBModel): multi_all_person = models.JSONField('全部处理的结果', default=dict, blank=True, help_text='需要当前状态处理人全部处理时实际的处理结果,json格式') -# class TicketCustomField(BaseModel): -# """ -# 工单数据,自定义字段值 -# """ -# ticket = models.ForeignKey(Ticket, verbose_name='关联工单', on_delete=models.CASCADE) -# form_field = models.ForeignKey(CustomField, verbose_name='关联字段', on_delete=models.SET_NULL, db_constraint=False, null=True, blank=True) -# field_name = models.CharField('字段名', max_length=50) -# field_key = models.CharField('字段标识', max_length=50) -# field_type = models.CharField('字段类型', choices=CustomField.field_type_choices, max_length=50) -# field_value = models.JSONField('录入值', default=dict, blank=True) -# sort = models.IntegerField('排序号', default=1) - class TicketFlow(BaseModel): """ 工单流转日志 diff --git a/hb_server/apps/wpm/views.py b/hb_server/apps/wpm/views.py index 4fe80e2..3a674e7 100644 --- a/hb_server/apps/wpm/views.py +++ b/hb_server/apps/wpm/views.py @@ -16,6 +16,7 @@ from apps.qm.serializers import TestRecordDetailSerializer from apps.system.mixins import CreateUpdateModelAMixin, OptimizationMixin from rest_framework.decorators import action +from apps.wf.models import Workflow from apps.wpm.filters import WMaterialFilterSet from apps.wpm.models import OperationEquip, OperationWproduct, Pick, PickWproduct, WMaterial, WProduct, Operation, OperationMaterial, OperationRecord, OperationRecordItem @@ -199,6 +200,7 @@ class WProductViewSet(ListModelMixin, GenericViewSet): data = RecordFormDetailSerializer(instance=form).data data['origin_test'] = None + data['form'] = form.id # 如果是复检, 需要带入原数据 if wproduct.act_state == WProduct.WPR_ACT_STATE_TORETEST: # 查找最近一条检验记录 @@ -366,11 +368,12 @@ class WProductViewSet(ListModelMixin, GenericViewSet): wproduct.save() return Response() - + @action(methods=['get'], detail=False, perms_map={'post':'*'}) def workflows(self, request, pk=None): """ 可发起的工作流 """ + wfs = Workflow.objects.get() class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, UpdateModelMixin, DestroyModelMixin, GenericViewSet): """ 生产操作记录