chenhaozhe
2025-09-10 77fe00e43102493349fad4107d0c1115cc679f12
添加 收料通知单 页面 多条码打印功能
4个文件已修改
938 ■■■■ 已修改文件
manifest.json 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/huanyangdan/form.vue 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/shouliaotongzhi/table.vue 857 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/shouliaotongzhi/table_son.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json
@@ -2,9 +2,8 @@
    "name" : "智云LMES",
    "appid" : "__UNI__B002F49",
    "description" : "",
    "versionName" : "1.0.70",
    "versionCode" : 170,
    "versionName" : "1.0.72",
    "versionCode" : 172,
    "transformPx" : false,
    /* 5+App特有相关 */
    "app-plus" : {
pages/huanyangdan/form.vue
@@ -565,41 +565,45 @@
                    resFunction: (res) => {
                        let {
                            code,
                            msg,
                            Message,
                            count,
                            data
                        } = res.data
                        if (code == 1) {
                            this.HBarCode = ''
                            let data1 = data.h_v_Sc_ProcessExchangeBillList
                        if (count == 1) {
                            this.hform = Object.assign(this.hform, {
                                "HMaterID": data1[0].HMaterID, //产品ID
                                "HMaterCode": data1[0].产品代码, //产品代码
                                "HMaterName": data1[0].产品, //产品名称
                                "HMaterSpec": data1[0].规格型号, //产品规格
                                "HUnitID": data1[0].HUnitID, //计量单位id
                                "HUnitName": data1[0].单位, //计量单位
                                "HMainSourceBillNo": data1[0].单据号, //源单单号
                                "HMainSourceInterID": data1[0].hmainid, //源单主内码
                                "HMainSourceBillType": 3772, //源单类型
                                "HProcExchBillNo": data1[0].单据号, //流转卡号
                                "HProcExchInterID": data1[0].hmainid, //流转卡主内码(取值HInterID)
                                "HBatchNo": data1[0].批号, //流转卡批次
                                "HICMOInterID": data1[0].hicmointerid, //生产订单ID
                                "HICMOEntryID": data1[0].HICMOEntryID, //生产订单子ID
                                "HICMOBillNo": data1[0].任务单号, //生产订单
                                "HDeptID": data1[0].HWorkShopID, //车间ID
                                "HDeptName": data1[0].生产车间, //车间
                                "HMaterID": data[0].HMaterID, //产品ID
                                "HMaterNumber": data[0].产品编码, //产品代码
                                "HMaterName": data[0].产品名称, //产品名称
                                "HModel": data[0].规格型号, //产品规格
                                "HUnitID": data[0].HUnitID, //计量单位id
                                "HUnitName": data[0].计量单位, //计量单位
                                "HProcExchBillNo": data[0].工序流转卡号, //流转卡号
                                "HProcExchInterID": data[0].工序流转卡主内码, //流转卡主内码(取值HInterID)
                                "HBatchNo": data[0].工序流转卡批次号, //流转卡批次
                                "HICMOInterID": data[0].任务单内码, //生产订单ID
                                "HICMOEntryID": data[0].任务单子内码, //生产订单子ID
                                "HICMOBillNo": data[0].任务单号, //生产订单
                                "HDeptID": data[0].HDeptID, //车间ID
                                "HDeptName": data[0].部门, //车间
                                "HProcID": data[0].HProcID, //当前工序ID
                                "HProcName": data[0].工序, //当前工序
                                "HProcExchEntryID": data[0].工序流转卡子内码, //流转卡子内码(源单行号)
                                "HProcExchQty": data[0].工序流转卡数量, //流转卡数量
                                "HICMOQty": data[0].任务单数量,
                                "WorkShiftName": data[0].生产班次,
                                "HWorkShiftID": data[0].HShiftsID,
                                "HBarCode": "",
                            })
                            console.log('this.hform: ', this.hform);
                            uni.showToast({
                                icon: 'none',
                                title: msg
                                title: '获取成功!'
                            })
                        } else {
                            uni.showToast({
                                icon: 'none',
                                title: msg
                                title: Message
                            })
                        }
                    }
@@ -657,11 +661,28 @@
                console.log('this.hform: ', this.hform);
                let sMainStr = JSON.stringify(this.hform)
                console.log('sMainStr: ', sMainStr);
                let sMainSub = sMainStr + ';' + this.refSav + ';' + getUserInfo()['Czymc'];
                let numData = [{
                    "HMaterID": this.hform.HMaterID,
                    "HUnitID": this.hform.HUnitID,
                    "HProcExchBillNo": this.hform.HProcExchBillNo,
                    "HProcExchInterID": this.hform.HProcExchInterID,
                    "HProcExchEntryID": this.hform.HProcExchEntryID,
                    "HICMOInterID": this.hform.HICMOInterID,
                    "HICMOEntryID": this.hform.HICMOEntryID,
                    "HICMOBillNo": this.hform.HICMOBillNo,
                    "HDeptID": this.hform.HDeptID,
                    "HProcID": this.hform.HProcID,
                    "HProcExchQty": this.hform.HProcExchQty,
                    "HWorkShiftID": this.hform.HWorkShiftID,
                    "HBatchNo": this.hform.HBatchNo,
                    "HICMOQty": this.hform.HICMOQty,
                    "HQty": this.hform.HQty
                }]
                let sSubStr = JSON.stringify(numData)
                let sMainSub = sMainStr + ';' + sSubStr +';' + this.refSav + ';' + getUserInfo()['Czymc'];
                CommonUtils.doRequest2({
                    method: 'POST',
                    url: '/QC_TakeSampleCheckBill/SaveQC_TakeSampleCheckBillMain',
                    url: '/QC_TakeSampleCheckBill/SaveQC_BackSampleCheckBillMain',
                    data: {
                        msg: sMainSub
                    },
pages/shouliaotongzhi/table.vue
@@ -1,257 +1,618 @@
<template>
    <view class="content">
        <view class="form">
            <view class="form-item">
                <view class="title"><text>*</text>条码:</view>
                <view class="right" style="width: 380rpx;">
                    <input :focus="HBarCodeFocus" v-model="HBarCode" placeholder="请扫描(或输入)条码" @confirm="getCode(HBarCode)"/>
                </view>
                <uni-icons type="scan" style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;" size="20" @click="toScanCode"></uni-icons>
            </view>
            <view class="form-item">
                <view class="title">单据号:</view>
                <view class="righton">
                    <input v-model="baseInfo.HBillNo" disabled/>
                </view>
            </view>
            <view class="form-item">
                <view class="title">供应商:</view>
                <view class="righton">
                    <input v-model="baseInfo.HSupName" disabled/>
                </view>
            </view>
            <view class="form-item">
                <view class="title">部门:</view>
                <view class="righton">
                    <input v-model="baseInfo.HDeptName" disabled/>
                </view>
            </view>
        </view>
        <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
        <view class="list" v-for="(item,index) in listData" :key="index" @tap="toSon(item)">
            <uni-card :title="item.物料代码" :extra="'No. ' + Number(index+1)" style="margin: 10px;">
                <view class="card-detail">
                    <view class="detail">
                        <text>物料名称:</text>{{item.物料名称}}
                    </view>
                    <view class="detail">
                        <text>规格型号:</text>{{item.规格型号}}
                    </view>
                    <view class="detail">
                        <text>订单数量:</text>{{item.数量}}
                    </view>
                </view>
    <view class="content">
        <view class="form">
            <view class="form-item">
                <view class="title"><text>*</text>条码:</view>
                <view class="right" style="width: 380rpx">
                    <input :focus="HBarCodeFocus" v-model="HBarCode" placeholder="请扫描(或输入)条码"
                        @confirm="getCode(HBarCode)" />
                </view>
                <uni-icons type="scan" style="
            margin-left: 10rpx;
            background-color: #3a78ff;
            padding: 6rpx;
            color: #fff;
            border-radius: 100%;
          " size="20" @click="toScanCode"></uni-icons>
            </view>
            <view class="form-item">
                <view class="title">单据号:</view>
                <view class="righton">
                    <input v-model="baseInfo.HBillNo" disabled />
                </view>
            </view>
            <view class="form-item">
                <view class="title">供应商:</view>
                <view class="righton">
                    <input v-model="baseInfo.HSupName" disabled />
                </view>
            </view>
            <view class="form-item">
                <view class="title">部门:</view>
                <view class="righton">
                    <input v-model="baseInfo.HDeptName" disabled />
                </view>
            </view>
        </view>
        <view class="button-groups">
            <view :class="MultiCodePrint ? 'show' : 'hidden'">
                <button @click="execMultiPrint" type="default" class="btn-c">打印</button>
            </view>
            <view>
                <button @click="changePrintMode" type="default" class="btn-c">
                    {{ MultiCodePrint ? "单条码打印" : "多条码打印" }}
                </button>
            </view>
        </view>
        <view style="width: 100%; height: 16rpx; background-color: #e5e5e5"></view>
            </uni-card>
        </view>
        <view class="over" v-if="listData.length == 0">暂无数据</view>
        <view class="over" v-if="listData.length != 0">已到底</view>
    </view>
        <view class="list" v-for="(item, index) in listData" :key="index" @tap="toSon(item)">
            <uni-card :class="item['isActive'] ? 'active' : ''" :title="item.物料代码" :extra="'No. ' + Number(index + 1)"
                style="margin: 10px">
                <view class="card-detail">
                    <view class="detail"> <text>物料名称:</text>{{ item.物料名称 }} </view>
                    <view class="detail"> <text>规格型号:</text>{{ item.规格型号 }} </view>
                    <view class="detail"> <text>订单数量:</text>{{ item.数量 }} </view>
                    <view class="detail"> <text>款号:</text>{{ item.款号 }} </view>
                </view>
            </uni-card>
        </view>
        <view class="over" v-if="listData.length == 0">暂无数据</view>
        <view class="over" v-if="listData.length != 0">已到底</view>
        <labelPrinterComponentVue ref="labelPrinter" :printInfo="printInfo" :printMode="'cpcl'">
        </labelPrinterComponentVue>
    </view>
</template>
<script>
    import { getUserInfo } from "@/utils/auth.js";
    export default {
        data() {
            return {
                HBarCodeFocus: false,
                userInfo:getUserInfo(),
                serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API',
                HBarCode:'',
                baseInfo:{
                    HBillNo:'',
                    HSupName:'',
                    HDeptName:'',
                    HInterID:'',
                },
                sWhere:'',
                listData:[],
            }
        },
        onLoad() {
            this.HBarCodeFocus = true
        },
        methods: {
            async refreshBarCodeState() {
                this.HBarCodeFocus = false
                await this.$nextTick(() => {
                    this.HBarCodeFocus = true
                    this.HBarCode = ""
                })
            },
             playSound(e){
                const innerAudioContext = uni.createInnerAudioContext();
                if(e == 1){
                    innerAudioContext.src = '/static/success.wav';
                }else{
                    innerAudioContext.src = '/static/jingbao.wav';
                }
                innerAudioContext.play(); // 播放音频
            },
            //扫码
            toScanCode(){
                var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
                mpaasScanModule.mpaasScan({
                    'hideAlbum': true,
                    'timeoutInterval':'10', //超时时间
                    'timeoutText':'未识别到二维码' //超时提醒
                },(ret) => {
                    console.log(ret.resp_result)
                    this.HBarCode = ret.resp_result
                    this.getCode(this.HBarCode)
                })
            },
            //扫条码处理
            getCode(HBarCode){
                if(!HBarCode){
                    this.playSound(0)
                    this.refreshBarCodeState()
                    uni.showToast({
                        title:'条码不能为空',
                        icon:'none'
                    })
                }else{
                    uni.request({
                        url: this.serverUrl + '/Cg_POInStockBill/GetCg_POInStockBill_PDA',
                        data: { HBillno: HBarCode },
                        success: (res) => {
                            console.log('扫码返回',res.data.data);
                            this.HBarCode = ''
                            if(res.data.count == 1){
                                this.playSound(1)
                                var data = res.data.data
                                this.baseInfo = {
                                    HBillNo:data[0].单据号,
                                    HSupName:data[0].供应商,
                                    HDeptName:data[0].部门,
                                    HInterID:data[0].hmainid,
                                }
                                this.listData = data
                            }else{
                                this.playSound(0)
                                this.refreshBarCodeState()
                                uni.showToast({
                                    title:res.data.Message,
                                    icon:'none'
                                })
                            }
                        },
                        fail: (res) => {
                            this.playSound(0)
                            this.refreshBarCodeState()
                            console.log(res);
                            uni.showToast({
                                title:'接口请求失败',
                                icon:'none'
                            })
                        },
                    });
                }
            },
            toSon(item){
                uni.navigateTo({
                    url:'./table_son?OperationType=1&closeType=1&linterid=' + item.hmainid + '&hsubid=' + item.hsubid
                })
            }
        }
    }
    import {
        getUserInfo
    } from "@/utils/auth.js";
    import labelPrinterComponentVue from "../../components/labelPrinterComponent/labelPrinterComponent.vue";
    export default {
        data() {
            return {
                printInfo: '',
                MultiCodePrint: false,
                HBarCodeFocus: false,
                userInfo: getUserInfo(),
                serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
                HBarCode: '',
                baseInfo: {
                    HBillNo: '',
                    HSupName: '',
                    HDeptName: '',
                    HInterID: '',
                },
                sWhere: '',
                listData: [],
                printableWaitCache: [],
                printableBaseInfo: {
                    HBarCode: '',
                    HMainID: '',
                    HSubID: '',
                    HBillNo: '',
                    HMaterID: '',
                    HMaterNumber: '',
                    HMaterName: '',
                    HMaterModel: '',
                    HQty: '',
                    HMinQty: '',
                    HSupID: '',
                    SHdate: '',
                    HMTONo: '',
                    HBatchNo: '',
                    HBQty: '',
                    HSupID: '',
                    HSupNumber: '',
                    HSupName: '',
                    HUnitID: '',
                    HBillType: '',
                    HPcsName: '',
                    HSupNameShort: '',
                    HMTONo: '',
                    HDate: '',
                    HSourceBillNo: '',
                    HMaker: getUserInfo()["Czymc"],
                    HCoilNO: '',
                    HFurnaceNO: '',
                    HFactory: '',
                    HSupMaterNumber: '',
                },
            }
        },
        onLoad() {
            this.HBarCodeFocus = true
        },
        components: {
            labelPrinterComponentVue
        },
        methods: {
            changePrintMode() {
                this.MultiCodePrint = !this.MultiCodePrint
                if (this.MultiCodePrint == false) {
                    this.printableWaitCache = []
                    this.listData.forEach(item => {
                        if(typeof item.isActive != 'undefined'){
                            item.isActive = false
                        }
                    })
                }
            },
            async refreshBarCodeState() {
                this.HBarCodeFocus = false
                await this.$nextTick(() => {
                    this.HBarCodeFocus = true
                    this.HBarCode = ""
                })
            },
            playSound(e) {
                const innerAudioContext = uni.createInnerAudioContext();
                if (e == 1) {
                    innerAudioContext.src = '/static/success.wav';
                } else {
                    innerAudioContext.src = '/static/jingbao.wav';
                }
                innerAudioContext.play(); // 播放音频
            },
            //扫码
            toScanCode() {
                var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
                mpaasScanModule.mpaasScan({
                    'hideAlbum': true,
                    'timeoutInterval': '10', //超时时间
                    'timeoutText': '未识别到二维码' //超时提醒
                }, (ret) => {
                    console.log(ret.resp_result)
                    this.HBarCode = ret.resp_result
                    this.getCode(this.HBarCode)
                })
            },
            //扫条码处理
            getCode(HBarCode) {
                if (!HBarCode) {
                    this.playSound(0)
                    this.refreshBarCodeState()
                    uni.showToast({
                        title: '条码不能为空',
                        icon: 'none'
                    })
                } else {
                    uni.request({
                        url: this.serverUrl + '/Cg_POInStockBill/GetCg_POInStockBill_PDA',
                        data: {
                            HBillno: HBarCode
                        },
                        success: (res) => {
                            console.log('扫码返回', res.data.data);
                            this.HBarCode = ''
                            if (res.data.count == 1) {
                                this.playSound(1)
                                var data = res.data.data
                                this.baseInfo = {
                                    HBillNo: data[0].单据号,
                                    HSupName: data[0].供应商,
                                    HDeptName: data[0].部门,
                                    HInterID: data[0].hmainid,
                                }
                                this.listData = data
                            } else {
                                this.playSound(0)
                                this.refreshBarCodeState()
                                uni.showToast({
                                    title: res.data.Message,
                                    icon: 'none'
                                })
                            }
                        },
                        fail: (res) => {
                            this.playSound(0)
                            this.refreshBarCodeState()
                            console.log(res);
                            uni.showToast({
                                title: '接口请求失败',
                                icon: 'none'
                            })
                        },
                    });
                }
            },
            toSon(item) {
                // 根据条件判断是否去子页面,如果是多条码打印模式,则存入缓存
                if (!this.MultiCodePrint) {
                    uni.navigateTo({
                        url: './table_son?OperationType=1&closeType=1&linterid=' + item.hmainid + '&hsubid=' +
                            item
                            .hsubid
                    })
                } else {
                    this.setPrintableWaitInfo(item)
                }
            },
            setPrintableWaitInfo(item) {
                if (typeof item['isActive'] == 'undefined') {
                    // 对象第一次被点击
                    this.$set(item, 'isActive', true)
                } else {
                    item['isActive'] = !item['isActive']
                }
                if (item.isActive) {
                    this.printableWaitCache.push(item)
                } else {
                    let index = this.printableWaitCache.findIndex(elem => {
                        return item.HMaterID == elem.HMaterID && item["款号"] == elem["款号"]
                    })
                    if (index != -1) {
                        this.printableWaitCache.splice(index, 1)
                    }
                }
            },
            // 获取存储条码信息,需同步
            async storePrinterInfo(printerOne) {
                return new Promise((resolve, reject) => {
                    let printInfoClone = JSON.parse(JSON.stringify(this.printableBaseInfo))
                    printInfoClone = Object.assign(printInfoClone, {
                        HMainID: printerOne.hmainid,
                        HSubID: printerOne.hsubid,
                        HBillNo: printerOne.单据号,
                        HSourceBillNo: printerOne.单据号,
                        HBillType: printerOne['HBillType'],
                        HInnerBillNo: printerOne.采购订单号,
                        HMaterID: printerOne.HMaterID,
                        HMaterNumber: printerOne.物料代码,
                        HMaterName: printerOne.物料名称,
                        HMaterModel: printerOne.规格型号,
                        HQty: printerOne.数量,
                        HMinQty: printerOne.数量,
                        HSupID: printerOne.HSupID,
                        SHdate: printerOne.审核日期,
                        HBatchNo: printerOne['批号'],
                        HSupID: printerOne['HSupID'],
                        HSupNumber: printerOne['供应商代码'],
                        HSupName: printerOne['供应商'],
                        HSupMaterNumber: printerOne['供应商物料编码'],
                        HUnitID: printerOne['HUnitID'],
                        HPcsName: printerOne['计量单位'],
                        HSupNameShort: printerOne['供应商简称'],
                        HMTONo: printerOne['计划跟踪号'],
                        HDate: printerOne['日期'],
                        HCoilNO: printerOne['款号'],
                        HFurnaceNO: printerOne['分组'],
                        HFactory: printerOne['客户编号'],
                    })
                    let HBarCode = this.getHBarCode({
                        HBillNo: printInfoClone.HBillNo,
                        HSubID: printInfoClone.HSubID,
                        HMaterNumber: printInfoClone.HMaterNumber,
                        HMTONo: printInfoClone.HMTONo,
                        HQty: printInfoClone.HQty
                    })
                    printInfoClone.HBarCode = HBarCode
                    console.log('printInfoClone: ',printInfoClone);
                    let sMain = []
                    sMain[0] = printInfoClone
                    let sMainStr = JSON.stringify(sMain);
                    //获取选择的组织
                    let HOrgType = uni.getStorageSync('Organization');
                    //获取选择的工厂代码
                    let CampanyName = "xxx";
                    //获取选择的源单类型
                    let HSourceBillType = "收料通知单";
                    //获取选择的条码类型
                    let HSelectBarCodeType = "品种条码";
                    //获取当前登录人员
                    let UserName = uni.getStorageSync('HUserName');
                    let sMainSub = sMainStr + ';' + HOrgType + ';' + HSourceBillType + ';' +
                        HSelectBarCodeType + ';' +
                        CampanyName + ';' + UserName + ';' + HBarCode + ';' + printInfoClone.HFactory +
                        ';' + printInfoClone.HCoilNO + ';' + printInfoClone.HFurnaceNO + '';
                    uni.request({
                        url: this.serverUrl + '/Sc_BarCode/SaveBarCode_NoGenerate',
                        method: 'POST',
                        data: {
                            msg: sMainSub,
                            CampanyName: CampanyName
                        },
                        success: (res) => {
                            if (res.data.count == 1) {
                                resolve(printInfoClone)
                            } else {
                                reject()
                            }
                        },
                        fail: (res) => {
                            reject()
                        },
                    });
                })
            },
            getHBarCode({
                HBillNo,
                HSubID,
                HMaterNumber,
                HMTONo,
                HQty
            }) {
                return `${HBillNo}@${HSubID}@${HMaterNumber || ''}@${HMTONo || ''}@${HQty || 0}`
            },
            getPrintCodeCpcl(barCodeStr, printerInfoModel) {
                console.log('printerInfoModel: ',printerInfoModel);
                let {
                    HSupNameShort,
                    HFactory,
                    HMaterNumber,
                    HMaterName,
                    HCoilNO,
                    HSupMaterNumber,
                    HFurnaceNO,
                    HMaterModel,
                    HQty,
                    HPcsName,
                    HDate,
                    HInnerBillNo
                } = printerInfoModel
                console.log("HFurnaceNO", HFurnaceNO)
                let pcsInfo = HPcsName ? '(' + HPcsName + ')' : ''
                let HFurnaceNo = HFurnaceNO.split('.')
                let printCodeCpclStr = new String()
                return printCodeCpclStr.concat(
                    "! 0 200 200 400 1\r\n",
                    "PAGE-WIDTH 608\r\n",
                    "SETQRVER 3\r\n",
                    "B QR 475 15 Q 0 U 3\r\n",
                    `LA,${barCodeStr}\r\n`,
                    "ENDQR\r\n",
                    `T 24 0 0 30 供应商: ${HSupNameShort}\r\n`,
                    `T 55 0 0 55 (Supplier)\r\n`,
                    `T 24 0 220 30 客户编号: ${HFactory || ''}\r\n`,
                    `T 55 0 220 55 (Consumer No.)\r\n`,
                    `T 24 0 0 75 物料编码: ${HMaterNumber}\r\n`,
                    `T 55 0 0 100 (Material Number)\r\n`,
                    `T 24 0 0 120 物料名称: ${HMaterName}\r\n`,
                    `T 55 0 0 145 (Material Code)\r\n`,
                    `T 24 0 0 165 款号: ${HCoilNO || ''}\r\n`,
                    `T 55 0 0 190 (Style No.)\r\n`,
                    `T 24 0 300 165 供应商料号: ${HSupMaterNumber}\r\n`,
                    `T 55 0 300 190 (Supplier Sku No.)\r\n`,
                    `T 24 0 0 210 分组: ${HFurnaceNo[1] || HFurnaceNo[0] || ''}\r\n`,
                    `T 55 0 0 235 (Group)\r\n`,
                    `T 24 0 300 210 规格: ${HMaterModel}\r\n`,
                    `T 55 0 300 235 (SKU NO.)\r\n`,
                    `T 24 0 0 255 数量: ${ parseFloat(HQty || 0).toFixed(0) } ${pcsInfo}\r\n`,
                    `T 55 0 0 280 (Quantity)\r\n`,
                    `T 24 0 300 255 日期: ${HDate || ''}\r\n`,
                    `T 55 0 300 280 (Date)\r\n`,
                    `T 24 0 0 300 检验员: \r\n`,
                    `L 80 325 230 325 3\r\n`,
                    `T 55 0 0 325 (QC)\r\n`,
                    `T 24 0 240 300 采购单号: ${HInnerBillNo || ''}\r\n`,
                    `T 55 0 300 325 (Purchase Order No.)\r\n`,
                    `T 24 0 0 345 检验结果: \r\n`,
                    `T 55 0 0 370 (Inspection status)\r\n`,
                    `BOX 240 345 260 365 4\r\n`,
                    `T 24 0 270 345 合格\r\n`,
                    `T 55 0 250 370 (Pass)\r\n`,
                    `BOX 340 345 360 365 4\r\n`,
                    `T 24 0 370 345 不合格\r\n`,
                    `T 55 0 370 370 (Fail)\r\n`,
                    `BOX 460 345 480 365 4\r\n`,
                    `T 24 0 490 345 特采\r\n`,
                    `T 55 0 440 370 (Spec. accepted)\r\n`,
                    `FORM\r\n`,
                    `PRINT`,
                ).toString()
            },
            async execMultiPrint() {
                if (this.$printer.isConnected() === false) {
                    this.$refs.labelPrinter.openPopup()
                    return
                }
                if (this.printableWaitCache.length == 0) {
                    return uni.showToast({
                        icon: 'none',
                        title: '无打印内容!!'
                    })
                }
                console.log(this.printableWaitCache);
                let printerOne = {}
                let printContent = []
                let printInfoBuffer = []
                let count = 0
                try {
                    for (printerOne of this.printableWaitCache) {
                        // 同步提交条码存储请求
                        let printedInfo = await this.storePrinterInfo(printerOne)
                        // 条码存储成功后 获取打印指令
                        let printCode = this.getPrintCodeCpcl(printedInfo.HBarCode, printedInfo)
                        printContent.push(printCode)
                        count++;
                        if (count == 10) {
                            printInfoBuffer.push(printContent.join("\r\n"))
                            count = 0
                            printContent = []
                        }
                    }
                    printInfoBuffer.push(printContent.join("\r\n"))
                    this.printInfo = JSON.stringify(printInfoBuffer)
                    printInfoBuffer = []
                    await this.$nextTick(() => {
                        this.$refs.labelPrinter.execPrint()
                    })
                } catch (e) {
                    console.error('e: ',e);
                    uni.showModal({
                        title: '温馨提示',
                        content: `物料名: ${printerOne['物料名称']} 款号: ${printerOne['款号']} 出现错误,已退出打印流程`,
                        showCancel: false
                    })
                }
            }
        }
    }
</script>
<style lang="scss" scoped>
    .form{
        width: 640rpx;
        margin: 20rpx auto;
    }
    .form-item{
        display: flex;
        align-items: center;
        font-size: 28rpx;
        padding: 6rpx 0;
        .title{
            width: 180rpx;
            text{
                color: red;
                font-weight: bold;
            }
        }
        .right{
            width: 450rpx;
            border-radius: 22rpx;
            border: 1px solid #acacac;
        }
        .righton{
            width: 450rpx;
            border-radius: 22rpx;
            border: 1px solid #e4e4e4;
            background-color: #e4e4e4;
        }
        input{
            width: 100%;
            padding: 8rpx 20rpx;
            font-size: 30rpx;
        }
    }
    .buttons{
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 20rpx;
        button{
            border-radius: 50rpx;
            width: 180rpx;
            height: 66rpx;
            line-height: 66rpx;
            font-size: 28rpx;
        }
        .btn-a{
            background-color: #acacac;
            color: #fff;
        }
        .btn-b{
            background-color: #41a863;
            color: #fff;
        }
        .btn-c{
            background-color: #3a78ff;
            color: #fff;
        }
    }
    .list{
        width: 100%;
        .card-detail{
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            line-height: 120%;
            .detail{
                // width: 50%;
                font-size: 26rpx;
                margin-bottom: 12rpx;
                color: #555;
                margin-right: 20rpx;
                text{
                    color: #999;
                    font-size: 26rpx;
                }
            }
        }
        .more{
            color: #888;
            font-size: 24rpx;
            display: flex;
            border-top: 1px solid #eee;
            padding-top: 20rpx;
            .part{
                width: 50%;
                text-align: center;
            }
        }
    }
    .show {
        display: block;
    }
</style>
    .active {
        background-color: rgba(0, 122, 255, 0.2);
    }
    .hidden {
        display: none;
    }
    .form {
        width: 640rpx;
        margin: 20rpx auto;
    }
    .form-item {
        display: flex;
        align-items: center;
        font-size: 28rpx;
        padding: 6rpx 0;
        .title {
            width: 180rpx;
            text {
                color: red;
                font-weight: bold;
            }
        }
        .right {
            width: 450rpx;
            border-radius: 22rpx;
            border: 1px solid #acacac;
        }
        .righton {
            width: 450rpx;
            border-radius: 22rpx;
            border: 1px solid #e4e4e4;
            background-color: #e4e4e4;
        }
        input {
            width: 100%;
            padding: 8rpx 20rpx;
            font-size: 30rpx;
        }
    }
    .buttons {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 20rpx;
        button {
            border-radius: 50rpx;
            width: 180rpx;
            height: 66rpx;
            line-height: 66rpx;
            font-size: 28rpx;
        }
        .btn-a {
            background-color: #acacac;
            color: #fff;
        }
        .btn-b {
            background-color: #41a863;
            color: #fff;
        }
        .btn-c {
            background-color: #3a78ff;
            color: #fff;
        }
    }
    .button-groups {
        box-sizing: border-box;
        padding: 0 60rpx 20rpx 60rpx;
        display: flex;
        flex-direction: row;
        justify-content: right;
        gap: 20rpx;
        button {
            border-radius: 50rpx;
            // width: 180rpx;
            height: 66rpx;
            line-height: 66rpx;
            font-size: 28rpx;
        }
        .btn-a {
            background-color: #acacac;
            color: #fff;
        }
        .btn-b {
            background-color: #41a863;
            color: #fff;
        }
        .btn-c {
            background-color: #3a78ff;
            color: #fff;
        }
    }
    .list {
        width: 100%;
        .card-detail {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            line-height: 120%;
            .detail {
                // width: 50%;
                font-size: 26rpx;
                margin-bottom: 12rpx;
                color: #555;
                margin-right: 20rpx;
                text {
                    color: #999;
                    font-size: 26rpx;
                }
            }
        }
        .more {
            color: #888;
            font-size: 24rpx;
            display: flex;
            border-top: 1px solid #eee;
            padding-top: 20rpx;
            .part {
                width: 50%;
                text-align: center;
            }
        }
    }
</style>
pages/shouliaotongzhi/table_son.vue
@@ -394,7 +394,8 @@
                            `${this.baseInfo.HBillNo}@${this.baseInfo.HSubID}@${this.baseInfo.HMaterNumber || ''}@${this.baseInfo.HMTONo || ''}@${this.baseInfo.HQty || 0}`
                        let pcsInfo = this.baseInfo.HPcsName ? '(' + this.baseInfo.HPcsName + ')' : ''
                        let HFurnaceNO = this.baseInfo.HFurnaceNO.split('.')
                        printContent.push(`! 0 200 200 400 1
                        printContent.push(
`! 0 200 200 400 1
PAGE-WIDTH 608
SETQRVER 3
B QR 475 15 Q 0 U 3