diff --git a/package1/AI/AIHangOrderList.vue b/package1/AI/AIHangOrderList.vue index db37161..aeec06f 100644 --- a/package1/AI/AIHangOrderList.vue +++ b/package1/AI/AIHangOrderList.vue @@ -1004,6 +1004,8 @@ this.returnList = new Map() console.log('dataList',dataList) res.result.name = res.result.userName + res.result.id = res.result.userId + res.result.noEarn = res.result.amountOwed uni.setStorageSync('khName', JSON.stringify(res.result)) uni.setStorageSync('carList1', JSON.stringify(dataList)) uni.setStorageSync('discountAll', item.discount != null ?item.discount:10) diff --git a/package1/AI/addAiList.vue b/package1/AI/addAiList.vue index b3413b8..4a1ac4c 100644 --- a/package1/AI/addAiList.vue +++ b/package1/AI/addAiList.vue @@ -1,499 +1,116 @@ - + @@ -504,150 +121,4 @@ background: #eee; height: 100%; } - - .box { - width: 95%; - margin: 20rpx auto 0; - background: #fff; - border-radius: 10px; - padding: 10px; - } - - .bottom-btn { - position: fixed; - bottom: 0; - height: 100rpx; - background: #fff; - width: 100%; - font-size: 36rpx; - color: #fff; - display: flex; - z-index: 99 - } - - .circle { - width: 40rpx; - height: 40rpx; - text-align: center; - line-height: 40rpx; - border-radius: 40rpx; - background: blue; - color: #fff; - font-size: 22rpx; - margin-top: 20rpx; - } - - .content { - display: flex; - height: 80rpx; - line-height: 80rpx; - } - - .input-box { - width: 100%; - height: 60rpx; - line-height: 60rpx; - display: inline-block; - margin-top: 5px; - border-bottom: 1px solid #eee; - padding-left: 10px; - } - - .name-box { - width: 20%; - } - - .voice-popup-content { - align-items: center; - justify-content: center; - padding: 15px; - width: 500rpx; - border-radius: 10px; - height: 720rpx; - background-color: #fff; - } - - .voice-popup-title { - font-size: 36rpx; - font-weight: bold; - text-align: center; - position: relative; - } - - .voice-popup-container { - margin-top: 20rpx; - } - - .voice-popup-bottom { - display: flex; - height: 80rpx; - color: #fff; - line-height: 80rpx; - margin-top: 30rpx; - } - - .voice-popup-btn { - flex: 1; - text-align: center; - background: linear-gradient(90deg, #FF9797, #FFC1E0); - } - - .voice-popup-btn:last-child { - background: linear-gradient(90deg, #60F3FF, #088FEB); - } - - .voice-model { - width: 300rpx; - height: 300rpx; - display: flex; - justify-content: center; - flex-flow: column; - position: fixed; - top: 50%; - left: 50%; - background: rgba(0, 0, 0, 0.5); - border-radius: 20rpx; - color: #fff; - text-align: center; - margin-left: -150rpx; - z-index: 999; - } - - .voice-model img { - width: 200rpx; - height: 200rpx; - margin: 0 auto; - } - - .voice-btn { - position: absolute; - bottom: -250rpx; - left: 30%; - width: 180rpx; - height: 180rpx; - background: #eee; - border-radius: 50%; - } - - .mask-model { - width: 60%; - height: 100rpx; - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - margin: auto; - text-align: center; - background: rgba(0, 0, 0, 0.7); - color: #eee; - padding: 5px; - border-radius: 5px; - z-index: 99; - } - - .upload-img { - width: 160rpx; - height: 160rpx; - } \ No newline at end of file diff --git a/package1/AI/voiceInventory.vue b/package1/AI/voiceInventory.vue index 01bdf21..1b70d36 100644 --- a/package1/AI/voiceInventory.vue +++ b/package1/AI/voiceInventory.vue @@ -459,7 +459,7 @@ {{item.categoryName}} - 0) { let isArgin = false + if(that.carList.get(id.productId).stockLogList.size == 1){ + if(that.carList.get(id.productId).stockLogList.get('{"颜色":"均色","尺码":"均码"}') != null && that.carList.get(id.productId).stockLogList.get('{"颜色":"均色","尺码":"均码"}') != undefined){ + that.carList.get(id.productId).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount = 0 + } + } that.carList.forEach(function(value, key) { value.stockLogList1 = [] if (isArgin == false) { @@ -7250,6 +7255,7 @@ } }) + that.zNum = 0 // that.$nextTick(() => { // that.carList.forEach(function(value, key) { @@ -7400,6 +7406,11 @@ }) that.zNum = 0 + if(that.carList.get(id).stockLogList1.length == 1){ + if(that.carList.get(id).stockLogList1[0].attributeList == '{"颜色":"均色","尺码":"均码"}'){ + that.carList.get(id).stockLogList1[0].productCount = 0 + } + } // that.$nextTick(() => { // that.carList.forEach(function(value, key) { diff --git a/package1/index/order.vue b/package1/index/order.vue index f983886..d86fdeb 100644 --- a/package1/index/order.vue +++ b/package1/index/order.vue @@ -206,7 +206,8 @@ res.result.forEach(item => { this.tui.request("/app/return/get/" + item.id, "GET", null, false,false).then((res) => { if (res.code == 200 && res.result != null && res.result != undefined) { - for(let i=0;i - 【补】 - 【销】 + 【补】 + 【销】 {{item1.attributeList | sliceMsg}} 数量:{{item1.productCount}} @@ -117,13 +120,13 @@ - + 之前欠款 @@ -146,14 +149,26 @@ 实收金额 ¥ - {{ sales.realAmount == null ?'暂无':sales.realAmount }} + {{ sales.realAmount == null ?'暂无':sales.realAmount}} + + + + + + {{ sales.realAmount == null ?'暂无':convertToChineseNumeral(sales.realAmount)}} 已收金额 ¥ - {{ sales.alreadyEarn == null ?'暂无':sales.alreadyEarn }} + {{ sales.alreadyEarn == null ?'暂无':sales.alreadyEarn}} + + + + + + {{ sales.alreadyEarn == null ?'暂无':convertToChineseNumeral(sales.alreadyEarn) }} @@ -227,6 +242,12 @@ {{ sales.noEarn == null ?'暂无':sales.noEarn}} + + + + {{ sales.noEarn == null ?'暂无':convertToChineseNumeral(sales.noEarn)}} + + 本单余额 @@ -234,6 +255,12 @@ {{ sales.noEarn == null ?'暂无':Math.abs(sales.noEarn)}} + + + + {{ sales.noEarn == null ?'暂无':convertToChineseNumeral(Math.abs(sales.noEarn))}} + + 退货金额 @@ -358,7 +385,7 @@ @@ -434,6 +461,7 @@ + 取消订单 @@ -444,6 +472,7 @@ @click="cancelOrder('qxps')">取消配送 + @@ -459,6 +488,22 @@ + + + + + + {{qrArr[qrArr.length-1].name}} + + + + + + {{qrArr[index].name}} + + + @@ -477,7 +522,10 @@ defaultText: '贴包单', radio1: 0, bigImg: [], - shopId: '', + shopId:uni.getStorageSync('shopId'), + shopName:'', + QrUrl: '', //二维码临时存放 + newQRList: [], // 生成的二维码临时路径的数组 swiperDotIndex: 0, sex: [{ text: '是', @@ -494,7 +542,7 @@ popupShow: false, shopAddress: uni.getStorageSync('shopAddress'), shopOwnerPhone: uni.getStorageSync('shopOwnerPhone'), - shopRemark1:uni.getStorageSync('shopRemark'), + shopRemark1: uni.getStorageSync('shopRemark'), sales: {}, dealingsRecord: {}, order: {}, @@ -508,7 +556,6 @@ editNoPrice: false, newEarn: 0, shopRemark: [], - qrcodeData: '', isgys: true, printHeight: 0, isReturnPrice: 1, @@ -516,7 +563,7 @@ orderXd: [], collection: [], returnPrice: 0, - shopMoblie:'', + shopMoblie: '', returnNum: 0, lbgName: [], returnAmount: 0, @@ -524,12 +571,13 @@ changeA: '', sAmout: 0, yNum: 150, + printingMethod: '0', printTotal: 1040, deviceType: 'ios', qrArr: [], isShare: false, isDownKH: false, - userId:'', + userId: '', addressArr: [], jinjuPhone: '', //金桔家单独改成这个电话 modal_qr: false, @@ -587,8 +635,7 @@ return { title: this.shopName + '的采购单', imageUrl: 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/b28b3d46c21d4f60a334b25f56175cf3.jpg', - path: '/package1/index/orderDetail?popleType=khName&id=' + this.sales.id + '&shopId=' + uni - .getStorageSync('shopId') + '&shopName=' + this.shopName + path: '/package1/index/orderDetail?popleType=khName&id=' + this.sales.id + '&shopId=' +uni.getStorageSync('shopId') + '&shopName=' + this.shopName + '&shopOwnerPhone='+ this.shopOwnerPhone } }, onShow() { @@ -597,23 +644,18 @@ mode: 'central' }) this.lbgName = JSON.parse(JSON.stringify(this.lbgName)) - - let that = this; }, onLoad(option) { var that = this; - if (option.shopId && option.shopId != uni.getStorageSync('shopId')) { this.isDownKH = true } - this.saleId = option.id this.userId = option.userId this.isShare = option.shopId ? true : false if (option.id != null && option.id != undefined && option.id != "") { if (option.type == 'gys') { this.type = option.type; - console.log("222") this.tui.request("/app/purchase/getPurchaseAllData", "post", { id: option.id }, false, true).then((res) => { @@ -627,9 +669,8 @@ } }).catch((res) => {}) } else { - console.log("333") this.tui.request("/app/sale/get/" + option.id, "GET", { - customerId:this.userId + customerId: this.userId }, false, false).then((res) => { if (res.code == 200 && res.result != null && res.result != undefined) { this.sales = res.result.sale @@ -676,7 +717,8 @@ }).catch((res) => {}) } } - this.shopId = option.shopId || uni.getStorageSync('shopId') || "" + this.shopOwnerPhone = option.shopOwnerPhone ? option.shopOwnerPhone : uni.getStorageSync('shopOwnerPhone') + this.shopId = (option.shopId != '' && option.shopId != undefined)?option.shopId: (uni.getStorageSync('shopId') !='' &&uni.getStorageSync('shopId') !=undefined)?uni.getStorageSync('shopId'):"" this.shopName = option.shopName ? option.shopName : uni.getStorageSync('shopName') uni.getSystemInfo({ success(res) { @@ -687,26 +729,22 @@ uni.setNavigationBarTitle({ title: this.shopName }); - if(option.oneShareData){ + if (option.oneShareData) { this.isShare = true this.shopAddress = JSON.parse(option.oneShareData).shopAddress - this.shopMoblie =JSON.parse(option.oneShareData).shopMoblie || '' - }else{ + this.shopMoblie = JSON.parse(option.oneShareData).shopMoblie || '' + } else { this.analysisQrCode() } - + }, methods: { // 展示二维码 showQrcode() { - let _this = this; - this.modal_qr = true; - console.log('$refs', _this.$refs.qrcodePopup) for (let i = 0; i < _this.$refs.qrcodePopup.length; i++) { _this.$refs.qrcodePopup[i].crtQrCode() } - }, //传入组件的方法 @@ -728,7 +766,6 @@ img.productPictures.push(data) } setTimeout(res1 => { - console.log(img) that.largeImg(img) }, 400); } else { @@ -737,7 +774,6 @@ }).catch((res) => {}) }, largeImg(img) { - console.log('img', img) if (img.productPicture == null && img.productPictures == null) { this.tui.toast("暂无可展示的图片", 1000) return @@ -761,65 +797,98 @@ }, //打印小票二维码,分割二维码字符串 analysisQrCode() { - console.log("1111") let that = this; that.tui.request("/app/shop/getShopInfoById", "post", { id: this.shopId, }, false, true).then((res) => { if (res.code == 200) { + // 客户上传的二维码走这里 + // 判断res.result.shopIcon.indexOf('@_@') != -1 + // 通过@_@符号区分,拿到二维码后,通过下面的方法处理试试行不行 + /* x: 文字方块左上角X座标,单位dot + y: 文字方块左上角Y座标,单位dot + data{ + threshold,// 0/1提取的灰度级 + width,//图像宽度 + height,//图像高度 + imageData , //图像数据 + } + */ + // blesdk.addCPCLImageCmd(x,y,data) + // uni.downloadFile({ + // url: imgA, + // success: (res2) => { + + // } + // }); + + // end + this.printingMethod = res.result.printingMethod == null ? '0' : res.result.printingMethod; this.shopName = res.result.shopName; - console.log(this.shopName) this.shopRemark = res.result.remark.split('\n'); - console.log('shopRemark', this.shopRemark) + this.shopAddress = res.result.shopAddress + this.shopRemark1 = res.result.remark this.jinjuPhone = res.result.contactPhone let qrCode = res.result.shopIcon - // let qrCode = '店铺https://u.wechat.com/EOzom56XQ_1MKeVPPqgwMlI?uVsMiaUpfpOk8MxSE19t4ao0TCVrd,微信wxp://f2f0QYU_-Jjd882vOWEqu7GA8F9Vbo_ftIqsS9muVsMiaUpfpOk8MxSE19t4ao0TCVrd,收款https://life.qujie365.com/smpay/unionpay/index.html?qrcode=80000013007399283719457' - if (qrCode != '') { + // let qrCode = + // '田一@_@https://u.wechat.com/EOzom56XQ_1MKeVPPqgwMlI?uVsMiaUpfpOk8MxSE19t4ao0TCVrd' + if (qrCode != '') { let data = qrCode.split(',') for (let i = 0; i < data.length; i++) { - var weixin = data[i].indexOf("微信"); - var dianpu = data[i].indexOf("店铺"); - var zifubao = data[i].indexOf("支付"); - var yinlian = data[i].indexOf("收款"); - if (dianpu != -1) { - var result = data[i].substring(dianpu + 2); + if (qrCode.indexOf('@_@') != -1) { let obj = { - name: '店铺微信', - path: result, + name: data[i].split('@_@')[0], + path: data[i].split('@_@')[1], level: "M" } this.qrArr.push(obj) - } - if (weixin != -1) { - var result = data[i].substring(weixin + 2); - let obj = { - name: '微信收款码', - path: result, - level: "M" + } else { + var weixin = data[i].indexOf("微信"); + var dianpu = data[i].indexOf("店铺"); + var zifubao = data[i].indexOf("支付"); + var yinlian = data[i].indexOf("收款"); + if (dianpu != -1) { + var result = data[i].substring(dianpu + 2); + let obj = { + name: '店铺微信', + path: result, + level: "M" + } + this.qrArr.push(obj) } - this.qrArr.push(obj) - } - if (zifubao != -1) { - var result = data[i].substring(zifubao + 2); - let obj = { - name: '支付宝收款码', - path: result, - level: "Q" + if (weixin != -1) { + var result = data[i].substring(weixin + 2); + let obj = { + name: '微信收款码', + path: result, + level: "M" + } + this.qrArr.push(obj) } - this.qrArr.push(obj) - } - if (yinlian != -1) { - var result = data[i].substring(yinlian + 2); - let obj = { - name: '银行收款码', - path: result, - level: "M" + if (zifubao != -1) { + var result = data[i].substring(zifubao + 2); + let obj = { + name: '支付宝收款码', + path: result, + level: "Q" + } + this.qrArr.push(obj) + } + if (yinlian != -1) { + var result = data[i].substring(yinlian + 2); + let obj = { + name: '银行收款码', + path: result, + level: "M" + } + this.qrArr.push(obj) } - this.qrArr.push(obj) } } setTimeout(res => { - that.showQrcode(); + if(this.qrArr.length > 0){ + that.getQRCode(); + } }, 1000) } } @@ -856,7 +925,6 @@ }, getPrintHeight() { let that = this; - console.log('newData', that.newData) this.printHeight = 960 for (let i = 0; i < that.newData.length; i++) { this.printHeight += 40 @@ -874,6 +942,28 @@ this.printHeight += 100 } }, + //生成二维码 + getQRCode() { + let that = this + for (let i = 0; i < that.qrArr.length; i++) { + setTimeout(res1 => { + that.QrUrl = that.qrArr[i].path + let data = { + name:that.qrArr[i].name, + path:"" + } + this.$refs.uqrcode.toTempFilePath({ + success: res => { + data.path = res.tempFilePath + that.newQRList.push(data) + }, + fail: err => { + console.log('err', err); + } + }); + }, 1000 * i) + } + }, splitTextIntoChunks(text, chunkSize) { let result = []; for (let i = 0; i < text.length; i += chunkSize) { @@ -881,18 +971,21 @@ } this.$nextTick(() => { this.addressArr = result - console.log('addressArr', this.addressArr) }) }, //打印小票 onPrintSmall() { let that = this; - console.log('printHeight', this.printHeight) let strCmd = '' let pageNum = 1 let Xindex = 0 - that.yNum = 405 + if (this.printingMethod == '0') { + that.yNum = 405 + } else { + that.yNum = 350 + } + strCmd = blesdk.CreatCPCLPage(1080, this.printHeight >= (1990 * pageNum) ? 1990 : this.printHeight, 1, 0, 0); strCmd += blesdk.addCPCLSETMAG(4, 4) @@ -909,13 +1002,16 @@ strCmd += blesdk.addCPCLText('500', '300', '24', '0', 0, '单号:' + that.sales.id) strCmd += blesdk.addCPCLText('0', '350', '24', '0', 0, '销售员:' + that.sales.createByName) strCmd += blesdk.addCPCLText('500', '350', '24', '0', 0, '日期:' + that.sales.createTime) - strCmd += blesdk.addCPCLText('0', '390', '24', '0', 0, - '-----------------------------------------------------------------------------------') - strCmd += blesdk.addCPCLText('10', that.yNum += 40, '24', '0', 0, '货号(名称)') - strCmd += blesdk.addCPCLText('320', that.yNum, '24', '0', 0, '规格') - strCmd += blesdk.addCPCLText('520', that.yNum, '24', '0', 0, '数量') - strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, '单价') - strCmd += blesdk.addCPCLText('720', that.yNum, '24', '0', 0, '总价') + + if (this.printingMethod == '0') { + strCmd += blesdk.addCPCLText('0', '390', '24', '0', 0, + '-----------------------------------------------------------------------------------') + strCmd += blesdk.addCPCLText('10', that.yNum += 40, '24', '0', 0, '货号(名称)') + strCmd += blesdk.addCPCLText('320', that.yNum, '24', '0', 0, '规格') + strCmd += blesdk.addCPCLText('520', that.yNum, '24', '0', 0, '数量') + strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, '单价') + strCmd += blesdk.addCPCLText('720', that.yNum, '24', '0', 0, '总价') + } for (var i = 0; i < that.newData.length; i++) { if (that.yNum + 25 >= 1990) { strCmd += blesdk.addCPCLPrint(); @@ -933,297 +1029,444 @@ '-----------------------------------------------------------------------------------') } - if (that.yNum + 64 >= 1990) { + if (this.printingMethod == '1') { + if (that.yNum + 64 >= 1990) { + strCmd += blesdk.addCPCLPrint(); + that.bufferData.push(strCmd); + strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : ( + this.printHeight - that.yNum + 64), 1, 0, 162); + that.yNum = 0 - strCmd += blesdk.addCPCLPrint(); - that.bufferData.push(strCmd); + pageNum++ - strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : (this - .printHeight - that.yNum + 64), 1, 0, 162); - that.yNum = 0 - pageNum++ - console.log('商品pageNum', pageNum) + } + if (that.newData[i].productName == that.newData[i].productSn) { + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, that + .newData[i].productSn) + } else { + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, that + .newData[i].productSn + '(' + (that.newData[i] + .productName == null ? '' : that.newData[i].productName) + ')') + } + let colorHeight = 64 + if(that.shopId == '1822829636942434305' || that.shopId == + '1818888277105709056'){ + colorHeight = 80 + } + if (that.yNum + colorHeight >= 1990) { + strCmd += blesdk.addCPCLPrint(); + that.bufferData.push(strCmd); + strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + colorHeight) >= 1990 ? 1990 : ( + this.printHeight - that.yNum + colorHeight), 1, 0, 162); + that.yNum = 0 + + pageNum++ - console.log('规格', that.yNum) - - for (var m = 0; m < that.newData[i].stockLogList1.length; m++) { - if (that.yNum + 64 >= 1990) { + } + + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '颜色') + let startWith = 180 + for (let a = 0; a < that.newData[i].sizeList.length; a++) { + if ((that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056') && that + .newData[i].sizeList[a] == '均') { + that.newData[i].sizeList[a] = '分码' + } + strCmd += blesdk.addCPCLSETBOLD('400') + let fountSize = '0' + let widthSize = 420 + if(that.shopId == '1822829636942434305' || that.shopId == + '1818888277105709056'){ + fountSize = '1' + widthSize = 470 + } + strCmd += blesdk.addCPCLText(startWith.toString(), that.yNum, '24', fountSize, 0, that.newData[i] + .sizeList[a]) + strCmd += blesdk.addCPCLSETBOLD('0') + startWith += Math.floor(widthSize / 8) + } + strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, '数量') + strCmd += blesdk.addCPCLText('644', that.yNum, '24', '0', 0, '单价') + strCmd += blesdk.addCPCLText('720', that.yNum, '24', '0', 0, '总价') + let begin = 0 + that.newData[i].sizePrintList.forEach(function(value, key) { + let colorHeight = 64 + if(that.shopId == '1822829636942434305' || that.shopId == + '1818888277105709056'){ + colorHeight = 80 + } + if (that.yNum + colorHeight >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); - strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : ( - this.printHeight - that.yNum + 64), 1, 0, 162); + strCmd = blesdk.CreatCPCLPage(1080, (that.printHeight - that.yNum + colorHeight) >= + 1990 ? 1990 : ( + that.printHeight - that.yNum + colorHeight), 1, 0, 162); that.yNum = 0 - pageNum++ - console.log('规格pageNum', pageNum) - if (that.newData[i].stockLogList1[m].isReturn) { - if (that.newData[i].productName == that.newData[i].productSn) { - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【退】' + that - .newData[i].productSn) - } else { - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【退】' + that - .newData[i].productSn + - '(' + (that.newData[i] - .productName == null ? '' : that.newData[i].productName) + ')') - } - } else { - if (that.newData[i].productName == that.newData[i].productSn && that.order.name != - '散客') { - if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1) { //买过 - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【补】' + that - .newData[i].productSn) - } else { // 0是没买过 - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【销】' + that + + } + if ((that.shopId == '1820269107191353344' || that.shopId == + '1818888277105709056') && key == '均色') { + key = '分色' + } + let beginHeight = 40 + let widthSize = 420 + if((that.shopId == '1822829636942434305' || that.shopId == + '1818888277105709056') && begin ==0 ){ + beginHeight = 58 + } + begin++ + if(that.shopId == '1822829636942434305' || that.shopId == + '1818888277105709056'){ + widthSize = 470 + } + strCmd += blesdk.addCPCLText('0', that.yNum += beginHeight, '24', '0', 0, key) + let childStartWith = 180 + let allCount = 0 + let discountAmount = 0 + for (let a = 0; a < that.newData[i].sizeList.length; a++) { + let printSizeCount = [] + if(that.newData[i].sizeList[a] == '分码'){ + that.newData[i].sizeList[a] = '均' + } + if (value.has(that.newData[i].sizeList[a])) { + printSizeCount = value.get(that.newData[i].sizeList[a]).split(':') + discountAmount = printSizeCount[1] == undefined ? '' : printSizeCount[1] + } + allCount += printSizeCount[0] == undefined ? 0 : Number(printSizeCount[0]) + strCmd += blesdk.addCPCLText(childStartWith.toString(), that.yNum, '24', '0', + 0, printSizeCount[0] == undefined ? '' : Number(printSizeCount[0])) + childStartWith += Math.floor(widthSize / 8) + } + strCmd += blesdk.addCPCLText('578', that.yNum, '24', '0', 0, allCount) + strCmd += blesdk.addCPCLText('644', that.yNum, '24', '0', 0, discountAmount) + strCmd += blesdk.addCPCLText('720', that.yNum, '24', '0', 0, (allCount * + discountAmount)) + + }) + } else { + if (that.yNum + 64 >= 1990) { + strCmd += blesdk.addCPCLPrint(); + that.bufferData.push(strCmd); + strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : (this + .printHeight - that.yNum + 64), 1, 0, 162); + that.yNum = 0 + pageNum++ + + for (var m = 0; m < that.newData[i].stockLogList1.length; m++) { + if (that.yNum + 64 >= 1990) { + strCmd += blesdk.addCPCLPrint(); + that.bufferData.push(strCmd); + strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? + 1990 : ( + this.printHeight - that.yNum + 64), 1, 0, 162); + that.yNum = 0 + + pageNum++ + if (that.newData[i].stockLogList1[m].isReturn) { + if (that.newData[i].productName == that.newData[i].productSn) { + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + + '.' + '【退】' + that .newData[i].productSn) + } else { + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + + '.' + '【退】' + that + .newData[i].productSn + + '(' + (that.newData[i] + .productName == null ? '' : that.newData[i].productName) + ')') } } else { - if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != - '散客') { //买过 - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【补】' + that - .newData[i].productSn + '(' + (that.newData[i] - .productName == null ? '' : that.newData[i].productName) + ')') - } else { // 0是没买过 - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【销】' + that - .newData[i].productSn + '(' + (that.newData[i] - .productName == null ? '' : that.newData[i].productName) + ')') + if (that.newData[i].productName == that.newData[i].productSn && that.order.name != + '散客') { + if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1) { //买过 + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【补】' + that + .newData[i].productSn) + } else { // 0是没买过 + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【销】' + that + .newData[i].productSn) + } + } else { + if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order + .name != + '散客') { //买过 + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【补】' + that + .newData[i].productSn + '(' + (that.newData[i] + .productName == null ? '' : that.newData[i].productName) + ')') + } else { // 0是没买过 + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【销】' + that + .newData[i].productSn + '(' + (that.newData[i] + .productName == null ? '' : that.newData[i].productName) + ')') + } } } - } - if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056') { - if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) { - that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m] - .attributeList.replace(/均色/g, '分色') - } - if (that.newData[i].stockLogList1[m].attributeList.indexOf('均码') != -1) { - that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m] - .attributeList.replace(/均码/g, '分码') + if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056') { + if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) { + that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[ + m] + .attributeList.replace(/均色/g, '分色') + } + if (that.newData[i].stockLogList1[m].attributeList.indexOf('均码') != -1) { + that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[ + m] + .attributeList.replace(/均码/g, '分码') + } } - } - strCmd += blesdk.addCPCLText('320', that.yNum, '24', '0', 0, that - .slicePrint(that.newData[i].stockLogList1[m].attributeList)) - - strCmd += blesdk.addCPCLText('520', that.yNum, '24', '0', 0, that.newData[i] - .stockLogList1[m].productCount) - if (that.newData[i].stockLogList1[m].isReturn) { - strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, that.newData[i] - .stockLogList1[m].discountAmount) - } else { - strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, that.newData[i] - .discountAmount) - } - - strCmd += blesdk.addCPCLText('720', that.yNum, '24', '0', 0, (that.newData[i] - .discountAmount * that.newData[i].stockLogList1[m].productCount)) - console.log('【销】', that.yNum) - } else { - console.log('规格不等于pageNum', pageNum) - if (that.newData[i].stockLogList1[m].isReturn) { - if (that.newData[i].productName == that.newData[i].productSn) { - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【退】' + that - .newData[i].productSn) + strCmd += blesdk.addCPCLText('320', that.yNum, '24', '0', 0, that + .slicePrint(that.newData[i].stockLogList1[m].attributeList)) + + strCmd += blesdk.addCPCLText('520', that.yNum, '24', '0', 0, that.newData[i] + .stockLogList1[m].productCount) + if (that.newData[i].stockLogList1[m].isReturn) { + strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, that.newData[i] + .stockLogList1[m].discountAmount) } else { - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【退】' + that - .newData[i].productSn + - '(' + (that.newData[i] - .productName == null ? '' : that.newData[i].productName) + ')') + strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, that.newData[i] + .discountAmount) } + + strCmd += blesdk.addCPCLText('720', that.yNum, '24', '0', 0, (that.newData[i] + .discountAmount * that.newData[i].stockLogList1[m].productCount)) } else { - if (that.newData[i].productName == that.newData[i].productSn && that.order.name != - '散客') { - if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1) { //买过 - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【补】' + that - .newData[i].productSn) - } else { // 0是没买过 - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【销】' + that + if (that.newData[i].stockLogList1[m].isReturn) { + if (that.newData[i].productName == that.newData[i].productSn) { + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + + '.' + '【退】' + that .newData[i].productSn) + } else { + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + + '.' + '【退】' + that + .newData[i].productSn + + '(' + (that.newData[i] + .productName == null ? '' : that.newData[i].productName) + ')') } } else { - if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != - '散客') { //买过 - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【补】' + that - .newData[i].productSn + '(' + (that.newData[i] - .productName == null ? '' : that.newData[i].productName) + ')') - } else { // 0是没买过 - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【销】' + that - .newData[i].productSn + '(' + (that.newData[i] - .productName == null ? '' : that.newData[i].productName) + ')') + if (that.newData[i].productName == that.newData[i].productSn && that.order.name != + '散客') { + if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1) { //买过 + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【补】' + that + .newData[i].productSn) + } else { // 0是没买过 + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【销】' + that + .newData[i].productSn) + } + } else { + if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order + .name != + '散客') { //买过 + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【补】' + that + .newData[i].productSn + '(' + (that.newData[i] + .productName == null ? '' : that.newData[i].productName) + ')') + } else { // 0是没买过 + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【销】' + that + .newData[i].productSn + '(' + (that.newData[i] + .productName == null ? '' : that.newData[i].productName) + ')') + } } } - } - if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056') { - if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) { - that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m] - .attributeList.replace(/均色/g, '分色') + if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056') { + if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) { + that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[ + m] + .attributeList.replace(/均色/g, '分色') + } + if (that.newData[i].stockLogList1[m].attributeList.indexOf('均码') != -1) { + that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[ + m] + .attributeList.replace(/均码/g, '分码') + } } - if (that.newData[i].stockLogList1[m].attributeList.indexOf('均码') != -1) { - that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m] - .attributeList.replace(/均码/g, '分码') + strCmd += blesdk.addCPCLText('320', that.yNum, '24', '0', 0, that + .slicePrint(that.newData[i].stockLogList1[m].attributeList)) + + strCmd += blesdk.addCPCLText('520', that.yNum, '24', '0', 0, that.newData[i] + .stockLogList1[m].productCount) + if (that.newData[i].stockLogList1[m].isReturn) { + strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, that.newData[i] + .stockLogList1[m].discountAmount) + } else { + strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, that.newData[i] + .discountAmount) } - } - strCmd += blesdk.addCPCLText('320', that.yNum, '24', '0', 0, that - .slicePrint(that.newData[i].stockLogList1[m].attributeList)) - - strCmd += blesdk.addCPCLText('520', that.yNum, '24', '0', 0, that.newData[i] - .stockLogList1[m].productCount) - if (that.newData[i].stockLogList1[m].isReturn) { - strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, that.newData[i] - .stockLogList1[m].discountAmount) - } else { - strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, that.newData[i] - .discountAmount) + + strCmd += blesdk.addCPCLText('720', that.yNum, '24', '0', 0, (that.newData[i] + .discountAmount * that.newData[i].stockLogList1[m].productCount)) } - strCmd += blesdk.addCPCLText('720', that.yNum, '24', '0', 0, (that.newData[i] - .discountAmount * that.newData[i].stockLogList1[m].productCount)) - console.log('【销】', that.yNum) } - - } - } else { - - console.log('规格', that.yNum) - for (var m = 0; m < that.newData[i].stockLogList1.length; m++) { - if (that.yNum + 64 >= 1990) { - strCmd += blesdk.addCPCLPrint(); - that.bufferData.push(strCmd); - strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : ( - this.printHeight - that.yNum + 64), 1, 0, 162); - that.yNum = 0 - - pageNum++ - console.log('规格pageNum', pageNum) - if (that.newData[i].stockLogList1[m].isReturn) { - if (that.newData[i].productName == that.newData[i].productSn) { - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【退】' + that - .newData[i].productSn) - } else { - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【退】' + that - .newData[i].productSn + - '(' + (that.newData[i] - .productName == null ? '' : that.newData[i].productName) + ')') - } - } else { - if (that.newData[i].productName == that.newData[i].productSn) { - if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != - '散客') { //买过 - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【补】' + that - .newData[i].productSn) - } else { // 0是没买过 - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【销】' + that + } else { + for (var m = 0; m < that.newData[i].stockLogList1.length; m++) { + if (that.yNum + 64 >= 1990) { + strCmd += blesdk.addCPCLPrint(); + that.bufferData.push(strCmd); + strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? + 1990 : ( + this.printHeight - that.yNum + 64), 1, 0, 162); + that.yNum = 0 + + pageNum++ + if (that.newData[i].stockLogList1[m].isReturn) { + if (that.newData[i].productName == that.newData[i].productSn) { + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【退】' + that .newData[i].productSn) + } else { + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【退】' + that + .newData[i].productSn + + '(' + (that.newData[i] + .productName == null ? '' : that.newData[i].productName) + ')') } } else { - if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != - '散客') { //买过 - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【补】' + that - .newData[i].productSn + '(' + (that.newData[i] - .productName == null ? '' : that.newData[i].productName) + ')') - } else { // 0是没买过 - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【销】' + that - .newData[i].productSn + '(' + (that.newData[i] - .productName == null ? '' : that.newData[i].productName) + ')') + if (that.newData[i].productName == that.newData[i].productSn) { + if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order + .name != + '散客') { //买过 + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【补】' + that + .newData[i].productSn) + } else { // 0是没买过 + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【销】' + that + .newData[i].productSn) + } + } else { + if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order + .name != + '散客') { //买过 + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【补】' + that + .newData[i].productSn + '(' + (that.newData[i] + .productName == null ? '' : that.newData[i].productName) + ')') + } else { // 0是没买过 + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【销】' + that + .newData[i].productSn + '(' + (that.newData[i] + .productName == null ? '' : that.newData[i].productName) + ')') + } } } - } - if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056') { - if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) { - that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m] - .attributeList.replace(/均色/g, '分色') + if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056') { + if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) { + that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[ + m] + .attributeList.replace(/均色/g, '分色') + } + if (that.newData[i].stockLogList1[m].attributeList.indexOf('均码') != -1) { + that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[ + m] + .attributeList.replace(/均码/g, '分码') + } } - if (that.newData[i].stockLogList1[m].attributeList.indexOf('均码') != -1) { - that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m] - .attributeList.replace(/均码/g, '分码') + strCmd += blesdk.addCPCLText('320', that.yNum, '24', '0', 0, that + .slicePrint(that.newData[i].stockLogList1[m].attributeList)) + + strCmd += blesdk.addCPCLText('520', that.yNum, '24', '0', 0, that.newData[i] + .stockLogList1[m].productCount) + if (that.newData[i].stockLogList1[m].isReturn) { + strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, that.newData[i] + .stockLogList1[m].discountAmount) + } else { + strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, that.newData[i] + .discountAmount) } - } - strCmd += blesdk.addCPCLText('320', that.yNum, '24', '0', 0, that - .slicePrint(that.newData[i].stockLogList1[m].attributeList)) - - strCmd += blesdk.addCPCLText('520', that.yNum, '24', '0', 0, that.newData[i] - .stockLogList1[m].productCount) - if (that.newData[i].stockLogList1[m].isReturn) { - strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, that.newData[i] - .stockLogList1[m].discountAmount) - } else { - strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, that.newData[i] - .discountAmount) - } - strCmd += blesdk.addCPCLText('720', that.yNum, '24', '0', 0, (that.newData[i] - .discountAmount * that.newData[i].stockLogList1[m].productCount)) - console.log('【销】', that.yNum) + strCmd += blesdk.addCPCLText('720', that.yNum, '24', '0', 0, (that.newData[i] + .discountAmount * that.newData[i].stockLogList1[m].productCount)) - } else { - console.log('规格不等于pageNum', pageNum) - if (that.newData[i].stockLogList1[m].isReturn) { - if (that.newData[i].productName == that.newData[i].productSn) { - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【退】' + that - .newData[i].productSn) - } else { - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【退】' + that - .newData[i].productSn + - '(' + (that.newData[i] - .productName == null ? '' : that.newData[i].productName) + ')') - } } else { - if (that.newData[i].productName == that.newData[i].productSn) { - if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != - '散客') { //买过 - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【补】' + that - .newData[i].productSn) - } else { // 0是没买过 - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【销】' + that + if (that.newData[i].stockLogList1[m].isReturn) { + if (that.newData[i].productName == that.newData[i].productSn) { + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【退】' + that .newData[i].productSn) + } else { + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【退】' + that + .newData[i].productSn + + '(' + (that.newData[i] + .productName == null ? '' : that.newData[i].productName) + ')') } } else { - if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != - '散客') { //买过 - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【补】' + that - .newData[i].productSn + '(' + (that.newData[i] - .productName == null ? '' : that.newData[i].productName) + ')') - } else { // 0是没买过 - strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex +=1)+'.'+'【销】' + that - .newData[i].productSn + '(' + (that.newData[i] - .productName == null ? '' : that.newData[i].productName) + ')') + if (that.newData[i].productName == that.newData[i].productSn) { + if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order + .name != + '散客') { //买过 + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【补】' + that + .newData[i].productSn) + } else { // 0是没买过 + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【销】' + that + .newData[i].productSn) + } + } else { + if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order + .name != + '散客') { //买过 + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【补】' + that + .newData[i].productSn + '(' + (that.newData[i] + .productName == null ? '' : that.newData[i].productName) + ')') + } else { // 0是没买过 + strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, (Xindex += + 1) + '.' + '【销】' + that + .newData[i].productSn + '(' + (that.newData[i] + .productName == null ? '' : that.newData[i].productName) + ')') + } } } - } - if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056') { - if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) { - that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m] - .attributeList.replace(/均色/g, '分色') - } - if (that.newData[i].stockLogList1[m].attributeList.indexOf('均码') != -1) { - that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m] - .attributeList.replace(/均码/g, '分码') + if (that.shopId == '1820269107191353344' || that.shopId == '1818888277105709056') { + if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) { + that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[ + m] + .attributeList.replace(/均色/g, '分色') + } + if (that.newData[i].stockLogList1[m].attributeList.indexOf('均码') != -1) { + that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[ + m] + .attributeList.replace(/均码/g, '分码') + } } - } - strCmd += blesdk.addCPCLText('320', that.yNum, '24', '0', 0, that - .slicePrint(that.newData[i].stockLogList1[m].attributeList)) + strCmd += blesdk.addCPCLText('320', that.yNum, '24', '0', 0, that + .slicePrint(that.newData[i].stockLogList1[m].attributeList)) - strCmd += blesdk.addCPCLText('520', that.yNum, '24', '0', 0, that.newData[i] - .stockLogList1[m].productCount) - if (that.newData[i].stockLogList1[m].isReturn) { - strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, that.newData[i] - .stockLogList1[m].discountAmount) - } else { - strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, that.newData[i] - .discountAmount) - } + strCmd += blesdk.addCPCLText('520', that.yNum, '24', '0', 0, that.newData[i] + .stockLogList1[m].productCount) + if (that.newData[i].stockLogList1[m].isReturn) { + strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, that.newData[i] + .stockLogList1[m].discountAmount) + } else { + strCmd += blesdk.addCPCLText('620', that.yNum, '24', '0', 0, that.newData[i] + .discountAmount) + } - strCmd += blesdk.addCPCLText('720', that.yNum, '24', '0', 0, (that.newData[i] - .discountAmount * that.newData[i].stockLogList1[m].productCount)) - console.log('【销】', that.yNum) + strCmd += blesdk.addCPCLText('720', that.yNum, '24', '0', 0, (that.newData[i] + .discountAmount * that.newData[i].stockLogList1[m].productCount)) + } } - } + + } } + } // strCmd += blesdk.addCPCLPrint(); // that.bufferData.push(strCmd); @@ -1233,12 +1476,12 @@ if (that.yNum + 25 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); - + strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 25) >= 1990 ? 1990 : (this .printHeight - that.yNum + 25), 1, 0, 162); that.yNum = 0 pageNum++ - + strCmd += blesdk.addCPCLText('0', that.yNum += 25, '24', '0', 0, '-----------------------------------------------------------------------------------') } else { @@ -1272,8 +1515,6 @@ .balanceDeductionAmount)) // strCmd += blesdk.addCPCLText('600', (that.yNum - 20), '24', '0', 0, '本单实收:' + that.sales.alreadyEarn) } - - console.log('销售数量', that.yNum) strCmd += blesdk.addCPCLSETMAG(1, 1) if (that.yNum + 54 >= 1990) { strCmd += blesdk.addCPCLPrint(); @@ -1291,8 +1532,6 @@ strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice) strCmd += blesdk.addCPCLText('580', that.yNum, '24', '0', 0, '其他费用:' + (that.sales.otherExpense)) } - - console.log('退货数量', that.yNum) if (that.yNum + 54 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); @@ -1335,8 +1574,6 @@ strCmd += blesdk.addCPCLText('580', (that.yNum), '24', '0', 0, '之前欠款:0') } } - - console.log('欠款抵退货', that.yNum) strCmd += blesdk.addCPCLSETMAG(1, 1) if (that.yNum + 54 >= 1990) { strCmd += blesdk.addCPCLPrint(); @@ -1402,77 +1639,79 @@ strCmd += blesdk.addCPCLText('580', that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales .alreadyEarn) } - }else if(this.shopId == '1821406205034237952' || this.shopId == '1810179818189361152') { //董大姐 + } else if (this.shopId == '1821406205034237952' || this.shopId == '1810179818189361152') { //董大姐 if (that.yNum + 64 >= 1990 * pageNum) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); - + strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : (this .printHeight - that.yNum + 64), 1, 0, 162); that.yNum = 0 pageNum++ strCmd += blesdk.addCPCLSETMAG(1, 1) strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '合计:') - strCmd += blesdk.addCPCLText('520', that.yNum, '24', '0', 0, that.sales.productCount+'件') - strCmd += blesdk.addCPCLText('700', that.yNum, '24', '0', 0, '¥'+that.sales.totalAmount) + strCmd += blesdk.addCPCLText('520', that.yNum, '24', '0', 0, that.sales.productCount + '件') + strCmd += blesdk.addCPCLText('700', that.yNum, '24', '0', 0, '¥' + that.sales.totalAmount) } else { strCmd += blesdk.addCPCLSETMAG(1, 1) strCmd += blesdk.addCPCLText('0', that.yNum += 40, '24', '0', 0, '合计:') - strCmd += blesdk.addCPCLText('520', that.yNum, '24', '0', 0, that.sales.productCount+'件') - strCmd += blesdk.addCPCLText('700', that.yNum, '24', '0', 0, '¥'+that.sales.totalAmount) + strCmd += blesdk.addCPCLText('520', that.yNum, '24', '0', 0, that.sales.productCount + '件') + strCmd += blesdk.addCPCLText('700', that.yNum, '24', '0', 0, '¥' + that.sales.totalAmount) } if (that.yNum + 60 >= 1990 * pageNum) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); - + strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 60) >= 1990 ? 1990 : (this .printHeight - that.yNum + 60), 1, 0, 162); that.yNum = 0 pageNum++ strCmd += blesdk.addCPCLSETMAG(1, 2) - strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单应收:' +that.sales.realAmount +'('+ this.convertToChineseNumeral(that.sales.realAmount)+')') + strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单应收:' + that.sales.realAmount + + '(' + this.convertToChineseNumeral(that.sales.realAmount) + ')') } else { strCmd += blesdk.addCPCLSETMAG(1, 2) - strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单应收:' +that.sales.realAmount +'('+ this.convertToChineseNumeral(that.sales.realAmount)+')') + strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单应收:' + that.sales.realAmount + + '(' + this.convertToChineseNumeral(that.sales.realAmount) + ')') } - if (that.yNum + 60 >= 1990) { + if (that.yNum + 60 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); - + strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 60) >= 1990 ? 1990 : (this .printHeight - that.yNum + 60), 1, 0, 162); that.yNum = 0 pageNum++ - + strCmd += blesdk.addCPCLSETMAG(1, 2) strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales - .alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn)+ ')') + .alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn) + ')') } else { strCmd += blesdk.addCPCLSETMAG(1, 2) - + strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales - .alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn)+ ')') + .alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn) + ')') } if (that.yNum + 60 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); - + strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 60) >= 1990 ? 1990 : (this .printHeight - that.yNum + 60), 1, 0, 162); that.yNum = 0 pageNum++ strCmd += blesdk.addCPCLSETMAG(1, 2) if (that.dealingsRecord.lastDebtAmount >= 0) { - strCmd += blesdk.addCPCLText('0', that.yNum+=60, '24', '0', 0, '之前欠款:' + that.dealingsRecord + strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '之前欠款:' + that.dealingsRecord .lastDebtAmount) } else if (that.dealingsRecord.lastDebtAmount < 0) { - strCmd += blesdk.addCPCLText('0', that.yNum+=60, '24', '0', 0, '之前余额:' + Math.abs(that + strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '之前余额:' + Math.abs(that .dealingsRecord .lastDebtAmount)) } else { - strCmd += blesdk.addCPCLText('0', that.yNum+=60, '24', '0', 0, '之前欠款:0') + strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '之前欠款:0') } - + if (that.dealingsRecord.balanceDue >= 0) { strCmd += blesdk.addCPCLText('540', that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord .balanceDue) @@ -1485,16 +1724,17 @@ } else { strCmd += blesdk.addCPCLSETMAG(1, 2) if (that.dealingsRecord.lastDebtAmount >= 0) { - strCmd += blesdk.addCPCLText('0', (that.yNum+=60), '24', '0', 0, '之前欠款:' + that.dealingsRecord + strCmd += blesdk.addCPCLText('0', (that.yNum += 60), '24', '0', 0, '之前欠款:' + that + .dealingsRecord .lastDebtAmount) } else if (that.dealingsRecord.lastDebtAmount < 0) { - strCmd += blesdk.addCPCLText('0', (that.yNum+=60), '24', '0', 0, '之前余额:' + Math.abs(that + strCmd += blesdk.addCPCLText('0', (that.yNum += 60), '24', '0', 0, '之前余额:' + Math.abs(that .dealingsRecord .lastDebtAmount)) } else { - strCmd += blesdk.addCPCLText('0', (that.yNum+=60), '24', '0', 0, '之前欠款:0') + strCmd += blesdk.addCPCLText('0', (that.yNum += 60), '24', '0', 0, '之前欠款:0') } - + if (that.dealingsRecord.balanceDue >= 0) { strCmd += blesdk.addCPCLText('540', that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord .balanceDue) @@ -1508,7 +1748,7 @@ if (that.yNum + 60 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); - + strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 60) >= 1990 ? 1990 : (this .printHeight - that.yNum + 60), 1, 0, 162); that.yNum = 0 @@ -1521,43 +1761,39 @@ strCmd += blesdk.addCPCLText('0', that.yNum += 60, '24', '0', 0, '-----------------------------------------------------------------------------------') } - - console.log('销售数量', that.yNum) strCmd += blesdk.addCPCLSETMAG(1, 1) - - if (that.yNum + 30 >= 1990) { - strCmd += blesdk.addCPCLPrint(); - that.bufferData.push(strCmd); - - strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 30) >= 1990 ? 1990 : (this - .printHeight - that.yNum + 30), 1, 0, 162); - that.yNum = 0 - pageNum++ - if (that.sales.noEarn >= 0) { - strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '本单欠款:' + (that.sales.noEarn)) - } else { - strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '本单余额:' + Math.abs(that.sales - .noEarn)) - } - if(that.returnPrice > 0){ - strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '退货数量:' + that.returnNum) - strCmd += blesdk.addCPCLText('580', that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice) - } + + if (that.yNum + 30 >= 1990) { + strCmd += blesdk.addCPCLPrint(); + that.bufferData.push(strCmd); + + strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 30) >= 1990 ? 1990 : (this + .printHeight - that.yNum + 30), 1, 0, 162); + that.yNum = 0 + pageNum++ + if (that.sales.noEarn >= 0) { + strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '本单欠款:' + (that.sales.noEarn)) } else { - if (that.sales.noEarn >= 0) { - strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '本单欠款:' + (that.sales.noEarn)) - } else { - strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '本单余额:' + Math.abs(that.sales - .noEarn)) - } - if(that.returnPrice > 0){ - strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '退货数量:' + that.returnNum) - strCmd += blesdk.addCPCLText('580', that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice) - } + strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '本单余额:' + Math.abs(that.sales + .noEarn)) } - - console.log('退货数量', that.yNum) - + if (that.returnPrice > 0) { + strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '退货数量:' + that.returnNum) + strCmd += blesdk.addCPCLText('580', that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice) + } + } else { + if (that.sales.noEarn >= 0) { + strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '本单欠款:' + (that.sales.noEarn)) + } else { + strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '本单余额:' + Math.abs(that.sales + .noEarn)) + } + if (that.returnPrice > 0) { + strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '退货数量:' + that.returnNum) + strCmd += blesdk.addCPCLText('580', that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice) + } + } + } else { if (that.yNum + 84 >= 1990 * pageNum) { strCmd += blesdk.addCPCLPrint(); @@ -1583,8 +1819,6 @@ .balanceDeductionAmount)) // strCmd += blesdk.addCPCLText('600', (that.yNum - 20), '24', '0', 0, '本单实收:' + that.sales.alreadyEarn) } - - console.log('销售数量', that.yNum) strCmd += blesdk.addCPCLSETMAG(1, 1) if (that.yNum + 84 >= 1990) { strCmd += blesdk.addCPCLPrint(); @@ -1602,8 +1836,6 @@ strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice) strCmd += blesdk.addCPCLText('610', that.yNum, '24', '0', 0, '其他费用:' + (that.sales.otherExpense)) } - - console.log('退货数量', that.yNum) if (that.yNum + 84 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); @@ -1648,8 +1880,6 @@ } } - console.log('欠款抵退货', that.yNum) - if (that.yNum + 94 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); @@ -1659,19 +1889,21 @@ that.yNum = 0 pageNum++ strCmd += blesdk.addCPCLSETMAG(1, 2) - strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单应收:' + that.sales.realAmount+'('+that.convertToChineseNumeral(that.sales.realAmount)+')') + strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单应收:' + that.sales.realAmount + + '(' + that.convertToChineseNumeral(that.sales.realAmount) + ')') strCmd += blesdk.addCPCLText('610', that.yNum, '24', '0', 0, '本单实收:' + that.sales.alreadyEarn) - + } else { strCmd += blesdk.addCPCLSETMAG(1, 2) - strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单应收:' + that.sales.realAmount+'(' + that.convertToChineseNumeral(that.sales.realAmount)+')') + strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单应收:' + that.sales.realAmount + + '(' + that.convertToChineseNumeral(that.sales.realAmount) + ')') strCmd += blesdk.addCPCLText('610', that.yNum, '24', '0', 0, '本单实收:' + that.sales.alreadyEarn) - + } - + if (that.yNum + 114 >= 1990) { - + strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); @@ -1681,10 +1913,11 @@ pageNum++ strCmd += blesdk.addCPCLSETMAG(1, 2) if (that.sales.noEarn >= 0) { - strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单欠款:' + that.sales.noEarn + '('+ that.convertToChineseNumeral(that.sales.noEarn) +')') + strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单欠款:' + that.sales.noEarn + + '(' + that.convertToChineseNumeral(that.sales.noEarn) + ')') } else { strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单余额:' + Math.abs(that.sales - .noEarn) + '('+ that.convertToChineseNumeral(Math.abs(that.sales.noEarn)) +')') + .noEarn) + '(' + that.convertToChineseNumeral(Math.abs(that.sales.noEarn)) + ')') } if (that.dealingsRecord.balanceDue >= 0) { strCmd += blesdk.addCPCLText('610', that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord @@ -1698,10 +1931,11 @@ } else { strCmd += blesdk.addCPCLSETMAG(1, 2) if (that.sales.noEarn >= 0) { - strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单欠款:' + (that.sales.noEarn) + '('+ that.convertToChineseNumeral(that.sales.noEarn) +')') + strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单欠款:' + (that.sales + .noEarn) + '(' + that.convertToChineseNumeral(that.sales.noEarn) + ')') } else { strCmd += blesdk.addCPCLText('0', that.yNum += 70, '24', '0', 0, '本单余额:' + Math.abs(that.sales - .noEarn) + '('+ that.convertToChineseNumeral(Math.abs(that.sales.noEarn)) +')') + .noEarn) + '(' + that.convertToChineseNumeral(Math.abs(that.sales.noEarn)) + ')') } if (that.dealingsRecord.balanceDue >= 0) { strCmd += blesdk.addCPCLText('610', that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord @@ -1714,7 +1948,7 @@ } } } - + if (that.yNum + 40 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); @@ -1804,7 +2038,7 @@ } else { strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '店铺电话:' + this.jinjuPhone) } - }else if (this.shopId == '1834512626093264897' || this.shopId == '1810179818189361152') { + } else if (this.shopId == '1834512626093264897' || this.shopId == '1810179818189361152') { if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); @@ -1876,11 +2110,11 @@ } } } - + if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); - + strCmd = blesdk.CreatCPCLPage(1080, (this.printHeight - that.yNum + 64) >= 1990 ? 1990 : (this .printHeight - that.yNum + 64), 1, 0, 162); that.yNum = 0 @@ -1906,19 +2140,19 @@ if (i == 0) { strCmd += blesdk.addCPCLSETMAG(1, 1) strCmd += blesdk.addCPCLText(that.countWidth(i, 900 / that.qrArr.length), (that.yNum += - 40),'24','0', 0, that.qrArr[i].name) + 40), '24', '0', 0, that.qrArr[i].name) strCmd += blesdk.addCPCLQRCode(that.countWidth(i, 900 / that.qrArr.length), (that.yNum += 40), that.qrArr[i].level, '2', 4, that.qrArr[i].path) //二维码 - - + + } else { strCmd += blesdk.addCPCLSETMAG(1, 1) strCmd += blesdk.addCPCLText(that.countWidth(i, 900 / that.qrArr.length), (that.yNum -= - 40),'24','0', 0, that.qrArr[i].name) + 40), '24', '0', 0, that.qrArr[i].name) strCmd += blesdk.addCPCLQRCode(that.countWidth(i, 900 / that.qrArr.length), (that.yNum += - 40),that.qrArr[i].level, '2', 4, that.qrArr[i].path) //二维码 - + 40), that.qrArr[i].level, '2', 4, that.qrArr[i].path) //二维码 + } if (that.qrArr.length == (i + 1)) { strCmd += blesdk.addCPCLPrint(); @@ -1937,21 +2171,21 @@ if (i == 0) { strCmd += blesdk.addCPCLSETMAG(1, 1) strCmd += blesdk.addCPCLText(that.countWidth(i, 900 / that.qrArr.length), (that.yNum += - 40),'24','0', 0, that.qrArr[i].name) + 40), '24', '0', 0, that.qrArr[i].name) strCmd += blesdk.addCPCLQRCode(that.countWidth(i, 900 / that.qrArr.length), (that.yNum += 40), that.qrArr[i].level, '2', 4, that.qrArr[i].path) //二维码 - - + + } else { strCmd += blesdk.addCPCLSETMAG(1, 1) strCmd += blesdk.addCPCLText(that.countWidth(i, 900 / that.qrArr.length), (that.yNum -= - 40),'24','0', 0, that.qrArr[i].name) + 40), '24', '0', 0, that.qrArr[i].name) strCmd += blesdk.addCPCLQRCode(that.countWidth(i, 900 / that.qrArr.length), (that.yNum += 40), that .qrArr[i].level, '2', 4, that.qrArr[i].path) //二维码 - + } if (that.qrArr.length == (i + 1)) { strCmd += blesdk.addCPCLPrint(); @@ -1963,11 +2197,7 @@ that.bufferData.push(strCmd); } } - - console.log(that.bufferData) this.$nextTick(() => { - console.log('that.yNum', that.yNum) - console.log('bufferData', that.bufferData) that.bufferData = [] }) @@ -2246,20 +2476,71 @@ this.tui.toast(res.message) } }) + setTimeout(res => { + let that = this + for (let i = 0; i < this.newData.length; i++) { + that.newData[i].sizeList = [] + that.newData[i].sizePrintList = new Map() + for (let j = 0; j < that.newData[i].stockLogList1.length; j++) { + let discountAmount = that.newData[i].discountAmount + let newObj = JSON.parse(that.newData[i].stockLogList1[j].attributeList) + let printSize = new Map() + let color = '' + let statusAttr = '[销] ' + if (that.newData[i].stockLogList1[j].isReturn) { + statusAttr = '[退] ' + discountAmount = that.newData[i].stockLogList1[j].discountAmount + } else if (that.newData[i].stockLogList1[j].isPurchasedBefore == 1 && that.order + .name != '散客') { + statusAttr = '[补] ' + } + for (let as in newObj) { + if (as == '颜色') { + color = statusAttr + newObj[as] + if (that.newData[i].sizePrintList.has(color) == true) { + printSize = that.newData[i].sizePrintList.get(color) + } else { + that.newData[i].sizePrintList.set(color, printSize) + } + } + if (as == '尺码') { + if (newObj[as].indexOf('码') != -1) { + if (that.newData[i].sizeList.indexOf(newObj[as].substr(0, newObj[as] + .indexOf('码'))) == -1) { + that.newData[i].sizeList.push(newObj[as].substr(0, newObj[as] + .indexOf('码'))) + } + that.newData[i].sizePrintList.get(color).set(newObj[as].substr(0, + newObj[as].indexOf('码')), that.newData[i].stockLogList1[j] + .productCount + ':' + discountAmount) + } else { + if (that.newData[i].sizeList.indexOf(newObj[as]) == -1) { + that.newData[i].sizeList.push(newObj[as]) + } + that.newData[i].sizePrintList.get(color).set(newObj[as], that.newData[ + i].stockLogList1[j].productCount + ':' + discountAmount) + } + } + } + } + + //this.newData[i].sizeList = [...new Set(this.newData[i].sizeList)] + } + + }, 500) this.$nextTick(() => { setTimeout(res => { this.getPrintHeight() - }, 500) + }, 1000) }) }, // 金额转大写 convertToChineseNumeral(money) { let fu = false - console.log('金额转大写',money) - if(money == 0){ + if (money == 0) { return '零元整' } - if(JSON.stringify(money).indexOf('-') != -1){ + if (JSON.stringify(money).indexOf('-') != -1) { money = JSON.stringify(money).split('-')[1] fu = true } @@ -2331,10 +2612,9 @@ } else if (decimalNum == '') { chineseStr += cnInteger } - if(fu == true){ + if (fu == true) { chineseStr = '负' + chineseStr } - console.log('金额转大写',chineseStr) return chineseStr }, getAllGoodsList() { @@ -2743,11 +3023,10 @@ .shop-collapse text { text-align: center; - // padding-right: 40rpx; border-right: 1px solid #eee; } - .noPic { + .noPic { border-radius: 10px; width: 140rpx; height: 140rpx; diff --git a/package1/index/peopleList.vue b/package1/index/peopleList.vue index 2a672e7..cce4ad5 100644 --- a/package1/index/peopleList.vue +++ b/package1/index/peopleList.vue @@ -50,9 +50,12 @@ - + 根据欠款金额倒序 + + + 根据客户余额倒序 根据未拿货天数倒序 @@ -69,20 +72,25 @@ {{allData.purchasingCount?allData.purchasingCount:0}}今日入库件数 - 欠款人数:{{allData.personCount?allData.personCount:0}} - 欠款总额:{{allData.amountOwed?allData.amountOwed:0}} + + 欠款人数:{{allData.personCount?allData.personCount:0}} + 欠款总额:{{allData.amountOwed?allData.amountOwed:0}} + + 余额人数:{{allBalanceData.personCount?allBalanceData.personCount:0}} + 总余额:{{allBalanceData.amountOwed?Math.abs(allBalanceData.amountOwed):0}} + - {{item.consigneeName}} + {{item.consigneeName}} {{item.consigneeMobile != 'undefined' &&item.consigneeMobile != null &&item.consigneeMobile != undefined ?item.consigneeMobile:'-'}} - + {{item.name}} - ({{item.categoryName}}) + ({{item.categoryName }}) {{item.phone}} @@ -92,19 +100,19 @@ {{(item.name == '散客' || item.consigneeName == '默认供应商') && item.city != null && item.city != undefined?'-':item.province + item.city + item.area}} {{(item.name == '散客' || item.consigneeName == '默认供应商')?'-':item.address}} - + 欠款:{{item.noEarn?item.noEarn :0}} - + 欠款:{{item.noEarn?item.noEarn :0}} - + 余额:{{item.noEarn?Math.abs(item.noEarn) :0}} - + 余额:{{item.noEarn?Math.abs(item.noEarn) :0}} - + {{item.notBuyDays+'天未拿货'}} @@ -285,7 +293,8 @@ }], userId:'', noDaysort:false, - allData:{}, + allData:{}, + allBalanceData:{}, sort:'', notBuyDays:'', nahuoDay:false, @@ -434,7 +443,7 @@ this.notBuyDays = "" this.noDaysort = false this.nahuoDay = false - this.khOrGysList() + this.getPeopleType() }, changeSort(type){ if(type == 'nahuo'){ @@ -585,12 +594,7 @@ this.popleList = [] this.getPeopleType() }, - clearSearch(){ - this.pages = 1 - this.searchName = "" - this.popleList = [] - this.getPeopleType() - }, + //查询拉包工和快递人员的列表 kdyOrlbgList() { this.status = 'loading'; @@ -654,6 +658,16 @@ this.allData = res.result }else{ + } + }) + this.tui.request('/app/debt/getAllBalanceByShopId', "post", { + shopId:uni.getStorageSync('shopId'), + userType:this.popleType == 'khName'?'0':this.popleType == 'gysName'?'1':"" + }, false, false).then((res) => { + if (res.code == 200) { + this.allBalanceData = res.result + }else{ + } }) }, diff --git a/package1/inventory/addGoods.vue b/package1/inventory/addGoods.vue index da68e0d..a0f00eb 100644 --- a/package1/inventory/addGoods.vue +++ b/package1/inventory/addGoods.vue @@ -234,7 +234,7 @@ {{item.categoryName}} - + 确认 @@ -930,14 +930,14 @@ } } } - await setTimeout(res => { - for (var i = 0; i < that.defaultList.length; i++) { - for (var m = 0; m < that.defaultList[i].list.length; m++) { - console.log("222") - that.defaultList[i].list[m].checked = false - } - } - }, 400) + // await setTimeout(res => { + // for (var i = 0; i < that.defaultList.length; i++) { + // for (var m = 0; m < that.defaultList[i].list.length; m++) { + // console.log("222") + // that.defaultList[i].list[m].checked = false + // } + // } + // }, 400) that.$refs.addTypeDialog.close() }, changessPrice(e, type) { @@ -1064,6 +1064,7 @@ } }, ejectRuleSelect() { + console.log('defaultList',this.defaultList) if (this.dataList.id) { //颜色 for (let m = 0; m < this.multipleList[0].productAttributeValueVoList.length; m++) { @@ -1100,7 +1101,7 @@ } this.$nextTick(() => { this.oldMultipleList = this.multipleList - if (this.dataList.id) { + if (this.dataList == '') { this.multipleList = [] } this.$refs.addTypeDialog.open('bottom') diff --git a/package1/stock/addStock.vue b/package1/stock/addStock.vue index ae8c0f5..b055c6d 100644 --- a/package1/stock/addStock.vue +++ b/package1/stock/addStock.vue @@ -1,93 +1,92 @@