左侧菜单调整/增加下属公司筛选功能
This commit is contained in:
parent
ef2a925265
commit
ac1d1f5c53
|
|
@ -13,6 +13,15 @@ export function getOrgList(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getSubOrgList(query) {
|
||||
return request({
|
||||
url: '/system/organization/sub/',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function createOrg(data) {
|
||||
return request({
|
||||
url: '/system/organization/',
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1617769333497" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4285" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M926.429394 129.158212s-140.389361-8.142583-205.530025-20.777625c-35.378119-6.738689-137.862353-64.579106-194.018097-99.114889L512 0l-14.881272 9.265698c-37.624349 23.304634-154.147519 91.533863-194.018097 99.114889C236.556073 121.296408 98.693721 129.158212 98.693721 129.158212l-28.077872 1.684673v465.8119c0 5.334796 2.527009 130.562106 153.024403 273.759254a719.635865 719.635865 0 0 0 276.005484 151.339731H517.896353l6.457911-1.403893A719.916644 719.916644 0 0 0 800.640526 870.414039c151.058953-144.039485 152.743625-268.705237 152.743625-274.040033V130.842885z m-29.762545 467.215794s-3.088566 106.976693-135.335344 233.046339a686.784755 686.784755 0 0 1-248.769948 137.581574h-1.403893a687.627091 687.627091 0 0 1-248.489169-137.581574C131.544831 704.473814 126.771593 597.497121 126.771593 596.654785V184.190842c42.678366-2.807787 133.369893-9.827255 186.437072-20.216068 48.013162-9.265698 151.901289-69.633123 198.229778-97.430217 46.328489 28.077872 150.216616 88.445298 198.229777 97.430217 53.067179 10.108034 143.758706 17.127502 186.437072 20.216068z" p-id="4286"></path><path d="M306.469975 416.956403A28.077872 28.077872 0 1 0 267.160954 457.10776l201.318344 201.879901 308.856595-280.778722A28.077872 28.077872 0 0 0 737.746093 336.934467l-268.14368 243.996709z" p-id="4287"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
|
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1617768967605" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3525" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M873.629538 1.102769h-727.04A145.408 145.408 0 0 0 1.024 146.510769v727.118769c0 80.344615 65.063385 145.486769 145.408 145.48677h727.118769c80.344615 0 145.486769-65.142154 145.486769-145.48677v-727.04c0-80.344615-65.142154-145.486769-145.486769-145.486769h0.078769z m72.861539 872.763077a72.467692 72.467692 0 0 1-72.310154 72.625231H146.747077a72.467692 72.467692 0 0 1-51.593846-21.267692 72.152615 72.152615 0 0 1-21.425231-51.357539V146.589538c0-40.251077 32.689231-72.861538 72.940308-72.861538h727.04c40.172308 0 72.782769 32.610462 72.782769 72.782769v727.355077z m-118.075077-545.634461H537.521231a36.312615 36.312615 0 1 0 0 72.704h290.894769a36.312615 36.312615 0 1 0 0-72.704z m0 291.052307H537.521231a36.312615 36.312615 0 1 0 0 72.625231h290.894769a36.312615 36.312615 0 1 0 0-72.625231zM319.330462 528.384a127.291077 127.291077 0 1 0 0 254.503385 127.291077 127.291077 0 0 0 0-254.424616v-0.078769z m38.596923 165.888a54.587077 54.587077 0 1 1-77.193847-77.193846 54.587077 54.587077 0 0 1 77.193847 77.193846z m44.819692-427.953231l-119.729231 119.729231-47.104-46.946462a36.312615 36.312615 0 1 0-51.357538 51.357539l72.704 72.704c14.178462 14.178462 37.179077 14.178462 51.357538 0l145.486769-145.408a36.312615 36.312615 0 0 0-51.357538-51.436308z" p-id="3526"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
|
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1617765282648" class="icon" viewBox="0 0 1075 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1177" xmlns:xlink="http://www.w3.org/1999/xlink" width="209.9609375" height="200"><defs><style type="text/css"></style></defs><path d="M768 0a153.6 153.6 0 1 1-94.6688 274.5856L399.616 448.7168a204.6464 204.6464 0 0 1 6.144 103.168l357.7344 172.288a179.2 179.2 0 1 1-44.4416 92.3136L361.2672 644.096a204.8 204.8 0 1 1-16.6912-281.8048l273.7152-174.1312A153.6 153.6 0 0 1 768 0z" p-id="1178"></path></svg>
|
||||
|
After Width: | Height: | Size: 654 B |
|
|
@ -7,7 +7,7 @@
|
|||
:collapse="isCollapse"
|
||||
:background-color="variables.menuBg"
|
||||
:text-color="variables.menuText"
|
||||
:unique-opened="false"
|
||||
:unique-opened="true"
|
||||
:active-text-color="variables.menuActiveText"
|
||||
:collapse-transition="false"
|
||||
mode="vertical"
|
||||
|
|
@ -39,6 +39,7 @@ export default {
|
|||
return meta.activeMenu
|
||||
}
|
||||
return path
|
||||
|
||||
},
|
||||
showLogo() {
|
||||
return this.$store.state.settings.sidebarLogo
|
||||
|
|
|
|||
|
|
@ -74,79 +74,68 @@ export const constantRoutes = [
|
|||
*/
|
||||
export const asyncRoutes = [
|
||||
{
|
||||
path: '/qualification',
|
||||
path: '/share',
|
||||
component: Layout,
|
||||
redirect: '/qualification',
|
||||
children: [{
|
||||
path: '',
|
||||
redirect: '/share/qualification',
|
||||
name: 'Share',
|
||||
alwaysShow: true,
|
||||
meta: { title: '能力共享', icon: 'share' },
|
||||
children: [
|
||||
{
|
||||
path: 'qualification',
|
||||
name: 'Qualification',
|
||||
component: () => import('@/views/ability/qualification'),
|
||||
meta: { title: '检验检测资质', icon: 'table', perms: ['qualification_view'] }
|
||||
}]
|
||||
meta: { title: '检验检测资质', perms: ['qualification_view'] }
|
||||
},
|
||||
{
|
||||
path: '/cma',
|
||||
component: Layout,
|
||||
redirect: '/cma',
|
||||
children: [{
|
||||
path: '',
|
||||
path: 'cma',
|
||||
name: 'CMA',
|
||||
component: () => import('@/views/ability/cma'),
|
||||
meta: { title: '检测能力(总部CMA+CNAS)', icon: 'table', perms: ['cma_view'] }
|
||||
}]
|
||||
meta: { title: '检测能力(总部CMA+CNAS)', perms: ['cma_view'] }
|
||||
},
|
||||
|
||||
{
|
||||
path: '/cma2',
|
||||
component: Layout,
|
||||
redirect: '/cma2',
|
||||
children: [{
|
||||
path: '',
|
||||
path: 'cma2',
|
||||
name: 'CMA2',
|
||||
component: () => import('@/views/ability/cma2'),
|
||||
meta: { title: '检测能力(分子公司CMA)', icon: 'table', perms: ['cma2_view'] }
|
||||
}
|
||||
]
|
||||
meta: { title: '检测能力(分子公司CMA)', perms: ['cma2_view'] }
|
||||
}
|
||||
,
|
||||
{
|
||||
path: '/inspection',
|
||||
component: Layout,
|
||||
redirect: '/inspection',
|
||||
children: [{
|
||||
path: '',
|
||||
name: 'inspection',
|
||||
path: 'inspection',
|
||||
name: 'Inspection',
|
||||
component: () => import('@/views/ability/inspection'),
|
||||
meta: { title: '检验能力', icon: 'table', perms: ['inspection_view'] }
|
||||
}]
|
||||
meta: { title: '检验能力', perms: ['inspection_view'] }
|
||||
},
|
||||
]
|
||||
|
||||
},
|
||||
{
|
||||
path: '/supervision',
|
||||
component: Layout,
|
||||
redirect: '/supervision/task',
|
||||
name: 'Supervision',
|
||||
meta: { title: '日常监督', icon: 'table', perms: ['supervision'] },
|
||||
meta: { title: '日常监督', icon: 'guide', perms: ['supervision'] },
|
||||
alwaysShow: true,
|
||||
children: [
|
||||
{
|
||||
path: 'content',
|
||||
name: 'Content',
|
||||
component: () => import('@/views/supervision/content.vue'),
|
||||
meta: { title: '材料清单', icon: 'documentation', perms: ['content'] }
|
||||
meta: { title: '材料清单', perms: ['content'] }
|
||||
},
|
||||
{
|
||||
path: 'task',
|
||||
name: 'Task',
|
||||
component: () => import('@/views/supervision/task.vue'),
|
||||
meta: { title: '报送任务', icon: 'guide', perms: ['task_view'] }
|
||||
meta: { title: '报送任务', perms: ['task_view'] }
|
||||
},
|
||||
{
|
||||
path: 'record',
|
||||
name: 'Record',
|
||||
component: () => import('@/views/supervision/record.vue'),
|
||||
meta: { title: '材料报送列表', icon: 'guide', perms: ['record_view'] }
|
||||
}
|
||||
,
|
||||
meta: { title: '报送材料查询', perms: ['record_view'] }
|
||||
},
|
||||
{
|
||||
path: 'taskdo/:id',
|
||||
name: 'Taskdo',
|
||||
|
|
@ -156,7 +145,50 @@ export const asyncRoutes = [
|
|||
},
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
path: '/qualityinspect',
|
||||
component: Layout,
|
||||
redirect: '/qualityinspect/task',
|
||||
name: 'Qualityinspect',
|
||||
meta: { title: '质量巡查', icon: 'inspect', perms: ['qualityinspect_view'] },
|
||||
alwaysShow: true,
|
||||
children: [
|
||||
{
|
||||
path: 'table',
|
||||
name: 'inspectTable',
|
||||
component: () => import('@/views/qualityinspect/index.vue'),
|
||||
meta: { title: '检查表', perms: ['qualityinspect_view'] }
|
||||
},
|
||||
{
|
||||
path: 'task',
|
||||
name: 'inspectTask',
|
||||
component: () => import('@/views/qualityinspect/index.vue'),
|
||||
meta: { title: '巡查任务', perms: ['qualityinspect_view'] }
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/pt',
|
||||
component: Layout,
|
||||
redirect: '/pt/',
|
||||
name: 'ProficiencyTest',
|
||||
meta: { title: '能力验证', icon: 'PT', perms: ['pt_view'] },
|
||||
alwaysShow: true,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'PT1',
|
||||
component: () => import('@/views/PT/index.vue'),
|
||||
meta: { title: '菜单一', perms: ['pt_view'] }
|
||||
},
|
||||
{
|
||||
path: 'msg',
|
||||
name: 'PT2',
|
||||
component: () => import('@/views/PT/index.vue'),
|
||||
meta: { title: '菜单二', perms: ['pt_view'] }
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/system',
|
||||
component: Layout,
|
||||
|
|
|
|||
|
|
@ -63,9 +63,13 @@
|
|||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-menu-item {
|
||||
font-size: 16px;
|
||||
}
|
||||
// menu hover
|
||||
.submenu-title-noDropdown,
|
||||
.el-submenu__title {
|
||||
font-size: 16px;
|
||||
&:hover {
|
||||
background-color: $menuHover !important;
|
||||
}
|
||||
|
|
@ -79,7 +83,7 @@
|
|||
& .el-submenu .el-menu-item {
|
||||
min-width: $sideBarWidth !important;
|
||||
background-color: $subMenuBg !important;
|
||||
|
||||
font-size: 16px;
|
||||
&:hover {
|
||||
background-color: $subMenuHover !important;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ $menuHover:#263445;
|
|||
$subMenuBg:#1f2d3d;
|
||||
$subMenuHover:#001528;
|
||||
|
||||
$sideBarWidth: 230px;
|
||||
$sideBarWidth: 240px;
|
||||
|
||||
// the :export directive is the magic sauce for webpack
|
||||
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
|
||||
|
|
|
|||
|
|
@ -37,11 +37,10 @@
|
|||
/>
|
||||
</el-select>
|
||||
|
||||
<el-select v-if="checkPermission(['record_confirm'])"
|
||||
<el-select
|
||||
v-model="listQuery.belong_dept"
|
||||
placeholder="上报部门"
|
||||
clearable
|
||||
style="width: 140px"
|
||||
@change="handleFilter"
|
||||
>
|
||||
<el-option
|
||||
|
|
@ -56,6 +55,7 @@
|
|||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="上报时间"
|
||||
style="width: 140px"
|
||||
>
|
||||
</el-date-picker>
|
||||
-
|
||||
|
|
@ -64,13 +64,11 @@
|
|||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
@change="handleFilter"
|
||||
style="width: 140px"
|
||||
placeholder="上报时间"
|
||||
>
|
||||
</el-date-picker>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleFilter"
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleFilter"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button
|
||||
|
|
@ -81,8 +79,11 @@
|
|||
>
|
||||
</div>
|
||||
<div style="margin-top: 10px">
|
||||
<el-checkbox v-model="listQuery.only" @change="showOnly">只显示本司</el-checkbox>
|
||||
<el-button type="primary" @click="centerDialogVisible = true" style="margin-left:4px">主动上报</el-button
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="centerDialogVisible = true"
|
||||
style="margin-left: 4px"
|
||||
>主动上报</el-button
|
||||
>
|
||||
<el-dialog
|
||||
title="主动报送"
|
||||
|
|
@ -116,21 +117,26 @@
|
|||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
|
||||
<el-table-column width="150px" label="任务标题" prop="task" sortable='custom'>
|
||||
<el-table-column
|
||||
width="150px"
|
||||
label="任务标题"
|
||||
prop="task"
|
||||
sortable="custom"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.task">{{
|
||||
scope.row.task_.name
|
||||
}}</span>
|
||||
<el-tag type="warning" effect="plain" v-else>
|
||||
主动报送
|
||||
</el-tag>
|
||||
<span v-if="scope.row.task">{{ scope.row.task_.name }}</span>
|
||||
<el-tag type="warning" effect="plain" v-else> 主动报送 </el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务截止时间">
|
||||
<template slot-scope="scope">{{ scope.row.end_date }}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="材料名称" sortable='custom' prop="content__sortnum">
|
||||
<el-table-column
|
||||
label="材料名称"
|
||||
sortable="custom"
|
||||
prop="content__sortnum"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.content_name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报送要求/备注">
|
||||
|
|
@ -150,7 +156,11 @@
|
|||
<el-table-column label="上报说明">
|
||||
<template slot-scope="scope">{{ scope.row.noteb }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上报单位" sortable='custom' prop="belong_dept__sort">
|
||||
<el-table-column
|
||||
label="上报单位"
|
||||
sortable="custom"
|
||||
prop="belong_dept__sort"
|
||||
>
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.belong_dept_.name
|
||||
}}</template>
|
||||
|
|
@ -160,9 +170,13 @@
|
|||
<el-tag type="danger" v-if="scope.row.state == '待上报'">{{
|
||||
scope.row.state
|
||||
}}</el-tag>
|
||||
<el-tag type="warning" v-else-if="scope.row.state == '待整改' || scope.row.state == '待发布'">{{
|
||||
scope.row.state
|
||||
}}</el-tag>
|
||||
<el-tag
|
||||
type="warning"
|
||||
v-else-if="
|
||||
scope.row.state == '待整改' || scope.row.state == '待发布'
|
||||
"
|
||||
>{{ scope.row.state }}</el-tag
|
||||
>
|
||||
<el-tag type="success" v-else-if="scope.row.state == '已确认'">{{
|
||||
scope.row.state
|
||||
}}</el-tag>
|
||||
|
|
@ -187,11 +201,7 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="操作"
|
||||
fixed="right"
|
||||
>
|
||||
<el-table-column align="center" label="操作" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-link
|
||||
v-if="
|
||||
|
|
@ -244,9 +254,7 @@
|
|||
v-if="checkPermission(['record_delete'])"
|
||||
type="danger"
|
||||
size="small"
|
||||
@click="
|
||||
handleRecord({ action: 'delete', record: scope.row })
|
||||
"
|
||||
@click="handleRecord({ action: 'delete', record: scope.row })"
|
||||
>删除</el-link
|
||||
>
|
||||
</template>
|
||||
|
|
@ -260,7 +268,12 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
<el-drawer title="记录" :visible.sync="drawer" :with-header="false" size="40%">
|
||||
<el-drawer
|
||||
title="记录"
|
||||
:visible.sync="drawer"
|
||||
:with-header="false"
|
||||
size="40%"
|
||||
>
|
||||
<recorddo
|
||||
ref="recorddo"
|
||||
:data="data"
|
||||
|
|
@ -280,10 +293,9 @@
|
|||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
<script>
|
||||
import { getOrgList } from "@/api/org";
|
||||
import { getOrgList, getSubOrgList } from "@/api/org";
|
||||
import { getRecordList, createself } from "@/api/record";
|
||||
import { genTree } from "@/utils";
|
||||
|
||||
|
|
@ -317,7 +329,8 @@ export default {
|
|||
],
|
||||
isOptions: [
|
||||
{ key: "true", name: "是" },
|
||||
{key:"false",name:"否"}],
|
||||
{ key: "false", name: "否" },
|
||||
],
|
||||
pickerOptions2: {
|
||||
shortcuts: [
|
||||
{
|
||||
|
|
@ -352,7 +365,7 @@ export default {
|
|||
listQuery: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
only: true
|
||||
belong_dept: this.$store.state.user.dept
|
||||
},
|
||||
listLoading: false,
|
||||
dialogVisible: false,
|
||||
|
|
@ -374,9 +387,9 @@ export default {
|
|||
|
||||
getState() {
|
||||
if (this.$route.params.state) {
|
||||
this.listQuery.state = this.$route.params.state
|
||||
this.listQuery.state = this.$route.params.state;
|
||||
}
|
||||
this.getList()
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
getRecordList(this.listQuery).then((response) => {
|
||||
|
|
@ -384,9 +397,15 @@ export default {
|
|||
});
|
||||
},
|
||||
getOrgList() {
|
||||
if (this.checkPermission(["record_confirm"])) {
|
||||
getOrgList({ can_supervision: true }).then((res) => {
|
||||
this.orgData = res.data;
|
||||
});
|
||||
}else{
|
||||
getSubOrgList().then(res=>{
|
||||
this.orgData = res.data;
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
handleOrgClick(obj, node, vue) {
|
||||
|
|
@ -402,7 +421,7 @@ export default {
|
|||
this.listQuery = {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
only: this.listQuery.only
|
||||
belong_dept: this.$store.state.user.dept
|
||||
};
|
||||
this.getList();
|
||||
},
|
||||
|
|
@ -418,19 +437,15 @@ export default {
|
|||
getContentsList() {
|
||||
getContentList({ can_doself: this.can_doself }).then((res) => {
|
||||
this.contentOptions = res.data;
|
||||
|
||||
});
|
||||
},
|
||||
showOnly(val) {
|
||||
this.getList()
|
||||
},
|
||||
changeTableSort(val) {
|
||||
if(val.order == 'ascending'){
|
||||
this.listQuery.ordering = val.prop
|
||||
if (val.order == "ascending") {
|
||||
this.listQuery.ordering = val.prop;
|
||||
} else {
|
||||
this.listQuery.ordering = '-' + val.prop
|
||||
this.listQuery.ordering = "-" + val.prop;
|
||||
}
|
||||
this.getList()
|
||||
this.getList();
|
||||
},
|
||||
contentup() {
|
||||
if (this.contents.length > 0) {
|
||||
|
|
@ -439,9 +454,9 @@ export default {
|
|||
this.listQuery = {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
state:'待上报',
|
||||
is_self:true
|
||||
}
|
||||
state: "待上报",
|
||||
is_self: true,
|
||||
};
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
|
|
@ -471,7 +486,7 @@ export default {
|
|||
// };
|
||||
// }
|
||||
// }
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class QualityConfig(AppConfig):
|
||||
name = 'quality'
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
from django.db import models
|
||||
from utils.model import BaseModel
|
||||
from apps.system.models import CommonAModel, CommonBModel, Organization, User, Dict, File
|
||||
# Create your models here.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
|
|
@ -172,6 +172,7 @@ class TaskViewSet(CreateUpdateCustomMixin, ModelViewSet):
|
|||
return Response(status=status.HTTP_200_OK)
|
||||
return Response('任务状态错误', status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
|
||||
def cal_task_rate(task, dept):
|
||||
"""
|
||||
计算任务上报率, 确认率
|
||||
|
|
@ -216,8 +217,6 @@ class RecordViewSet(PageOrNot, CreateUpdateCustomMixin, ModelViewSet):
|
|||
queryset = queryset.filter(belong_dept__in = belong_depts)
|
||||
elif '本级' in data_range:
|
||||
queryset = queryset.filter(belong_dept = user.dept)
|
||||
if self.request.query_params.get('only', None) == 'true':
|
||||
queryset = queryset.filter(belong_dept = user.dept)
|
||||
return queryset
|
||||
|
||||
def filter_queryset(self, queryset):
|
||||
|
|
|
|||
|
|
@ -203,6 +203,15 @@ class OrganizationViewSet(PageOrNot,ModelViewSet):
|
|||
ordering_fields = ['sort']
|
||||
ordering = ['sort', 'pk']
|
||||
|
||||
@action(methods=['get'], detail=False, permission_classes=[IsAuthenticated])
|
||||
def sub(self, request, pk=None):
|
||||
"""
|
||||
获取本人所在部门的下级部门
|
||||
"""
|
||||
subdept = get_child_queryset2(request.user.dept).order_by('sort')
|
||||
serializer = OrganizationSerializer(subdept, many=True)
|
||||
return Response(serializer.data)
|
||||
|
||||
class RoleViewSet(ModelViewSet):
|
||||
"""
|
||||
角色:增删改查
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ INSTALLED_APPS = [
|
|||
'apps.system',
|
||||
'apps.crm',
|
||||
'apps.ability',
|
||||
'apps.supervision'
|
||||
'apps.supervision',
|
||||
'apps.quality'
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
|
|
|||
Loading…
Reference in New Issue