|
|
|
@ -55,7 +55,7 @@ |
|
|
|
<text class="uni-tab__text">已选择</text> |
|
|
|
</view> |
|
|
|
<text style="background-color:#ff0000;color:#fff;position: absolute;top: 0;right: 10rpx;" |
|
|
|
class="uni-tab__dot">{{carList.length}}</text> |
|
|
|
class="uni-tab__dot">{{carList.size}}</text> |
|
|
|
</view> |
|
|
|
<view class="bottom-right"> |
|
|
|
<view class="bottom-btn" @tap="backPrevPage">选好了</view> |
|
|
|
@ -64,33 +64,36 @@ |
|
|
|
<!-- 购物车弹出层 --> |
|
|
|
<uni-popup ref="carPopup" background-color="#fff"> |
|
|
|
<view class="popup-content"> |
|
|
|
<view v-for="(item,index) in carList" :key="index" style="position: relative;"> |
|
|
|
<view v-for="(value,key) in Array.from(carList)" :key="key" style="position: relative;"> |
|
|
|
<view class="popup-title"> |
|
|
|
<view class="popup-title-left"> |
|
|
|
<img class="img-radius" :src="item.productPicture" alt="" v-if="item.productPicture"> |
|
|
|
<img class="img-radius" :src="value[1].productPicture" alt="" v-if="value[1].productPicture"> |
|
|
|
<view class="noPic" v-else>暂无图片</view> |
|
|
|
</view> |
|
|
|
<view class="popup-title-right"> |
|
|
|
<view class="popup-title-right-box" style="color: #088FEB;">{{item.productName}}</view> |
|
|
|
<view class="popup-title-right-box">{{item.productSn}}</view> |
|
|
|
<view class="popup-title-right-box" style="color: #088FEB;">{{value[1].productName}}</view> |
|
|
|
<view class="popup-title-right-box">{{value[1].productSn}}</view> |
|
|
|
<view class="popup-title-right-box"> |
|
|
|
<text style="margin-right:20rpx;">供应商:{{item.supplierName}}</text> |
|
|
|
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(item)"> |
|
|
|
<text style="margin-right:20rpx;">供应商:{{value[1].supplierName}}</text> |
|
|
|
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[1])"> |
|
|
|
<uni-icons color="red" type="trash" size="26"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="popup-container" v-for="(item1,index1) in item.saleDetailQueryDTO" :key="index1"> |
|
|
|
<view class="popup-container" v-for="(values,keys) in Array.from(value[1].stockLogList)" :key="keys"> |
|
|
|
<view class="checkList" style="padding-bottom:160rpx;"> |
|
|
|
<!-- <view style="margin-right:5%;" @tap="delShopSpec(item.id,item1.attributeList)"> |
|
|
|
<uni-icons color="red" type="minus" size="26"></uni-icons> |
|
|
|
</view> --> |
|
|
|
<view class="checkList-box"> |
|
|
|
{{item1.attributeList | sliceMsg}} |
|
|
|
{{values[0] | sliceMsg}} |
|
|
|
</view> |
|
|
|
<view class="checkList-box"> |
|
|
|
{{values[1].stockCount}} |
|
|
|
</view> |
|
|
|
<uni-number-box max="100000" v-model="item1.pdNum" /> |
|
|
|
<uni-number-box max="100000" v-model="values[1].pdNum" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -120,7 +123,7 @@ |
|
|
|
categoryId: '', //分类id |
|
|
|
searchName: '', //搜索框输入值 |
|
|
|
shopId: '', //店铺id, |
|
|
|
carList: [], |
|
|
|
carList: new Map(), |
|
|
|
attributeList: [], |
|
|
|
purchasePrice: 0, |
|
|
|
storageType: '', |
|
|
|
@ -152,28 +155,41 @@ |
|
|
|
onShow(){ |
|
|
|
let that = this; |
|
|
|
this.pdList = this.pdList |
|
|
|
console.log('你好',this.pdList) |
|
|
|
if(this.carList.length == 0){ //carList没有数据 |
|
|
|
this.carList.push(this.pdList) |
|
|
|
}else{ //carList有数据 |
|
|
|
for(let i=0;i<this.carList.length;i++){ |
|
|
|
if(this.pdList.id == this.carList[i].id){ //相拼相同 |
|
|
|
for(let z=0;z<this.carList[i].saleDetailQueryDTO.length;z++){ |
|
|
|
for(let j=0;j<this.pdList.saleDetailQueryDTO.length;j++){ |
|
|
|
if(this.carList[i].saleDetailQueryDTO[z].attributeList == this.pdList.saleDetailQueryDTO[j].attributeList){ //规格相同 |
|
|
|
this.carList[i].saleDetailQueryDTO[z] = this.pdList.saleDetailQueryDTO[j] |
|
|
|
}else{ //规格不同 |
|
|
|
this.carList[i].saleDetailQueryDTO.push(this.pdList.saleDetailQueryDTO[j]) |
|
|
|
} |
|
|
|
} |
|
|
|
if(this.pdList.saleDetailQueryDTO){ |
|
|
|
if (this.carList.size == 0) { //当前页没有数据 |
|
|
|
let obj = { |
|
|
|
id: this.pdList.id, |
|
|
|
productName: this.pdList.productName, |
|
|
|
productPicture: this.pdList.productPicture, |
|
|
|
productSn: this.pdList.productSn, |
|
|
|
supplierName:this.pdList.supplierName, |
|
|
|
stockLogList: new Map(), |
|
|
|
} |
|
|
|
for (let m = 0; m < this.pdList.saleDetailQueryDTO.length; m++) { |
|
|
|
obj.stockLogList.set(this.pdList.saleDetailQueryDTO[m].attributeList, this.pdList.saleDetailQueryDTO[m]) |
|
|
|
} |
|
|
|
this.carList.set(this.pdList.id, obj) |
|
|
|
} else { //当前页有数据 |
|
|
|
if (this.carList.has(this.pdList.id) == true) { //商品相同 |
|
|
|
for (let m = 0; m < this.pdList.saleDetailQueryDTO.length; m++) { |
|
|
|
this.carList.get(this.pdList.id).stockLogList.set(this.pdList.saleDetailQueryDTO[m].attributeList,this.pdList.saleDetailQueryDTO[m]) |
|
|
|
} |
|
|
|
}else{ //商品不同 |
|
|
|
this.carList.push(this.pdList) |
|
|
|
} else { //商品不同 |
|
|
|
let obj = { |
|
|
|
id: this.pdList.id, |
|
|
|
productName: this.pdList.productName, |
|
|
|
productPicture: this.pdList.productPicture, |
|
|
|
productSn: this.pdList.productSn, |
|
|
|
supplierName:this.pdList.supplierName, |
|
|
|
stockLogList: new Map(), |
|
|
|
} |
|
|
|
for (let m = 0; m < this.pdList.saleDetailQueryDTO.length; m++) { |
|
|
|
obj.stockLogList.set(this.pdList.saleDetailQueryDTO[m].attributeList, this.pdList.saleDetailQueryDTO[m]) |
|
|
|
} |
|
|
|
this.carList.set(this.pdList.id, obj) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log(this.carList) |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
@ -230,7 +246,7 @@ |
|
|
|
toggle(type, item) { |
|
|
|
if (type == 'carPopup') { |
|
|
|
this.$refs.carPopup.open('bottom') |
|
|
|
this.carType = this.carList.length |
|
|
|
this.carType = this.carList.size |
|
|
|
} else { |
|
|
|
|
|
|
|
this.productId = item.id |
|
|
|
|