<template>
    <fullscreen :fullscreen.sync="fullscreen" class="container">
        <div class="container-box">
            <toolList @iconCli='iconCli' :tooltit='tooltit'></toolList>
            <div class="search">
                <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
            </div>
            <div class="tabbox">
                <el-table height="calc(100% - 40px)" class="com-table" ref="multipleTable" :data="tableData"
                    tooltip-effect="dark" size="small" border style="width: 100%" v-loading="loading">
                    <el-table-column prop="woTitle" label="任务标题" width="120">
                    </el-table-column>
                    <el-table-column prop="sendNo" label="派发工号">
                    </el-table-column>
                    <el-table-column prop="sendName" label="派发姓名">
                        <template slot-scope="scope">
                              <span>{{$desensitization(scope.row.sendName,1)}}</span>
                        </template>
                    </el-table-column>
                    <el-table-column prop="sendTime" label="派发时间" width="140">
                    </el-table-column>
                    <el-table-column prop="recDeptName" label="回复部门">
                    </el-table-column>
                    <el-table-column prop="recName" label="回复人">
                    </el-table-column>
                    <el-table-column prop="dealRemark" label="回复内容">
                    </el-table-column>
                    <el-table-column prop="requireTime" label="要求回复时间" width='140'>
                    </el-table-column>
                    <el-table-column prop="recTime" label="实际回复时间" width='140'>
                    </el-table-column>
                    <el-table-column prop="overTimeFlagDesc" label="回复及时性" width="100">
                    </el-table-column>
                    <el-table-column prop="urgeStsDesc" label="是否催办">
                    </el-table-column>
                    <el-table-column prop="urgeNo" label="催办工号">
                    </el-table-column>
                    <el-table-column prop="urgeName" label="催办姓名">
                    </el-table-column>
                    <el-table-column prop="urgeTime" label="催办时间" width='140'>
                    </el-table-column>
                    <el-table-column prop="urgeCnt" label="催办次数">
                    </el-table-column>
                    <el-table-column label="操作" width="100" align="center" fixed="right">
                        <template slot-scope="scope">
                            <el-button v-if="!scope.row.overTimeFlagDesc" size="mini" type="primary" @click="dialogCheck(scope.row)">催办</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 toolList from "../../../components/toolList.vue";

    export default {
        components: {
            mySearch,
            toolList
        },
        data() {

            return {
                tooltit: '任务回复明细',
                searchList: [{
                        type: 'input',
                        tit: '任务标题',
                        value: '',
                        width: '32%',
                    },
                    {
                        type: 'date',
                        tit: '开始时间',
                        value: '',
                        width: '32%',
                    },
                    {
                        type: 'date',
                        tit: '结束时间',
                        value: '',
                        width: '32%',
                    },
                ],
                fullscreen: false,
                total: 0,
                pageSize: 1,
                tableData: [],
                dialogStatus: false,
                disableStatus: false,
                titname: '终端',
                infolist: {},
                typeOptions: [{
                    dataCode: 1,
                    dataName: 111,
                }],
                userInfo: {},
                params: {},
                infoApply: [],
                loading: false
            }
        },
        methods: {
            //搜索数据
            searchInfo(v) {
                this.params = {};
                v[0] ? this.params.woTitle = v[0] : '';
                v[1] ? this.params.recTimeFrom = this.$formatDate(v[1], "YYYY-MM-DD") : '';
                v[2] ? this.params.recTimeTo = this.$formatDate(v[2], "YYYY-MM-DD") : '';
                this.getList(this.params, this.pageSize);
            },
            //获取列表
            getList(v, n) {
                this.pageSize = n;
                let _this = this;
                this.tableData = [];
                this.loading = true;
                this.$http({
                    url: "/market/cwodept/queryPage",
                    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;
                });
            },
            dialogCheck(v) {
                this.$http({
                    url: '/market/cwo/urgeWo',
                    method: "post",
                    headers: {
                        "Content-Type": "application/json",
                    },
                    data: {
                        id: v.id,
                        urgeNo: this.userInfo.loginNo,
                        urgeName: this.userInfo.loginName,
                        urgeTime: this.$formatDate(new Date(), "YYYY-MM-DD")
                    },
                }).then((res) => {
                    this.getList(this.params, this.pageSize);
                });
            },
            // 分页
            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.infolist = {
                    opNo: '',
                    opName: '',
                };
                this.infolist.opNo = this.userInfo.loginNo;
                this.infolist.opName = this.userInfo.loginName;

            }
        },
        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: 16px;
    }

    .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>
