From 7937a632a0bb8cb9b558b2bd7240b3c8d56ddc0a Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 17 Dec 2024 17:20:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20process=E5=A2=9E=E5=8A=A0mtype?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/mtm/migrations/0046_process_mtype.py | 18 ++++++++++++++++++ apps/mtm/models.py | 9 +++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 apps/mtm/migrations/0046_process_mtype.py diff --git a/apps/mtm/migrations/0046_process_mtype.py b/apps/mtm/migrations/0046_process_mtype.py new file mode 100644 index 00000000..ebbdfca3 --- /dev/null +++ b/apps/mtm/migrations/0046_process_mtype.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.12 on 2024-12-17 06:14 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('mtm', '0045_process_type'), + ] + + operations = [ + migrations.AddField( + model_name='process', + name='mtype', + field=models.PositiveSmallIntegerField(choices=[(10, '常规'), (20, '切分'), (30, '合并')], default=10, verbose_name='工序生产类型'), + ), + ] diff --git a/apps/mtm/models.py b/apps/mtm/models.py index 83624892..a8c510c7 100644 --- a/apps/mtm/models.py +++ b/apps/mtm/models.py @@ -1,7 +1,6 @@ from django.db import models from apps.system.models import CommonAModel, Dictionary, CommonBModel, CommonADModel, File, BaseModel -from django.db.models import Subquery, OuterRef -from rest_framework.exceptions import ValidationError, ParseError +from rest_framework.exceptions import ParseError from apps.utils.models import CommonBDModel class Process(CommonBModel): @@ -10,8 +9,14 @@ class Process(CommonBModel): """ PRO_PROD = 10 RPO_TEST = 20 + + + PRO_NORMAL = 10 + PRO_DIV = 20 + PRO_MERGE = 30 name = models.CharField('工序名称', max_length=100) type = models.PositiveSmallIntegerField("工序类型", default=PRO_PROD, choices=((PRO_PROD, '生产工序'), (RPO_TEST, '检验工序'))) + mtype = models.PositiveSmallIntegerField("工序生产类型", default=PRO_NORMAL, choices=((PRO_NORMAL, '常规'), (PRO_DIV, '切分'), (PRO_MERGE, '合并'))) cate = models.CharField('大类', max_length=10, default='') sort = models.PositiveSmallIntegerField('排序', default=1) instruction = models.ForeignKey(