models.py 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. from django.db import models
  2. from utils.models import BaseModel
  3. # Create your models here.
  4. class Django_mf_bg(BaseModel):
  5. bg_no = models.CharField(max_length=30, primary_key=True,blank=False,verbose_name="单据号码")
  6. no_dd = models.DateTimeField(verbose_name="单据日期")
  7. bg_id = models.CharField(max_length=10,default='', blank=False,null=False,verbose_name="单据类别")
  8. zc_no = models.CharField(max_length=30,default='', blank=False,null=False,verbose_name="制程代号")
  9. mo_no = models.CharField(max_length=100,default='', blank=False,null=False,verbose_name="制令单号")
  10. sal_no = models.CharField(max_length=150,default='', blank=True,null=True,verbose_name="作业人员")
  11. zd_zc = models.CharField(max_length=150,default='', blank=True,null=True,verbose_name="指定制程")
  12. isbad = models.BooleanField(default=False, verbose_name='是否异常单')
  13. create_user = models.CharField(max_length=50, null=True, blank=True,verbose_name='创建人')
  14. update_user = models.CharField(max_length=50, null=True, blank=True,verbose_name='修改人')
  15. class Meta:
  16. db_table = 'django_mf_bg'
  17. verbose_name = '报工表头'
  18. verbose_name_plural = verbose_name
  19. def __str__(self):
  20. return self.bg_no
  21. class Django_tf_bg(BaseModel):
  22. YEAR_IN_SCHOOL_CHOICES = (
  23. (1, '接收'),
  24. (2, '派工'),
  25. (3, '收货'),
  26. (4, '转移'),
  27. )
  28. bg_no = models.ForeignKey(Django_mf_bg,on_delete=models.CASCADE, max_length='30',blank=False,verbose_name="单据号码")
  29. no_dd = models.DateTimeField(verbose_name="单据日期")
  30. itm = models.IntegerField(verbose_name="行号",blank=False,null=False,default='')
  31. bg_id = models.CharField(max_length=10,default='',blank=False,null=False,verbose_name="单据类别")
  32. mo_no = models.CharField(max_length=40,blank=False,null=False,default='',verbose_name="制令单号")
  33. zt_no = models.CharField(max_length=40,blank=False,null=False,default='',verbose_name="通知单号")
  34. prd_no = models.CharField(max_length=40,blank=False,null=False,default='',verbose_name="品号")
  35. prd_name = models.CharField(max_length=200,default='',verbose_name="品名")
  36. sal_no = models.CharField(max_length=200,default='',verbose_name="作业员")
  37. zc_no_up = models.CharField(max_length=200, default='', verbose_name="上制程")
  38. zc_no_end = models.CharField(max_length=200, default='', verbose_name="下制程")
  39. zd_zc = models.CharField(max_length=150, default='', blank=True, null=True, verbose_name="指定制程")
  40. cc = models.CharField(max_length=40,default='',verbose_name="尺寸")
  41. zy = models.CharField(max_length=40,default='',verbose_name="字印")
  42. qty = models.DecimalField(max_digits=19,decimal_places=2,default=0,verbose_name="数量")
  43. zl = models.CharField(max_length=40, default='', verbose_name="重量")
  44. ms = models.TextField( default='', verbose_name="描述")
  45. rem = models.TextField( default='', verbose_name="备注")
  46. dd = models.CharField(max_length=40, default='', verbose_name="电镀")
  47. prd_rem = models.TextField(default='', verbose_name="货品备注")
  48. class Meta:
  49. db_table = 'django_tf_bg'
  50. verbose_name = '报工表身'
  51. verbose_name_plural = verbose_name
  52. def __str__(self):
  53. return self.bg_no