From 1dd040430d432a7331b88ee33460c98caa92f853 Mon Sep 17 00:00:00 2001
From: wangfukang <15630117759@163.com>
Date: Fri, 1 Nov 2024 08:43:39 +0800
Subject: [PATCH] 11.1
---
pages/index/home.vue | 3 +
pages/index/index.vue | 30 +-
pages/inventory/goodsList1.vue | 741 ++++++++++++++++++++++-----------
pages/inventory/inventory.vue | 10 +-
4 files changed, 536 insertions(+), 248 deletions(-)
diff --git a/pages/index/home.vue b/pages/index/home.vue
index 1e6ddb2..8d0f116 100644
--- a/pages/index/home.vue
+++ b/pages/index/home.vue
@@ -13,6 +13,9 @@
uni.showLoading({
title: '加载中...'
})
+ if(uni.getStorageSync('noReload')){
+ uni.removeStorageSync('noReload')
+ }
if (uni.getStorageSync('hiver_token')) {
if (uni.getStorageSync('wayValue') == 1) {
uni.reLaunch({
diff --git a/pages/index/index.vue b/pages/index/index.vue
index b7bcac4..6b1b746 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -106,9 +106,19 @@
-
-
+
+ {{ item.createByName == null ?'暂无':item.createByName}} -
+ {{ item.createTime }}
+
+
+ 订单状态:{{item.status == '0' ?'待抢单' :item.status == '2' ?'作废' :item.status == '1' ?'待取货' :item.status == '3' ?'待送达' :item.status == '4' ?'已完成' :item.status == '5' ?'下游客户待退货' :item.status == '00' ?'退货待抢单' :item.status == '01' ?'退货待取货' :item.status == '03' ?'退货待送达' :item.status == '04' ?'待确认退货' :item.status == '6' ?'待配货':item.status == '8' ?'待物流上门':item.status == '9' ?'已完成' :'挂单'}}
+
+ 撤销
+ 撤销并复制
+
+
+
{{ item.createByName == null ?'暂无':item.createByName}} -
{{ item.createTime }}
@@ -346,12 +356,7 @@
activeBgOpacity: 0.08,
seriesGap: 10,
barBorderCircle: true,
- barBorderRadius: [
- 20,
- 20,
- 0,
- 0
- ],
+ barBorderRadius: [20,20,0,0],
linearType: "custom"
}
},
@@ -384,10 +389,6 @@
return val;
}
},
- onShow() {
- this.getSaleInfo()
- this.getEndTime()
- },
onLoad() {
let that = this;
wx.getLocation({
@@ -418,7 +419,8 @@
uni.setStorageSync("publicize", day)
this.$refs.publicizepopup.open('center')
}
-
+ this.getSaleInfo()
+ this.getEndTime()
},
onTabItemTap(e) {
this.getSaleInfo()
diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue
index c60a556..d2dc642 100644
--- a/pages/inventory/goodsList1.vue
+++ b/pages/inventory/goodsList1.vue
@@ -701,11 +701,11 @@
+ style="width: 69%;display: inline-block;font-size: 30rpx;font-weight: bold;padding-left: 40rpx;">
规格
+ style="font-size: 30rpx;color: #000;font-weight: bold;width: 25%;display: inline-block;text-align: center;">
库存
@@ -728,8 +728,8 @@
- {{item.name}}
-
+ {{item.name}}
+
无库存
@@ -1611,10 +1611,10 @@
}
}
}
- if(!cusPrice && Number(value.discountAmount) != Number(value.wholesalePrice)){
+ if(!cusPrice && (Number(value.discountAmount) != Number(value.wholesalePrice) && Number(value.discountAmount) != Number(value.lsprice))){
value.isChangePrice = true
}
- if(!cusReturnPrice && Number(value.returnPrice) != Number(value.wholesalePrice)){
+ if(!cusReturnPrice && (Number(value.discountAmount) != Number(value.wholesalePrice) && Number(value.discountAmount) != Number(value.lsprice))){
value.isChangeReturnPrice = true
}
if(value.isChangePrice){
@@ -2082,10 +2082,10 @@
}
}
}
- if(!cusPrice && Number(obj.discountAmount) != Number(obj.wholesalePrice)){
+ if(!cusPrice && (Number(obj.discountAmount) != Number(obj.wholesalePrice) && Number(obj.discountAmount) != Number(obj.lsprice))){
obj.isChangePrice = true
}
- if(!cusReturnPrice && obj.returnPrice != undefined && Number(obj.returnPrice) != Number(that.carList1[i].wholesalePrice)){
+ if(!cusReturnPrice && obj.returnPrice != undefined && (Number(obj.discountAmount) != Number(obj.wholesalePrice) && Number(obj.discountAmount) != Number(obj.lsprice))){
obj.isChangeReturnPrice = true
}
console.log(this.khName)
@@ -2143,7 +2143,7 @@
}
}
console.log('this.carList',this.carList)
- if(!cusReturnPrice1 && this.carList1[i].returnPrice != undefined && Number(this.carList1[i].returnPrice) != Number(this.carList1[i].wholesalePrice)){
+ if(!cusReturnPrice1 && this.carList1[i].returnPrice != undefined && (Number(this.carList1[i].returnPrice) != Number(this.carList1[i].wholesalePrice) && Number(this.carList1[i].returnPrice) != Number(this.carList1[i].lsprice))){
this.carList.get(this.carList1[i].id).isChangeReturnPrice = true
this.carList.get(this.carList1[i].id).returnPrice = this.carList1[i].returnPrice
}
@@ -2252,10 +2252,10 @@
}
}
}
- if(!cusPrice && Number(obj.discountAmount) != Number(obj.wholesalePrice)){
+ if(!cusPrice && (Number(obj.discountAmount) != Number(obj.wholesalePrice) && Number(obj.discountAmount) != Number(obj.lsprice))){
obj.isChangePrice = true
}
- if(!cusReturnPrice && Number(obj.returnPrice) != Number(obj.wholesalePrice)){
+ if(!cusReturnPrice && (Number(obj.discountAmount) != Number(obj.wholesalePrice) && Number(obj.discountAmount) != Number(obj.lsprice))){
obj.isChangeReturnPrice = true
}
console.log(this.khName)
@@ -2959,7 +2959,7 @@
disNoAmount: 0, //折前价,用于计算整体折扣
wholesalePrice: 0, //批发价
lsprice: 0, //零售价
- productCount: 0, //总数量
+ productCount: 1, //总数量
returnCount: 0, //退货数量
productId: '',
productName: '',
@@ -3098,16 +3098,24 @@
if (this.isPlusAndMinus == false) {
for (var i = 0; i < this.temporaryList.length; i++) {
if (this.evalue.length == 0) {
- this.temporaryList[i].productCount = Number(this.allChangeNum)
- if(this.temporaryList[i].productCount < 0 && this.khName.name!='散客'){
- this.checkCanReturn(this.goodsDetail.productSn,this.goodsDetail.id,this.temporaryList[i].attributeList,this.khName.id,this.temporaryList[i].productCount)
+ if(Number(this.allChangeNum) > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){
+ this.tui.toast(this.temporaryList[i].name + "已超出可售数量",300)
+ }else{
+ this.temporaryList[i].productCount = Number(this.allChangeNum)
+ if(this.temporaryList[i].productCount < 0 && this.khName.name!='散客'){
+ this.checkCanReturn(this.goodsDetail.productSn,this.goodsDetail.id,this.temporaryList[i].attributeList,this.khName.id,this.temporaryList[i].productCount)
+ }
}
} else {
for (var j = 0; j < this.evalue.length; j++) {
if (this.evalue[j] == this.temporaryList[i].name) {
- this.temporaryList[i].productCount = Number(this.allChangeNum)
- if(this.temporaryList[i].productCount < 0 && this.khName.name!='散客'){
- this.checkCanReturn(this.goodsDetail.productSn,this.goodsDetail.id,this.temporaryList[i].attributeList,this.khName.id,this.temporaryList[i].productCount)
+ if(Number(this.allChangeNum) > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){
+ this.tui.toast(this.temporaryList[i].name + "已超出可售数量",300)
+ }else{
+ this.temporaryList[i].productCount = Number(this.allChangeNum)
+ if(this.temporaryList[i].productCount < 0 && this.khName.name!='散客'){
+ this.checkCanReturn(this.goodsDetail.productSn,this.goodsDetail.id,this.temporaryList[i].attributeList,this.khName.id,this.temporaryList[i].productCount)
+ }
}
}
}
@@ -3184,7 +3192,11 @@
if (this.temporaryList[i].productCount == undefined) {
this.temporaryList[i].productCount = 1
} else {
- this.temporaryList[i].productCount++
+ if(this.temporaryList[i].productCount + 1 > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){
+ this.tui.toast(this.temporaryList[i].name + "已超出可售数量",300)
+ }else{
+ this.temporaryList[i].productCount++
+ }
}
} else {
for (var j = 0; j < this.evalue.length; j++) {
@@ -3192,7 +3204,11 @@
if (this.temporaryList[i].productCount == undefined) {
this.temporaryList[i].productCount = 1
} else {
- this.temporaryList[i].productCount++
+ if(this.temporaryList[i].productCount + 1 > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){
+ this.tui.toast(this.temporaryList[i].name + "已超出可售数量",300)
+ }else{
+ this.temporaryList[i].productCount++
+ }
}
}
}
@@ -3609,8 +3625,17 @@
value1 += '"' + '颜色' + '":"' + data[i].value + '",'
value1 += '"' + '尺码' + '":"' + dataJ[j].value + '"'
value1 += "}"
- value.push(value1)
- this.evalue.push(name)
+ if(this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400'){
+ for(let a = 0;a 0)){
+ value.push(value1)
+ this.evalue.push(name)
+ }
+ }
+ }else{
+ value.push(value1)
+ this.evalue.push(name)
+ }
}
}
}
@@ -3755,17 +3780,21 @@
}
},
numChange(e, index) {
- this.temporaryList[index].productCount = Number(e)
- if(this.temporaryList[index].productCount < 0 && this.khName.name!='散客'){
- this.checkCanReturn(this.goodsDetail.productSn,this.goodsDetail.id,this.temporaryList[index].attributeList,this.khName.id,this.temporaryList[index].productCount)
- }
- setTimeout(res => {
- if(this.checkCanBuy.length > 0){
- this.seeCustomCategory()
+ if(Number(e) > this.temporaryList[index].productCount && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){
+ this.tui.toast("已超出可售数量",300)
+ }else{
+ this.temporaryList[index].productCount = Number(e)
+ if(this.temporaryList[index].productCount < 0 && this.khName.name!='散客'){
+ this.checkCanReturn(this.goodsDetail.productSn,this.goodsDetail.id,this.temporaryList[index].attributeList,this.khName.id,this.temporaryList[index].productCount)
}
- }, 500)
- this.$forceUpdate()
- this.temporaryChange()
+ setTimeout(res => {
+ if(this.checkCanBuy.length > 0){
+ this.seeCustomCategory()
+ }
+ }, 500)
+ this.$forceUpdate()
+ this.temporaryChange()
+ }
},
numReturnChange(e, index) {
if(e > 0){
@@ -3787,40 +3816,44 @@
},
mapnumChange(e, id, id1) {
let that = this;
- this.carList.get(id).productCount = 0
- this.carList.get(id).returnCount = 0
-
- this.carList.get(id).stockLogList.get(id1).productCount = Number(e)
- if(this.carList.get(id).stockLogList.get(id1).productCount < 0 && this.khName.name!='散客'){
- this.checkCanReturn(this.carList.get(id).productSn,this.carList.get(id).productId,id1,this.khName.id,this.carList.get(id).stockLogList.get(id1).productCount)
- }
- setTimeout(res => {
- if(this.checkCanBuy.length > 0){
- this.seeCustomCategory()
+ if(!this.carList.get(id).isNew && e > this.carList.get(id).stockLogList.get(id1).productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){
+ this.tui.toast("已超出可售数量",300)
+ }else{
+ this.carList.get(id).productCount = 0
+ this.carList.get(id).returnCount = 0
+
+ this.carList.get(id).stockLogList.get(id1).productCount = Number(e)
+ if(this.carList.get(id).stockLogList.get(id1).productCount < 0 && this.khName.name!='散客'){
+ this.checkCanReturn(this.carList.get(id).productSn,this.carList.get(id).productId,id1,this.khName.id,this.carList.get(id).stockLogList.get(id1).productCount)
}
- }, 500)
- this.carList.get(id).stockLogList.forEach(function(value, key) {
- if (value.productCount < 0) {
+ setTimeout(res => {
+ if(this.checkCanBuy.length > 0){
+ this.seeCustomCategory()
+ }
+ }, 500)
+ this.carList.get(id).stockLogList.forEach(function(value, key) {
+ if (value.productCount < 0) {
+ that.carList.get(id).returnCount = that.carList.get(id).returnCount + Math.abs(value
+ .productCount)
+ } else {
+ that.carList.get(id).productCount = Number(that.carList.get(id).productCount) + Number(value.productCount)
+ }
+ })
+ this.carList.get(id).returnList.forEach(function(value, key) {
that.carList.get(id).returnCount = that.carList.get(id).returnCount + Math.abs(value
.productCount)
- } else {
- that.carList.get(id).productCount = Number(that.carList.get(id).productCount) + Number(value.productCount)
- }
- })
- this.carList.get(id).returnList.forEach(function(value, key) {
- that.carList.get(id).returnCount = that.carList.get(id).returnCount + Math.abs(value
- .productCount)
- })
- this.$nextTick(() => {
- // if (that.discountType != 0) { //单品折扣
- that.carList.get(id).price = Number(that.carList.get(id).productCount) * that.carList
- .get(id).discountAmount
- that.carList.get(id).price = that.carList.get(id).price.toFixed(2)
- // }
- })
- this.$nextTick(() => {
- this.getAllPrice()
- })
+ })
+ this.$nextTick(() => {
+ // if (that.discountType != 0) { //单品折扣
+ that.carList.get(id).price = Number(that.carList.get(id).productCount) * that.carList
+ .get(id).discountAmount
+ that.carList.get(id).price = that.carList.get(id).price.toFixed(2)
+ // }
+ })
+ this.$nextTick(() => {
+ this.getAllPrice()
+ })
+ }
},
mapnumReturnChange(e, id, id1) {
let that = this;
@@ -3853,8 +3886,12 @@
this.temporaryChange()
},
mapPlusNum(index) {
- this.temporaryList[index].productCount++
- this.temporaryChange()
+ if(this.temporaryList[index].productCount + 1 > this.temporaryList[index].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){
+ this.tui.toast("已超出可售数量",300)
+ }else{
+ this.temporaryList[index].productCount++
+ this.temporaryChange()
+ }
},
mapMinusReturnNum(index) {
this.temporaryReturnList[index].productCount--
@@ -3945,32 +3982,37 @@
},
onePlusNum(index, index1) {
let that = this;
- this.carList.get(index).productCount = 0
- this.carList.get(index).returnCount = 0
- this.carList.get(index).stockLogList.get(index1).productCount++
- this.carList.get(index).stockLogList.forEach(function(value, key) {
- if (value.productCount < 0) {
+ if(!this.carList.get(index).isNew && this.carList.get(index).stockLogList.get(index1).productCount + 1 > this.carList.get(index).stockLogList.get(index1).productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){
+ this.tui.toast("已超出可售数量")
+ }else{
+ this.carList.get(index).stockLogList.get(index1).productCount++
+ this.carList.get(index).productCount = 0
+ this.carList.get(index).returnCount = 0
+
+ this.carList.get(index).stockLogList.forEach(function(value, key) {
+ if (value.productCount < 0) {
+ that.carList.get(index).returnCount = that.carList.get(index).returnCount + Math.abs(value
+ .productCount)
+ } else {
+ that.carList.get(index).productCount = Number(that.carList.get(index).productCount) + Number(value
+ .productCount)
+ }
+ })
+ this.carList.get(index).returnList.forEach(function(value, key) {
that.carList.get(index).returnCount = that.carList.get(index).returnCount + Math.abs(value
.productCount)
- } else {
- that.carList.get(index).productCount = Number(that.carList.get(index).productCount) + Number(value
- .productCount)
- }
- })
- this.carList.get(index).returnList.forEach(function(value, key) {
- that.carList.get(index).returnCount = that.carList.get(index).returnCount + Math.abs(value
- .productCount)
- })
- this.$nextTick(() => {
- // if (that.discountType != 0) { //单品折扣
- that.carList.get(index).price = Number(that.carList.get(index).productCount) * that.carList
- .get(index).discountAmount
- that.carList.get(index).price = that.carList.get(index).price.toFixed(2)
- // }
- })
- this.$nextTick(() => {
- this.getAllPrice()
- })
+ })
+ this.$nextTick(() => {
+ // if (that.discountType != 0) { //单品折扣
+ that.carList.get(index).price = Number(that.carList.get(index).productCount) * that.carList
+ .get(index).discountAmount
+ that.carList.get(index).price = that.carList.get(index).price.toFixed(2)
+ // }
+ })
+ this.$nextTick(() => {
+ this.getAllPrice()
+ })
+ }
},
async oneMinusReturnNum(index, index1) {
let that = this;
@@ -4783,6 +4825,16 @@
voiceData.wholesalePrice = voiceData.wholesalePrice1.replace(/[^0-9.]/g, "");
}
if(this.voiceGetOneData == true){
+ let oldProduCount = 1
+ if(this.carList.get(this.oneGoodsId).productCount == 1 && this.carList.get(this.oneGoodsId).stockLogList.size == 1 && this.carList.get(this.oneGoodsId).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 1){
+ this.carList.get(this.oneGoodsId).productCount = 0
+ this.carList.get(this.oneGoodsId).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount = 0
+ }else{
+ if(voiceData.productCount == undefined){
+ oldProduCount = 0
+ }
+ }
+
this.tui.request('/app/product/getShareList', "post", {
customerId:this.khName.id,
categoryId: "",
@@ -4806,7 +4858,7 @@
}
let data = {
attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: voiceData.productCount != undefined ? Number(voiceData.productCount[0]):1,
+ productCount: voiceData.productCount != undefined ? Number(voiceData.productCount[0]):oldProduCount,
stockCount: res.result.records[i].defaultStockCount
}
@@ -4824,7 +4876,7 @@
this.$refs.popup.close();
let data = {
attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: voiceData.productCount != undefined ? Number(voiceData.productCount[0]):1,
+ productCount: voiceData.productCount != undefined ? Number(voiceData.productCount[0]):oldProduCount,
stockCount: res.result.records[0].defaultStockCount
}
@@ -5230,10 +5282,10 @@
purchaseDetails[0]
.wholesalePrice
}
- this.carList.get(id).returnCount =
+ /* this.carList.get(id).returnCount =
0
this.carList.get(id).productCount =
- 0
+ 0 */
if (purchaseDetails[0].productId) {
this.carList.get(id).attrId =
purchaseDetails[0].attrId
@@ -5562,7 +5614,7 @@
wholesalePrice: voiceData.wholesalePrice || 0,
stockLogList1: [{
attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: Number(voiceData.productCount) || 1,
+ productCount: Number(voiceData.productCount) || oldProduCount,
stockCount: null
}]
}
@@ -5730,15 +5782,28 @@
this.carList.get(id).lsprice = purchaseDetails[0].lsprice
}
- this.carList.get(id).wholesalePrice = purchaseDetails[0]
- .wholesalePrice
- this.carList.get(id).discountAmount = purchaseDetails[0]
- .wholesalePrice
- this.carList.get(id).unitPrice = purchaseDetails[0]
- .wholesalePrice
- this.carList.get(id).lsprice = purchaseDetails[0].price
- this.carList.get(id).price = purchaseDetails[0]
- .wholesalePrice * Number(purchaseDetails[0].productCount)
+ if (that.carList.get(id).wholesalePrice == '' || that.carList
+ .get(id).wholesalePrice == null) {
+ if(that.carList.get(id).discountAmount == '' || that.carList
+ .get(id).discountAmount == null){
+ that.carList.get(id).wholesalePrice = purchaseDetails[0]
+ .wholesalePrice
+ that.carList.get(id).unitPrice = purchaseDetails[0]
+ .wholesalePrice
+ }else{
+ that.carList.get(id).wholesalePrice = that.carList.get(id).discountAmount
+ that.carList.get(id).unitPrice = that.carList.get(id).discountAmount
+ }
+
+ }
+ if (that.carList.get(id).discountAmount == '' || that.carList
+ .get(id).discountAmount == null) {
+ that.carList.get(id).discountAmount = purchaseDetails[0]
+ .wholesalePrice
+ }
+
+ that.carList.get(id).lsprice = purchaseDetails[0].price
+ that.carList.get(id).price = (that.carList.get(id).discountAmount * Number(purchaseDetails[0].productCount)).toFixed(2)
let specMap = new Map() //新的临时存放值那个更改过的值的map
this.$nextTick(() => {
this.carList.forEach(function(value, key) {
@@ -5793,7 +5858,7 @@
}
this.carList.get(id).price = Number(this.carList.get(id)
.productCount) * this.carList.get(id)
- .wholesalePrice
+ .discountAmount
if (this.carList.get(id).stockLogList.get(
'{"颜色":"均色","尺码":"均码"}').productCount ==
0 && this.carList.get(
@@ -5826,6 +5891,15 @@
}
})
}else{
+ let oldProduCount = 1
+ if(this.carList.get(this.oneGoodsId).productCount == 1 && this.carList.get(this.oneGoodsId).stockLogList.size == 1 && this.carList.get(this.oneGoodsId).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 1){
+ this.carList.get(this.oneGoodsId).productCount = 0
+ this.carList.get(this.oneGoodsId).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount = 0
+ }else{
+ if(voiceData.productCount == undefined){
+ oldProduCount = 0
+ }
+ }
this.tui.request('/app/product/getByProductSn', "post", {
customerId:this.khName.id,
productSn: voiceData.productSn
@@ -5843,7 +5917,7 @@
if (res1.code == 200) {
let data = {
attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: Number(voiceData.productCount) || 1,
+ productCount: Number(voiceData.productCount) || oldProduCount,
stockCount: null
}
@@ -5855,7 +5929,7 @@
data = {
attributeList: '{"颜色":"均色","尺码":"均码"}',
productCount: Number(voiceData
- .productCount) || 1,
+ .productCount) || oldProduCount,
stockCount: res1.result.stock[i]
.stockCount
}
@@ -6267,10 +6341,10 @@
purchaseDetails[0]
.wholesalePrice
}
- this.carList.get(id).returnCount =
+ /* this.carList.get(id).returnCount =
0
this.carList.get(id).productCount =
- 0
+ 0 */
if (purchaseDetails[0].productId) {
this.carList.get(id).attrId =
purchaseDetails[0].attrId
@@ -6601,7 +6675,7 @@
wholesalePrice: voiceData.wholesalePrice || 0,
stockLogList1: [{
attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: Number(voiceData.productCount) || 1,
+ productCount: Number(voiceData.productCount) || oldProduCount,
stockCount: null
}]
}
@@ -6637,10 +6711,18 @@
purchaseDetails[0].productPicture
}
if (this.carList.get(id).wholesalePrice == '') {
- this.carList.get(id).wholesalePrice =
- purchaseDetails[0].wholesalePrice
- this.carList.get(id).unitPrice =
- purchaseDetails[0].wholesalePrice
+ if(this.carList.get(id).discountAmount == ''){
+ this.carList.get(id).wholesalePrice =
+ purchaseDetails[0].wholesalePrice
+ this.carList.get(id).unitPrice =
+ purchaseDetails[0].wholesalePrice
+ }else{
+ this.carList.get(id).wholesalePrice =
+ this.carList.get(id).discountAmount
+ this.carList.get(id).unitPrice =
+ this.carList.get(id).discountAmount
+ }
+
}
if (this.carList.get(id).productCount == '') {
this.carList.get(id).productCount =
@@ -6697,7 +6779,7 @@
'{"颜色":"均色","尺码":"均码"}')
}
this.carList.get(id).price = Number(this.carList.get(id)
- .productCount) * this.carList.get(id).wholesalePrice
+ .productCount) * this.carList.get(id).discountAmount
} else {
let isTrue = false
@@ -6769,15 +6851,24 @@
this.carList.get(id).lsprice = purchaseDetails[0].lsprice
}
- this.carList.get(id).wholesalePrice = purchaseDetails[0]
- .wholesalePrice
- this.carList.get(id).discountAmount = purchaseDetails[0]
- .wholesalePrice
- this.carList.get(id).unitPrice = purchaseDetails[0]
- .wholesalePrice
- this.carList.get(id).lsprice = purchaseDetails[0].price
- this.carList.get(id).price = purchaseDetails[0]
- .wholesalePrice * Number(purchaseDetails[0].productCount)
+ if (this.carList.get(id).wholesalePrice == '') {
+ if(this.carList.get(id).discountAmount == ''){
+ this.carList.get(id).wholesalePrice = purchaseDetails[0]
+ .wholesalePrice
+ }else{
+ this.carList.get(id).wholesalePrice = this.carList.get(id).discountAmount
+ }
+ }
+ if (this.carList.get(id).discountAmount == '') {
+ this.carList.get(id).discountAmount = purchaseDetails[0]
+ .wholesalePrice
+ this.carList.get(id).unitPrice = purchaseDetails[0]
+ .wholesalePrice
+ }
+ if (this.carList.get(id).lsprice == '') {
+ this.carList.get(id).lsprice = purchaseDetails[0].price
+ }
+ this.carList.get(id).price = (this.carList.get(id).discountAmount * Number(purchaseDetails[0].productCount)).toFixed(2)
let specMap = new Map() //新的临时存放值那个更改过的值的map
this.$nextTick(() => {
this.carList.forEach(function(value, key) {
@@ -6832,7 +6923,7 @@
}
this.carList.get(id).price = Number(this.carList.get(id)
.productCount) * this.carList.get(id)
- .wholesalePrice
+ .discountAmount
if (this.carList.get(id).stockLogList.get(
'{"颜色":"均色","尺码":"均码"}').productCount ==
0 && this.carList.get(
@@ -9786,7 +9877,7 @@
})
if(value.stockLogList1.length == 1){
- if(value.stockLogList1[0].attributeList == '{"颜色":"均色","尺码":"均码"}'){
+ if(value.stockLogList1[0].attributeList == '{"颜色":"均色","尺码":"均码"}' && value.stockLogList1[0].productCount == 1){
value.stockLogList1[0].productCount = 0
}
}
@@ -10049,7 +10140,7 @@
that.colorData = []
if(that.carList.get(id)){
if(that.carList.get(id).stockLogList1.length == 1){
- if(that.carList.get(id).stockLogList1[0].attributeList == '{"颜色":"均色","尺码":"均码"}'){
+ if(that.carList.get(id).stockLogList1[0].attributeList == '{"颜色":"均色","尺码":"均码"}' && that.carList.get(id).stockLogList1[0].productCount == 1){
that.carList.get(id).stockLogList1[0].productCount = 0
}
}
@@ -11535,7 +11626,7 @@
alreadyEarn: this.priceOk, //已付金额
realAmount: this.relPrice, //实收金额
noEarn: this.relPrice - this.priceOk, //欠款
- totalAmount: ZreturnCount, //总金额
+ totalAmount: (this.returnPay!='' && this.returnPay != ZreturnCount) ? this.returnPay : ZreturnCount, //总金额
debtDeductionAmount: this.qiankuandikou,
saleDeductionAmount: this.xiaoshoudikou,
balanceDeductionAmount: this.yuedikou,
@@ -11839,128 +11930,312 @@
},
//计算总金额和总数量
getAllPrice(price, type) {
- if (type == 'tanyue') {
- this.tanyue = !this.tanyue
- } else if (type == 'tanxiaoshou') {
- this.tanxiaoshou = !this.tanxiaoshou
- }
- let that = this;
- this.totalAmount = 0
- that.returnTotalAmount = 0
-
- that.qiankuandikou = 0
- that.xiaoshoudikou = 0
- that.leijiqiankuan = 0
- that.yuedikou = 0
- if(!price){
- that.returnPay = 0
+ let that = this
+ let productIds = ''
+ this.carList.forEach(function(value, key) {
+ productIds += key + ','
+ })
+ if(this.oldCustomId != this.khName.id && this.khName.name != '散客'){
+ this.tui.request("/app/sale/buyCount", "POST", {
+ customerId: this.khName.id,
+ productIds: productIds
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ if(res.result.length == 0){
+ this.carList.forEach(function(value, key) {
+ value.buyCount = ''
+ })
+ }else{
+ this.carList.forEach(function(value, key) {
+ let hasProduct = false
+ for(let i = 0; i < res.result.length;i++){
+ if(key == res.result[i].productId){
+ that.carList.get(res.result[i].productId).buyCount = res.result[i].buyCount
+ hasProduct = true
+ }
+ }
+ if(hasProduct == false){
+ value.buyCount = ''
+ }
+ })
+ }
+ this.$forceUpdate()
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
}
- if (!price) {
- this.shouldPay = 0
+ if((this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056') && this.khName.name != '散客'){
+
+ this.tui.request("/app/product/getByUserIdAndProductIds", "POST", {
+ userId: this.khName.id,
+ productIds: productIds
+ }, false, true).then((res1) => {
+ if (res1.code == 200) {
+ if(res1.result != null && res1.result.length > 0){
+ for(let i = 0; i < res1.result.length;i++){
+ if(!this.carList.get(res1.result[i].productId).isChangePrice){
+ this.carList.get(res1.result[i].productId).discountAmount = res1.result[i].discountAmount
+ this.carList.get(res1.result[i].productId).price = Number(res1.result[i].discountAmount * this.carList.get(res1.result[i].productId).productCount).toFixed(2)
+ }
+ if(!this.carList.get(res1.result[i].productId).isChangeReturnPrice){
+ this.carList.get(res1.result[i].productId).returnPrice = res1.result[i].discountAmount
+ }
+ }
+ this.$nextTick(() => {
+ if (type == 'tanyue') {
+ this.tanyue = !this.tanyue
+ } else if (type == 'tanxiaoshou') {
+ this.tanxiaoshou = !this.tanxiaoshou
+ }
+ this.totalAmount = 0
+ that.returnTotalAmount = 0
+
+ that.qiankuandikou = 0
+ that.xiaoshoudikou = 0
+ that.leijiqiankuan = 0
+ that.yuedikou = 0
+ if(!price){
+ that.returnPay = 0
+ }
+ if (!price) {
+ this.shouldPay = 0
+ }
+ this.carList.forEach(function(value, key) {
+ if (!price) {
+ that.shouldPay = Number(that.shouldPay) + Number(value.price)
+ }
+ if (!price) {
+ that.returnPay = Number(that.returnPay) + (Number(value.returnPrice) * Math.abs(Number(value
+ .returnCount)))
+ }
+
+
+ if (!price) {
+ if (value.productCount > 0) {
+ that.totalAmount = Number(that.totalAmount) + Number(value.productCount)
+ }
+ }
+ that.returnTotalAmount = Number(that.returnTotalAmount) + Number(value.returnCount)
+ })
+ if (!price) {
+ that.shouldPay = that.shouldPay.toFixed(2)
+ }
+ if (!price) {
+ that.returnPay = that.returnPay.toFixed(2)
+ }
+
+ /**
+ * that.shouldPay 销售金额
+ * that.returnPay 退货金额
+ * that.zhiqianqiankuan 之前欠款
+ * that.qiankuandikou 欠款抵扣
+ * that.xiaoshoudikou 销售抵扣
+ * that.yuedikou 余额抵扣
+ * that.leijiqiankuan 累计欠款
+ * that.relPrice 实收金额
+ * that.priceOk 已收金额
+ */
+ this.$nextTick(() => {
+ if (that.tanyue && that.tanxiaoshou) {
+ if (that.zhiqianqiankuan > 0) {
+ if (parseFloat(that.returnPay) == 0) {
+ that.relPrice = that.shouldPay
+ that.qiankuandikou = 0
+ that.xiaoshoudikou = 0
+ } else {
+ if (parseFloat(that.returnPay) >= parseFloat(that.zhiqianqiankuan)) {
+ that.qiankuandikou = that.zhiqianqiankuan
+ if (parseFloat(that.shouldPay) > parseFloat(that.returnPay) - that
+ .zhiqianqiankuan) {
+ that.xiaoshoudikou = that.returnPay - that.zhiqianqiankuan
+ } else if (that.shouldPay <= that.returnPay - that.zhiqianqiankuan) {
+ that.xiaoshoudikou = that.shouldPay
+ }
+ that.relPrice = that.shouldPay - (that.returnPay - that.zhiqianqiankuan)
+ } else if (parseFloat(that.returnPay) < parseFloat(that.zhiqianqiankuan)) {
+ that.qiankuandikou = that.returnPay
+ that.relPrice = that.shouldPay
+ that.xiaoshoudikou = 0
+
+ }
+ }
+ } else if (parseFloat(that.zhiqianqiankuan) < 0) {
+ if (that.shouldPay > Math.abs(that.zhiqianqiankuan)) {
+ that.yuedikou = Math.abs(that.zhiqianqiankuan)
+ this.relPrice = this.shouldPay - Math.abs(that.zhiqianqiankuan)
+ } else if (that.shouldPay <= Math.abs(that.zhiqianqiankuan)) {
+ that.yuedikou = that.shouldPay
+ this.relPrice = 0
+ }
+ if (that.returnPay != 0) {
+ this.relPrice = this.relPrice - that.returnPay
+ }
+ } else if (parseFloat(that.zhiqianqiankuan) == 0) {
+ if (parseFloat(that.returnPay) > 0) {
+ this.relPrice = that.shouldPay - that.returnPay
+ if (parseFloat(that.returnPay) >= parseFloat(that.zhiqianqiankuan)) {
+ that.qiankuandikou = that.zhiqianqiankuan
+ if (parseFloat(that.shouldPay) > parseFloat(that.returnPay) - that
+ .zhiqianqiankuan) {
+ that.xiaoshoudikou = that.returnPay - that.zhiqianqiankuan
+ } else if (that.shouldPay <= that.returnPay - that.zhiqianqiankuan) {
+ that.xiaoshoudikou = that.shouldPay
+ }
+ this.relPrice = that.shouldPay - (that.returnPay - that.zhiqianqiankuan)
+ } else if (parseFloat(that.returnPay) < parseFloat(that.zhiqianqiankuan)) {
+ that.qiankuandikou = that.returnPay
+ this.relPrice = this.shouldPay
+ that.xiaoshoudikou = 0
+
+ }
+ } else if (parseFloat(that.returnPay) == 0) {
+ this.relPrice = that.shouldPay
+ that.qiankuandikou = 0
+ that.xiaoshoudikou = 0
+ }
+ }
+ }
+
+ this.priceOk = this.checkRealPay(this.relPrice)
+ that.noPay = this.relPrice - (this.priceOk == '' ? 0 : this.priceOk)
+ that.noPay = that.noPay.toFixed(2)
+ this.leijiqiankuan = Number(this.zhiqianqiankuan) - Number(this.qiankuandikou) + Number(this
+ .yuedikou) + Number(this.noPay)
+ this.$forceUpdate()
+ })
+ })
+ this.$forceUpdate()
+ }
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
}
- this.carList.forEach(function(value, key) {
+ this.$nextTick(() => {
+ if (type == 'tanyue') {
+ this.tanyue = !this.tanyue
+ } else if (type == 'tanxiaoshou') {
+ this.tanxiaoshou = !this.tanxiaoshou
+ }
+ this.totalAmount = 0
+ that.returnTotalAmount = 0
+
+ that.qiankuandikou = 0
+ that.xiaoshoudikou = 0
+ that.leijiqiankuan = 0
+ that.yuedikou = 0
+ if(!price){
+ that.returnPay = 0
+ }
if (!price) {
- that.shouldPay = Number(that.shouldPay) + Number(value.price)
+ this.shouldPay = 0
}
+ this.carList.forEach(function(value, key) {
+ if (!price) {
+ that.shouldPay = Number(that.shouldPay) + Number(value.price)
+ }
+ if (!price) {
+ that.returnPay = Number(that.returnPay) + (Number(value.returnPrice) * Math.abs(Number(value
+ .returnCount)))
+ }
+
+
+ if (!price) {
+ if (value.productCount > 0) {
+ that.totalAmount = Number(that.totalAmount) + Number(value.productCount)
+ }
+ }
+ that.returnTotalAmount = Number(that.returnTotalAmount) + Number(value.returnCount)
+ })
if (!price) {
- that.returnPay = Number(that.returnPay) + (Number(value.returnPrice) * Math.abs(Number(value
- .returnCount)))
+ that.shouldPay = that.shouldPay.toFixed(2)
}
-
-
if (!price) {
- if (value.productCount > 0) {
- that.totalAmount = Number(that.totalAmount) + Number(value.productCount)
- }
+ that.returnPay = that.returnPay.toFixed(2)
}
- that.returnTotalAmount = Number(that.returnTotalAmount) + Number(value.returnCount)
- })
- if (!price) {
- that.shouldPay = that.shouldPay.toFixed(2)
- }
- if (!price) {
- that.returnPay = that.returnPay.toFixed(2)
- }
-
- /**
- * that.shouldPay 销售金额
- * that.returnPay 退货金额
- * that.zhiqianqiankuan 之前欠款
- * that.qiankuandikou 欠款抵扣
- * that.xiaoshoudikou 销售抵扣
- * that.yuedikou 余额抵扣
- * that.leijiqiankuan 累计欠款
- * that.relPrice 实收金额
- * that.priceOk 已收金额
- */
- this.$nextTick(() => {
- if (that.tanyue && that.tanxiaoshou) {
- if (that.zhiqianqiankuan > 0) {
- if (parseFloat(that.returnPay) == 0) {
- that.relPrice = that.shouldPay
- that.qiankuandikou = 0
- that.xiaoshoudikou = 0
- } else {
- if (parseFloat(that.returnPay) >= parseFloat(that.zhiqianqiankuan)) {
- that.qiankuandikou = that.zhiqianqiankuan
- if (parseFloat(that.shouldPay) > parseFloat(that.returnPay) - that
- .zhiqianqiankuan) {
- that.xiaoshoudikou = that.returnPay - that.zhiqianqiankuan
- } else if (that.shouldPay <= that.returnPay - that.zhiqianqiankuan) {
- that.xiaoshoudikou = that.shouldPay
- }
- that.relPrice = that.shouldPay - (that.returnPay - that.zhiqianqiankuan)
- } else if (parseFloat(that.returnPay) < parseFloat(that.zhiqianqiankuan)) {
- that.qiankuandikou = that.returnPay
+
+ /**
+ * that.shouldPay 销售金额
+ * that.returnPay 退货金额
+ * that.zhiqianqiankuan 之前欠款
+ * that.qiankuandikou 欠款抵扣
+ * that.xiaoshoudikou 销售抵扣
+ * that.yuedikou 余额抵扣
+ * that.leijiqiankuan 累计欠款
+ * that.relPrice 实收金额
+ * that.priceOk 已收金额
+ */
+ this.$nextTick(() => {
+ if (that.tanyue && that.tanxiaoshou) {
+ if (that.zhiqianqiankuan > 0) {
+ if (parseFloat(that.returnPay) == 0) {
that.relPrice = that.shouldPay
+ that.qiankuandikou = 0
that.xiaoshoudikou = 0
-
+ } else {
+ if (parseFloat(that.returnPay) >= parseFloat(that.zhiqianqiankuan)) {
+ that.qiankuandikou = that.zhiqianqiankuan
+ if (parseFloat(that.shouldPay) > parseFloat(that.returnPay) - that
+ .zhiqianqiankuan) {
+ that.xiaoshoudikou = that.returnPay - that.zhiqianqiankuan
+ } else if (that.shouldPay <= that.returnPay - that.zhiqianqiankuan) {
+ that.xiaoshoudikou = that.shouldPay
+ }
+ that.relPrice = that.shouldPay - (that.returnPay - that.zhiqianqiankuan)
+ } else if (parseFloat(that.returnPay) < parseFloat(that.zhiqianqiankuan)) {
+ that.qiankuandikou = that.returnPay
+ that.relPrice = that.shouldPay
+ that.xiaoshoudikou = 0
+
+ }
}
- }
- } else if (parseFloat(that.zhiqianqiankuan) < 0) {
- if (that.shouldPay > Math.abs(that.zhiqianqiankuan)) {
- that.yuedikou = Math.abs(that.zhiqianqiankuan)
- this.relPrice = this.shouldPay - Math.abs(that.zhiqianqiankuan)
- } else if (that.shouldPay <= Math.abs(that.zhiqianqiankuan)) {
- that.yuedikou = that.shouldPay
- this.relPrice = 0
- }
- if (that.returnPay != 0) {
- this.relPrice = this.relPrice - that.returnPay
- }
- } else if (parseFloat(that.zhiqianqiankuan) == 0) {
- if (parseFloat(that.returnPay) > 0) {
- this.relPrice = that.shouldPay - that.returnPay
- if (parseFloat(that.returnPay) >= parseFloat(that.zhiqianqiankuan)) {
- that.qiankuandikou = that.zhiqianqiankuan
- if (parseFloat(that.shouldPay) > parseFloat(that.returnPay) - that
- .zhiqianqiankuan) {
- that.xiaoshoudikou = that.returnPay - that.zhiqianqiankuan
- } else if (that.shouldPay <= that.returnPay - that.zhiqianqiankuan) {
- that.xiaoshoudikou = that.shouldPay
+ } else if (parseFloat(that.zhiqianqiankuan) < 0) {
+ if (that.shouldPay > Math.abs(that.zhiqianqiankuan)) {
+ that.yuedikou = Math.abs(that.zhiqianqiankuan)
+ this.relPrice = this.shouldPay - Math.abs(that.zhiqianqiankuan)
+ } else if (that.shouldPay <= Math.abs(that.zhiqianqiankuan)) {
+ that.yuedikou = that.shouldPay
+ this.relPrice = 0
+ }
+ if (that.returnPay != 0) {
+ this.relPrice = this.relPrice - that.returnPay
+ }
+ } else if (parseFloat(that.zhiqianqiankuan) == 0) {
+ if (parseFloat(that.returnPay) > 0) {
+ this.relPrice = that.shouldPay - that.returnPay
+ if (parseFloat(that.returnPay) >= parseFloat(that.zhiqianqiankuan)) {
+ that.qiankuandikou = that.zhiqianqiankuan
+ if (parseFloat(that.shouldPay) > parseFloat(that.returnPay) - that
+ .zhiqianqiankuan) {
+ that.xiaoshoudikou = that.returnPay - that.zhiqianqiankuan
+ } else if (that.shouldPay <= that.returnPay - that.zhiqianqiankuan) {
+ that.xiaoshoudikou = that.shouldPay
+ }
+ this.relPrice = that.shouldPay - (that.returnPay - that.zhiqianqiankuan)
+ } else if (parseFloat(that.returnPay) < parseFloat(that.zhiqianqiankuan)) {
+ that.qiankuandikou = that.returnPay
+ this.relPrice = this.shouldPay
+ that.xiaoshoudikou = 0
+
}
- this.relPrice = that.shouldPay - (that.returnPay - that.zhiqianqiankuan)
- } else if (parseFloat(that.returnPay) < parseFloat(that.zhiqianqiankuan)) {
- that.qiankuandikou = that.returnPay
- this.relPrice = this.shouldPay
+ } else if (parseFloat(that.returnPay) == 0) {
+ this.relPrice = that.shouldPay
+ that.qiankuandikou = 0
that.xiaoshoudikou = 0
-
}
- } else if (parseFloat(that.returnPay) == 0) {
- this.relPrice = that.shouldPay
- that.qiankuandikou = 0
- that.xiaoshoudikou = 0
}
}
- }
-
- this.priceOk = this.checkRealPay(this.relPrice)
- that.noPay = this.relPrice - (this.priceOk == '' ? 0 : this.priceOk)
- that.noPay = that.noPay.toFixed(2)
- this.leijiqiankuan = Number(this.zhiqianqiankuan) - Number(this.qiankuandikou) + Number(this
- .yuedikou) + Number(this.noPay)
- this.$forceUpdate()
+
+ this.priceOk = this.checkRealPay(this.relPrice)
+ that.noPay = this.relPrice - (this.priceOk == '' ? 0 : this.priceOk)
+ that.noPay = that.noPay.toFixed(2)
+ this.leijiqiankuan = Number(this.zhiqianqiankuan) - Number(this.qiankuandikou) + Number(this
+ .yuedikou) + Number(this.noPay)
+ this.$forceUpdate()
+ })
})
+
},
noReturn() {
this.priceOk = 0
@@ -12119,7 +12394,7 @@