同步内容
This commit is contained in:
parent
b02e4cd27e
commit
6a6e6d859b
|
@ -7,6 +7,9 @@ export function getCertappunitList(query) {
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function getCertappunit(id) {
|
export function getCertappunit(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/project/certappunit/${id}/`,
|
url: `/project/certappunit/${id}/`,
|
||||||
|
@ -48,6 +51,16 @@ export function createcompleteCertappunit(id,data) {
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function testlistCertappunit(query) {
|
||||||
|
return request({
|
||||||
|
url: `/project/certappunit/testlist/`,
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// export function createAccess(data) {
|
// export function createAccess(data) {
|
||||||
// return request({
|
// return request({
|
||||||
// url: '/accessment/certass/',
|
// url: '/accessment/certass/',
|
||||||
|
|
|
@ -276,7 +276,7 @@ export default {
|
||||||
},
|
},
|
||||||
updatestate(id){
|
updatestate(id){
|
||||||
var val='待CTC下达';
|
var val='待CTC下达';
|
||||||
teststateCertappunit(id, {'teststate':val}).then(res=>{
|
teststateCertappunit(this.formData.id, {'teststate':val}).then(res=>{
|
||||||
this.$message.success('成功')
|
this.$message.success('成功')
|
||||||
this.getList()
|
this.getList()
|
||||||
})
|
})
|
||||||
|
@ -287,13 +287,11 @@ export default {
|
||||||
if (!valid) return;
|
if (!valid) return;
|
||||||
testtaskCertappunit(this.formData.id, this.formData).then((res) => {
|
testtaskCertappunit(this.formData.id, this.formData).then((res) => {
|
||||||
this.$message.success('成功')
|
this.$message.success('成功')
|
||||||
|
this.getList()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updatestate()
|
|
||||||
{
|
|
||||||
alert(提交CTC还没有做)
|
|
||||||
},
|
|
||||||
rowClick(row, column, event){
|
rowClick(row, column, event){
|
||||||
this.formData = Object.assign({}, row);
|
this.formData = Object.assign({}, row);
|
||||||
console.log( this.formData)
|
console.log( this.formData)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-tabs type="border-card" v-model="activeName" >
|
<el-tabs type="border-card" >
|
||||||
|
|
||||||
<el-form ref="Form"
|
<el-form ref="Form"
|
||||||
:model="formData"
|
:model="formData"
|
||||||
|
@ -18,8 +18,8 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="生产企业" prop="">
|
<el-form-item label="生产企业" prop="enterprise_.name">
|
||||||
<el-input v-model="formData.certunit_.enterprise_.name" />
|
<el-input v-model="formData.enterprise_.name" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="单元描述" prop="ontactManTel">
|
<el-form-item label="单元描述" prop="certunit_.description">
|
||||||
<el-input v-model="formData.certunit_.description" />
|
<el-input v-model="formData.certunit_.description" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -55,7 +55,8 @@
|
||||||
type="date"
|
type="date"
|
||||||
placeholder="选择日期"
|
placeholder="选择日期"
|
||||||
format="yyyy 年 MM 月 dd 日"
|
format="yyyy 年 MM 月 dd 日"
|
||||||
value-format="yyyy-MM-dd":style="{width: '100%'}">
|
value-format="yyyy-MM-dd"
|
||||||
|
:style="{width: '100%'}">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -85,16 +86,8 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="检测状态" prop="inspectionstate">
|
<el-form-item label="检测状态" prop="inspectionstate">
|
||||||
<el-select placeholder="请选择检测状态" v-model="formData.inspectionstate" filterable allow-create :style="{width: '100%'}"
|
|
||||||
>
|
<el-input v-model="formData.inspectionstate" />
|
||||||
<el-option
|
|
||||||
v-for="(item, index) in inspectionOptions"
|
|
||||||
:key="index"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
:disabled="item.disabled"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
@ -180,8 +173,7 @@
|
||||||
issuancedate:undefined,
|
issuancedate:undefined,
|
||||||
conclusion:undefined,
|
conclusion:undefined,
|
||||||
resultremark:undefined,
|
resultremark:undefined,
|
||||||
remarks:undefined
|
remarks:undefined,
|
||||||
|
|
||||||
},
|
},
|
||||||
chargeOptions:[
|
chargeOptions:[
|
||||||
{
|
{
|
||||||
|
@ -194,21 +186,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
inspectionOptions:[
|
|
||||||
{
|
|
||||||
label: "待检测",
|
|
||||||
value: "待检测",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "在检测",
|
|
||||||
value: "在检测",
|
|
||||||
}
|
|
||||||
,
|
|
||||||
{
|
|
||||||
label: "已检测",
|
|
||||||
value: "已检测",
|
|
||||||
}
|
|
||||||
],
|
|
||||||
conclusionOptions:[
|
conclusionOptions:[
|
||||||
{
|
{
|
||||||
label: "合格",
|
label: "合格",
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="生产企业" prop="">
|
<el-form-item label="生产企业" prop="">
|
||||||
<el-input v-model="formData.certunit_.enterprise_.name" />
|
<el-input v-model="formData.enterprise_.name" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
import { getTestOrgList} from "@/api/laboratory"
|
import { getTestOrgList} from "@/api/laboratory"
|
||||||
import { getDictList } from "@/api/dict";
|
import { getDictList } from "@/api/dict";
|
||||||
import { getCertunitList } from "@/api/certunit";
|
import { getCertunitList } from "@/api/certunit";
|
||||||
import { getCertappunitList, testtaskCertappunit,teststateCertappunit } from "@/api/certappunit";
|
import { getCertappunitList, testtaskCertappunit,teststateCertappunit ,getTasklist} from "@/api/certappunit";
|
||||||
import Pagination from "@/components/Pagination";
|
import Pagination from "@/components/Pagination";
|
||||||
import checkPermission from "@/utils/permission";
|
import checkPermission from "@/utils/permission";
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
|
@ -135,8 +135,7 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
|
|
||||||
getCertappunitList({ pageoff:true,
|
getTasklist().then((response) => {
|
||||||
certapp:this.certapp}).then((response) => {
|
|
||||||
|
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.tableData = response.data;
|
this.tableData = response.data;
|
||||||
|
|
|
@ -28,19 +28,19 @@ class EnterpriseAddressSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = EnterpriseAddress
|
model = EnterpriseAddress
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
class EnterpriseSimpleSerializer(serializers.ModelSerializer):
|
||||||
|
class Meta:
|
||||||
|
model = Enterprise
|
||||||
|
fields = ['id', 'name']
|
||||||
|
|
||||||
class CertunitSerializer(serializers.ModelSerializer):
|
class CertunitSerializer(serializers.ModelSerializer):
|
||||||
standard_ = StandardSerializer(source='standard', read_only=True)
|
standard_ = StandardSerializer(source='standard', read_only=True)
|
||||||
enterprise_ = serializers.CharField(source='enterprise',read_only=True)
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Certunit
|
model = Certunit
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
||||||
class EnterpriseSimpleSerializer(serializers.ModelSerializer):
|
|
||||||
class Meta:
|
|
||||||
model = Enterprise
|
|
||||||
fields = ['id', 'name']
|
|
||||||
|
|
||||||
class CertunitSimpleSerializer(serializers.ModelSerializer):
|
class CertunitSimpleSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
|
@ -8,7 +8,7 @@ from apps.system.serializers import DictSerializer, UserSimpleSerializer, DictSi
|
||||||
from apps.certset.serializers import StandardSerializer
|
from apps.certset.serializers import StandardSerializer
|
||||||
from apps.plan.serializers import PlanSerializer
|
from apps.plan.serializers import PlanSerializer
|
||||||
from apps.laboratory.serializers import TestOrgSerializer
|
from apps.laboratory.serializers import TestOrgSerializer
|
||||||
|
from apps.crm.serializers import EnterpriseSimpleSerializer
|
||||||
# class ApplicationCreateSerializer(serializers.ModelSerializer):
|
# class ApplicationCreateSerializer(serializers.ModelSerializer):
|
||||||
# number = serializers.CharField(required=False)
|
# number = serializers.CharField(required=False)
|
||||||
# class Meta:
|
# class Meta:
|
||||||
|
@ -69,7 +69,7 @@ from apps.certificate.models import Certificate
|
||||||
class CertappunitSerializer(serializers.ModelSerializer):
|
class CertappunitSerializer(serializers.ModelSerializer):
|
||||||
certunit_ = CertunitSimpleSerializer(source = 'certunit', read_only=True)
|
certunit_ = CertunitSimpleSerializer(source = 'certunit', read_only=True)
|
||||||
decision_ = DictSimpleSerializer(source = 'decision', read_only=True)
|
decision_ = DictSimpleSerializer(source = 'decision', read_only=True)
|
||||||
|
enterprise_ = EnterpriseSimpleSerializer(source='certunit.enterprise',read_only=True)
|
||||||
testorg_ = TestOrgSerializer(source = 'testorg', read_only=True)
|
testorg_ = TestOrgSerializer(source = 'testorg', read_only=True)
|
||||||
|
|
||||||
certificate_ = serializers.SerializerMethodField()
|
certificate_ = serializers.SerializerMethodField()
|
||||||
|
@ -80,7 +80,7 @@ class CertappunitSerializer(serializers.ModelSerializer):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def setup_eager_loading(queryset):
|
def setup_eager_loading(queryset):
|
||||||
""" Perform necessary eager loading of data. """
|
""" Perform necessary eager loading of data. """
|
||||||
queryset = queryset.select_related('certunit','testorg','decision')
|
queryset = queryset.select_related('certunit','testorg','decision','certunit.enterprise')
|
||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
def get_certificate_(self, obj):
|
def get_certificate_(self, obj):
|
||||||
|
|
|
@ -14,6 +14,8 @@ from apps.system.permission_data import RbacFilterSet
|
||||||
from apps.system.mixins import CreateUpdateCustomMixin, OptimizationMixin
|
from apps.system.mixins import CreateUpdateCustomMixin, OptimizationMixin
|
||||||
import random
|
import random
|
||||||
from rest_framework.decorators import action
|
from rest_framework.decorators import action
|
||||||
|
|
||||||
|
from rest_framework.generics import ListAPIView
|
||||||
from .filters import *
|
from .filters import *
|
||||||
from utils.pagination import PageOrNot
|
from utils.pagination import PageOrNot
|
||||||
from rest_framework.exceptions import ParseError, NotAuthenticated
|
from rest_framework.exceptions import ParseError, NotAuthenticated
|
||||||
|
@ -226,7 +228,7 @@ class CertappunitViewset(PageOrNot, ModelViewSet):
|
||||||
perms_map={'get': '*', '*':'certapp_view'}
|
perms_map={'get': '*', '*':'certapp_view'}
|
||||||
queryset = Certappunit.objects.all()
|
queryset = Certappunit.objects.all()
|
||||||
serializer_class = CertappunitSerializer
|
serializer_class = CertappunitSerializer
|
||||||
filterset_fields = ['certapp','teststate']
|
filterset_fields = ['certapp','teststate','id','inspectionstate']
|
||||||
ordering= ['-id']
|
ordering= ['-id']
|
||||||
|
|
||||||
@action(methods=['put'], detail=True, perms_map={'put':'certapp_access'}, url_name='certappunit_access')
|
@action(methods=['put'], detail=True, perms_map={'put':'certapp_access'}, url_name='certappunit_access')
|
||||||
|
@ -259,6 +261,16 @@ class CertappunitViewset(PageOrNot, ModelViewSet):
|
||||||
obj.charge = request.data['charge']
|
obj.charge = request.data['charge']
|
||||||
obj.save()
|
obj.save()
|
||||||
return Response(status=status.HTTP_200_OK)
|
return Response(status=status.HTTP_200_OK)
|
||||||
|
@action(methods=['get'], detail=True, perms_map={'get':'certapp_testlist'}, url_name='certappunit_testlist')
|
||||||
|
def testlist(self, request, pk=None):
|
||||||
|
"""
|
||||||
|
实验室任务列表
|
||||||
|
"""
|
||||||
|
|
||||||
|
queryset = Certappunit.objects.filter(teststate__in=['待实验室检验', '到样检测中'])
|
||||||
|
return queryset
|
||||||
|
|
||||||
|
|
||||||
@action(methods=['put'], detail=True, perms_map={'put':'certapp_teststate'}, url_name='certappunit_teststate')
|
@action(methods=['put'], detail=True, perms_map={'put':'certapp_teststate'}, url_name='certappunit_teststate')
|
||||||
def teststate(self, request, pk=None):
|
def teststate(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
@ -283,6 +295,7 @@ class CertappunitViewset(PageOrNot, ModelViewSet):
|
||||||
"""
|
"""
|
||||||
obj = self.get_object()
|
obj = self.get_object()
|
||||||
obj.teststate = '到样检测中'
|
obj.teststate = '到样检测中'
|
||||||
|
obj.inspectionstate = "在检验"
|
||||||
obj.sampledate = request.data['sampledate']
|
obj.sampledate = request.data['sampledate']
|
||||||
obj.save()
|
obj.save()
|
||||||
return Response(status=status.HTTP_200_OK)
|
return Response(status=status.HTTP_200_OK)
|
||||||
|
@ -294,6 +307,7 @@ class CertappunitViewset(PageOrNot, ModelViewSet):
|
||||||
obj = self.get_object()
|
obj = self.get_object()
|
||||||
obj.teststate = '待提取报告'
|
obj.teststate = '待提取报告'
|
||||||
obj.path = request.data['path']
|
obj.path = request.data['path']
|
||||||
|
obj.inspectionstate = "已检验"
|
||||||
obj.conclusion = request.data['conclusion']
|
obj.conclusion = request.data['conclusion']
|
||||||
obj.completedate = request.data['completedate']
|
obj.completedate = request.data['completedate']
|
||||||
obj.issuancedate = request.data['issuancedate']
|
obj.issuancedate = request.data['issuancedate']
|
||||||
|
@ -302,6 +316,21 @@ class CertappunitViewset(PageOrNot, ModelViewSet):
|
||||||
obj.save()
|
obj.save()
|
||||||
return Response(status=status.HTTP_200_OK)
|
return Response(status=status.HTTP_200_OK)
|
||||||
|
|
||||||
|
class TaskList(ListAPIView):
|
||||||
|
"""
|
||||||
|
我的审核项目
|
||||||
|
"""
|
||||||
|
perms_map = {'get': 'myaudittask_view'}
|
||||||
|
serializer_class = ProjectSerializerX
|
||||||
|
filterset_class = ProjectFilter
|
||||||
|
search_fields = ['auditee__name', 'plan__name']
|
||||||
|
ordering=['-pk']
|
||||||
|
|
||||||
|
def get_queryset(self):
|
||||||
|
queryset = Project.objects.filter(certapp_project__member_certapp__user=self.request.user).distinct()
|
||||||
|
if hasattr(self.get_serializer_class(), 'setup_eager_loading'):
|
||||||
|
queryset = self.get_serializer_class().setup_eager_loading(queryset)
|
||||||
|
return queryset
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue