左侧菜单调整/增加下属公司筛选功能

This commit is contained in:
caoqianming 2021-04-07 14:33:43 +08:00
parent ef2a925265
commit ac1d1f5c53
21 changed files with 245 additions and 154 deletions

View File

@ -13,6 +13,15 @@ export function getOrgList(query) {
params: query params: query
}) })
} }
export function getSubOrgList(query) {
return request({
url: '/system/organization/sub/',
method: 'get',
params: query
})
}
export function createOrg(data) { export function createOrg(data) {
return request({ return request({
url: '/system/organization/', url: '/system/organization/',

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -7,7 +7,7 @@
:collapse="isCollapse" :collapse="isCollapse"
:background-color="variables.menuBg" :background-color="variables.menuBg"
:text-color="variables.menuText" :text-color="variables.menuText"
:unique-opened="false" :unique-opened="true"
:active-text-color="variables.menuActiveText" :active-text-color="variables.menuActiveText"
:collapse-transition="false" :collapse-transition="false"
mode="vertical" mode="vertical"
@ -39,6 +39,7 @@ export default {
return meta.activeMenu return meta.activeMenu
} }
return path return path
}, },
showLogo() { showLogo() {
return this.$store.state.settings.sidebarLogo return this.$store.state.settings.sidebarLogo
@ -51,4 +52,4 @@ export default {
} }
} }
} }
</script> </script>

View File

