# Generated by Django 2.1.7 on 2020-12-14 12:39

import company.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0094_auto_20201211_1839'),
    ]

    operations = [
        migrations.CreateModel(
            name='Benefit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=50, verbose_name='权益名称')),
                ('is_face_to_agent', models.BooleanField(default=True, verbose_name='是否面向经销商')),
                ('is_face_to_terminal', models.BooleanField(default=True, verbose_name='是否面向终端店')),
                ('is_face_to_business', models.BooleanField(default=True, verbose_name='是否面向业务员')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否激活')),
                ('remark', models.CharField(blank=True, default='', max_length=100, null=True, verbose_name='备注说明')),
                ('tm', models.DateTimeField(auto_now_add=True, null=True, verbose_name='时间')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='company.Company', verbose_name='公司')),
            ],
            options={
                'verbose_name': '权益',
                'verbose_name_plural': '权益',
            },
        ),
        migrations.CreateModel(
            name='Brands',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='名称')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否激活')),
                ('level_up_method', models.SmallIntegerField(blank=True, choices=[(1, '按销售数量'), (2, '按销售金额')], default=1, null=True, verbose_name='升级方法')),
                ('remark', models.CharField(blank=True, default='', max_length=100, null=True, verbose_name='备注说明')),
                ('tm', models.DateTimeField(auto_now_add=True, null=True, verbose_name='时间')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='company.Company', verbose_name='公司')),
            ],
            options={
                'verbose_name': '品牌管理',
                'verbose_name_plural': '品牌管理',
            },
        ),
        migrations.CreateModel(
            name='Brands_Level',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=50, verbose_name='等级名称')),
                ('level', models.IntegerField(db_index=True, default=1, verbose_name='等级')),
                ('photo', models.ImageField(blank=True, null=True, upload_to=company.models.company_upload_brand, verbose_name='等级图片')),
                ('need_money', models.IntegerField(blank=True, default=0, null=True, verbose_name='需要金额')),
                ('need_num', models.IntegerField(blank=True, default=0, null=True, verbose_name='需要数量')),
                ('remark', models.CharField(blank=True, default='', max_length=100, null=True, verbose_name='备注说明')),
                ('tm', models.DateTimeField(auto_now_add=True, null=True, verbose_name='时间')),
                ('benefit', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='company.Benefit', verbose_name='权益')),
                ('brand', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='company.Brands', verbose_name='品牌')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='company.Company', verbose_name='公司')),
            ],
            options={
                'verbose_name': '品牌管理',
                'verbose_name_plural': '品牌管理',
            },
        ),
        migrations.CreateModel(
            name='Label_Bind_Rule',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('level_1', models.SmallIntegerField(default=0, verbose_name='一级绑定')),
                ('level_2', models.SmallIntegerField(default=0, verbose_name='二级绑定')),
                ('level_3', models.SmallIntegerField(default=0, verbose_name='三级绑定')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否激活')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='company.Company', verbose_name='公司')),
            ],
            options={
                'verbose_name': '绑定规则',
                'verbose_name_plural': '绑定规则',
            },
        ),
        migrations.CreateModel(
            name='News',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subtitle', models.CharField(max_length=300, verbose_name='大标题')),
                ('content', models.CharField(max_length=10000, verbose_name='新闻内容')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否激活')),
                ('remark', models.CharField(blank=True, default='', max_length=100, null=True, verbose_name='备注说明')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='company.Company', verbose_name='公司')),
            ],
            options={
                'verbose_name': '新闻资讯',
                'verbose_name_plural': '新闻资讯',
            },
        ),
        migrations.CreateModel(
            name='Page_Banners',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(blank=True, null=True, upload_to=company.models.company_upload_banner, verbose_name='轮播图')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否激活')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='company.Company', verbose_name='公司名称')),
            ],
            options={
                'verbose_name': '轮播图管理',
                'verbose_name_plural': '轮播图管理',
            },
        ),
        migrations.CreateModel(
            name='Sale_Task',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='销售任务名称')),
                ('start_tm', models.DateField(blank=True, null=True, verbose_name='开始时间')),
                ('end_tm', models.DateField(blank=True, null=True, verbose_name='结束时间')),
                ('finish_percent', models.DecimalField(blank=True, decimal_places=4, default=0, max_digits=10, null=True, verbose_name='完成进度')),
                ('remark', models.CharField(blank=True, default='', max_length=100, null=True, verbose_name='备注说明')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否激活')),
                ('tm', models.DateTimeField(auto_now_add=True, null=True, verbose_name='时间')),
                ('last_update_tm', models.DateTimeField(auto_now_add=True, null=True, verbose_name='最后更新时间')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='company.Company', verbose_name='公司')),
            ],
            options={
                'verbose_name': '销售任务考核',
                'verbose_name_plural': '销售任务考核',
            },
        ),
        migrations.CreateModel(
            name='Sale_Task_Allocate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sale_money', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, null=True, verbose_name='任务销售额度')),
                ('sold_money', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, null=True, verbose_name='已销售金额')),
                ('finish_percent', models.DecimalField(blank=True, decimal_places=4, default=0, max_digits=10, null=True, verbose_name='完成进度')),
                ('remark', models.CharField(blank=True, default='', max_length=100, null=True, verbose_name='备注说明')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否激活')),
                ('tm', models.DateTimeField(auto_now_add=True, null=True, verbose_name='时间')),
                ('last_update_tm', models.DateTimeField(auto_now_add=True, null=True, verbose_name='最后更新时间')),
                ('agent', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='company_agent', to='company.Company', verbose_name='经销商')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='company_company', to='company.Company', verbose_name='公司')),
                ('sale_task', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='company.Sale_Task', verbose_name='任务')),
            ],
            options={
                'verbose_name': '销售任务分配',
                'verbose_name_plural': '销售任务分配',
            },
        ),
        migrations.CreateModel(
            name='Third_Party_Company',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, verbose_name='第三方公司名称')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否激活')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='company.Company', verbose_name='公司')),
            ],
            options={
                'verbose_name': '第三方公司',
                'verbose_name_plural': '第三方公司',
            },
        ),
        migrations.CreateModel(
            name='Third_Party_Label_Bind',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label_type', models.CharField(max_length=50, verbose_name='标签类型')),
                ('label_code', models.CharField(max_length=50, verbose_name='标签序号')),
                ('label_code_out', models.CharField(max_length=50, verbose_name='第三方标签序号')),
                ('label_code_type', models.SmallIntegerField(default=2, verbose_name='标签序号类型')),
                ('label_bind_rule', models.CharField(max_length=50, verbose_name='第三方标签序号')),
                ('batch_id', models.CharField(max_length=50, verbose_name='标签序号')),
                ('parent_id', models.IntegerField(blank=True, null=True, verbose_name='父级ID')),
                ('first_parent_id', models.IntegerField(blank=True, null=True, verbose_name='顶层父级ID')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='company.Company', verbose_name='公司')),
                ('third_party_company', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='company.Third_Party_Company', verbose_name='第三方公司')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, verbose_name='操作人')),
            ],
            options={
                'verbose_name': '第三方标签序号绑定',
                'verbose_name_plural': '第三方标签序号绑定',
            },
        ),
        migrations.CreateModel(
            name='White_Domain',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('domain', models.CharField(max_length=200, verbose_name='域名')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否激活')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='company.Company', verbose_name='公司')),
            ],
            options={
                'verbose_name': '域名白名单',
                'verbose_name_plural': '域名白名单',
            },
        ),
        migrations.CreateModel(
            name='White_Domain_Type',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='类型')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
            ],
            options={
                'verbose_name': '域名白名单类型',
                'verbose_name_plural': '域名白名单类型',
            },
        ),
        migrations.AddField(
            model_name='white_domain',
            name='domain_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='company.White_Domain_Type', verbose_name='域名类型'),
        ),
        migrations.AddField(
            model_name='brands',
            name='third_party_company',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='company.Third_Party_Company', verbose_name='第三方公司'),
        ),
    ]
