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
        }
    }
     

  • 相关阅读:
    腾讯精品课程
    什么都没有,先空出来!
    Python3-super().__init()__
    Python3-模块
    Python3-单例模式
    Python3-私有化修改
    Python3-私有属性
    Python3-面向对象-魔术方法
    Python3-面向对象-四种方法
    Python3-迭代器
  • 原文地址:https://www.cnblogs.com/czly/p/14635520.html
Copyright © 2011-2022 走看看