From 8ffb676b97f8de68c27e8f2fbfd5e1d01b7a82fa Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Tue, 4 Jun 2024 16:51:03 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E7=89=88=EF=BC=8C?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E9=97=AE=E9=A2=98=E7=9A=84=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E7=89=88=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package1/.DS_Store | Bin 10244 -> 10244 bytes package1/index/orderDetail.vue | 351 +++++++---------------- package1/inventory/addGoods.vue | 488 +++----------------------------- package1/inventory/gategory.vue | 39 +-- 4 files changed, 161 insertions(+), 717 deletions(-) diff --git a/package1/.DS_Store b/package1/.DS_Store index 546c695329cfa115492f66032ea37a0e4b3b9d05..b5160ea0349dfc5e5692bfba54cf6cc38cb31412 100644 GIT binary patch delta 494 zcmZn(XbIRLC@9DBYc2x=0~3QIgJ*8Oi%U{YeiD$+VaSsfU(SAPvc90GJe2JSQ&*5- z7@VA+TL9!UFt9poP8QT-tY`FH3*s?kGUPF&Fr+e6Ae$x@1~v_30*ZYFDE}Q9Vp7USwPs3ktt}wWC3BZ$&n&F952^HtON;&q<(oKd*#XW&V{a~yT*?Epbuvv{F!`Fe9sr%nfUW=l delta 494 zcmZn(XbIRLC@9D5`iX&ofr-J9!814C#U&{xKMBa^aQgEy>&L&Nll28f<)Lgxn7V=t z!{Frn+yWqkAX};QIP_-54#E! zn=ouB3ogpb${MV`3RekB{r`W z$zWtxn{TMJ@%7QkGGfv&_GUY=5Js0+uzQOcN*EFu(iqZ^eU!6*)_cJ#M 20) { - // let position = 20; - // let part1 = this.sales.remark.substring(0, position); - // let part2 = this.sales.remark.substring(position); - // strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1) - // strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2) - // } else { - // strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.sales.remark) - // } - // strCmd += blesdk.addCPCLLocation(0); - // strCmd += blesdk.addCPCLPrint(); - // this.bufferData.push(strCmd); - // } else { - // this.yNum = 0 - // strCmd += blesdk.addCPCLLocation(0); - // strCmd += blesdk.addCPCLPrint(); - // this.bufferData.push(strCmd); - // strCmd = '' - // if (this.sales.remark.length > 20) { - // let position = 20; - // let part1 = this.sales.remark.substring(0, position); - // let part2 = this.sales.remark.substring(position); - // strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - // strCmd += blesdk.addCPCLLocation(0); - // strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1) - // strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2) - // } else { - // strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - // strCmd += blesdk.addCPCLLocation(0); - // strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.sales.remark) - // } - // strCmd += blesdk.addCPCLLocation(0); - // strCmd += blesdk.addCPCLPrint(); - - // this.bufferData.push(strCmd); - - // } - if (Math.ceil(Number(this.sales.remark.length) / 20) * 30 + this.yNum < that.printTotal) { - if (this.sales.remark.length > 20) { - let position = 20; - let part1 = this.sales.remark.substring(0, position); - let part2 = this.sales.remark.substring(position); - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1) - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2) - } else { - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.sales.remark) - } + let that = this; + let printHeight = 800 + for(let i=0;i 20) { let position = 20; let part1 = this.sales.remark.substring(0, position); let part2 = this.sales.remark.substring(position); - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1) strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2) } else { - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.sales.remark) } - } } - if (that.countPrint() < that.printTotal) { - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, - '===============================================================') - } else { - this.yNum = 0 - strCmd += blesdk.addCPCLPrint(); - this.bufferData.push(strCmd); - strCmd = '' - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); + strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, - '===============================================================') - } + '===============================================================================================') //店铺地址 - if (that.countPrint() < that.printTotal) { - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '店铺地址:' + uni.getStorageSync( - 'shopAddress')) - } else { - this.yNum = 0 - strCmd += blesdk.addCPCLPrint(); - this.bufferData.push(strCmd); - strCmd = '' - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); + + strCmd += blesdk.addCPCLSETMAG(1, 1) strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, '店铺地址:' + uni.getStorageSync( 'shopAddress')) - } + //店铺电话 - if (that.countPrint() < that.printTotal) { + + strCmd += blesdk.addCPCLSETMAG(1, 1) strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '店铺电话:' + uni.getStorageSync( 'username')) - } else { - that.yNum = 0 - strCmd += blesdk.addCPCLPrint(); - that.bufferData.push(strCmd); - strCmd = '' - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, '店铺电话:' + uni.getStorageSync( - 'username')) - } + if(this.qrArr.length != 0){ //店铺微信/微信收款/支付宝收款/收款码收款(店铺,微信,支付,收款) for (let i = 0; i < this.qrArr.length; i++) { //店铺二维码 - if ((that.yNum + 200) < that.printTotal) { - console.log('11111') - strCmd += blesdk.addCPCLQRCode(that.countWidth(i,600/that.qrArr.length), (that.yNum + 50), that.qrArr[i].level, '2', 3, that.qrArr[i].path) //二维码 - strCmd += blesdk.addCPCLText(that.countWidth(i,600/that.qrArr.length), (that.yNum + 180), '24', '0', 0, that.qrArr[i].name) + strCmd += blesdk.addCPCLQRCode(that.countWidth(i,1000/that.qrArr.length), (that.yNum + 80), that.qrArr[i].level, '2', 4, that.qrArr[i].path) //二维码 + strCmd += blesdk.addCPCLSETMAG(1, 1) + strCmd += blesdk.addCPCLText(that.countWidth(i,1000/that.qrArr.length), (that.yNum + 240), '24', '0', 0, that.qrArr[i].name) strCmd += blesdk.addCPCLLocation(0); if(this.qrArr.length == (i+1)){ strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); } - } else { - console.log('2222') - // that.yNum = 0 - strCmd += blesdk.addCPCLPrint(); - that.bufferData.push(strCmd); - strCmd = '' - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLQRCode(that.countWidth(i,600/that.qrArr.length) , 30, that.qrArr[i].level, '2', 3, that.qrArr[i].path) //二维码 - strCmd += blesdk.addCPCLText(that.countWidth(i,600/that.qrArr.length), 180, '24', '0', 0, that.qrArr[i].name) - strCmd += blesdk.addCPCLPrint(); - that.bufferData.push(strCmd); - } } }else{ strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); } - - this.$nextTick(() => { - that.bufferData = [] - uni.hideLoading(); + + this.$nextTick(() => { + that.bufferData = [] + uni.hideLoading(); }) - }, countWidth(num,len){ return num*len + 20 }, goPrint(type){ let strCmd = '' - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 1); - strCmd += blesdk.addCPCLSETMAG(2, 2) - blesdk.addCPCLSETBOLD('bold') - strCmd += blesdk.addCPCLText('40', '30', '24', '0', 0, '沧州明珠商贸城--快衣店') + strCmd = blesdk.CreatCPCLPage(1000, 1040, 1, 1); strCmd += blesdk.addCPCLSETMAG(3, 3) blesdk.addCPCLSETBOLD('bold') - strCmd += blesdk.addCPCLText('50', '120', '24', '0', 0, '收:' + maskShopName(this.sales.userName)) - strCmd += blesdk.addCPCLSETMAG(1, 1) - strCmd += blesdk.addCPCLText('50', '250', '24', '0', 0, maskPhone(this.order.phone)) - strCmd += blesdk.addCPCLText('250', '250', '24', '0', 0, '编号:' + this.sales.id) - strCmd += blesdk.addCPCLSETMAG(1, 1) + strCmd += blesdk.addCPCLLocation(2); + strCmd += blesdk.addCPCLText('0', '30', '24', '0', 0, '沧州明珠商贸城--快衣店') + strCmd += blesdk.addCPCLSETMAG(2, 2) + strCmd += blesdk.addCPCLLocation(0); blesdk.addCPCLSETBOLD('bold') - strCmd += blesdk.addCPCLText('50', '330', '24', '0', 0, this.sales.province + '/' + this.sales.city + '/' + + strCmd += blesdk.addCPCLText('50', '150', '24', '0', 0, '收货人:' + maskShopName(this.sales.userName)) + strCmd += blesdk.addCPCLSETMAG(2, 2) + strCmd += blesdk.addCPCLLocation(0); + strCmd += blesdk.addCPCLText('50', '230', '24', '0', 0, '电话:' + maskPhone(this.order.phone)) + strCmd += blesdk.addCPCLText('50', '310', '24', '0', 0, '编号:' + this.sales.id) + strCmd += blesdk.addCPCLSETMAG(2, 2) + blesdk.addCPCLSETBOLD('bold') + strCmd += blesdk.addCPCLLocation(0); + strCmd += blesdk.addCPCLText('50', '390', '24', '0', 0, this.sales.province + '/' + this.sales.city + '/' + this.sales.area) - strCmd += blesdk.addCPCLSETMAG(1, 1) + strCmd += blesdk.addCPCLSETMAG(2, 2) + strCmd += blesdk.addCPCLLocation(0); if(type == 'confirm'){ - strCmd += blesdk.addCPCLText('50', '410', '24', '0', 0, "*****") + strCmd += blesdk.addCPCLText('50', '470', '24', '0', 0, "*****") }else{ if (this.sales.receiveAddress.length > 20) { let position = 20; let part1 = this.sales.receiveAddress.substring(0, position); let part2 = this.sales.receiveAddress.substring(position); - strCmd += blesdk.addCPCLText('50', '410', '24', '0', 0, part1) - strCmd += blesdk.addCPCLText('50', '440', '24', '0', 0, part2) + strCmd += blesdk.addCPCLText('50', '470', '24', '0', 0, part1) + strCmd += blesdk.addCPCLText('50', '550', '24', '0', 0, part2) } else { strCmd += blesdk.addCPCLText('50', '410', '24', '0', 0, this.sales.receiveAddress) } } strCmd += blesdk.addCPCLSETMAG(2, 2) + strCmd += blesdk.addCPCLLocation(0); blesdk.addCPCLSETBOLD('bold') - strCmd += blesdk.addCPCLText('0', '490', '24', '0', 0, '——————————————————————————————') - strCmd += blesdk.addCPCLText('50', '570', '24', '0', 0, '发货方式:' + (this.sales.companyName ? this.sales + strCmd += blesdk.addCPCLText('0', '600', '24', '0', 0, '——————————————————————————————') + strCmd += blesdk.addCPCLText('50', '680', '24', '0', 0, '发货方式:' + (this.sales.companyName ? this.sales .companyName : '暂无')) strCmd += blesdk.addCPCLSETMAG(2, 2) - strCmd += blesdk.addCPCLText('0', '650', '24', '0', 0, '——————————————————————————————') - strCmd += blesdk.addCPCLText('50', '730', '24', '0', 0, '店铺:' + this.sales.shopName) - strCmd += blesdk.addCPCLText('50', '810', '24', '0', 0, this.sales.createByPhone) - strCmd += blesdk.addCPCLText('50', '890', '24', '0', 0, '地址:' + this.shopData.shopAddress) + strCmd += blesdk.addCPCLLocation(0); + strCmd += blesdk.addCPCLText('0', '760', '24', '0', 0, '——————————————————————————————') + strCmd += blesdk.addCPCLText('50', '840', '24', '0', 0, '店铺:' + this.sales.shopName) + strCmd += blesdk.addCPCLText('50', '920', '24', '0', 0, this.sales.createByPhone) + strCmd += blesdk.addCPCLText('50', '1000', '24', '0', 0, '地址:' + this.shopData.shopAddress) strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLPrint(); this.bufferData.push(strCmd); @@ -933,11 +800,11 @@ }, //计算打印机当前行高度 countPrint() { - if ((this.yNum + 50) >= 1040) { - return this.yNum += 50 - } else { + // if ((this.yNum + 50) >= 1040) { + // return this.yNum += 50 + // } else { return this.yNum += 30 - } + // } }, //截取 slicePrint(val) { diff --git a/package1/inventory/addGoods.vue b/package1/inventory/addGoods.vue index d74644d..fe319e9 100644 --- a/package1/inventory/addGoods.vue +++ b/package1/inventory/addGoods.vue @@ -16,12 +16,17 @@ - - - - + + + + + + + + + - + @@ -34,27 +39,6 @@ - - - - - - - - - - - - - - - - - @@ -73,40 +57,7 @@ - - - - - - 添加规格 - - - - - -
    -
  • - - {{item.name}} - - - - {{item1.value}} - -
  • -
- - 确认 - -
-
-
+ @@ -118,143 +69,16 @@ fileList1: [], formData: { productName: '', - price: 0, + price: '', productSn: '', - wholesalePrice: 0, + wholesalePrice: '', productPicture: '', productIntro: '', categoryId: '', salesWeek: '', tailWarn: '', barcode:'' - }, - defaultList:[{ - name:'颜色', - list:[{ - value:'均色', - checked:false, - },{ - value:'白色', - checked:false, - },{ - value:'黑色', - checked:false, - },{ - value:'浅蓝', - checked:false, - },{ - value:'蓝色', - checked:false, - },{ - value:'灰色', - checked:false, - },{ - value:'咖色', - checked:false, - },{ - value:'紫色', - checked:false, - },{ - value:'红色', - checked:false, - },{ - value:'米色', - checked:false, - }] - },{ - name:'尺码', - list:[{ - value:'均码', - checked:false, - },{ - value:'XS码', - checked:false - },{ - value:'S码', - checked:false, - },{ - value:'M码', - checked:false, - },{ - value:'L码', - checked:false, - },{ - value:'XL码', - checked:false, - },{ - value:'2XL码', - checked:false, - },{ - value:'3XL码', - checked:false, - },{ - value:'4XL码', - checked:false, - },{ - value:'25码', - checked:false - },{ - value:'26码', - checked:false - },{ - value:'27码', - checked:false - },{ - value:'28码', - checked:false - },{ - value:'29码', - checked:false - },{ - value:'30码', - checked:false - },{ - value:'31码', - checked:false - },{ - value:'32码', - checked:false - },{ - value:'33码', - checked:false - },{ - value:'34码', - checked:false - },{ - value:'35码', - checked:false - },{ - value:'36码', - checked:false - },{ - value:'37码', - checked:false - },{ - value:'38码', - checked:false - },{ - value:'39码', - checked:false - },{ - value:'40码', - checked:false - },{ - value:'41码', - checked:false - },{ - value:'42码', - checked:false - },{ - value:'43码', - checked:false - },{ - value:'44码', - checked:false - },{ - value:'45码', - checked:false - }] - }], + }, categoryList: [], productId:'', arrtList: [], @@ -262,8 +86,7 @@ arrtChange: [], categoryId:'', dataList:[], - type:'add', - multipleList:[], + type:'add', rules: { categoryId: { rules: [{ @@ -271,18 +94,18 @@ errorMessage: '请选择商品分类', }, ], }, - // price: { - // rules: [{ - // required: true, - // errorMessage: '请填写市场价', - // }, ], - // }, - // wholesalePrice: { - // rules: [{ - // required: true, - // errorMessage: '请填写批发价', - // }, ], - // }, + price: { + rules: [{ + required: true, + errorMessage: '请填写市场价', + }, ], + }, + wholesalePrice: { + rules: [{ + required: true, + errorMessage: '请填写批发价', + }, ], + }, productSn: { rules: [{ required: true, @@ -331,25 +154,9 @@ this.formData.categoryId = this.dataList.categoryId this.formData.salesWeek = this.dataList.salesWeek this.formData.tailWarn = this.dataList.tailWarn - } - this.getGategoryList() + } }, - methods: { - //初始化获取分类列表 - getGategoryList() { - this.tui.request("/app/productCategory/list", "get", { - // shopId: 1, - }, false, true).then((res) => { - if (res.code == 200) { - if(res.result.length > 0){ - this.typeItem = res.result[0] - this.formData.categoryId = this.typeItem.id - } - } else { - this.tui.toast(res.message) - } - }).catch((res) => {}) - }, + methods: { // 删除图片 deletePic(event) { this[`fileList${event.name}`].splice(event.index, 1) @@ -380,104 +187,6 @@ })) fileListLen++ } - }, - obtainPrice(e,type,num){ - console.log("获得焦点") - this.linshiPrice = e.target.value - if(type=='price'){ - this.formData.price = '' - }else if(type=='wholesalePrice'){ - this.formData.wholesalePrice = '' - } - }, - dialogInputConfirm(e) { - let that = this; - if(that.multipleList == ''){ - that.multipleList = [{ - attributeName:'颜色', - productAttributeValueVoList:[{ - checked: true, - value: "均色" - }] - },{ - attributeName:'尺码', - productAttributeValueVoList:[{ - checked: true, - value: "均码" - }] - }] - }else{ - for(let i=0;i { if(that.dataList !=''){ url = '/app/product/edit' - this.formData.id = that.dataList.id + res.id = that.dataList.id }else{ url = '/app/product/save' - this.formData.purchasePrice = 0 } if(res.productPicture == ''){ res.productPicture = '' } - that.tui.request(url, "post", this.formData, false, false).then((res1) => { + that.tui.request(url, "post", res, false, false).then((res1) => { if (res1.code == 200) { uni.navigateBack({ delta: 1 @@ -581,57 +286,7 @@ }) } }) - }, - //选择多个规格保存 - addMultipleType(item,item1,index){ - item.list[index].checked = !item.list[index].checked - var list = [] - if(this.multipleList == ''){ - list.push(item.list[index]) - var data = { - attributeName:item.name, - productAttributeValueVoList: list - } - this.multipleList.push(data) - }else{ - for(var i=0;i @@ -684,11 +339,6 @@ width: 160rpx; height: 160rpx; } - .checked{ - background: #60F3FF !important; - color: #fff !important; - border-radius: 5px !important; - } .content-list { height: 70rpx; border: 1px solid #eee; @@ -700,79 +350,5 @@ color: #fff; background: #5fd9ee; border-radius: 10px; - } - .content-input { - width: auto; - position: relative; - overflow: hidden; - flex: 1; - line-height: 1; - font-size: 14px; - height: 35px; - border: 2px solid #eee; - padding-left: 20rpx; - border-radius: 5px; - } - .add-popup-content { - align-items: center; - justify-content: center; - padding: 15px; - width: 100%; - height: 1050rpx; - background-color: #fff; - } - - .add-popup-title { - font-size: 36rpx; - font-weight: bold; - text-align: center; - position: relative; - } - - .add-popup-container { - margin-top: 20rpx; - } - - .add-popup-bottom { - display: flex; - height: 80rpx; - color: #fff; - line-height: 80rpx; - margin-top: 50rpx; - } - - .add-popup-btn { - flex: 1; - text-align: center; - background: linear-gradient(90deg, #60F3FF, #088FEB); - } - .title-fur { - width: 95%; - height: 70rpx; - margin: 0 auto; - border-bottom: 1px solid #eee; - .name { - font-size: 30rpx; - width: 90%; - float: left; - height: 70rpx; - line-height: 70rpx; - } - } - .content-fur { - padding-bottom: 25rpx; - } - - .content-low { - width: auto; - border: 1px solid #eee; - display: inline-block; - min-width: 90rpx; - padding: 5rpx; - font-size: 35rpx; - text-align: center; - color: #777; - margin: 20rpx 0 0 20rpx; - border-radius: 5px; } \ No newline at end of file diff --git a/package1/inventory/gategory.vue b/package1/inventory/gategory.vue index 39b334d..2bcd5e4 100644 --- a/package1/inventory/gategory.vue +++ b/package1/inventory/gategory.vue @@ -8,12 +8,9 @@
  • {{item.categoryName}} - - - - - - + + +
  • @@ -50,12 +47,12 @@ style="height:40rpx;line-height: 40rpx;position: absolute !important;bottom:0;right: 30rpx;"> - + - + 确认 @@ -76,7 +73,7 @@ - + 提示 @@ -190,13 +187,13 @@ value:'XL码', checked:false, },{ - value:'2XL码', + value:'XXL码', checked:false, },{ - value:'3XL码', + value:'XXXL码', checked:false, },{ - value:'4XL码', + value:'XXXXL码', checked:false, },{ value:'25码', @@ -308,7 +305,7 @@ this.inputVal = ''; this.isOpenId = item; this.dialogTit = '输入分类名' - this.$refs.addTypeDialog.open('center') + this.$refs.addTypeDialog.open('bottom') } }, @@ -543,9 +540,12 @@ }, //选择多个规格保存 addMultipleType(item,item1,index){ + + item.list[index].checked = !item.list[index].checked var list = [] if(this.multipleList == ''){ + list.push(item.list[index]) var data = { attributeName:item.name, @@ -687,9 +687,10 @@ } .bj-btn { - width: 80rpx; + width: 120rpx; height: 60rpx; font-size: 26rpx; + background: red; margin: 20rpx 0; float: left; padding: 0; @@ -697,7 +698,7 @@ } .name { - width: 86%; + width: 75%; float: left; display: flex; } @@ -770,8 +771,8 @@ align-items: center; justify-content: center; padding: 15px; - width: 500rpx; - height: 350rpx; + width: 100%; + height: 1300rpx; background-color: #fff; } From cfa6bd8e20efbc79e9dbe046949f2fa0cb0c59c9 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Tue, 4 Jun 2024 16:51:09 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E7=89=88=EF=BC=8C?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E9=97=AE=E9=A2=98=E7=9A=84=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E7=89=88=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/.DS_Store | Bin 10244 -> 10244 bytes pages/inventory/goodsList1.vue | 346 ++++++++++------------------ pages/inventory/inventoryDetail.vue | 2 +- 3 files changed, 118 insertions(+), 230 deletions(-) diff --git a/pages/.DS_Store b/pages/.DS_Store index 80e54b5a9067eeb0f87349bb5ba4f2f1214d7339..96d9923793ae36c52d50999dc04d4ccfb8a5f97e 100644 GIT binary patch delta 365 zcmZn(XbIS0D5$P5je&uIogs-KlOYEPGa2$2(sT1&T#|C~lYlZDT(dIb%h``jju4b* zhq5=<3Dz-c|5^c-a0Du1V@PJmXUGM@e1^Q-{1mumsG7~{!eNZeOvm?4ZV-`Tzr&mb zHgTbdv?`PhGK3XucM3x)Lq$P`VQ_MOZUIn~fq^+-^FtA9W~L7}Cd)}EvAgVm=q{8H zpByK_gTz;5G?=U_D!zH0gd?No$@^es5QB4o?n(z4kL)(6ip>&I<&4^HJlP;OK|E6g vbVCwDB0~v7DzXNsn$5eUiy1X1%E2|TG86-qCNiWkq#-MZs@NPRyN(M0*8OS5 delta 363 zcmZn(XbIS0D5x$~&%nUI&XB~A$&dqtnGAUh>ACqXE=f80NkAD6AZBpyJ32W+P@Wyi z-drbG$EeM~(6Iep_EATmAR9w6Lq0<;5au)F<>sd#X$Gs=tS%hJ$jtn8%H#$SDfSMl zV+jkc9i6;TL|PTf1{uN%wmXF(m7$^_!!S5GKeqs69|OyR%@0ManVC*)m@Fru#NPQP zxz+XI(aD7p;*;Yfc#!z2lXXNTHm{R#WYh$@O-is3>^4@Qr}7!nL58Eb45VVSgj6}m zD-4G7Ln^8Uu$s-gq>C9f|LvAJEO-TKelbvKB10NO8nSYzip^oN G>$m{Tc50pg diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue index d08f572..2049b04 100644 --- a/pages/inventory/goodsList1.vue +++ b/pages/inventory/goodsList1.vue @@ -2457,7 +2457,8 @@ } } }, - showPrice() { + showPrice() { + let that = this; if (this.khName == '') { this.tui.toast('请选择客户!') return @@ -2496,7 +2497,19 @@ } else { this.tui.toast('请选择发货方式!') return - } + } + let printHeight = 800 + this.carList.forEach(function(value, key) { + printHeight += 30 + value.stockLogList.forEach(function(value1, key1) { + printHeight += 30 + }) + }) + this.printTotal = printHeight + that.bufferData = [] + let strCmd = this.getPrintData() + strCmd += blesdk.addCPCLPrint(); + that.bufferData.push(strCmd); this.$refs.showPopup.open() }, //点击底部开单按钮 @@ -2592,235 +2605,110 @@ // }); // }, //打印小票 - onPrint(opt) { - let that = this; - this.goSell('print') - let strCmd = '' - that.yNum = 150 - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLSETMAG(2, 2) - blesdk.addCPCLSETBOLD('bold') - strCmd += blesdk.addCPCLLocation(2); - strCmd += blesdk.addCPCLText('0', '30', '24', '0', 0, uni.getStorageSync('shopName')) - - strCmd += blesdk.addCPCLSETMAG(1, 1) - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLText('0', '100', '24', '0', 0, '客户:' + this.khName.name) - // strCmd += blesdk.addCPCLText('280', '100', '24', '0', 0, this.sales.id) - strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '销售:' + this.createByName) - strCmd += blesdk.addCPCLText('280', '130', '24', '0', 0, '日期:' + this.formatDate(new Date(), - 'YYYY-MM-DD')) //+ - strCmd += blesdk.addCPCLText('0', '150', '24', '0', 0, - '=========================================================') - - this.carList.forEach(function(value, key) { - if (that.countPrint() < that.printTotal) { - strCmd += blesdk.addCPCLText('0', that.yNum, '24', '0', 0, value.productName + '(' + - value.productSn + ')') - } else { - that.yNum = 0 - strCmd += blesdk.addCPCLPrint(); - that.bufferData.push(strCmd); - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, value.productName + - '(' + - value.productSn + ')') - - } - value.stockLogList.forEach(function(value1, key1) { - if (that.countPrint() < that.printTotal) { - strCmd += blesdk.addCPCLText('0', that.yNum, '24', '0', 0, '□ ' + (that - .slicePrint( - key1)) + '*' + value1.productCount) - strCmd += blesdk.addCPCLText('240', that.yNum, '24', '0', 0, '单价:' + value - .discountAmount) - strCmd += blesdk.addCPCLText('400', that.yNum, '24', '0', 0, '总价:' + (value - .discountAmount * value1.productCount)) - } else { - that.yNum = 0 - strCmd += blesdk.addCPCLPrint(); - that.bufferData.push(strCmd); - strCmd = '' - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, '□ ' + (that - .slicePrint(key1)) + '*' + value1.productCount) - strCmd += blesdk.addCPCLText('240', that.yNum, '24', '0', 0, '单价:' + value - .discountAmount) - strCmd += blesdk.addCPCLText('400', that.yNum, '24', '0', 0, '总价:' + (value - .discountAmount * value1.productCount)) - } - }) + async onPrint(opt) { + let that = this; + await this.goSell('print') + + this.$nextTick(() => { + uni.hideLoading(); + that.$refs.showPopup.close() + that.bufferData = [] + that.clearAll1() + uni.switchTab({ + url: '/pages/index/index' + }); }) - if (that.countPrint() < that.printTotal) { - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, - '===============================================================') - } else { - this.yNum = 0 - strCmd += blesdk.addCPCLPrint(); - this.bufferData.push(strCmd); - strCmd = '' - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, - '===============================================================') - - } - if (that.countPrint() < that.printTotal) { - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '总数量:' + this.totalAmount) - strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '总金额:' + this.shouldPay) - strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.relPrice) - } else { - this.yNum = 0 - strCmd += blesdk.addCPCLPrint(); - this.bufferData.push(strCmd); - strCmd = '' - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLText('0', (this.yNum += 30), '24', '0', 0, '总数量:' + this.totalAmount) - strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '总金额:' + this.shouldPay) - strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.relPrice) - - } - if (that.countPrint() < that.printTotal) { - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '实收:' + this.priceOk) - strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '欠款:' + (this.relPrice - this.priceOk) - .toFixed(2)) - strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:' + (this.otherExpense == '' ? 0 : - this.otherExpense)) - } else { - this.yNum = 0 - strCmd += blesdk.addCPCLPrint(); - this.bufferData.push(strCmd); - strCmd = '' - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLText('0', (this.yNum += 30), '24', '0', 0, '实收:' + this.priceOk) - strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '欠款:' + (this.relPrice - this.priceOk) - .toFixed(2)) - strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:' + (this.otherExpense == '' ? 0 : - this.otherExpense)) - - } - if (Math.ceil(Number(this.remark.length) / 20) * 30 + this.yNum < that.printTotal) { - if (this.remark.length > 20) { - let position = 20; - let part1 = this.remark.substring(0, position); - let part2 = this.remark.substring(position); - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1) - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2) - } else { - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.remark) - } - - } else { - this.yNum = 0 - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLPrint(); - this.bufferData.push(strCmd); - strCmd = '' - if (this.remark.length > 20) { - let position = 20; - let part1 = this.remark.substring(0, position); - let part2 = this.remark.substring(position); - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1) - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2) - } else { - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.remark) - } - } - if (that.countPrint() < that.printTotal) { - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, - '===============================================================') - } else { - this.yNum = 0 - strCmd += blesdk.addCPCLPrint(); - this.bufferData.push(strCmd); - strCmd = '' - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, - '===============================================================') - - } - //店铺地址 - if (that.countPrint() < that.printTotal) { - strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '店铺地址:' + uni.getStorageSync( - 'shopAddress')) - } else { - this.yNum = 0 - strCmd += blesdk.addCPCLPrint(); - this.bufferData.push(strCmd); - strCmd = '' - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, '店铺地址:' + uni.getStorageSync( - 'shopAddress')) - } - //店铺电话 - if (that.countPrint() < that.printTotal) { - strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '店铺电话:' + uni.getStorageSync( - 'username')) - } else { - that.yNum = 0 - strCmd += blesdk.addCPCLPrint(); - that.bufferData.push(strCmd); - strCmd = '' - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, '店铺电话:' + uni.getStorageSync( - 'username')) + }, + getPrintData(){ + let that = this; + let strCmd = '' + that.yNum = 300 + strCmd = blesdk.CreatCPCLPage(1000, this.printTotal, 1, 0); + strCmd += blesdk.addCPCLSETMAG(2, 2) + blesdk.addCPCLSETBOLD('bold') + strCmd += blesdk.addCPCLLocation(2); + strCmd += blesdk.addCPCLText('0', '30', '24', '0', 0, '') + strCmd += blesdk.addCPCLSETMAG(2, 2) + blesdk.addCPCLSETBOLD('bold') + strCmd += blesdk.addCPCLLocation(2); + strCmd += blesdk.addCPCLText('0', '110', '24', '0', 0, uni.getStorageSync('shopName')) + + strCmd += blesdk.addCPCLSETMAG(1, 1) + strCmd += blesdk.addCPCLLocation(0); + blesdk.addCPCLSETBOLD('bold') + strCmd += blesdk.addCPCLText('0', '190', '24', '0', 0, '客户:' + that.khName.name) + strCmd += blesdk.addCPCLSETMAG(1, 1) + strCmd += blesdk.addCPCLLocation(0); + strCmd += blesdk.addCPCLText('0', '240', '24', '0', 0, '销售员:' + that.createByName) + strCmd += blesdk.addCPCLText('500', '240', '24', '0', 0, '日期:' + that.formatDate(new Date(), + 'YYYY-MM-DD')) //+ + strCmd += blesdk.addCPCLText('0', '300', '24', '0', 0, + '=====================================================================================') + + that.carList.forEach(function(value, key) { + strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, value.productName + '(' + + value.productSn + ')') + value.stockLogList.forEach(function(value1, key1) { + strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '□ ' + (that + .slicePrint(key1))) + strCmd += blesdk.addCPCLText('220', that.yNum, '24', '0', 0, '数量:'+ value1.productCount) + strCmd += blesdk.addCPCLText('400', that.yNum, '24', '0', 0, '单价:' + value + .discountAmount) + strCmd += blesdk.addCPCLText('650', that.yNum, '24', '0', 0, '总价:' + (value + .discountAmount * value1.productCount)) + }) + }) + strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, + '==========================================================================================') + strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '总数量:' + that.totalAmount) + strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '总金额:' + that.shouldPay) + strCmd += blesdk.addCPCLText('630', that.yNum, '24', '0', 0, '应收:' + that.relPrice) + strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '实收:' + that.priceOk) + strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '欠款:' + (that.relPrice - that.priceOk) + .toFixed(2)) + strCmd += blesdk.addCPCLText('630', that.yNum, '24', '0', 0, '其他费用:' + (that.otherExpense == '' ? 0 : + that.otherExpense)) + if(that.remark != ''){ + if (that.remark.length > 20) { + let position = 20; + let part1 = that.remark.substring(0, position); + let part2 = that.remark.substring(position); + strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '备注:' + part1) + strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, part2) + } else { + strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '备注:' + that.remark) + } + } - if(this.qrArr.length != 0){ + + strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, + '=========================================================================================') + //店铺地址 + + strCmd += blesdk.addCPCLSETMAG(1, 1) + strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, '店铺地址:' + uni.getStorageSync( + 'shopAddress')) + + //店铺电话 + + strCmd += blesdk.addCPCLSETMAG(1, 1) + strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '店铺电话:' + uni.getStorageSync( + 'username')) + + if(that.qrArr.length != 0){ //店铺微信/微信收款/支付宝收款/收款码收款(店铺,微信,支付,收款) - for (let i = 0; i < this.qrArr.length; i++) { + for (let i = 0; i < that.qrArr.length; i++) { + //店铺二维码 - console.log(that.qrArr[i]) - console.log(that.yNum) - console.log(that.countWidth(i,600/that.qrArr.length)) - if ((that.yNum + 200) < that.printTotal) { - console.log('11111') - strCmd += blesdk.addCPCLQRCode(that.countWidth(i,600/that.qrArr.length), (that.yNum + 50), that.qrArr[i].level, '2', 3, that.qrArr[i].path) //二维码 - strCmd += blesdk.addCPCLText(that.countWidth(i,600/that.qrArr.length), (that.yNum + 180), '24', '0', 0, that.qrArr[i].name) - strCmd += blesdk.addCPCLLocation(0); - if(this.qrArr.length == (i+1)){ - strCmd += blesdk.addCPCLPrint(); - that.bufferData.push(strCmd); - } - } else { - console.log('2222') - // that.yNum = 0 - strCmd += blesdk.addCPCLPrint(); - that.bufferData.push(strCmd); - strCmd = '' - strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); - strCmd += blesdk.addCPCLLocation(0); - strCmd += blesdk.addCPCLQRCode(that.countWidth(i,600/that.qrArr.length) , 30, that.qrArr[i].level, '2', 3, that.qrArr[i].path) //二维码 - strCmd += blesdk.addCPCLText(that.countWidth(i,600/that.qrArr.length), 180, '24', '0', 0, that.qrArr[i].name) - strCmd += blesdk.addCPCLPrint(); - that.bufferData.push(strCmd); - } + console.log('11111') + strCmd += blesdk.addCPCLQRCode(that.countWidth(i,1000/that.qrArr.length), (that.yNum + 80), that.qrArr[i].level, '2', 4, that.qrArr[i].path) //二维码 + strCmd += blesdk.addCPCLSETMAG(1, 1) + strCmd += blesdk.addCPCLText(that.countWidth(i,1000/that.qrArr.length), (that.yNum + 240), '24', '0', 0, that.qrArr[i].name) + strCmd += blesdk.addCPCLLocation(0); + } - }else{ - strCmd += blesdk.addCPCLPrint(); - that.bufferData.push(strCmd); } - - uni.hideLoading(); - this.$nextTick(() => { - console.log('bufferData',that.bufferData) - that.$refs.showPopup.close() - that.bufferData = [] - that.clearAll1() - uni.switchTab({ - url: '/pages/index/index' - }); - }) + return strCmd; }, countWidth(num,len){ // if(num == 0){ @@ -2831,11 +2719,11 @@ }, //计算打印机当前行高度 countPrint() { - if ((this.yNum + 50) >= 1040) { - return this.yNum += 50 - } else { + // if ((this.yNum + 50) >= 1040) { + // return this.yNum += 50 + // } else { return this.yNum += 30 - } + // } }, //截取 slicePrint(val) { diff --git a/pages/inventory/inventoryDetail.vue b/pages/inventory/inventoryDetail.vue index 706cdd7..397a636 100644 --- a/pages/inventory/inventoryDetail.vue +++ b/pages/inventory/inventoryDetail.vue @@ -157,7 +157,7 @@ @confirm="changePrice"> - + Date: Fri, 7 Jun 2024 19:36:10 +0800 Subject: [PATCH 3/3] 11 --- pages/inventory/goodsList1.vue | 4315 ++++++++------------------------ 1 file changed, 1035 insertions(+), 3280 deletions(-) diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue index 2049b04..873ef82 100644 --- a/pages/inventory/goodsList1.vue +++ b/pages/inventory/goodsList1.vue @@ -1,795 +1,266 @@ - - - \ No newline at end of file