xuxueyang
2024-07-30 1fb44496929548b4f07b37796d506dedc494d44a
sub_pages/customer/shopping/shopping.vue
@@ -17,7 +17,8 @@
            <view class="sup-title">
               <radio :checked="ids.indexOf(item.id)>=0" @click="changeItem(item,'supplier')"></radio>
               <radio :checked="ids.indexOf('supplier@'+item.supplierId)>=0" @click="changeItem(item,'supplier')">
               </radio>
               {{ item.supplierName || '-' }}
            </view>
            <u-divider></u-divider>
@@ -218,6 +219,9 @@
                        this.ids.push(item.id)
                     }
                  })
                  if (this.ids.indexOf('supplier@' + dto.supplierId) < 0) {
                     this.ids.push('supplier@' + dto.supplierId)
                  }
               })
               this.checkall = true
            }
@@ -236,8 +240,9 @@
               } else {
                  this.checkall = false
                  this.ids.splice(this.ids.indexOf('supplier@' + dto.supplierId), 1)
                  console.log('this.ids splice', this.ids)
                  dto.flowerList.forEach(item => {
                     this.ids.splice(this.ids.indexOf('supplier@' + item.supplierId), 1)
                     this.ids.splice(this.ids.indexOf(item.id), 1)
                  })
               }
@@ -260,10 +265,13 @@
                     }
                  }
                  if (has) {
                     this.ids.push(dto.supplierId)
                     this.$forceUpdate()
                  }else{
                     console.log('has',this.ids,dto)
                     if (this.ids.indexOf('supplier@' + dto.supplierId) < 0) {
                        this.ids.push('supplier@' + dto.supplierId)
                        this.$forceUpdate()
                     }
                  } else {
                     console.log('has', this.ids, dto)
                  }
               } else {
@@ -272,6 +280,11 @@
                  if (this.ids.indexOf(dto.id) >= 0) {
                     this.ids.splice(this.ids.indexOf(dto.id), 1)
                  }
                  //还要删除供应商的id
                  if (this.ids.indexOf('supplier@' + dto.supplierId) >= 0) {
                     this.ids.splice(this.ids.indexOf('supplier@' + dto.supplierId), 1)
                  }
               }
            }