This commit is contained in:
caoqianming 2020-10-29 08:36:23 +08:00
parent dba0c4826d
commit f0fa6ea933
42 changed files with 560 additions and 951 deletions

View File

@ -77,3 +77,20 @@ export function flowCertapp(id) {
method: 'get', 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

@ -312,12 +312,19 @@ export const asyncRoutes = [
meta: { title: '人员信息', icon: 'example', perms: ['employee_view'] } meta: { title: '人员信息', icon: 'example', perms: ['employee_view'] }
}, },
{ {
path: 'employee/update/:id', path: 'employee/:id/update',
name: 'EmployeeUpdate', name: 'EmployeeUpdate',
component: () => import('@/views/employee/employeeupdate'), component: () => import('@/views/employee/employeeupdate'),
meta: { title: '人员信息变更', icon: 'example', perms: ['employee_update'] }, meta: { title: '人员信息变更', icon: 'example', perms: ['employee_update'] },
hidden: true hidden: true
}, },
{
path: 'employee/:id/detail',
name: 'Employeedetail',
component: () => import('@/views/employee/employeeupdate'),
meta: { title: '人员信息详情', icon: 'example', perms: ['employee_detail'] },
hidden: true
},
// { // {
// path: 'qualification_', // path: 'qualification_',
// name: 'Qualification_', // name: 'Qualification_',

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,37 +1,8 @@
<template> <template>
<div class="app-container"> <div>
<div style="display:flex"> <el-button type="primary" @click="appendChose" size="mini">添加选中</el-button>
<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>
<el-table <el-table
ref="cTable"
v-loading="listLoading" v-loading="listLoading"
:data="tableData.results" :data="tableData.results"
style="width: 100%;margin-top:6px;" style="width: 100%;margin-top:6px;"
@ -39,9 +10,9 @@
fit fit
stripe stripe
highlight-current-row 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="申请单号"> <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>
@ -109,7 +80,7 @@ export default {
}, },
created() { created() {
this.getList() this.getList()
this.getfields() // this.getfields()
}, },
methods: { methods: {
checkPermission, 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> </script>

View File

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

View File

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

View File

@ -22,13 +22,13 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button> >查询</el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>刷新重置</el-button> >重置</el-button>
</div> </div>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div> <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> </div>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"

View File

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

View File

@ -216,7 +216,7 @@
</el-col> </el-col>
</el-row> </el-row>
<el-form-item size="large"> <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-button @click="goBack">返回</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>

View File

@ -1,16 +1,16 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-tabs type="border-card" > <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> <Employeedetail :id="employee"></Employeedetail>
</el-tab-pane> </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> <Qualification :employee="employee"></Qualification>
</el-tab-pane> </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> <Ability :employee="employee"></Ability>
</el-tab-pane> </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> <Education :employee="employee"></Education>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>

View File

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

View File

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

View File

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

View File

@ -29,14 +29,14 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button> >查询</el-button>
<el-button <el-button
class="filter-item" class="filter-item"
style="margin-left: 10px;" style="margin-left: 10px;"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>刷新重置</el-button> >重置</el-button>
</div> </div>
<div style="margin-top:6px"> <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">新增</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>
<el-table-column label="操作" width="300"> <el-table-column label="操作" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button-group>
<el-button <el-button
type="primary" type="primary"
size="small" size="small"
@ -60,7 +59,6 @@
:disabled="!checkPermission(['plan_delete'])" :disabled="!checkPermission(['plan_delete'])"
@click="handleDeletePlan(scope)" @click="handleDeletePlan(scope)"
>删除</el-button> >删除</el-button>
</el-button-group>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -122,7 +120,6 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="300" fixed="right"> <el-table-column label="操作" width="300" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button-group>
<el-button <el-button
type="primary" type="primary"
size="small" size="small"
@ -135,7 +132,6 @@
:disabled="!checkPermission(['project_delete'])" :disabled="!checkPermission(['project_delete'])"
@click="handleDetailProject(scope)" @click="handleDetailProject(scope)"
>详情</el-button> >详情</el-button>
</el-button-group>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -48,7 +48,7 @@ class MemberViewSet(CreateUpdateCustomMixin, PageOrNot, ModelViewSet):
def create(self, request, *args, **kwargs): def create(self, request, *args, **kwargs):
serializer = self.get_serializer(data=request.data) serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True) 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) return Response('业务状态异常,操作失败', status = status.HTTP_400_BAD_REQUEST)
if Member.objects.filter(user = request.data['user'], certapp=request.data['certapp'], is_deleted=False).exists(): if Member.objects.filter(user = request.data['user'], certapp=request.data['certapp'], is_deleted=False).exists():
return Response('已存在该成员', status= status.HTTP_400_BAD_REQUEST) return Response('已存在该成员', status= status.HTTP_400_BAD_REQUEST)

