{
    template:'${tmpl}',
    data:function(){
      return {
        options:[
          {value:"TMZCSQ",label:"商标初步审定公告"},
          {value:"TMZCZC",label:"商标注册公告（一）"},
          {value:"TMQTZC",label:"商标注册公告（二）"}
        ],
        ncloptions:  [
          {value: "all", label: "全部类别"},
          {value: "1", label: "01类 化学原料"}, {value: "2", label: "02类 颜料油漆"},
          {value: "3", label: "03类 日化用品"}, {value: "4", label: "04类 燃料油脂"},
          {value: "5", label: "05类 医药"}, {value: "6", label: "06类 金属材料"},
          {value: "7", label: "07类 机械设备"}, {value: "8", label: "08类 手工器械"},
          {value: "9", label: "09类 科学仪器"}, {value: "10", label: "10类 医疗器械"},
          {value: "11", label: "11类 灯具空调"}, {value: "12", label: "12类 运输工具"},
          {value: "13", label: "13类 军火烟火"}, {value: "14", label: "14类 珠宝钟表"},
          {value: "15", label: "15类 乐器"}, {value: "16", label: "16类 办公用品"},
          {value: "17", label: "17类 橡胶制品"}, {value: "18", label: "18类 皮革皮具"},
          {value: "19", label: "19类 建筑材料"}, {value: "20", label: "20类 家具"},
          {value: "21", label: "21类 厨房洁具"}, {value: "22", label: "22类 绳网袋蓬"},
          {value: "23", label: "23类 纱线丝"}, {value: "24", label: "24类 布料床单"},
          {value: "25", label: "25类 服装鞋帽"}, {value: "26", label: "26类 钮扣拉链"},
          {value: "27", label: "27类 地毯席垫"}, {value: "28", label: "28类 健身器材"}, {value: "29", label: "29类 食品"},
          {value: "30", label: "30类 方便食品"}, {value: "31", label: "31类 农林生鲜"}, {value: "32", label: "32类 啤酒饮料"},
          {value: "33", label: "33类 酒"}, {value: "34", label: "34类 烟草烟具"}, {value: "35", label: "35类 广告销售"},
          {value: "36", label: "36类 金融物管"}, {value: "37", label: "37类 建筑修理"}, {value: "38", label: "38类 通讯服务"},
          {value: "39", label: "39类 运输贮藏"}, {value: "40", label: "40类 材料加工"}, {value: "41", label: "41类 教育娱乐"},
          {value: "42", label: "42类 科技服务"}, {value: "43", label: "43类 餐饮住宿"}, {value: "44", label: "44类 医疗园艺"},
          {value: "45", label: "45类 社会服务"}],
        nclNum:"all",
        options1:[],
        noticetype: "TMZCSQ",
        noticetype1: "",
        noticenumber:"",
        applynumber:"",
        tmname:"",
        applier:"",
        tmcategory:"",
        tmcbsdgg:"",
        gonggao:true,
        total:0,
        querydata:[
        ],
        page: 1,
        size: 20,
        yydate:"",
        daohang:""
      };
    },
    methods:{
      reset(){
        this.noticetype="TMZCSQ";
        this.noticenumber="";
        this.applynumber="";
        this.tmname="";
        this.applier="";
        this.nclNum="all";
        this.tmcategory="";
      },
      handleCurrentChange(val)
      {
        this.page = val;
        this.noticequery();
      },
      handleSizeChange(val)
      {
        this.size = val;
        console.log(`每页 ${val} 条`);
        this.noticequery();
      },
      getRole (prov) {
        console.log("-------------------------------");
        console.log(prov);
        /*if(prov=="TMZCSQ"){
          var obj =
          {
              noticetype: prov
          };
          this.noticenumber="";
          var that =this;
          this.$root.postReq("/web/bytmqueryCtl/noticequeryTMZCSQ", obj).then(function (d) {
            let select1=d.data.selectdata;
            that.gonggao=false;
            that.options1=select1;
            that.yydate=d.data.date;
          }).catch(function (e) {
              that.$message.warning(`操作失败，请刷新页面后重新操作`);
          });
        }else{
          this.gonggao=true;
          this.yydate="";
          this.noticetype1="";
        }*/
      },
      isNull(str)
      {
          if (str == "") return true;
          var regu = "^[ ]+$";
          var re = new RegExp(regu);
          return re.test(str);
      },
      noticequeryClick(){
        console.log("nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn");
        console.log(this.noticenumber);
        this.applynumber = this.applynumber.replace(/\s+/g,"");
        this.tmname = this.tmname.replace(/\s+/g,"");
        this.applier = this.applier.replace(/\s+/g,"");
        var re = /^[0-9]+.?[0-9]*$/;
        var numberandchar =  /^[0-9a-zA-Z]+$/;
        if(this.isNull(this.noticenumber)){
          this.daohang="";
          if(this.isNull(this.applynumber)){
            var obj =
            {
                noticenumber: this.noticenumber,
                applynumber:this.applynumber,
                tmname: this.tmname,
                applier: this.applier,
                nclNum:this.nclNum,
                noticetype: this.noticetype,
                pageSize:20,
                currentPage:1,
            };
            this.size = 20;
            this.page = 1;
            var that =this;
            const loadingbyc = this.$loading({
                lock: true,
                text: 'Loading',
                spinner: 'el-icon-loading',
                background: 'rgba(0, 0, 0, 0.7)'
            });
            this.$root.postReq("/web/bytmqueryCtl/noticequery", obj).then(function (d) {
              loadingbyc.close();
              that.querydata=d.data.rows;
              that.total = d.data.count;
            }).catch(function (e) {
                that.$message.warning(`操作失败，请刷新页面后重新操作`);
            });
          }else{
            if(numberandchar.test(this.applynumber)){
              var obj =
              {
                  noticenumber: this.noticenumber,
                  applynumber:this.applynumber,
                  tmname: this.tmname,
                  applier: this.applier,
                  nclNum:this.nclNum,
                  noticetype: this.noticetype,
                  pageSize:20,
                  currentPage:1,
              };
              this.size = 20;
              this.page = 1;
              var that =this;
              const loadingbyc = this.$loading({
                  lock: true,
                  text: 'Loading',
                  spinner: 'el-icon-loading',
                  background: 'rgba(0, 0, 0, 0.7)'
              });
              this.$root.postReq("/web/bytmqueryCtl/noticequery", obj).then(function (d) {
                loadingbyc.close();
                that.querydata=d.data.rows;
                that.total = d.data.count;
              }).catch(function (e) {
                  that.$message.warning(`操作失败，请刷新页面后重新操作`);
              });
            }else{
              this.$message.warning("申请号只能是数字和字母");
            }
          }

        }else{
          if(re.test(this.noticenumber)){
            this.daohang=this.noticenumber;
            if(this.isNull(this.applynumber)){
              var obj =
              {
                  noticenumber: this.noticenumber,
                  applynumber:this.applynumber,
                  tmname: this.tmname,
                  applier: this.applier,
                  nclNum:this.nclNum,
                  noticetype: this.noticetype,
                  pageSize:20,
                  currentPage:1,
              };
              this.size = 20;
              this.page = 1;
              var that =this;
              const loadingbyc = this.$loading({
                  lock: true,
                  text: 'Loading',
                  spinner: 'el-icon-loading',
                  background: 'rgba(0, 0, 0, 0.7)'
              });
              this.$root.postReq("/web/bytmqueryCtl/noticequery", obj).then(function (d) {
                loadingbyc.close();
                that.querydata=d.data.rows;
                that.total = d.data.count;
              }).catch(function (e) {
                  that.$message.warning(`操作失败，请刷新页面后重新操作`);
              });
            }else{
              if(numberandchar.test(this.applynumber)){
                var obj =
                {
                    noticenumber: this.noticenumber,
                    applynumber:this.applynumber,
                    tmname: this.tmname,
                    applier: this.applier,
                    nclNum:this.nclNum,
                    noticetype: this.noticetype,
                    pageSize:20,
                    currentPage:1,
                };
                this.size = 20;
                this.page = 1;
                var that =this;
                const loadingbyc = this.$loading({
                    lock: true,
                    text: 'Loading',
                    spinner: 'el-icon-loading',
                    background: 'rgba(0, 0, 0, 0.7)'
                });
                this.$root.postReq("/web/bytmqueryCtl/noticequery", obj).then(function (d) {
                  loadingbyc.close();
                  that.querydata=d.data.rows;
                  that.total = d.data.count;
                }).catch(function (e) {
                    that.$message.warning(`操作失败，请刷新页面后重新操作`);
                });
              }else{
                this.$message.warning("申请号只能是数字和字母");
              }
            }

          }else{
            this.$message.warning("公告期号只能是数字");
          }
        }

      },
      noticequery(){
        var obj =
            {
                noticenumber: this.noticenumber,
                applynumber:this.applynumber,
                tmname: this.tmname,
                applier: this.applier,
                nclNum:this.nclNum,
                noticetype: this.noticetype,
                pageSize:this.size,
                currentPage:this.page,
            };
        var that =this;
        const loadingbyc = this.$loading({
            lock: true,
            text: 'Loading',
            spinner: 'el-icon-loading',
            background: 'rgba(0, 0, 0, 0.7)'
        });
        this.$root.postReq("/web/bytmqueryCtl/noticequery", obj).then(function (d) {
          loadingbyc.close();
          that.querydata=d.data.rows;
          that.total = d.data.count;
        }).catch(function (e) {
            that.$message.warning(`操作失败，请刷新页面后重新操作`);
        });
      },
      noticedetailClick(row){
        console.log("--------------------------");
        console.log(row.sbzch);
        console.log(row.linkurl);
        var localurl = location.href;
        console.log(localurl);
        var base = localurl.split("bycnoticeindex");
        if(row.sbmc){
          var name = row.ggqh+row.gglx+">"+row.sbmc+"公告详情";
        }else{
          var name = row.ggqh+row.gglx+">公告详情";
        }

        var url = base[0] + "bycnoticedetailtm?name="+name+"&imgurl="+row.linkurl;
        console.log(base);
        console.log(url);
        window.open(url);
      },
      backbycnoticetm(){
        var localurl = location.href;
        console.log(localurl);
        var base = localurl.split("bycnoticeindex");
        var url = base[0] + "/bycnoticetm";
        console.log(base);
        console.log(url);
        this.$root.pushx({
          title:"",
          name: "/bycnoticetm"
         });
      }
    },
    mounted:function(){
      console.log("uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu");
      var url = location.href;
      console.log(url);
      console.log(this.$router.history.current.query);
      this.noticetype=this.$router.history.current.query.noticetype;
      this.noticenumber=this.$router.history.current.query.noticenumber;
      this.daohang=this.$router.history.current.query.noticenumber;
      console.log(this.noticenumber);
      this.noticequeryClick();
    },
    vname:"gsb-bycnoticeindex"
}
