From 7970739db1c4fb8e565176b34feb163b87c70ca3 Mon Sep 17 00:00:00 2001
From: wangfukang <15630117759@163.com>
Date: Tue, 20 Aug 2024 18:00:57 +0800
Subject: [PATCH] 11
---
package1/AI/AIHangOrderList.vue | 7 +-
package1/index/order.vue | 34 ++++----
package1/index/orderDetail.vue | 106 ++++++++++++++++++------
package1/inventory/addGoods.vue | 83 ++++++++++++++++++-
package1/inventory/inventoryConfirm.vue | 7 +-
5 files changed, 186 insertions(+), 51 deletions(-)
diff --git a/package1/AI/AIHangOrderList.vue b/package1/AI/AIHangOrderList.vue
index 87b427a..4926467 100644
--- a/package1/AI/AIHangOrderList.vue
+++ b/package1/AI/AIHangOrderList.vue
@@ -949,12 +949,13 @@
obj.categoryId = item.saleDetailDTOList[i].categoryId
obj.zPrice = item.saleDetailDTOList[i].discountAmount
obj.unitPrice = item.saleDetailDTOList[i].discountAmount || item.saleDetailDTOList[i]
- .wholesalePrice
+ .wholesalePrice
+ obj.discountAmount = item.saleDetailDTOList[i].discountAmount
obj.productName = item.saleDetailDTOList[i].productName
obj.productPicture = item.saleDetailDTOList[i].productPicture + '?time=' + new Date().getTime()
obj.productSn = item.saleDetailDTOList[i].productSn
- obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice
- obj.returnPrice = item.saleDetailDTOList[i].returnPrice
+ obj.wholesalePrice = item.saleDetailDTOList[i].discountAmount || item.saleDetailDTOList[i].wholesalePrice
+ obj.returnPrice = item.saleDetailDTOList[i].returnPrice
obj.saleId = item.id
obj.remark = item.remark
obj.xsyId = item.createBy
diff --git a/package1/index/order.vue b/package1/index/order.vue
index 44a2eba..c59a15e 100644
--- a/package1/index/order.vue
+++ b/package1/index/order.vue
@@ -324,23 +324,23 @@
obj.createByName = item.createByName
dataList.push(obj)
}
- this.$nextTick(()=>{
- this.tui.request("/app/customer/list", "post", {
- notBuyDays: "",
- pageNum: 1,
- pageSize: 10,
- searchStr: item.userName,
- sort: "",
- }, false, false).then((res) => {
- if (res.code == 200) {
- this.returnList = new Map()
- uni.setStorageSync('khName', JSON.stringify(res.result.records[0]))
- uni.setStorageSync('carList1', JSON.stringify(dataList))
- uni.setStorageSync('hangOrder', true)
- uni.switchTab({
- url: '/pages/inventory/goodsList1'
- })
- }
+ this.$nextTick(()=>{
+ this.tui.request("/app/debt/selectByUserId", "post", {
+ shopId:uni.getStorageSync('shopId'),
+ userId:item.userId
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ this.returnList = new Map()
+ res.result.noEarn = res.result.amountOwed
+ res.result.name = res.result.userName
+ res.result.id = item.userId
+ uni.setStorageSync('khName', JSON.stringify(res.result))
+ uni.setStorageSync('carList1', JSON.stringify(dataList))
+ uni.setStorageSync('hangOrder', true)
+ uni.switchTab({
+ url: '/pages/inventory/goodsList1'
+ })
+ }
})
})
},
diff --git a/package1/index/orderDetail.vue b/package1/index/orderDetail.vue
index 3390dfd..718c55c 100644
--- a/package1/index/orderDetail.vue
+++ b/package1/index/orderDetail.vue
@@ -97,6 +97,20 @@
{{ sales.totalAmount == null ?'暂无':sales.totalAmount }}
+
+ 退货数量
+
+ ¥
+ {{ returnNum == null ?'暂无':returnNum }}
+
+
+
+ 退货金额
+
+ ¥
+ {{ returnPrice == null ?'暂无':returnPrice }}
+
+
总成本
@@ -933,14 +947,24 @@
.productName == null ? '' : that.newData[i].productName) + ')')
}
} else {
- if (that.newData[i].productName == that.newData[i].productSn) {
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
- .newData[i].productSn)
+ if (that.newData[i].productName == that.newData[i].productSn && that.order.name !='散客') {
+ if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1){ //买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
+ .newData[i].productSn)
+ }else{ // 0是没买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
+ .newData[i].productSn)
+ }
} else {
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
- .newData[i].productSn +
- '(' + (that.newData[i]
- .productName == null ? '' : that.newData[i].productName) + ')')
+ if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
+ .newData[i].productSn + '(' + (that.newData[i]
+ .productName == null ? '' : that.newData[i].productName) + ')')
+ }else{ // 0是没买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
+ .newData[i].productSn + '(' + (that.newData[i]
+ .productName == null ? '' : that.newData[i].productName) + ')')
+ }
}
}
@@ -985,14 +1009,24 @@
.productName == null ? '' : that.newData[i].productName) + ')')
}
} else {
- if (that.newData[i].productName == that.newData[i].productSn) {
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
- .newData[i].productSn)
+ if (that.newData[i].productName == that.newData[i].productSn && that.order.name !='散客') {
+ if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1){ //买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
+ .newData[i].productSn)
+ }else{ // 0是没买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
+ .newData[i].productSn)
+ }
} else {
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
- .newData[i].productSn +
- '(' + (that.newData[i]
- .productName == null ? '' : that.newData[i].productName) + ')')
+ if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
+ .newData[i].productSn + '(' + (that.newData[i]
+ .productName == null ? '' : that.newData[i].productName) + ')')
+ }else{ // 0是没买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
+ .newData[i].productSn + '(' + (that.newData[i]
+ .productName == null ? '' : that.newData[i].productName) + ')')
+ }
}
}
@@ -1052,13 +1086,23 @@
}
} else {
if (that.newData[i].productName == that.newData[i].productSn) {
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
- .newData[i].productSn)
+ if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
+ .newData[i].productSn)
+ }else{ // 0是没买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
+ .newData[i].productSn)
+ }
} else {
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
- .newData[i].productSn +
- '(' + (that.newData[i]
- .productName == null ? '' : that.newData[i].productName) + ')')
+ if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
+ .newData[i].productSn + '(' + (that.newData[i]
+ .productName == null ? '' : that.newData[i].productName) + ')')
+ }else{ // 0是没买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
+ .newData[i].productSn + '(' + (that.newData[i]
+ .productName == null ? '' : that.newData[i].productName) + ')')
+ }
}
}
@@ -1104,13 +1148,23 @@
}
} else {
if (that.newData[i].productName == that.newData[i].productSn) {
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
- .newData[i].productSn)
+ if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
+ .newData[i].productSn)
+ }else{ // 0是没买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
+ .newData[i].productSn)
+ }
} else {
- strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
- .newData[i].productSn +
- '(' + (that.newData[i]
- .productName == null ? '' : that.newData[i].productName) + ')')
+ if(that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name !='散客'){ //买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【补】' + that
+ .newData[i].productSn + '(' + (that.newData[i]
+ .productName == null ? '' : that.newData[i].productName) + ')')
+ }else{ // 0是没买过
+ strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '【销】' + that
+ .newData[i].productSn + '(' + (that.newData[i]
+ .productName == null ? '' : that.newData[i].productName) + ')')
+ }
}
}
if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056' || that
diff --git a/package1/inventory/addGoods.vue b/package1/inventory/addGoods.vue
index fd49b5f..1a2ed5a 100644
--- a/package1/inventory/addGoods.vue
+++ b/package1/inventory/addGoods.vue
@@ -17,7 +17,9 @@
-
+
+
+
@@ -200,6 +202,24 @@
+
+
+
+
@@ -220,6 +240,7 @@
productName: '',
price: 0,
productSn: '',
+ purchasePrice:'',
wholesalePrice: 0,
productPicture: '',
productIntro: '',
@@ -360,7 +381,10 @@
categoryList: [],
cancelArr:[],
productId:'',
- arrtList: [],
+ arrtList: [],
+ guigeNum:0,//总共有多少件库存
+ differencePurchasePrice:0,//旧采购价和新维护采购价的差额差额
+ oldPurchasePrice:0,
userType: '',
typeItem:{},
arrtChange: [],
@@ -456,6 +480,8 @@
this.formData.barcode = res.result.barcode
this.formData.price = res.result.price
this.formData.productSn = res.result.productSn
+ this.formData.purchasePrice = res.result.purchasePrice
+ this.oldPurchasePrice = res.result.purchasePrice
this.formData.wholesalePrice = res.result.wholesalePrice
this.formData.productPicture = res.result.productPicture
this.formData.productIntro = res.result.productIntro
@@ -521,6 +547,21 @@
this.tui.toast(res.message)
}
}).catch((res) => {})
+ },
+ supplierCollection(){
+ this.tui.request('/app/debt/recharge', "post", {
+ userId:this.dataList.supplierId,
+ amountOwed:(this.guigeNum * this.differencePurchasePrice).toFixed(2),
+ userType:'1'
+ }, false, false).then((res) => {
+ if (res.code == 200) {
+ this.tui.toast('回款成功')
+ this.$refs.warnPopup.close()
+ }else{
+ this.tui.toast(res.message)
+ this.$refs.warnPopup.close()
+ }
+ })
},
//进入页面,查询货号列表
getSnList(){
@@ -618,6 +659,8 @@
this.formData.price = ''
}else if(type=='wholesalePrice'){
this.formData.wholesalePrice = ''
+ }else if(type=='purchasePrice'){
+ this.formData.purchasePrice = ''
}
},
generateSn(value){
@@ -767,7 +810,7 @@
}
}
- }else{
+ }else if(type == 'wholesalePrice'){
if(this.linshiPrice == e.target.value){
this.formData.wholesalePrice = e.target.value
}else{
@@ -778,6 +821,40 @@
}
}
+ }else if(type == 'purchasePrice'){
+ uni.showLoading({
+ title: '加载中...',
+ mask:true
+ })
+ if(this.linshiPrice == e.target.value){
+ this.formData.purchasePrice = e.target.value
+ }else{
+ if(e.target.value == ''){
+ this.formData.purchasePrice = this.linshiPrice
+ }else{
+ this.differencePurchasePrice = Number(this.oldPurchasePrice) - Number(e.target.value)
+ this.tui.request("/app/purchase/getPurchaseListByProductId", "post", {
+ productId: this.dataList.id,
+ pageSize: 9999,
+ pageNum: this.pageNum
+ }, false, false).then((res) => {
+ if (res.code == 200) {
+ this.guigeNum = 0
+ for(let i=0;i{
+ this.$refs.warnPopup.open()
+ uni.hideLoading()
+ },1000)
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
+ this.formData.purchasePrice = e.target.value
+ }
+
+ }
}
},
diff --git a/package1/inventory/inventoryConfirm.vue b/package1/inventory/inventoryConfirm.vue
index 4985022..6f7da03 100644
--- a/package1/inventory/inventoryConfirm.vue
+++ b/package1/inventory/inventoryConfirm.vue
@@ -177,6 +177,9 @@
url = '/app/stock/putInOfProduct'
}else{
url = '/app/stock/putOutPrice'
+ for(let i=0;i{
@@ -187,7 +190,7 @@
}, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({
- title: "退货成功",
+ title: "成功",
icon: 'none'
})
setTimeout(res => {
@@ -197,7 +200,7 @@
}, 1000)
} else {
uni.showToast({
- title: "退货失败",
+ title: "失败",
icon: 'none'
})
}