Browse Source

新增物流总件数和店铺开单bug

master
wangfukang 2 years ago
parent
commit
4f4ced97f2
  1. 146
      pages/inventory/goodsList1.vue
  2. 4
      pages/staff/staff.vue

146
pages/inventory/goodsList1.vue

@ -96,7 +96,7 @@
style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 318rpx;padding-left: 20rpx;"> style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 318rpx;padding-left: 20rpx;">
</view> </view>
<view style="display: flex;height: 55rpx;line-height: 55rpx;"> <view style="display: flex;height: 55rpx;line-height: 55rpx;">
货号:<input type="text" @input="sninput($event,value[0])" 货号:<input type="text" @focus="newProductId=''" @input="sninput($event,value[0])"
@blur="getSnIsRepeat($event,value[0])" v-model="value[1].productSn" @blur="getSnIsRepeat($event,value[0])" v-model="value[1].productSn"
style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 252rpx;padding-left: 20rpx;"> style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 252rpx;padding-left: 20rpx;">
<uni-icons type="refresh" color="#777" size='30' @tap="getOneId(value[0])"></uni-icons> <uni-icons type="refresh" color="#777" size='30' @tap="getOneId(value[0])"></uni-icons>
@ -1296,6 +1296,7 @@
return { return {
attrList: [], attrList: [],
zeroArr:[], zeroArr:[],
newProductId:'',
productPictures: [], productPictures: [],
oneData: {}, oneData: {},
moreData: [], moreData: [],
@ -1942,6 +1943,9 @@
this.mapnumReturnChange(Number(this.keyboardNum), this.keyboardIndex[0], this.keyboardIndex[1]) this.mapnumReturnChange(Number(this.keyboardNum), this.keyboardIndex[0], this.keyboardIndex[1])
} }
} else if (this.keyboard == 'danjia') { } else if (this.keyboard == 'danjia') {
if(this.newProductId !=''){
this.keyboardIndex = this.newProductId
}
this.clickCollapse(Number(this.keyboardNum), this.keyboardIndex) this.clickCollapse(Number(this.keyboardNum), this.keyboardIndex)
} else if (this.keyboard == 'priceOk') { } else if (this.keyboard == 'priceOk') {
this.changePrice(Number(this.keyboardNum)) this.changePrice(Number(this.keyboardNum))
@ -2218,11 +2222,13 @@
.saleDetailQueryDTO[m].stockCount .saleDetailQueryDTO[m].stockCount
} }
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
if (this.carList1[i].saleDetailQueryDTO[m].productCount < 0) { //退货数量 if (this.carList1[i].saleDetailQueryDTO[m].productCount < 0) { //退货数量
obj.returnCount += Math.abs(this.carList1[i].saleDetailQueryDTO[m].productCount) obj.returnCount += Math.abs(this.carList1[i].saleDetailQueryDTO[m].productCount)
obj.returnList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
} else { } else {
obj.productCount += Number(this.carList1[i].saleDetailQueryDTO[m].productCount) obj.productCount += Number(this.carList1[i].saleDetailQueryDTO[m].productCount)
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
} }
} }
@ -2251,25 +2257,41 @@
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) { for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
if (this.carList.get(this.carList1[i].id).stockLogList.has(this.carList1[i] if (this.carList.get(this.carList1[i].id).stockLogList.has(this.carList1[i]
.saleDetailQueryDTO[m].attributeList) == true) { //规格相同 .saleDetailQueryDTO[m].attributeList) == true) { //规格相同1
if(uni.getStorageSync('hangOrder')){
var data1 = { var data1 = {
productCount: Number(this.carList.get(this.carList1[i].id).stockLogList.get(this productCount: Number(this.carList1[i].saleDetailQueryDTO[m].productCount),
.carList1[i].saleDetailQueryDTO[m].attributeList).productCount) + name: this.carList1[i].saleDetailQueryDTO[m].name,
Number(this.carList1[i].saleDetailQueryDTO[m].productCount), productNum: this.carList1[i].saleDetailQueryDTO[m].productNum !=
name: this.carList1[i].saleDetailQueryDTO[m].name, undefined ? this.carList1[i].saleDetailQueryDTO[m].productNum : this
productNum: this.carList1[i].saleDetailQueryDTO[m].productNum != .carList1[i].saleDetailQueryDTO[m].stockCount
undefined ? this.carList1[i].saleDetailQueryDTO[m].productNum : this }
.carList1[i].saleDetailQueryDTO[m].stockCount
}else{
var data1 = {
productCount: Number(this.carList.get(this.carList1[i].id).stockLogList.get(this
.carList1[i].saleDetailQueryDTO[m].attributeList).productCount) +
Number(this.carList1[i].saleDetailQueryDTO[m].productCount),
name: this.carList1[i].saleDetailQueryDTO[m].name,
productNum: this.carList1[i].saleDetailQueryDTO[m].productNum !=
undefined ? this.carList1[i].saleDetailQueryDTO[m].productNum : this
.carList1[i].saleDetailQueryDTO[m].stockCount
}
} }
// if(data1.productCount >= 0){ // if(data1.productCount >= 0){
// this.carList.get(this.carList1[i].id).productCount += data1.productCount // this.carList.get(this.carList1[i].id).productCount += data1.productCount
// }else if(data1.productCount < 0){ // }else if(data1.productCount < 0){
// this.carList.get(this.carList1[i].id).returnCount += Math.abs(data1.productCount) // this.carList.get(this.carList1[i].id).returnCount += Math.abs(data1.productCount)
// } // }
if(data1.productCount >= 0){
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i]
.saleDetailQueryDTO[m].attributeList, data1)
}else if(data1.productCount < 0){
this.carList.get(this.carList1[i].id).returnList.set(this.carList1[i]
.saleDetailQueryDTO[m].attributeList, data1)
}
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i]
.saleDetailQueryDTO[m].attributeList, data1)
} else { //规格不同 } else { //规格不同
var data1 = { var data1 = {
@ -2284,9 +2306,14 @@
// }else if(data1.productCount < 0){ // }else if(data1.productCount < 0){
// this.carList.get(this.carList1[i].id).returnCount += Math.abs(data1.productCount) // this.carList.get(this.carList1[i].id).returnCount += Math.abs(data1.productCount)
// } // }
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i] if(data1.productCount >= 0){
.saleDetailQueryDTO[ this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i]
m].attributeList, data1) .saleDetailQueryDTO[m].attributeList, data1)
}else if(data1.productCount < 0){
this.carList.get(this.carList1[i].id).returnList.set(this.carList1[i]
.saleDetailQueryDTO[m].attributeList, data1)
}
} }
} }
this.carList.get(this.carList1[i].id).returnList.forEach(function(value, key) { this.carList.get(this.carList1[i].id).returnList.forEach(function(value, key) {
@ -2388,13 +2415,15 @@
this.carList1[i].saleDetailQueryDTO[m].productNum : this.carList1[i] this.carList1[i].saleDetailQueryDTO[m].productNum : this.carList1[i]
.saleDetailQueryDTO[m].stockCount .saleDetailQueryDTO[m].stockCount
} }
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.name = this.carList1[i].saleDetailQueryDTO[m].name obj.name = this.carList1[i].saleDetailQueryDTO[m].name
if (this.carList1[i].saleDetailQueryDTO[m].productCount < 0) { //退货数量 if (this.carList1[i].saleDetailQueryDTO[m].productCount < 0) { //退货数量
obj.returnCount += Math.abs(this.carList1[i].saleDetailQueryDTO[m].productCount) obj.returnCount += Math.abs(this.carList1[i].saleDetailQueryDTO[m].productCount)
obj.returnList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
} else { } else {
obj.productCount += Number(this.carList1[i].saleDetailQueryDTO[m].productCount) obj.productCount += Number(this.carList1[i].saleDetailQueryDTO[m].productCount)
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
} }
} }
this.carList.set(this.carList1[i].id, obj) this.carList.set(this.carList1[i].id, obj)
@ -3854,6 +3883,7 @@
} else if (type == 'danjia') { } else if (type == 'danjia') {
this.showPrice = true this.showPrice = true
this.keyboard = 'danjia' this.keyboard = 'danjia'
console.log('num',num)
this.keyboardIndex = num this.keyboardIndex = num
} else if (type == 'mapdanjishu') { } else if (type == 'mapdanjishu') {
this.showFu = true this.showFu = true
@ -3983,14 +4013,19 @@
} }
}, },
mapMinusReturnNum(index) { mapMinusReturnNum(index) {
uni.showLoading({
title: '加载中...',
mask:true
})
this.temporaryReturnList[index].productCount-- this.temporaryReturnList[index].productCount--
if(this.temporaryReturnList[index].productCount < 0 && this.khName.name!='散客'){ if(this.temporaryReturnList[index].productCount < 0 && this.khName.name!='散客'){
this.checkCanReturn(this.goodsReturnDetail.productSn,this.goodsReturnDetail.id,this.temporaryReturnList[index].attributeList,this.khName.id,this.temporaryReturnList[index].productCount) this.checkCanReturn(this.goodsReturnDetail.productSn,this.goodsReturnDetail.id,this.temporaryReturnList[index].attributeList,this.khName.id,this.temporaryReturnList[index].productCount)
} }
setTimeout(res => { setTimeout(res => {
if(this.checkCanBuy.length > 0){ if(this.checkCanBuy.length > 0){
this.seeCustomCategory() this.seeCustomCategory()
} }
uni.hideLoading()
}, 500) }, 500)
this.temporaryReturnChange() this.temporaryReturnChange()
}, },
@ -4024,8 +4059,11 @@
} }
this.checkCanBuy.push(obj) this.checkCanBuy.push(obj)
} }
uni.hideLoading()
} }
}).catch((res) => {}) }).catch((res) => {
uni.hideLoading()
})
}, },
async oneMinusNum(index, index1) { async oneMinusNum(index, index1) {
let that = this; let that = this;
@ -4288,6 +4326,9 @@
} }
let convertedStr = this.trimWhitespace(this.voiceText); let convertedStr = this.trimWhitespace(this.voiceText);
convertedStr = this.convertChineseToArabic(convertedStr); convertedStr = this.convertChineseToArabic(convertedStr);
if (convertedStr.indexOf('退') != -1 && convertedStr.indexOf('数量') == -1) {
convertedStr = convertedStr.replace(/退/g, '数量:-')
}
if(convertedStr.indexOf('数量') == -1 && convertedStr.indexOf('名称') == -1 &&convertedStr.indexOf('单价') == -1 &&convertedStr.indexOf('批发价') == -1){ if(convertedStr.indexOf('数量') == -1 && convertedStr.indexOf('名称') == -1 &&convertedStr.indexOf('单价') == -1 &&convertedStr.indexOf('批发价') == -1){
convertedStr = convertedStr + ',' convertedStr = convertedStr + ','
} }
@ -4795,6 +4836,9 @@
} }
let convertedStr = this.trimWhitespace(this.voiceText); let convertedStr = this.trimWhitespace(this.voiceText);
convertedStr = this.convertChineseToArabic(convertedStr); convertedStr = this.convertChineseToArabic(convertedStr);
if (convertedStr.indexOf('退') != -1 && convertedStr.indexOf('数量') == -1) {
convertedStr = convertedStr.replace(/退/g, '数量:-')
}
if(convertedStr.indexOf('数量') == -1 && convertedStr.indexOf('名称') == -1 &&convertedStr.indexOf('单价') == -1 &&convertedStr.indexOf('批发价') == -1){ if(convertedStr.indexOf('数量') == -1 && convertedStr.indexOf('名称') == -1 &&convertedStr.indexOf('单价') == -1 &&convertedStr.indexOf('批发价') == -1){
convertedStr = convertedStr + ',' convertedStr = convertedStr + ','
} }
@ -4885,11 +4929,10 @@
} }
this.getMsg = convertedStr this.getMsg = convertedStr
let regexCount = /-?\d+/g; let regexCount = /-?\d+/g;
if (convertedStr.indexOf('色') == -1 && convertedStr if (convertedStr.indexOf('色') == -1 && convertedStr.indexOf('码') == -1) {
.indexOf('码') == -1) { if (!convertedStr.startsWith("货号")) {
if (!convertedStr.startsWith("货号")) { convertedStr = "货号" + convertedStr;
convertedStr = "货号" + convertedStr; }
}
try { try {
const regex = /货号.*?(?=货号|$)/g; const regex = /货号.*?(?=货号|$)/g;
convertedStr = convertedStr.match(regex); convertedStr = convertedStr.match(regex);
@ -4901,6 +4944,7 @@
if (voiceData.productCount) { if (voiceData.productCount) {
voiceData.productCount = voiceData.productCount.match(regexCount); voiceData.productCount = voiceData.productCount.match(regexCount);
} }
console.log('负数',voiceData.productCount)
if (voiceData.wholesalePrice) { if (voiceData.wholesalePrice) {
voiceData.wholesalePrice = this.replaceCharAfterNumber(voiceData.wholesalePrice, '块', voiceData.wholesalePrice = this.replaceCharAfterNumber(voiceData.wholesalePrice, '块',
'.') '.')
@ -5671,7 +5715,7 @@
this.voiceText1 = '' this.voiceText1 = ''
this.$refs.popup.close() this.$refs.popup.close()
if (voiceData.productCount) { if (voiceData.productCount) {
let regexZCount = /\d+/g; let regexZCount = /-?\d+/g;
voiceData.productCount = voiceData.productCount[0].match( voiceData.productCount = voiceData.productCount[0].match(
regexZCount); regexZCount);
} }
@ -5695,7 +5739,8 @@
} }
let data = { let data = {
id: voiceData.productSn, id: voiceData.productSn,
productCount: Number(voiceData.productCount) || 0, productCount: Number(voiceData.productCount)>=0?Number(voiceData.productCount):0,
returnCount: Number(voiceData.productCount)<0?Math.abs(Number(voiceData.productCount)):0,
productName: voiceData.productName, productName: voiceData.productName,
productSn: voiceData.productSn, productSn: voiceData.productSn,
customerCategoryList:null, customerCategoryList:null,
@ -5705,6 +5750,7 @@
unitPrice: voiceData.wholesalePrice || 0, unitPrice: voiceData.wholesalePrice || 0,
discountAmount: voiceData.wholesalePrice || 0, discountAmount: voiceData.wholesalePrice || 0,
wholesalePrice: voiceData.wholesalePrice || 0, wholesalePrice: voiceData.wholesalePrice || 0,
returnPrice: voiceData.wholesalePrice || 0,
stockLogList1: [{ stockLogList1: [{
attributeList: '{"颜色":"均色","尺码":"均码"}', attributeList: '{"颜色":"均色","尺码":"均码"}',
productCount: Number(voiceData.productCount) || oldProduCount, productCount: Number(voiceData.productCount) || oldProduCount,
@ -5790,8 +5836,14 @@
.stockLogList1[i]) .stockLogList1[i])
} }
} }
this.carList.get(id).productCount += Number(purchaseDetails[j] if(Number(purchaseDetails[j].stockLogList1[i].productCount) >=0){
.stockLogList1[i].productCount) this.carList.get(id).productCount += Number(purchaseDetails[j]
.stockLogList1[i].productCount)
}else{
this.carList.get(id).returnCount += Math.abs(Number(purchaseDetails[j]
.stockLogList1[i].productCount))
}
} }
} }
if (this.carList.get(id).stockLogList.get( if (this.carList.get(id).stockLogList.get(
@ -5944,9 +5996,16 @@
.stockLogList1[i]) .stockLogList1[i])
} }
} }
this.carList.get(id).productCount += if(Number(purchaseDetails[j].stockLogList1[i]
Number(purchaseDetails[j].stockLogList1[i] .productCount) >=0){
.productCount) this.carList.get(id).productCount +=
Number(purchaseDetails[j].stockLogList1[i]
.productCount)
}else{
this.carList.get(id).returnCount +=
Math.abs(Number(purchaseDetails[j].stockLogList1[i]
.productCount))
}
} }
} }
this.carList.get(id).price = Number(this.carList.get(id) this.carList.get(id).price = Number(this.carList.get(id)
@ -6732,7 +6791,7 @@
this.voiceText1 = '' this.voiceText1 = ''
this.$refs.popup.close() this.$refs.popup.close()
if (voiceData.productCount) { if (voiceData.productCount) {
let regexZCount = /\d+/g; let regexZCount = /-?\d+/g;
voiceData.productCount = voiceData.productCount[0].match( voiceData.productCount = voiceData.productCount[0].match(
regexZCount); regexZCount);
} }
@ -7177,6 +7236,7 @@
this.carList.get(id).wholesalePrice = purchaseDetails[0].purchasePrice this.carList.get(id).wholesalePrice = purchaseDetails[0].purchasePrice
this.carList.get(id).unitPrice = purchaseDetails[0].purchasePrice this.carList.get(id).unitPrice = purchaseDetails[0].purchasePrice
this.carList.get(id).discountAmount = purchaseDetails[0].purchasePrice this.carList.get(id).discountAmount = purchaseDetails[0].purchasePrice
this.carList.get(id).returnPrice = purchaseDetails[0].purchasePrice
} }
} }
@ -7402,6 +7462,7 @@
this.carList.get(id).wholesalePrice = purchaseDetails[0].purchasePrice this.carList.get(id).wholesalePrice = purchaseDetails[0].purchasePrice
this.carList.get(id).unitPrice = purchaseDetails[0].purchasePrice this.carList.get(id).unitPrice = purchaseDetails[0].purchasePrice
this.carList.get(id).discountAmount = purchaseDetails[0].purchasePrice this.carList.get(id).discountAmount = purchaseDetails[0].purchasePrice
this.carList.get(id).returnPrice = purchaseDetails[0].purchasePrice
} }
} }
@ -8406,7 +8467,7 @@
this.voiceText1 = '' this.voiceText1 = ''
this.$refs.popup.close() this.$refs.popup.close()
if (voiceData.productCount) { if (voiceData.productCount) {
let regexZCount = /\d+/g; let regexZCount = /-?\d+/g;
voiceData.productCount = voiceData.productCount[0].match( voiceData.productCount = voiceData.productCount[0].match(
regexZCount); regexZCount);
} }
@ -8820,6 +8881,8 @@
}, },
//编辑每一个的单价 //编辑每一个的单价
clickCollapse(e, id) { clickCollapse(e, id) {
this.newProductId =''
console.log('id',this.carList)
this.carList.get(id).discountAmount = Number(e) this.carList.get(id).discountAmount = Number(e)
this.carList.get(id).unitPrice = Number(e) this.carList.get(id).unitPrice = Number(e)
this.carList.get(id).returnPrice = this.carList.get(id).discountAmount this.carList.get(id).returnPrice = this.carList.get(id).discountAmount
@ -9443,6 +9506,7 @@
this.carList.get(id).productName = e.detail.value this.carList.get(id).productName = e.detail.value
}, },
sninput(e, id) { sninput(e, id) {
this.newProductId = e.detail.value
this.carList.get(id).productSn = e.detail.value this.carList.get(id).productSn = e.detail.value
this.$forceUpdate() this.$forceUpdate()
}, },
@ -9484,7 +9548,6 @@
} }
}) })
this.$nextTick(() => { this.$nextTick(() => {
if (isTrue == false) { if (isTrue == false) {
if (that.carList.get(id).productId) { if (that.carList.get(id).productId) {
@ -11277,6 +11340,11 @@
} }
} }
if(that.carList.get(carList1[i].id).returnList.size > 0){
that.carList.get(carList1[i].id).returnList.forEach(function(value, key) {
that.carList.get(carList1[i].id).returnCount += Math.abs(value.productCount)
})
}
} else { //商品不同 } else { //商品不同
let obj = { let obj = {
attrId:carList1[i].attrId, attrId:carList1[i].attrId,
@ -11969,6 +12037,7 @@
//删除商品下的某一个规格 //删除商品下的某一个规格
delShopSpec(id, name) { delShopSpec(id, name) {
var that = this; var that = this;
console.log('carList',that.carList)
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: "确定删除此条规格吗?", content: "确定删除此条规格吗?",
@ -11985,7 +12054,7 @@
that.carList.get(id).price = Number(that.carList.get(id).productCount) * that.carList.get( that.carList.get(id).price = Number(that.carList.get(id).productCount) * that.carList.get(
id).unitPrice id).unitPrice
if (that.carList.get(id).stockLogList.size == 0) { if (that.carList.get(id).stockLogList.size == 0 && that.carList.get(id).returnList.size == 0) {
that.carList.delete(id) that.carList.delete(id)
} }
// that.getAllPrice() // that.getAllPrice()
@ -12010,6 +12079,9 @@
that.carList.get(id).returnList.delete(name); that.carList.get(id).returnList.delete(name);
that.carList.get(id).returtnPay = Number(that.carList.get(id).productCount) * that.carList.get( that.carList.get(id).returtnPay = Number(that.carList.get(id).productCount) * that.carList.get(
id).returnPrice id).returnPrice
if (that.carList.get(id).stockLogList.size == 0 && that.carList.get(id).returnList.size == 0) {
that.carList.delete(id)
}
that.getAmountAndWho() that.getAmountAndWho()
} }
that.$forceUpdate() that.$forceUpdate()

4
pages/staff/staff.vue

@ -88,12 +88,12 @@
}) })
}, },
gotoPerformancePage() { gotoPerformancePage() {
if(this.type == 0){ if(this.type == 0 && (uni.getStorageSync('shopOwnerPhone') == uni.getStorageSync('username'))){
uni.navigateTo({ uni.navigateTo({
url: '/package1/staff/performance' url: '/package1/staff/performance'
}) })
}else{ }else{
this.tui.toast("暂无添加权限") this.tui.toast("暂无查看权限")
} }
}, },

Loading…
Cancel
Save