40 lines
1.9 KiB
Python
40 lines
1.9 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 Equipment(BaseModel):
|
|
"""
|
|
设备台账信息
|
|
"""
|
|
state_choices = (
|
|
('启用', '启用'),
|
|
('停用', '停用'),
|
|
)
|
|
node = models.IntegerField('序号', max_length=50, default=0)
|
|
name = models.CharField('设备名称', max_length=50)
|
|
number = models.CharField('设备编号', max_length=50,null=True, blank=True, unique=True)
|
|
model = models.CharField('规格型号', max_length=10,null=True, blank=True)
|
|
factory = models.CharField('生产厂', max_length=50)
|
|
country = models.CharField('国别', max_length=50)
|
|
productiondate = models.DateField('生产日期', max_length=50,null=True, blank=True, unique=True)
|
|
buydate = models.DateField('购置日期', max_length=10,null=True, blank=True)
|
|
gznumber = models.IntegerField('购置数量', max_length=10,null=True, blank=True,default=0)
|
|
state = models.CharField('设备状态', max_length=11,choices=state_choices, default='启用')
|
|
indicators = models.CharField('技术指标', max_length=50)
|
|
address = models.CharField('存放位置', max_length=50,null=True, blank=True, unique=True)
|
|
contact = models.CharField('经管联系人', max_length=20, blank=True, null=True)
|
|
contactphone = models.CharField('联系电话', max_length=11,unique=True, blank=True, null=True)
|
|
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 |