chenhaozhe
2025-07-31 548af6a6faffe9ea0e0f8ed33b86835acf447a4e
修改商品条码打印
1个文件已修改
157 ■■■■■ 已修改文件
pages/tiaomadaying/tiaomadaying.vue 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tiaomadaying/tiaomadaying.vue
@@ -79,8 +79,8 @@
            </view>
        </view>
        <view class="operation-zone">
            <button class="btn-c" @click="GenereateBarCode">生成</button>
            <button class="btn-c" :disabled="buttonStatus.btn2 == false" @click="print">打印</button>
            <button class="btn-c" :disabled="buttonStatus.btn1" @click="GenereateBarCode">生成</button>
            <button class="btn-c" :disabled="buttonStatus.btn2" @click="print">打印</button>
            <view></view>
            <button class="btn-c" @click="setClearLailiaoInfo">新增</button>
            <button class="btn-c" @click="exit">退出</button>
@@ -128,7 +128,7 @@
                userInfo: getUserInfo(),
                buttonStatus: {
                    btn1: true,
                    btn2: false
                    btn2: true
                },
                barCodeMeta: '',
                generatedBarCode: '',
@@ -295,43 +295,46 @@
                    //     this.$refs.labelPrinter.execPrint()
                    // })
                    // T 24 0 300 280 计划跟踪号: ${this.lailiaoInfo.HMTONo || ''}
                    this.printInfo = `! 0 200 200 400 1
PAGE-WIDTH 608
SETQRVER 3
B QR 470 30 M 4 U 5
B QR 480 30 M 4 U 4
LA,${this.lailiaoInfo.barCodeNo}
ENDQR
T 24 0 10 30 供应商: ${this.lailiaoInfo.HSupName}
T 55 0 10 55 (Supplier)
T 24 0 10 80 供应商料号:  ${this.lailiaoInfo.HMaterNumber}
T 55 0 10 105 (Supplier Sku No.)
T 24 0 10 130 物料名称: ${this.lailiaoInfo.HMaterName}
T 55 0 5 155 (Material Code)
T 24 0 300 130 款号:
T 55 0 300 155 (eng)
T 24 0 5 180 分组: ${this.lailiaoInfo.HBatchNo}
T 55 0 5 205 (Group)
T 24 0 300 180 规格: ${this.lailiaoInfo.HMaterModel}
T 55 0 300 205 (SKU NO.)
T 24 0 10 70 供应商料号:  ${this.lailiaoInfo.HMaterNumber}
T 55 0 10 95 (Supplier Sku No.)
T 24 0 10 110 物料名称: ${this.lailiaoInfo.HMaterName}
T 55 0 10 135 (Material Code)
T 24 0 10 150 款号:
T 55 0 10 175 (eng)
T 24 0 300 150 款号:
T 55 0 300 175 (eng)
T 24 0 10 190 分组: ${this.lailiaoInfo.HBatchNo}
T 55 0 10 215 (Group)
T 24 0 300 190 规格: ${this.lailiaoInfo.HMaterModel}
T 55 0 300 215 (SKU NO.)
T 24 0 10 230 数量:  ${this.lailiaoInfo.HQty} (${this.lailiaoInfo.HPcsName})
T 55 0 5 255 (Quantity)
T 55 0 10 255 (Quantity)
T 24 0 300 230 日期: ${this.lailiaoInfo.HDate}
T 55 0 300 255 (Date) 
T 24 0 5 280 检验员:
T 55 0 5 305 (QC)
T 24 0 300 280 采购单号: ${this.lailiaoInfo.HBillNo || ''}
T 55 0 300 305 (Purchase Order No.)
T 24 0 5 330 检验结果:
T 55 0 5 355 (Inspection status)
BOX 240 330 260 350 4
T 24 0 270 330 合格
T 55 0 250 355 (Pass)
BOX 340 330 360 350 4
T 24 0 370 330 不合格
T 55 0 370 355 (Fail)
BOX 460 330 480 350 4
T 24 0 490 330 特采
T 55 0 440 355 (Spec. accepted)
T 24 0 10 270 检验员:
T 55 0 10 295 (QC)
T 24 0 300 270 采购单号: ${this.lailiaoInfo.HBillNo || ''}
T 55 0 300 295 (Purchase Order No.)
T 24 0 10 310 检验结果:
T 55 0 10 335 (Inspection status)
BOX 240 310 260 330 4
T 24 0 270 310 合格
T 55 0 250 335 (Pass)
BOX 340 310 360 330 4
T 24 0 370 310 不合格
T 55 0 370 335 (Fail)
BOX 460 310 480 330 4
T 24 0 490 310 特采
T 55 0 440 335 (Spec. accepted)
FORM
PRINT`
@@ -428,21 +431,34 @@
                            console.log('采购订单: ', res)
                            let {
                                data,
                                count
                                count,
                                Message
                            } = res.data
                            if (count > 0) {
                                this.setLailiaoInfo(data, Row)
                                // uni.showToast({
                                //     icon: 'none',
                                //     title: Message
                                // })
                                this.buttonStatus.btn1 = false
                            } else {
                                CommonUtils.playSound(0)
                                this.refreshBarcodeState()
                                // uni.showToast({
                                //     icon: 'none',
                                //     title: Message
                                // })
                                this.buttonStatus.btn1 = true
                                this.buttonStatus.btn2 = true
                            }
                        },
                        (error) => {
                            CommonUtils.playSound(0)
                            this.refreshBarcodeState()
                            this.buttonStatus.btn2 = false
                            this.buttonStatus.btn1 = true
                            this.buttonStatus.btn2 = true
                        }
                    )
