两个找相同的

2023-08-06  本文已影响0人  糖醋里脊120625
goodsGroup(infoID).then((res) => {

      function FindItem(itemID,moreList){
        let findData = moreList.find(x => x.piId == itemID.piId);
        return findData
      }



      let newdata= res.data.map((item) => {
        if(item.products){
          var childFloor = item.products.map((each)=>{
            return {
              ...each,         
              ProductDes:each.piSpec+'、'+each.piNetContent+each.piNetContentUnit+'/'+each.piSpec,

              showAddOrSub:FindItem(each,that.data.SeledGoods)==undefined?false:true,
              SelNum:FindItem(each,that.data.SeledGoods)==undefined?0:FindItem(each,this.data.SeledGoods).SelNum,
              
            }
          })
        }else{
          var childFloor=[]
        }
        
        return {
          ...item,
          text:item.ptItemName,
          products: childFloor,
        };
      });
      this.setData({
        goodsList:newdata
      })
      this.TotalAllSelecteFun()

    })
上一篇下一篇

猜你喜欢

热点阅读