diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue
index 5ce7c37..e265ca6 100644
--- a/pages/inventory/goodsList1.vue
+++ b/pages/inventory/goodsList1.vue
@@ -57,7 +57,7 @@
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;">
品名:{{value[1].productName}} ({{value[1].productSn}})
- 单价:{{value[1].purchasePrice}} 数量:{{value[1].productCount}} 总价:{{value[1].price}}
+ 单价:{{value[1].unitPrice}} 数量:{{value[1].productCount}} 总价:{{value[1].price}}
供应商:{{value[1].supplierName}}
单价
-
+
- 折扣(100%)
-
+ 折扣(0-10)
+
折后价
@@ -81,7 +81,7 @@
数量
-
+
@@ -101,37 +101,37 @@
总金额
-
+
实收金额
-
+
已收金额
-
+
欠款
-
+
其他费用
-
+
备注
-
+
@@ -215,6 +215,10 @@
+
@@ -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) {