美文网首页
扁平化方法

扁平化方法

作者: 糖醋里脊120625 | 来源:发表于2022-03-17 16:38 被阅读0次
publicData(index,rowData){
      rowData.deliverDateTimes = rowData.planDate + ' ' + this.$format(rowData.supplyTime,'hh:mm:ss');
      this.infoObj = rowData;
      this.getcanteenInfo(rowData.canteenId);
      this.infoLoading = true;
      this.dialogVisible = true;
      this.value = config.baseYGimg + '/canteen-supplier/#/order/sendGpage?id='+rowData.id+'&areaName='+this.invoiceTitle+'&type=1';
      

      supplierDeliveryApi.getDetail(rowData.id).then(data => {
        let zj = 0;
        if(data.deliveryVehicleInfos.length > 0){
          let catinfo = data.deliveryVehicleInfos[0];
          catinfo.startDates = this.$format(catinfo.startTime,'yyyy-MM-dd');
          catinfo.endDates = this.$format(catinfo.endTime,'yyyy-MM-dd');
          this.catInfo = catinfo;
        }else{
          this.catInfo = {};
        }
        let listData = data.list;
        listData.forEach((ele,ind)=>{
          this.$set(ele, "voucherimglist", ele.voucherList.map(item => {return {url: item, type: item.substr(item.lastIndexOf(".") + 1)}}));
          if(ele.productionDate){
            ele.scDate = this.$format(ele.productionDate,'yyyy-MM-dd');
            if(ele.scDate.indexOf('1900') >= 0){
              ele.scDate = '';
            }
          }
        })
        this.infoData = listData;
        var arrayTwo = Object.values(listData.reduce((res, item) => {
          res[item.salesItemName] ? res[item.salesItemName].push(item) : res[item.salesItemName] = [item];
          return res;
        }, {}));
        this.newInfoData = arrayTwo;
      })
      .finally(() => {
        this.infoLoading = false;
      })
      return
    },

相关文章

  • 用JavaScript实现的5个常见函数

    数组扁平化 数组扁平化有很多方法,但最终最好的方法就是递归,实现一个指定深度的扁平化方法,这样基本的套路都会了解。...

  • JS 数组扁平化的5种方式

    什么是数组扁平化 数组扁平化是指将一个多维数组变为一维数组 数据准备 实现方法一 实现方法二 实现方法三 实现方法...

  • 前端手写算法题

    1、深拷贝deepCopy 2、对象扁平化 3、数组扁平化 4、手写Promise 5、promise.all方法...

  • js小算法

    1、数组扁平化 数组扁平化是指将一个多维数组变为一个一维数组 方法1:使用flat() 方法2:利用正则,但数据类...

  • es6将二维、多维数组转化为一维数组

    扁平化数组 Array.prototype.flat()方法 使用方法总结 1. Array.prototype....

  • 扁平化方法

  • 封装常用数组操作函数

    1. 数组扁平化 方法一 : 递归迭代数组 方法二 : 通过js原生 falt方法展开数组 方法三 通过正则...

  • JS算法题总结

    1. 对象深克隆 2. 数组去重 方法一: 方法二: 3. 数组扁平化 方法一: 方法二: 4. 冒泡排序

  • 如何实现一个 flatMap 函数 ?

    基础学习:JavaScript(ES6)扁平化嵌套方法flatMap()和flat() Array.prototy...

  • 手写代码系列

    深拷贝 html转码 手写promise.all 有哪些实现数组扁平化的方法 原生js 运用flat方法 redu...

网友评论

      本文标题:扁平化方法

      本文链接:https://www.haomeiwen.com/subject/uvnvdrtx.html