zoukankan      html  css  js  c++  java
  • vue a-select下拉选择及给其他文本赋值

     <a-form-model-item label="物料" prop="MaterialId">
              <a-select v-model="entity.MaterialId" allowClear @select="onMaterialChanged">
                <a-select-option v-for="item in MaterialList" :key="item.Id" :value="item.Id">{{
                  item.MaterialNumber
                }}</a-select-option>
              </a-select>
            </a-form-model-item>


    data() {
    return {
           entity: {},
          MaterialList: [],
        }
      },
      methods: {
        init() {
         
          this.loading = true
          this.$http
            .post('/Base_Manage/Base_Material/GetDataList', {
              PageIndex: 1,
              PageRows: 1000,
              SortField: 'Id',
              SortType: '',
              Search: this.queryParam,
              ...this.filters,
            })
            .then((resJson) => {
              this.loading = false
              this.MaterialList = resJson.Data
            })
        },
    onMaterialChanged(obj) {
          var item = this.MaterialList.find((p) => {
            if (p.Id == obj) {
              return p
            }
          })

          this.entity.MaterialNumber=item.MaterialNumber
          this.entity.MaterialName=item.MaterialName
        }
    }
     

  • 相关阅读:
    笛卡尔树学习笔记
    图论基础(自认为很全)
    我的博客在这里
    C++学习资料
    test
    个人介绍
    CF1153F Serval and Bonus Problem
    【ZJOI2020】抽卡
    【LOJ】小 Q 的序列
    我的个人博客:https://xyix.github.io
  • 原文地址:https://www.cnblogs.com/czly/p/14635520.html
Copyright © 2011-2022 走看看