核对实验室模块

This commit is contained in:
shilixia 2020-10-30 15:06:22 +08:00
commit cc6b5edbec
57 changed files with 926 additions and 1057 deletions

View File

@ -77,3 +77,20 @@ export function flowCertapp(id) {
method: 'get',
})
}
export function bindCertapp(data) {
//与项目绑定
return request({
url: `/project/certapp/bind/`,
method: 'put',
data
})
}
export function unbindCertapp(id) {
//与项目解绑
return request({
url: `/project/certapp/${id}/unbind/`,
method: 'put',
})
}

View File

@ -159,7 +159,7 @@ export const asyncRoutes = [
path: 'certapp/:id/:action/',
name: 'Certappmember',
component: () => import('@/views/certapp/certapphandle'),
meta: { title: '派', icon: 'example', perms: ['plan_view'] },
meta: { title: '派', icon: 'example', perms: ['plan_view'] },
hidden: true
},
]
@ -303,6 +303,13 @@ export const asyncRoutes = [
meta: { title: '证书颁发', icon: 'example', perms: ['certificate_issue'] },
hidden: true
},
{
path: 'certapp/:id/issue/',
name: 'Certappissue',
component: () => import('@/views/certapp/certapphandle'),
meta: { title: '发证/通知', icon: 'example', perms: ['certapp_issue'] },
hidden: true
},
]
},
{
@ -319,12 +326,19 @@ export const asyncRoutes = [
meta: { title: '人员信息', icon: 'example', perms: ['employee_view'] }
},
{
path: 'employee/update/:id',
path: 'employee/:id/update',
name: 'EmployeeUpdate',
component: () => import('@/views/employee/employeeupdate'),
meta: { title: '人员信息变更', icon: 'example', perms: ['employee_update'] },
hidden: true
},
{
path: 'employee/:id/detail',
name: 'Employeedetail',
component: () => import('@/views/employee/employeeupdate'),
meta: { title: '人员信息详情', icon: 'example', perms: ['employee_detail'] },
hidden: true
},
// {
// path: 'qualification_',
// name: 'Qualification_',

View File

@ -103,9 +103,9 @@ body .el-table th.gutter{
.el-button+.el-button {
margin-left: 1px;
}
// .el-button {
// border-radius: 0px;
// }
.el-button {
border-radius: 2px;
}
.el-tabs__header {
margin: 0 0 6px;
}

View File

@ -30,17 +30,17 @@
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button>
>查询</el-button>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>刷新重置</el-button>
>重置</el-button>
</div>
<div style="margin-top:6px">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate">新增</el-button>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" v-if="$route.name=='EmployeeUpdate'">新增</el-button>
</div>
<el-table
v-loading="listLoading"

View File

@ -218,7 +218,7 @@ getDictList({type__code:'cert_decision', pageoff:true}).then(res=>{
if (!valid) return;
accessCertapp(this.certapp, this.formData).then((res) => {
this.$message.success('成功')
});
})
});
},
handleAcessunit(val,id){
@ -227,7 +227,7 @@ getDictList({type__code:'cert_decision', pageoff:true}).then(res=>{
this.formData.state = res.data.state
this.$emit("stateChange", res.data.state);
this.$emit("flowChange");
})
}).catch(()=>{this.getUnitList()})
}
}

View File

@ -26,7 +26,7 @@
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button>
>查询</el-button>
<el-button
class="filter-item"
type="primary"
@ -35,15 +35,19 @@
>刷新</el-button>
</el-col>
</el-row>
<el-card style="margin-top:6px">
<div slot="header" class="clearfix">
<span>待评定业务</span>
</div>
<el-table
v-loading="listLoading"
:data="tableData.results"
style="width: 100%;margin-top:10px;"
border
fit
stripe
highlight-current-row
height="320"
@row-click="handleRclick"
>
<el-table-column type="index" width="50" />
<el-table-column label="申请单号">
@ -99,6 +103,55 @@
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
</el-card>
<el-card style="margin-top:6px">
<div slot="header" class="clearfix">
<span>本业务认证单元</span>
</div>
<el-table
v-loading="listLoading2"
:data="tableData2"
border
fit
stripe
highlight-current-row
height="320"
>
<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" v-if="scope.row.certunit_">
{{scope.row.certunit_.description}}
</template>
</el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">
{{ scope.row.teststate}}
</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" v-if="scope.row.certificate_">{{ scope.row.certificate_.number}}</template>
</el-table-column>
<el-table-column label="操作" fixed="right">
<template slot-scope="scope" >
<el-button
v-if="scope.row.teststate=='待评定'"
type="primary"
size="small"
:disabled="!checkPermission(['certapp_accessment'])"
@click="handleAccessment2(scope)"
>评定</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
@ -110,15 +163,20 @@ import checkPermission from '@/utils/permission'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { genTree } from '../../utils'
import { getCertappunitList } from "@/api/certappunit"
export default {
components: { Pagination, Treeselect },
data() {
return {
nowCetapp:{},
tableData: {count:0},
listLoading: true,
tableData2: [],
listLoading: false,
listLoading2:false,
listQuery: {
page: 1,
page_size: 20
page_size: 20,
certappunit_certapp__teststate:'待评定'
},
deptOptions: [],
field_list:[]
@ -148,7 +206,8 @@ export default {
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20
page_size: 20,
certappunit_certapp__teststate:'待评定'
}
this.getList()
},
@ -179,7 +238,25 @@ this.$router.push({
name: "Certappaccess",
params: { id: scope.row.id, action:'access' },
});
}
},
handleAccessment2(scope) {
this.$router.push({
name: "Certappaccess",
params: { id: this.nowCetapp.id, action:'access' },
});
},
handleRclick(row, column, event) {
this.listLoading2 = true;
this.nowCetapp = {id:row.id,number:row.number}
getCertappunitList({ certapp: row.id, pageoff:true})
.then((res) => {
this.tableData2 = res.data;
this.listLoading2 = false;
})
.catch((e) => {
this.listLoading2 = false;
});
},
}
};
</script>

View File

@ -44,13 +44,13 @@
icon="el-icon-search"
@click="handleFilter"
style="margin-left:10px"
>搜索</el-button>
>查询</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>刷新重置</el-button>
>重置</el-button>
</div>
<div style="margin-top:6px">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" >认证申请</el-button>

View File

@ -47,7 +47,6 @@
</el-table-column>
<el-table-column label="操作" width="300">
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
size="small"
@ -60,7 +59,6 @@
:disabled="!checkPermission(['plan_delete'])"
@click="handleDeletePlan(scope)"
>删除</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
@ -122,7 +120,6 @@
</el-table-column>
<el-table-column label="操作" width="300" fixed="right">
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
size="small"
@ -135,7 +132,6 @@
:disabled="!checkPermission(['project_delete'])"
@click="handleDetailProject(scope)"
>详情</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>

View File

@ -40,9 +40,8 @@
<template slot-scope="scope">{{ scope.row.days }}</template>
</el-table-column>
</el-table>
<el-row :gutter="6">
<el-col :xs="24" :md="12">
<el-card style="margin-top:6px" v-if="$route.params.action=='member'">
<el-row style="margin-top:6px">
<el-card v-if="$route.params.action=='member'">
<div slot="header" class="clearfix">
<span>成员配置</span>
</div>
@ -97,9 +96,9 @@
</el-row>
</el-form>
</el-card>
</el-col>
<el-col :xs="24" :md="12">
<el-card style="margin-top:6px" v-if="this.$route.name=='Certappfeedback' || this.$route.name=='Certapptest'">
</el-row>
<el-row style="margin-top:6px">
<el-card v-if="this.$route.name=='Certappfeedback' || this.$route.name=='Certapptest'">
<div slot="header" class="clearfix">
<span>审核员参与天数/人日数</span>
</div>
@ -141,7 +140,6 @@
</el-row>
</el-form>
</el-card>
</el-col>
</el-row>
<el-dialog
title="选择组员"

View File

