|
|
|
@ -57,7 +57,7 @@ |
|
|
|
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;"> |
|
|
|
<view class="shop-productName"> |
|
|
|
<view style="color:#FF5809;">品名:{{value[1].productName}} ({{value[1].productSn}})</view> |
|
|
|
<view>单价:{{value[1].purchasePrice}} 数量:{{value[1].productCount}} 总价:{{value[1].price}}</view> |
|
|
|
<view>单价:{{value[1].unitPrice}} 数量:{{value[1].productCount}} 总价:{{value[1].price}}</view> |
|
|
|
<view>供应商:{{value[1].supplierName}}</view> |
|
|
|
</view> |
|
|
|
<view style="position: absolute;top: 110rpx;right: 40rpx;color: blue;text-decoration: underline;" |
|
|
|
@ -69,11 +69,11 @@ |
|
|
|
<view class="shop-collapse-item" v-if="discountType == '0'"> |
|
|
|
<view class="collapse-1"> |
|
|
|
<text>单价</text> |
|
|
|
<input class="input" type="text" :value='value[1].purchasePrice' disabled> |
|
|
|
<input class="input" type="text" :value='value[1].unitPrice' disabled> |
|
|
|
</view> |
|
|
|
<view class="collapse-1"> |
|
|
|
<text>折扣(100%)</text> |
|
|
|
<input class="input" type="text" :value='value[1].discount'> |
|
|
|
<text>折扣(0-10)</text> |
|
|
|
<input class="input" type="number" :value='value[1].discount | maxNum' @blur="changeDis($event,value[0])"> |
|
|
|
</view> |
|
|
|
<view class="collapse-1"> |
|
|
|
<text>折后价</text> |
|
|
|
@ -81,7 +81,7 @@ |
|
|
|
</view> |
|
|
|
<view class="collapse-1"> |
|
|
|
<text>数量</text> |
|
|
|
<input class="input" type="text" :value='value[1].productCount'> |
|
|
|
<input class="input" type="number" :value='value[1].productCount'> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)"> |
|
|
|
@ -101,37 +101,37 @@ |
|
|
|
<view class="content-list"> |
|
|
|
<view class="list-name">总金额</view> |
|
|
|
<view class="list-val"> |
|
|
|
<input type="text" :value="price" disabled> |
|
|
|
<input type="number" :value="shouldPay" disabled> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="content-list"> |
|
|
|
<view class="list-name">实收金额</view> |
|
|
|
<view class="list-val"> |
|
|
|
<input type="text" :value="relPrice"> |
|
|
|
<input type="number" :value="relPrice"> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="content-list"> |
|
|
|
<view class="list-name">已收金额</view> |
|
|
|
<view class="list-val"> |
|
|
|
<input type="text" :value="priceOk"> |
|
|
|
<input type="number" :value="priceOk"> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="content-list"> |
|
|
|
<view class="list-name">欠款</view> |
|
|
|
<view class="list-val"> |
|
|
|
<input type="text" :value="priceNo" disabled> |
|
|
|
<input type="number" :value="priceNo" disabled> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="content-list"> |
|
|
|
<view class="list-name">其他费用</view> |
|
|
|
<view class="list-val"> |
|
|
|
<input type="text" :value="otherExpense"> |
|
|
|
<input type="number" :value="otherExpense"> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="content-list"> |
|
|
|
<view class="list-name">备注</view> |
|
|
|
<view class=""> |
|
|
|
<textarea /> |
|
|
|
<textarea :value="remark"/> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -215,6 +215,10 @@ |
|
|
|
<view class="popup-pay-container" @tap="checkPay(wholesalePrice)"> |
|
|
|
<text style="display: inline-block">批发价:¥{{wholesalePrice}}</text> |
|
|
|
</view> |
|
|
|
<view class="popup-pay-container" style="background: #fff;display: flex;"> |
|
|
|
<input type="number" style="height: 100rpx;line-height: 100rpx;color:#000;" placeholder="请输入价格" @blur="changePay"> |
|
|
|
<view style="flex: 1;color: #fff;background: #088FEB;border-radius: 10px;" @tap="checkPay(customPrice)">确定</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
</view> |
|
|
|
@ -278,7 +282,9 @@ |
|
|
|
carList: new Map(), //添加商品页传回来的商品信息 |
|
|
|
xsyId: '', |
|
|
|
shouldPay:0, |
|
|
|
totalAmount: 0 |
|
|
|
totalAmount: 0, |
|
|
|
customPrice:0,//选择自定义金额 |
|
|
|
remark:'' |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
@ -291,9 +297,10 @@ |
|
|
|
if (this.carList.size == 0) { //当前页没有数据 |
|
|
|
for (let i = 0; i < this.carList1.length; i++) { |
|
|
|
let obj = { |
|
|
|
purchasePrice: this.carList1[i].price, //最后的价格 |
|
|
|
purchasePrice: this.carList1[i].price, //采购价 |
|
|
|
price: 0, //总价 |
|
|
|
discount:10, //折扣 |
|
|
|
unitPrice:0, //单价 |
|
|
|
discountAmount:0, //折后价 |
|
|
|
wholesalePrice:this.carList1[i].wholesalePrice, //批发价 |
|
|
|
lsprice:this.carList1[i].lsprice, //零售价 |
|
|
|
@ -334,10 +341,11 @@ |
|
|
|
} |
|
|
|
} else { //商品不同 |
|
|
|
let obj = { |
|
|
|
purchasePrice: this.carList1[i].price, //最后的价格 |
|
|
|
purchasePrice: this.carList1[i].price, //采购价 |
|
|
|
price: 0, |
|
|
|
discount:10, |
|
|
|
discountAmount:0, |
|
|
|
unitPrice:0, //单价 |
|
|
|
wholesalePrice:this.carList1[i].wholesalePrice, //批发价 |
|
|
|
lsprice:this.carList1[i].lsprice, //零售价 |
|
|
|
productCount: 0, |
|
|
|
@ -378,6 +386,13 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
return name; |
|
|
|
}, |
|
|
|
maxNum(val){ |
|
|
|
if(val >= 10){ |
|
|
|
return 10 |
|
|
|
}else if(val < 0){ |
|
|
|
return 0 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
@ -409,8 +424,18 @@ |
|
|
|
}, |
|
|
|
//折扣种类选择 |
|
|
|
discountChange(e){ |
|
|
|
//快递0 物流1 发车2 拼包3 自送4 |
|
|
|
let that = this; |
|
|
|
that.shouldPay = 0 |
|
|
|
this.discountType = e.detail.value; |
|
|
|
this.carList.forEach(function(value, key) { |
|
|
|
value.price = value.productCount * value.unitPrice //总价 |
|
|
|
value.discount = 10 //折扣 |
|
|
|
value.discountAmount = value.unitPrice |
|
|
|
that.shouldPay += value.price |
|
|
|
}) |
|
|
|
this.price = this.shouldPay //永远不变的总金额/实际折扣后的总金额 |
|
|
|
this.discountNum = 10 |
|
|
|
// shouldPay |
|
|
|
for (let i = 0; i < this.items.length; i++) { |
|
|
|
if (this.items[i].value === e.detail.value) { |
|
|
|
this.discountCurrent = i; |
|
|
|
@ -418,6 +443,12 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
//整体折扣数字框改变 |
|
|
|
change(e){ |
|
|
|
console.log(e) |
|
|
|
|
|
|
|
this.shouldPay = this.price *10000 * e / 10 /10000 |
|
|
|
}, |
|
|
|
//点击发货方式按钮 |
|
|
|
radioChange(e) { |
|
|
|
this.khName = '' |
|
|
|
@ -480,7 +511,8 @@ |
|
|
|
createByName:this.createByName, |
|
|
|
userId: "1704126992443641856", |
|
|
|
remark: '123', |
|
|
|
discountNum:10 |
|
|
|
discountNum:10, |
|
|
|
otherExpense:this.otherExpense |
|
|
|
}, |
|
|
|
|
|
|
|
saleDetailList: [] |
|
|
|
@ -525,11 +557,27 @@ |
|
|
|
this.lsprice = this.carList.get(this.index).lsprice |
|
|
|
this.$refs.inputDialog.open() |
|
|
|
}, |
|
|
|
//输入商品自定义金额 |
|
|
|
changePay(e){ |
|
|
|
this.customPrice = e.detail.value |
|
|
|
}, |
|
|
|
//更改单品折扣 |
|
|
|
changeDis(e,id){ |
|
|
|
let that = this; |
|
|
|
this.shouldPay = 0 |
|
|
|
let carlist = this.carList.get(id) |
|
|
|
carlist.discount = e.detail.value; |
|
|
|
carlist.discountAmount = carlist.unitPrice * e.detail.value /10 |
|
|
|
carlist.price = carlist.unitPrice * e.detail.value /10 * carlist.productCount |
|
|
|
that.carList.forEach(function(value, key) { |
|
|
|
that.shouldPay += value.price |
|
|
|
}) |
|
|
|
}, |
|
|
|
//选择是零售价还是批发价 |
|
|
|
checkPay(price){ |
|
|
|
let that = this; |
|
|
|
this.shouldPay = 0 |
|
|
|
this.carList.get(this.index).purchasePrice = price; |
|
|
|
this.carList.get(this.index).unitPrice = price; |
|
|
|
that.carList.get(that.index).price = price * that.carList.get(that.index).productCount; |
|
|
|
this.$refs.inputDialog.close() |
|
|
|
that.carList.forEach(function(value, key) { |
|
|
|
|