流程卡2

This commit is contained in:
caoqianming 2022-01-11 16:34:04 +08:00
parent 63ddab4942
commit 902dc5bd96
1 changed files with 14 additions and 6 deletions

View File

@ -463,12 +463,20 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
card_data = WProductCardSerializer(instance=obj).data
ret = []
if card_data['parents']:
pass
else:
ret.append(['序号', '工序', card_data['number']])
step_list_full = card_data['step_list_full']
for index, item in enumerate(step_list_full):
ret.append([str(index+1), item['step_name'], item['actions']])
line1 = ['序号', '工序']
for i in card_data['parents']:
line1.append(i['number'])
ret.append(line1)
steps_list_full_1 = card_data['parents'][0]['step_list_full']
for index, item in enumerate(steps_list_full_1):
linex = [str(index+1), item['step_name']]
for i in card_data['parents']:
linex.append(i['step_list_full'][index]['actions'])
ret.append(linex)
ret.append(['序号', '工序', card_data['number']])
step_list_full = card_data['step_list_full']
for index, item in enumerate(step_list_full):
ret.append([str(index+1), item['step_name'], item['actions']])
return Response(ret)
class WproductTicketViewSet(ListModelMixin, GenericViewSet):