This commit is contained in:
shilixia 2021-03-23 09:09:42 +08:00
commit 66f68e5a34
4 changed files with 23 additions and 23 deletions

View File

@ -62,7 +62,7 @@ div:focus {
// main-container global css // main-container global css
.app-container { .app-container {
padding: 10px; padding: 6px;
} }
.el-table--medium td,   .el-table--medium th { .el-table--medium td,   .el-table--medium th {

View File

@ -1,12 +1,11 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card style="margin-top: 10px"> <el-card>
<div> <div>
<el-input <el-input
v-model="listQuery.content_name" v-model="listQuery.content_name"
placeholder="材料名称" placeholder="材料名称"
style="width: 200px" style="width: 140px"
class="filter-item"
@keyup.enter.native="handleFilter" @keyup.enter.native="handleFilter"
/> />
<el-select <el-select
@ -14,7 +13,6 @@
placeholder="是否主动报送" placeholder="是否主动报送"
clearable clearable
style="width: 140px" style="width: 140px"
class="filter-item"
@change="handleFilter" @change="handleFilter"
> >
<el-option <el-option
@ -29,7 +27,6 @@
placeholder="记录状态" placeholder="记录状态"
clearable clearable
style="width: 140px" style="width: 140px"
class="filter-item"
@change="handleFilter" @change="handleFilter"
> >
<el-option <el-option
@ -45,7 +42,6 @@
placeholder="上报部门" placeholder="上报部门"
clearable clearable
style="width: 140px" style="width: 140px"
class="filter-item"
@change="handleFilter" @change="handleFilter"
> >
<el-option <el-option
@ -78,16 +74,13 @@
>搜索</el-button >搜索</el-button
> >
<el-button <el-button
class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</el-button >重置</el-button
> >
</div> </div>
</el-card> <div style="margin-top: 10px">
<el-card style="margin-top: 10px">
<el-row>
<el-button type="primary" @click="centerDialogVisible = true" plain <el-button type="primary" @click="centerDialogVisible = true" plain
>主动上报</el-button >主动上报</el-button
> >
@ -107,8 +100,8 @@
<el-button type="primary" @click="contentup()">确认</el-button> <el-button type="primary" @click="contentup()">确认</el-button>
</span> </span>
</el-dialog> </el-dialog>
</el-row> </div>
</el-card> </el-card>
<el-card style="margin-top: 10px"> <el-card style="margin-top: 10px">
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
@ -124,9 +117,9 @@
<el-table-column width="150px" label="任务标题"> <el-table-column width="150px" label="任务标题">
<template slot-scope="scope" > <template slot-scope="scope" >
<el-tag type="" effect="plain" hit="false" v-if="scope.row.task">{{ <span v-if="scope.row.task">{{
scope.row.task_.name scope.row.task_.name
}}</el-tag> }}</span>
<el-tag type="warning" effect="plain" v-else> <el-tag type="warning" effect="plain" v-else>
主动报送 主动报送
</el-tag> </el-tag>
@ -398,7 +391,6 @@ export default {
}, },
getContentsList() { getContentsList() {
getContentList({ can_doself: this.can_doself }).then((res) => { getContentList({ can_doself: this.can_doself }).then((res) => {
console.log(res.data)
this.contentOptions = res.data; this.contentOptions = res.data;
}); });
@ -407,6 +399,12 @@ export default {
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 = {
page:1,
page_size:20,
state:'待上报',
is_self:true
}
this. getList(); this. getList();
}); });
} else { } else {

View File

@ -24,8 +24,8 @@
<span class="desc" v-if="task.create_by_"> <span class="desc" v-if="task.create_by_">
{{ task.create_by_.name }}/</span {{ task.create_by_.name }}/</span
> >
<span class="desc" v-if="task.belong_belong_dept_">{{ <span class="desc" v-if="task.belong_dept_">{{
task.belong_belong_dept_.name task.belong_dept_.name
}}</span> }}</span>
</div> </div>
</el-col> </el-col>
@ -33,13 +33,13 @@
<div style="margin-bottom: 6px"> <div style="margin-bottom: 6px">
<span class="term">任务状态</span> <span class="term">任务状态</span>
<span class="desc"> <span class="desc">
<el-tag v-if="task.state == '创建中'" type="warning">{{ <el-tag effect="plain" v-if="task.state == '创建中'" type="warning">{{
task.state task.state
}}</el-tag> }}</el-tag>
<el-tag v-else-if="task.state == '执行中'" type="primary">{{ <el-tag effect="plain" v-else-if="task.state == '执行中'" type="primary">{{
task.state task.state
}}</el-tag> }}</el-tag>
<el-tag v-else type="success">{{ task.state }}</el-tag> <el-tag effect="plain" v-else type="success">{{ task.state }}</el-tag>
</span> </span>
</div> </div>
</el-col> </el-col>
@ -86,6 +86,7 @@
v-for="(item, index) in contents" v-for="(item, index) in contents"
v-bind:key="item.id" v-bind:key="item.id"
@click="chosecontent(item)" @click="chosecontent(item)"
style="margin-top:2px"
> >
<el-link type="primary" <el-link type="primary"
>{{ index + 1 }}-{{ item.name }}</el-link >{{ index + 1 }}-{{ item.name }}</el-link
@ -255,6 +256,7 @@
v-for="(item, index) in depts" v-for="(item, index) in depts"
v-bind:key="item.id" v-bind:key="item.id"
@click="chosedept(item)" @click="chosedept(item)"
style="margin-top:2px"
> >
<el-link type="primary" <el-link type="primary"
>{{ index + 1 }}-{{ item.name }}</el-link >{{ index + 1 }}-{{ item.name }}</el-link
@ -310,7 +312,7 @@
</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 }}/{{ 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="文件">

View File

@ -116,7 +116,7 @@ class RecordViewSet(RbacFilterSet, PageOrNot, CreateUpdateCustomMixin, ModelView
queryset = Record.objects.all() queryset = Record.objects.all()
serializer_class = RecordSerializer serializer_class = RecordSerializer
search_fields = ['content__name','task__name'] search_fields = ['content__name','task__name']
ordering = ['create_time'] ordering = ['-create_time']
filter_class = RecordFilter # 过滤类 filter_class = RecordFilter # 过滤类
@action(methods=['get'], detail=False, perms_map = {'get':'*'}) @action(methods=['get'], detail=False, perms_map = {'get':'*'})