diff --git a/pages/billing/addUser.vue b/pages/billing/addUser.vue
index f8afde7..5a411d8 100644
--- a/pages/billing/addUser.vue
+++ b/pages/billing/addUser.vue
@@ -22,7 +22,7 @@
- 删除人员
+ 删除人员
提交
diff --git a/pages/billing/changeGoods1.vue b/pages/billing/changeGoods1.vue
index 1cc77f9..68c2bc2 100644
--- a/pages/billing/changeGoods1.vue
+++ b/pages/billing/changeGoods1.vue
@@ -343,35 +343,41 @@
},
//选择商品查询商品规格
- checkGoods(item) {
- this.goodsDetail = item
- if (typeof(this.goodsDetail.attributeList) == 'string') {
- let newObj = JSON.parse(this.goodsDetail.attributeList)
- let newArr = []
- for (let val in newObj) {
- let valueObj = [];
- for (var i = 0; i < newObj[val].length; i++) {
- valueObj.push({
- value: newObj[val][i],
- isChecked: false
- })
- this.attrNameList.push({
- value: newObj[val][i],
- name: val,
- isChecked: false
- })
- }
- newArr.push({
- name: val,
- value: valueObj
- })
- }
- this.goodsDetail.attributeList = newArr;
- this.goodsDetail.attributeList.forEach((item, index) => {
- this.columns[index] = item.value;
- this.keyList[index] = item.name;
- })
- }
+ checkGoods(item) {
+ this.tui.request("/app/product/getById/"+item.id, "POST", {}, false, true).then((res) => {
+ if (res.code == 200) {
+ this.goodsDetail = res.result
+ if (typeof(this.goodsDetail.attributeList) == 'string') {
+ let newObj = JSON.parse(this.goodsDetail.attributeList)
+ let newArr = []
+ for (let val in newObj) {
+ let valueObj = [];
+ for (var i = 0; i < newObj[val].length; i++) {
+ valueObj.push({
+ value: newObj[val][i],
+ isChecked: false
+ })
+ this.attrNameList.push({
+ value: newObj[val][i],
+ name: val,
+ isChecked: false
+ })
+ }
+ newArr.push({
+ name: val,
+ value: valueObj
+ })
+ }
+ this.goodsDetail.attributeList = newArr;
+ this.goodsDetail.attributeList.forEach((item, index) => {
+ this.columns[index] = item.value;
+ this.keyList[index] = item.name;
+ })
+ }
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
},
//顶部搜索框
diff --git a/pages/inventory/changeGoods1.vue b/pages/inventory/changeGoods1.vue
index 6b178a8..2c4c0ba 100644
--- a/pages/inventory/changeGoods1.vue
+++ b/pages/inventory/changeGoods1.vue
@@ -324,35 +324,42 @@
},
//选择商品查询商品规格
- checkGoods(item) {
- this.goodsDetail = item
- if (typeof(this.goodsDetail.attributeList) == 'string') {
- let newObj = JSON.parse(this.goodsDetail.attributeList)
- let newArr = []
- for (let val in newObj) {
- let valueObj = [];
- for (var i = 0; i < newObj[val].length; i++) {
- valueObj.push({
- value: newObj[val][i],
- isChecked: false
- })
- this.attrNameList.push({
- value: newObj[val][i],
- name: val,
- isChecked: false
- })
- }
- newArr.push({
- name: val,
- value: valueObj
- })
- }
- this.goodsDetail.attributeList = newArr;
- this.goodsDetail.attributeList.forEach((item, index) => {
- this.columns[index] = item.value;
- this.keyList[index] = item.name;
- })
- }
+ checkGoods(item) {
+ this.tui.request("/app/product/getById/"+item.id, "POST", {}, false, true).then((res) => {
+ if (res.code == 200) {
+ this.goodsDetail = res.result
+ if (typeof(this.goodsDetail.attributeList) == 'string') {
+ let newObj = JSON.parse(this.goodsDetail.attributeList)
+ let newArr = []
+ for (let val in newObj) {
+ let valueObj = [];
+ for (var i = 0; i < newObj[val].length; i++) {
+ valueObj.push({
+ value: newObj[val][i],
+ isChecked: false
+ })
+ this.attrNameList.push({
+ value: newObj[val][i],
+ name: val,
+ isChecked: false
+ })
+ }
+ newArr.push({
+ name: val,
+ value: valueObj
+ })
+ }
+ this.goodsDetail.attributeList = newArr;
+ this.goodsDetail.attributeList.forEach((item, index) => {
+ this.columns[index] = item.value;
+ this.keyList[index] = item.name;
+ })
+ }
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
+
},
//顶部搜索框
diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue
index 8186ff9..d3af544 100644
--- a/pages/inventory/goodsList1.vue
+++ b/pages/inventory/goodsList1.vue
@@ -30,6 +30,22 @@
添加商品
+
+
+
+ 选择价格
+
+
+
+
+
+
@@ -50,22 +66,6 @@
-
-
-
- 选择价格
-
-
-
-
-
-
@@ -251,7 +251,7 @@
relPrice: '0', //已付金额
otherExpense: '0', // 其他费用
priceNo: '0', //未付金额
- discountNum:10,
+ discountNum:10, //整体折扣
priceCurrent:'',
value: '',
priceItems:[{
@@ -265,11 +265,11 @@
],
items: [{
value: '0',
- name: '单品折'
+ name: '单品'
},
{
value: '1',
- name: '整体折'
+ name: '整体'
}
],
logisticsType: [{
@@ -293,7 +293,7 @@
name: '自送'
},
],
- discountType:'',
+ discountType:'', //折扣类型
discountCurrent:'',
current:'',
discCurrent: '', //折扣
@@ -344,10 +344,7 @@
.saleDetailQueryDTO[m].productCount)
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
}
- console.log("没有数据")
this.carList.set(this.carList1[i].id, obj)
- console.log(this.carList)
- // this.lsList.set(this.carList1[i].id, obj)
}
this.carList1 = []
} else { //当前页有数据
@@ -355,11 +352,9 @@
if (this.carList.has(this.carList1[i].id) == true) { //商品相同
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
if (this.carList.get(this.carList1[i].id).stockLogList.has(this.carList1[i].saleDetailQueryDTO[m].attributeList) == true) { //规格相同
- console.log("规格相同")
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList.get(this.carList1[i].id).stockLogList.get(this.carList1[i].saleDetailQueryDTO[m].attributeList) + this.carList1[i].saleDetailQueryDTO[m].productCount)
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
} else { //规格不同
- console.log("规格不同")
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
m].attributeList, this.carList1[i].saleDetailQueryDTO[m].productCount)
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
@@ -395,10 +390,17 @@
this.carList1 = []
}
- console.log('carList1', this.carList1)
- console.log('carList', this.carList)
this.carList.forEach(function(value, key) {
+ if(that.priceType == 0){ //零售
+ value.unitPrice = value.lsprice
+ }else if(that.priceType == 1){ //批发
+ value.unitPrice = value.wholesalePrice
+ }
+ if(that.discountType == 1){ //整体折扣
+ value.price = value.unitPrice * 10000 * value.productCount * that.discountNum /10 /10000
+ }
that.totalAmount += value.productCount
+ that.shouldPay += value.price
})
this.noPay = this.shouldPay
},
@@ -451,6 +453,10 @@
//折扣种类选择
discountChange(e){
let that = this;
+ // if(this.carList.size == 0){
+ // this.tui.toast("请先选择商品")
+ // return
+ // }
that.shouldPay = 0
this.discountType = e.detail.value;
this.carList.forEach(function(value, key) {
@@ -599,6 +605,11 @@
//整体选择是批发价还是零售价
priceChange(e){
let that = this;
+ // if(this.carList.size == 0){
+ // this.tui.toast("请先选择商品")
+ // return
+ // }
+ this.priceType = e
this.carList.forEach(function(value, key) {
that.index = value.productId
if(e == 0){ //零售