vue 搜索框

//按时间查询数据 
<el-form class="line" inline @submit.native.prevent="GEOMNum()">
                  <el-form-item>
                    <el-date-picker
                      value-format="yyyy-MM-dd"
                      type="date"
                      v-model="creTime"
                      :placeholder="this.LANG.test1.desc49"
                    ></el-date-picker>
                    <el-button
                      class="button"
                      @click="GEOMNum()"
                      type="primary"
                      >{{ LANG.test1.desc48 }}</el-button
                    >
                  </el-form-item>
                </el-form>
//按账号查询数据 
<el-input :placeholder="this.LANG.test1.desc50" v-model="address"  clearable  @clear="resetGoods">
</el-input>
<el-button @click="GEOMNum()" type="primary">{{ LANG.test1.desc48}}</el-button>
 methods: {
    GEOMNum: function (index) {
      this.$axios
        .get("bk", {
          params: {
            currentPage: this.currentPage,
            creTime: this.creTime,
            address: this.address,
            pageSize: this.pageSize,
          },
        })
        .then((res) => {
          console.log(res);
          if (res.code == 0) {
            this.dataList = res.data.dataList;
            this.totalPage = res.data.totalPage;
            this.currentPage = res.data.currentPage;
            this.pageSize = res.data.pageSize;
            this.total = res.data.total;
            console.log(this.totalPage);
            console.log(this.currentPage);
            console.log(this.pageSize);
            console.log(this.total);
          }
        });
    },
    time() {
      this.GEOMNum();
    },
    // 重置搜索框
    resetGoods() {
      this.address = "";
      this.GEOMNum();
    },
    // 点击搜索按钮
    searchGoodsResult() {
      this.GEOMNum();
    },
}
posted @ 2022-02-15 15:18  koo-  阅读(465)  评论(0)    收藏  举报