1
chenhaozhe
2025-10-30 8bb9d2275014efe8796b7e68798507983537f0f5
1
1个文件已修改
33 ■■■■ 已修改文件
pages/shouliaotongzhi/table.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/shouliaotongzhi/table.vue
@@ -43,7 +43,7 @@
                    {{ MultiCodePrint ? "单条码打印" : "多条码打印" }}
                </button>
                <!-- <button @click="getPrintCodeTest()" type="default" class="btn-c"> -->
                    <!-- 打印测试 -->
                <!-- 打印测试 -->
                <!-- </button> -->
            </view>
        </view>
@@ -323,10 +323,11 @@
                            CampanyName: CampanyName
                        },
                        success: (res) => {
                            if (res.data.count == 1) {
                                resolve(printInfoClone)
                            } else {
                                reject()
                                reject(res.data.Message)
                            }
                        },
                        fail: (res) => {
@@ -353,8 +354,8 @@
                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()
@@ -363,7 +364,7 @@
                        "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) {
@@ -375,7 +376,7 @@
                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()
@@ -450,10 +451,10 @@
            },
            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',
@@ -485,11 +486,11 @@
                    printInfoBuffer = []
                    await this.$nextTick(() => {
                        this.$refs.labelPrinter.execPrint()
                        this.printableWaitCache = []
                    })
                    // await this.$nextTick(() => {
                    //     this.$refs.labelPrinter.execPrint()
                    //     this.printableWaitCache = []
                    // })
                    this.printButtonDisabled = false
                } catch (e) {
@@ -497,7 +498,7 @@
                    this.printInfo = "" // 清空打印缓存 
                    uni.showModal({
                        title: '温馨提示',
                        content: `物料名: ${printerOne['物料名称']} 款号: ${printerOne['款号']} 出现错误,已退出打印流程`,
                        content: `物料名: ${printerOne['物料名称']} 款号: ${printerOne['款号']} ${e},已退出打印流程`,
                        showCancel: false
                    })
                }