细节调整

This commit is contained in:
caoqianming 2021-03-18 17:23:55 +08:00
parent 6bd5cf1365
commit cc340095db
4 changed files with 98 additions and 90 deletions

View File

@ -19,11 +19,11 @@
首页 首页
</el-dropdown-item> </el-dropdown-item>
</router-link> </router-link>
<!-- <router-link to="/myinfo"> <router-link to="/myinfo">
<el-dropdown-item divided> <el-dropdown-item divided>
个人中心 个人中心
</el-dropdown-item> </el-dropdown-item>
</router-link> --> </router-link>
<!-- <a target="_blank" href="https://github.com/PanJiaChen/vue-admin-template/"> <!-- <a target="_blank" href="https://github.com/PanJiaChen/vue-admin-template/">
<el-dropdown-item>Github</el-dropdown-item> <el-dropdown-item>Github</el-dropdown-item>
</a> </a>

View File

@ -48,9 +48,18 @@ export const constantRoutes = [
}] }]
}, },
{ {
path: '/404', path: '/myinfo',
component: () => import('@/views/404'), component: Layout,
hidden: true redirect: '/myinfo',
hidden: true,
children: [
{
path: '',
name: 'ChangePassword',
component: () => import('@/views/system/changepassword'),
meta: { title: '修改密码', noCache: true, icon: '', perms: [] },
},
]
}, },
] ]
@ -81,7 +90,7 @@ export const asyncRoutes = [
meta: { title: '检测能力(总部CMA+CNAS)', icon: 'table', perms: ['cma_view'] } meta: { title: '检测能力(总部CMA+CNAS)', icon: 'table', perms: ['cma_view'] }
}] }]
}, },
{ {
path: '/cma2', path: '/cma2',
component: Layout, component: Layout,
@ -92,64 +101,64 @@ export const asyncRoutes = [
component: () => import('@/views/ability/cma2'), component: () => import('@/views/ability/cma2'),
meta: { title: '检测能力(分子公司CMA)', icon: 'table', perms: ['cma2_view'] } meta: { title: '检测能力(分子公司CMA)', icon: 'table', perms: ['cma2_view'] }
} }
] ]
} }
, ,
{ {
path: '/inspection', path: '/inspection',
component: Layout, component: Layout,
redirect: '/inspection', redirect: '/inspection',
children: [{ children: [{
path: '', path: '',
name: 'inspection', name: 'inspection',
component: () => import('@/views/ability/inspection'), component: () => import('@/views/ability/inspection'),
meta: { title: '检验能力', icon: 'table', perms: ['inspection_view'] } 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: 'table', perms: ['supervision'] },
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: '材料清单', icon: 'documentation', 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: '报送任务', icon: 'guide', 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_all'] } meta: { title: '材料列表', icon: 'guide', perms: ['record_all'] }
} }
,
{
path: 'report',
name: 'Report',
component: () => import('@/views/supervision/report.vue'),
meta: { title: '材料报送', icon: 'guide', perms: ['record_view'] }
}
, ,
{ {
path: 'taskdo/:id', path: 'report',
name: 'Taskdo', name: 'Report',
component: () => import('@/views/supervision/taskdo.vue'), component: () => import('@/views/supervision/report.vue'),
meta: { title: '报送任务执行', perms: ['task_view'] }, meta: { title: '材料报送', icon: 'guide', perms: ['record_view'] }
hidden: true }
}, ,
] {
}, path: 'taskdo/:id',
name: 'Taskdo',
component: () => import('@/views/supervision/taskdo.vue'),
meta: { title: '报送任务执行', perms: ['task_view'] },
hidden: true
},
]
},
{ {
path: '/system', path: '/system',
component: Layout, component: Layout,
@ -246,24 +255,6 @@ export const asyncRoutes = [
} }
] ]
}, },
{
path: '/myinfo',
component: Layout,
redirect: '/myinfo',
name: 'myinfo',
meta: { title: '个人中心', icon: 'tree' },
hidden: true,
children: [
{
path: '',
name: 'ChangePassword',
component: () => import('@/views/system/changepassword'),
meta: { title: '修改密码', noCache: true, icon: '', perms:[]},
hidden: true
},
]
},
// 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true } { path: '*', redirect: '/404', hidden: true }
] ]

View File

@ -36,7 +36,7 @@
</el-row> </el-row>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
:data="recordList" :data="recordList.results"
border border
fit fit
stripe stripe
@ -136,6 +136,13 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination
v-show="recordList.count > 0"
:total="recordList.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getRecordList"
/>
</el-card> </el-card>
<el-drawer title="记录" :visible.sync="drawer" :with-header="false"> <el-drawer title="记录" :visible.sync="drawer" :with-header="false">
@ -170,7 +177,13 @@ export default {
contents: [], contents: [],
depts: [], depts: [],
listLoading: false, listLoading: false,
recordList: [], listQuery: {
page: 1,
page_size: 20,
},
recordList: {
count:0
},
now: {}, now: {},
drawer: false, drawer: false,
}; };
@ -185,12 +198,13 @@ export default {
getTab() { getTab() {
if (this.$route.params.tab) { if (this.$route.params.tab) {
this.activeName = this.$route.params.tab; this.activeName = this.$route.params.tab;
this.handleClick({name:this.activeName})
} }
}, },
getRecordList() { getRecordList() {
getRecordList({ state: this.state }).then((res) => { getRecordList({ state: this.state }).then((res) => {
this.listLoading = false; this.listLoading = false;
this.recordList = res.data.results; this.recordList = res.data;
}); });
}, },
getContentList() { getContentList() {

View File

@ -152,14 +152,17 @@ class RecordViewSet(RbacFilterSet, PageOrNot, CreateUpdateCustomMixin, ModelView
上报 上报
""" """
obj = self.get_object() obj = self.get_object()
if obj.state == '待上报' or obj.state == '待整改': if obj.state in ['待整改','待上报']:
if 'files' in request.data: if 'files' in request.data and len(request.data['files'])==0:
obj.files.clear() if request.data.get('noteb', None):
obj.files.add(*request.data['files']) if request.data.get('is_yes', True):
if request.data.get('noteb', None): return Response('请选择不适用', status=status.HTTP_400_BAD_REQUEST)
obj.noteb = request.data['noteb'] else:
if request.data.get('is_yes', True): return Response('请上传文件或填写备注', status=status.HTTP_400_BAD_REQUEST)
obj.is_yes = request.data.get('is_yes') obj.is_yes = request.data.get('is_yes')
obj.files.clear()
obj.files.add(*request.data['files'])
obj.noteb = request.data['noteb']
obj.state = '已上报' obj.state = '已上报'
obj.up_user = request.user obj.up_user = request.user
obj.up_date = timezone.now() obj.up_date = timezone.now()