peng
3 天以前 5c5292c6b267e09a5e1f6056b06c5ac99f0088db
manager/src/components/lili-dialog/goods-dialog.vue
@@ -155,13 +155,21 @@
      if (this.selectAll){
        this.goodsData.forEach(item =>{
          item.selected = true;
          this.selectedWay.push(item);
          const isExist = this.selectedWay.some(selectedItem => selectedItem.id === item.id);
          if (!isExist) {
            this.selectedWay.push(item);
          }
        })
      }else{
        this.goodsData.forEach(item =>{
          item.selected = false;
          this.selectedWay.splice(0, this.selectedWay.length);
          const index = this.selectedWay.findIndex(
            selectedItem => selectedItem.id === item.id
          );
          if (index !== -1) {
            this.selectedWay.splice(index, 1);
          }
        })
      }
      console.log(this.selectedWay)