条件流转bug
This commit is contained in:
parent
c3cb7e36dc
commit
b7a701efe6
|
|
@ -5,6 +5,7 @@ from django.db.models.base import Model
|
|||
import django.utils.timezone as timezone
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
|
||||
from utils.model import SoftModel, BaseModel
|
||||
from apps.mtm.models import Material
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class WfService(object):
|
|||
expression = i['expression'].format(**ticket_all_value)
|
||||
import datetime, time # 用于支持条件表达式中对时间的操作
|
||||
if eval(expression):
|
||||
destination_state = State.objects.get(i['expression'].get('target_state'))
|
||||
destination_state = State.objects.get(pk=i['target_state'])
|
||||
return destination_state
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
|
|
@ -277,6 +277,13 @@ class TicketViewSet(OptimizationMixin, CreateUpdateCustomMixin, CreateModelMixin
|
|||
else:
|
||||
raise APIException('无需接单')
|
||||
|
||||
@action(methods=['post'], detail=True, perms_map={'post':'*'})
|
||||
def retreat(self, request, pk=None):
|
||||
"""
|
||||
撤回工单,允许创建人在指定状态撤回工单至初始状态,状态设置中开启允许撤回
|
||||
"""
|
||||
pass
|
||||
|
||||
class TicketFlowViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||
"""
|
||||
工单日志
|
||||
|
|
|
|||
Loading…
Reference in New Issue