cert
This commit is contained in:
parent
23d2b81c51
commit
e62643b4e9
|
@ -8,6 +8,14 @@ export function getCertappunitList(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function accessCertappunit(id,data) {
|
||||||
|
return request({
|
||||||
|
url: `/project/certappunit/${id}/access/`,
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// export function createAccess(data) {
|
// export function createAccess(data) {
|
||||||
// return request({
|
// return request({
|
||||||
// url: '/accessment/certass/',
|
// url: '/accessment/certass/',
|
||||||
|
|
|
@ -244,12 +244,25 @@ export const asyncRoutes = [
|
||||||
name: 'CertificateManage',
|
name: 'CertificateManage',
|
||||||
meta: { title: '证书管理', icon: 'example'},
|
meta: { title: '证书管理', icon: 'example'},
|
||||||
children: [
|
children: [
|
||||||
|
{
|
||||||
|
path: 'issueindex',
|
||||||
|
name: 'issueindex',
|
||||||
|
component: () => import('@/views/certificate/issueindex'),
|
||||||
|
meta: { title: '证书颁发', icon: 'example', perms: ['certificate_issue'] }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'index',
|
path: 'index',
|
||||||
name: 'Certificate',
|
name: 'Certificate',
|
||||||
component: () => import('@/views/certificate/index'),
|
component: () => import('@/views/certificate/index'),
|
||||||
meta: { title: '证书管理', icon: 'example', perms: ['certificate_view'] }
|
meta: { title: '证书管理', icon: 'example', perms: ['certificate_view'] }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'certapp/:id/:action/',
|
||||||
|
name: 'Certissue',
|
||||||
|
component: () => import('@/views/certapp/certapphandle'),
|
||||||
|
meta: { title: '证书颁发', icon: 'example', perms: ['certificate_issue'] },
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column label="单元名称">
|
<el-table-column label="单元名称">
|
||||||
<template slot-scope="scope" >{{ scope.row.name }}</template>
|
<template slot-scope="scope" v-if="scope.row.certunit_">{{ scope.row.certunit_.name }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="证书信息">
|
<el-table-column label="证书信息">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
@ -83,38 +83,59 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="认证决定">
|
<el-table-column label="认证决定">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<!-- <el-button
|
<el-select
|
||||||
type="danger"
|
v-model="scope.row.decision"
|
||||||
size="small"
|
clearable
|
||||||
:disabled="!checkPermission(['certapps_update'])"
|
collapse-tags
|
||||||
@click="handleDelete(scope)"
|
:style="{width: '100%'}"
|
||||||
>删除</el-button> -->
|
@change="((val)=>{handleAcessunit(val, scope.row.id)})"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="(item, index) in decisionOptions"
|
||||||
|
:key="index"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
:disabled="item.disabled"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作">
|
<!-- <el-table-column label="操作">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<!-- <el-button
|
<el-button
|
||||||
type="danger"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
:disabled="!checkPermission(['certapps_update'])"
|
:disabled="!checkPermission(['certapp_access'])"
|
||||||
@click="handleDelete(scope)"
|
@click="handleAcessunit(scope)"
|
||||||
>删除</el-button> -->
|
>决定</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<!-- <el-dialog title="决定" :visible.sync="dialogVisible">
|
||||||
|
<el-select>
|
||||||
|
|
||||||
|
</el-select>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getDictList } from "@/api/dict"
|
import { getDictList } from "@/api/dict"
|
||||||
import { accessCertapp, getCertapp } from "@/api/certapp"
|
import { accessCertapp, getCertapp } from "@/api/certapp"
|
||||||
import { getCertappunitList } from "@/api/certappunit"
|
import { getCertappunitList, accessCertappunit } from "@/api/certappunit"
|
||||||
import { getCertunitList } from "@/api/certunit";
|
import { getCertunitList } from "@/api/certunit";
|
||||||
|
import checkPermission from "@/utils/permission";
|
||||||
export default {
|
export default {
|
||||||
name: "access",
|
name: "access",
|
||||||
props:['certapp'],
|
props:['certapp'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
dialogVisible:false,
|
||||||
listLoading: false,
|
listLoading: false,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
formData:{},
|
formData:{},
|
||||||
|
@ -143,6 +164,7 @@ export default {
|
||||||
},
|
},
|
||||||
conclusionOptions:[],
|
conclusionOptions:[],
|
||||||
nonOptions:[],
|
nonOptions:[],
|
||||||
|
decisionOptions:[],
|
||||||
tableUnitData: [],
|
tableUnitData: [],
|
||||||
listQuery:{
|
listQuery:{
|
||||||
pageoff:true,
|
pageoff:true,
|
||||||
|
@ -154,9 +176,16 @@ export default {
|
||||||
this.getConclusion()
|
this.getConclusion()
|
||||||
this.getOptions1()
|
this.getOptions1()
|
||||||
this.getOptions2()
|
this.getOptions2()
|
||||||
this.getUnitList();
|
this.getUnitList()
|
||||||
|
this.getDecisionOptions()
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
checkPermission,
|
||||||
|
getDecisionOptions() {
|
||||||
|
getDictList({type__code:'cert_decision', pageoff:true}).then(res=>{
|
||||||
|
this.decisionOptions = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
getConclusion() {
|
getConclusion() {
|
||||||
getCertapp(this.certapp).then(res=>{
|
getCertapp(this.certapp).then(res=>{
|
||||||
if(res.data){
|
if(res.data){
|
||||||
|
@ -176,12 +205,9 @@ export default {
|
||||||
},
|
},
|
||||||
getUnitList() {
|
getUnitList() {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
getCertappunitList(this.listQuery).then((response) => {
|
getCertappunitList(this.listQuery).then(res => {
|
||||||
|
if (res.data) {
|
||||||
if (response.data) {
|
this.tableUnitData = res.data;
|
||||||
|
|
||||||
this.tableUnitData = response.data;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
});
|
});
|
||||||
|
@ -193,6 +219,12 @@ export default {
|
||||||
this.$message.success('成功')
|
this.$message.success('成功')
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
handleAcessunit(val,id){
|
||||||
|
accessCertappunit(id, {'decision':val}).then(res=>{
|
||||||
|
this.$message.success('成功')
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -43,11 +43,14 @@
|
||||||
<el-tab-pane label="现场审核反馈" name="Certappfeedback" v-if="certapp" lazy>
|
<el-tab-pane label="现场审核反馈" name="Certappfeedback" v-if="certapp" lazy>
|
||||||
<Conclusion :certapp="certapp"></Conclusion>
|
<Conclusion :certapp="certapp"></Conclusion>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="安排检测任务" name="Certapptask" v-if="certapp" lazy>
|
||||||
|
<Detectiontask :certapp="certapp"></Detectiontask>
|
||||||
|
</el-tab-pane>
|
||||||
<el-tab-pane label="认证评定" name="Certappaccess" v-if="certapp" lazy>
|
<el-tab-pane label="认证评定" name="Certappaccess" v-if="certapp" lazy>
|
||||||
<access :certapp="certapp"></access>
|
<access :certapp="certapp"></access>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="安排检测任务" name="Certapptask" v-if="certapp" lazy>
|
<el-tab-pane label="证书颁发" name="Certissue" v-if="certapp" lazy>
|
||||||
<Detectiontask :certapp="certapp"></Detectiontask>
|
<issue :certapp="certapp"></issue>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -81,10 +84,11 @@ import QMSform from "@/views/certapp/qmsform"
|
||||||
import Conclusion from "@/views/audit/conclusion"
|
import Conclusion from "@/views/audit/conclusion"
|
||||||
import Member from "@/views/audit/member"
|
import Member from "@/views/audit/member"
|
||||||
import access from "@/views/accessment/access"
|
import access from "@/views/accessment/access"
|
||||||
|
import issue from "@/views/certificate/issue"
|
||||||
import REVIEW from "@/views/certapp/review"
|
import REVIEW from "@/views/certapp/review"
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: { CCCform, Certunit, QMSform, Conclusion, Member, access, CHARGE, REVIEW},
|
components: { CCCform, Certunit, QMSform, Conclusion, Member, access, CHARGE, REVIEW, issue},
|
||||||
|
|
||||||
props: [],
|
props: [],
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -1,49 +0,0 @@
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-card >
|
|
||||||
<div slot="header" class="clearfix">
|
|
||||||
<span>认证结果评价</span>
|
|
||||||
<el-button type="primary" >创建</el-button>
|
|
||||||
</div>
|
|
||||||
<el-table
|
|
||||||
ref="elTable"
|
|
||||||
v-loading="listLoading"
|
|
||||||
:data="tableData"
|
|
||||||
style="width: 100%;"
|
|
||||||
border
|
|
||||||
fit
|
|
||||||
stripe
|
|
||||||
highlight-current-row
|
|
||||||
>
|
|
||||||
<el-table-column label="评定表编号">
|
|
||||||
<template slot-scope="scope">{{ scope.row.number }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="工厂检查结论">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.conclusion }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="不符合项分类">
|
|
||||||
<template slot-scope="scope" >{{ scope.row.create_time }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="创建时间">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.create_time }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name:'access',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
listLoading:false,
|
|
||||||
tableData:[]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
|
|
@ -0,0 +1,136 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="tableUnitData"
|
||||||
|
style="width: 100%;"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
highlight-current-row
|
||||||
|
height="380"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<el-table-column label="单元名称">
|
||||||
|
<template slot-scope="scope" v-if="scope.row.certunit_">{{ scope.row.certunit_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="证书信息">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<!-- <el-button
|
||||||
|
type="danger"
|
||||||
|
size="small"
|
||||||
|
:disabled="!checkPermission(['certapps_update'])"
|
||||||
|
@click="handleDelete(scope)"
|
||||||
|
>删除</el-button> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="认证决定">
|
||||||
|
<template slot-scope="scope" v-if="scope.row.decision_">
|
||||||
|
{{ scope.row.decision_.name }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
:disabled="!checkPermission(['certificate_issue'])"
|
||||||
|
@click="handleIssue(scope)"
|
||||||
|
>发证</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<el-drawer
|
||||||
|
title="发证"
|
||||||
|
:visible.sync="drawerVisible"
|
||||||
|
direction="rtl"
|
||||||
|
:close-on-click-modal="false">
|
||||||
|
<span>我来啦!</span>
|
||||||
|
</el-drawer>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getDictList } from "@/api/dict"
|
||||||
|
import { accessCertapp, getCertapp } from "@/api/certapp"
|
||||||
|
import { getCertappunitList, accessCertappunit } from "@/api/certappunit"
|
||||||
|
import { getCertunitList } from "@/api/certunit";
|
||||||
|
import checkPermission from "@/utils/permission";
|
||||||
|
export default {
|
||||||
|
name: "issue",
|
||||||
|
props:['certapp'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
drawerVisible:false,
|
||||||
|
listLoading: false,
|
||||||
|
tableData: [],
|
||||||
|
formData:{},
|
||||||
|
rules:{
|
||||||
|
conclusion: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请选择",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
nonitems: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请选择",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
score: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
conclusionOptions:[],
|
||||||
|
nonOptions:[],
|
||||||
|
decisionOptions:[],
|
||||||
|
tableUnitData: [],
|
||||||
|
listQuery:{
|
||||||
|
pageoff:true,
|
||||||
|
certapp:this.certapp
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getUnitList()
|
||||||
|
this.getDecisionOptions()
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
checkPermission,
|
||||||
|
getDecisionOptions() {
|
||||||
|
getDictList({type__code:'cert_decision', pageoff:true}).then(res=>{
|
||||||
|
this.decisionOptions = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getConclusion() {
|
||||||
|
getCertapp(this.certapp).then(res=>{
|
||||||
|
if(res.data){
|
||||||
|
this.formData = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getUnitList() {
|
||||||
|
this.listLoading = true;
|
||||||
|
getCertappunitList(this.listQuery).then(res => {
|
||||||
|
if (res.data) {
|
||||||
|
this.tableUnitData = res.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleIssue(scope){
|
||||||
|
this.drawerVisible = true
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,180 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div style="display:flex">
|
||||||
|
<treeselect
|
||||||
|
v-model="listQuery.user__dept"
|
||||||
|
:multiple="false"
|
||||||
|
:options="deptOptions"
|
||||||
|
placeholder="所属组织"
|
||||||
|
:disable-branch-nodes="true"
|
||||||
|
@input="handleFilter"
|
||||||
|
style="width: 280px" clearable/>
|
||||||
|
|
||||||
|
<el-input
|
||||||
|
v-model="listQuery.search"
|
||||||
|
placeholder="姓名/易记码/编号/注册领域"
|
||||||
|
style="width: 300px;margin-left:10px"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="handleFilter"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleFilter"
|
||||||
|
>搜索</el-button>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh-left"
|
||||||
|
@click="resetFilter"
|
||||||
|
>刷新重置</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="tableData.results"
|
||||||
|
style="width: 100%;margin-top:10px;"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
highlight-current-row
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<el-table-column label="申请单号">
|
||||||
|
<template slot-scope="scope" v-if="scope.row.number">{{ scope.row.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="认证领域/分类">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag >{{scope.row.cert_field_.name}}</el-tag>
|
||||||
|
<el-tag v-if="scope.row.cccpv_class_" type="warning" style="margin:2px">{{scope.row.cccpv_class_.name}}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="申请信息" width="300px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div><span style="color:darkblue;font-weight:bold">申请方</span>:{{ scope.row.applicant_v.name }}</div>
|
||||||
|
<div v-if="scope.row.manufacture"><span style="color:darkblue;font-weight:bold">制造商</span>:{{ scope.row.manufacture_v.name }}</div>
|
||||||
|
<div v-if="scope.row.factory"><span style="color:darkblue;font-weight:bold">生产厂</span>:{{ scope.row.factory_v.name }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="当前状态">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.status}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建人">
|
||||||
|
<template slot-scope="scope">{{ scope.row.create_by_.name}}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建日期">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.create_time }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right">
|
||||||
|
<template slot-scope="scope" >
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
:disabled="!checkPermission(['certapp_accessment'])"
|
||||||
|
@click="handleIssue(scope)"
|
||||||
|
>颁发</el-button>
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
:disabled="!checkPermission(['certapp_detail'])"
|
||||||
|
@click="handleCertappDetail(scope)"
|
||||||
|
>详情</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="tableData.count>0"
|
||||||
|
:total="tableData.count"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.page_size"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getCertappList, deleteCertapp } from "@/api/certapp"
|
||||||
|
import { getOrgList } from "@/api/org"
|
||||||
|
import { getDictList } from "@/api/dict"
|
||||||
|
import Pagination from "@/components/Pagination"
|
||||||
|
import checkPermission from '@/utils/permission'
|
||||||
|
import Treeselect from '@riophae/vue-treeselect'
|
||||||
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
|
import { genTree } from '../../utils'
|
||||||
|
export default {
|
||||||
|
components: { Pagination, Treeselect },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableData: {count:0},
|
||||||
|
listLoading: true,
|
||||||
|
listQuery: {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20
|
||||||
|
},
|
||||||
|
deptOptions: [],
|
||||||
|
field_list:[]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
this.getdeptOptions()
|
||||||
|
this.getfields()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkPermission,
|
||||||
|
getList() {
|
||||||
|
this.listLoading = true;
|
||||||
|
getCertappList(this.listQuery).then(response => {
|
||||||
|
if (response.data) {
|
||||||
|
this.tableData = response.data
|
||||||
|
}
|
||||||
|
this.listLoading = false
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getdeptOptions() {
|
||||||
|
getOrgList().then(res=>{
|
||||||
|
this.deptOptions = genTree(res.data)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
resetFilter() {
|
||||||
|
this.listQuery = {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20
|
||||||
|
}
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
handleFilter() {
|
||||||
|
this.listQuery.page = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
getfields(){
|
||||||
|
getDictList({type__code:'cert_field'}).then(res=>{
|
||||||
|
let fields = []
|
||||||
|
for(var i=0;i<res.data.length;i++){
|
||||||
|
if(res.data[i].parent!=null){
|
||||||
|
fields.push({id:res.data[i].id, name:res.data[i].name, code:res.data[i].code})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.field_list = fields
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
handleCertappDetail(scope) {
|
||||||
|
this.$router.push({
|
||||||
|
name: "Certappdetail",
|
||||||
|
params: { id: scope.row.id },
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleIssue(scope) {
|
||||||
|
this.$router.push({
|
||||||
|
name: "Certissue",
|
||||||
|
params: { id: scope.row.id, action:'issue' },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -34,4 +34,9 @@ class CertunitSerializer(serializers.ModelSerializer):
|
||||||
enterprise = serializers.CharField(read_only=True)
|
enterprise = serializers.CharField(read_only=True)
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Certunit
|
model = Certunit
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
||||||
|
class CertunitSimpleSerializer(serializers.ModelSerializer):
|
||||||
|
class Meta:
|
||||||
|
model = Certunit
|
||||||
|
fields = ['id', 'name']
|
|
@ -3,7 +3,7 @@ from rest_framework import serializers
|
||||||
|
|
||||||
from .models import *
|
from .models import *
|
||||||
|
|
||||||
from apps.system.serializers import DictSerializer, UserSimpleSerializer
|
from apps.system.serializers import DictSerializer, UserSimpleSerializer, DictSimpleSerializer
|
||||||
from apps.certset.serializers import StandardSerializer
|
from apps.certset.serializers import StandardSerializer
|
||||||
from apps.plan.serializers import PlanSerializer
|
from apps.plan.serializers import PlanSerializer
|
||||||
|
|
||||||
|
@ -55,11 +55,21 @@ class CertappSerializer(serializers.ModelSerializer):
|
||||||
queryset = queryset.prefetch_related('cnas_scopes',)
|
queryset = queryset.prefetch_related('cnas_scopes',)
|
||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
|
from apps.crm.serializers import CertunitSimpleSerializer
|
||||||
class CertappunitSerializer(serializers.ModelSerializer):
|
class CertappunitSerializer(serializers.ModelSerializer):
|
||||||
|
certunit_ = CertunitSimpleSerializer(source = 'certunit', read_only=True)
|
||||||
|
decision_ = DictSimpleSerializer(source = 'decision', read_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Certappunit
|
model = Certappunit
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def setup_eager_loading(queryset):
|
||||||
|
""" Perform necessary eager loading of data. """
|
||||||
|
queryset = queryset.select_related('certunit','decision')
|
||||||
|
return queryset
|
||||||
|
|
||||||
class EvaluationDetailSerializer(serializers.ModelSerializer):
|
class EvaluationDetailSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = EvaluationDetail
|
model = EvaluationDetail
|
||||||
|
|
|
@ -168,7 +168,10 @@ class CertappunitViewset(PageOrNot, ListModelMixin, GenericViewSet):
|
||||||
单元评定
|
单元评定
|
||||||
"""
|
"""
|
||||||
obj = self.get_object()
|
obj = self.get_object()
|
||||||
obj.decision = Dict.objects.get(pk=request.data['decision'])
|
if request.data['decision']:
|
||||||
|
obj.decision = Dict.objects.get(pk=request.data['decision'])
|
||||||
|
else:
|
||||||
|
obj.decision = None
|
||||||
obj.save()
|
obj.save()
|
||||||
return Response(status=status.HTTP_200_OK)
|
return Response(status=status.HTTP_200_OK)
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,11 @@ class DictSerializer(serializers.ModelSerializer):
|
||||||
# return obj.code + obj.name
|
# return obj.code + obj.name
|
||||||
# return obj.name
|
# return obj.name
|
||||||
|
|
||||||
|
class DictSimpleSerializer(serializers.ModelSerializer):
|
||||||
|
class Meta:
|
||||||
|
model = Dict
|
||||||
|
fields = ['pk', 'name', 'code']
|
||||||
|
|
||||||
class PositionSerializer(serializers.ModelSerializer):
|
class PositionSerializer(serializers.ModelSerializer):
|
||||||
"""
|
"""
|
||||||
岗位序列化
|
岗位序列化
|
||||||
|
|
Loading…
Reference in New Issue