feature:<master> feat:新增质量活动的增删改查以及前端页面功能
This commit is contained in:
parent
3a38185a81
commit
e5df963e99
|
@ -0,0 +1,57 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export function getRcs(query) {
|
||||||
|
return request({
|
||||||
|
url: '/info/qa/',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getMyRcs(query) {
|
||||||
|
return request({
|
||||||
|
url: '/info/qa/activate_info/',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getRc(id) {
|
||||||
|
return request({
|
||||||
|
url: `/info/qa/${id}/`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function updateRc(id, data) {
|
||||||
|
return request({
|
||||||
|
url: `/info/qa/${id}/`,
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createRc(data) {
|
||||||
|
return request({
|
||||||
|
url: `/info/qa/`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getRc_activate() {
|
||||||
|
return request({
|
||||||
|
url: `/info/qa/activate_info/`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del_activate(id) {
|
||||||
|
return request({
|
||||||
|
url: `/info/qa/${id}/`,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
|
@ -425,13 +425,13 @@ export const asyncRoutes = [
|
||||||
path: 'qualityCommend',
|
path: 'qualityCommend',
|
||||||
name: 'qualityCommend',
|
name: 'qualityCommend',
|
||||||
component: () => import('@/views/informatiomCollect/qualityCommend.vue'),
|
component: () => import('@/views/informatiomCollect/qualityCommend.vue'),
|
||||||
meta: { title: '质量表彰', perms: ['infoCollect_QC'] }
|
meta: { title: '质量活动', perms: ['infoCollect_QC'] }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'qualityActive.',
|
path: 'qualityActive.',
|
||||||
name: 'qualityActive.',
|
name: 'qualityActive.',
|
||||||
component: () => import('@/views/informatiomCollect/qualityActive.vue'),
|
component: () => import('@/views/informatiomCollect/qualityActive.vue'),
|
||||||
meta: { title: '质量活动', perms: ['infoCollect_QA'] }
|
meta: { title: '质量表彰', perms: ['infoCollect_QA'] }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'laboratoryContact',
|
path: 'laboratoryContact',
|
||||||
|
|
|
@ -4,23 +4,28 @@
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="handleAddFile">新增</el-button>
|
<el-button type="primary" icon="el-icon-plus" @click="handleAddFile">新增</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card style="margin-top: 10px">
|
<el-card style="margin-top: 10px">
|
||||||
<el-table v-loading="listLoading" :data="tableData.results" :hieght="tableHeight" border fit stripe
|
<el-table v-loading="listLoading"
|
||||||
|
:data="tableData.results"
|
||||||
|
border fit stripe height="500px"
|
||||||
highlight-current-row>
|
highlight-current-row>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column label="文件名称">
|
<el-table-column label="活动名称" prop="name"></el-table-column>
|
||||||
<template slot-scope="scope">{{ scope.row.name }}</template>
|
<el-table-column label="活动角色" prop="roles">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ac_options[scope.row.roles]}}</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="文件描述">
|
<el-table-column label="合作方" prop="collaborators"></el-table-column>
|
||||||
<template slot-scope="scope">{{ scope.row.description }}</template>
|
<el-table-column label="组织单位" prop="orgunits"></el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="活动地点" prop="place"></el-table-column>
|
||||||
<el-table-column label="文件格式">
|
<el-table-column label="活动参与单位数量" prop="participations"></el-table-column>
|
||||||
<template slot-scope="scope">{{ scope.row.file_.mime }}</template>
|
<el-table-column label="活动中发挥的作用" prop="function"></el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="活动收益" prop="earnings"></el-table-column>
|
||||||
<el-table-column align="center" label="文件下载">
|
<!-- <el-table-column align="center" label="文件下载">
|
||||||
<template slot-scope="scope" v-if="scope.row.file_.file">
|
<template slot-scope="scope" v-if="scope.row.file_.file">
|
||||||
<el-link :href="scope.row.file_.file" type="primary">下载</el-link>
|
<el-link :href="scope.row.file_.file" type="primary">下载</el-link>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column align="center" label="操作" width="120px" fixed="right">
|
<el-table-column align="center" label="操作" width="120px" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-link :disabled="!checkPermission(['infoCollect_RS'])" type="primary" size="small"
|
<el-link :disabled="!checkPermission(['infoCollect_RS'])" type="primary" size="small"
|
||||||
|
@ -31,27 +36,77 @@
|
||||||
@click="handleDelete(scope)">删除</el-link>
|
@click="handleDelete(scope)">删除</el-link>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-col :span="12" style="margin-top: 5px;">
|
||||||
|
<div class="cardHead">
|
||||||
|
<span class="cardTitle">质量活动</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination v-show="tableData.count > 0" :total="tableData.count" :page.sync="listQuery.page"
|
<pagination v-show="tableData.count > 0" :total="tableData.count" :page.sync="listQuery.page"
|
||||||
:limit.sync="listQuery.page_size" @pagination="getTableList" />
|
:limit.sync="listQuery.page_size" @pagination="getTableList" />
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-dialog :visible.sync="dialogVisible" :title="dialogType === 'edit' ? '编辑评审' : '新增评审'">
|
<el-dialog :visible.sync="dialogVisible" :title="dialogType === 'edit' ? '编辑' : '新增'">
|
||||||
<el-form ref="Form" :model="Content" label-width="80px" label-position="right" :rules="rule">
|
<el-form ref="Form" :model="Content" label-width="80px" label-position="right" :rules="rule">
|
||||||
<el-form-item label="评审名称" prop="name">
|
<el-form-item label="名称" prop="name">
|
||||||
<el-input v-model="Content.name" placeholder="评审名称" />
|
<el-input v-model="Content.name" placeholder="名称"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="活动角色">
|
||||||
<el-form-item label="" prop="description">
|
<el-select
|
||||||
<el-input type="textarea" :rows="2" v-model="Content.description" placeholder="评审描述" />
|
v-model="Content.roles"
|
||||||
|
placeholder="请选择"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in activateOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.key"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="评审文件" prop="file" v-if="dialogVisible">
|
<el-form-item label="合作方" prop="collaborators">
|
||||||
|
<el-input v-model="Content.collaborators" ></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="组织单位" prop="orgunits">
|
||||||
|
<el-input v-model="Content.orgunits" ></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="活动地点" prop="place">
|
||||||
|
<el-input v-model="Content.place"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="活动参与单位数量" prop="participations" >
|
||||||
|
<el-input-number
|
||||||
|
v-model="Content.participations"
|
||||||
|
:min="1"
|
||||||
|
controls-position="right"
|
||||||
|
:step="1"
|
||||||
|
step-strictly="true"
|
||||||
|
/>
|
||||||
|
<!-- <el-input v-model="Content.participations"></el-input> -->
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="活动中发挥的作用" prop="function" >
|
||||||
|
<el-input v-model="Content.function"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="活动收益" prop="earnings" >
|
||||||
|
<el-input v-model="Content.earnings"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="活动时间" prop="activate_time">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="Content.activate_time"
|
||||||
|
type="date"
|
||||||
|
placeholder="选择日期"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
style="width:50%"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="文件" prop="file" v-if="dialogVisible">
|
||||||
<el-upload ref="upload" :action="upUrl" :on-preview="handlePreview" :on-success="handleUpSuccess"
|
<el-upload ref="upload" :action="upUrl" :on-preview="handlePreview" :on-success="handleUpSuccess"
|
||||||
:on-remove="handleRemove" :headers="upHeaders" :file-list="fileList" :limit="1"
|
:on-remove="handleRemove" :headers="upHeaders" :file-list="fileList" :limit="1"
|
||||||
accept=".doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf">
|
accept=".doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf">
|
||||||
<el-button size="small" type="primary">上传文件</el-button>
|
<el-button size="small" type="primary">上传文件</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<div style="text-align: right">
|
<div style="text-align: right">
|
||||||
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||||
|
@ -66,16 +121,36 @@ import Pagination from "@/components/Pagination"; // secondary package based on
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
import { getDictList, getDictTypeList } from "@/api/dict";
|
import { getDictList, getDictTypeList } from "@/api/dict";
|
||||||
|
import { getRcs, createRc, del_activate, updateRc, getMyRcs } from "@/api/qa";
|
||||||
import { upUrl, upHeaders } from "@/api/file";
|
import { upUrl, upHeaders } from "@/api/file";
|
||||||
|
|
||||||
const defaultContent = {
|
const defaultContent = {
|
||||||
name: "",
|
name: "",
|
||||||
description: "",
|
roles: "",
|
||||||
file: null
|
collaborators: "",
|
||||||
|
orgunits: "",
|
||||||
|
place: "",
|
||||||
|
activate_time: "",
|
||||||
|
participations: "",
|
||||||
|
function: "",
|
||||||
|
earnings: ""
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { Pagination, Treeselect },
|
components: { Pagination, Treeselect },
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
|
form: {
|
||||||
|
name: "",
|
||||||
|
roles: "",
|
||||||
|
collaborators: "",
|
||||||
|
orgunits: "",
|
||||||
|
place: "",
|
||||||
|
activate_time: "",
|
||||||
|
participations: "",
|
||||||
|
function: "",
|
||||||
|
earnings: "",
|
||||||
|
},
|
||||||
upHeaders: upHeaders(),
|
upHeaders: upHeaders(),
|
||||||
upUrl: upUrl(),
|
upUrl: upUrl(),
|
||||||
fileList: [],
|
fileList: [],
|
||||||
|
@ -95,17 +170,13 @@ export default {
|
||||||
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
||||||
},
|
},
|
||||||
filterOrgText: "",
|
filterOrgText: "",
|
||||||
tableHeight: null,
|
// tableHeight: '300px',
|
||||||
};
|
activateOptions:[
|
||||||
},
|
{key:'组织方',value:0},
|
||||||
computed: {},
|
{key:'参与方',value:1}
|
||||||
watch: {
|
],
|
||||||
filterOrgText(val) {
|
ac_options:{0:'组织方', 1:'参与方'}
|
||||||
this.$refs.tree.filter(val);
|
}
|
||||||
},
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
@ -117,8 +188,25 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
//提交表单
|
||||||
|
submitForm(formName) {
|
||||||
|
this.$refs[formName].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.dialogType == "new") {
|
||||||
|
this.addData();
|
||||||
|
} else {
|
||||||
|
this.editData();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log("error submit!!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
getTableList(){
|
getTableList(){
|
||||||
this.getList();
|
this.getList()
|
||||||
|
|
||||||
},
|
},
|
||||||
handlePreview(file) {
|
handlePreview(file) {
|
||||||
if ("url" in file) {
|
if ("url" in file) {
|
||||||
|
@ -142,8 +230,18 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
getList() {
|
getList() {
|
||||||
},
|
this.listLoading = true;
|
||||||
|
this.tableData.results =[];
|
||||||
|
this.tableData.count =0;
|
||||||
|
getMyRcs(this.listQuery).then((response) => {
|
||||||
|
console.log(response);
|
||||||
|
if (response.data) {
|
||||||
|
this.tableData = response.data;
|
||||||
|
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
handleFilter() {
|
handleFilter() {
|
||||||
this.listQuery.page = 1;
|
this.listQuery.page = 1;
|
||||||
|
@ -181,9 +279,12 @@ export default {
|
||||||
type: "error",
|
type: "error",
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
// await deleteDoc(scope.row.id);
|
await del_activate(scope.row.id).then(() => {
|
||||||
// this.getList();
|
this.getList();
|
||||||
// this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
|
this.getTableList();
|
||||||
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
@ -195,9 +296,23 @@ export default {
|
||||||
const isEdit = this.dialogType === "edit";
|
const isEdit = this.dialogType === "edit";
|
||||||
if (isEdit) {
|
if (isEdit) {
|
||||||
console.log(this.Content)
|
console.log(this.Content)
|
||||||
|
updateRc(this.Content.id, this.Content).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.tableData = response.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.getTableList();
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
|
createRc(this.Content).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.tableData = response.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.getTableList();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -205,6 +320,8 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style></style>
|
<style></style>
|
||||||
|
@/api/qa
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 3.2.12 on 2024-03-29 08:35
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('information', '0010_rename_time_qualityactivities_activate_time'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='qualityactivities',
|
||||||
|
old_name='organizational_units',
|
||||||
|
new_name='orgunits',
|
||||||
|
),
|
||||||
|
]
|
|
@ -43,7 +43,7 @@ class QualityActivities(models.Model):
|
||||||
name = models.CharField(max_length=20, unique=True, verbose_name='活动名称')
|
name = models.CharField(max_length=20, unique=True, verbose_name='活动名称')
|
||||||
roles = models.PositiveSmallIntegerField(max_length=20, choices=role, verbose_name='参与角色')
|
roles = models.PositiveSmallIntegerField(max_length=20, choices=role, verbose_name='参与角色')
|
||||||
collaborators = models.CharField(max_length=20, verbose_name='合作方')
|
collaborators = models.CharField(max_length=20, verbose_name='合作方')
|
||||||
organizational_units = models.CharField(max_length=20, verbose_name='组织单位')
|
orgunits = models.CharField(max_length=20, verbose_name='组织单位')
|
||||||
place = models.CharField(max_length=50, verbose_name='活动地点')
|
place = models.CharField(max_length=50, verbose_name='活动地点')
|
||||||
activate_time = models.DateField(verbose_name='活动时间', null=True)
|
activate_time = models.DateField(verbose_name='活动时间', null=True)
|
||||||
participations = models.IntegerField(verbose_name='活动参与单位数量', null=True, blank=True)
|
participations = models.IntegerField(verbose_name='活动参与单位数量', null=True, blank=True)
|
||||||
|
|
|
@ -3,11 +3,11 @@ from rest_framework import routers
|
||||||
from .views import AbilityReviewViewSet, QualityCommendationViewSet, QualityActivitiesViewSet, ContactViewSet, ExternalAuditorsViewSet
|
from .views import AbilityReviewViewSet, QualityCommendationViewSet, QualityActivitiesViewSet, ContactViewSet, ExternalAuditorsViewSet
|
||||||
|
|
||||||
router = routers.DefaultRouter()
|
router = routers.DefaultRouter()
|
||||||
router.register('abilityreviews', AbilityReviewViewSet, basename='abilityreviews')
|
router.register('ar', AbilityReviewViewSet, basename='abilityreviews')
|
||||||
router.register('qualitycommendation', QualityCommendationViewSet, basename='qualitycommendation')
|
router.register('qc', QualityCommendationViewSet, basename='qualitycommendation')
|
||||||
router.register('qualityactivities', QualityActivitiesViewSet, basename='qualityactivities')
|
router.register('qa', QualityActivitiesViewSet, basename='qualityactivities')
|
||||||
router.register('contact', ContactViewSet, basename='contact')
|
router.register('contact', ContactViewSet, basename='contact')
|
||||||
router.register('externalauditors', ExternalAuditorsViewSet, basename='externalauditors')
|
router.register('ea', ExternalAuditorsViewSet, basename='externalauditors')
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('', include(router.urls))
|
path('', include(router.urls))
|
||||||
]
|
]
|
|
@ -145,8 +145,8 @@ class QualityCommendationViewSet(ImpMixin, ModelViewSet):
|
||||||
|
|
||||||
# 查询子以及已经本公司的质量表彰
|
# 查询子以及已经本公司的质量表彰
|
||||||
@action(detail=False, methods=['get'])
|
@action(detail=False, methods=['get'])
|
||||||
def commentdation_info(self, *args, **kwargs):
|
def commentdation_info(self, request, *args, **kwargs):
|
||||||
father_dept = self.request.user.dept
|
father_dept = request.user.dept
|
||||||
child_dept = get_child_queryset2(father_dept)
|
child_dept = get_child_queryset2(father_dept)
|
||||||
query = QualityCommendation.objects.filter(department__in=child_dept)
|
query = QualityCommendation.objects.filter(department__in=child_dept)
|
||||||
serializer = QualityCommendationSerializer(query, many=True)
|
serializer = QualityCommendationSerializer(query, many=True)
|
||||||
|
@ -159,25 +159,27 @@ class QualityActivitiesViewSet(ModelViewSet):
|
||||||
serializer_class = QualityActivitiesSerializer
|
serializer_class = QualityActivitiesSerializer
|
||||||
|
|
||||||
def create(self, request):
|
def create(self, request):
|
||||||
if Organization.objects.filter(name=self.request.data['organizational_units']).exists():
|
print("---------------------", self.request.data)
|
||||||
department_id = Organization.objects.filter(name=self.request.data['organizational_units']).first().id
|
if Organization.objects.filter(name=self.request.data['orgunits']).exists():
|
||||||
|
department_id = Organization.objects.filter(name=self.request.data['orgunits']).first().id
|
||||||
self.request.data['department'] = department_id
|
self.request.data['department'] = department_id
|
||||||
print("-----------,",self.request.data)
|
|
||||||
serializer = self.get_serializer(data=self.request.data)
|
serializer = self.get_serializer(data=self.request.data)
|
||||||
if serializer.is_valid(raise_exception=True):
|
if serializer.is_valid(raise_exception=True):
|
||||||
serializer.save()
|
serializer.save()
|
||||||
return Response(serializer.data, status = status.HTTP_201_CREATED)
|
return Response(serializer.data, status = status.HTTP_201_CREATED)
|
||||||
else:
|
else:
|
||||||
raise ParseError("部门不存在")
|
raise ParseError("组织单位不存在")
|
||||||
|
|
||||||
# 查询子以及已经本公司的质量活动
|
# 查询子以及已经本公司的质量活动
|
||||||
@action(detail=False, methods=['get'])
|
@action(detail=False, methods=['get'])
|
||||||
def activate_info(self, *args, **kwargs):
|
def activate_info(self, request, *args, **kwargs):
|
||||||
father_dept = self.request.user.dept
|
child_dept = get_child_queryset2(request.user.dept)
|
||||||
child_dept = get_child_queryset2(father_dept)
|
|
||||||
query = QualityActivities.objects.filter(department__in=child_dept)
|
query = QualityActivities.objects.filter(department__in=child_dept)
|
||||||
serializer = QualityActivitiesSerializer(query, many=True)
|
serializer = QualityActivitiesSerializer(query, many=True)
|
||||||
return Response(serializer.data)
|
data = {'count':len(serializer.data), 'results':serializer.data}
|
||||||
|
print("return Response(serializer.data)", data)
|
||||||
|
return Response(data, status = status.HTTP_200_OK)
|
||||||
|
|
||||||
|
|
||||||
class ContactViewSet(mixins.CreateModelMixin,
|
class ContactViewSet(mixins.CreateModelMixin,
|
||||||
mixins.ListModelMixin,
|
mixins.ListModelMixin,
|
||||||
|
|
Loading…
Reference in New Issue