# Generated by Django 3.0.7 on 2020-08-12 08:54

from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('system', '0028_auto_20200807_1018'),
        ('crm', '0011_enterprise_parent'),
        ('project', '0016_case'),
    ]

    operations = [
        migrations.CreateModel(
            name='CertApp',
            fields=[
                ('id', models.AutoField(auto_created=True, 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='删除标记')),
                ('number', models.CharField(blank=True, max_length=100, null=True, verbose_name='受理编号')),
                ('apply_date', models.DateField(blank=True, null=True, verbose_name='申请日期')),
                ('accept_date', models.DateField(blank=True, null=True, verbose_name='受理日期')),
                ('applicant_v', django.contrib.postgres.fields.jsonb.JSONField(verbose_name='申请方')),
                ('status', models.CharField(choices=[('草稿', '草稿'), ('已申请', '已申请'), ('已受理', '已受理'), ('进行中', '进行中'), ('已中止', '已中止'), ('已完成', '已完成')], default='草稿', max_length=50, verbose_name='申请状态')),
                ('evresult', models.CharField(choices=[('未评审', '未评审'), ('合格', '合格'), ('不合格', '不合格'), ('有条件放行', '有条件放行')], default='未评审', max_length=50, verbose_name='评审结论')),
                ('evremark', models.TextField(blank=True, verbose_name='备注')),
                ('is_approve', models.BooleanField(default=True, verbose_name='是否认可')),
                ('pattern', models.CharField(blank=True, choices=[('正常', '正常'), ('ODM', 'ODM'), ('OEM', 'OEM')], max_length=50, null=True, verbose_name='申请模式')),
                ('manufacture_v', django.contrib.postgres.fields.jsonb.JSONField(null=True, verbose_name='制造商')),
                ('factory_v', django.contrib.postgres.fields.jsonb.JSONField(null=True, verbose_name='生产厂')),
                ('applicant', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='certapp_applicant', to='crm.Enterprise')),
                ('belong_dept', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='certapp_belong_dept', to='system.Organization', verbose_name='所属部门')),
                ('cccpv_class', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='certapp_cccpv_class', to='system.Dict', verbose_name='涉及CCC/PV分类')),
                ('cert_field', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='certapp_cert_field', to='system.Dict', verbose_name='认证领域')),
                ('cnas_scopes', models.ManyToManyField(blank=True, related_name='certapp_cnas_sopes', to='system.Dict', verbose_name='涉及cnas分类')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='certapp_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('factory', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='certapp_factory', to='crm.Enterprise')),
                ('manufacture', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='certapp_manufacture', to='crm.Enterprise')),
                ('project', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='certapp_project', to='project.Project')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='certapp_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'verbose_name': '认证受理',
                'verbose_name_plural': '认证受理',
            },
        ),
        migrations.DeleteModel(
            name='Case',
        ),
    ]
