pull neirong
This commit is contained in:
parent
5ec7751abd
commit
89399f537b
|
@ -85,7 +85,7 @@ import access from "@/views/accessment/access"
|
|||
import Detectiontask from "@/views/certapp/detectiontask"
|
||||
export default {
|
||||
|
||||
components: { CCCform, Certunit, QMSform,Productunit, Conclusion, Member, access, CHARGE, REVIEW},
|
||||
components: { CCCform, Certunit, QMSform, Conclusion, Member, access, CHARGE, REVIEW},
|
||||
|
||||
props: [],
|
||||
data() {
|
||||
|
|
|
@ -140,7 +140,6 @@
|
|||
</template>
|
||||
<script>
|
||||
import { getImplementRuleList, getUnitTypeList } from "@/api/implementrule"
|
||||
import { getUnitList, deleteUnit, createUnit, updateUnit } from "@/api/unit";
|
||||
import { getDictList } from "@/api/dict";
|
||||
import Pagination from "@/components/Pagination";
|
||||
import checkPermission from "@/utils/permission";
|
||||
|
|
|
@ -40,4 +40,5 @@ class Chargeitem(CommonBModel):
|
|||
verbose_name = '收费项目'
|
||||
verbose_name_plural = verbose_name
|
||||
def __str__(self):
|
||||
return self.itemkind
|
||||
return self.itemkind
|
||||
|
||||
|
|
|
@ -2,10 +2,13 @@ from django.db import models
|
|||
from apps.system.models import CommonBModel,CommonAModel,Dict
|
||||
from simple_history.models import HistoricalRecords
|
||||
from django.contrib.postgres.fields import ArrayField
|
||||
from apps.project.models import Certappunit
|
||||
import uuid
|
||||
# Create your models here.
|
||||
class TestOrg(CommonBModel):
|
||||
|
||||
"""
|
||||
实验室列表
|
||||
"""
|
||||
code = models.CharField('实验室编号', max_length=100)
|
||||
name = models.CharField('实验室名称',null=True, blank=True,max_length=200)
|
||||
address = models.CharField('通讯地址',null=True, blank=True,max_length=500)
|
||||
|
@ -23,7 +26,9 @@ class TestOrg(CommonBModel):
|
|||
def __str__(self):
|
||||
return self.name
|
||||
class TestOrgNotice(CommonBModel):
|
||||
|
||||
"""
|
||||
实验室公告
|
||||
"""
|
||||
name = models.CharField('公告标题',null=True, blank=True,max_length=500)
|
||||
publishdate = models.DateTimeField('发布时间')
|
||||
ismportant = models.BooleanField('是否重要公告', default=True)
|
||||
|
@ -38,8 +43,11 @@ class TestOrgNotice(CommonBModel):
|
|||
def __str__(self):
|
||||
return self.name
|
||||
class DetectionTask(CommonBModel):
|
||||
|
||||
"""
|
||||
检测任务
|
||||
"""
|
||||
testorg = models.ForeignKey(TestOrg,verbose_name='检测机构', related_name='detectionTask_testorg', on_delete=models.DO_NOTHING)
|
||||
|
||||
certappunit = models.ForeignKey(Certappunit,verbose_name='认证单元', related_name='detectionTask_certappunit', on_delete=models.DO_NOTHING)
|
||||
remark = models.TextField('备注', null=True, blank=True)
|
||||
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
from django.urls import path, include
|
||||
from .views import TestOrgViewSet,TestOrgNoticeViewSet
|
||||
from .views import TestOrgViewSet,TestOrgNoticeViewSet,DetectionTaskViewSet
|
||||
from rest_framework import routers
|
||||
|
||||
router = routers.DefaultRouter()
|
||||
router.register('testorg', TestOrgViewSet, basename="TestOrg")
|
||||
router.register('testnotice', TestOrgNoticeViewSet, basename="TestOrgnotice")
|
||||
|
||||
router.register('detectiontask', DetectionTaskViewSet, basename="DetectionTask")
|
||||
urlpatterns = [
|
||||
path('', include(router.urls))
|
||||
]
|
|
@ -3,7 +3,7 @@ from django.shortcuts import render
|
|||
from rest_framework.viewsets import ModelViewSet
|
||||
from .models import TestOrg,TestOrgNotice
|
||||
from utils.queryset import get_child_queryset2
|
||||
from .serializers import TestOrgSerializer,TestOrgNoticeSerializer,TestOrgNoticListSerializer
|
||||
from .serializers import TestOrgSerializer,TestOrgNoticeSerializer,TestOrgNoticListSerializer,DetectionTaskSerializer
|
||||
from apps.system.permission_data import RbacFilterSet
|
||||
from apps.system.mixins import CreateUpdateCustomMixin, OptimizationMixin
|
||||
# Create your views here.
|
||||
|
@ -27,4 +27,10 @@ class TestOrgNoticeViewSet(CreateUpdateCustomMixin, OptimizationMixin, ModelView
|
|||
if self.action == 'list':
|
||||
return TestOrgNoticListSerializer
|
||||
return TestOrgNoticeSerializer
|
||||
class DetectionTasViewSet(CreateUpdateCustomMixin, OptimizationMixin, ModelViewSet):
|
||||
perms_map = {'get': '*', 'post': 'DetectionTas_create',
|
||||
'put': 'DetectionTas_update', 'delete': 'DetectionTas_delete'}
|
||||
queryset = DetectionTas.objects
|
||||
serializer_class = DetectionTaskSerializer
|
||||
ordering = ['-create_time']
|
||||
|
||||
|
|
Loading…
Reference in New Issue