@ -74,79 +74,68 @@ export const constantRoutes = [
*/ */
export const asyncRoutes = [ export const asyncRoutes = [
{ {
path: '/qualification', path: '/share',
component: Layout, component: Layout,
redirect: '/qualification', redirect: '/share/qualification',
children: [{ name: 'Share',
path: '', alwaysShow: true,
name: 'Qualification', meta: { title: '能力共享', icon: 'share' },
component: () => import('@/views/ability/qualification'), children: [
meta: { title: '检验检测资质', icon: 'table', perms: ['qualification_view'] } {
}] path: 'qualification',
}, name: 'Qualification',
{ component: () => import('@/views/ability/qualification'),
path: '/cma', meta: { title: '检验检测资质', perms: ['qualification_view'] }
component: Layout, },
redirect: '/cma', {
children: [{ path: 'cma',
path: '', name: 'CMA',
name: 'CMA', component: () => import('@/views/ability/cma'),
component: () => import('@/views/ability/cma'), meta: { title: '检测能力(总部CMA+CNAS)', perms: ['cma_view'] }
meta: { title: '检测能力(总部CMA+CNAS)', icon: 'table', perms: ['cma_view'] } },
}]
},
{ {
path: '/cma2', path: 'cma2',
component: Layout, name: 'CMA2',
redirect: '/cma2', component: () => import('@/views/ability/cma2'),
children: [{ meta: { title: '检测能力(分子公司CMA)', perms: ['cma2_view'] }
path: '', }
name: 'CMA2', ,
component: () => import('@/views/ability/cma2'), {
meta: { title: '检测能力(分子公司CMA)', icon: 'table', perms: ['cma2_view'] } path: 'inspection',
} name: 'Inspection',
component: () => import('@/views/ability/inspection'),
meta: { title: '检验能力', perms: ['inspection_view'] }
},
] ]
}
,
{
path: '/inspection',
component: Layout,
redirect: '/inspection',
children: [{
path: '',
name: 'inspection',
component: () => import('@/views/ability/inspection'),
meta: { title: '检验能力', icon: 'table', perms: ['inspection_view'] }
}]
},
},
{ {
path: '/supervision', path: '/supervision',
component: Layout, component: Layout,
redirect: '/supervision/task', redirect: '/supervision/task',
name: 'Supervision', name: 'Supervision',
meta: { title: '日常监督', icon: 'table', perms: ['supervision'] }, meta: { title: '日常监督', icon: 'guide', perms: ['supervision'] },
alwaysShow: true,
children: [ children: [
{ {
path: 'content', path: 'content',
name: 'Content', name: 'Content',
component: () => import('@/views/supervision/content.vue'), component: () => import('@/views/supervision/content.vue'),
meta: { title: '材料清单', icon: 'documentation', perms: ['content'] } meta: { title: '材料清单', perms: ['content'] }
}, },
{ {
path: 'task', path: 'task',
name: 'Task', name: 'Task',
component: () => import('@/views/supervision/task.vue'), component: () => import('@/views/supervision/task.vue'),
meta: { title: '报送任务', icon: 'guide', perms: ['task_view'] } meta: { title: '报送任务', perms: ['task_view'] }
}, },
{ {
path: 'record', path: 'record',
name: 'Record', name: 'Record',
component: () => import('@/views/supervision/record.vue'), component: () => import('@/views/supervision/record.vue'),
meta: { title: '材料报送列表', icon: 'guide', perms: ['record_view'] } meta: { title: '报送材料查询', perms: ['record_view'] }
} },
,
{ {
path: 'taskdo/:id', path: 'taskdo/:id',
name: 'Taskdo', 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', path: '/system',
component: Layout, component: Layout,
@ -253,22 +285,22 @@ export const asyncRoutes = [
} }
] ]
}, },
// 404 page must be placed at the end !!! // 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true } { path: '*', redirect: '/404', hidden: true }
] ]
const createRouter = () => new Router({ const createRouter = () => new Router({
// mode: 'history', // require service support // mode: 'history', // require service support
scrollBehavior: () => ({ y: 0 }), scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes routes: constantRoutes
}) })
const router = createRouter() const router = createRouter()
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() { export function resetRouter() {
const newRouter = createRouter() const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router router.matcher = newRouter.matcher // reset router
} }
export default router export default router

View File

@ -63,9 +63,13 @@
width: 100% !important; width: 100% !important;
} }
.el-menu-item {
font-size: 16px;
}
// menu hover // menu hover
.submenu-title-noDropdown, .submenu-title-noDropdown,
.el-submenu__title { .el-submenu__title {
font-size: 16px;
&:hover { &:hover {
background-color: $menuHover !important; background-color: $menuHover !important;
} }
@ -79,7 +83,7 @@
& .el-submenu .el-menu-item { & .el-submenu .el-menu-item {
min-width: $sideBarWidth !important; min-width: $sideBarWidth !important;
background-color: $subMenuBg !important; background-color: $subMenuBg !important;
font-size: 16px;
&:hover { &:hover {
background-color: $subMenuHover !important; background-color: $subMenuHover !important;
} }

View File

@ -9,7 +9,7 @@ $menuHover:#263445;
$subMenuBg:#1f2d3d; $subMenuBg:#1f2d3d;
$subMenuHover:#001528; $subMenuHover:#001528;
$sideBarWidth: 230px; $sideBarWidth: 240px;
// the :export directive is the magic sauce for webpack // the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass

View File

View File

@ -8,7 +8,7 @@
style="width: 140px" style="width: 140px"
@keyup.enter.native="handleFilter" @keyup.enter.native="handleFilter"
/> />
<el-select <el-select
v-model="listQuery.is_self" v-model="listQuery.is_self"
placeholder="是否主动报送" placeholder="是否主动报送"
clearable clearable
@ -36,12 +36,11 @@
:value="item.key" :value="item.key"
/> />
</el-select> </el-select>
<el-select v-if="checkPermission(['record_confirm'])" <el-select
v-model="listQuery.belong_dept" v-model="listQuery.belong_dept"
placeholder="上报部门" placeholder="上报部门"
clearable clearable
style="width: 140px"
@change="handleFilter" @change="handleFilter"
> >
<el-option <el-option
@ -56,6 +55,7 @@
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="上报时间" placeholder="上报时间"
style="width: 140px"
> >
</el-date-picker> </el-date-picker>
- -
@ -64,13 +64,11 @@
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
@change="handleFilter" @change="handleFilter"
style="width: 140px"
placeholder="上报时间" placeholder="上报时间"
> >
</el-date-picker> </el-date-picker>
<el-button <el-button type="primary" icon="el-icon-search" @click="handleFilter"
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button >搜索</el-button
> >
<el-button <el-button
@ -81,8 +79,11 @@
> >
</div> </div>
<div style="margin-top: 10px"> <div style="margin-top: 10px">
<el-checkbox v-model="listQuery.only" @change="showOnly">只显示本司</el-checkbox> <el-button
<el-button type="primary" @click="centerDialogVisible = true" style="margin-left:4px">主动上报</el-button type="primary"
@click="centerDialogVisible = true"
style="margin-left: 4px"
>主动上报</el-button
> >
<el-dialog <el-dialog
title="主动报送" title="主动报送"
@ -96,7 +97,7 @@
:titles="['材料清单', '选择的清单']" :titles="['材料清单', '选择的清单']"
:props="{ key: 'id', label: 'name' }" :props="{ key: 'id', label: 'name' }"
/> />
<div slot="footer" style="text-align:right"> <div slot="footer" style="text-align: right">
<el-button type="primary" @click="contentup()">确认</el-button> <el-button type="primary" @click="contentup()">确认</el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -116,21 +117,26 @@
> >
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column width="150px" label="任务标题" prop="task" sortable='custom'> <el-table-column
<template slot-scope="scope" > width="150px"
<span v-if="scope.row.task">{{ label="任务标题"
scope.row.task_.name prop="task"
}}</span> sortable="custom"
<el-tag type="warning" effect="plain" v-else> >
主动报送 <template slot-scope="scope">
</el-tag> <span v-if="scope.row.task">{{ scope.row.task_.name }}</span>
</template> <el-tag type="warning" effect="plain" v-else> 主动报送 </el-tag>
</template>
</el-table-column> </el-table-column>
<el-table-column label="任务截止时间" > <el-table-column label="任务截止时间">
<template slot-scope="scope">{{ scope.row.end_date }}</template> <template slot-scope="scope">{{ scope.row.end_date }}</template>
</el-table-column> </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> <template slot-scope="scope">{{ scope.row.content_name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="报送要求/备注"> <el-table-column label="报送要求/备注">
@ -144,13 +150,17 @@
</el-table-column> </el-table-column>
<el-table-column label="上报情况"> <el-table-column label="上报情况">
<template slot-scope="scope" v-if="scope.row.up_user_" <template slot-scope="scope" v-if="scope.row.up_user_"
>{{ scope.row.up_user_.name }}/{{ scope.row.up_date }}</template >{{ scope.row.up_user_.name }}/{{ scope.row.up_date }}</template
> >
</el-table-column> </el-table-column>
<el-table-column label="上报说明"> <el-table-column label="上报说明">
<template slot-scope="scope">{{ scope.row.noteb }}</template> <template slot-scope="scope">{{ scope.row.noteb }}</template>
</el-table-column> </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">{{ <template slot-scope="scope">{{
scope.row.belong_dept_.name scope.row.belong_dept_.name
}}</template> }}</template>
@ -160,9 +170,13 @@
<el-tag type="danger" v-if="scope.row.state == '待上报'">{{ <el-tag type="danger" v-if="scope.row.state == '待上报'">{{
scope.row.state scope.row.state
}}</el-tag> }}</el-tag>
<el-tag type="warning" v-else-if="scope.row.state == '待整改' || scope.row.state == '待发布'">{{ <el-tag
scope.row.state type="warning"
}}</el-tag> v-else-if="
scope.row.state == '待整改' || scope.row.state == '待发布'
"
>{{ scope.row.state }}</el-tag
>
<el-tag type="success" v-else-if="scope.row.state == '已确认'">{{ <el-tag type="success" v-else-if="scope.row.state == '已确认'">{{
scope.row.state scope.row.state
}}</el-tag> }}</el-tag>
@ -187,15 +201,11 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column align="center" label="操作" fixed="right">
align="center"
label="操作"
fixed="right"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if=" v-if="
(scope.row.state == '待上报'||scope.row.state=='待发布' )&& (scope.row.state == '待上报' || scope.row.state == '待发布') &&
checkPermission(['record_update']) checkPermission(['record_update'])
" "
type="warning" type="warning"
@ -241,14 +251,12 @@
>查看</el-link >查看</el-link
> >
<el-link <el-link
v-if="checkPermission(['record_delete'])" v-if="checkPermission(['record_delete'])"
type="danger" type="danger"
size="small" size="small"
@click=" @click="handleRecord({ action: 'delete', record: scope.row })"
handleRecord({ action: 'delete', record: scope.row }) >删除</el-link
" >
>删除</el-link
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -260,7 +268,12 @@
@pagination="getList" @pagination="getList"
/> />
</el-card> </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 <recorddo
ref="recorddo" ref="recorddo"
:data="data" :data="data"
@ -280,11 +293,10 @@
display: block; display: block;
} }
} }
</style> </style>
<script> <script>
import { getOrgList } from "@/api/org"; import { getOrgList, getSubOrgList } from "@/api/org";
import { getRecordList,createself } from "@/api/record"; import { getRecordList, createself } from "@/api/record";
import { genTree } from "@/utils"; import { genTree } from "@/utils";
import { getContentList } from "@/api/content"; import { getContentList } from "@/api/content";
@ -302,7 +314,7 @@ export default {
recordList: { recordList: {
count: 0, count: 0,
}, },
can_doself: true, can_doself: true,
contentOptions: [], contentOptions: [],
contents: [], contents: [],
@ -315,9 +327,10 @@ export default {
{ key: "已确认", name: "已确认" }, { key: "已确认", name: "已确认" },
{ key: "待整改", name: "待整改" }, { key: "待整改", name: "待整改" },
], ],
isOptions:[ isOptions: [
{key:"true",name:""}, { key: "true", name: "" },
{key:"false",name:""}], { key: "false", name: "" },
],
pickerOptions2: { pickerOptions2: {
shortcuts: [ shortcuts: [
{ {
@ -352,7 +365,7 @@ export default {
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20, page_size: 20,
only: true belong_dept: this.$store.state.user.dept
}, },
listLoading: false, listLoading: false,
dialogVisible: false, dialogVisible: false,
@ -371,12 +384,12 @@ export default {
}, },
methods: { methods: {
checkPermission, checkPermission,
getState(){ getState() {
if(this.$route.params.state){ if (this.$route.params.state) {
this.listQuery.state = this.$route.params.state this.listQuery.state = this.$route.params.state;
} }
this.getList() this.getList();
}, },
getList() { getList() {
getRecordList(this.listQuery).then((response) => { getRecordList(this.listQuery).then((response) => {
@ -384,9 +397,15 @@ export default {
}); });
}, },
getOrgList() { getOrgList() {
getOrgList({ can_supervision: true }).then((res) => { if (this.checkPermission(["record_confirm"])) {
this.orgData = res.data; getOrgList({ can_supervision: true }).then((res) => {
}); this.orgData = res.data;
});
}else{
getSubOrgList().then(res=>{
this.orgData = res.data;
})
}
}, },
handleOrgClick(obj, node, vue) { handleOrgClick(obj, node, vue) {
@ -402,7 +421,7 @@ export default {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
page_size: 20, page_size: 20,
only: this.listQuery.only belong_dept: this.$store.state.user.dept
}; };
this.getList(); this.getList();
}, },
@ -418,31 +437,27 @@ export default {
getContentsList() { getContentsList() {
getContentList({ can_doself: this.can_doself }).then((res) => { getContentList({ can_doself: this.can_doself }).then((res) => {
this.contentOptions = res.data; this.contentOptions = res.data;
}); });
}, },
showOnly(val) { changeTableSort(val) {
this.getList() if (val.order == "ascending") {
}, this.listQuery.ordering = val.prop;
changeTableSort (val) { } else {
if(val.order == 'ascending'){ this.listQuery.ordering = "-" + val.prop;
this.listQuery.ordering = val.prop
}else{
this.listQuery.ordering = '-' + val.prop
} }
this.getList() this.getList();
}, },
contentup() { contentup() {
if (this.contents.length > 0) { if (this.contents.length > 0) {
createself({ contents: this.contents }).then((res) => { createself({ contents: this.contents }).then((res) => {
this.centerDialogVisible = false; this.centerDialogVisible = false;
this.listQuery = { this.listQuery = {
page:1, page: 1,
page_size:20, page_size: 20,
state:'待上报', state: "待上报",
is_self:true is_self: true,
} };
this. getList(); this.getList();
}); });
} else { } else {
this.$message.error("请选择清单!"); this.$message.error("请选择清单!");
@ -471,7 +486,7 @@ export default {
// }; // };
// } // }
// } // }
} },
}, },
}; };
</script> </script>

View File

View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@ -0,0 +1,5 @@
from django.apps import AppConfig
class QualityConfig(AppConfig):
name = 'quality'

View File

@ -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.

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View File

@ -172,6 +172,7 @@ class TaskViewSet(CreateUpdateCustomMixin, ModelViewSet):
return Response(status=status.HTTP_200_OK) return Response(status=status.HTTP_200_OK)
return Response('任务状态错误', status=status.HTTP_400_BAD_REQUEST) return Response('任务状态错误', status=status.HTTP_400_BAD_REQUEST)
def cal_task_rate(task, dept): def cal_task_rate(task, dept):
""" """
计算任务上报率, 确认率 计算任务上报率, 确认率
@ -216,8 +217,6 @@ class RecordViewSet(PageOrNot, CreateUpdateCustomMixin, ModelViewSet):
queryset = queryset.filter(belong_dept__in = belong_depts) queryset = queryset.filter(belong_dept__in = belong_depts)
elif '本级' in data_range: elif '本级' in data_range:
queryset = queryset.filter(belong_dept = user.dept) 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 return queryset
def filter_queryset(self, queryset): def filter_queryset(self, queryset):

View File

@ -202,7 +202,16 @@ class OrganizationViewSet(PageOrNot,ModelViewSet):
filterset_fields = ['pid','name', 'type','can_supervision'] filterset_fields = ['pid','name', 'type','can_supervision']
ordering_fields = ['sort'] ordering_fields = ['sort']
ordering = ['sort', 'pk'] 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): class RoleViewSet(ModelViewSet):
""" """
角色增删改查 角色增删改查

View File

@ -44,7 +44,8 @@ INSTALLED_APPS = [
'apps.system', 'apps.system',
'apps.crm', 'apps.crm',
'apps.ability', 'apps.ability',
'apps.supervision' 'apps.supervision',
'apps.quality'
] ]
MIDDLEWARE = [ MIDDLEWARE = [