# Generated by Django 3.2.12 on 2023-09-21 08:26

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    dependencies = [
        ('system', '0002_myschedule'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('mtm', '0009_process'),
    ]

    operations = [
        migrations.AddField(
            model_name='material',
            name='count',
            field=models.PositiveIntegerField(default=0, verbose_name='物料库存总数'),
        ),
        migrations.AddField(
            model_name='material',
            name='count_safe',
            field=models.PositiveIntegerField(blank=True, null=True, verbose_name='安全库存总数'),
        ),
        migrations.AddField(
            model_name='material',
            name='number',
            field=models.CharField(blank=True, max_length=100, null=True, verbose_name='编号'),
        ),
        migrations.AddField(
            model_name='material',
            name='specification',
            field=models.CharField(blank=True, max_length=100, null=True, verbose_name='型号'),
        ),
        migrations.AddField(
            model_name='material',
            name='unit',
            field=models.CharField(default='个', max_length=10, verbose_name='基准计量单位'),
        ),
        migrations.AddField(
            model_name='process',
            name='belong_dept',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='process_belong_dept', to='system.dept', verbose_name='所属部门'),
        ),
        migrations.AddField(
            model_name='process',
            name='cate',
            field=models.CharField(default='', max_length=10, verbose_name='大类'),
        ),
        migrations.AddField(
            model_name='process',
            name='instruction',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='system.file', verbose_name='指导书'),
        ),
        migrations.AddField(
            model_name='process',
            name='instruction_content',
            field=models.TextField(blank=True, null=True, verbose_name='指导书内容'),
        ),
        migrations.AddField(
            model_name='process',
            name='sort',
            field=models.PositiveSmallIntegerField(default=1, verbose_name='排序'),
        ),
        migrations.AlterField(
            model_name='material',
            name='type',
            field=models.PositiveSmallIntegerField(choices=[(0, '电/水/气'), (10, '成品'), (20, '半成品'), (30, '主要原料'), (40, '辅助材料'), (50, '加工工具'), (60, '辅助工装'), (70, '办公用品')], default=1, help_text="((0, '电/水/气'), (10, '成品'), (20, '半成品'), (30, '主要原料'), (40, '辅助材料'), (50, '加工工具'), (60, '辅助工装'), (70, '办公用品'))", verbose_name='物料类型'),
        ),
        migrations.CreateModel(
            name='Route',
            fields=[
                ('id', models.CharField(editable=False, help_text='主键ID', max_length=20, primary_key=True, serialize=False, verbose_name='主键ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('sort', models.PositiveSmallIntegerField(default=1, verbose_name='顺序')),
                ('is_autotask', models.BooleanField(default=False, verbose_name='是否自动排产')),
                ('out_rate', models.FloatField(default=100, verbose_name='出材率')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='route_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('material', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='mtm.material', verbose_name='关联产品')),
                ('process', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='mtm.process', verbose_name='工序')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='route_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
