This commit is contained in:
parent
dd7f9663da
commit
c2af958fd2
|
@ -61,6 +61,27 @@ export const constantRoutes = [
|
|||
* the routes that need to be dynamically loaded based on user perms
|
||||
*/
|
||||
export const asyncRoutes = [
|
||||
{
|
||||
path: '/application',
|
||||
component: Layout,
|
||||
redirect: '/application/',
|
||||
name: 'ApplicationManage',
|
||||
meta: { title: '认证申请', icon: 'example'},
|
||||
children: [
|
||||
{
|
||||
path: 'application',
|
||||
name: 'Applicaion',
|
||||
component: () => import('@/views/employee/employee'),
|
||||
meta: { title: '申请受理', icon: 'example', perms: ['application_view'] }
|
||||
},
|
||||
{
|
||||
path: 'application2',
|
||||
name: 'Applicaion2',
|
||||
component: () => import('@/views/employee/train'),
|
||||
meta: { title: '客户申请受理', icon: 'example', perms: ['application_accept'] }
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/employee',
|
||||
component: Layout,
|
||||
|
@ -81,12 +102,12 @@ export const asyncRoutes = [
|
|||
meta: { title: '人员信息变更', icon: 'example', perms: ['employee_update'] },
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'qualification_',
|
||||
name: 'Qualification_',
|
||||
component: () => import('@/views/qualification/qualification_'),
|
||||
meta: { title: '注册资格检索', icon: 'example', perms: ['qualification_view'] }
|
||||
},
|
||||
// {
|
||||
// path: 'qualification_',
|
||||
// name: 'Qualification_',
|
||||
// component: () => import('@/views/qualification/qualification_'),
|
||||
// meta: { title: '注册资格检索', icon: 'example', perms: ['qualification_view'] }
|
||||
// },
|
||||
{
|
||||
path: 'train',
|
||||
name: 'Train',
|
||||
|
@ -162,10 +183,16 @@ export const asyncRoutes = [
|
|||
|
||||
{
|
||||
path: 'enterprise',
|
||||
name: 'enterprise',
|
||||
name: 'Enterprise',
|
||||
component: () => import('@/views/enterprise/enterprise'),
|
||||
meta: { title: '组织信息', icon: 'example', perms: ['enterprise_manage'] }
|
||||
},
|
||||
{
|
||||
path: 'enterprise2',
|
||||
name: 'Enterprise2',
|
||||
component: () => import('@/views/enterprise/enterprise'),
|
||||
meta: { title: '组织信息2', icon: 'example', perms: ['enterprise_manage'] }
|
||||
},
|
||||
{
|
||||
path: 'enterprise/create',
|
||||
name: 'EnterpriseCreate',
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
</el-select>
|
||||
<el-input
|
||||
v-model="listQuery.search"
|
||||
placeholder="姓名/易记码/编号"
|
||||
placeholder="姓名/易记码/编号/注册领域"
|
||||
style="width: 300px;margin-left:10px"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="handleFilter"
|
||||
|
@ -67,7 +67,7 @@
|
|||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="编号">
|
||||
<template slot-scope="scope">{{ scope.row.code }}</template>
|
||||
<template slot-scope="scope" v-if="scope.row.code">{{ scope.row.code }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="账号">
|
||||
<template slot-scope="scope">{{ scope.row.user.username }}</template>
|
||||
|
@ -79,10 +79,15 @@
|
|||
<template slot-scope="scope">{{ scope.row.user.dept_name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="身份证号">
|
||||
<template slot-scope="scope">{{ scope.row.ID_number }}</template>
|
||||
<template slot-scope="scope" v-if="scope.row.ID_number">{{ scope.row.ID_number }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最高学历">
|
||||
<template slot-scope="scope">{{ scope.row.max_edu }}</template>
|
||||
<template slot-scope="scope" v-if="scope.row.max_edu">{{ scope.row.max_edu }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="注册领域">
|
||||
<template slot-scope="scope" v-if="scope.row.fields">
|
||||
<el-tag v-for="(item, index) in scope.row.fields.split(',')" :key="index" style="margin:2px" >{{item}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建日期">
|
||||
<template slot-scope="scope">
|
||||
|
|
|
@ -270,6 +270,7 @@ import { getDictList } from "@/api/dict";
|
|||
import { genTree } from "@/utils";
|
||||
import { getEmployee, updateEmployee } from "@/api/employee";
|
||||
const defaultForm = {
|
||||
user:{},
|
||||
is_onjob: true,
|
||||
is_fulltime: true,
|
||||
is_payinsurance: true
|
||||
|
|
|
@ -87,12 +87,12 @@
|
|||
:disabled="!checkPermission(['implementrule_update'])"
|
||||
@click="handleUpdate(scope)"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
:disabled="!checkPermission(['implementrule_update'])"
|
||||
@click="handleUpate(scope)"
|
||||
>单元划分</el-button>
|
||||
>单元划分</el-button> -->
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
|
@ -143,7 +143,7 @@ export default {
|
|||
this.listLoading = true;
|
||||
getImplementRuleList(this.listQuery).then(response => {
|
||||
if (response.data) {
|
||||
this.ruleList = response.data.results
|
||||
this.ruleList = response.data
|
||||
}
|
||||
this.listLoading = false
|
||||
});
|
||||
|
|
|
@ -74,6 +74,7 @@
|
|||
<el-form-item label="产品分类" prop="pv_class">
|
||||
<treeselect
|
||||
v-model="formData.pv_class"
|
||||
:disable-branch-nodes="true"
|
||||
placeholder="请选择产品分类"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
|
@ -86,6 +87,7 @@
|
|||
<el-form-item label="产品分类" prop="ccc_list">
|
||||
<treeselect
|
||||
v-model="formData.ccc_list"
|
||||
:disable-branch-nodes="true"
|
||||
placeholder="请选择产品分类"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
|
|
|
@ -78,6 +78,7 @@
|
|||
<treeselect
|
||||
v-model="formData.pv_class"
|
||||
placeholder="请选择产品分类"
|
||||
:disable-branch-nodes="true"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
:options="pv_classOptions"
|
||||
|
@ -90,6 +91,7 @@
|
|||
<treeselect
|
||||
v-model="formData.ccc_list"
|
||||
placeholder="请选择产品分类"
|
||||
:disable-branch-nodes="true"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
:options="ccc_listOptions"
|
||||
|
@ -128,13 +130,14 @@
|
|||
</template>
|
||||
<script>
|
||||
import { getDictList } from "@/api/dict";
|
||||
import { createImplementRule, getImplementRule } from "@/api/implementrule";
|
||||
import { updateImplementRule, getImplementRule } from "@/api/implementrule";
|
||||
import { genTree } from "@/utils";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import { upUrl, upHeaders } from "@/api/file";
|
||||
import Unittype from "@/views/implementrule/unittype"
|
||||
export default {
|
||||
components: { Treeselect },
|
||||
components: { Treeselect, Unittype },
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
|
@ -300,7 +303,7 @@ export default {
|
|||
this.$refs["elForm"].validate(valid => {
|
||||
if (!valid) return;
|
||||
// TODO 提交表单
|
||||
createImplementRule(this.formData).then(response => {
|
||||
updateImplementRule(this.formData.id, this.formData).then(response => {
|
||||
this.$router.go(-1);
|
||||
});
|
||||
});
|
||||
|
@ -309,8 +312,9 @@ export default {
|
|||
this.$refs["elForm"].validate(valid => {
|
||||
if (!valid) return;
|
||||
// TODO 提交表单
|
||||
createImplementRule(this.formData).then(response => {
|
||||
updateImplementRule(this.formData.id, this.formData).then(response => {
|
||||
//this.$router.go(-1);
|
||||
this.$message.success('成功')
|
||||
});
|
||||
});
|
||||
},
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
|
@ -0,0 +1,5 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class ApplicationConfig(AppConfig):
|
||||
name = 'application'
|
|
@ -0,0 +1,20 @@
|
|||
from django.db import models
|
||||
from apps.system.models import CommonAModel, Dict, User, CommonBModel
|
||||
from apps.certset.models import ImplementRule
|
||||
from simple_history.models import HistoricalRecords
|
||||
from rest_framework.exceptions import ParseError
|
||||
# Create your models here.
|
||||
|
||||
class Application(CommonBModel):
|
||||
"""
|
||||
认证项目申请
|
||||
"""
|
||||
status_choices = (
|
||||
('草稿', '草稿'),
|
||||
('已申请', '已申请'),
|
||||
('已受理', '已受理'),
|
||||
('进行中', '进行中'),
|
||||
('已中止', '已中止'),
|
||||
('已完成', '已完成')
|
||||
)
|
||||
pass
|
|
@ -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.
|
|
@ -0,0 +1,14 @@
|
|||
# Generated by Django 3.0.7 on 2020-07-27 01:33
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('employee', '0014_auto_20200717_0832'),
|
||||
('employee', '0005_auto_20200714_0943'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
]
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.0.7 on 2020-07-27 01:33
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('employee', '0015_merge_20200727_0933'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='employee',
|
||||
name='fields',
|
||||
field=models.TextField(blank=True, verbose_name='专业领域'),
|
||||
),
|
||||
]
|
|
@ -41,6 +41,7 @@ class Employee(CommonAModel):
|
|||
address = models.TextField('详细地址', null=True, blank=True)
|
||||
signature = models.CharField('签名图片', max_length=200, null=True, blank=True)
|
||||
max_edu = models.TextField('最高学历', blank=True)
|
||||
fields = models.TextField('专业领域', blank=True)
|
||||
|
||||
class Meta:
|
||||
verbose_name = '人员详细信息'
|
||||
|
@ -89,6 +90,10 @@ class Qualification(CommonAModel):
|
|||
for i in Ability.objects.filter(employee=self.employee, cert_field=self.cert_field):
|
||||
i.auditor_abilitys.add(Dict.objects.get(code='checker_auditor'))
|
||||
super().save(*args, **kwargs)
|
||||
fields = Qualification.objects.filter(is_enabled=True, is_deleted=False).values_list('cert_field__code', flat=True)
|
||||
if self.employee.fields != ','.join(fields):
|
||||
self.employee.fields = ','.join(fields)
|
||||
self.employee.save()
|
||||
|
||||
|
||||
class Ability(CommonAModel):
|
||||
|
|
|
@ -15,7 +15,7 @@ class EmployeeViewSet(CreateUpdateCustomMixin, OptimizationMixin, ModelViewSet):
|
|||
'put': 'employee_update', 'delete': 'employee_delete'}
|
||||
queryset = Employee.objects.all()
|
||||
serializer_class = EmployeeSerializer
|
||||
search_fields = ['code', 'remember_code', 'user__name']
|
||||
search_fields = ['code', 'remember_code', 'user__name', 'fields']
|
||||
filterset_fields = ['is_onjob', 'is_fulltime', 'user__dept']
|
||||
ordering = ['-create_time']
|
||||
|
||||
|
@ -29,7 +29,7 @@ class QualificationViewSet(CreateUpdateCustomMixin, OptimizationMixin, ModelView
|
|||
queryset = Qualification.objects.all()
|
||||
serializer_class = QualificationSerializer
|
||||
search_fields = ['cert_number', 'auditor_type__name']
|
||||
filterset_fields = ['auditor_type', 'cert_field', 'is_enabled']
|
||||
filterset_fields = ['auditor_type', 'cert_field', 'is_enabled', 'employee']
|
||||
ordering = ['-create_time']
|
||||
|
||||
class AbilityViewSet(CreateUpdateCustomMixin, OptimizationMixin, ModelViewSet):
|
||||
|
@ -41,7 +41,7 @@ class AbilityViewSet(CreateUpdateCustomMixin, OptimizationMixin, ModelViewSet):
|
|||
queryset = Ability.objects.all()
|
||||
serializer_class = AbilitySerializer
|
||||
search_fields = ['major__code', 'major_rule__code']
|
||||
filterset_fields = ['major', 'major_rule', 'auditor_abilitys', 'afrom']
|
||||
filterset_fields = ['major', 'major_rule', 'auditor_abilitys', 'afrom', 'employee']
|
||||
ordering = ['-create_time']
|
||||
|
||||
class EducationViewSet(CreateUpdateCustomMixin, OptimizationMixin, ModelViewSet):
|
||||
|
@ -53,7 +53,7 @@ class EducationViewSet(CreateUpdateCustomMixin, OptimizationMixin, ModelViewSet)
|
|||
queryset = Education.objects.all()
|
||||
serializer_class = EducationSerializer
|
||||
search_fields = ['school', 'major', 'employee__name']
|
||||
filterset_fields = ['level']
|
||||
filterset_fields = ['level', 'employee']
|
||||
ordering = ['level__sort']
|
||||
|
||||
class TrainViewSet(CreateUpdateCustomMixin, OptimizationMixin, ModelViewSet):
|
||||
|
|
|
@ -76,11 +76,11 @@ class DictViewSet(ModelViewSet):
|
|||
'put': 'dict_update', 'delete': 'dict_delete'}
|
||||
# queryset = Dict.objects.get_queryset(all=True) # 获取全部的,包括软删除的
|
||||
queryset = Dict.objects.all()
|
||||
filterset_fields = ['type', 'is_deleted', 'type__code']
|
||||
filterset_fields = ['type', 'is_used', 'type__code']
|
||||
serializer_class = DictSerializer
|
||||
search_fields = ['name']
|
||||
ordering_fields = ['sort']
|
||||
ordering = ['is_deleted', 'sort']
|
||||
ordering = ['sort']
|
||||
|
||||
def paginate_queryset(self, queryset):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue