<template>
	<fullscreen :fullscreen.sync="fullscreen" class="container">
		<div class="container-box">
			<toolList @iconCli='iconCli' :tooltit='tooltit'></toolList>
			<div class="tabbox">
				<el-table height="100%" class="com-table" ref="multipleTable" :data="tableData"
					tooltip-effect="dark" size="small" border style="width: 100%" v-loading="loading">
                    <el-table-column prop="missionName" label="名称" v-if="level != 3">
					</el-table-column>
					<el-table-column prop="receiverName" label="管理员" v-if="level != 3">
					</el-table-column>
					<el-table-column prop="validTime" label="处理时效" v-if="level != 3">
					</el-table-column>
					<el-table-column prop="allSum" label="总量" v-if="level != 3">
					</el-table-column>
                    <el-table-column prop="cityIngSum" label="地市处理中" v-if="level != 3">
					</el-table-column>
					<el-table-column prop="areaIngSum" label="区县处理中" v-if="level != 3">
					</el-table-column>
					<el-table-column prop="dutyIngSum" label="负责人处理中" v-if="level != 3">
					</el-table-column>
                    <el-table-column prop="cityAppSum" label="地市审批" v-if="level != 3">
                    </el-table-column>
					<el-table-column prop="areaAppSum" label="区县审批" v-if="level != 3">
					</el-table-column>
                    <el-table-column prop="receiverName" label="负责人" v-if="level == 3">
					</el-table-column>
					<el-table-column prop="stsDesc" label="状态">
					</el-table-column>
                    <el-table-column label="操作" width="120px" align="center">
                        <template slot-scope="scope">
                            <el-button size="mini" type="primary" @click="jumpinfo(scope.row)" v-if="scope.row.sts != 0">查看</el-button>
                            <el-button size="mini" type="primary" @click="zhaohui(scope.row)" v-if="scope.row.sts == 0">召回</el-button>
                        </template>
                    </el-table-column>
				</el-table>
				<el-pagination class="pageBox" @current-change="currchange" layout="prev, pager, next" background
					:total="total">
				</el-pagination>
			</div>
		</div>
	</fullscreen>

</template>
<script>
	import mySearch from "../../../components/search.vue";
	import myMessage from "../../../components/myMessage.vue"
	import toolList from '../../../components/toolList'

	export default {
		components: {
			mySearch,
			myMessage,
			toolList
		},
		data() {
			return {
				tooltit: '进度跟踪',
				fullscreen: false,
				total: 0,
				pageSize: 1,
				tableData: [{}],
				dialogStatus: false,
				disableStatus: false,
				titname: '',
				infolist: {},
				userInfo: {},
				params: {},
				centerDialogVisible: false,
				messTit: '',
				delid: '',
				loading: false,
				loadinged: false,
                level:0
			}
		},
		methods: {
            zhaohui(v){
                this.$http({
                    url: "/market/cIllegalCallTask/callBack",
                    method: "post",
                    headers: {
                        "Content-Type": "application/json",
                    },
                    data: {
                        missionId: v.missionId,
                    },
                }).then((res) => {
                    this.shenpists = false;
                    this.$message({
                        message: '成功',
                        type: 'success'
                    });
                    this.getList({}, this.pageSize);
                });
            },
			jumpinfo(v) {
                let id = v.tempId+','+v.missionId+','+v.sts;
				this.$router.push({
					path: "/scheduleinfo?id="+id,
                    query:{
                        id:id,
                    }
				});
				this.setabList("任务详情", "/scheduleinfo?id="+id);
			},
			setabList(n, p) {
				let params = {
					children: "",
					name: n,
					rountPath: p,
					target: "_self",
				};
				for (let i = 0; i < this.$store.state.tabList.length; i++) {
					if (this.$store.state.tabList[i].name === params.name) {
						this.$store.state.tabList[i] = params;
					}
				}
				let set = new Set([...this.$store.state.tabList, params]);
				set.add(params);
				this.$store.commit("setDefaultActive", params.rountPath);
				this.$store.commit("setTabList", Array.from(set));
			},
			//获取列表
			getList(v, n) {
				this.pageSize = n;
				let _this = this;
				this.loading = true;
				this.tableData = [];
                // v.sts = 0;
                let url = '';
                if(this.$route.query.id.split(",")[1] == 1){
                    url = '/market/cIllegalCallTask/queryProvProgressListPage'
                    v.taskId = this.$route.query.id.split(",")[0];
                }else if(this.$route.query.id.split(",")[1] == 2){
                    url = '/market/cIllegalCallTask/queryCityProgressListPage'
                    v.missionId = this.$route.query.id.split(",")[2];
                }else{
                    url = '/market/cIllegalCallTask/queryAreaProgressListPage'
                    v.missionId = this.$route.query.id.split(",")[2];
                }
				this.$http({
					url: url,
					method: "post",
					headers: {
						"Content-Type": "application/json",
						"page": '{"pageNo":"' + n + '","pageSize":"10"}'
					},
					data: v,
				}).then((res) => {
					this.tableData = res.data.data;
					this.total = res.data.totalRecord;
					this.loading = false;
				});
			},
			// 分页
			currchange(v) {
				this.pageSize = v;
				this.getList(this.params, this.pageSize);
			},
			//功能栏
			iconCli(v) {
				if (v === 1) {
					this.getList(this.params, this.pageSize);
				}
				if (v === 2) {
					this.fullscreen = !this.fullscreen
				}
			},
			getUser() {
				this.userInfo = JSON.parse(window.sessionStorage.userInfo);
                this.level = this.$route.query.id.split(",")[1]
			}
		},
		mounted() {
			this.getList({}, 1);
			this.getUser();
		},
		created() {

		}
	}
</script>
<style scoped lang="scss">
	.onetab {
		margin-bottom: 20px;
		padding: 0 20px;
	}

	.titbox {
		div {
			float: right;

			i {
				font-size: 22px;
				margin-left: 20px;
				cursor: pointer;
			}
		}
	}

	.tabbox {
		margin-top: 15px;
	}

	.pageBox {
		text-align: right;
		margin-top: 10px;
	}

	.info-line {
		width: 100%;
		display: block;
		padding-left: 20px;

		div {
			width: 50%;
			display: inline-block;
		}

		span {
			width: 80px;
			display: inline-block;
			text-align: left;

			i {
				color: red;
				display: inline-block;
				padding-right: 5px;
			}
		}

		.el-select,
		.el-input {
			width: calc(100% - 100px);
		}
	}

	.online {
		width: 100%;

		.el-select {
			width: calc(100% - 100px);
		}

		span {
			vertical-align: top;
		}

		.el-textarea {
			width: calc(100% - 100px);
		}
	}
</style>
