| | |
| | | {{ MultiCodePrint ? "单条码打印" : "多条码打印" }} |
| | | </button> |
| | | <!-- <button @click="getPrintCodeTest()" type="default" class="btn-c"> --> |
| | | <!-- 打印测试 --> |
| | | <!-- 打印测试 --> |
| | | <!-- </button> --> |
| | | </view> |
| | | </view> |
| | |
| | | CampanyName: CampanyName |
| | | }, |
| | | success: (res) => { |
| | | |
| | | if (res.data.count == 1) { |
| | | resolve(printInfoClone) |
| | | } else { |
| | | reject() |
| | | reject(res.data.Message) |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | |
| | | let printContent = [] |
| | | let printInfoBuffer = [] |
| | | let count = 0 |
| | | console.log('testArray.length: ',testArray.length); |
| | | for (let i = 0;i<testArray.length; i++) { |
| | | console.log('testArray.length: ', testArray.length); |
| | | for (let i = 0; i < testArray.length; i++) { |
| | | // 条码存储成功后 获取打印指令 |
| | | |
| | | let printCode = new String() |
| | |
| | | "PAGE-WIDTH 608\r\n", |
| | | `FORM\r\n`, |
| | | `PRINT`).toString() |
| | | console.log('printCode: ',printCode); |
| | | console.log('printCode: ', printCode); |
| | | printContent.push(printCode) |
| | | count++; |
| | | if (count == 10) { |
| | |
| | | |
| | | printInfoBuffer.push(printContent.join("\r\n")) |
| | | this.printInfo = JSON.stringify(printInfoBuffer) |
| | | console.log('this.printInfo: ',this.printInfo); |
| | | console.log('this.printInfo: ', this.printInfo); |
| | | printInfoBuffer = [] |
| | | await this.$nextTick(() => { |
| | | this.$refs.labelPrinter.execPrint() |
| | |
| | | }, |
| | | async execMultiPrint() { |
| | | this.printButtonDisabled = true |
| | | if (this.$printer.isConnected() === false) { |
| | | this.$refs.labelPrinter.openPopup() |
| | | return |
| | | } |
| | | // if (this.$printer.isConnected() === false) { |
| | | // this.$refs.labelPrinter.openPopup() |
| | | // return |
| | | // } |
| | | if (this.printableWaitCache.length == 0) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | |
| | | |
| | | printInfoBuffer = [] |
| | | |
| | | await this.$nextTick(() => { |
| | | this.$refs.labelPrinter.execPrint() |
| | | this.printableWaitCache = [] |
| | | }) |
| | | |
| | | // await this.$nextTick(() => { |
| | | // this.$refs.labelPrinter.execPrint() |
| | | // this.printableWaitCache = [] |
| | | // }) |
| | | |
| | | this.printButtonDisabled = false |
| | | |
| | | } catch (e) { |
| | |
| | | this.printInfo = "" // 清空打印缓存 |
| | | uni.showModal({ |
| | | title: '温馨提示', |
| | | content: `物料名: ${printerOne['物料名称']} 款号: ${printerOne['款号']} 出现错误,已退出打印流程`, |
| | | content: `物料名: ${printerOne['物料名称']} 款号: ${printerOne['款号']} ${e},已退出打印流程`, |
| | | showCancel: false |
| | | }) |
| | | } |