美文网首页
扁平化方法

扁平化方法

作者: 糖醋里脊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
        },
    

    相关文章

      网友评论

          本文标题:扁平化方法

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