@@ -465,41 +481,41 @@
                                title: '条码格式错误,请重新扫描...'
                            })
                        }
                        let barCodeInfo = ret.resp_result.split("@")
                        let [PurchaseBillNo, Row] = barCodeInfo
                        this.lailiaoInfo.HBillNo = PurchaseBillNo,
                            this.lailiaoInfo.HBillLineNo = Row
                        console.log({
                            sWhere: ` and 单据号 = '${PurchaseBillNo}'`,
                            user: this.userInfo.Czymc,
                        })
                        CommonUtils.doRequest(
                            "/Cg_POOrderBill/list", {
                                sWhere: ` and 单据号 = '${PurchaseBillNo}'`,
                                user: this.userInfo.Czymc,
                            },
                            (res) => {
                                console.log('采购订单: ', res)
                                let {
                                    data,
                                    count
                                } = res.data
                                if (count > 0) {
                                    this.setLailiaoInfo(data, Row)
                                }
                            },
                            (error) => {
                        // let barCodeInfo = ret.resp_result.split("@")
                        // let [PurchaseBillNo, Row] = barCodeInfo
                        // this.lailiaoInfo.HBillNo = PurchaseBillNo,
                        //     this.lailiaoInfo.HBillLineNo = Row
                        // console.log({
                        //     sWhere: ` and 单据号 = '${PurchaseBillNo}'`,
                        //     user: this.userInfo.Czymc,
                        // })
                        // CommonUtils.doRequest(
                        //     "/Cg_POOrderBill/list", {
                        //         sWhere: ` and 单据号 = '${PurchaseBillNo}'`,
                        //         user: this.userInfo.Czymc,
                        //     },
                        //     (res) => {
                        //         console.log('采购订单: ', res)
                        //         let {
                        //             data,
                        //             count
                        //         } = res.data
                        //         if (count > 0) {
                        //             this.setLailiaoInfo(data, Row)
                        //         }
                        //     },
                        //     (error) => {
                    
                            }
                        )
                        //     }
                        // )
                        this.barCodeEntryHandler(ret.resp_result)
                    }
                
                })
            },
            GenereateBarCode() {
                let HBarCodeNoStr =
                    `${this.lailiaoInfo.HBillNo}@${this.lailiaoInfo.HBillLineNo}@${this.lailiaoInfo.HMaterNumber}@${this.lailiaoInfo.HMTONo}@${this.lailiaoInfo.HQty}@${this.lailiaoInfo.HSupID}`
                    `${this.lailiaoInfo.HBillNo}@${this.lailiaoInfo.HBillLineNo}@${this.lailiaoInfo.HMaterNumber || ''}@${this.lailiaoInfo.HMTONo || ''}@${this.lailiaoInfo.HQty || ''}@${this.lailiaoInfo.HSupID || ''}`
                let sMain = []
                sMain[0] = this.lailiaoInfo
                let sMainStr = JSON.stringify(sMain);
@@ -508,9 +524,9 @@
                //获取选择的工厂代码
                let CampanyName = "xxx";
                //获取选择的源单类型
                let HSourceBillType = "来料通知单";
                let HSourceBillType = "采购订单";
                //获取选择的条码类型
                let HSelectBarCodeType = "唯一条码";
                let HSelectBarCodeType = "品种条码";
                //获取当前登录人员
                let UserName = uni.getStorageSync('HUserName');
                let sMainSub = sMainStr + ';' + HOrgType + ';' + HSourceBillType + ';' + HSelectBarCodeType + ';' +
@@ -530,15 +546,19 @@
                        } = res.data
                        if (count > 0) {
                            this.buttonStatus = {
                                btn1: false,
                                btn2: true
                                btn1: true,
                                btn2: false
                            }
                            this.generatedBarCode = data[0]['条码编号']
                            console.log(this.generatedBarCode)
                            // this.generatedBarCode = data[0]['条码编号']/
                            // console.log(this.generatedBarCode)
                            uni.showToast({
                                icon: 'none',
                                title: Message
                            })
                            this.buttonStatus = {
                                btn1: true,
                                btn2: false
                            }
                        } else {
                            uni.showToast({
                                icon: 'none',
@@ -547,7 +567,10 @@
                        }
                    },
                    (err) => {
                        uni.showToast({
                            icon: 'none',
                            title: err
                        })
                    },
                    "POST"
                )