feat: process添加工序类型
This commit is contained in:
parent
765bcc39de
commit
1a296e8e30
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.2.12 on 2024-12-12 07:16
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('mtm', '0044_mgroup_code'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='process',
|
||||
name='type',
|
||||
field=models.PositiveSmallIntegerField(choices=[(10, '生产工序'), (20, '检验工序')], default=10, verbose_name='工序类型'),
|
||||
),
|
||||
]
|
|
@ -8,8 +8,10 @@ class Process(CommonBModel):
|
|||
"""
|
||||
工序
|
||||
"""
|
||||
|
||||
PRO_PROD = 10
|
||||
RPO_TEST = 20
|
||||
name = models.CharField('工序名称', max_length=100)
|
||||
type = models.PositiveSmallIntegerField("工序类型", default=PRO_PROD, choices=((PRO_PROD, '生产工序'), (RPO_TEST, '检验工序')))
|
||||
cate = models.CharField('大类', max_length=10, default='')
|
||||
sort = models.PositiveSmallIntegerField('排序', default=1)
|
||||
instruction = models.ForeignKey(
|
||||
|
|
|
@ -59,6 +59,7 @@ class MgroupSerializer(CustomModelSerializer):
|
|||
belong_dept_name = serializers.CharField(
|
||||
source='belong_dept.name', read_only=True)
|
||||
process_name = serializers.CharField(source='process.name', read_only=True)
|
||||
process_type = serializers.CharField(source='process.type', read_only=True)
|
||||
process_cate = serializers.CharField(source='process.cate', read_only=True)
|
||||
|
||||
class Meta:
|
||||
|
|
Loading…
Reference in New Issue