View File

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

View File

@ -1,7 +1,6 @@
import re import re
from django.http import request from django.http import request
from rest_framework.views import APIView from rest_framework.views import APIView
from apps import project
from django.shortcuts import render from django.shortcuts import render
from rest_framework.serializers import ModelSerializer from rest_framework.serializers import ModelSerializer
from rest_framework.viewsets import ModelViewSet, GenericViewSet from rest_framework.viewsets import ModelViewSet, GenericViewSet
@ -155,8 +154,7 @@ class CertappViewset(PageOrNot, RbacFilterSet, ModelViewSet):
obj.save() obj.save()
CertAppFlow.objects.create(certapp = obj, handler=self.request.user, operation='提交现场审核反馈', state=oldstate) CertAppFlow.objects.create(certapp = obj, handler=self.request.user, operation='提交现场审核反馈', state=oldstate)
return Response({'state':obj.state}, status=status.HTTP_200_OK) 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':'*'}, @action(methods=['get'], detail=True, perms_map={'get':'*'},
url_name='certapp_flow') url_name='certapp_flow')
@ -168,7 +166,29 @@ class CertappViewset(PageOrNot, RbacFilterSet, ModelViewSet):
serializer = CertappflowSerializer(objs, many=True) serializer = CertappflowSerializer(objs, many=True)
return Response(serializer.data) 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): class EvaluationDetailViewset(CreateUpdateCustomMixin, PageOrNot, ModelViewSet):
""" """
@ -288,7 +308,7 @@ class ProjectViewSet(RbacFilterSet, ModelViewSet):
serializer = self.get_serializer(data=postdata) serializer = self.get_serializer(data=postdata)
serializer.is_valid(raise_exception=True) serializer.is_valid(raise_exception=True)
obj = serializer.save(create_by = self.request.user, belong_dept=self.request.user.dept) 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']: if 'certapps' in postdata and postdata['certapps']:
CertApp.objects.filter(pk__in = postdata['certapps']).update(project=obj) CertApp.objects.filter(pk__in = postdata['certapps']).update(project=obj)
obj.state = '待策划' obj.state = '待策划'
@ -307,7 +327,6 @@ class ProjectViewSet(RbacFilterSet, ModelViewSet):
obj.state = '审核任务已下达' obj.state = '审核任务已下达'
obj.save() obj.save()
return Response(status=status.HTTP_200_OK) return Response(status=status.HTTP_200_OK)
else:
return Response('项目状态异常,操作失败', status=status.HTTP_400_BAD_REQUEST) return Response('项目状态异常,操作失败', status=status.HTTP_400_BAD_REQUEST)
@action(methods=['put'], detail=True, perms_map={'put':'project_toplan'}, @action(methods=['put'], detail=True, perms_map={'put':'project_toplan'},
@ -408,4 +427,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) return Response({'start_date':obj.start_date, 'end_date':obj.end_date,'state':obj.state}, status=status.HTTP_200_OK)
else: else:
return Response('项目状态异常,操作失败', status=status.HTTP_400_BAD_REQUEST) return Response('项目状态异常,操作失败', status=status.HTTP_400_BAD_REQUEST)