@ -28,7 +28,7 @@
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button
>查询</el-button
>
<el-button
class="filter-item"
@ -97,7 +97,7 @@
<span>{{ scope.row.create_time }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="260">
<el-table-column label="操作" width="260">
<template slot-scope="scope">
<el-button
v-if="scope.row.state == '审核任务已接受'"
@ -222,7 +222,7 @@
<span>{{ scope.row.create_time }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="260">
<el-table-column label="操作" width="260">
<template slot-scope="scope">
<el-button
type="primary"

View File

@ -23,7 +23,7 @@
icon="el-icon-search"
@click="handleFilter"
style="margin-left:2px"
>搜索</el-button>
>查询</el-button>
<el-button
class="filter-item"
type="primary"
@ -87,7 +87,7 @@
@click="handleUpdate(scope)"
>编辑</el-button>
<el-button
v-if="scope.row.state=='申请'"
type="danger"
size="small"
:disabled="!checkPermission(['certapp_delete'])"

View File

@ -1,37 +1,8 @@
<template>
<div class="app-container">
<div style="display:flex">
<treeselect
v-model="listQuery.cert_field"
:multiple="false"
:options="fieldOptions"
placeholder="所属领域"
:default-expand-level="1"
:disable-branch-nodes="true"
@input="handleFilter"
style="width: 280px" clearable/>
<el-input
v-model="listQuery.search"
placeholder="姓名/易记码/编号/注册领域"
style="width: 300px;margin-left:2px"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
style="margin-left:2px"
>搜索</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置</el-button>
</div>
<div>
<el-button type="primary" @click="appendChose" size="mini">添加选中</el-button>
<el-table
ref="cTable"
v-loading="listLoading"
:data="tableData.results"
style="width: 100%;margin-top:6px;"
@ -39,9 +10,9 @@
fit
stripe
highlight-current-row
max-height="600"
max-height="400"
>
<el-table-column type="index" width="50" />
<el-table-column type="selection" width="50" />
<el-table-column label="申请单号">
<template slot-scope="scope" v-if="scope.row.number">{{ scope.row.number }}</template>
</el-table-column>
@ -109,7 +80,7 @@ export default {
},
created() {
this.getList()
this.getfields()
// this.getfields()
},
methods: {
checkPermission,
@ -167,6 +138,18 @@ deleteCertapp(scope.row.id).then(res=>{
})
},
appendChose(){
var selects = this.$refs.cTable.selection
if(selects.length==0){
this.$message.warning('未选择记录')
}else{
var selectIds = []
for(var i=0;i<selects.length;i++){
selectIds.push(selects[i].id)
}
this.$emit('handleChose', selectIds)
}
}
}
};
</script>

View File

@ -39,7 +39,7 @@
<Conclusion :certapp="certapp" @stateChange="stateChange" @flowChange="flowChange"></Conclusion>
</el-tab-pane>
<el-tab-pane label="检测任务" name="Certapptest" v-if="certapp" lazy>
<Detectiontask :certapp="certapp"></Detectiontask>
<Detectiontask :certapp="certapp" @stateChange="stateChange" @flowChange="flowChange"></Detectiontask>
</el-tab-pane>
<el-tab-pane label="认证评定" name="Certappaccess" v-if="certapp" lazy>
<access :certapp="certapp" :key="Certappaccesskey" @stateChange="stateChange" @flowChange="flowChange"></access>

View File

@ -1,18 +1,18 @@
<template>
<div id="print">
<el-form ref="elForm" :model="formData" size="medium" label-width="70px">
<el-form ref="elForm" :model="formData" size="medium" >
<el-row :gutter="12">
<el-col>
<el-table id="evl"
ref="multipleTable"
:data="eltList"
style="width: 100%;margin-top:10px;"
style="width: 100%;"
border
fit
highlight-current-row
max-height="600">
<el-table-column align="center" label="项目内容" width="750">
<el-table-column align="center" label="项目内容">
<template slot-scope="scope">
<span v-if="scope.row.item">{{ scope.row.item_v }}</span>
<span v-else>{{ scope.row.content }}</span>

View File

@ -26,7 +26,7 @@
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button>
>查询</el-button>
<el-button
class="filter-item"
type="primary"

View File

@ -14,6 +14,9 @@
<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" >{{ scope.row.teststate }}</template>
</el-table-column>
<el-table-column label="认证决定">
<template slot-scope="scope" v-if="scope.row.decision_">
{{ scope.row.decision_.name }}

View File

@ -1,6 +1,7 @@
<template>
<div class="app-container">
<div style="display:flex">
<el-row :gutter="6">
<el-col :xs="24" :md="4">
<treeselect
v-model="listQuery.user__dept"
:multiple="false"
@ -8,37 +9,45 @@
placeholder="所属组织"
:disable-branch-nodes="true"
@input="handleFilter"
style="width: 280px" clearable/>
style="width: 100%" clearable/>
</el-col>
<el-col :xs="24" :md="4">
<el-input
v-model="listQuery.search"
placeholder="姓名/易记码/编号/注册领域"
style="width: 300px;margin-left:10px"
style="width: 100%"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
</el-col>
<el-col :xs="24" :md="4">
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button>
>查询</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>刷新重置</el-button>
>重置</el-button>
</el-col>
</el-row>
<el-card style="margin-top:6px">
<div slot="header" class="clearfix">
<span>待处理业务</span>
</div>
<el-table
v-loading="listLoading"
:data="tableData.results"
style="width: 100%;margin-top:10px;"
border
fit
stripe
highlight-current-row
height="320"
@row-click="handleRclick"
>
<el-table-column type="index" width="50" />
<el-table-column label="申请单号">
@ -75,9 +84,9 @@
<el-button
type="primary"
size="small"
:disabled="!checkPermission(['certapp_accessment'])"
:disabled="!checkPermission(['certificate_issue'])"
@click="handleIssue(scope)"
></el-button>
>/通知</el-button>
<el-button
size="small"
:disabled="!checkPermission(['certapp_detail'])"
@ -94,6 +103,55 @@
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
</el-card>
<el-card style="margin-top:6px">
<div slot="header" class="clearfix">
<span>本业务认证单元</span>
</div>
<el-table
v-loading="listLoading2"
:data="tableData2"
border
fit
stripe
highlight-current-row
height="320"
>
<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" v-if="scope.row.certunit_">
{{scope.row.certunit_.description}}
</template>
</el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">
{{ scope.row.teststate}}
</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" v-if="scope.row.certificate_">{{ scope.row.certificate_.number}}</template>
</el-table-column>
<el-table-column label="操作" fixed="right">
<template slot-scope="scope" >
<el-button
v-if="scope.row.teststate=='已评定'"
type="primary"
size="small"
:disabled="!checkPermission(['certificate_issue'])"
@click="handleIssue2(scope)"
>发证/通知</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
@ -105,15 +163,20 @@ import checkPermission from '@/utils/permission'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { genTree } from '../../utils'
import { getCertappunitList } from "@/api/certappunit"
export default {
components: { Pagination, Treeselect },
data() {
return {
nowCetapp:{},
tableData: {count:0},
listLoading: true,
tableData2: [],
listLoading: false,
listLoading2:false,
listQuery: {
page: 1,
page_size: 20
page_size: 20,
certappunit_certapp__teststate:'已评定'
},
deptOptions: [],
field_list:[]
@ -143,7 +206,8 @@ export default {
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20
page_size: 20,
certappunit_certapp__teststate:'待评定'
}
this.getList()
},
@ -171,10 +235,28 @@ this.$router.push({
},
handleIssue(scope) {
this.$router.push({
name: "Certissue",
name: "Certappissue",
params: { id: scope.row.id, action:'issue' },
});
}
},
handleIssue2(scope) {
this.$router.push({
name: "Certappissue",
params: { id: this.nowCetapp.id, action:'issue' },
});
},
handleRclick(row, column, event) {
this.listLoading2 = true;
this.nowCetapp = {id:row.id,number:row.number}
getCertappunitList({ certapp: row.id, pageoff:true})
.then((res) => {
this.tableData2 = res.data;
this.listLoading2 = false;
})
.catch((e) => {
this.listLoading2 = false;
});
},
}
};
</script>

View File

@ -1,7 +1,7 @@
<template>
<div class="app-container">
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate">新增</el-button>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" v-if="$route.name=='EmployeeUpdate'">新增</el-button>
</div>
<el-table
v-loading="listLoading"

View File

@ -44,13 +44,13 @@
icon="el-icon-search"
@click="handleFilter"
style="margin-left:10px"
>搜索</el-button>
>查询</el-button>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>刷新重置</el-button>
>重置</el-button>
</div>
<!-- <div style="margin-top:6px">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate">新增</el-button>

View File

@ -216,7 +216,7 @@
</el-col>
</el-row>
<el-form-item size="large">
<el-button type="primary" @click="submitForm">保存</el-button>
<el-button v-if="$route.name=='EmployeeUpdate'" type="primary" @click="submitForm" >保存</el-button>
<el-button @click="goBack">返回</el-button>
</el-form-item>
</el-form>

View File

@ -1,16 +1,16 @@
<template>
<div class="app-container">
<el-tabs type="border-card" >
<el-tab-pane label="详细信息" style="height:700px;overflow-y:auto;overflow-x:hidden;">
<el-tab-pane label="详细信息" >
<Employeedetail :id="employee"></Employeedetail>
</el-tab-pane>
<el-tab-pane label="注册资格" style="height:700px;overflow-y:auto;overflow-x:hidden;">
<el-tab-pane label="注册资格" lazy>
<Qualification :employee="employee"></Qualification>
</el-tab-pane>
<el-tab-pane label="专业能力" style="height:700px;overflow-y:auto;overflow-x:hidden;">
<el-tab-pane label="专业能力" lazy>
<Ability :employee="employee"></Ability>
</el-tab-pane>
<el-tab-pane label="教育经历" style="height:700px;overflow-y:auto;overflow-x:hidden;">
<el-tab-pane label="教育经历" lazy>
<Education :employee="employee"></Education>
</el-tab-pane>
</el-tabs>

View File

