Compare commits
No commits in common. '7d1e03cbe030cd7c43f34ddc2b29233c3972f2e1' and '5a0ec3dde21134735028bb16f93d4267d1dbd744' have entirely different histories.
7d1e03cbe0
...
5a0ec3dde2
@ -1,3 +0,0 @@
|
|||||||
from django.contrib import admin
|
|
||||||
|
|
||||||
# Register your models here.
|
|
@ -1,6 +0,0 @@
|
|||||||
from django.apps import AppConfig
|
|
||||||
|
|
||||||
|
|
||||||
class ProductionInfoConfig(AppConfig):
|
|
||||||
default_auto_field = 'django.db.models.BigAutoField'
|
|
||||||
name = 'production_info'
|
|
@ -1,67 +0,0 @@
|
|||||||
# Generated by Django 3.2.16 on 2023-04-13 21:27
|
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
initial = True
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('goods_info', '0001_initial'),
|
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='BomProcessModel',
|
|
||||||
fields=[
|
|
||||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
|
|
||||||
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
|
|
||||||
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
|
|
||||||
('process_order', models.IntegerField(verbose_name='执行顺序')),
|
|
||||||
('name', models.CharField(max_length=50, verbose_name='工序名称')),
|
|
||||||
('leader_name', models.CharField(max_length=20, verbose_name='负责人的名字')),
|
|
||||||
('money', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='工价,最多精确到小数点后两位')),
|
|
||||||
('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')),
|
|
||||||
('leader_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='leader1_in_list', to=settings.AUTH_USER_MODEL, verbose_name='负责人员')),
|
|
||||||
('parent_goods', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='process_list', to='goods_info.goodsmodel', verbose_name='当前的生产工序属于哪个货品')),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
'verbose_name': '生产工序表',
|
|
||||||
'verbose_name_plural': '生产工序表',
|
|
||||||
'db_table': 't_bom_process',
|
|
||||||
'ordering': ['process_order'],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='BomMaterialModel',
|
|
||||||
fields=[
|
|
||||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
|
|
||||||
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
|
|
||||||
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
|
|
||||||
('goods_code', models.CharField(max_length=28, verbose_name='货品编号,不让用户填写')),
|
|
||||||
('name', models.CharField(max_length=20, verbose_name='货品名称')),
|
|
||||||
('specification', models.CharField(blank=True, max_length=50, null=True, verbose_name='货品规格')),
|
|
||||||
('model_number', models.CharField(blank=True, max_length=50, null=True, verbose_name='型号')),
|
|
||||||
('units_name', models.CharField(blank=True, max_length=50, null=True, verbose_name='单位名字')),
|
|
||||||
('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')),
|
|
||||||
('purchase_price', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, verbose_name='采购价')),
|
|
||||||
('count', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='数量,最多精确到小数点后两位')),
|
|
||||||
('money', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='费用,最多精确到小数点后两位')),
|
|
||||||
('goods', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='goods_info.goodsmodel', verbose_name='货品')),
|
|
||||||
('parent_goods', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='material_list', to='goods_info.goodsmodel', verbose_name='当前的物料清单属于哪个货品')),
|
|
||||||
('units', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='goods_info.unitsmodel')),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
'verbose_name': '生产物料表',
|
|
||||||
'verbose_name_plural': '生产物料表',
|
|
||||||
'db_table': 't_bom_material',
|
|
||||||
'ordering': ['id'],
|
|
||||||
},
|
|
||||||
),
|
|
||||||
]
|
|
@ -1,105 +0,0 @@
|
|||||||
# Generated by Django 3.2.16 on 2023-04-22 20:49
|
|
||||||
|
|
||||||
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 = [
|
|
||||||
('goods_info', '0001_initial'),
|
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
||||||
('sale_info', '0001_initial'),
|
|
||||||
('production_info', '0001_initial'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='ProductTaskModel',
|
|
||||||
fields=[
|
|
||||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
|
|
||||||
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
|
|
||||||
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
|
|
||||||
('invoices_date', models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True, verbose_name='单据日期')),
|
|
||||||
('number_code', models.CharField(max_length=28, unique=True, verbose_name='编号或者条码')),
|
|
||||||
('name', models.CharField(max_length=20, verbose_name='货品名称')),
|
|
||||||
('specification', models.CharField(blank=True, max_length=50, null=True, verbose_name='货品规格')),
|
|
||||||
('model_number', models.CharField(blank=True, max_length=50, null=True, verbose_name='型号')),
|
|
||||||
('goods_number_code', models.CharField(max_length=28, verbose_name='生产的货品编号或者批号')),
|
|
||||||
('units_name', models.CharField(blank=True, max_length=28, null=True, verbose_name='货品的单位')),
|
|
||||||
('sale_number', models.DecimalField(decimal_places=2, default=1, max_digits=10, verbose_name='订单数量')),
|
|
||||||
('p_number', models.DecimalField(decimal_places=2, default=1, max_digits=10, verbose_name='生产数量')),
|
|
||||||
('finish_date', models.DateField(blank=True, null=True, verbose_name='实际完工日期')),
|
|
||||||
('plan_finish_date', models.DateField(verbose_name='计划完工日期')),
|
|
||||||
('sale_number_code', models.CharField(blank=True, max_length=28, null=True, verbose_name='销售单的编号或者批号')),
|
|
||||||
('status', models.CharField(default='0', max_length=1, verbose_name='状态,0:未审核,1:加工中,2:完工')),
|
|
||||||
('check_number', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='验收合格数量')),
|
|
||||||
('storage_number', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='已入库数量')),
|
|
||||||
('cost_money', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='合计成本')),
|
|
||||||
('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')),
|
|
||||||
('goods', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='goods_info.goodsmodel', verbose_name='货品')),
|
|
||||||
('sale', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='sale_info.salemodel', verbose_name='销售单')),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
'verbose_name': '生产任务表',
|
|
||||||
'verbose_name_plural': '生产任务表',
|
|
||||||
'db_table': 't_product_task',
|
|
||||||
},
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='ProductProcessModel',
|
|
||||||
fields=[
|
|
||||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
|
|
||||||
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
|
|
||||||
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
|
|
||||||
('process_order', models.IntegerField(verbose_name='执行顺序')),
|
|
||||||
('name', models.CharField(max_length=128, verbose_name='工序名称')),
|
|
||||||
('leader_name', models.CharField(max_length=20, verbose_name='负责人的名字')),
|
|
||||||
('price', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='工价,最多精确到小数点后两位')),
|
|
||||||
('money', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='费用,最多精确到小数点后两位')),
|
|
||||||
('plan_finish_date', models.DateField(blank=True, null=True, verbose_name='计划完工日期')),
|
|
||||||
('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')),
|
|
||||||
('leader_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='leader2_in_list', to=settings.AUTH_USER_MODEL, verbose_name='负责人员')),
|
|
||||||
('product_task', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='process_list', to='production_info.producttaskmodel', verbose_name='生产任务')),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
'verbose_name': '生产工序表',
|
|
||||||
'verbose_name_plural': '生产工序表',
|
|
||||||
'db_table': 't_product_process',
|
|
||||||
},
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='ProductMaterialModel',
|
|
||||||
fields=[
|
|
||||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
|
|
||||||
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
|
|
||||||
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
|
|
||||||
('goods_code', models.CharField(max_length=28, verbose_name='货品编号,不让用户填写')),
|
|
||||||
('name', models.CharField(max_length=20, verbose_name='货品名称')),
|
|
||||||
('specification', models.CharField(blank=True, max_length=50, null=True, verbose_name='货品规格')),
|
|
||||||
('model_number', models.CharField(blank=True, max_length=50, null=True, verbose_name='型号')),
|
|
||||||
('units_name', models.CharField(blank=True, max_length=50, null=True, verbose_name='单位名字')),
|
|
||||||
('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')),
|
|
||||||
('purchase_price', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, verbose_name='采购价')),
|
|
||||||
('count', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='总共需要的数量')),
|
|
||||||
('money', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='费用,最多精确到小数点后两位')),
|
|
||||||
('get_count', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='已经领取的数量')),
|
|
||||||
('back_count', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='退回的数量')),
|
|
||||||
('use_count', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='已使用的数量')),
|
|
||||||
('scrap_count', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='报废的数量')),
|
|
||||||
('goods', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='goods_info.goodsmodel', verbose_name='货品')),
|
|
||||||
('product_task', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='material_list', to='production_info.producttaskmodel', verbose_name='生产任务')),
|
|
||||||
('units', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='goods_info.unitsmodel')),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
'verbose_name': '生产物料表',
|
|
||||||
'verbose_name_plural': '生产物料表',
|
|
||||||
'db_table': 't_product_material',
|
|
||||||
},
|
|
||||||
),
|
|
||||||
]
|
|
@ -1,26 +0,0 @@
|
|||||||
# Generated by Django 3.2.16 on 2023-04-22 21:38
|
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
||||||
('production_info', '0002_productmaterialmodel_productprocessmodel_producttaskmodel'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='producttaskmodel',
|
|
||||||
name='check_user',
|
|
||||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='checker6_list', to=settings.AUTH_USER_MODEL, verbose_name='审核人员,不能修改'),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='producttaskmodel',
|
|
||||||
name='check_user_name',
|
|
||||||
field=models.CharField(blank=True, max_length=20, null=True, verbose_name='操作人员的真实姓名'),
|
|
||||||
),
|
|
||||||
]
|
|
@ -1,144 +0,0 @@
|
|||||||
from django.db import models
|
|
||||||
from django.utils import timezone
|
|
||||||
|
|
||||||
from ERP_5.utils.base_model import BaseModel
|
|
||||||
|
|
||||||
|
|
||||||
# BOM表中的物料模型类
|
|
||||||
class BomMaterialModel(BaseModel):
|
|
||||||
# 冗余字段
|
|
||||||
goods_code = models.CharField('货品编号,不让用户填写', max_length=28)
|
|
||||||
name = models.CharField(max_length=20, verbose_name='货品名称')
|
|
||||||
specification = models.CharField('货品规格', max_length=50, null=True, blank=True)
|
|
||||||
model_number = models.CharField('型号', max_length=50, null=True, blank=True)
|
|
||||||
units_name = models.CharField('单位名字', max_length=50, null=True, blank=True)
|
|
||||||
units = models.ForeignKey('goods_info.UnitsModel', on_delete=models.SET_NULL, null=True, blank=True)
|
|
||||||
|
|
||||||
remark = models.CharField('备注', max_length=512, blank=True, null=True)
|
|
||||||
purchase_price = models.DecimalField('采购价', max_digits=10, decimal_places=2, blank=True, default=0)
|
|
||||||
count = models.DecimalField('数量,最多精确到小数点后两位', max_digits=10, decimal_places=2, default=0)
|
|
||||||
money = models.DecimalField('费用,最多精确到小数点后两位', max_digits=10, decimal_places=2, default=0)
|
|
||||||
|
|
||||||
goods = models.ForeignKey('goods_info.GoodsModel', null=True, on_delete=models.SET_NULL,
|
|
||||||
verbose_name='货品')
|
|
||||||
|
|
||||||
parent_goods = models.ForeignKey('goods_info.GoodsModel', blank=True, related_name='material_list', null=True,
|
|
||||||
on_delete=models.SET_NULL, verbose_name='当前的物料清单属于哪个货品')
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
db_table = 't_bom_material'
|
|
||||||
verbose_name = '生产物料表'
|
|
||||||
verbose_name_plural = verbose_name
|
|
||||||
ordering = ['id']
|
|
||||||
|
|
||||||
|
|
||||||
# BOM表中 的生产工序模型类
|
|
||||||
class BomProcessModel(BaseModel):
|
|
||||||
process_order = models.IntegerField('执行顺序')
|
|
||||||
name = models.CharField('工序名称', max_length=50)
|
|
||||||
leader_name = models.CharField('负责人的名字', max_length=20)
|
|
||||||
leader_user = models.ForeignKey('erp_system.UserModel', related_name='leader1_in_list', null=True, blank=True,
|
|
||||||
on_delete=models.SET_NULL, verbose_name='负责人员')
|
|
||||||
money = models.DecimalField('工价,最多精确到小数点后两位', max_digits=10, decimal_places=2, default=0)
|
|
||||||
remark = models.CharField('备注', max_length=512, blank=True, null=True)
|
|
||||||
parent_goods = models.ForeignKey('goods_info.GoodsModel', blank=True, related_name='process_list', null=True,
|
|
||||||
on_delete=models.SET_NULL, verbose_name='当前的生产工序属于哪个货品')
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
db_table = 't_bom_process'
|
|
||||||
verbose_name = '生产工序表'
|
|
||||||
verbose_name_plural = verbose_name
|
|
||||||
ordering = ['process_order']
|
|
||||||
|
|
||||||
|
|
||||||
# 生产任务模型类
|
|
||||||
class ProductTaskModel(BaseModel):
|
|
||||||
invoices_date = models.DateTimeField('单据日期', blank=True, null=True, default=timezone.now)
|
|
||||||
number_code = models.CharField('编号或者条码', max_length=28, unique=True)
|
|
||||||
# 冗余字段
|
|
||||||
name = models.CharField(max_length=20, verbose_name='货品名称')
|
|
||||||
specification = models.CharField('货品规格', max_length=50, null=True, blank=True)
|
|
||||||
model_number = models.CharField('型号', max_length=50, null=True, blank=True)
|
|
||||||
goods_number_code = models.CharField('生产的货品编号或者批号', max_length=28)
|
|
||||||
units_name = models.CharField('货品的单位', max_length=28, null=True, blank=True)
|
|
||||||
sale_number = models.DecimalField('订单数量', default=1, max_digits=10, decimal_places=2)
|
|
||||||
p_number = models.DecimalField('生产数量', default=1, max_digits=10, decimal_places=2)
|
|
||||||
finish_date = models.DateField('实际完工日期', null=True, blank=True)
|
|
||||||
plan_finish_date = models.DateField('计划完工日期')
|
|
||||||
goods = models.ForeignKey('goods_info.GoodsModel', null=True, blank=True, on_delete=models.SET_NULL,
|
|
||||||
verbose_name='货品')
|
|
||||||
|
|
||||||
sale_number_code = models.CharField('销售单的编号或者批号', max_length=28, null=True, blank=True)
|
|
||||||
sale = models.ForeignKey('sale_info.SaleModel', null=True, blank=True, on_delete=models.SET_NULL,
|
|
||||||
verbose_name='销售单')
|
|
||||||
status = models.CharField('状态,0:未审核,1:加工中,2:完工', max_length=1,
|
|
||||||
default='0')
|
|
||||||
|
|
||||||
check_number = models.DecimalField('验收合格数量', default=0, max_digits=10, decimal_places=2)
|
|
||||||
storage_number = models.DecimalField('已入库数量', default=0, max_digits=10, decimal_places=2)
|
|
||||||
cost_money = models.DecimalField('合计成本', max_digits=10, decimal_places=2, default=0)
|
|
||||||
remark = models.CharField('备注', max_length=512, blank=True, null=True)
|
|
||||||
|
|
||||||
check_user = models.ForeignKey('erp_system.UserModel', related_name='checker6_list', null=True, blank=True,
|
|
||||||
on_delete=models.SET_NULL,
|
|
||||||
verbose_name='审核人员,不能修改')
|
|
||||||
# 增加一个冗余字段
|
|
||||||
check_user_name = models.CharField('操作人员的真实姓名', max_length=20, null=True, blank=True)
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
db_table = 't_product_task'
|
|
||||||
verbose_name = '生产任务表'
|
|
||||||
verbose_name_plural = verbose_name
|
|
||||||
|
|
||||||
|
|
||||||
# 生产物料模型
|
|
||||||
class ProductMaterialModel(BaseModel):
|
|
||||||
# 冗余字段
|
|
||||||
goods_code = models.CharField('货品编号,不让用户填写', max_length=28)
|
|
||||||
name = models.CharField(max_length=20, verbose_name='货品名称')
|
|
||||||
specification = models.CharField('货品规格', max_length=50, null=True, blank=True)
|
|
||||||
model_number = models.CharField('型号', max_length=50, null=True, blank=True)
|
|
||||||
units_name = models.CharField('单位名字', max_length=50, null=True, blank=True)
|
|
||||||
units = models.ForeignKey('goods_info.UnitsModel', on_delete=models.SET_NULL, null=True, blank=True)
|
|
||||||
|
|
||||||
remark = models.CharField('备注', max_length=512, blank=True, null=True)
|
|
||||||
purchase_price = models.DecimalField('采购价', max_digits=10, decimal_places=2, blank=True, default=0)
|
|
||||||
count = models.DecimalField('总共需要的数量', max_digits=10, decimal_places=2, default=0)
|
|
||||||
money = models.DecimalField('费用,最多精确到小数点后两位', max_digits=10, decimal_places=2, default=0)
|
|
||||||
|
|
||||||
goods = models.ForeignKey('goods_info.GoodsModel', null=True, on_delete=models.SET_NULL,
|
|
||||||
verbose_name='货品')
|
|
||||||
|
|
||||||
get_count = models.DecimalField('已经领取的数量', max_digits=10, decimal_places=2, default=0)
|
|
||||||
back_count = models.DecimalField('退回的数量', max_digits=10, decimal_places=2, default=0)
|
|
||||||
use_count = models.DecimalField('已使用的数量', max_digits=10, decimal_places=2, default=0)
|
|
||||||
scrap_count = models.DecimalField('报废的数量', max_digits=10, decimal_places=2, default=0)
|
|
||||||
|
|
||||||
product_task = models.ForeignKey('ProductTaskModel', null=True, on_delete=models.SET_NULL,
|
|
||||||
verbose_name='生产任务', related_name='material_list')
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
db_table = 't_product_material'
|
|
||||||
verbose_name = '生产物料表'
|
|
||||||
verbose_name_plural = verbose_name
|
|
||||||
|
|
||||||
|
|
||||||
# 生产任务中 的生产工序模型类
|
|
||||||
class ProductProcessModel(BaseModel):
|
|
||||||
process_order = models.IntegerField('执行顺序')
|
|
||||||
name = models.CharField('工序名称', max_length=128)
|
|
||||||
leader_name = models.CharField('负责人的名字', max_length=20)
|
|
||||||
leader_user = models.ForeignKey('erp_system.UserModel', related_name='leader2_in_list', null=True, blank=True,
|
|
||||||
on_delete=models.SET_NULL, verbose_name='负责人员')
|
|
||||||
price = models.DecimalField('工价,最多精确到小数点后两位', max_digits=10, decimal_places=2, default=0)
|
|
||||||
money = models.DecimalField('费用,最多精确到小数点后两位', max_digits=10, decimal_places=2, default=0)
|
|
||||||
plan_finish_date = models.DateField('计划完工日期', null=True, blank=True)
|
|
||||||
remark = models.CharField('备注', max_length=512, blank=True, null=True)
|
|
||||||
|
|
||||||
product_task = models.ForeignKey('ProductTaskModel', null=True, on_delete=models.SET_NULL,
|
|
||||||
verbose_name='生产任务', related_name='process_list')
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
db_table = 't_product_process'
|
|
||||||
verbose_name = '生产工序表'
|
|
||||||
verbose_name_plural = verbose_name
|
|
@ -1,3 +0,0 @@
|
|||||||
from django.test import TestCase
|
|
||||||
|
|
||||||
# Create your tests here.
|
|
@ -1,35 +0,0 @@
|
|||||||
"""ERP_5 URL Configuration
|
|
||||||
|
|
||||||
The `urlpatterns` list routes URLs to views. For more information please see:
|
|
||||||
https://docs.djangoproject.com/en/3.2/topics/http/urls/
|
|
||||||
Examples:
|
|
||||||
Function views
|
|
||||||
1. Add an import: from my_app import views
|
|
||||||
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
|
||||||
Class-based views
|
|
||||||
1. Add an import: from other_app.views import Home
|
|
||||||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
|
||||||
Including another URLconf
|
|
||||||
1. Import the include() function: from django.urls import include, path
|
|
||||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
|
||||||
"""
|
|
||||||
from django.contrib import admin
|
|
||||||
from django.urls import path, re_path
|
|
||||||
from rest_framework.routers import DefaultRouter
|
|
||||||
from .views import bom_views, product_task_views
|
|
||||||
|
|
||||||
from rest_framework_jwt.views import obtain_jwt_token
|
|
||||||
|
|
||||||
urlpatterns = [
|
|
||||||
# path('admin/', admin.site.urls),
|
|
||||||
|
|
||||||
|
|
||||||
]
|
|
||||||
|
|
||||||
router = DefaultRouter()
|
|
||||||
router.register('bom_material', bom_views.MaterialViewSets)
|
|
||||||
router.register('bom_process', bom_views.ProcessViewSets)
|
|
||||||
router.register('bom', bom_views.GoodsBomViewSet)
|
|
||||||
router.register('products', product_task_views.ProductTaskViewSets)
|
|
||||||
|
|
||||||
urlpatterns += router.urls
|
|
@ -1,3 +0,0 @@
|
|||||||
from django.shortcuts import render
|
|
||||||
|
|
||||||
# Create your views here.
|
|
@ -1,20 +0,0 @@
|
|||||||
# Generated by Django 3.2.16 on 2023-04-22 22:11
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('production_info', '0003_auto_20230422_2138'),
|
|
||||||
('warehouse_info', '0002_saledeliveritemmodel_saledelivermodel'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='saledelivermodel',
|
|
||||||
name='product_task',
|
|
||||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='production_info.producttaskmodel', verbose_name='所属的生产任务'),
|
|
||||||
),
|
|
||||||
]
|
|
Loading…
Reference in new issue