调整到报送列表

This commit is contained in:
caoqianming 2021-03-19 09:13:39 +08:00
parent 13303b884b
commit 2493758943
12 changed files with 281 additions and 262 deletions

View File

@ -139,14 +139,7 @@ export const asyncRoutes = [
path: 'record', path: 'record',
name: 'Record', name: 'Record',
component: () => import('@/views/supervision/record.vue'), component: () => import('@/views/supervision/record.vue'),
meta: { title: '材料列表', icon: 'guide', perms: ['record_all'] } meta: { title: '材料报送列表', icon: 'guide', perms: ['record_view'] }
}
,
{
path: 'report',
name: 'Report',
component: () => import('@/views/supervision/report.vue'),
meta: { title: '材料报送', icon: 'guide', perms: ['record_view'] }
} }
, ,
{ {

View File

@ -95,7 +95,6 @@ const actions = {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getInfo(state.token).then(response => { getInfo(state.token).then(response => {
const { data } = response const { data } = response
if(data){
const { perms, name, avatar } = data const { perms, name, avatar } = data
// perms must be a non-empty array // perms must be a non-empty array
if (!perms || perms.length <= 0) { if (!perms || perms.length <= 0) {
@ -105,19 +104,6 @@ const actions = {
commit('SET_NAME', name) commit('SET_NAME', name)
commit('SET_AVATAR', avatar) commit('SET_AVATAR', avatar)
resolve(data) resolve(data)
}else{
getInfo(state.token).then(res=>{
const { data } = response
if (!perms || perms.length <= 0) {
reject('没有任何权限!')
}
commit('SET_PERMS', perms)
commit('SET_NAME', name)
commit('SET_AVATAR', avatar)
resolve(data)
})
}

View File

@ -23,7 +23,7 @@
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>刷新</el-button >重置</el-button
> >
</el-col> </el-col>
</el-row> </el-row>

View File

@ -41,7 +41,7 @@
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>刷新</el-button >重置</el-button
> >
</el-col> </el-col>
</el-row> </el-row>

View File

@ -41,7 +41,7 @@
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>刷新</el-button >重置</el-button
> >
</el-col> </el-col>
</el-row> </el-row>

View File

@ -32,7 +32,7 @@
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>刷新</el-button> >重置</el-button>
</el-col> </el-col>
</el-row> </el-row>
<div style="margin-top:10px"> <div style="margin-top:10px">

View File

@ -20,7 +20,7 @@
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-table <el-table
v-loading="listLoading" v-loading="listLoading"

View File

@ -58,7 +58,7 @@
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>待办任务提醒</span> <span>待办任务提醒</span>
</div> </div>
<div class="litem" @click="goto('toup')"> <div class="litem" @click="goRecord('待上报')" v-if="!checkPermission(['record_confirm'])">
<el-link class="desc"> <el-link class="desc">
您有 您有
<span style="color:red">{{todos.toup}}</span> <span style="color:red">{{todos.toup}}</span>
@ -66,13 +66,13 @@
</el-link> </el-link>
</div> </div>
<div class="litem"> <div class="litem">
<el-link class="desc" @click="goto('tozg')"> <el-link class="desc" @click="goRecord('待整改')" v-if="!checkPermission(['record_confirm'])">
您有 您有
<span style="color:red">{{todos.tozg}}</span> <span style="color:red">{{todos.tozg}}</span>
条记录待整改 条记录待整改
</el-link> </el-link>
</div> </div>
<div class="litem" @click="goto('uped')"> <div class="litem" @click="goRecord('已上报')">
<el-link class="desc" v-if="todos.toconfirm"> <el-link class="desc" v-if="todos.toconfirm">
您有 您有
<span style="color:red">{{todos.toconfirm}}</span> <span style="color:red">{{todos.toconfirm}}</span>
@ -88,6 +88,7 @@
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { getRecordtodos } from "@/api/todos" import { getRecordtodos } from "@/api/todos"
import checkPermission from "@/utils/permission";
export default { export default {
name: 'Dashboard', name: 'Dashboard',
computed: { computed: {
@ -105,6 +106,7 @@ export default {
this.gettodos() this.gettodos()
}, },
methods:{ methods:{
checkPermission,
toPath(val) { toPath(val) {
this.$router.push({path:val}) this.$router.push({path:val})
}, },
@ -113,8 +115,8 @@ export default {
this.todos = res.data this.todos = res.data
}) })
}, },
goto(tab){ goRecord(state){
this.$router.push({name: "Report", params: { tab: tab }, }) this.$router.push({name:'Record', params: {state:state}})
} }
} }
} }

View File

@ -1,8 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card <el-card style="margin-top: 10px">
style="margin-top: 10px"
>
<div> <div>
<el-input <el-input
v-model="listQuery.content_name" v-model="listQuery.content_name"
@ -12,8 +10,6 @@
@keyup.enter.native="handleFilter" @keyup.enter.native="handleFilter"
/> />
<el-select <el-select
v-model="listQuery.state" v-model="listQuery.state"
placeholder="记录状态" placeholder="记录状态"
@ -49,20 +45,34 @@
v-model="listQuery.date_gt" v-model="listQuery.date_gt"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="上报时间"> placeholder="上报时间"
>
</el-date-picker> </el-date-picker>
-
<el-date-picker <el-date-picker
v-model="listQuery.date_lt" v-model="listQuery.date_lt"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
@change="handleFilter" @change="handleFilter"
placeholder="上报时间"> placeholder="上报时间"
>
</el-date-picker> </el-date-picker>
<el-button
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button
>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置</el-button
>
</div> </div>
</el-card> </el-card>
<el-card <el-card style="margin-top: 10px">
style="margin-top: 10px"
>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
:data="recordList.results" :data="recordList.results"
@ -76,7 +86,9 @@
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="任务标题"> <el-table-column label="任务标题">
<template slot-scope="scope" v-if="scope.row.task">{{ scope.row.task_.name }}</template> <template slot-scope="scope" v-if="scope.row.task">{{
scope.row.task_.name
}}</template>
</el-table-column> </el-table-column>
<el-table-column label="材料名称"> <el-table-column label="材料名称">
<template slot-scope="scope">{{ scope.row.content_.name }}</template> <template slot-scope="scope">{{ scope.row.content_.name }}</template>
@ -85,13 +97,14 @@
<template slot-scope="scope">{{ scope.row.up_date }}</template> <template slot-scope="scope">{{ scope.row.up_date }}</template>
</el-table-column> </el-table-column>
<el-table-column label="上报人"> <el-table-column label="上报人">
<template slot-scope="scope" v-if="scope.row.up_user">{{ scope.row.up_user_.name }}</template> <template slot-scope="scope" v-if="scope.row.up_user">{{
scope.row.up_user_.name
}}</template>
</el-table-column> </el-table-column>
<el-table-column sortable label="截止时间"> <el-table-column sortable label="截止时间">
<template slot-scope="scope">{{ scope.row.end_date }}</template> <template slot-scope="scope">{{ scope.row.end_date }}</template>
</el-table-column> </el-table-column>
<el-table-column label="上报备注"> <el-table-column label="上报备注">
<template slot-scope="scope">{{ scope.row.note }}</template> <template slot-scope="scope">{{ scope.row.note }}</template>
</el-table-column> </el-table-column>
@ -100,28 +113,48 @@
</el-table-column> </el-table-column>
<el-table-column label="上报单位"> <el-table-column label="上报单位">
<template slot-scope="scope" >{{ scope.row.belong_dept_.name }}</template> <template slot-scope="scope">{{
scope.row.belong_dept_.name
}}</template>
</el-table-column> </el-table-column>
<el-table-column label="记录状态"> <el-table-column label="记录状态">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag type="danger" v-if="scope.row.state == '待上报'">{{ scope.row.state }}</el-tag> <el-tag type="danger" v-if="scope.row.state == '待上报'">{{
<el-tag type="warning" v-else-if="scope.row.state == '待整改'">{{ scope.row.state }}</el-tag> scope.row.state
<el-tag type="success" v-else-if="scope.row.state == '已确认'">{{ scope.row.state }}</el-tag> }}</el-tag>
<el-tag v-else-if="scope.row.state == '已上报'">{{ scope.row.state }}</el-tag> <el-tag type="warning" v-else-if="scope.row.state == '待整改'">{{
scope.row.state
}}</el-tag>
<el-tag type="success" v-else-if="scope.row.state == '已确认'">{{
scope.row.state
}}</el-tag>
<el-tag v-else-if="scope.row.state == '已上报'">{{
scope.row.state
}}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="上报文件"> <el-table-column label="上报文件">
<template slot-scope="scope" v-if="scope.row.files"> <template slot-scope="scope" v-if="scope.row.files">
<el-link v-if="scope.row.files.length>1" @click="handleRecord({action:'view', record:scope.row})"> <el-link
v-if="scope.row.files.length > 1"
@click="handleRecord({ action: 'view', record: scope.row })"
>
<span style="color: red">{{ scope.row.files.length }}</span> <span style="color: red">{{ scope.row.files.length }}</span>
个文件</el-link> 个文件</el-link
>
<div v-else v-for="item in scope.row.files_" v-bind:key="item.id"> <div v-else v-for="item in scope.row.files_" v-bind:key="item.id">
<el-link :href="item.path" target="_blank" type="primary">{{ item.name }}</el-link> <el-link :href="item.path" target="_blank" type="primary">{{
item.name
}}</el-link>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="220px" fixed="right"> <el-table-column
align="center"
label="操作"
width="220px"
fixed="right"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-if=" v-if="
@ -198,7 +231,7 @@ import checkPermission from "@/utils/permission";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import recorddo from "@/views/supervision/recorddo"; import recorddo from "@/views/supervision/recorddo";
const defaultrecord = { const defaultrecord = {
name: "" name: "",
}; };
export default { export default {
components: { Pagination, recorddo }, components: { Pagination, recorddo },
@ -218,33 +251,36 @@ export default {
{ key: "待整改", name: "待整改" }, { key: "待整改", name: "待整改" },
], ],
pickerOptions2: { pickerOptions2: {
shortcuts: [{ shortcuts: [
text: '最近一周', {
text: "最近一周",
onClick(picker) { onClick(picker) {
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]); picker.$emit("pick", [start, end]);
} },
}, { },
text: '最近一个月', {
text: "最近一个月",
onClick(picker) { onClick(picker) {
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]); picker.$emit("pick", [start, end]);
} },
}, { },
text: '最近三个月', {
text: "最近三个月",
onClick(picker) { onClick(picker) {
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]); picker.$emit("pick", [start, end]);
} },
}] },
],
}, },
value7: '',
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20, page_size: 20,
@ -253,32 +289,32 @@ export default {
dialogVisible: false, dialogVisible: false,
dialogType: "new", dialogType: "new",
rule1: { rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }] name: [{ required: true, message: "请输入", trigger: "blur" }],
}, },
}; };
}, },
computed: {}, computed: {},
watch: { watch: {},
},
created() { created() {
this.getList(); this.getState();
this.getOrgList(); this.getOrgList();
}, },
methods: { methods: {
checkPermission, checkPermission,
getList(){ getState(){
if(this.$route.params.state){
getRecordList(this.listQuery).then((response)=>{ this.listQuery.state = this.$route.params.state
this.recordList=response.data
})
} }
, this.getList()
},
getList() {
getRecordList(this.listQuery).then((response) => {
this.recordList = response.data;
});
},
getOrgList() { getOrgList() {
getOrgList({ pid: 1 }).then((res) => { getOrgList({ pid: 1 }).then((res) => {
this.orgData = genTree(res.data) this.orgData = genTree(res.data);
}); });
}, },
@ -288,7 +324,6 @@ export default {
this.getList(); this.getList();
}, },
handleFilter() { handleFilter() {
this.listQuery.page = 1; this.listQuery.page = 1;
this.getList(); this.getList();
}, },
@ -296,7 +331,7 @@ export default {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
page_size: 20, page_size: 20,
} };
this.getList(); this.getList();
}, },
@ -304,7 +339,10 @@ export default {
this.data = data; this.data = data;
this.drawer = true; this.drawer = true;
}, },
handleDo(data) {
this.drawer = false;
this.getList();
},
}, },
}; };
</script> </script>

View File

@ -21,7 +21,7 @@
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>刷新重置</el-button >重置</el-button
> >
</div> </div>
<div style="margin-top: 10px"> <div style="margin-top: 10px">

View File

@ -35,7 +35,7 @@
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-table <el-table
v-loading="listLoading" v-loading="listLoading"

View File

@ -62,7 +62,7 @@
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>刷新重置</el-button >重置</el-button
> >
</div> </div>
<div style="margin-top: 10px"> <div style="margin-top: 10px">