Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop
This commit is contained in:
commit
18cc087da6
|
@ -212,6 +212,14 @@ class Ticket(CommonBModel):
|
||||||
act_state = models.IntegerField('进行状态', default=1, help_text='当前工单的进行状态', choices=act_state_choices)
|
act_state = models.IntegerField('进行状态', default=1, help_text='当前工单的进行状态', choices=act_state_choices)
|
||||||
multi_all_person = models.JSONField('全部处理的结果', default=dict, blank=True, help_text='需要当前状态处理人全部处理时实际的处理结果,json格式')
|
multi_all_person = models.JSONField('全部处理的结果', default=dict, blank=True, help_text='需要当前状态处理人全部处理时实际的处理结果,json格式')
|
||||||
|
|
||||||
|
# class TicketCustomField(BaseModel):
|
||||||
|
# """
|
||||||
|
# 工单自定义表单数据
|
||||||
|
# """
|
||||||
|
# form_field = models.ForeignKey(CustomField, verbose_name='关联自定义表单字段', on_delete=models.CASCADE)
|
||||||
|
# field_value = models.JSONField('录入值', null=True, blank=True)
|
||||||
|
# field_display_value = models.CharField('展示值', max_length=1000, null=True, blank=True, help_text='可用于只读时展示')
|
||||||
|
# ticket = models.ForeignKey(Ticket, verbose_name='关联的工单', on_delete=models.CASCADE, related_name='ticket_data')
|
||||||
|
|
||||||
class TicketFlow(BaseModel):
|
class TicketFlow(BaseModel):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -13,3 +13,17 @@ class GetParticipants:
|
||||||
"""工单创建人"""
|
"""工单创建人"""
|
||||||
participant = ticket.create_by.id
|
participant = ticket.create_by.id
|
||||||
return participant
|
return participant
|
||||||
|
|
||||||
|
class HandleScripts:
|
||||||
|
all_funcs = [
|
||||||
|
{'func': 'handle_wproduct', 'name':'处理不合格品'}
|
||||||
|
]
|
||||||
|
@classmethod
|
||||||
|
def handle_wproduct(cls, ticket:dict={}):
|
||||||
|
"""处理不合格品"""
|
||||||
|
ticket_data = ticket.ticket_data
|
||||||
|
wp = ticket.wt_ticket
|
||||||
|
wp = ticket_data
|
||||||
|
if 'shenli2' in ticket_data and ticket_data['shenli2']:
|
||||||
|
if ticket_data['shenli2'] in ['返工', '返修']:
|
||||||
|
pass
|
|
@ -84,6 +84,7 @@ class WprouctTicket(CommonAModel):
|
||||||
step = models.ForeignKey(Step, verbose_name='所在步骤', on_delete=models.CASCADE)
|
step = models.ForeignKey(Step, verbose_name='所在步骤', on_delete=models.CASCADE)
|
||||||
subproduction_plan = models.ForeignKey(SubProductionPlan, verbose_name='所在子生产计划', on_delete=models.CASCADE)
|
subproduction_plan = models.ForeignKey(SubProductionPlan, verbose_name='所在子生产计划', on_delete=models.CASCADE)
|
||||||
ticket = models.ForeignKey('wf.ticket', verbose_name='关联工单', on_delete=models.CASCADE, related_name='wt_ticket')
|
ticket = models.ForeignKey('wf.ticket', verbose_name='关联工单', on_delete=models.CASCADE, related_name='wt_ticket')
|
||||||
|
decision = models.CharField('最终决定', null=True, blank=True, max_length=100)
|
||||||
|
|
||||||
class Pick(CommonADModel):
|
class Pick(CommonADModel):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -338,7 +338,7 @@ class WProductViewSet(ListModelMixin, GenericViewSet):
|
||||||
报废操作
|
报废操作
|
||||||
"""
|
"""
|
||||||
obj = self.get_object()
|
obj = self.get_object()
|
||||||
if obj.ow_wproduct.ow_operation.count() >4 or obj.act_state != WProduct.WPR_ACT_STATE_NOTOK:
|
if Operation.objects.filter(ow_operation__wproduct=obj, is_submited=True).count() >4 or obj.act_state != WProduct.WPR_ACT_STATE_NOTOK:
|
||||||
raise exceptions.APIException('该产品不支持直接报废')
|
raise exceptions.APIException('该产品不支持直接报废')
|
||||||
obj.act_state = WProduct.WPR_ACT_STATE_SCRAP
|
obj.act_state = WProduct.WPR_ACT_STATE_SCRAP
|
||||||
obj.update_by = request.user
|
obj.update_by = request.user
|
||||||
|
|
|
@ -65,7 +65,7 @@ class UpdateDevelop(APIView):
|
||||||
ret = os.popen('git pull https://caoqianming%40foxmail.com:9093qqww@e.coding.net/ctcdevteam/hberp/hberp.git develop')
|
ret = os.popen('git pull https://caoqianming%40foxmail.com:9093qqww@e.coding.net/ctcdevteam/hberp/hberp.git develop')
|
||||||
# 奇怪的处理
|
# 奇怪的处理
|
||||||
os.chdir('/home/hberp/hb_server/vuedist')
|
os.chdir('/home/hberp/hb_server/vuedist')
|
||||||
os.popen('cp index.html indexbak & rm -rf index.html & rename indexbak index.html')
|
os.popen('cp index.html indexbak & rm -rf index.html & mv indexbak index.html')
|
||||||
# 打包前端
|
# 打包前端
|
||||||
# os.chdir('/home/hberp/hb_client')
|
# os.chdir('/home/hberp/hb_client')
|
||||||
# os.system('npm run build:prod')
|
# os.system('npm run build:prod')
|
||||||
|
|
Loading…
Reference in New Issue