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