From 313081ff347c930f250ed652f3b137d5a87fcfc5 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Sun, 18 Aug 2024 09:07:52 +0800 Subject: [PATCH] 11 --- pages/billing/changeGoods1.vue | 8 +- pages/index/checkShop.vue | 9 +- .../index/customAndSupplierProductDetail.vue | 42 +- pages/index/dataStatistics.vue | 10 +- pages/index/index.vue | 82 ++- pages/index/shareStyle.vue | 4 +- pages/index/waitStorage.vue | 125 +++- pages/inventory/goodsList1.vue | 542 ++++++++++-------- pages/inventory/inventory.vue | 2 +- pages/inventory/inventoryDetail.vue | 17 +- pages/login/login.vue | 4 +- 11 files changed, 567 insertions(+), 278 deletions(-) diff --git a/pages/billing/changeGoods1.vue b/pages/billing/changeGoods1.vue index f2ecb81..4526417 100644 --- a/pages/billing/changeGoods1.vue +++ b/pages/billing/changeGoods1.vue @@ -21,7 +21,7 @@ - {{item.productSn}}({{item.productName == null ?'':item.productName}}) + {{item.productSn==null?'':item.productSn}}({{item.productName == null ?'':item.productName}}) (已下架) 供应商:{{item.supplierName== null?'':item.supplierName}} @@ -58,7 +58,7 @@ {{item.productSn}} ({{item.productName == null ?'':item.productName}}) - 供应商:{{item.supplierName}} + 供应商:{{item.supplierName== null?'':item.supplierName}} {{userType == 0 ?item1.supplierBuyProductDetailLogVos[0].purchasePrice:0}} + align="center">{{userType == 0 ?(item1.supplierBuyProductDetailLogVos[0].purchasePrice == null?0:item1.supplierBuyProductDetailLogVos[0].purchasePrice):0}} {{item1.productCount * item1.supplierBuyProductDetailLogVos[0].purchasePrice || 0}} @@ -1078,6 +1078,42 @@ this.$forceUpdate() } + } else if (this.current == 3) { + if(this.type == 'gysName'){ + // for (let i = 0; i < this.list.length; i++) { + // this.list[i].productCount = 0 + // for (let j = 0; j < this.list[i].supplierBuySaleVos.length; j++) { + // this.list[i].supplierBuySaleVos[j].productCount = 0 + + // for (let m = 0; m < this.list[i].supplierBuySaleVos[j] + // .supplierBuyProductDetailLogVos.length; m++) { + // this.list[i].productCount += this.list[i].supplierBuySaleVos[j] + // .supplierBuyProductDetailLogVos[m].productCount + // this.list[i].supplierBuySaleVos[j].productCount += this.list[i] + // .supplierBuySaleVos[j].supplierBuyProductDetailLogVos[m] + // .productCount + // } + // } + // } + // this.$forceUpdate() + }else{ + for (let i = 0; i < this.list.length; i++) { + + for (let j = 0; j < this.list[i].returnSaleDetailList.length; j++) { + + + this.list[i].returnSaleDetailList[j].productCount = 0 + for (let m = 0; m < this.list[i].returnSaleDetailList[j] + .stockLogList1.length; m++) { + this.list[i].returnSaleDetailList[j].productCount += this.list[i] + .returnSaleDetailList[j].stockLogList1[m] + .productCount + } + } + } + this.$forceUpdate() + } + } } else { this.tui.toast(res.message) diff --git a/pages/index/dataStatistics.vue b/pages/index/dataStatistics.vue index 79c71f8..2706e3d 100644 --- a/pages/index/dataStatistics.vue +++ b/pages/index/dataStatistics.vue @@ -58,7 +58,7 @@ {{item.name}} - {{item.name == '销售金额'?shopInfo.totalAmount:item.name == '实收金额'?shopInfo.totalAlreadyEarn:item.name == '利润' && type == 0?shopInfo.totalProfit:item.name == '进货金额' && type == 0?shopInfo.purchasingCost:item.name == '退货金额'?shopInfo.returnTotalAmount:item.name == '下单客户'?shopInfo.totalCCount:""}} + {{item.name == '销售金额'?shopInfo.totalAmount:item.name == '销售总件数'?shopInfo.totalJCount:item.name == '退货总件数'?shopInfo.returnTotalCount:item.name == '实收金额'?shopInfo.totalAlreadyEarn:item.name == '利润' && type == 0?shopInfo.totalProfit:item.name == '进货金额' && type == 0?shopInfo.purchasingCost:item.name == '退货金额'?shopInfo.returnTotalAmount:item.name == '下单客户'?shopInfo.totalCCount:""}} @@ -77,6 +77,10 @@ name:'销售金额', value:'xiaoshou', icon:'cart', + },{ + name:'销售总件数', + value:'xiaoshou', + icon:'cart', },{ name:'实收金额', value:'shishou', @@ -93,6 +97,10 @@ name:'退货金额', value:'tuihuo', icon:'refreshempty' + },{ + name:'退货总件数', + value:'tuihuo', + icon:'refreshempty' },{ name:'下单客户', value:'xiadankehu', diff --git a/pages/index/index.vue b/pages/index/index.vue index b9439b6..5a8b085 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -2,6 +2,9 @@ + + + @@ -139,6 +142,8 @@ clickable isLink arrow-direction="left"> --> + @@ -150,10 +155,15 @@ isLink arrow-direction="left"> + + - @@ -23,7 +23,7 @@ {{item.productName == null ?'':item.productName}} (已下架) - {{item.productSn}} + {{item.productSn==null?'':item.productSn}} 供应商:{{item.supplierName == null ?'':item.supplierName}} diff --git a/pages/index/waitStorage.vue b/pages/index/waitStorage.vue index cb89edd..f9f4031 100644 --- a/pages/index/waitStorage.vue +++ b/pages/index/waitStorage.vue @@ -49,9 +49,10 @@ 订单状态:{{item.delFlag == 1 ?'已撤销':item.inStorageStatus == 0 ?'未入库' :item.inStorageStatus == 1 ?'已入库':item.inStorageStatus == 2 ?'AI识别-识别中...':item.inStorageStatus == 3 || (item.inStorageStatus == 4 && item.ocrCount > 0) ?'AI识别-识别完成':item.ocrCount == 0 && item.inStorageStatus == 4?'AI识别-识别失败':'暂无'}} - 更新 - 撤销 - AI入库 + 更新 + 撤销并复制 + 撤销 + AI入库 @@ -116,7 +117,121 @@ } } }, - methods: { + methods: { + // 取消订单 + cancelOrder(item) { + let that = this; + // await this.getReturnOrder(item.id) + this.tui.modal("提示", "您确定要撤销此采购单吗?", true, (res) => { + if (res) { + that.cancelOk(item) + } + }) + }, + // 取消订单 + cancelOk(item) { + let that = this; + that.tui.request('/app/purchase/cancelPurchase', "POST", { + id:item.id + }, true, true).then((res1) => { + if (res1.code == 200) { + that.goSaleGoods(item) + } else { + that.tui.toast(res.message) + } + }).catch((res1) => {}) + }, + sliceMsg(val) { + var name = '' + if (typeof(val) == 'string') { + let newObj = JSON.parse(val) + for (let as in newObj) { + name += newObj[as] + '/' + } + } + return name; + }, + //带参数跳转到入库页 + async goSaleGoods(item) { + let dataList = [] + await this.tui.request('/app/purchase/getPurchaseAllData', "POST", { + id:item.id + }, false, true).then((res1) => { + if(res1.code == 200){ + if(!res1.result.purchaseDetails){ + res1.result.purchaseDetails = [] + } + if (res1.result.purchaseDetails) { + for (let i = 0; i < res1.result.purchaseDetails.length; i++) { + + let obj = {} + let attrMap = new Map() + let newSaleDetailDTOList = [] + let num = 0 + + for (let m = 0; m < res1.result.purchaseDetails[i].stockLogList1.length; m++) { + if (attrMap.has(res1.result.purchaseDetails[i].stockLogList1[m].attributeList) == true) { + let hasCount = attrMap.get(res1.result.purchaseDetails[i].stockLogList1[m].attributeList) + newSaleDetailDTOList[hasCount].productCount = Number(newSaleDetailDTOList[hasCount] + .productCount) + Number(res1.result.purchaseDetails[i].stockLogList1[m].productCount) + } else { + res1.result.purchaseDetails[i].stockLogList1[m].name = this.sliceMsg(res1.result.purchaseDetails[i] + .stockLogList1[m].attributeList) + newSaleDetailDTOList.push(res1.result.purchaseDetails[i].stockLogList1[m]) + attrMap.set(res1.result.purchaseDetails[i].stockLogList1[m].attributeList, num) + num++ + } + + } + obj.saleDetailQueryDTO = newSaleDetailDTOList + obj.num = 0 + obj.id = res1.result.purchaseDetails[i].productId + obj.purchasePrice = res1.result.purchaseDetails[i].purchasePrice + obj.price = res1.result.purchaseDetails[i].price + obj.categoryId = res1.result.purchaseDetails[i].categoryId + obj.productName = res1.result.purchaseDetails[i].productName + obj.productPicture = res1.result.purchaseDetails[i].productPicture + obj.productSn = res1.result.purchaseDetails[i].productSn + obj.productId = res1.result.purchaseDetails[i].productId + obj.wholesalePrice = res1.result.purchaseDetails[i].wholesalePrice + obj.saleId = item.id + obj.remark = item.remark + obj.xsyId = item.createBy + obj.createByName = item.createByName + dataList.push(obj) + } + } else { + let obj = {} + obj.num = 0 + obj.price = 0 + obj.saleId = item.id + obj.remark = item.remark + obj.xsyId = item.createBy + obj.createByName = item.createByName + dataList.push(obj) + } + uni.setStorageSync('AiInventoryId', res1.result.purchase.id) + } + }).catch((res1) => {}) + console.log('dataList',dataList) + await this.tui.request("/app/debt/selectByUserId", "post", { + shopId:uni.getStorageSync('shopId'), + userId:item.supplierId + }, false, true).then((res) => { + if (res.code == 200) { + console.log('khName',res.result) + res.result.noEarn = res.result.amountOwed + res.result.consigneeName = res.result.userName + res.result.id = res.result.userId + uni.setStorageSync('khName', JSON.stringify(res.result)) + uni.setStorageSync('carList1', JSON.stringify(dataList)) + uni.setStorageSync('hangOrder', true) + uni.navigateTo({ + url: '/package1/AI/voiceInventory', + }) + } + }) + }, searchTime(res){ console.log(res) if(res == ''){ @@ -213,7 +328,7 @@ this.khOrGysList() }, goDetail(item){ - uni.setStorageSync('noReload',true) + // uni.setStorageSync('noReload',true) uni.navigateTo({ url: '/package1/index/waitStorageDetail?id=' + item.id }) diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue index 5ef8e0e..258c0a8 100644 --- a/pages/inventory/goodsList1.vue +++ b/pages/inventory/goodsList1.vue @@ -125,11 +125,11 @@ --> - 语音录入 - 添加规格 @@ -742,10 +742,13 @@ - 请确认开单金额 + 请确认再次确认 + + 开单客户:{{khName.name}} + 更换图片 + + + + + 提示 + + + 您的货号为“ + {{item}}、”的商品售价为0,是否继续开单? + + + 取消 + 确认 + + + @@ -1043,6 +1065,7 @@ data() { return { attrList: [], + zeroArr:[], productPictures: [], oneData: {}, moreData: [], @@ -1620,7 +1643,7 @@ } for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) { var data1 = { - productCount: this.carList1[i].saleDetailQueryDTO[m].productCount, + 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] @@ -1631,7 +1654,7 @@ if (this.carList1[i].saleDetailQueryDTO[m].productCount < 0) { //退货数量 obj.returnCount += Math.abs(this.carList1[i].saleDetailQueryDTO[m].productCount) } else { - obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount + obj.productCount += Number(this.carList1[i].saleDetailQueryDTO[m].productCount) } } @@ -1647,9 +1670,9 @@ m].attributeList) == true) { //规格相同 var data1 = { - productCount: this.carList.get(this.carList1[i].id).stockLogList.get(this - .carList1[i].saleDetailQueryDTO[m].attributeList).productCount + - this.carList1[i].saleDetailQueryDTO[m].productCount, + 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 @@ -1674,7 +1697,7 @@ // m].productCount var data1 = { - productCount: this.carList1[i].saleDetailQueryDTO[m].productCount, + 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 @@ -1688,8 +1711,8 @@ this.carList.get(this.carList1[i].id).returnCount += Math.abs(this.carList1[i] .saleDetailQueryDTO[m].productCount) } else { - this.carList.get(this.carList1[i].id).productCount += this.carList1[i] - .saleDetailQueryDTO[m].productCount + this.carList.get(this.carList1[i].id).productCount += Number(this.carList1[i] + .saleDetailQueryDTO[m].productCount) } } @@ -1721,7 +1744,7 @@ // .saleDetailQueryDTO[m].productCount) // obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount var data1 = { - productCount: this.carList1[i].saleDetailQueryDTO[m].productCount, + 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] @@ -1733,7 +1756,7 @@ if (this.carList1[i].saleDetailQueryDTO[m].productCount < 0) { //退货数量 obj.returnCount += Math.abs(this.carList1[i].saleDetailQueryDTO[m].productCount) } else { - obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount + obj.productCount += Number(this.carList1[i].saleDetailQueryDTO[m].productCount) } } this.carList.set(this.carList1[i].id, obj) @@ -1757,7 +1780,7 @@ value.unitPrice = value.wholesalePrice } if (that.discountType == 1) { //整体折扣 - value.price = value.unitPrice * 10000 * value.productCount * that.discountNum / 10 / 10000 + value.price = value.unitPrice * 10000 * Number(value.productCount) * that.discountNum / 10 / 10000 } }) // this.getAllPrice() @@ -1817,7 +1840,7 @@ } for (let m = 0; m < this.carList1[i].stockLogList1.length; m++) { var data1 = { - productCount: this.carList1[i].stockLogList1[m].productCount, + productCount: Number(this.carList1[i].stockLogList1[m].productCount), name: this.sliceMsg(this.carList1[i].stockLogList1[m].attributeList), productNum: this.carList1[i].stockLogList1[m].stockCount } @@ -1825,7 +1848,7 @@ if (this.carList1[i].stockLogList1[m].productCount < 0) { //退货数量 obj.returnCount += Math.abs(this.carList1[i].stockLogList1[m].productCount) } else { - obj.productCount += this.carList1[i].stockLogList1[m].productCount + obj.productCount += Number(this.carList1[i].stockLogList1[m].productCount) } } this.carList.set(this.carList1[i].productId, obj) @@ -1838,9 +1861,9 @@ m].attributeList) == true) { //规格相同 var data1 = { - productCount: this.carList.get(this.carList1[i].productId).stockLogList - .get(this.carList1[i].stockLogList1[m].attributeList).productCount + - this.carList1[i].stockLogList1[m].productCount, + productCount: Number(this.carList.get(this.carList1[i].productId).stockLogList + .get(this.carList1[i].stockLogList1[m].attributeList).productCount) + + Number(this.carList1[i].stockLogList1[m].productCount), name: this.sliceMsg(this.carList1[i].stockLogList1[m].attributeList), productNum: this.carList1[i].stockLogList1[m].stockCount } @@ -1850,7 +1873,7 @@ } else { //规格不同 var data1 = { - productCount: this.carList1[i].stockLogList1[m].productCount, + productCount: Number(this.carList1[i].stockLogList1[m].productCount), name: this.sliceMsg(this.carList1[i].stockLogList1[m].attributeList), productNum: this.carList1[i].stockLogList1[m].stockCount } @@ -1861,8 +1884,8 @@ this.carList.get(this.carList1[i].productId).returnCount += Math.abs(this.carList1[ i].stockLogList1[m].productCount) } else { - this.carList.get(this.carList1[i].productId).productCount += this.carList1[i] - .stockLogList1[m].productCount + this.carList.get(this.carList1[i].productId).productCount += Number(this.carList1[i] + .stockLogList1[m].productCount) } } } else { //商品不同 @@ -1898,7 +1921,7 @@ // .stockLogList1[m].productCount) // obj.productCount += this.carList1[i].stockLogList1[m].productCount var data1 = { - productCount: this.carList1[i].stockLogList1[m].productCount, + productCount: Number(this.carList1[i].stockLogList1[m].productCount), name: this.sliceMsg(this.carList1[i].stockLogList1[m].attributeList), productNum: this.carList1[i].stockLogList1[m].stockCount } @@ -1908,7 +1931,7 @@ if (this.carList1[i].stockLogList1[m].productCount < 0) { //退货数量 obj.returnCount += Math.abs(this.carList1[i].stockLogList1[m].productCount) } else { - obj.productCount += this.carList1[i].stockLogList1[m].productCount + obj.productCount += Number(this.carList1[i].stockLogList1[m].productCount) } } this.carList.set(this.carList1[i].productId, obj) @@ -1928,7 +1951,7 @@ value.unitPrice = value.wholesalePrice } if (that.discountType == 1) { //整体折扣 - value.price = value.unitPrice * 10000 * value.productCount * that.discountNum / + value.price = value.unitPrice * 10000 * Number(value.productCount) * that.discountNum / 10 / 10000 } }) @@ -2188,7 +2211,7 @@ if (specMap.has(stringKey) == true) { data[1] = stringKey specMap.get(stringKey).name = that.sliceMsg(stringKey) - specMap.get(stringKey).productCount += value.productCount + specMap.get(stringKey).productCount += Number(value.productCount) } else { data[1] = stringKey specMap.set(stringKey, value) @@ -2209,7 +2232,7 @@ } } else { if (specMap.has(key) == true) { - specMap.get(key).productCount += value.productCount + specMap.get(key).productCount += Number(value.productCount) } else { specMap.set(key, value) specMap.get(key).name = that.sliceMsg(key) @@ -2221,7 +2244,7 @@ if (specMap.has(stringKey) == true) { data[1] = stringKey specMap.get(stringKey).name = that.sliceMsg(stringKey) - specMap.get(stringKey).productCount += value.productCount + specMap.get(stringKey).productCount += Number(value.productCount) } else { data[1] = stringKey @@ -2243,7 +2266,7 @@ } } else { if (specMap.has(key) == true) { - specMap.get(key).productCount += value.productCount + specMap.get(key).productCount += Number(value.productCount) } else { specMap.set(key, value) specMap.get(key).name = that.sliceMsg(key) @@ -2291,12 +2314,12 @@ for (var m = 0; m < this.pageOldTemList.length; m++) { if (this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList) { - this.pageOldTemList[m].productCount = this.temporaryList[i].productCount + this.pageOldTemList[m].productCount = Number(this.temporaryList[i].productCount) } } for (var j = 0; j < this.oldTemList.length; j++) { if (this.temporaryList[i].attributeList == this.oldTemList[j].attributeList) { - this.oldTemList[j].productCount = this.temporaryList[i].productCount + this.oldTemList[j].productCount = Number(this.temporaryList[i].productCount) } } } @@ -2329,12 +2352,12 @@ for (var m = 0; m < this.pageOldTemList.length; m++) { if (this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList) { - this.pageOldTemList[m].productCount = this.temporaryList[i].productCount + this.pageOldTemList[m].productCount = Number(this.temporaryList[i].productCount) } } for (var j = 0; j < this.oldTemList.length; j++) { if (this.temporaryList[i].attributeList == this.oldTemList[j].attributeList) { - this.oldTemList[j].productCount = this.temporaryList[i].productCount + this.oldTemList[j].productCount = Number(this.temporaryList[i].productCount) } } } @@ -2356,12 +2379,12 @@ for (var m = 0; m < this.pageOldTemList.length; m++) { if (this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList) { - this.pageOldTemList[m].productCount = this.temporaryList[i].productCount + this.pageOldTemList[m].productCount = Number(this.temporaryList[i].productCount) } } for (var j = 0; j < this.oldTemList.length; j++) { if (this.temporaryList[i].attributeList == this.oldTemList[j].attributeList) { - this.oldTemList[j].productCount = this.temporaryList[i].productCount + this.oldTemList[j].productCount = Number(this.temporaryList[i].productCount) } } } @@ -2445,7 +2468,7 @@ for (var i = 0; i < value.length; i++) { this.attributeList = { attributeList: value[i], - productCount: this.temporaryNum, + productCount: Number(this.temporaryNum), productNum: this.productNum, name: this.evalue[i], price: this.purchasePrice @@ -2458,7 +2481,7 @@ for (var i = 0; i < value.length; i++) { for (var m = 0; m < this.temporaryList.length; m++) { if (this.temporaryList[m].attributeList == value[i]) { - newProductCount = this.temporaryList[m].productCount + newProductCount = Number(this.temporaryList[m].productCount) } } this.attributeList = { @@ -2478,7 +2501,7 @@ let notChcek = true; for (var m = 0; m < this.newTemList.length; m++) { if (this.oldTemList[i].attributeList == this.newTemList[m].attributeList) { - this.newTemList[m].productCount = this.oldTemList[i].productCount + this.newTemList[m].productCount = Number(this.oldTemList[i].productCount) notChcek = false; } } @@ -2493,7 +2516,7 @@ let notChcek = true; for (var m = 0; m < this.newTemList.length; m++) { if (this.pageOldTemList[i].attributeList == this.newTemList[m].attributeList) { - this.newTemList[m].productCount = this.pageOldTemList[i].productCount + this.newTemList[m].productCount = Number(this.pageOldTemList[i].productCount) notChcek = false; } } @@ -2548,7 +2571,7 @@ for (var i = 0; i < value.length; i++) { this.attributeList = { attributeList: value[i], - productCount: this.temporaryNum, + productCount: Number(this.temporaryNum), productNum: null, name: this.evalue[i], price: this.purchasePrice @@ -2560,7 +2583,7 @@ for (var i = 0; i < value.length; i++) { for (var m = 0; m < this.temporaryList.length; m++) { if (this.temporaryList[m].attributeList == value[i]) { - newProductCount = this.temporaryList[m].productCount + newProductCount = Number(this.temporaryList[m].productCount) } } this.attributeList = { @@ -2580,7 +2603,7 @@ let notChcek = true; for (var m = 0; m < this.newTemList.length; m++) { if (this.oldTemList[i].attributeList == this.newTemList[m].attributeList) { - this.newTemList[m].productCount = this.oldTemList[i].productCount + this.newTemList[m].productCount = Number(this.oldTemList[i].productCount) notChcek = false; } } @@ -2595,7 +2618,7 @@ let notChcek = true; for (var m = 0; m < this.newTemList.length; m++) { if (this.pageOldTemList[i].attributeList == this.newTemList[m].attributeList) { - this.newTemList[m].productCount = this.pageOldTemList[i].productCount + this.newTemList[m].productCount = Number(this.pageOldTemList[i].productCount) notChcek = false; } } @@ -2663,7 +2686,7 @@ } }, numChange(e, index) { - this.temporaryList[index].productCount = e + this.temporaryList[index].productCount = Number(e) this.$forceUpdate() this.temporaryChange() }, @@ -2679,12 +2702,12 @@ that.carList.get(id).returnCount = that.carList.get(id).returnCount + Math.abs(value .productCount) } else { - that.carList.get(id).productCount = that.carList.get(id).productCount + value.productCount + that.carList.get(id).productCount = Number(that.carList.get(id).productCount) + Number(value.productCount) } }) this.$nextTick(() => { // if (that.discountType != 0) { //单品折扣 - that.carList.get(id).price = that.carList.get(id).productCount * that.carList + that.carList.get(id).price = Number(that.carList.get(id).productCount) * that.carList .get(id).discountAmount // } }) @@ -2707,16 +2730,16 @@ this.carList.get(index).stockLogList.get(index1).productCount-- await 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( + that.carList.get(index).returnCount = Number(that.carList.get(index).returnCount) + Math.abs( value.productCount) } else { - that.carList.get(index).productCount = that.carList.get(index).productCount + value - .productCount + that.carList.get(index).productCount = Number(that.carList.get(index).productCount) + Number(value + .productCount) } }) await this.$nextTick(() => { // if (that.discountType != 0) { //单品折扣 - that.carList.get(index).price = that.carList.get(index).productCount * that.carList + that.carList.get(index).price = Number(that.carList.get(index).productCount) * that.carList .get(index).discountAmount // } }) @@ -2733,13 +2756,13 @@ that.carList.get(index).returnCount = that.carList.get(index).returnCount + Math.abs(value .productCount) } else { - that.carList.get(index).productCount = that.carList.get(index).productCount + value - .productCount + that.carList.get(index).productCount = Number(that.carList.get(index).productCount) + Number(value + .productCount) } }) this.$nextTick(() => { // if (that.discountType != 0) { //单品折扣 - that.carList.get(index).price = that.carList.get(index).productCount * that.carList + that.carList.get(index).price = Number(that.carList.get(index).productCount) * that.carList .get(index).discountAmount // } }) @@ -2977,16 +3000,18 @@ if (this.voiceData.wholesalePrice) { this.voiceData.wholesalePrice = this.replaceCharAfterNumber(this .voiceData.wholesalePrice, '块', '.') - this.voiceData.wholesalePrice = this.replaceCharAfterNumber(this - .voiceData.wholesalePrice, '元', '') + if (this.voiceData.wholesalePrice.indexOf('元') != -1) { + this.voiceData.wholesalePrice = this.voiceData.wholesalePrice.replace(/元/g, '') + } this.voiceData.wholesalePrice = this.voiceData.wholesalePrice.replace( /[^0-9.]/g, ''); } if (this.voiceData.wholesalePrice1) { this.voiceData.wholesalePrice1 = this.replaceCharAfterNumber(this .voiceData.wholesalePrice1, '块', '.') - this.voiceData.wholesalePrice1 = this.replaceCharAfterNumber(this - .voiceData.wholesalePrice1, '元', '') + if (this.voiceData.wholesalePrice1.indexOf('元') != -1) { + this.voiceData.wholesalePrice1 = this.voiceData.wholesalePrice1.replace(/元/g, '') + } this.voiceData.wholesalePrice = this.voiceData.wholesalePrice1.replace( /[^0-9.]/g, ''); } @@ -3007,15 +3032,17 @@ if (voiceData.wholesalePrice) { voiceData.wholesalePrice = this.replaceCharAfterNumber(voiceData.wholesalePrice, '块', '.') - voiceData.wholesalePrice = this.replaceCharAfterNumber( - voiceData.wholesalePrice, '元', '') + if (voiceData.indexOf('元') != -1) { + voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/元/g, '') + } voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/[^0-9.]/g, ""); } if (voiceData.wholesalePrice1) { voiceData.wholesalePrice1 = this.replaceCharAfterNumber(voiceData.wholesalePrice1, '块', '.') - voiceData.wholesalePrice1 = this.replaceCharAfterNumber( - voiceData.wholesalePrice1, '元', '') + if (voiceData.wholesalePrice1.indexOf('元') != -1) { + voiceData.wholesalePrice1 = voiceData.wholesalePrice1.replace(/元/g, '') + } voiceData.wholesalePrice = voiceData.wholesalePrice1.replace(/[^0-9.]/g, ""); } this.tui.request('/app/product/getByProductSn', "post", { @@ -3082,15 +3109,13 @@ if (res.result[0].productCount == '') { if (voiceData.productCount < 0) { res.result[0].returnCount = - voiceData - .productCount[0] + Number(voiceData.productCount[0]) res.result[0].returnPrice = res .result[ 0].wholesalePrice } else { res.result[0].productCount = - voiceData - .productCount + Number(voiceData.productCount) } } @@ -3128,23 +3153,25 @@ if (voiceData.wholesalePrice) { voiceData.wholesalePrice = this.replaceCharAfterNumber( voiceData.wholesalePrice, '块', '.') - voiceData.wholesalePrice = this.replaceCharAfterNumber( - voiceData.wholesalePrice, '元', '') + if (voiceData.indexOf('元') != -1) { + voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/元/g, '') + } voiceData.wholesalePrice = voiceData.wholesalePrice.replace( /[^0-9.]/g, ""); } if (voiceData.wholesalePrice1) { voiceData.wholesalePrice1 = this.replaceCharAfterNumber( voiceData.wholesalePrice1, '块', '.') - voiceData.wholesalePrice1 = this.replaceCharAfterNumber( - voiceData.wholesalePrice1, '元', '') + if (voiceData.wholesalePrice1.indexOf('元') != -1) { + voiceData.wholesalePrice1 = voiceData.wholesalePrice1.replace(/元/g, '') + } voiceData.wholesalePrice = voiceData.wholesalePrice1.replace( /[^0-9.]/g, ""); } let data = { id: voiceData.productSn, productId: voiceData.productSn, - productCount: voiceData.productCount[0] || 0, + productCount: Number(voiceData.productCount[0]) || 0, productName: voiceData.productName, productSn: voiceData.productSn, isNew: true, @@ -3409,15 +3436,17 @@ if (voiceData.wholesalePrice) { voiceData.wholesalePrice = this.replaceCharAfterNumber(voiceData.wholesalePrice, '块', '.') - voiceData.wholesalePrice = this.replaceCharAfterNumber( - voiceData.wholesalePrice, '元', '') + if (voiceData.wholesalePrice.indexOf('元') != -1) { + voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/元/g, '') + } voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/[^0-9.]/g, ""); } if (voiceData.wholesalePrice1) { voiceData.wholesalePrice1 = this.replaceCharAfterNumber(voiceData.wholesalePrice1, '块', '.') - voiceData.wholesalePrice1 = this.replaceCharAfterNumber( - voiceData.wholesalePrice1, '元', '') + if (voiceData.wholesalePrice1.indexOf('元') != -1) { + this.voiceData.wholesalePrice1 = this.voiceData.wholesalePrice1.replace(/元/g, '') + } voiceData.wholesalePrice = voiceData.wholesalePrice1.replace(/[^0-9.]/g, ""); } this.tui.request('/app/product/getByProductSn', "post", { @@ -3501,12 +3530,10 @@ if (purchaseDetails[0] .productCount < 0 ) { - this.carList.get( - id) + this.carList.get(id) .returnCount = - purchaseDetails[ - 0] - .productCount + Number(purchaseDetails[0] + .productCount) this.carList.get( id) .returnPrice = @@ -3514,12 +3541,10 @@ 0] .wholesalePrice } else { - this.carList.get( - id) + this.carList.get(id) .productCount = - purchaseDetails[ - 0] - .productCount + Number(purchaseDetails[0] + .productCount) } } @@ -3636,11 +3661,9 @@ .attributeList ) .productCount += - purchaseDetails[ - j] - .stockLogList1[ - i] - .productCount + Number(purchaseDetails[j] + .stockLogList1[i] + .productCount) } else { this.carList.get( id) @@ -3659,9 +3682,9 @@ } this.carList.get(id) .productCount += - purchaseDetails[j] + Number(purchaseDetails[j] .stockLogList1[i] - .productCount + .productCount) } } if (this.carList.get(id) @@ -3675,8 +3698,8 @@ '{"颜色":"均色","尺码":"均码"}' ) } - this.carList.get(id).price = this - .carList.get(id).productCount * + this.carList.get(id).price = Number(this + .carList.get(id).productCount) * this.carList.get(id) .wholesalePrice } else { @@ -3844,9 +3867,9 @@ purchaseDetails[0].price this.carList.get(id).price = purchaseDetails[0] - .wholesalePrice * this + .wholesalePrice * Number(this .carList.get(id) - .productCount + .productCount) } else { this.carList.get(id) @@ -3864,9 +3887,9 @@ purchaseDetails[0].price this.carList.get(id).price = purchaseDetails[0] - .wholesalePrice * this + .wholesalePrice * Number(this .carList.get(id) - .productCount + .productCount) } let specMap = @@ -3972,13 +3995,9 @@ .attributeList ) .productCount += - purchaseDetails[ - j - ] - .stockLogList1[ - i - ] - .productCount + Number(purchaseDetails[j] + .stockLogList1[i] + .productCount) this.carList .get( id @@ -4024,10 +4043,8 @@ ) } } - if (purchaseDetails[ - j] - .stockLogList1[ - i] + if (purchaseDetails[j] + .stockLogList1[i] .productCount < 0) { this.carList @@ -4036,12 +4053,8 @@ .returnCount += Math .abs( - purchaseDetails[ - j - ] - .stockLogList1[ - i - ] + purchaseDetails[j] + .stockLogList1[i] .productCount ) } else { @@ -4049,19 +4062,17 @@ .get( id) .productCount += - purchaseDetails[ - j] - .stockLogList1[ - i] - .productCount + Number(purchaseDetails[j] + .stockLogList1[i] + .productCount) } } } this.carList.get(id) - .price = this + .price = Number(this .carList.get(id) - .productCount * + .productCount) * this.carList.get( id) .wholesalePrice @@ -4113,22 +4124,24 @@ if (voiceData.wholesalePrice) { voiceData.wholesalePrice = this.replaceCharAfterNumber(voiceData .wholesalePrice, '块', '.') - this.voiceData.wholesalePrice = this.replaceCharAfterNumber(this - .voiceData.wholesalePrice, '元', '') + if (voiceData.wholesalePrice.indexOf('元') != -1) { + voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/元/g, '') + } voiceData.wholesalePrice = voiceData.wholesalePrice.replace( /[^0-9.]/g, ""); } if (voiceData.wholesalePrice1) { voiceData.wholesalePrice1 = this.replaceCharAfterNumber(voiceData .wholesalePrice1, '块', '.') - voiceData.wholesalePrice1 = this.replaceCharAfterNumber( - voiceData.wholesalePrice1, '元', '') + if (voiceData.wholesalePrice1.indexOf('元') != -1) { + voiceData.wholesalePrice1 = voiceData.wholesalePrice1.replace(/元/g, '') + } voiceData.wholesalePrice = voiceData.wholesalePrice1.replace( /[^0-9.]/g, ""); } let data = { id: voiceData.productSn, - productCount: voiceData.productCount || 0, + productCount: Number(voiceData.productCount) || 0, productName: voiceData.productName, productSn: voiceData.productSn, categoryId: this.fenleiList.categoryId, @@ -4178,7 +4191,7 @@ } if (this.carList.get(id).productCount == '') { this.carList.get(id).productCount = - purchaseDetails[0].productCount + Number(purchaseDetails[0].productCount) } if (this.carList.get(id).discountAmount == '') { this.carList.get(id).discountAmount = @@ -4211,8 +4224,8 @@ this.carList.get(id).stockLogList.get( purchaseDetails[j].stockLogList1[i] .attributeList).productCount += - purchaseDetails[j].stockLogList1[i] - .productCount + Number(purchaseDetails[j].stockLogList1[i] + .productCount) } else { this.carList.get(id).stockLogList.set( purchaseDetails[j].stockLogList1[i] @@ -4220,8 +4233,8 @@ .stockLogList1[i]) } } - this.carList.get(id).productCount += purchaseDetails[j] - .stockLogList1[i].productCount + this.carList.get(id).productCount += Number(purchaseDetails[j] + .stockLogList1[i].productCount) } } if (this.carList.get(id).stockLogList.get( @@ -4230,8 +4243,8 @@ this.carList.get(id).stockLogList.delete( '{"颜色":"均色","尺码":"均码"}') } - this.carList.get(id).price = this.carList.get(id) - .productCount * this.carList.get(id).wholesalePrice + this.carList.get(id).price = Number(this.carList.get(id) + .productCount) * this.carList.get(id).wholesalePrice } else { let isTrue = false @@ -4311,7 +4324,7 @@ .wholesalePrice this.carList.get(id).lsPrice = purchaseDetails[0].price this.carList.get(id).price = purchaseDetails[0] - .wholesalePrice * purchaseDetails[0].productCount + .wholesalePrice * Number(purchaseDetails[0].productCount) let specMap = new Map() //新的临时存放值那个更改过的值的map this.$nextTick(() => { this.carList.forEach(function(value, key) { @@ -4348,8 +4361,8 @@ .stockLogList1[i] .attributeList) .productCount += - purchaseDetails[j] - .stockLogList1[i].productCount + Number(purchaseDetails[j] + .stockLogList1[i].productCount) } else { this.carList.get(id).stockLogList .set(purchaseDetails[j] @@ -4360,12 +4373,12 @@ } } this.carList.get(id).productCount += - purchaseDetails[j].stockLogList1[i] - .productCount + Number(purchaseDetails[j].stockLogList1[i] + .productCount) } } - this.carList.get(id).price = this.carList.get(id) - .productCount * this.carList.get(id) + this.carList.get(id).price = Number(this.carList.get(id) + .productCount) * this.carList.get(id) .wholesalePrice if (this.carList.get(id).stockLogList.get( '{"颜色":"均色","尺码":"均码"}').productCount == @@ -4460,12 +4473,19 @@ this.carList.get(id).productPicture = purchaseDetails[0].productPicture } if (purchaseDetails[0].productId) { - this.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice - this.carList.get(id).lsPrice = purchaseDetails[0].lsPrice + if(purchaseDetails[0].wholesalePrice > 0){ + this.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice + this.carList.get(id).discountAmount = purchaseDetails[0].wholesalePrice + } + if(purchaseDetails[0].lsPrice > 0){ + this.carList.get(id).lsPrice = purchaseDetails[0].lsPrice + } } else { - this.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice - this.carList.get(id).unitPrice = purchaseDetails[0].wholesalePrice - this.carList.get(id).discountAmount = purchaseDetails[0].wholesalePrice + if(purchaseDetails[0].purchasePrice > 0){ + this.carList.get(id).wholesalePrice = purchaseDetails[0].purchasePrice + this.carList.get(id).unitPrice = purchaseDetails[0].purchasePrice + this.carList.get(id).discountAmount = purchaseDetails[0].purchasePrice + } } let specMap = new Map() //新的临时存放值那个更改过的值的map @@ -4513,8 +4533,8 @@ '{"颜色":"均色","尺码":"均码"}') } } - this.carList.get(id).price = this.carList.get(id) - .productCount * this.carList.get(id).discountAmount + this.carList.get(id).price = Number(this.carList.get(id) + .productCount) * this.carList.get(id).discountAmount }) this.$nextTick(() => { this.getAllPrice() @@ -4602,12 +4622,21 @@ this.carList.get(id).productPicture = purchaseDetails[0].productPicture } if (purchaseDetails[0].productId) { - this.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice - this.carList.get(id).lsPrice = purchaseDetails[0].lsPrice + if(purchaseDetails[0].wholesalePrice > 0){ + this.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice + this.carList.get(id).discountAmount = purchaseDetails[0].wholesalePrice + } + if(purchaseDetails[0].lsPrice > 0){ + this.carList.get(id).lsPrice = purchaseDetails[0].lsPrice + } + } else { - this.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice - this.carList.get(id).unitPrice = purchaseDetails[0].wholesalePrice - this.carList.get(id).discountAmount = purchaseDetails[0].wholesalePrice + if(purchaseDetails[0].purchasePrice > 0){ + this.carList.get(id).wholesalePrice = purchaseDetails[0].purchasePrice + this.carList.get(id).unitPrice = purchaseDetails[0].purchasePrice + this.carList.get(id).discountAmount = purchaseDetails[0].purchasePrice + } + } let specMap = new Map() //新的临时存放值那个更改过的值的map @@ -4656,7 +4685,7 @@ } } - this.carList.get(id).price = this.carList.get(id).productCount * + this.carList.get(id).price = Number(this.carList.get(id).productCount) * this.carList.get(id).discountAmount }) this.$nextTick(() => { @@ -4760,7 +4789,7 @@ this.carList.get(id).discountAmount = Number(e) this.carList.get(id).unitPrice = Number(e) this.carList.get(id).returnPrice = this.carList.get(id).discountAmount - this.carList.get(id).price = this.carList.get(id).productCount * this.carList.get(id).discountAmount + this.carList.get(id).price = Number(this.carList.get(id).productCount) * this.carList.get(id).discountAmount this.getAllPrice() }, voiceGetOne() { @@ -4790,7 +4819,7 @@ res.result.records[i].discountAmount = oneData.wholesalePrice } - res.result.records[i].productCount = oneData.productCount[0] + res.result.records[i].productCount = Number(oneData.productCount[0]) } this.$nextTick(() => { this.moreData.push(res.result.records) @@ -4879,21 +4908,23 @@ if (oneData.wholesalePrice) { oneData.wholesalePrice = this.replaceCharAfterNumber(oneData.wholesalePrice, '块', '.') - this.voiceData.wholesalePrice = this.replaceCharAfterNumber(this - .voiceData.wholesalePrice, '元', '') + if (oneData.wholesalePrice.indexOf('元') != -1) { + oneData.wholesalePrice = oneData.wholesalePrice.replace(/元/g, '') + } oneData.wholesalePrice = oneData.wholesalePrice.replace(/[^0-9.]/g, ""); } if (oneData.wholesalePrice1) { oneData.wholesalePrice1 = this.replaceCharAfterNumber(oneData.wholesalePrice1, '块', '.') - oneData.wholesalePrice1 = this.replaceCharAfterNumber( - oneData.wholesalePrice1, '元', '') + if (oneData.wholesalePrice1.indexOf('元') != -1) { + oneData.wholesalePrice1 = oneData.wholesalePrice1.replace(/元/g, '') + } oneData.wholesalePrice = oneData.wholesalePrice1.replace(/[^0-9.]/g, ""); } let data = { id: oneData.productSn, productId: oneData.productSn, - productCount: oneData.productCount[0] || 0, + productCount: Number(oneData.productCount[0]) || 0, productName: oneData.productName, productSn: oneData.productSn, isNew: true, @@ -5395,12 +5426,12 @@ num.returnPrice = returnPrice } num.unitPrice = price; - num.price = price * num.productCount; + num.price = price * Number(num.productCount); this.$refs.inputDialog.close() this.$refs.historyPopup.close() // num.discountAmount = num.unitPrice * num.discount / 10 num.disNoAmount = num.discountAmount - num.price = num.unitPrice * num.discount / 10 * num.productCount + num.price = num.unitPrice * num.discount / 10 * Number(num.productCount) that.relPrice = that.shouldPay that.priceOk = that.shouldPay // this.getAllPrice() @@ -5430,12 +5461,12 @@ if (that.discountType == 1) { //整体折扣 value.discountAmount = value.unitPrice * (that.discountNum / 10) value.discountAmount = value.discountAmount.toFixed(2) - value.price = value.discountAmount * value.productCount + value.price = value.discountAmount * Number(value.productCount) value.price = value.price.toFixed(2) } else if (that.discountType == 0) { //单品折扣 value.discountAmount = value.unitPrice * (value.discount / 10) value.discountAmount = value.discountAmount.toFixed(2) - value.price = (value.unitPrice * (value.discount / 10)) * value.productCount + value.price = (value.unitPrice * (value.discount / 10)) * Number(value.productCount) value.price = value.price.toFixed(2) } @@ -5523,7 +5554,7 @@ value.stockLogList.forEach(function(values, keys) { if (value.stockLogList1.length == 0) { let obj = { - productCount: values.productCount, + productCount: Number(values.productCount), name: values.name, attributeList: keys, productNum: values.productNum @@ -5534,7 +5565,7 @@ if (value.stockLogList1[i].attributeList != keys) { if (value.stockLogList1.length == (i + 1)) { let obj = { - productCount: values.productCount, + productCount: Number(values.productCount), name: values.name, attributeList: keys, productNum: values.productNum @@ -5548,7 +5579,7 @@ }) if (value.productId == id) { - that.zNum = value.productCount + that.zNum = Number(value.productCount) that.temporaryList = value.stockLogList1 that.pageOldTemList = value.stockLogList1 that.oldTemList = value.stockLogList1 @@ -5556,7 +5587,7 @@ } else { if (value.isNew) { if (value.id == id.id) { - that.zNum = value.productCount + that.zNum = Number(value.productCount) that.temporaryList = value.stockLogList1 that.pageOldTemList = value.stockLogList1 that.oldTemList = value.stockLogList1 @@ -5564,7 +5595,7 @@ } } else { if (value.productId == id.productId) { - that.zNum = value.productCount + that.zNum = Number(value.productCount) that.temporaryList = value.stockLogList1 that.pageOldTemList = value.stockLogList1 that.oldTemList = value.stockLogList1 @@ -5596,7 +5627,7 @@ value.stockLogList.forEach(function(values, keys) { if (value.stockLogList1.length == 0) { let obj = { - productCount: values.productCount, + productCount: Number(values.productCount), name: values.name, attributeList: keys, productNum: values.productNum @@ -5610,8 +5641,8 @@ if (value.stockLogList1.length == (i + 1)) { let obj = { - productCount: values - .productCount, + productCount: Number(values + .productCount), name: values.name, attributeList: keys, productNum: values.productNum @@ -5627,7 +5658,7 @@ that.$nextTick(() => { that.carList.forEach(function(value, key) { if (value.productId == id) { - that.zNum = value.productCount + that.zNum = Number(value.productCount) that.temporaryList = value.stockLogList1 that.pageOldTemList = value.stockLogList1 that.oldTemList = value.stockLogList1 @@ -5748,13 +5779,13 @@ if (item != '' && item != undefined) { for (var m = 0; m < this.pageOldTemList.length; m++) { if (item.attributeList == this.pageOldTemList[m].attributeList) { - this.pageOldTemList[m].productCount = item.productCount + this.pageOldTemList[m].productCount = Number(item.productCount) break; } } for (var j = 0; j < this.oldTemList.length; j++) { if (item.attributeList == this.oldTemList[j].attributeList) { - this.oldTemList[j].productCount = item.productCount + this.oldTemList[j].productCount = Number(item.productCount) break; } } @@ -5762,7 +5793,7 @@ this.zNum = 0 for (var i = 0; i < this.temporaryList.length; i++) { if (this.temporaryList[i].productCount > 0) { - this.zNum += this.temporaryList[i].productCount + this.zNum += Number(this.temporaryList[i].productCount) } } }, @@ -5801,7 +5832,7 @@ that.shouldPay = 0 this.discountType = e.detail.value; this.carList.forEach(function(value, key) { - value.price = value.productCount * value.unitPrice //总价 + value.price = Number(value.productCount) * value.unitPrice //总价 value.discount = 10 //折扣 value.discountAmount = value.unitPrice that.shouldPay += value.price @@ -5994,13 +6025,13 @@ for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) { var data1 = { - productCount: carList1[i].saleDetailQueryDTO[m].productCount, + productCount: Number(carList1[i].saleDetailQueryDTO[m].productCount), name: carList1[i].saleDetailQueryDTO[m].name, productNum: carList1[i].saleDetailQueryDTO[m].productNum } obj.stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, data1) if (carList1[i].saleDetailQueryDTO[m].productCount > 0) { - obj.productCount += carList1[i].saleDetailQueryDTO[m].productCount + obj.productCount += Number(carList1[i].saleDetailQueryDTO[m].productCount) } else { obj.returnCount += Math.abs(carList1[i].saleDetailQueryDTO[m].productCount) } @@ -6021,7 +6052,7 @@ .saleDetailQueryDTO[ m].attributeList) == true) { //规格相同 var data1 = { - productCount: carList1[i].saleDetailQueryDTO[m].productCount, + productCount: Number(carList1[i].saleDetailQueryDTO[m].productCount), name: carList1[i].saleDetailQueryDTO[m].name, productNum: carList1[i].saleDetailQueryDTO[m].productNum } @@ -6031,7 +6062,7 @@ } else { //规格不同 var data1 = { - productCount: carList1[i].saleDetailQueryDTO[m].productCount, + productCount: Number(carList1[i].saleDetailQueryDTO[m].productCount), name: carList1[i].saleDetailQueryDTO[m].name, productNum: carList1[i].saleDetailQueryDTO[m].productNum } @@ -6040,14 +6071,14 @@ m].attributeList, data1) } if (carList1[i].saleDetailQueryDTO[m].productCount > 0) { - this.carList.get(carList1[i].id).productCount += carList1[i] - .saleDetailQueryDTO[m].productCount + this.carList.get(carList1[i].id).productCount += Number(carList1[i] + .saleDetailQueryDTO[m].productCount) } else { this.carList.get(carList1[i].id).returnCount += Math.abs(carList1[i] .saleDetailQueryDTO[m].productCount) } - that.carList.get(carList1[i].id).price = that.carList.get(carList1[i].id) - .productCount * + that.carList.get(carList1[i].id).price = Number(that.carList.get(carList1[i].id) + .productCount) * that.carList.get(carList1[i].id).unitPrice } } else { //商品不同 @@ -6077,13 +6108,13 @@ for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) { var data1 = { - productCount: carList1[i].saleDetailQueryDTO[m].productCount, + productCount: Number(carList1[i].saleDetailQueryDTO[m].productCount), name: carList1[i].saleDetailQueryDTO[m].name, productNum: carList1[i].saleDetailQueryDTO[m].productNum } obj.stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, data1) if (carList1[i].saleDetailQueryDTO[m].productCount > 0) { - obj.productCount += carList1[i].saleDetailQueryDTO[m].productCount + obj.productCount += Number(carList1[i].saleDetailQueryDTO[m].productCount) } else { obj.returnCount += Math.abs(carList1[i].saleDetailQueryDTO[m].productCount) } @@ -6102,7 +6133,7 @@ value.unitPrice = value.wholesalePrice } if (that.discountType == 1) { //整体折扣 - value.price = value.unitPrice * 10000 * value.productCount * that + value.price = value.unitPrice * 10000 * Number(value.productCount) * that .discountNum / 10 / 10000 } } @@ -6331,11 +6362,15 @@ let purchaseDetails = []; let returnList = []; let ZreturnCount = 0 + this.zeroArr = [] await this.carList.forEach(function(value, key) { if (value.productSn == "" || value.productSn == null) { that.tui.toast('开单商品货号不能为空') throw Error('1') } + if(value.discountAmount == 0){ + that.zeroArr.push(value.productSn) + } let returnGoods = [] let goodsList = [] value.purchasePrice = value.isNew ? '' : value.purchasePrice @@ -6352,7 +6387,7 @@ returnGoods.push(obj1) } else { let obj1 = { - productCount: values.productCount, + productCount: Number(values.productCount), attributeList: keys } goodsList.push(obj1) @@ -6368,7 +6403,7 @@ discountAmount: value.returnPrice, lsprice: value.lsprice ? value.lsprice : 0, price: value.price, - productCount: value.productCount, + productCount: Number(value.productCount), productId: value.isNew ? '' : value.productId, productName: value.productName, productPicture: value.productPicture, @@ -6392,7 +6427,7 @@ discount: value.discount, discountAmount: value.discountAmount, price: value.lsprice ? value.lsprice : 0, - productCount: value.productCount, + productCount: Number(value.productCount), productId: value.isNew ? '' : value.productId, productName: value.productName, productPicture: value.productPicture, @@ -6452,8 +6487,17 @@ }, 500) }) this.sellObj = obj + //零元开单弹窗点击了确认 + if(type=='zeroNo'){ + this.zeroArr = [] + } if (type != 'hang') { - this.$refs.showPopup.open() + if(this.zeroArr.length > 0){ + this.$refs.zeroDialog.open() + }else{ + this.$refs.zeroDialog.close() + this.$refs.showPopup.open() + } } }, hangOrderFn() { @@ -6499,6 +6543,12 @@ title: '加载中...' }) this.$refs.showPopup.close() + if(this.khName == ''){ + setTimeout(res=>{ + that.tui.toast('请选择客户后再开单') + },1000) + return + } let url = '' if (this.saleId != '') { url = '/app/sale/shareToBuyNew' @@ -6561,7 +6611,7 @@ carlist.discountAmount = carlist.unitPrice * carlist.discount / 10 carlist.discountAmount = carlist.discountAmount.toFixed(2) - carlist.price = carlist.unitPrice * (carlist.discount / 10) * carlist.productCount + carlist.price = carlist.unitPrice * (carlist.discount / 10) * Number(carlist.productCount) carlist.price = carlist.price.toFixed(2) this.getAllPrice() }, @@ -6604,15 +6654,14 @@ success: function(res) { if (res.confirm) { if (that.carList.get(id).stockLogList.get(name).productCount > 0) { - that.carList.get(id).productCount -= that.carList.get(id).stockLogList.get( - name) - .productCount; + that.carList.get(id).productCount -= Number(that.carList.get(id).stockLogList.get( + name).productCount); } else { that.carList.get(id).returnCount -= Math.abs(that.carList.get(id).stockLogList .get(name).productCount); } that.carList.get(id).stockLogList.delete(name); - that.carList.get(id).price = that.carList.get(id).productCount * that.carList.get( + that.carList.get(id).price = Number(that.carList.get(id).productCount) * that.carList.get( id).unitPrice if (that.carList.get(id).stockLogList.size == 0) { @@ -6719,27 +6768,27 @@ this.$nextTick(() => { if (that.tanyue && that.tanxiaoshou) { if (that.zhiqianqiankuan > 0) { - // if (parseFloat(that.returnPay) == 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.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) @@ -6748,32 +6797,32 @@ that.yuedikou = that.shouldPay this.relPrice = 0 } - // if (that.returnPay != 0) { - // this.relPrice = this.relPrice - that.returnPay - // } + 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) { + 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 - // } + } } } @@ -6808,8 +6857,11 @@ noEarn: null } } else { + this.khName = {} this.tui.toast(res.message) } + }).catch((res) => { + this.khName = {} }) }, clearAll1() { @@ -6838,7 +6890,7 @@ id: that.khData.id, name: that.khData.name, noEarn: null - } + } || {} that.gysName = [] that.wlName = [] that.kdyName = [] @@ -6888,7 +6940,7 @@ id: that.khData.id, name: that.khData.name, noEarn: null - } + } || {} that.gysName = [] that.wlName = [] that.kdyName = [] @@ -7774,5 +7826,17 @@ .shop-popup-content { height: 900rpx; } + .yuyinluru{ + padding: 0 5px; + width: auto !important; + height: auto !important; + font-size: 24rpx; + } + .tianjiaguige{ + padding: 0 5px; + width: auto !important; + height: auto !important; + font-size: 24rpx; + } } \ No newline at end of file diff --git a/pages/inventory/inventory.vue b/pages/inventory/inventory.vue index dc89a55..973dbad 100644 --- a/pages/inventory/inventory.vue +++ b/pages/inventory/inventory.vue @@ -62,7 +62,7 @@ 暂无图片 - 货号:{{item.productSn}} + 货号:{{item.productSn==null?'':item.productSn}} 名称:{{item.productName == null?'暂无':item.productName}} 供应商:{{item.supplierName == null?'暂无':item.supplierName}} diff --git a/pages/inventory/inventoryDetail.vue b/pages/inventory/inventoryDetail.vue index 078455a..9bc5702 100644 --- a/pages/inventory/inventoryDetail.vue +++ b/pages/inventory/inventoryDetail.vue @@ -110,7 +110,7 @@ {{item.purchase.supplierName}} {{item.purchase.totalAmount}} - {{type == 0?item.purchaseDetails[0].purchasePrice:0}} + {{type == 0?(item.purchaseDetails[0].purchasePrice==null?0:item.purchaseDetails[0].purchasePrice):0}} {{type == 0?item.purchaseDetails[0].zPrice:0}} @@ -135,8 +135,8 @@ {{item.userName?item.userName:''}} - {{item.productCount?item.productCount:'0'}} - {{item.totalAmount?item.totalAmount:'0'}} + {{item.returnSaleDetailList[0].productCount?item.returnSaleDetailList[0].productCount:'0'}} + {{item.returnSaleDetailList[0].discountAmount?item.returnSaleDetailList[0].discountAmount:'0'}} {{type == 0?(item.returnSaleDetailList[0].purchasePrice?item.returnSaleDetailList[0].purchasePrice:'0'):0}} @@ -420,6 +420,13 @@ this.detailList[i].purchaseDetails[m].zPrice = this.detailList[i].purchaseDetails[m].productCount * this.detailList[i].purchaseDetails[m].purchasePrice } } + }else if(this.current==3){ + for(let i=0;i{ + this.tui.toast(res.message) + },1000) } }).catch((res) => {