vue2中el-select模糊查询

 <div class="zhu_top_box">
         <div class="zhu_top_title">项目名称</div>
         <el-select
             clearable
             v-on:change="toProjectName()"
             class="zhu_top_input_2"
             v-model="project_name"
             filterable
             remote
             :remote-method="filterData"
             placeholder="请输入项目名称关键词"
             :loading="loading">
              <el-option
                v-for="item in Option"
                :key="item.project_number"
                :label="item.project_name"
                :value="item.project_name">
              </el-option>
         </el-select>
   </div>
 
    //下拉框查询请求
    toProjectName:function(){
      this.loadPage();
    },

    //模糊查询
    filterData(project_name){
      // console.log(project_name)
      axios({
        method: "POST",
        url: httpUrl.OA_personnel_maintenance_ledger_project_name_select,
        params: {
          project_name:project_name
        }
      }).then(res=>{
        let result = JSON.parse(res.data);
        // console.log(result)
        this.Option = result;

      }).catch(err=>{
      })
    },


    //查询遍历表
    loadPage(){
      axios({
        method: "POST",
        url: httpUrl.OA_personnel_maintenance_ledger_info_select,
        params: {
          project_name: this.project_name,
          open_date: this.open_date,
          risk_rank: this.risk_rank,
          letter_apply_condition: this.letter_apply_condition,
          letter_apply_state: this.letter_apply_state,
          page: page,
          pageSize: pageSize
        }
      }).then(res => {
        let result = JSON.parse(res.data);
        // console.log(result);
        this.list = result.list;
        this.count = result.count;
      }).catch(err=>{
      })
    },
  data() {
    return {
     
      Option: [],
      loading: false,
    

    }
  },

  • 6
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值