问题贴出来

调整代码: 

<el-table-column label="实结点位" align="center" width="140">
   <template slot-scope="scope">
     <div class="display">
       <el-input v-model="scope.row.chargesPercentage" clearable size="small" 
             @blur="onExchangeChange(scope.$index)" @input="change(scope.$index)"/>
       <span>%</span>
     </div>
   </template>
 </el-table-column>


<div class="table-bottom">
      <div class="left">批量调整</div>
        <div class="right">
          <el-input v-model="policyNototal" clearable size="small" 
                  @blur="batchChange($event)" />
          <span>%</span>
        </div>
      </div>
</div>

method:

this.statementChangeList.forEach(item => {

        item.chargesPercentage = item.policyChargesPercentage ;

   });
/**批量调整点位 */

    batchChange() {

      this.statementChangeList.forEach((item,index) => {

        item.chargesPercentage = this.policyNototal;

        this.onExchangeChange(index);

        this.change(index) ;

      });

    },


 

/**特殊方法处理 */

    /** 更改el-table input 批量赋值显示问题 */

    onExchangeChange: function (index) {

        let tmpObj = this.statementChangeList[index];

        this.$set(this.statementChangeList, index, tmpObj);

    },

    change: function (index) {

      // 重新赋值

      let tmpObj = this.statementChangeList[index];

      this.$set(this.statementChangeList, index, tmpObj);

    }
Logo

前往低代码交流专区

更多推荐