车间操作bug

This commit is contained in:
caoqianming 2021-11-23 14:37:11 +08:00
parent f311327c88
commit fd2141598e
1 changed files with 10 additions and 6 deletions

View File

@ -367,9 +367,10 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
i_wmat.count = i_wmat.count- i.count
i_wmat.save()
# 更新子计划物料消耗情况
sp = i_wmat.subproduction_plan
sp.count_real = sp.count_real + i.count
sp.save()
spp = SubProductionProgress.objects.get(subproduction_plan=i_wmat.subproduction_plan,
material=i_wmat.material)
spp.count_real = spp.count_real + i.count
spp.save()
# 更新产出
for i in OperationMaterial.objects.filter(operation=op, type=SubprodctionMaterial.SUB_MA_TYPE_OUT):
if not i.subproduction_progress.is_main:
@ -378,9 +379,9 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
ins.count = ins.count + i.count
ins.save()
# 更新子计划物料产出情况
sp = i.subproduction_progress
sp.count_real = sp.count_real + i.count
sp.save()
spp = i.subproduction_progress
spp.count_real = spp.count_real + i.count
spp.save()
# 更新动态产品表
if step.type == Step.STEP_TYPE_NOM:
for i in OperationWproduct.objects.filter(operation=op):
@ -435,6 +436,9 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
instance.save()
wproduct.save()
ows.update(is_hidden=True, child=wproduct)
op.is_submited = True
op.save()
return Response()