32 lines
1.3 KiB
Python
32 lines
1.3 KiB
Python
from django.db import models
|
|
from django.contrib.auth.models import AbstractUser
|
|
from django.db.models.base import Model
|
|
import django.utils.timezone as timezone
|
|
from django.db.models.query import QuerySet
|
|
from apps.system.models import CommonAModel, CommonBModel, Organization, User, Dict, File
|
|
from utils.model import SoftModel, BaseModel
|
|
from simple_history.models import HistoricalRecords
|
|
|
|
|
|
|
|
class Employee(BaseModel):
|
|
"""
|
|
员工信息
|
|
"""
|
|
job_choices = (
|
|
('在职', '在职'),
|
|
('离职', '离职'),
|
|
)
|
|
name = models.CharField('姓名', max_length=50)
|
|
number = models.CharField('人员编号', max_length=50,null=True, blank=True, unique=True)
|
|
gender = models.CharField('性别', max_length=10,null=True, blank=True)
|
|
phone = models.CharField('手机号', max_length=11,null=True, blank=True, unique=True)
|
|
jobstate = models.CharField('在职状态', max_length=11,choices=job_choices, default='在职')
|
|
dept = models.ForeignKey(Organization, verbose_name='关联部门', on_delete=models.CASCADE, related_name='employee_dept')
|
|
description = models.CharField('描述', max_length=200, blank=True, null=True)
|
|
class Meta:
|
|
verbose_name = '客户信息'
|
|
verbose_name_plural = verbose_name
|
|
|
|
def __str__(self):
|
|
return self.name |