Bootstrap

el-select下拉框一行显示编码和名称,可输入查询

 

 

 


        <el-form-item label="账户代码">
          <el-select v-model="form.code" clearable style="width: 100%" @change="setAccountCode" placeholder="请选择账户代码" filterable remote :remote-method="queryWar" :loading="loading"
            @focus="(event)=>queryWar()">
            <el-option v-for="c in accountList" :label="c.code" :value="c.code" :key="c.code+'b'">
              <name-code :name="c.accountName" :code="c.code" />
            </el-option>
          </el-select>
        </el-form-item>


--------------------------------
import { listManage } from '@/api/acc/account'
data(){
return{
accountList: [],
      loading: true,
      queryParams: {
        orderByColumn: 'a.id',
        isAsc: 'desc',
        code: null,
      },
}
},
created() {
    this.getBankList()
    // this.getCurrencyList()
  },
 methods: {
    getBankList() {
      this.loading = true
      listManage(this.queryParams).then((response) => {
        this.accountList = response.rows
        this.loading = false
      })
    },

    //查询账户信息
    queryWar(v) {
      this.queryParams.code = v
      this.getBankList()
    },
}

悦读

道可道,非常道;名可名,非常名。 无名,天地之始,有名,万物之母。 故常无欲,以观其妙,常有欲,以观其徼。 此两者,同出而异名,同谓之玄,玄之又玄,众妙之门。

;