|
|
|
@ -29,12 +29,15 @@ |
|
|
|
:key="key"> |
|
|
|
<view class="shop-name"> |
|
|
|
<view class="new-logo" v-if="value[1].isNew">新</view> |
|
|
|
<view class="u-upload" @tap="uploadFilePromise(value)"></view> |
|
|
|
<view class="u-upload" v-if="value[1].isNew" @tap="uploadFilePromise(value)"></view> |
|
|
|
<view class="" style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;"> |
|
|
|
<img class="img-radius" style="width: 140rpx;height: 140rpx;" @tap="" :src="value[1].productPicture" alt=""> |
|
|
|
<view style="width: 140rpx;height:34rpx;line-height: 34rpx;display: flex;margin-top: -10rpx;"> |
|
|
|
<img v-if="value[1].productPicture" class="img-radius" style="width: 140rpx;height: 140rpx;display: block;overflow: hidden;" :src="value[1].productPicture" alt=""> |
|
|
|
<view v-else style="width: 100%;height: 140rpx;border-radius: 10px;border: 1px solid #eee;line-height: 140rpx;text-align: center;"> |
|
|
|
<uni-icons type='plusempty' size='26'></uni-icons> |
|
|
|
</view> |
|
|
|
<view style="width: 140rpx;height:34rpx;line-height: 34rpx;display: flex;margin-top: 20rpx;"> |
|
|
|
<view @tap.stop="delShop(value[0])" style="background:#088FEB" class="left-btn">删除</view> |
|
|
|
<view class="left-btn" style="margin-left: 20rpx;">合并</view> |
|
|
|
<view @tap="toggle('mergePopup',value[0])" class="left-btn" style="margin-left: 20rpx;">合并</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
@ -51,7 +54,9 @@ |
|
|
|
</view> |
|
|
|
<view style="display: flex;height: 55rpx;line-height: 55rpx;"> |
|
|
|
单价:<input type="number" v-model="value[1].purchasePrice" @blur="clickCollapse($event,value[0])" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 319rpx;padding-left: 20rpx;"> |
|
|
|
<view style="height: 27px;width: 70px;background: #088FEB;color: #fff;border-radius: 5px;margin-top: -10rpx;text-align: center;">添加规格</view> |
|
|
|
<view @tap="AiAddSpec(value[1])" style="height: 27px;width: 70px;background: #088FEB;color: #fff;border-radius: 5px;margin-top: -10rpx;text-align: center;"> |
|
|
|
添加规格 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
@ -206,6 +211,36 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
<!-- 弹出合并商品 --> |
|
|
|
<uni-popup ref="mergePopup" background-color="#fff" :is-mask-click="true"> |
|
|
|
<view class="type-popup" style="max-height: 1000rpx;overflow: scroll;margin-bottom: 0;border-radius: 0;"> |
|
|
|
<view style="height: 80rpx;font-size: 36rpx;font-weight: bold;line-height: 80rpx;text-align: center;"> |
|
|
|
请选择要合并到的商品 |
|
|
|
</view> |
|
|
|
<view class="shop-box" v-for="(value,key) in Array.from(carList)" :key="key" v-if="value[1].id != mergeId" @tap="clickMerge(value[0])"> |
|
|
|
<view class="shop-name" style="height: 150rpx;"> |
|
|
|
<view class="" style="width: 100rpx;height: 100rpx;margin: 20rpx 0 0 20rpx;font-size: 22rpx;"> |
|
|
|
<img v-if="value[1].productPicture" class="img-radius" style="width: 100rpx;height: 100rpx;display: block;overflow: hidden;" :src="value[1].productPicture" alt=""> |
|
|
|
<view v-else class="img-radius" style="width: 100rpx;height: 100rpx;display: block;overflow: hidden;text-align: center;line-height: 100rpx;border: 1px solid #eee;">暂无图片</view> |
|
|
|
</view> |
|
|
|
<view class="shop-productName" style="height: 130rpx;"> |
|
|
|
<view style="display: flex;height: 55rpx;line-height: 55rpx;"> |
|
|
|
{{value[1].productName}} |
|
|
|
</view> |
|
|
|
<view style="display: flex;height: 55rpx;line-height: 55rpx;"> |
|
|
|
货号:{{value[1].productSn}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view style="line-height: 80rpx;font-size: 22rpx;color: #777;text-align: center;"> |
|
|
|
没有要合并的商品?那就去库存里看看吧~ ↓↓ |
|
|
|
</view> |
|
|
|
<view @tap="goChooseGoods" style="width: 100%;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 0;background: linear-gradient(90deg, #60F3FF, #088FEB);color: #fff;"> |
|
|
|
<view>同库存商品合并</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
<!-- 弹出规格选择 --> |
|
|
|
<uni-popup ref="getaPopup" background-color="#fff" :is-mask-click="true"> |
|
|
|
<view class="type-popup"> |
|
|
|
@ -270,7 +305,8 @@ |
|
|
|
pageOldTemList: [], |
|
|
|
oldTemList: [], |
|
|
|
attrList: [], |
|
|
|
goodsList: [], |
|
|
|
goodsList: [], |
|
|
|
mergeId:'', |
|
|
|
newTemList: [], |
|
|
|
pecsList: [], |
|
|
|
dataObj: new Map(), |
|
|
|
@ -296,7 +332,22 @@ |
|
|
|
title: '加载中...' |
|
|
|
}) |
|
|
|
let that = this; |
|
|
|
|
|
|
|
if(this.merge ==1){ |
|
|
|
this.$refs.mergePopup.close(); |
|
|
|
this.carList.get(this.mergeId).productId = this.carList1.id |
|
|
|
this.carList.get(this.mergeId).id = this.carList1.id |
|
|
|
this.carList.get(this.mergeId).productName = this.carList1.productName |
|
|
|
this.carList.get(this.mergeId).productPicture = this.carList1.productPicture |
|
|
|
this.carList.get(this.mergeId).productSn = this.carList1.productSn |
|
|
|
this.carList.get(this.mergeId).categoryId = this.carList1.categoryId |
|
|
|
this.carList.get(this.mergeId).isNew=false |
|
|
|
setTimeout(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
}, 300) |
|
|
|
this.$forceUpdate() |
|
|
|
this.merge ==0 |
|
|
|
return; |
|
|
|
} |
|
|
|
if(uni.getStorageSync('carList1') != ''){ |
|
|
|
this.carList1 = uni.getStorageSync('carList1') |
|
|
|
}else{ |
|
|
|
@ -310,8 +361,9 @@ |
|
|
|
purchasePrice: this.carList1[i].price, //进货价 |
|
|
|
price: 0, |
|
|
|
productCount: 0, |
|
|
|
id:this.carList1[i].id, |
|
|
|
isNew:this.carList1[i].isNew, |
|
|
|
productId: this.carList1[i].id, |
|
|
|
productId: this.carList1[i].productId == null ? '' : this.carList1[i].productId, |
|
|
|
productName: this.carList1[i].productName, |
|
|
|
wholesalePrice: this.carList1[i].wholesalePrice, |
|
|
|
categoryName:'', |
|
|
|
@ -366,8 +418,9 @@ |
|
|
|
let obj = { |
|
|
|
purchasePrice: "", //进货价 |
|
|
|
price: 0, |
|
|
|
productCount: 0, |
|
|
|
productId: this.carList1[i].id, |
|
|
|
productCount: 0, |
|
|
|
id:this.carList1[i].id, |
|
|
|
productId: this.carList1[i].productId == null ? '' : this.carList1[i].productId, |
|
|
|
isNew:this.carList1[i].isNew, |
|
|
|
productName: this.carList1[i].productName, |
|
|
|
wholesalePrice: this.carList1[i].wholesalePrice, |
|
|
|
@ -634,6 +687,9 @@ |
|
|
|
uni.navigateTo({ |
|
|
|
url: "/pages/inventory/changeGoods1" |
|
|
|
}) |
|
|
|
}, |
|
|
|
mergeGoods(){ |
|
|
|
|
|
|
|
}, |
|
|
|
addGategory(){ |
|
|
|
this.tui.request("/app/productCategory/save", "post", { |
|
|
|
@ -683,6 +739,11 @@ |
|
|
|
this.temporaryList[i].productCount-- |
|
|
|
} |
|
|
|
this.temporaryChange() |
|
|
|
}, |
|
|
|
goChooseGoods(){ |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/package1/AI/AiChangeGoods' |
|
|
|
}) |
|
|
|
}, |
|
|
|
attrNameChange(index, data1, index1) { |
|
|
|
let that= this; |
|
|
|
@ -837,7 +898,39 @@ |
|
|
|
this.$refs.typePopup.open() |
|
|
|
}else if(type== 'addGateDialog'){ |
|
|
|
this.$refs.addGateDialog.open() |
|
|
|
}else if(type== "mergePopup"){ |
|
|
|
console.log(id) |
|
|
|
this.mergeId = id |
|
|
|
this.$refs.mergePopup.open() |
|
|
|
} |
|
|
|
}, |
|
|
|
//合并已有 |
|
|
|
clickMerge(value,key){ |
|
|
|
let that = this; |
|
|
|
console.log('key',this.mergeId) |
|
|
|
console.log('11',this.carList.get(this.mergeId)) // 旧的 |
|
|
|
console.log('订单',this.carList.get(value)) // 新的 |
|
|
|
this.carList.get(this.mergeId).stockLogList.forEach(function(values, keys) { |
|
|
|
if(that.carList.get(value).stockLogList.has(keys)){ |
|
|
|
console.log('找到了') |
|
|
|
that.carList.get(value).stockLogList.get(keys).productCount += that.carList.get(that.mergeId).stockLogList.get(keys).productCount |
|
|
|
}else{ |
|
|
|
console.log('没找到',that.carList.get(that.mergeId).stockLogList.get(keys)) |
|
|
|
console.log('没找到',keys) |
|
|
|
that.carList.get(value).stockLogList.set(keys,that.carList.get(that.mergeId).stockLogList.get(keys)) |
|
|
|
} |
|
|
|
that.carList.get(value).productCount += that.carList.get(that.mergeId).stockLogList.get(keys).productCount |
|
|
|
that.carList.get(value).price = that.carList.get(value).productCount * that.carList.get(value).purchasePrice |
|
|
|
}) |
|
|
|
this.carList.delete(this.mergeId) |
|
|
|
this.$forceUpdate() |
|
|
|
console.log(this.carList) |
|
|
|
this.getAllPrice() |
|
|
|
this.$refs.mergePopup.close() |
|
|
|
}, |
|
|
|
AiAddSpec(value){ |
|
|
|
console.log(value) |
|
|
|
this.toggle('bottom', value.id); |
|
|
|
}, |
|
|
|
//通过商品id查询商品详细信息 |
|
|
|
getById(id) { |
|
|
|
@ -1018,7 +1111,8 @@ |
|
|
|
let data = { |
|
|
|
id: this.goodsDetail.id, |
|
|
|
price: 0, |
|
|
|
num: this.zNum, |
|
|
|
num: this.zNum, |
|
|
|
productId:this.goodsDetail.id, |
|
|
|
productName: this.goodsDetail.productName, |
|
|
|
wholesalePrice: this.goodsDetail.wholesalePrice, |
|
|
|
categoryName:'', |
|
|
|
@ -1046,7 +1140,8 @@ |
|
|
|
let obj = { |
|
|
|
purchasePrice: "", //进货价 |
|
|
|
price: 0, |
|
|
|
productCount: 0, |
|
|
|
productCount: 0, |
|
|
|
id: carList1[i].id, |
|
|
|
productId: carList1[i].id, |
|
|
|
wholesalePrice: this.goodsDetail.wholesalePrice, |
|
|
|
categoryName:'', |
|
|
|
@ -1241,7 +1336,8 @@ |
|
|
|
supplierId: this.khName.id, //供应商id和姓名 |
|
|
|
supplierName: this.khName.consigneeName |
|
|
|
} |
|
|
|
let purchaseDetails = []; |
|
|
|
let purchaseDetails = []; |
|
|
|
console.log(this.carList) |
|
|
|
this.carList.forEach(function(value, key) { |
|
|
|
value.stockLogList1 = [] |
|
|
|
if (value.purchasePrice == '' || value.purchasePrice == 0) { |
|
|
|
@ -1265,7 +1361,8 @@ |
|
|
|
attributeList: keys |
|
|
|
} |
|
|
|
value.stockLogList1.push(obj) |
|
|
|
}) |
|
|
|
}) |
|
|
|
delete value.id; |
|
|
|
purchaseDetails.push(value) |
|
|
|
}) |
|
|
|
console.log(purchaseDetails) |
|
|
|
|