Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop

This commit is contained in:
shijing 2022-03-02 09:54:02 +08:00
commit 72ec880a45
8 changed files with 20 additions and 8 deletions

View File

@ -94,12 +94,12 @@
</template>
</el-table-column>
<el-table-column label="客户">
<template slot-scope="scope" v-if="scope.row.to_order_.customer_">
<template slot-scope="scope" v-if="scope.row.to_order_">
{{scope.row.to_order_.customer_.name }}
</template>
</el-table-column>
<el-table-column label="合同">
<template slot-scope="scope" v-if="scope.row.to_order_.contract_">
<template slot-scope="scope" v-if="scope.row.to_order_">
{{scope.row.to_order_.contract_.name }}
</template>
</el-table-column>

View File

@ -88,7 +88,7 @@ class FIFO(CommonADModel):
pu_order = models.ForeignKey(PuOrder, verbose_name='关联采购订单',
null=True, blank=True, on_delete=models.CASCADE)
sale = models.ForeignKey(Sale, verbose_name='关联销售记录',
null=True, blank=True, on_delete=models.CASCADE)
null=True, blank=True, on_delete=models.CASCADE, related_name='fifo_sale')
class FIFOItem(BaseModel):

View File

@ -269,7 +269,7 @@ class SubProductionPlanViewSet(CreateUpdateModelAMixin, ListModelMixin, UpdateMo
obj.save()
return Response(TestRecordDetailBaseSerializer(instance=tr).data)
@action(methods=['post'], detail=True, perms_map={'post':'*'}, serializer_class=FirstTestAuditSerializer)
@action(methods=['post'], detail=True, perms_map={'post':'first_audit'}, serializer_class=FirstTestAuditSerializer)
@transaction.atomic
def first_audit(self, request, pk=None):
"""

View File

@ -162,8 +162,11 @@ class SaleProductViewSet(ListModelMixin, DestroyModelMixin, CreateModelMixin, Ge
})
return Response(SaleProductPackDetailSerializer(instance=obj).data)
elif request.method == 'POST':
if obj.sale.is_audited:
raise exceptions.APIException('该销售记录已审核,不可装箱')
if not obj.sale.is_audited:
raise exceptions.APIException('该销售记录未审核,不可装箱')
if obj.sale.fifo_sale.first().is_audited:
raise exceptions.APIException('该销售记录已出库,不可装箱')
serializer = SaleProductPackSerializer(data=request.data)
serializer.is_valid(raise_exception=True)
vdata = serializer.validated_data
@ -185,6 +188,8 @@ class SaleProductViewSet(ListModelMixin, DestroyModelMixin, CreateModelMixin, Ge
obj = self.get_object()
if obj.sale.is_audited:
raise exceptions.APIException('该销售记录已审核,不可填写备注')
if obj.sale.fifo_sale.first().is_audited:
raise exceptions.APIException('该销售记录已出库,不可装箱')
serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True)
vdata = serializer.validated_data

View File

@ -27,7 +27,7 @@ class ProcessYieldView(CreateAPIView):
"""
工序成品率统计
"""
perms_map = {'get':'*'}
perms_map = {'post':'*'}
serializer_class = ProcessYieldSerializer

View File

@ -349,5 +349,10 @@ class WfService(object):
if destination_state.participant_type == State.PARTICIPANT_TYPE_ROBOT:
getattr(HandleScripts, destination_state.participant)(ticket)
if destination_state.type == State.STATE_TYPE_END:
TicketFlow.objects.create(ticket=ticket, state=destination_state,
participant_type=0, intervene_type=0,
participant=None)
return ticket

View File

@ -298,7 +298,7 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
WpmService.add_wproduct_flow_log(i, 'putins')
return Response()
@action(methods=['post'], detail=True, perms_map={'post': 'wp_putin'}, serializer_class=WproductPutInSerializer)
@action(methods=['post'], detail=True, perms_map={'post': 'wp_putins'}, serializer_class=WproductPutInSerializer)
@transaction.atomic
def putin(self, request, pk=None):
"""
@ -752,6 +752,8 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
oms_w = omos.filter(subproduction_progress__is_main=True)
if len(oms_w) == 1:
oms_w = oms_w[0]
if oms_w.count!=1:
raise exceptions.APIException('产出数量应为1')
# 校验单片数量是否正确, 暂时未写
newstep, needTest = WpmService.get_next_step(
oms_w.subproduction_plan, step)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB