|
|
|
@ -276,19 +276,61 @@ |
|
|
|
if (this.temporaryList.length == 0) { |
|
|
|
this.temporaryList.push(this.attributeList); |
|
|
|
} else { |
|
|
|
for (var i = 0; i < this.temporaryList.length; i++) { |
|
|
|
if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) { |
|
|
|
this.temporaryList[i] = this.attributeList |
|
|
|
for (var m = 0; m < this.temporaryList.length; m++) { |
|
|
|
if (this.temporaryList[m].name.indexOf(this.attributeList.name) != -1) { |
|
|
|
this.temporaryList[m] = this.attributeList |
|
|
|
return |
|
|
|
} else { |
|
|
|
if (this.temporaryList.length == (i + 1)) { |
|
|
|
if (this.temporaryList.length == (m + 1)) { |
|
|
|
this.temporaryList.push(this.attributeList); |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(this.carList.length == 0){ |
|
|
|
let data = { |
|
|
|
id: this.goodsDetail.id, |
|
|
|
price: this.zPrice, |
|
|
|
num: this.zNum, |
|
|
|
productName: this.goodsDetail.productName, |
|
|
|
productSn: this.goodsDetail.productSn, |
|
|
|
productPicture: this.goodsDetail.productPicture, |
|
|
|
supplierName: this.goodsDetail.supplierName, |
|
|
|
saleDetailQueryDTO: this.temporaryList, |
|
|
|
wholesalePrice: this.goodsDetail.wholesalePrice, |
|
|
|
lsprice: this.goodsDetail.price |
|
|
|
} |
|
|
|
this.carList.push(data) |
|
|
|
}else{ |
|
|
|
for(let i = 0; i < this.carList.length; i++){ |
|
|
|
if(this.carList[i].id== this.goodsDetail.id){ //商品存在 |
|
|
|
for(let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++){ |
|
|
|
if(this.carList[i].saleDetailQueryDTO[m].name != this.attributeList.name){ //规格不存在 |
|
|
|
if(this.carList[i].saleDetailQueryDTO.length == (m+1)){ |
|
|
|
this.carList[i].saleDetailQueryDTO.push(this.attributeList) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}else{ //商品不存在 |
|
|
|
let data = { |
|
|
|
id: this.goodsDetail.id, |
|
|
|
price: this.zPrice, |
|
|
|
num: this.zNum, |
|
|
|
productName: this.goodsDetail.productName, |
|
|
|
productSn: this.goodsDetail.productSn, |
|
|
|
productPicture: this.goodsDetail.productPicture, |
|
|
|
supplierName: this.goodsDetail.supplierName, |
|
|
|
saleDetailQueryDTO: this.temporaryList, |
|
|
|
wholesalePrice: this.goodsDetail.wholesalePrice, |
|
|
|
lsprice: this.goodsDetail.price |
|
|
|
} |
|
|
|
this.carList.push(data) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@ -338,10 +380,12 @@ |
|
|
|
this.type = type |
|
|
|
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
|
|
|
if (type == 'carPopup') { |
|
|
|
this.carNum = 0 |
|
|
|
this.$refs.carPopup.open('bottom') |
|
|
|
for (let i = 0; i < this.carList.length; i++) { |
|
|
|
this.carNum += this.carList[i].num |
|
|
|
} |
|
|
|
|
|
|
|
this.carType = this.carList.length |
|
|
|
} else { |
|
|
|
this.checkGoods(item); |
|
|
|
@ -439,19 +483,19 @@ |
|
|
|
// icon: 'none' |
|
|
|
// }) |
|
|
|
// }else{ |
|
|
|
let data = { |
|
|
|
id: this.goodsDetail.id, |
|
|
|
price: this.zPrice, |
|
|
|
num: this.zNum, |
|
|
|
productName: this.goodsDetail.productName, |
|
|
|
productSn: this.goodsDetail.productSn, |
|
|
|
productPicture: this.goodsDetail.productPicture, |
|
|
|
supplierName: this.goodsDetail.supplierName, |
|
|
|
saleDetailQueryDTO: this.temporaryList, |
|
|
|
wholesalePrice: this.goodsDetail.wholesalePrice, |
|
|
|
lsprice: this.goodsDetail.price |
|
|
|
} |
|
|
|
this.carList.push(data) |
|
|
|
// let data = { |
|
|
|
// id: this.goodsDetail.id, |
|
|
|
// price: this.zPrice, |
|
|
|
// num: this.zNum, |
|
|
|
// productName: this.goodsDetail.productName, |
|
|
|
// productSn: this.goodsDetail.productSn, |
|
|
|
// productPicture: this.goodsDetail.productPicture, |
|
|
|
// supplierName: this.goodsDetail.supplierName, |
|
|
|
// saleDetailQueryDTO: this.temporaryList, |
|
|
|
// wholesalePrice: this.goodsDetail.wholesalePrice, |
|
|
|
// lsprice: this.goodsDetail.price |
|
|
|
// } |
|
|
|
// this.carList.push(data) |
|
|
|
this.temporaryList = [] |
|
|
|
this.purchasePrice = '' |
|
|
|
this.zPrice = '' |
|
|
|
|