chenhaozhe
17 小时以前 8ab8e369a6c1403cd2cc144935ad79b27481e206
Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev
2个文件已修改
1 文件已重命名
202 ■■■■ 已修改文件
pages.json 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tiaomachaima/tiaomachaimaCopy_HK.vue 194 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json
@@ -471,6 +471,12 @@
                "navigationBarTitleText": "条码拆码2"
            }
        },
        {
            "path": "pages/tiaomachaima/tiaomachaimaCopy_HK",
            "style": {
                "navigationBarTitleText": "条码拆码3"
            }
        },
        {
            "path": "pages/wuliaosaoma/wuliaosaoma",
            "style": {
pages/index/index.vue
@@ -340,7 +340,7 @@
                    {
                        "img": "../../static/icon/icon21.png",
                        "text": "条码拆码",
                        "url": "/pages/tiaomachaima/tiaomachaimaCopy",
                        "url": "/pages/tiaomachaima/tiaomachaimaCopy_HK",
                        "id": 25,
                        "hidden": false
                    },
pages/tiaomachaima/tiaomachaimaCopy_HK.vue
File was renamed from pages/tiaomachaima/tiaomachaimaCopy.vue
@@ -33,7 +33,7 @@
                    :disabled="cantGenerate">生成</button>
                <button type="default" :class="cantPrint ? 'btn-disabled' : 'btn-c'" @click="PrintHBarCode"
                    :disabled="cantPrint">打印</button>
                    <button type="primary" @click="printerLabel">测试打印</button>
                    <button type="primary" @click="printerLabel2">测试打印2</button>
            </view>
        </view>
        <view class="divide"></view>
@@ -48,17 +48,36 @@
                        <text>条码编号:</text>{{barCodeInfo['条码编号'] || ''}}
                    </view>
                    <view class="detail">
                        <text>条码原数量:</text>{{barCodeInfo['数量'] || '0'}}
                    </view>
                    <view class="detail">
                        <text>剩余数量:</text>{{barCodeInfo['剩余数量'] || '0'}}
                    </view>
                    <view class="dWetail">
                        <text>物料编码:</text>{{barCodeInfo['物料代码'] || ''}}
                        <text>供应商名称:</text>{{barCodeInfo['供应商'] || ''}}
                    </view>
                    <view class="detail">
                        <text>物料名称:</text>{{barCodeInfo['物料名称'] || ''}}
                    </view>
                    <view class="detail">
                        <text>物料简称:</text>{{barCodeInfo['物料简称'] || ''}}
                    </view>
                    <view class="detail">
                        <text>条码原数量:</text>{{barCodeInfo['条码剩余数量'] || '0'}}
                    </view>
                    <view class="detail">
                        <text>剩余数量:</text>{{barCodeInfo['剩余数量'] || '0'}}
                    </view>
                    <view class="detail">
                        <text>工号:</text>{{barCodeInfo['工号'] || ''}}
                    </view>
                    <view class="detail">
                        <text>生产日期:</text>{{barCodeInfo['生产日期'] || ''}}
                    </view>
                    <view class="detail">
                        <text>流水号:</text>{{barCodeInfo['流水号'] || ''}}
                    </view>
                    <view class="detail">
                        <text>打印日期:</text>{{barCodeInfo['打印日期'] || ''}}
                    </view>
                    <view class="dWetail">
                        <text>物料编码:</text>{{barCodeInfo['物料代码'] || ''}}
                    </view>
                    <view class="detail">
                        <text>规格型号:</text>{{barCodeInfo['规格型号'] || ''}}
                    </view>
@@ -79,10 +98,22 @@
                            <text>拆分数量:</text>{{item['HSplitNum'] || '0'}}
                        </view>
                        <view class="detail">
                            <text>物料代码:</text>{{item['HNumber'] || ''}}
                            <text>供应商名称:</text>{{barCodeInfo['供应商'] || ''}}
                        </view>
                        <view class="detail">
                            <text>物料名称:</text>{{item['HName'] || ''}}
                            <text>物料名称:</text>{{barCodeInfo['物料名称'] || ''}}
                        </view>
                        <view class="detail">
                            <text>物料简称:</text>{{barCodeInfo['物料简称'] || ''}}
                        </view>
                        <view class="detail">
                            <text>工号:</text>{{barCodeInfo['工号'] || ''}}
                        </view>
                        <view class="detail">
                            <text>生产日期:</text>{{barCodeInfo['生产日期'] || ''}}
                        </view>
                        <view class="detail">
                            <text>流水号:</text>{{barCodeInfo['流水号'] || ''}}
                        </view>
                        <view class="detail">
                            <text>规格型号:</text>{{item['HModel'] || ''}}
@@ -159,9 +190,10 @@
                });
            
            },
            printerLabel(item) {
            printerLabel() {
                console.log('测试打印');
                const formatDate = (date = new Date()) =>
                  date.toISOString().split('T')[0];
                printer.setLineSpacing({
                    spacing: 1.2
                });
@@ -170,12 +202,13 @@
                printer.setFontSize({
                    fontSize: 1
                });
                //打印母标签
                printer.printText2({
                    offset: 1,
                    fontSize: 2,
                    isBold: false,
                    isUnderLine: false,
                    content: '出库单号:MATO00049684\r\n',
                    content: '供应商名称:'+this.barCodeInfo['供应商']+'\r\n'
                });
                
                printer.printText2({
@@ -183,68 +216,52 @@
                    fontSize: 2,
                    isBold: false,
                    isUnderLine: false,
                    content: '供应商名称:慈溪瑞益电子有限公司\r\n'
                });
                printer.printText2({
                    offset: 1,
                    fontSize:2,
                    isBold: false,
                    isUnderLine: false,
                    content: '物料代码:R.06.17.02.18002\r\n'
                    content: '物料代码:'+this.barCodeInfo['物料代码']+'\r\n'
                });
                printer.printText2({
                    offset: 1,
                    fontSize: 2,
                    isBold: false,
                    isUnderLine: false,
                    content: '物料简称:12SH 出风网 注塑灰011(同GE灰)\r\n'
                });
                // printer.printText2({
                //     offset: 1,
                //     fontSize:2,
                //     isBold: false,
                //     isUnderLine: false,
                //     content: '物料名称:12SH 出风网 注塑灰011(同GE灰)\r\n'
                // });
                printer.printText2({
                    offset: 1,
                    fontSize:2,
                    isBold: false,
                    isUnderLine: false,
                    content: '数量:1\r\n'
                    content: '物料简称:'+this.barCodeInfo['物料简称']+'\r\n'
                });
                printer.printText2({
                    offset: 1,
                    fontSize: 2,
                    isBold: false,
                    isUnderLine: false,
                    content: '工号:1\r\n'
                    content: '数量:'+this.barCodeInfo['剩余数量']+'\r\n'
                });
                printer.printText2({
                    offset: 1,
                    fontSize: 2,
                    isBold: false,
                    isUnderLine: false,
                    content: '生产日期:2025-8-13\r\n'
                    content: '工号:'+this.barCodeInfo['工号']+'\r\n'
                });
                printer.printText2({
                    offset: 1,
                    fontSize: 2,
                    isBold: false,
                    isUnderLine: false,
                    content: '流水号:000001\r\n'
                    content: '生产日期:'+this.barCodeInfo['生产日期']+'\r\n'
                });
                printer.printText2({
                    offset: 1,
                    fontSize: 2,
                    isBold: false,
                    isUnderLine: false,
                    content: '打印日期:2025-8-13\r\n'
                    content: '流水号:'+this.barCodeInfo['流水号']+'\r\n'
                });
                printer.printText2({
                    offset: 1,
                    fontSize: 2,
                    isBold: false,
                    isUnderLine: false,
                    content: '打印日期:'+this.formatDate()+'\r\n'
                });
                printer.printQR2({
                    text: 'title',
                    text: this.barCodeInfo['条码编号'],
                    height: 120,
                    offset: 3
                });
@@ -252,6 +269,90 @@
                    line_length: 5
                });
                printer.printGoToNextMark();
                //打印子标签
                printer.printText2({
                    offset: 1,
                    fontSize: 2,
                    isBold: false,
                    isUnderLine: false,
                    content: '供应商名称:'+this.barCodeInfo['供应商']+'\r\n'
                });
                printer.printText2({
                    offset: 1,
                    fontSize:2,
                    isBold: false,
                    isUnderLine: false,
                    content: '物料代码:'+this.barCodeInfo['物料代码']+'\r\n'
                });
                printer.printText2({
                    offset: 1,
                    fontSize: 2,
                    isBold: false,
                    isUnderLine: false,
                    content: '物料简称:'+this.barCodeInfo['物料简称']+'\r\n'
                });
                printer.printText2({
                    offset: 1,
                    fontSize:2,
                    isBold: false,
                    isUnderLine: false,
                    content: '数量:'+this.barCodeSplitInfo[0]['HSplitNum']+'\r\n'
                });
                printer.printText2({
                    offset: 1,
                    fontSize: 2,
                    isBold: false,
                    isUnderLine: false,
                    content: '工号:'+this.barCodeInfo['工号']+'\r\n'
                });
                printer.printText2({
                    offset: 1,
                    fontSize: 2,
                    isBold: false,
                    isUnderLine: false,
                    content: '生产日期:'+this.barCodeInfo['生产日期']+'\r\n'
                });
                printer.printText2({
                    offset: 1,
                    fontSize: 2,
                    isBold: false,
                    isUnderLine: false,
                    content: '流水号:'+this.barCodeInfo['流水号']+'\r\n'
                });
                printer.printText2({
                    offset: 1,
                    fontSize: 2,
                    isBold: false,
                    isUnderLine: false,
                    content: '打印日期:'+this.formatDate()+'\r\n'
                });
                printer.printQR2({
                    text: this.barCodeSplitInfo[0]['HBarCode'],
                    height: 120,
                    offset: 3
                });
                printer.printLine({
                    line_length: 5
                });
                printer.printGoToNextMark();
                console.log('测试打印QR结束');
            },
            printerLabel2() {
                console.log('测试打印');
                const formatDate = (date = new Date()) =>
                  date.toISOString().split('T')[0];
                console.log(formatDate)
                CommonUtils.showTips({
                    message:'母标签\r\n'+'供应商名称:'+this.barCodeInfo['供应商']+'\r\n'+'物料代码:'+this.barCodeInfo['物料代码']+'\r\n'+'物料简称:'+this.barCodeInfo['物料简称']+'\r\n'
                    +'数量:'+this.barCodeInfo['剩余数量']+'\r\n'+'工号:'+this.barCodeInfo['工号']+'\r\n'+'生产日期:'+this.barCodeInfo['生产日期']+'\r\n'+'流水号:'+this.barCodeInfo['流水号']+'\r\n'
                    +'打印日期:'+formatDate()+'\r\n'+this.barCodeInfo['条码编号']+'\r\n'
                    +'子标签\r\n'+'供应商名称:'+this.barCodeInfo['供应商']+'\r\n'+'物料代码:'+this.barCodeInfo['物料代码']+'\r\n'+'物料简称:'+this.barCodeInfo['物料简称']+'\r\n'
                    +'数量:'+this.barCodeSplitInfo[0]['HSplitNum']+'\r\n'+'工号:'+this.barCodeInfo['工号']+'\r\n'+'生产日期:'+this.barCodeInfo['生产日期']+'\r\n'+'流水号:'+this.barCodeInfo['流水号']+'\r\n'
                    +'打印日期:'+formatDate()+'\r\n'+this.barCodeSplitInfo[0]['HBarCode']+'\r\n'
                    ,
                })
                
                console.log('测试打印QR结束');
            },
@@ -520,7 +621,8 @@
                    
                    // 打印成功后重置状态
                    uni.hideLoading();
                    //this.printerLabel();//打印
                    this.printerLabel();//打印
                    this.isPrinting = false;
                } catch (error) {
                    console.error('打印失败:', error);
                    uni.hideLoading();
@@ -575,10 +677,10 @@
                            duration: 2000
                        });
                        //成功后设置状态
                        self.isPrinting = false;
                        //self.isPrinting = false;
                        //this.resetButtonState();
                    } else if (e.key == 3) {
                        self.isPrinting = false;
                        //self.isPrinting = false;
                        uni.showToast({
                            title: '缺纸',
                            duration: 2000