|
|
@ -39,15 +39,21 @@ |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
<view class="shop-type"> |
|
|
<view class="shop-type"> |
|
|
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)"> |
|
|
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)" :key="key"> |
|
|
|
|
|
<view @tap.stop="delShopSpec(value[0],values[0])"> |
|
|
|
|
|
<uni-icons color="red" type="minus" size="26"></uni-icons> |
|
|
|
|
|
</view> |
|
|
<text>{{values[0] | sliceMsg}}</text> |
|
|
<text>{{values[0] | sliceMsg}}</text> |
|
|
<!-- <text style="color: red;">单价:¥{{item.price}}</text> --> |
|
|
<!-- <text style="color: red;">单价:¥{{item.price}}</text> --> |
|
|
<text>数量:{{values[1]}}</text> |
|
|
<view style="text-align: left;padding-left: 5px;width:50%;display: flex;">数量:<uni-number-box max="100000" style="margin-top:16rpx;" v-model="values[1]" @change="GoodsNumChange($event,value[0],values[0])" /></view> |
|
|
</view> |
|
|
</view> |
|
|
<view |
|
|
<view |
|
|
style="position: absolute;top: 130rpx;right: 40rpx;color: blue;text-decoration: underline;" |
|
|
style="position: absolute;top: 130rpx;right: 40rpx;color: blue;text-decoration: underline;" |
|
|
@tap="clickCollapse(value[0])" v-if='storageType==0'> |
|
|
@tap="clickCollapse(value[0])" v-if='storageType==0'> |
|
|
维护采购价 |
|
|
维护采购价 |
|
|
|
|
|
</view> |
|
|
|
|
|
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[0])"> |
|
|
|
|
|
<uni-icons color="red" type="trash" size="26"></uni-icons> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -133,14 +139,14 @@ |
|
|
</view> |
|
|
</view> |
|
|
</li> |
|
|
</li> |
|
|
</ul> |
|
|
</ul> |
|
|
<view class="shop-checkList" v-for="item in temporaryList"> |
|
|
<view class="shop-checkList" v-for="(item,index) in temporaryList" :key="index"> |
|
|
<view class="shop-checkList-box"> |
|
|
<view class="shop-checkList-box"> |
|
|
{{item.name}} |
|
|
{{item.name}} |
|
|
</view> |
|
|
</view> |
|
|
<uni-number-box max='1000000' v-model="item.productCount" @change="temporaryChange" /> |
|
|
<uni-number-box max='1000000' v-model="item.productCount" @change="temporaryChange" /> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="shop-popup-bottom" v-for="item in temporaryList"> |
|
|
<view class="shop-popup-bottom" v-for="(item,index) in temporaryList" :key="index"> |
|
|
<view class="shop-popup-bottom-left"> |
|
|
<view class="shop-popup-bottom-left"> |
|
|
<text>数量:{{zNum}} 件</text> |
|
|
<text>数量:{{zNum}} 件</text> |
|
|
</view> |
|
|
</view> |
|
|
@ -518,6 +524,41 @@ |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url: '/pages/index/peopleList?popleType=' + popleType |
|
|
url: '/pages/index/peopleList?popleType=' + popleType |
|
|
}) |
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
//删除整条商品 |
|
|
|
|
|
delShop(id) { |
|
|
|
|
|
var that = this; |
|
|
|
|
|
uni.showModal({ |
|
|
|
|
|
title: "提示", |
|
|
|
|
|
content: "确定删除此条商品吗?", |
|
|
|
|
|
success: function(res) { |
|
|
|
|
|
if(res.confirm){ |
|
|
|
|
|
if(that.carList.has(id) == true){ |
|
|
|
|
|
that.carList.delete(id) |
|
|
|
|
|
} |
|
|
|
|
|
that.$forceUpdate() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
//删除商品下的某一个规格 |
|
|
|
|
|
delShopSpec(id,name) { |
|
|
|
|
|
var that = this; |
|
|
|
|
|
uni.showModal({ |
|
|
|
|
|
title: "提示", |
|
|
|
|
|
content: "确定删除此条商品吗?", |
|
|
|
|
|
success: function(res) { |
|
|
|
|
|
if(res.confirm){ |
|
|
|
|
|
that.carList.get(id).stockLogList.delete(name) |
|
|
|
|
|
if(that.carList.get(id).stockLogList.size == 0){ |
|
|
|
|
|
that.carList.delete(id) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
that.$forceUpdate() |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
inventorySubmit() { |
|
|
inventorySubmit() { |
|
|
if (this.khName == '' || this.carList == '') { |
|
|
if (this.khName == '' || this.carList == '') { |
|
|
@ -591,7 +632,24 @@ |
|
|
that.carList.forEach(function(value, key) { |
|
|
that.carList.forEach(function(value, key) { |
|
|
that.shouldPay += value.price |
|
|
that.shouldPay += value.price |
|
|
}) |
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
//修改已选规格的数量 |
|
|
|
|
|
GoodsNumChange(e,index,index1){ |
|
|
|
|
|
console.log(this.carList) |
|
|
|
|
|
let that = this; |
|
|
|
|
|
this.carList.get(index).stockLogList.set(index1,e) |
|
|
|
|
|
this.carList.get(index).productCount = 0 |
|
|
|
|
|
this.shouldPay = 0 |
|
|
|
|
|
this.totalAmount = 0 |
|
|
|
|
|
this.carList.get(index).stockLogList.forEach(function(value, key) { |
|
|
|
|
|
console.log(that.carList.get(index)) |
|
|
|
|
|
that.carList.get(index).productCount = that.carList.get(index).productCount + value |
|
|
|
|
|
that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get(index).purchasePrice |
|
|
|
|
|
}) |
|
|
|
|
|
this.carList.forEach(function(value, key) { |
|
|
|
|
|
that.shouldPay = that.shouldPay + value.price |
|
|
|
|
|
that.totalAmount = that.totalAmount+ value.productCount |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -718,7 +776,7 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.shop-collapse text { |
|
|
.shop-collapse text { |
|
|
flex: 1; |
|
|
width: 40%; |
|
|
text-align: center; |
|
|
text-align: center; |
|
|
padding-right: 40rpx; |
|
|
padding-right: 40rpx; |
|
|
border-right: 1px solid #eee; |
|
|
border-right: 1px solid #eee; |
|
|
|