opl增加workscope
This commit is contained in:
parent
448dccbcac
commit
13f7a31d16
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 3.2.12 on 2022-10-11 07:53
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('opm', '0005_auto_20220912_1838'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='opl',
|
||||||
|
name='work_scope',
|
||||||
|
field=models.CharField(blank=True, max_length=200, null=True, verbose_name='作业范围'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -74,6 +74,7 @@ class Opl(CommonBDModel):
|
||||||
operation = models.ForeignKey(Operation, verbose_name='关联作业',
|
operation = models.ForeignKey(Operation, verbose_name='关联作业',
|
||||||
on_delete=models.CASCADE, related_name='opl_operation')
|
on_delete=models.CASCADE, related_name='opl_operation')
|
||||||
number = models.CharField('作业许可编号', max_length=20, null=True, blank=True)
|
number = models.CharField('作业许可编号', max_length=20, null=True, blank=True)
|
||||||
|
work_scope = models.CharField('作业范围', max_length=200, null=True, blank=True)
|
||||||
level = models.CharField('作业级别', max_length=20,
|
level = models.CharField('作业级别', max_length=20,
|
||||||
help_text='特技/三级/二级/主干道/次干道', null=True, blank=True)
|
help_text='特技/三级/二级/主干道/次干道', null=True, blank=True)
|
||||||
cate = models.ForeignKey(OplCate, verbose_name='作业许可种类',
|
cate = models.ForeignKey(OplCate, verbose_name='作业许可种类',
|
||||||
|
|
|
@ -41,6 +41,7 @@ def bind_opl(ticket: Ticket, transition: Transition, new_ticket_data: dict):
|
||||||
ticket_data.update({
|
ticket_data.update({
|
||||||
'operation': opl.operation.id, # operation id值
|
'operation': opl.operation.id, # operation id值
|
||||||
'level': opl.level,
|
'level': opl.level,
|
||||||
|
'power_days': opl.power_days,
|
||||||
'monitor': opl.monitor.id,
|
'monitor': opl.monitor.id,
|
||||||
'workers': list(OplWorker.objects.filter(opl=opl).values_list('worker__id', flat=True)),
|
'workers': list(OplWorker.objects.filter(opl=opl).values_list('worker__id', flat=True)),
|
||||||
'charger': opl.charger.id,
|
'charger': opl.charger.id,
|
||||||
|
|
Loading…
Reference in New Issue