{
    template:'${tmpl}',
        data
:

    function () {
        return {
            agency_name: "",
            /*全选*/
            isnumIndeterminate: false,
            /*查询得到数据*/
            querydata: [],
            /*当前页*/
            page: 1,
            size: 20,
            total: "",
            /*1.统计类型*/
            total_type: -1,
            /*监控名称*/
            jkmc: "",
            /*申请年份*/
            year_list: [],
            /*临时传值*/
            value_button_num: "-1",
            index: -1,
            allsum:0,
            sum:0
        };
    }

,
    created:function () {
        $("#byctitle").text("标眼查-代理机构监控列表详情");
        /*页面加载时使用*/
        this.agency_name = this.$router.history.current.query.agency_name;
        var obj = {
            agency_name: this.agency_name,
            total_type: "-1",
            current_page: 1,
            page_size: 10
        };
        var that = this;
        const loading = this.$loading({
            lock: true,
            text: 'Loading',
            spinner: 'el-icon-loading',
            background: 'rgba(0, 0, 0, 0.7)'
        });
        that.$root.postReq("/web/bytmmonitCtl/getMonitAgencyList", obj).then(function (d) {
            loading.close();
            that.querydata = d.data.list;
            that.total = d.data.list.length;
        }).catch(function (e) {
        });
        that.$root.postReq("/web/bytmmonitCtl/getMonitAgencyListSum",  {agency_name: this.agency_name,total_type: "-1" }).then(function (d) {
            that.allsum = d.data.totalSize;
        }).catch(function (e) {
        });
        that.$root.postReq("/web/bytmmonitCtl/getMonitAgencyListSum",  {agency_name: this.agency_name,total_type: "1" }).then(function (d) {
            that.sum = d.data.totalSize;
        }).catch(function (e) {
        });
    }
,
    methods:{
        styleset(obj)
        {
            if (this.index == obj) {
                return {color: "#ffffff", background: "#108EE9"};
            } else {
                return {color: '#303133', background: "#ffffff"};
            }
        }
    ,
        bytmmonitck()
        {
            this.$root.pushx({
                title:"",
                name:"/bytmmonit"
            });

        }
        ,bytmmonitlistck()
        {
            this.$root.pushx({
                title:"",
                name:"/bytmmonitlist"
            });

        }
    ,
        handleEdit(index, row)
        {
            console.log(index, row);
        }
    ,
        handleDelete(index, row)
        {
            console.log(index, row);
        }
    ,
        /*按钮*/
        jkxq(num)
        {
            this.index = num;
            this.value_button_num = num;
            this.agency_name = this.$router.history.current.query.agency_name;
            var obj = {
                total_type: this.value_button_num,
                agency_name: this.agency_name,
                current_page: this.page,
                page_size: this.size
            };
            console.log(obj);
            var that = this;
            const loading = this.$loading({
                lock: true,
                text: 'Loading',
                spinner: 'el-icon-loading',
                background: 'rgba(0, 0, 0, 0.7)'
            });
            that.$root.postReq("/web/bytmmonitCtl/getMonitAgencyList", obj).then(function (d) {
                loading.close();
                that.querydata = d.data.list;
            }).catch(function (e) {
            });
        }
    ,
        changePageData()
        {
            this.code = this.$router.history.current.query.code;
            var obj = {
                code: this.code,
                total_type: this.value_button_num.toString(),
                current_page: this.page,
                page_size: this.size
            };
            var that = this;
            const loading = this.$loading({
                lock: true,
                text: 'Loading',
                spinner: 'el-icon-loading',
                background: 'rgba(0, 0, 0, 0.7)'
            });
            that.$root.postReq("/web/bytmmonitCtl/getMonitListDetails", obj).then(function (d) {
                loading.close();
                that.querydata = d.data;
                that.total = d.total_count;
            }).catch(function (e) {
            });
        }
    ,
        handleCurrentChange(val)
        {
            this.page = val;
            console.log(`当前 ${val} 页`);
            this.changePageData();
        }
    ,
        handleSizeChange(val)
        {
            this.size = val;
            console.log(`每页 ${val} 条`);
            this.changePageData();
        }
    ,
        /*查看详情*/
        viewDetails(company_name)
        {   
            var localurl = location.href;
            var base = localurl.split("bytmmonitagency");
            var url = base[0] + "/bycquerytm?tmmonitzcr=" + company_name;
            window.open(url);
        }

    }
,
    mounted()
    {

        /* this.jkxq01();*/


    }
,
    vname:"gsb-bytmmonitagency"
}