@ -7,11 +7,12 @@
:multiple="false"
:options="deptOptions"
placeholder="所属组织"
:default-expand-level="1"
:disable-branch-nodes="true"
@input="handleFilter"
clearable/>
</el-col>
<el-col :xs="24" :md="2">
<el-col :xs="24" :md="4">
<el-select
v-model="listQuery.is_fulltime"
placeholder="是否全职"
@ -33,20 +34,18 @@
/>
</el-col>
<el-col :xs="24" :md="4">
<el-button-group>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button>
></el-button>
<el-button
class="filter-item"
type="warning"
icon="el-icon-refresh-left"
@click="resetFilter"
>刷新重置</el-button>
</el-button-group>
></el-button>
</el-col>
</el-row>
<el-table
@ -91,18 +90,16 @@
</el-table-column>
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
size="small"
@click="handleChose(scope)"
>选中</el-button>
<el-button
type="info"
type="plain"
size="small"
@click="handleDelete(scope)"
@click="handleDetail(scope)"
>详情</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
@ -161,6 +158,9 @@ export default {
this.deptOptions = genTree(res.data)
})
},
handleDetail(scope) {
this.$router.push({name:"Employeedetail", params:{id:scope.row.id}})
},
resetFilter() {
this.listQuery = {
page: 1,

View File

@ -10,12 +10,12 @@
<el-button class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter">搜索</el-button>
@click="handleFilter">查询</el-button>
<el-button class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter">刷新重置</el-button>
@click="resetFilter">重置</el-button>
</div>
<div style="margin-top:6px">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate">新增</el-button>

View File

@ -10,7 +10,7 @@
<el-button class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter">搜索</el-button>
@click="handleFilter">查询</el-button>
<el-button class="filter-item"
type="primary"
icon="el-icon-refresh-left"

View File

@ -29,14 +29,14 @@
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button>
>查询</el-button>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>刷新重置</el-button>
>重置</el-button>
</div>
<div style="margin-top:6px">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate">新增</el-button>

View File

@ -1,533 +0,0 @@
<template>
<div class="app-container">
<el-row :gutter="6">
<el-col :xs="24" :md="8">
<el-card class="box-card" style="overflow-y:auto;overflow-x:hidden;height:200px">
<div slot="header" class="clearfix">
<span>受审核方</span>
<el-button style="float: right; padding: 0px 0" type="text">更多企业信息</el-button>
</div>
<div class="item">{{auditee.name}}</div>
<div v-for="item in auditee.address_" :key="item.id" class="text item">
<span class="span">{{item.type}}</span>
{{item.address}}
</div>
<div class="text item">
<span class="span">常用联系人</span>
{{auditee.linkman1_name}}/{{auditee.linkman1_duty}}/{{auditee.linkman1_mobile}}
</div>
<div class="text item">
<span class="span">备用联系人</span>
{{auditee.linkman2_name}}/{{auditee.linkman2_duty}}/{{auditee.linkman2_mobile}}
</div>
</el-card>
</el-col>
<el-col :xs="24" :md="16">
<el-card class="box-card" style="overflow-y:auto;overflow-x:hidden;height:200px">
<div slot="header" class="clearfix">
<span>项目信息</span>
</div>
<div class="text item">
<span class="span">项目号</span>
{{project.number}}
<span class="span" >所属计划</span>
<span v-if="project.plan_">{{project.plan_.name}}</span>
<span v-else>暂无</span>
</div>
<div class="text item">
<span class="span">项目概况</span>
<el-tag
v-for="(item, index) in project.certapps"
:key="index"
style="margin:2px;font-size:12px"
>{{item}}</el-tag>
</div>
<div class="text item">
<span class="span">当前状态</span>
{{project.state}}
</div>
<div class="text item" v-if="project.assign_by_">
<span class="span">下达人</span>
{{project.assign_by_.name}}
</div>
<div class="text2 item">
<!-- <el-switch
style="display: block"
v-model="can_paichai"
active-color="#13ce66"
inactive-color="#FF0000"
active-text="是否可派差">
</el-switch>-->
<el-checkbox v-model="can_paichai" border @change="handlePaichai">可派差</el-checkbox>
</div>
</el-card>
</el-col>
</el-row>
<el-row style="margin-top:6px">
<el-col>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>业务信息</span>
</div>
<el-table
ref="projectTable"
v-loading="listLoading"
:data="certappData"
style="width: 100%;"
border
fit
stripe
highlight-current-row
max-height="300"
>
<el-table-column label="单号">
<template slot-scope="scope" v-if="scope.row.number">{{ scope.row.number }}</template>
</el-table-column>
<el-table-column label="认证领域/分类" width="300px">
<template slot-scope="scope">
<el-tag v-if="scope.row.cert_field_">{{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.state}}</template>
</el-table-column>
<el-table-column label="受理/确认人">
<template
slot-scope="scope"
v-if="scope.row.accept_by_"
>{{ scope.row.accept_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="操作" width="300">
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
size="small"
:disabled="!checkPermission(['certapp_detail'])"
@click="handleDetail(scope)"
>详情</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
<el-row :gutter="6" style="margin-top:6px">
<el-col :xs="24" :md="9">
<el-card class="box-card" style="overflow-y:auto;overflow-x:hidden;">
<div slot="header" class="clearfix">
<span>联系记录</span>
</div>
<el-table
ref="projectTable"
v-loading="listLoading"
:data="contactData"
style="width: 100%;"
border
fit
stripe
highlight-current-row
height="200"
>
<el-table-column label="联系时间">
<template slot-scope="scope">{{ scope.row.contact_date }}</template>
</el-table-column>
<el-table-column label="内容" >
<template slot-scope="scope">{{ scope.row.content }}</template>
</el-table-column>
<el-table-column label="操作人">
<template slot-scope="scope">{{ scope.row.create_by_.name }}</template>
</el-table-column>
</el-table>
<el-row :gutter="10">
<el-col :xs="24" :md="12">
<el-form
ref="elForm"
:model="formData"
:rules="rules"
size="medium"
label-width="80px"
style="margin-top:2px"
label-position="left"
>
<el-row>
<el-col>
<el-form-item label="联系时间" prop="contact_date">
<el-date-picker
v-model="formData.contact_date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
:style="{width: '100%'}"
placeholder="联系时间"
clearable
></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="内容" prop="content">
<el-input
v-model="formData.content"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<div style="text-align:right;">
<el-button-group>
<el-button type="primary" @click="createNewRecord" size="mini">创建新记录</el-button>
<!-- <el-button type="primary" @click="updateNowRecord" size="mini">保存</el-button> -->
<el-button @click="resetForm" size="mini">重置</el-button>
</el-button-group>
</div>
</el-row>
</el-form>
</el-col>
<el-col :xs="24" :md="12">
<el-row>
<el-card shadow="never" style="margin-top:2px">
<div slot="header" class="clearfix">
<span>常用语</span>
</div>
<el-tag
v-for="(item, index) in useditems"
:key="index"
@click.native="handleClickTag(item)"
style="margin:2px;font-size:12px"
>{{item}}</el-tag>
</el-card>
</el-row>
</el-col>
</el-row>
</el-card>
</el-col>
<el-col :xs="24" :md="15">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>审核组成员</span>
</div>
<el-table
ref="memberTable"
v-loading="listLoading"
:data="memberData"
style="width: 100%;"
border
fit
stripe
highlight-current-row
height="200"
@row-click="handleMClick"
>
<el-table-column label="姓名">
<template slot-scope="scope">{{ scope.row.user_.name }}</template>
</el-table-column>
<el-table-column label="是否组长" >
<template slot-scope="scope">
<i class="el-icon-circle-check" v-if="scope.row.is_leader" style="color:green;"></i>
</template>
</el-table-column>
<el-table-column label="身份" >
<template slot-scope="scope" v-if="scope.row.identity">{{ scope.row.identity_.name }}</template>
</el-table-column>
</el-table>
<el-form ref="elForm2" :model="formDataMember" label-width="80px" label-position="right" :rules="rules2" style="margin-top:2px">
<el-col :xs="24" :md="12">
<el-form-item label="成员" prop="user" >
<el-input placeholder="请选择成员" readonly clearable v-model="formDataMember.user_.name">
<el-button slot="append" icon="el-icon-search" @click="choseMember"></el-button>
</el-input>
</el-form-item>
</el-col>
<el-col :xs="24" :md="12">
<el-form-item prop="is_leader">
<el-checkbox v-model="formDataMember.is_leader">组长</el-checkbox>
</el-form-item>
</el-col>
<el-col :xs="24" :md="12">
<el-form-item label="身份" prop="identity">
<el-select v-model="formDataMember.identity" placeholder="请选择">
<el-option
v-for="item in identityOptions"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-form>
<div style="text-align:right;">
<el-button-group>
<el-button type="primary" @click="appendNewM" size="mini">添加新成员</el-button>
<el-button type="warning" @click="updateNowM" size="mini">保存</el-button>
<el-button @click="resetForm2" size="mini">重置</el-button>
</el-button-group>
</div>
</el-card>
</el-col>
</el-row>
<el-dialog
title="选择组员"
:visible.sync="choseVisiable"
:close-on-click-modal="false"
width="80%"
:append-to-body="true"
>
<Userchose ref="Userchose" :queryData="queryData" @handleChose="choseComplete"></Userchose>
</el-dialog>
</div>
</template>
<style scoped>
.text {
font-size: 15px;
}
.el-checkbox__label {
font-size: 18px;
}
.item {
margin-bottom: 4px;
}
.span {
color: gray;
font-weight: bold;
}
</style>
<script>
import { getDictList } from "@/api/dict"
import { getCertappList } from "@/api/certapp";
import { getEnterprise } from "@/api/enterprise";
import { getProject, updateProject } from "@/api/project";
import { getContactRecordList, createContactRecord } from "@/api/plan";
import Pagination from "@/components/Pagination";
import checkPermission from "@/utils/permission";
import Userchose from "@/views/employee/userchose"
import { getMemberList, createMember, updateMember, deleteMember} from "@/api/member"
import { genTree, deepClone } from '@/utils'
export default {
components: { Pagination, Userchose },
props: [],
data() {
return {
auditee: {},
project: { assign_by_: null },
certappData: [],
contactData: [],
memberData:[],
can_paichai: false,
formData: {
content: "",
project: this.$route.query.project,
},
rules: {
contact_date: [
{
required: true,
message: "请选择日期",
trigger: "change",
},
],
content: [
{
required: true,
message: "请输入内容",
trigger: "change",
},
],
},
useditems: [
"可以,第一联系人",
"可以,第二联系人",
"不可以",
"C类企业飞行检查",
],
formDataMember:{
user:null,
user_:{},
is_leader:false,
project:this.$route.query.project
},
rules2:{
user: [
{
required: true,
message: "请选择组员",
trigger: "change",
},
],
},
choseVisiable:false,
queryData:{},
identityOptions:[]
};
},
computed: {},
watch: {},
created() {
this.getParams();
this.getMemberList_()
this.getCertappList_();
this.getContactRecordList_();
this.getIdOptions();
},
mounted() {},
methods: {
checkPermission,
getParams() {
getProject(this.$route.query.project).then((res) => {
this.project = res.data;
this.can_paichai = this.project.can_paichai;
}).then(()=>{
getEnterprise(this.project.auditee).then((res) => {
this.auditee = res.data;
})
})
},
getCertappList_() {
this.listLoading = true;
getCertappList({
project: this.$route.query.project,
pageoff: true,
}).then((res) => {
if (res.data) {
this.certappData = res.data;
}
this.listLoading = false;
});
},
getIdOptions(){
getDictList({type__code:'auditor_teamrole',pageoff:true}).then(res=>{
this.identityOptions = res.data
})
},
getContactRecordList_() {
getContactRecordList({
pageoff: true,
project: this.$route.query.project,
}).then((res) => {
this.contactData = res.data;
});
},
getMemberList_(){
getMemberList({project:this.$route.query.project, pageoff:true}).then(res=>{
this.memberData = res.data
})
},
submitForm() {
this.$refs["elForm"].validate((valid) => {
if (!valid) return;
// TODO 提交表单
});
},
resetForm() {
this.$refs["elForm"].resetFields();
},
resetForm2() {
this.$refs["elForm2"].resetFields();
this.formDataMember.user_ = {}
},
handleDetail() {},
handleClickTag(val) {
this.formData.content = val;
},
createNewRecord() {
createContactRecord(this.formData).then((rse) => {
this.$message.success("成功");
this.getContactRecordList_();
});
},
// contactClick(scope) {
// this.formData.scope
// },
handlePaichai(val) {
if (val) {
this.$confirm("确定标记为可派差?", "提示", {})
.then(() => {
updateProject(this.$route.query.project, {
can_paichai: true,
}).then((res) => {
this.$message.success("成功");
});
})
.catch((res) => {
this.can_paichai = false;
});
} else {
this.$confirm("取消派差标记?", "警告", { type: "warning" })
.then(() => {
this.$message.success("未写接口");
this.can_paichai = true;
})
.catch((res) => {
this.can_paichai = true;
});
}
},
choseMember(){
this.choseVisiable = true
},
appendNewM(){
this.$refs["elForm2"].validate((valid) => {
if (!valid) return;
// TODO 提交表单
createMember(this.formDataMember).then(res=>{
this.$message.success('成功')
this.getMemberList_()
})
});
},
updateNowM(){
if(this.formDataMember.id){
updateMember(this.formDataMember.id, this.formDataMember).then(res=>{
this.$message.success('成功')
this.getMemberList_()
})
}
},
choseComplete(val){
if(val){
this.formDataMember.user = val.user_.id
this.formDataMember.user_.name = val.user_.name
}
this.choseVisiable = false
},
handleMClick(row,c,e){
this.formDataMember = deepClone(row)
}
},
};
</script>

View File

@ -47,7 +47,6 @@
</el-table-column>
<el-table-column label="操作" width="300">
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
size="small"
@ -60,7 +59,6 @@
:disabled="!checkPermission(['plan_delete'])"
@click="handleDeletePlan(scope)"
>删除</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
@ -122,7 +120,6 @@
</el-table-column>
<el-table-column label="操作" width="300" fixed="right">
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
size="small"
@ -135,7 +132,6 @@
:disabled="!checkPermission(['project_delete'])"
@click="handleDetailProject(scope)"
>详情</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>

View File

@ -29,22 +29,20 @@
</el-table-column>
<el-table-column label="操作" width="120">
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
size="small"
size="mini"
:disabled="!checkPermission(['plan_update'])"
@click="handleUpdatePlan(scope)"
icon="el-icon-edit"
></el-button>
<el-button
type="danger"
size="small"
size="mini"
:disabled="!checkPermission(['plan_delete'])"
@click="handleDeletePlan(scope)"
icon="el-icon-delete"
></el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
@ -100,29 +98,11 @@
<el-table-column label="创建人">
<template slot-scope="scope">{{ scope.row.create_by_.name}}</template>
</el-table-column>
<el-table-column label="创建日期" width="190">
<el-table-column label="创建日期" >
<template slot-scope="scope">
<span>{{ scope.row.create_time }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="操作" width="200" fixed="right">
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
size="small"
:disabled="!checkPermission(['project_update'])"
@click="planProject(scope)"
>联系企业</el-button>
<el-button
type="danger"
size="small"
:disabled="!checkPermission(['project_delete'])"
@click="handleDetailProject(scope)"
>详情</el-button>
</el-button-group>
</template>
</el-table-column>-->
</el-table>
<pagination
v-show="projectData.count>0"
@ -180,14 +160,13 @@
<el-table-column label="创建人">
<template slot-scope="scope">{{ scope.row.create_by_.name}}</template>
</el-table-column>
<el-table-column label="创建日期" width="190">
<el-table-column label="创建日期" >
<template slot-scope="scope">
<span>{{ scope.row.create_time }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="300" fixed="right">
<el-table-column label="操作" width="260" fixed="right">
<template slot-scope="scope">
<el-button-group>
<el-button
v-if="scope.row.state =='策划中'"
type="primary"
@ -197,7 +176,7 @@
>计划</el-button>
<el-button
v-if="scope.row.state =='策划中'"
type="primary"
type="plain"
size="small"
:disabled="!checkPermission(['project_assgin'])||!scope.row.can_paichai"
@click="assginProject(scope)"
@ -207,7 +186,6 @@
:disabled="!checkPermission(['project_delete'])"
@click="handleDetailProject(scope)"
>详情</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>

View File

@ -2,7 +2,10 @@
<div class="app-container">
<el-row :gutter="6">
<el-col :xs="24" :md="16">
<el-card class="box-card" style="overflow-y:auto;overflow-x:hidden;height:200px">
<el-card
class="box-card"
style="overflow-y: auto; overflow-x: hidden; height: 200px"
>
<div slot="header" class="clearfix">
<span>项目信息</span>
</div>
@ -33,15 +36,27 @@
</div>
<div class="text item" v-if="project.edate0">
<span class="span">预计审核时间</span>
{{edate_[0].substring(0,16)}} -{{edate_[1].substring(0,16)}}
{{ edate_[0].substring(0, 16) }} -{{
edate_[1].substring(0, 16)
}}
</div>
<div class="text item" v-if="project.start_date">
<span class="span">实际审核时间</span>
{{ project.start_date.substring(0, 16) }}
<span v-if="project.end_date">-{{project.end_date.substring(0,16)}}</span>
<span v-if="project.end_date"
>-{{ project.end_date.substring(0, 16) }}</span
>
</div>
<div class="text2 item" v-if="$route.name=='PlanProject' && project.state == '策划中'">
<el-checkbox v-model="can_paichai" border @change="handlePaichai">可派差</el-checkbox>
<div
class="text2 item"
v-if="$route.name == 'PlanProject' && project.state == '策划中'"
>
<el-checkbox
v-model="can_paichai"
border
@change="handlePaichai"
>可派差</el-checkbox
>
</div>
</el-card>
</el-col>
@ -67,7 +82,9 @@
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleEdate">保存</el-button>
<el-button type="primary" @click="handleEdate"
>保存</el-button
>
</el-form-item>
</el-form>
<el-form
@ -79,6 +96,7 @@
<el-form-item label="开始时间">
<el-date-picker
v-model="start_date"
type="datetime"
placeholder="开始审核"
format="yyyy-MM-dd HH:mm"
:style="{ width: '100%' }"
@ -86,7 +104,9 @@
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleStart">开始审核</el-button>
<el-button type="primary" @click="handleStart"
>开始审核</el-button
>
</el-form-item>
</el-form>
</el-card>
@ -94,37 +114,47 @@
</el-card>
</el-col>
<el-col :xs="24" :md="8">
<el-card class="box-card" style="overflow-y:auto;overflow-x:hidden;height:200px">
<el-card
class="box-card"
style="overflow-y: auto; overflow-x: hidden; height: 200px"
>
<div slot="header" class="clearfix">
<span>受审核方</span>
<el-button style="float: right; padding: 0px 0" type="text">更多企业信息</el-button>
<el-button style="float: right; padding: 0px 0" type="text"
>更多企业信息</el-button
>
</div>
<div class="item">{{ auditee.name }}</div>
<div v-for="item in auditee.address_" :key="item.id" class="text item">
<div
v-for="item in auditee.address_"
:key="item.id"
class="text item"
>
<span class="span">{{ item.type }}</span>
{{ item.address }}
</div>
<div class="text item">
<span class="span">常用联系人</span>
{{auditee.linkman1_name}}/{{auditee.linkman1_duty}}/{{auditee.linkman1_mobile}}
{{ auditee.linkman1_name }}/{{ auditee.linkman1_duty }}/{{
auditee.linkman1_mobile
}}
</div>
<div class="text item">
<span class="span">备用联系人</span>
{{auditee.linkman2_name}}/{{auditee.linkman2_duty}}/{{auditee.linkman2_mobile}}
{{ auditee.linkman2_name }}/{{ auditee.linkman2_duty }}/{{
auditee.linkman2_mobile
}}
</div>
</el-card>
</el-col>
</el-row>
<el-card style="margin-top: 6px">
<div slot="header" class="clearfix">
<span>项目进度</span>
</div>
<el-steps :active="states.indexOf(project.state)" finish-status="success">
<el-step v-for="item in states" :title="item"
:key="item"
></el-step>
<el-step v-for="item in states" :title="item" :key="item"></el-step>
</el-steps>
</el-card>
<el-row style="margin-top: 6px">
@ -133,7 +163,8 @@
<div slot="header" class="clearfix">
<span>业务信息</span>
</div>
<el-button type="primary" @click="appendCertapp" size="mini">添加申请</el-button>
<el-button type="primary" @click="appendCertapp" size="mini" v-if="$route.name == 'PlanProject'"
:disabled="!checkPermission(['certapp_bind'])">添加申请</el-button>
<el-table
ref="projectTable"
v-loading="listLoading"
@ -146,16 +177,21 @@
max-height="300"
>
<el-table-column label="单号">
<template slot-scope="scope" v-if="scope.row.number">{{ scope.row.number }}</template>
<template slot-scope="scope" v-if="scope.row.number">{{
scope.row.number
}}</template>
</el-table-column>
<el-table-column label="认证领域/分类" width="300px">
<template slot-scope="scope">
<el-tag v-if="scope.row.cert_field_">{{scope.row.cert_field_.name}}</el-tag>
<el-tag v-if="scope.row.cert_field_">{{
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>
>{{ scope.row.cccpv_class_.name }}</el-tag
>
</template>
</el-table-column>
<!-- <el-table-column label="申请信息" width="300px">
@ -178,17 +214,16 @@
<template slot-scope="scope">{{ scope.row.state }}</template>
</el-table-column>
<el-table-column label="受理/确认人">
<template
slot-scope="scope"
v-if="scope.row.accept_by_"
>{{ scope.row.accept_by_.name}}</template>
<template slot-scope="scope" v-if="scope.row.accept_by_">{{
scope.row.accept_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">
<el-table-column label="操作" fixed="right" width="260px">
<template slot-scope="scope">
<el-button
v-if="$route.name == 'AuditProject'"
@ -196,31 +231,36 @@
size="small"
:disabled="!checkPermission(['certapp_detail'])"
@click="handleFeedback(scope)"
>反馈</el-button>
>反馈</el-button
>
<el-button
v-if="$route.name == 'AuditProject'"
size="small"
:disabled="!checkPermission(['certapp_detail'])"
@click="handleCertappTest(scope)"
>安排检测</el-button>
>安排检测</el-button
>
<el-button
v-if="$route.name == 'PlanProject'"
type="primary"
size="small"
:disabled="!checkPermission(['certapp_detail'])"
@click="handlePlan(scope)"
>派人</el-button>
>派人</el-button
>
<el-button
size="small"
:disabled="!checkPermission(['certapp_detail'])"
@click="handleDetail(scope)"
>详情</el-button>
>详情</el-button
>
<el-button
v-if="$route.name == 'Projectupdate'"
type="danger"
size="small"
@click="handleRemove(scope)"
>移除</el-button>
>移除</el-button
>
</template>
</el-table-column>
</el-table>
@ -229,7 +269,10 @@
</el-row>
<el-row :gutter="6" style="margin-top: 6px">
<el-col :xs="24" :md="8">
<el-card class="box-card" style="overflow-y:auto;overflow-x:hidden;height:380px">
<el-card
class="box-card"
style="overflow-y: auto; overflow-x: hidden; height: 380px"
>
<div slot="header" class="clearfix">
<span>联系记录</span>
</div>
@ -237,7 +280,7 @@
ref="projectTable"
v-loading="listLoading"
:data="contactData"
style="width: 100%;"
style="width: 100%"
border
fit
stripe
@ -245,13 +288,17 @@
height="160"
>
<el-table-column label="联系时间">
<template slot-scope="scope">{{ scope.row.contact_date }}</template>
<template slot-scope="scope">{{
scope.row.contact_date
}}</template>
</el-table-column>
<el-table-column label="内容">
<template slot-scope="scope">{{ scope.row.content }}</template>
</el-table-column>
<el-table-column label="操作人">
<template slot-scope="scope">{{ scope.row.create_by_.name }}</template>
<template slot-scope="scope">{{
scope.row.create_by_.name
}}</template>
</el-table-column>
</el-table>
<el-row :gutter="10">
@ -291,12 +338,15 @@
</el-col>
</el-row>
<el-row>
<div style="text-align:right;">
<el-button-group>
<el-button type="primary" @click="createNewRecord" size="mini">创建新记录</el-button>
<div style="text-align: right">
<el-button
type="primary"
@click="createNewRecord"
size="mini"
>创建新记录</el-button
>
<!-- <el-button type="primary" @click="updateNowRecord" size="mini">保存</el-button> -->
<el-button @click="resetForm" size="mini">重置</el-button>
</el-button-group>
</div>
</el-row>
</el-form>
@ -312,7 +362,8 @@
:key="index"
@click.native="handleClickTag(item)"
style="margin: 2px; font-size: 12px"
>{{item}}</el-tag>
>{{ item }}</el-tag
>
</el-card>
</el-row>
</el-col>
@ -320,7 +371,10 @@
</el-card>
</el-col>
<el-col :xs="24" :md="8">
<el-card class="box-card" style="overflow-y:auto;overflow-x:hidden;height:380px">
<el-card
class="box-card"
style="overflow-y: auto; overflow-x: hidden; height: 380px"
>
<div slot="header" class="clearfix">
<span>项目成员</span>
</div>
@ -328,7 +382,7 @@
ref="memberTable"
v-loading="listLoading"
:data="memberData"
style="width: 100%;"
style="width: 100%"
border
fit
stripe
@ -340,11 +394,17 @@
</el-table-column>
<el-table-column label="是否组长">
<template slot-scope="scope">
<i class="el-icon-circle-check" v-if="scope.row.is_leader" style="color:green;"></i>
<i
class="el-icon-circle-check"
v-if="scope.row.is_leader"
style="color: green"
></i>
</template>
</el-table-column>
<el-table-column label="身份">
<template slot-scope="scope" v-if="scope.row.identity">{{ scope.row.identity_.name }}</template>
<template slot-scope="scope" v-if="scope.row.identity">{{
scope.row.identity_.name
}}</template>
</el-table-column>
<el-table-column label="是否接受">
<template slot-scope="scope">
@ -406,7 +466,10 @@
</el-card>
</el-col>
<el-col :xs="24" :md="8">
<el-card class="box-card" style="overflow-y:auto;overflow-x:hidden;height:380px">
<el-card
class="box-card"
style="overflow-y: auto; overflow-x: hidden; height: 380px"
>
<div slot="header" class="clearfix">
<span>审核总反馈</span>
</div>
@ -456,10 +519,16 @@
</el-col>
</el-row>
<el-row>
<div style="text-align:center;" v-if="$route.name=='AuditProject'">
<el-button-group>
<el-button type="primary" @click="handlePback" :disabled="project.state != '现场审核中'">提交反馈</el-button>
</el-button-group>
<div
style="text-align: center"
v-if="$route.name == 'AuditProject'"
>
<el-button
type="primary"
@click="handlePback"
:disabled="project.state != '现场审核中'"
>提交反馈</el-button
>
</div>
</el-row>
</el-form>
@ -473,7 +542,11 @@
width="80%"
:append-to-body="true"
>
<Userchose ref="Userchose" :querydata="querydata" @handleChose="choseComplete"></Userchose>
<Userchose
ref="Userchose"
:querydata="querydata"
@handleChose="choseComplete"
></Userchose>
</el-dialog>
<el-dialog
title="选择申请"
@ -482,10 +555,13 @@
width="80%"
:append-to-body="true"
>
<Certappchose ref="Certappchose" @handleChose="chooseComplete2" :querydata="querydata2"></Certappchose>
<Certappchose
ref="Certappchose"
@handleChose="choseComplete2"
:querydata="querydata2"
></Certappchose>
</el-dialog>
</div>
</template>
<style scoped>
.text {
@ -504,14 +580,20 @@
</style>
<script>
import { getDictList } from "@/api/dict";
import { getCertappList } from "@/api/certapp";
import { getCertappList, bindCertapp, unbindCertapp } from "@/api/certapp";
import { getEnterprise } from "@/api/enterprise";
import { getProject, updateProject, edateProject, startProject, feedbackProject } from "@/api/project";
import {
getProject,
updateProject,
edateProject,
startProject,
feedbackProject,
} from "@/api/project";
import { getContactRecordList, createContactRecord } from "@/api/plan";
import Pagination from "@/components/Pagination";
import checkPermission from "@/utils/permission";
import Userchose from "@/views/employee/userchose";
import Certappchose from '@/views/certapp/certappchose'
import Certappchose from "@/views/certapp/certappchose";
import {
getMemberList,
createMember,
@ -525,7 +607,18 @@ export default {
props: [],
data() {
return {
states:['创建中', '待策划', '策划中', '审核任务已下达', '审核任务已接受', '待现场审核', '现场审核中', '任务已反馈', '检测评定出证', '完成'],
states: [
"创建中",
"待策划",
"策划中",
"审核任务已下达",
"审核任务已接受",
"待现场审核",
"现场审核中",
"任务已反馈",
"检测评定出证",
"完成",
],
stateIndex: 1,
auditee: {},
project: { assign_by_: null },
@ -535,7 +628,7 @@ export default {
can_paichai: false,
formData: {
content: "",
project: this.$route.query.project,
project: this.$route.params.id,
},
rules: {
contact_date: [
@ -585,7 +678,7 @@ export default {
rdate: [],
backformData: {
backdate: null,
feedback_remark:''
feedback_remark: "",
},
backrules: {
backdate: [
@ -595,12 +688,11 @@ export default {
trigger: "change",
},
],
}
},
};
},
computed: {},
watch: {
},
watch: {},
created() {
this.getParams();
this.getMemberList_();
@ -617,12 +709,15 @@ export default {
this.project = res.data;
this.can_paichai = this.project.can_paichai;
if (this.project.edate0) {
this.edate = [this.project.edate0, this.project.edate1]
this.edate_ = [this.project.edate0, this.project.edate1]
this.edate = [this.project.edate0, this.project.edate1];
this.edate_ = [this.project.edate0, this.project.edate1];
}
if (this.project.end_date) {
this.backformData.backdate = [this.project.start_date, this.project.end_date]
this.backformData.feedback_remark = this.project.feedback_remark
this.backformData.backdate = [
this.project.start_date,
this.project.end_date,
];
this.backformData.feedback_remark = this.project.feedback_remark;
}
})
.then(() => {
@ -659,11 +754,12 @@ export default {
});
},
getMemberList_() {
getMemberList({ certapp__project: this.$route.params.id, pageoff: true }).then(
(res) => {
getMemberList({
certapp__project: this.$route.params.id,
pageoff: true,
}).then((res) => {
this.memberData = res.data;
}
);
});
},
submitForm() {
this.$refs["elForm"].validate((valid) => {
@ -683,6 +779,7 @@ export default {
this.formData.content = val;
},
createNewRecord() {
console.log(this.formData)
createContactRecord(this.formData).then((rse) => {
this.$message.success("成功");
this.getContactRecordList_();
@ -750,59 +847,112 @@ export default {
},
handleEdate() {
if (this.edate.length) {
edateProject(this.project.id, {edate0:this.edate[0], edate1:this.edate[1]}).then(res=>{
this.$message.success('成功')
this.edate_ = this.edate
this.project.state = res.data.state
this.project.edate0 = res.data.edate0
this.project.edate1 = res.data.edate1
}).catch(e=>{})
edateProject(this.project.id, {
edate0: this.edate[0],
edate1: this.edate[1],
})
.then((res) => {
this.$message.success("成功");
this.edate_ = this.edate;
this.project.state = res.data.state;
this.project.edate0 = res.data.edate0;
this.project.edate1 = res.data.edate1;
})
.catch((e) => {});
}
},
handleStart(scope) {
startProject(this.project.id, {start_date:this.start_date}).then(res=>{
this.$message.success('成功')
this.project.state = res.data.state
this.project.start_date = res.data.start_date
}).catch(e=>{})
startProject(this.project.id, { start_date: this.start_date })
.then((res) => {
this.$message.success("成功");
this.project.state = res.data.state;
this.project.start_date = res.data.start_date;
})
.catch((e) => {});
},
handlePback() {
this.$refs['backform'].validate(valid => {
this.$refs["backform"].validate((valid) => {
if (valid) {
feedbackProject(this.project.id, {start_date:this.backformData.backdate[0], end_date:this.backformData.backdate[1], feedback_remark:this.backformData.feedback_remark}).then(res=>{
this.$message.success('成功')
this.project.state = res.data.state
this.project.start_date = res.data.start_date
this.project.end_date = res.data.end_date
}).catch(e=>{})}
else{
return false
}})
feedbackProject(this.project.id, {
start_date: this.backformData.backdate[0],
end_date: this.backformData.backdate[1],
feedback_remark: this.backformData.feedback_remark,
})
.then((res) => {
this.$message.success("成功");
this.project.state = res.data.state;
this.project.start_date = res.data.start_date;
this.project.end_date = res.data.end_date;
})
.catch((e) => {});
} else {
return false;
}
});
},
handleFeedback(scope) {
this.$router.push({name:"Certappfeedback", params:{action:'feedback', id:scope.row.id}})
this.$router.push({
name: "Certappfeedback",
params: { action: "feedback", id: scope.row.id },
});
},
handleCertappTest(scope) {
this.$router.push({name:"Certapptest", params:{action:'test', id:scope.row.id}})
this.$router.push({
name: "Certapptest",
params: { action: "test", id: scope.row.id },
});
},
handlePlan(scope) {
this.$router.push({name:"Certappmember", params:{action:'member', id:scope.row.id}})
this.$router.push({
name: "Certappmember",
params: { action: "member", id: scope.row.id },
});
},
handleDetail(scope) {
this.$router.push({name:"Certappdetail", params:{id:scope.row.id}})
this.$router.push({
name: "Certappdetail",
params: { id: scope.row.id },
});
},
appendCertapp() {
this.querydata2 = {
page: 1,
page_size: 10,
applicant: this.project.auditee,
state:'策划'
}
this.chooseVisiable2 = true
state: "策划",
};
this.chooseVisiable2 = true;
},
choseComplete2(val) {
}
this.chooseVisiable2 = false;
var data = { ids: val, project: this.$route.params.id };
bindCertapp(data)
.then((res) => {
this.getCertappList_();
this.$message.success("成功");
})
.catch((e) => {
this.getCertappList_();
});
},
handleRemove(scope) {
this.$confirm("确认移除吗?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
unbindCertapp(scope.row.id)
.then((res) => {
this.getCertappList_();
this.$message.success("成功");
})
.catch((e) => {
this.getCertappList_();
});
})
.catch((e) => {});
},
},
};
</script>

View File

@ -45,17 +45,17 @@
icon="el-icon-search"
@click="handleFilter"
style="margin-left:10px"
>搜索</el-button>
>查询</el-button>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>刷新重置</el-button>
>重置</el-button>
</div>
<div style="margin-top:6px">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate">新增</el-button>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" v-if="$route.name=='EmployeeUpdate'">新增</el-button>
</div>
<el-table
v-loading="listLoading"

View File

@ -45,14 +45,14 @@
icon="el-icon-search"
@click="handleFilter"
style="margin-left:10px"
>搜索</el-button>
>查询</el-button>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>刷新重置</el-button>
>重置</el-button>
</div>
<el-table
v-loading="listLoading"

View File

@ -28,14 +28,14 @@
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button>
>查询</el-button>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>刷新重置</el-button>
>重置</el-button>
</div>
<div style="margin-top:6px">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate">新增</el-button>

View File

@ -23,14 +23,14 @@
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-search" @click="handleFilter">查询</el-button>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>刷新重置</el-button>
>重置</el-button>
</div>
<el-table
v-loading="listLoading"

View File

@ -28,14 +28,14 @@
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button>
>查询</el-button>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>刷新重置</el-button>
>重置</el-button>
</div>
<el-table
v-loading="listLoading"

View File

@ -3,7 +3,7 @@
<div style="margin-top:10px">
<el-input
v-model="search"
placeholder="输入部门名称进行搜索"
placeholder="输入部门名称进行查询"
style="width: 200px;"
class="filter-item"
@keyup.native="handleFilter"

View File

@ -3,7 +3,7 @@
<div style="margin-top:10px">
<el-input
v-model="search"
placeholder="输入权限名称进行搜索"
placeholder="输入权限名称进行查询"
style="width: 200px;"
class="filter-item"
@keyup.native="handleFilter"

View File

@ -3,7 +3,7 @@
<div style="margin-top:10px">
<el-input
v-model="search"
placeholder="输入岗位名称进行搜索"
placeholder="输入岗位名称进行查询"
style="width: 200px;"
class="filter-item"
@keyup.native="handleFilter"

View File

@ -3,7 +3,7 @@
<div style="margin-top:10px">
<el-input
v-model="search"
placeholder="输入角色名称进行搜索"
placeholder="输入角色名称进行查询"
style="width: 200px;"
class="filter-item"
@keyup.native="handleFilter"

View File

@ -28,14 +28,14 @@
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button>
>查询</el-button>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>刷新重置</el-button>
>重置</el-button>
</div>
<el-table
v-loading="listLoading"

View File

@ -47,14 +47,14 @@
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button>
>查询</el-button>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>刷新重置</el-button>
>重置</el-button>
</div>
<div style="margin-top:10px">
<el-button type="primary" icon="el-icon-plus" @click="handleAddUser">新增</el-button>

View File

@ -53,7 +53,6 @@
</el-table-column>
<el-table-column label="操作" width="250">
<template slot-scope="scope">
<el-button-group>
<el-button
v-if="scope.row.teststate=='待实验室检验'"
@ -75,7 +74,6 @@
:disabled="!checkPermission(['certapps_update'])"
@click="handlestate(scope.row.id)"
>查看任务</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>

View File

@ -2,40 +2,8 @@ from utils import serializer
from rest_framework import serializers
from .models import *
from apps.system.serializers import DictSimpleSerializer, UserListSerializer, UserSimpleSerializer
from apps.project.models import Project
from apps.plan.models import Member
from apps.project.serializers import PlanSerializer
from apps.plan.serializers import MemberSerializer
class ProjectSerializerX(serializers.ModelSerializer):
create_by_ = UserSimpleSerializer(source='create_by', read_only=True)
certapps = serializers.SerializerMethodField()
plan_ = PlanSerializer(source='plan', read_only=True)
members = serializers.SerializerMethodField()
class Meta:
model = Project
fields = '__all__'
def get_certapps(self, obj):
certapps = []
for i in obj.certapp_project.filter(is_deleted=False):
certapps.append(i.cert_field.code +'(' + i.cccpv_class.name +')')
return certapps
def get_members(self, obj):
queryset = obj.certapp_project.all()
members = Member.objects.filter(certapp__in=queryset, is_deleted=False).distinct('is_leader','user').order_by('-is_leader')
serializer = MemberSerializer(members, many=True)
return serializer.data
@staticmethod
def setup_eager_loading(queryset):
""" Perform necessary eager loading of data. """
queryset = queryset.select_related('create_by', 'plan')
queryset = queryset.prefetch_related('certapp_project',)
return queryset
from apps.project.models import CertApp
from apps.system.serializers import DictSimpleSerializer, UserSimpleSerializer
class CertappSerializerX(serializers.ModelSerializer):
cert_field_ = DictSimpleSerializer(source='cert_field', read_only=True)
@ -43,7 +11,6 @@ class CertappSerializerX(serializers.ModelSerializer):
cnas_scopes_ = DictSimpleSerializer(source='cnas_scopes', many=True , read_only=True)
create_by_ = UserSimpleSerializer(source='create_by', read_only=True)
accept_by_ = UserSimpleSerializer(source='accept_by', read_only=True)
members = serializers.SerializerMethodField()
class Meta:
model = CertApp
fields = '__all__'
@ -55,7 +22,3 @@ class CertappSerializerX(serializers.ModelSerializer):
queryset = queryset.prefetch_related('cnas_scopes', 'member_certapp')
return queryset
def get_members(self, obj):
members = Member.objects.filter(certapp=obj, is_deleted=False).order_by('-is_leader')
serializer = MemberSerializer(members, many=True)
return serializer.data

View File

@ -1,10 +1,10 @@
# from django.urls import path, include
# from .views import CertaccessViewSet
# from rest_framework import routers
from django.urls import path, include
from .views import CertaccessViewSet
from rest_framework import routers
# router = routers.DefaultRouter()
# router.register('certaccess', CertaccessViewSet, basename="certaccess")
router = routers.DefaultRouter()
# urlpatterns = [
# path('', include(router.urls))
# ]
urlpatterns = [
path('', include(router.urls))
]

View File

@ -4,14 +4,19 @@ from rest_framework.mixins import ListModelMixin
from .models import *
from .serializers import *
from apps.project.models import *
from apps.project.models import CertApp
# Create your views here.
class CertaccessViewSet(PageOrNot, ListModelMixin, GenericViewSet):
"""
业务评定
"""
perms_map = {'get': 'access_view'}
queryset = CertApp.objects.all()
serializer_class = CertappSerializerX
filterset_fields = []
ordering = ['-create_time']
def get_queryset(self):
queryset = CertApp.objects.filter(state__in=['产品检测', '评定', '出证'])
if hasattr(self.get_serializer_class(), 'setup_eager_loading'):
queryset = self.get_serializer_class().setup_eager_loading(queryset)
return queryset

View File

@ -57,7 +57,7 @@ class Enterprise(CommonBModel):
verbose_name_plural = verbose_name
def __str__(self):
return self.name
return self.code
class EnterpriseAddress(CommonAModel):
type_choices = (
('注册地址', '注册地址'),

View File

@ -29,10 +29,7 @@ class EnterpriseAddressSerializer(serializers.ModelSerializer):
model = EnterpriseAddress
fields = '__all__'
class SimpEnterpriseSerializer(serializers.ModelSerializer):
class Meta:
model = Enterprise
fields = ['name']
class CertunitSerializer(serializers.ModelSerializer):
standard_ = StandardSerializer(source='standard', read_only=True)
enterprise_ = serializers.CharField(source='enterprise',read_only=True)
@ -40,14 +37,15 @@ class CertunitSerializer(serializers.ModelSerializer):
model = Certunit
fields = '__all__'
class CertunitSimpleSerializer(serializers.ModelSerializer):
enterprise_ = SimpEnterpriseSerializer(source='enterprise',read_only=True)
class Meta:
model = Certunit
fields = ['id', 'name','description','enterprise','enterprise_']
class EnterpriseSimpleSerializer(serializers.ModelSerializer):
class Meta:
model = Enterprise
fields = ['id', 'name']
class CertunitSimpleSerializer(serializers.ModelSerializer):
class Meta:
model = Certunit
fields = ['id', 'name','description']

View File

@ -37,7 +37,7 @@ class TeamMemberSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
fields = ['code', 'user', 'user_', 'photo', 'fields', 'majors']
fields = ['code', 'user', 'user_', 'photo', 'fields', 'majors', 'id']
def get_majors(self, obj):
majors = obj.ability_employee.all()

View File

@ -0,0 +1,25 @@
# Generated by Django 3.0.7 on 2020-10-29 01:56
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('plan', '0007_auto_20200911_0954'),
]
operations = [
migrations.RemoveField(
model_name='contactrecord',
name='belong_dept',
),
migrations.RemoveField(
model_name='contactrecord',
name='create_by',
),
migrations.RemoveField(
model_name='contactrecord',
name='update_by',
),
]

View File

@ -0,0 +1,26 @@
# Generated by Django 3.0.7 on 2020-10-29 01:57
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('plan', '0008_auto_20201029_0956'),
]
operations = [
migrations.AddField(
model_name='contactrecord',
name='create_by',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='contactrecord_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人'),
),
migrations.AddField(
model_name='contactrecord',
name='update_by',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='contactrecord_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人'),
),
]

View File

@ -4,11 +4,11 @@ from django.db import models
from rest_framework.exceptions import ParseError
from simple_history.models import HistoricalRecords
from apps.system.models import CommonAModel, CommonBModel, Dict, User
from apps.system.models import CommonAModel, CommonBModel, Dict, User, BaseBModel, BaseModel
from apps.project.models import Project, CertApp
# Create your models here.
class Plan(CommonBModel):
class Plan(BaseBModel):
"""
计划(项目组)
"""
@ -22,7 +22,7 @@ class Plan(CommonBModel):
def __str__(self):
return self.name
class ContactRecord(CommonBModel):
class ContactRecord(CommonAModel):
"""
联系记录
"""

View File

@ -48,7 +48,7 @@ class MemberViewSet(CreateUpdateCustomMixin, PageOrNot, ModelViewSet):
def create(self, request, *args, **kwargs):
serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True)
if CertApp.object.get(pk=request.data['certapp'])!='策划':
if CertApp.objects.get(pk=request.data['certapp']).state !='策划':
return Response('业务状态异常,操作失败', status = status.HTTP_400_BAD_REQUEST)
if Member.objects.filter(user = request.data['user'], certapp=request.data['certapp'], is_deleted=False).exists():
return Response('已存在该成员', status= status.HTTP_400_BAD_REQUEST)
@ -56,6 +56,21 @@ class MemberViewSet(CreateUpdateCustomMixin, PageOrNot, ModelViewSet):
headers = self.get_success_headers(serializer.data)
return Response(serializer.data, status=status.HTTP_201_CREATED, headers=headers)
def update(self, request, *args, **kwargs):
partial = kwargs.pop('partial', False)
instance = self.get_object()
serializer = self.get_serializer(instance, data=request.data, partial=partial)
serializer.is_valid(raise_exception=True)
self.perform_update(serializer)
if CertApp.objects.get(pk=request.data['certapp']).project.state !='策划中':
return Response('项目状态异常,操作失败', status = status.HTTP_400_BAD_REQUEST)
if getattr(instance, '_prefetched_objects_cache', None):
# If 'prefetch_related' has been applied to a queryset, we need to
# forcibly invalidate the prefetch cache on the instance.
instance._prefetched_objects_cache = {}
return Response(serializer.data)
@action(methods=['put'], detail=True, perms_map={'put':'audit_days'},
url_name='audit_days')
def days(self, request, *args, **kwargs):

View File

@ -2,3 +2,4 @@
from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(CertApp)

View File

@ -0,0 +1,21 @@
# Generated by Django 3.0.7 on 2020-10-23 03:09
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('project', '0053_project_feedback_remark'),
]
operations = [
migrations.AddField(
model_name='certappunit',
name='assessor',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='certappunit_assessor', to=settings.AUTH_USER_MODEL, verbose_name='评定人'),
),
]

View File

@ -0,0 +1,18 @@
# Generated by Django 3.0.7 on 2020-10-29 01:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project', '0054_certappunit_assessor'),
]
operations = [
migrations.AlterField(
model_name='certappunit',
name='teststate',
field=models.CharField(blank=True, choices=[('待提交CTC', '待提交CTC'), ('待CTC下达', '待CTC下达'), ('待实验室检验', '待实验室检验'), ('到样检测中', '到样检测中'), ('待提取报告', '待提取报告'), ('待实验室整改', '待实验室整改'), ('待评定', '待评定'), ('已评定', '已评定'), ('任务撤销', '任务撤销')], default='待提交CTC', max_length=50, null=True, verbose_name='任务状态'),
),
]

View File

@ -6,7 +6,7 @@ from rest_framework.exceptions import ParseError
from simple_history.models import HistoricalRecords
from apps.certset.models import ImplementRule, UnitType, Evaluations, Standard
from apps.crm.models import Enterprise
from apps.system.models import CommonAModel, CommonBModel, Dict, User
from apps.system.models import CommonAModel, CommonBModel, Dict, User, BaseBModel
# from apps.plan.models import Plan
# Create your models here.
@ -81,7 +81,7 @@ from apps.system.models import CommonAModel, CommonBModel, Dict, User
# def __str__(self):
# return self.number
class Project(CommonBModel):
class Project(BaseBModel):
"""
认证项目
"""
@ -118,7 +118,9 @@ class Project(CommonBModel):
verbose_name_plural = verbose_name
def __str__(self):
if self.number:
return self.number
return ''
class CertApp(CommonBModel):
@ -192,6 +194,9 @@ class CertApp(CommonBModel):
verbose_name = '认证受理'
verbose_name_plural = verbose_name
def __str__(self):
return self.number
class CertAppFlow(model.BaseModel):
"""
certapp流转记录
@ -214,8 +219,7 @@ class EvaluationDetail(CommonBModel):
class Meta:
verbose_name = '评审记录详情'
verbose_name_plural = verbose_name
def __str__(self):
return self.name
class Certappunit(CommonBModel):
"""
@ -243,7 +247,7 @@ class Certappunit(CommonBModel):
('待提取报告', '待提取报告'),
('待实验室整改', '待实验室整改'),
('待评定', '待评定'),
('评定完成', '评定完成'),
('评定', '评定'),
('任务撤销', '任务撤销'),
)
@ -272,14 +276,11 @@ class Certappunit(CommonBModel):
remarks = models.TextField('检验反馈备注', null=True, blank=True)
path = models.CharField('文件地址', max_length=1000, null=True, blank=True)
inspectionstate = models.CharField('实验室检验状态', choices=charge_choices,null=True, blank=True, max_length=50)
assessor = models.ForeignKey(User, related_name='certappunit_assessor', on_delete=models.SET_NULL, null=True, blank=True, verbose_name='评定人')
class Meta:
verbose_name = '认证单元'
verbose_name_plural = verbose_name
def __str__(self):
return self.name
# def save(self, *args, **kwargs):
# super().save(*args, **kwargs)

View File

@ -1,7 +1,6 @@
import re
from django.http import request
from rest_framework.views import APIView
from apps import project
from django.shortcuts import render
from rest_framework.serializers import ModelSerializer
from rest_framework.viewsets import ModelViewSet, GenericViewSet
@ -78,9 +77,11 @@ class CertappViewset(PageOrNot, RbacFilterSet, ModelViewSet):
queryset = CertApp.objects.all()
serializer_class = CertappSerializer
ordering = ['-create_time']
filterset_fields = ['state', 'project','cert_field']
filterset_fields = ['state', 'project', 'certappunit_certapp__teststate', 'cert_field']
# filterset_class = CertAppFilter
def perform_destroy(self, instance):
instance.delete(soft=False)
def create(self, request, *args, **kwargs):
postdata = request.data
@ -155,8 +156,7 @@ class CertappViewset(PageOrNot, RbacFilterSet, ModelViewSet):
obj.save()
CertAppFlow.objects.create(certapp = obj, handler=self.request.user, operation='提交现场审核反馈', state=oldstate)
return Response({'state':obj.state}, status=status.HTTP_200_OK)
else:
return Response('项目状态异常,操作失败', status=status.HTTP_400_BAD_REQUEST)
return Response('业务状态异常,操作失败', status=status.HTTP_400_BAD_REQUEST)
@action(methods=['get'], detail=True, perms_map={'get':'*'},
url_name='certapp_flow')
@ -168,7 +168,29 @@ class CertappViewset(PageOrNot, RbacFilterSet, ModelViewSet):
serializer = CertappflowSerializer(objs, many=True)
return Response(serializer.data)
@action(methods=['put'], detail=False, perms_map={'put':'certapp_bind'},
url_name='certapp_bind')
def bind(self, request, *args, **kwargs):
"""
绑定至项目
"""
ids = request.data['ids']
project = Project.objects.get(pk=request.data['project'])
CertApp.objects.filter(pk__in=ids, is_deleted=False, project__isnull=True).update(project=project)
return Response(status=status.HTTP_200_OK)
@action(methods=['put'], detail=True, perms_map={'put':'certapp_unbind'},
url_name='certapp_unbind')
def unbind(self, request, *args, **kwargs):
"""
与项目解绑
"""
obj = self.get_object()
if obj.state == '策划':
obj.project = None
obj.save()
return Response(status=status.HTTP_200_OK)
return Response('业务状态异常,操作失败', status=status.HTTP_400_BAD_REQUEST)
class EvaluationDetailViewset(CreateUpdateCustomMixin, PageOrNot, ModelViewSet):
"""
@ -206,12 +228,16 @@ class CertappunitViewset(PageOrNot, ModelViewSet):
单元评定
"""
obj = self.get_object()
if obj.teststate == '待评定':
if request.data['decision']:
obj.decision = Dict.objects.get(pk=request.data['decision'])
else:
obj.decision = None
obj.teststate = '已评定'
obj.save()
return Response(status=status.HTTP_200_OK)
else:
return Response('项目状态异常,操作失败', status=status.HTTP_400_BAD_REQUEST)
@action(methods=['put'], detail=True, perms_map={'put':'certapp_testtask'}, url_name='certappunit_testtask')
def testtask(self, request, pk=None):
"""
@ -292,7 +318,7 @@ class ProjectViewSet(RbacFilterSet, ModelViewSet):
serializer = self.get_serializer(data=postdata)
serializer.is_valid(raise_exception=True)
obj = serializer.save(create_by = self.request.user, belong_dept=self.request.user.dept)
obj.state = '创建中'
obj.state = '创建中' #空项目
if 'certapps' in postdata and postdata['certapps']:
CertApp.objects.filter(pk__in = postdata['certapps']).update(project=obj)
obj.state = '待策划'
@ -311,7 +337,6 @@ class ProjectViewSet(RbacFilterSet, ModelViewSet):
obj.state = '审核任务已下达'
obj.save()
return Response(status=status.HTTP_200_OK)
else:
return Response('项目状态异常,操作失败', status=status.HTTP_400_BAD_REQUEST)
@action(methods=['put'], detail=True, perms_map={'put':'project_toplan'},
@ -412,4 +437,3 @@ class ProjectViewSet(RbacFilterSet, ModelViewSet):
return Response({'start_date':obj.start_date, 'end_date':obj.end_date,'state':obj.state}, status=status.HTTP_200_OK)
else:
return Response('项目状态异常,操作失败', status=status.HTTP_400_BAD_REQUEST)

View File

@ -192,6 +192,19 @@ class CommonBModel(SoftModel):
class Meta:
abstract = True
class BaseBModel(BaseModel):
"""
业务用基本表BB,包含create_by, update_by, belong_dept字段, 物理删除
"""
create_by = models.ForeignKey(
User, null=True, blank=True, on_delete=models.SET_NULL, verbose_name='创建人', related_name = '%(class)s_create_by')
update_by = models.ForeignKey(
User, null=True, blank=True, on_delete=models.SET_NULL, verbose_name='最后编辑人', related_name = '%(class)s_update_by')
belong_dept = models.ForeignKey(
Organization, null=True, blank=True, on_delete=models.SET_NULL, verbose_name='所属部门', related_name= '%(class)s_belong_dept')
class Meta:
abstract = True
class File(CommonAModel):
"""