peng
6 天以前 b8be56fe7c3b38bb21cc36a245e2b86cb2ce3e0d
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)