This commit is contained in:
caoqianming 2021-03-19 13:54:40 +08:00
commit a8ba750585
2 changed files with 82 additions and 11 deletions

View File

@ -9,7 +9,21 @@
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-select
v-model="listQuery.is_self"
placeholder="是否主动报送"
clearable
style="width: 140px"
class="filter-item"
@change="handleFilter"
>
<el-option
v-for="item in isOptions"
:key="item.key"
:label="item.name"
:value="item.key"
/>
</el-select>
<el-select
v-model="listQuery.state"
placeholder="记录状态"
@ -26,7 +40,7 @@
/>
</el-select>
<el-select
<el-select v-if="checkPermission(['record_confirm'])"
v-model="listQuery.belong_dept"
placeholder="上报部门"
clearable
@ -72,6 +86,29 @@
>
</div>
</el-card>
<el-card style="margin-top: 10px">
<el-row>
<el-button type="primary" @click="centerDialogVisible = true" plain
>主动上报</el-button
>
<el-dialog
title="提示"
:visible.sync="centerDialogVisible"
width="50%"
center
>
<el-transfer
v-model="contents"
:data="contentOptions"
:titles="['材料清单', '选择的清单']"
:props="{ key: 'id', label: 'name' }"
/>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="contentup()">确认</el-button>
</span>
</el-dialog>
</el-row>
</el-card>
<el-card style="margin-top: 10px">
<el-table
v-loading="listLoading"
@ -85,15 +122,20 @@
>
<el-table-column type="index" width="50" />
<el-table-column label="任务标题">
<template slot-scope="scope" v-if="scope.row.task">{{
<el-table-column width="150px" label="任务标题">
<template slot-scope="scope" >
<el-tag type="" effect="plain" hit="false" v-if="scope.row.task">{{
scope.row.task_.name
}}</template>
}}</el-tag>
<el-tag type="warning" effect="plain" v-else>
主动报送
</el-tag>
</template>
</el-table-column>
<el-table-column label="材料名称">
<template slot-scope="scope">{{ scope.row.content_.name }}</template>
</el-table-column>
<el-table-column sortable label="上报时间">
<el-table-column label="上报时间">
<template slot-scope="scope">{{ scope.row.up_date }}</template>
</el-table-column>
<el-table-column label="上报人">
@ -101,7 +143,7 @@
scope.row.up_user_.name
}}</template>
</el-table-column>
<el-table-column sortable label="截止时间">
<el-table-column label="截止时间">
<template slot-scope="scope">{{ scope.row.end_date }}</template>
</el-table-column>
@ -225,8 +267,10 @@
</template>
<script>
import { getOrgList } from "@/api/org";
import { getRecordList } from "@/api/record";
import { getRecordList,createself } from "@/api/record";
import { genTree } from "@/utils";
import { getContentList } from "@/api/content";
import checkPermission from "@/utils/permission";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import recorddo from "@/views/supervision/recorddo";
@ -242,6 +286,10 @@ export default {
count: 0,
},
can_doself: true,
contentOptions: [],
contents: [],
centerDialogVisible: false,
orgData: [],
drawer: false,
stateOptions: [
@ -250,6 +298,9 @@ export default {
{ key: "已确认", name: "已确认" },
{ key: "待整改", name: "待整改" },
],
isOptions:[
{key:"true",name:""},
{key:"false",name:""}],
pickerOptions2: {
shortcuts: [
{
@ -298,9 +349,11 @@ export default {
created() {
this.getState();
this.getOrgList();
this.getContentsList();
},
methods: {
checkPermission,
getState(){
if(this.$route.params.state){
this.listQuery.state = this.$route.params.state
@ -343,6 +396,23 @@ export default {
this.drawer = false;
this.getList();
},
getContentsList() {
getContentList({ can_doself: this.can_doself }).then((res) => {
console.log(res.data)
this.contentOptions = res.data;
});
},
contentup() {
if (this.contents.length > 0) {
createself({ contents: this.contents }).then((res) => {
this.centerDialogVisible = false;
this. getList();
});
} else {
this.$message.error("请选择清单!");
}
},
},
};
</script>

View File

@ -8,6 +8,7 @@ class RecordFilter(filters.FilterSet):
belong_dept=filters.NumberFilter(field_name='belong_dept')
content_name = filters.CharFilter(field_name='content__name')
state = filters.CharFilter(field_name='state',lookup_expr='icontains')
isself = filters.BooleanFilter(field_name='is_self', lookup_expr='isnull')
class Meta:
model = Record
fields = ['up_date','content__name','belong_dept','state', 'task', 'content']
fields = ['up_date','content__name','belong_dept','state','is_self','task', 'content']