part sort

This commit is contained in:
caoqianming 2020-09-25 14:46:01 +08:00
parent 402705b4f3
commit be7ec8a803
8 changed files with 56 additions and 75 deletions

View File

@ -73,28 +73,37 @@
@filter-change="filterChange"
>
<el-table-column type="index" width="50" />
<el-table-column align="center" label="大类名称">
<el-table-column label="大类名称">
<template slot-scope="scope">{{ scope.row.dlmc }}</template>
</el-table-column>
<el-table-column align="header-center" label="类别名称">
<el-table-column label="类别名称">
<template slot-scope="scope">{{ scope.row.lbmc }}</template>
</el-table-column>
<el-table-column align="header-center" label="项目序号">
<el-table-column label="项目序号">
<template slot-scope="scope">{{ scope.row.xmxh }}</template>
</el-table-column>
<el-table-column align="header-center" label="项目名称">
<el-table-column label="项目名称">
<template slot-scope="scope">{{ scope.row.xmmc }}</template>
</el-table-column>
<el-table-column align="header-center" label="标准名称" width="300">
<el-table-column label="标准名称" width="300">
<template slot-scope="scope">{{ scope.row.bzmc }}</template>
</el-table-column>
<el-table-column align="header-center" label="标准编号">
<el-table-column label="标准编号">
<template slot-scope="scope">{{ scope.row.bzbh }}</template>
</el-table-column>
<el-table-column align="header-center" label="限制范围">
<el-table-column label="限制范围">
<template slot-scope="scope">{{ scope.row.xzfw }}</template>
</el-table-column>
<el-table-column align="header-center" label="关联资质" prop="glzz"
<el-table-column label="限制范围">
<template slot-scope="scope">{{ scope.row.xzfw }}</template>
</el-table-column>
<el-table-column label="创建日期">
<template slot-scope="scope">{{ scope.row.create_time.substring(0,10) }}</template>
</el-table-column>
<el-table-column label="变更日期">
<template slot-scope="scope">{{ scope.row.update_time.substring(0,10) }}</template>
</el-table-column>
<el-table-column label="关联资质" prop="glzz"
column-key="glzz"
:filters="groupBy.glzz"
:filter-multiple="false">

View File

@ -62,6 +62,9 @@
<el-form-item label="上级部门" prop="pid">
<treeselect v-model="org.pid" :multiple="false" :options="tableData" placeholder="父级"/>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number v-model="org.sort" :min="1" :max="10" ></el-input-number>
</el-form-item>
</el-form>
<div style="text-align:right;">
<el-button type="danger" @click="dialogVisible=false">取消</el-button>
@ -81,7 +84,8 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
const defaultOrg = {
id: null,
name: '',
pid: null
pid: null,
sort:1
}
export default {
components: { Treeselect },
@ -155,10 +159,7 @@ export default {
.then(async() => {
await deleteOrg(scope.row.id)
this.getList()
this.$message({
type: 'success',
message: '成功删除!'
})
this.$message.success('成功')
})
.catch(err => {
console.error(err)
@ -172,12 +173,7 @@ export default {
updateOrg(this.org.id, this.org).then(() => {
this.getList()
this.dialogVisible = false
this.$notify({
title: '成功',
message: '编辑成功',
type: 'success',
duration: 2000
})
this.$message.success('成功')
})
} else {
createOrg(this.org).then(res => {
@ -185,12 +181,7 @@ export default {
// this.tableData.unshift(this.org)
this.getList()
this.dialogVisible = false
this.$notify({
title: '成功',
message: '新增成功',
type: 'success',
duration: 2000
})
this.$message.success('成功')
})
}
} else {

View File

@ -167,10 +167,7 @@ export default {
.then(async() => {
await deletePerm(scope.row.id)
this.getList()
this.$message({
type: 'success',
message: '成功删除!'
})
this.$message.success('成功')
})
.catch(err => {
console.error(err)
@ -184,12 +181,7 @@ export default {
updatePerm(this.perm.id, this.perm).then(() => {
this.getList()
this.dialogVisible = false
this.$notify({
title: '成功',
message: '编辑成功',
type: 'success',
duration: 2000
})
this.$message.success('成功')
})
} else {
createPerm(this.perm).then(res => {
@ -197,12 +189,7 @@ export default {
// this.tableData.unshift(this.perm)
this.getList()
this.dialogVisible = false
this.$notify({
title: '成功',
message: '新增成功',
type: 'success',
duration: 2000
})
this.$message.success('成功')
})
}
} else {

View File

@ -218,10 +218,7 @@ export default {
.then(async() => {
await deleteRole(row.id)
this.tableData.splice($index, 1)
this.$message({
type: 'success',
message: '成功删除!'
})
this.$message.success('成功')
})
.catch(err => {
console.error(err)
@ -254,15 +251,7 @@ export default {
const { desc, name } = this.role
this.dialogVisible = false
this.$notify({
title: '成功',
dangerouslyUseHTMLString: true,
message: `
<div>角色名: ${name}</div>
<div>角色描述: ${desc}</div>
`,
type: 'success'
})
this.$message.success('成功')
}
}
}

View File

@ -329,10 +329,7 @@ export default {
.then(async () => {
await deleteUser(scope.row.id);
this.userList.splice(scope.row.index, 1);
this.$message({
type: "success",
message: "成功删除!"
});
this.$message.success('成功')
})
.catch(err => {
console.error(err);
@ -347,12 +344,7 @@ export default {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$notify({
title: "成功",
message: "编辑成功",
type: "success",
duration: 2000
});
this.$message.success('成功')
}
});
} else {
@ -360,12 +352,7 @@ export default {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$notify({
title: "成功",
message: "新增成功",
type: "success",
duration: 2000
});
this.$message.success('成功')
}
});
}

View File

@ -0,0 +1,18 @@
# Generated by Django 3.0.7 on 2020-09-25 06:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('system', '0004_message'),
]
operations = [
migrations.AddField(
model_name='organization',
name='sort',
field=models.IntegerField(default=1, verbose_name='排序'),
),
]

View File

@ -64,7 +64,7 @@ class Organization(SoftModel):
choices=organization_type_choices, default='部门')
pid = models.ForeignKey('self', null=True, blank=True,
on_delete=models.SET_NULL, verbose_name='')
sort = models.IntegerField('排序', default=1)
class Meta:
verbose_name = '组织架构'
verbose_name_plural = verbose_name

View File

@ -166,7 +166,7 @@ class PermissionViewSet(ModelViewSet):
pagination_class = None
search_fields = ['name']
ordering_fields = ['sort']
ordering = 'id'
ordering = 'sort'
class OrganizationViewSet(ModelViewSet):
@ -178,9 +178,9 @@ class OrganizationViewSet(ModelViewSet):
queryset = Organization.objects.all()
serializer_class = OrganizationSerializer
pagination_class = None
search_fields = ['^name', '^method']
ordering_fields = ['id']
ordering = 'id'
search_fields = ['name']
ordering_fields = ['sort']
ordering = ['sort', 'pk']
class RoleViewSet(ModelViewSet):