点击筛选框动态增加 多条可输入Table列 以及通过操作数组改造数据

点击筛选框动态增加 多条可输入Table列 以及通过操作数组改造数据
点击筛选框动态增加 多条可输入Table列 以及通过操作数组改造数据_第1张图片


              
                
                  
                  
                
              
            

              
              
                  
                  
                  
                    
                  
                  
                    
                  
                
              
            
data
flowTypeOptions : [{
        flowType: "card",
        flowTypeName: "卡",
        eventAccount: "",
        details: [{
            key: "am",
            name: "分",
            value: "",
            required: true,
            icon: "fa-jpy"
        }, {
            key: "CardNo",
            name: "卡号",
            isSm4: true,
            value: "",
            required: true,
            icon: "fa-credit-card"
        }]
    }]
flowTypeChange(v){ //筛选框改变数据改造
        this.flowTypeOptions.forEach((item,index) => {
          if(item.flowType == v){
            this.csmFetr.push({
              flowTypeName:item.flowTypeName,
              'amtFlows':[]
            })
            item.details.forEach(element => {
              this.csmFetr[this.csmFetr.length-1].amtFlows.push({
                flowType:item.flowType,
                name:element.name,
                key:element.key,
                value:'',
            })
            });

          }
        });
      },
      打印改造你需要的数据格式和后端调试
      _this.ruleForm.amtFlows = []
        _this.csmFetr.forEach(item => { //提交资金流向改造
          var arr = {}
          item.amtFlows.forEach(el => {
            arr[el.key]=el.value

          });
            arr['eventAccount'] = '';
            arr['flowType'] = item.amtFlows[0].flowType;
            _this.ruleForm.amtFlows.push(arr);
        });
        提交ruleForm

你可能感兴趣的:(javascript,开发语言,ecmascript)