chenhaozhe
2025-09-01 4c871e4c1afee9f9cb4a50378b074684de606e37
Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev
3个文件已修改
1个文件已添加
1284 ■■■■■ 已修改文件
.hbuilderx/launch.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 778 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/tab2.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tiaomachaima/tiaomachaima2.vue 497 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.hbuilderx/launch.json
@@ -25,7 +25,7 @@
            "localRepoPath" : "D:/WorkBench/ZY_APP_Dev/STUWMS/unpackage/debug",
            "openVueDevtools" : true,
            "packageName" : "com.shebeiguanli.www",
            "playground" : "custom",
            "playground" : "standard",
            "type" : "uni-app:app-android"
        }
    ]
pages.json
@@ -2,7 +2,783 @@
    "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
        {
            "path": "pages/index/login",
            "style": {
                "navigationBarTitleText": "登录",
                "navigationStyle": "custom"
            }
        },
        {
            "path": "pages/index/index",
            "style": {
                "navigationBarTitleText": "首页",
                "navigationStyle": "custom"
            }
        },
        {
            "path": "pages/index/tab1",
            "style": {
                "navigationBarTitleText": "车间工序"
            }
        },
        {
            "path": "pages/index/tab2",
            "style": {
                "navigationBarTitleText": "单据列表"
            }
        },
        {
            "path": "pages/index/mine",
            "style": {
                "navigationBarTitleText": "个人中心",
                // "navigationStyle": "custom"
                "navigationBarTextStyle": "white",
                "navigationBarBackgroundColor": "#65a2fb"
            }
        },
        {
            "path": "pages/shebeilvli/form",
            "style": {
                "navigationBarTitleText": "设备状态分析"
            }
        },
        {
            "path": "pages/shebeilvli/table",
            "style": {
                "navigationBarTitleText": "设备履历",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/shebeilvli/table_son",
            "style": {
                "navigationBarTitleText": "设备履历子表"
            }
        },
        {
            "path": "pages/baoyangjihua/form",
            "style": {
                "navigationBarTitleText": "设备保养计划单"
            }
        },
        {
            "path": "pages/baoyangjihua/table",
            "style": {
                "navigationBarTitleText": "设备保养计划单",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/baoyangjihua/table_son",
            "style": {
                "navigationBarTitleText": "保养计划子表"
            }
        },
        {
            "path": "pages/baoyangjilu/form",
            "style": {
                "navigationBarTitleText": "设备保养记录单"
            }
        },
        {
            "path": "pages/baoyangjilu/table",
            "style": {
                "navigationBarTitleText": "设备保养记录单",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/baoyangjilu/table_son",
            "style": {
                "navigationBarTitleText": "保养记录子表"
            }
        },
        {
            "path": "pages/guzhangdengji/form",
            "style": {
                "navigationBarTitleText": "设备故障登记表"
            }
        },
        {
            "path": "pages/guzhangdengji/table",
            "style": {
                "navigationBarTitleText": "设备故障登记表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/shebeidangan/form",
            "style": {
                "navigationBarTitleText": "设备档案"
            }
        },
        {
            "path": "pages/shebeidangan/table",
            "style": {
                "navigationBarTitleText": "设备档案",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/shebeiweixiu/form",
            "style": {
                "navigationBarTitleText": "设备维修记录单"
            }
        },
        {
            "path": "pages/shebeiweixiu/table",
            "style": {
                "navigationBarTitleText": "设备维修记录单",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/weiwaigxIn/form",
            "style": {
                "navigationBarTitleText": "委外工序发出单"
            }
        },
        {
            "path": "pages/weiwaigxIn/table",
            "style": {
                "navigationBarTitleText": "委外工序发出单",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/weiwaigxOut/form",
            "style": {
                "navigationBarTitleText": "委外工序接收单"
            }
        },
        {
            "path": "pages/weiwaigxOut/table",
            "style": {
                "navigationBarTitleText": "委外工序接收单",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/weiwaigxOut/firstCheck",
            "style": {
                "navigationBarTitleText": "首件检验单",
                "enablePullDownRefresh": true
            }
        }, {
            "path": "pages/gongxuIn/form",
            "style": {
                "navigationBarTitleText": "工序进站接收单"
            }
        },
        {
            "path": "pages/gongxuIn/table",
            "style": {
                "navigationBarTitleText": "工序进站接收单",
                "enablePullDownRefresh": true
            }
        }, {
            "path": "pages/gongxuOut/form",
            "style": {
                "navigationBarTitleText": "工序出站汇报单"
            }
        },
        {
            "path": "pages/gongxuOut/table",
            "style": {
                "navigationBarTitleText": "工序出站汇报单",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/shebeiguanli/form",
            "style": {
                "navigationBarTitleText": "设备管理",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/shebeiguanli/table",
            "style": {
                "navigationBarTitleText": "设备管理",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/shebeiguanli/list",
            "style": {
                "navigationBarTitleText": "工单列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/baogong/form",
            "style": {
                "navigationBarTitleText": "产量汇报单",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/baogong/table",
            "style": {
                "navigationBarTitleText": "报工平台",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/baogong/list",
            "style": {
                "navigationBarTitleText": "工单列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/baogong/abnormal",
            "style": {
                "navigationBarTitleText": "异常反馈单",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/yichang/table",
            "style": {
                "navigationBarTitleText": "异常反馈单列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/yichang/form",
            "style": {
                "navigationBarTitleText": "异常反馈单",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/yichang/list",
            "style": {
                "navigationBarTitleText": "异常反馈处理单列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/caigouruku/table",
            "style": {
                "navigationBarTitleText": "采购入库列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/caigouruku/form",
            "style": {
                "navigationBarTitleText": "采购入库单",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/caigoutuiliao/table",
            "style": {
                "navigationBarTitleText": "采购退料列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/caigoutuiliao/form",
            "style": {
                "navigationBarTitleText": "采购退料单",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/xiaoshouchuku/table",
            "style": {
                "navigationBarTitleText": "销售出库列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/xiaoshouchuku/form",
            "style": {
                "navigationBarTitleText": "销售出库单",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/xiaoshoutuihuo/table",
            "style": {
                "navigationBarTitleText": "销售退货列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/xiaoshoutuihuo/form",
            "style": {
                "navigationBarTitleText": "销售退货单",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/shouliaotongzhi/table",
            "style": {
                "navigationBarTitleText": "收料通知单",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/shouliaotongzhi/table_son",
            "style": {
                "navigationBarTitleText": "条码生成",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/shengchanlingliao/table",
            "style": {
                "navigationBarTitleText": "生产领料校验列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/shengchanlingliao/form",
            "style": {
                "navigationBarTitleText": "生产领料单校验",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/shengchanruku/table",
            "style": {
                "navigationBarTitleText": "生产入库校验列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/shengchanruku/form",
            "style": {
                "navigationBarTitleText": "生产入库单校验",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/shengchandiaobo/table",
            "style": {
                "navigationBarTitleText": "生产调拨校验列表",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/shengchandiaobo/form",
            "style": {
                "navigationBarTitleText": "生产调拨单校验",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/labelPrinter/index",
            "style": {
                "navigationBarTitleText": "标签打印"
            }
        },
        {
            "path": "pages/shebeiyunxingzhuangtai/shebeiyunxingzhuangtai",
            "style": {
                "navigationBarTitleText": "设备运行状态",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/shebeiyunxingzhuangtai/detail",
            "style": {
                "navigationBarTitleText": "设备运行状态详情"
            }
        },
        {
            "path": "pages/mujvzhuangtai/mujvzhuangtai",
            "style": {
                "navigationBarTitleText": "模具状态分布",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/mujvzhuangtai/detail",
            "style": {
                "navigationBarTitleText": "模具状态详情"
            }
        },
        {
            "path": "pages/tiaomachaima/tiaomachaima",
            "style": {
                "navigationBarTitleText": "条码拆码"
            }
        },
        {
            "path": "pages/tiaomachaima/tiaomachaima2",
            "style": {
                "navigationBarTitleText": "条码拆码2"
            }
        },
        {
            "path": "pages/wuliaosaoma/wuliaosaoma",
            "style": {
                "navigationBarTitleText": "物料清单"
            }
        },
        {
            "path": "pages/wuliaosaoma/detail",
            "style": {
                "navigationBarTitleText": "条码档案"
            }
        },
        {
            "path": "pages/caigouruku/table",
            "style": {
                "navigationBarTitleText": "采购入库",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/caigouruku/form",
            "style": {
                "navigationBarTitleText": "采购入库单"
            }
        },
        {
            "path": "pages/caigoutuiliao/table",
            "style": {
                "navigationBarTitleText": "采购退料",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/caigoutuiliao/form",
            "style": {
                "navigationBarTitleText": "采购退料单"
            }
        },
        {
            "path": "pages/xiaoshouchuku/table",
            "style": {
                "navigationBarTitleText": "销售出库",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/xiaoshouchuku/form",
            "style": {
                "navigationBarTitleText": "销售出库单"
            }
        },
        {
            "path": "pages/xiaoshoutuihuo/table",
            "style": {
                "navigationBarTitleText": "销售退货",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/xiaoshoutuihuo/form",
            "style": {
                "navigationBarTitleText": "销售退货单"
            }
        },
        {
            "path": "pages/qitachuku/qitachuku",
            "style": {
                "navigationBarTitleText": "其他出库",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/qitachuku/form",
            "style": {
                "navigationBarTitleText": "其他出库单"
            }
        },
        {
            "path": "pages/qitaruku/qitaruku",
            "style": {
                "navigationBarTitleText": "其他入库",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/qitaruku/form",
            "style": {
                "navigationBarTitleText": "其他入库单"
            }
        },
        {
            "path": "pages/tiaomadaying/tiaomadaying",
            "style": {
                "navigationBarTitleText": "采购条码打印"
            }
        },
        {
            "path": "pages/caigoudingdan/generate",
            "style": {
                "navigationBarTitleText": "条码生成"
            }
        },
        {
            "path": "pages/caigoudingdan/caigoudingdan",
            "style": {
                "navigationBarTitleText": "采购订单"
            }
        },
        {
            "path": "pages/MJGL/shangmudan/table",
            "style": {
                "navigationBarTitleText": "上模单"
            }
        },
        {
            "path": "pages/MJGL/shangmudan/form",
            "style": {
                "navigationBarTitleText": "上模单"
            }
        },
        {
            "path": "pages/qitachukujiaoyan/qitachukujiaoyan",
            "style": {
                "navigationBarTitleText": "其他出库校验",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/qitachukujiaoyan/detail",
            "style": {
                "navigationBarTitleText": "其他出库单校验"
            }
        },
        {
            "path": "pages/shengchanbuliaojiaoyan/CacheList",
            "style": {
                "navigationBarTitleText": "生产补料校验",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/shengchanbuliaojiaoyan/form",
            "style": {
                "navigationBarTitleText": "生产补料单校验"
            }
        },
        {
            "path": "pages/xiaoshouchukujiaoyan/table",
            "style": {
                "navigationBarTitleText": "销售出库校验",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/xiaoshouchukujiaoyan/form",
            "style": {
                "navigationBarTitleText": "销售出库单校验"
            }
        },
        {
            "path": "pages/weiwailingliaojiaoyan/table",
            "style": {
                "navigationBarTitleText": "委外领料校验",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/weiwailingliaojiaoyan/form",
            "style": {
                "navigationBarTitleText": "委外领料单校验"
            }
        },
        {
            "path": "pages/caigourukujiaoyan/table",
            "style": {
                "navigationBarTitleText": "采购入库校验",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/caigourukujiaoyan/form",
            "style": {
                "navigationBarTitleText": "采购入库单校验",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/qitarukujiaoyan/table",
            "style": {
                "navigationBarTitleText": "其他入库校验",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/qitarukujiaoyan/form",
            "style": {
                "navigationBarTitleText": "其他入库单校验"
            }
        },
        {
            "path": "pages/weiwaibuliaojiaoyan/table",
            "style": {
                "navigationBarTitleText": "委外补料校验",
                "enablePullDownRefresh": true
            }
        },
        {
            "path": "pages/weiwaibuliaojiaoyan/form",
            "style": {
                "navigationBarTitleText": "委外补料单校验"
            }
        },
        {
            "path" : "pages/shengchanlingliaoshengdan/table",
            "style" :
            {
                "navigationBarTitleText" : "生产领料",
                "enablePullDownRefresh": true
            }
        },
        {
            "path" : "pages/shengchanlingliaoshengdan/form",
            "style" :
            {
                "navigationBarTitleText" : "生产领料单"
            }
        },
        {
            "path" : "pages/weiwailingliao/table",
            "style" :
            {
                "navigationBarTitleText" : "委外领料",
                "enablePullDownRefresh": true
            }
        },
        {
            "path" : "pages/weiwailingliao/form",
            "style" :
            {
                "navigationBarTitleText" : "委外领料单"
            }
        },
        {
            "path" : "pages/shengchanrukushengdan/table",
            "style" :
            {
                "navigationBarTitleText" : "生产入库",
                "enablePullDownRefresh": true
            }
        },
        {
            "path" : "pages/shengchanrukushengdan/form",
            "style" :
            {
                "navigationBarTitleText" : "生产入库单"
            }
        },
        {
            "path" : "pages/shengchanbuliao/table",
            "style" :
            {
                "navigationBarTitleText" : "生产补料",
                "enablePullDownRefresh": true
            }
        },
        {
            "path" : "pages/shengchanbuliao/form",
            "style" :
            {
                "navigationBarTitleText" : "生产补料单"
            }
        },
        {
            "path" : "pages/qitaruku_v2/table",
            "style" :
            {
                "navigationBarTitleText" : "其他入库",
                "enablePullDownRefresh": true
            }
        },
        {
            "path" : "pages/qitaruku_v2/form",
            "style" :
            {
                "navigationBarTitleText" : "其他入库单"
            }
        },
        {
            "path" : "pages/qitachuku_v2/table",
            "style" :
            {
                "navigationBarTitleText" : "其他出库",
                "enablePullDownRefresh": true
            }
        },
        {
            "path" : "pages/qitachuku_v2/form",
            "style" :
            {
                "navigationBarTitleText" : "其他出库单"
            }
        },
        {
            "path" : "pages/zhijiediaobo/table",
            "style" :
            {
                "navigationBarTitleText" : "直接调拨",
                "enablePullDownRefresh": true
            }
        },
        {
            "path" : "pages/zhijiediaobo/form",
            "style" :
            {
                "navigationBarTitleText" : "直接调拨单"
            }
        },
        {
            "path" : "pages/xiugaimima/index",
            "style" :
            {
                "navigationBarTitleText" : "修改密码"
            }
        }
    ],
    "tabBar": {
        "color": "#888888", //tab 上的文字默认颜色,仅支持十六进制颜色
        "selectedColor": "#2d7dee", //tab 上的文字选中时的颜色,仅支持十六进制颜色
        "borderStyle": "black", //tabbar上边框的颜色, 仅支持 black / white
        "backgroundColor": "#ffffff", //tab 的背景色,仅支持十六进制颜色
        "list": [{
                "pagePath": "pages/index/index",
                "iconPath": "static/tabBar/home.png",
                "selectedIconPath": "static/tabBar/home-default.png",
                "text": "仓储管理"
            },
            {
                "pagePath": "pages/index/tab1",
                "iconPath": "static/tabBar/icon1.png",
                "selectedIconPath": "static/tabBar/icon1-default.png",
                "text": "车间工序"
            },
            {
                "pagePath": "pages/index/tab2",
                "iconPath": "static/tabBar/icon2.png",
                "selectedIconPath": "static/tabBar/icon2-default.png",
                "text": "单据列表"
            },
            {
                "pagePath": "pages/index/mine",
                "iconPath": "static/tabBar/user.png",
                "selectedIconPath": "static/tabBar/user-default.png",
                "text": "我的"
            }
        ]
    },
    "globalStyle": {
        "navigationBarTextStyle": "white",
        "navigationBarTitleText": "设备管理",
        "navigationBarBackgroundColor": "#3A78FF",
        "backgroundColor": "#F8F8F8",
        "pageOrientation": "default"
    },
    "uniIdRouter": {}
=======
            "style": {
                "navigationBarTitleText": "登录",
                "navigationStyle": "custom"
pages/index/tab2.vue
@@ -209,6 +209,13 @@
                    id: 28,
                    hidden: false,
                },
                {
                    img: '../../static/icon/icon21.png',
                    text: '条码拆码2',
                    url: '/pages/tiaomachaima/tiaomachaima2',
                    id: 29,
                    hidden: false,
                },
                // , {
                //     img: '../../static/icon/icon1.png',
                //     text: '设备档案查询',
pages/tiaomachaima/tiaomachaima2.vue
New file
@@ -0,0 +1,497 @@
<template>
    <view class="container">
        <view class="header">
            <view class="item">
                <view class="left">条码编号:</view>
                <view class="right">
                    <input name="HBarCode"  v-model="barCodeInfoMeta.barCodeNo" placeholder="请扫描条码"
                        @blur="searchbarCodeInfo" />
                </view>
                <view>
                    <uni-icons type="scan"
                        style="background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;font-weight: 500;"
                        size="20" @click="toScanCode"></uni-icons>
                </view>
            </view>
            <view class="item">
                <view class="left">拆码数量:</view>
                <view class="right">
                    <input type="number" name="HSplitNum" v-model="barCodeInfoMeta.splitNum" placeholder="请输入拆码数量" />
                </view>
            </view>
            <view class="item">
                <view class="left">制单人:</view>
                <view class="right">
                    <input type="text" disabled name="HMaker" v-model="barCodeInfoMeta.billMaker"
                        placeholder="请输入制单人" />
                </view>
            </view>
            <view class="operation-zone">
                <button class="btn-c" @click="searchbarCodeInfoMeta">拆码</button>
                <button type="default" :class="cantGenerate?'':'btn-c'" @click="SaveBarCodeCreate"
                    :disabled="cantGenerate">生成</button>
                <button type="default" :class="cantPrint?'':'btn-c'" @click="PrintHBarCode" :disabled="cantPrint" >打印</button>
            </view>
        </view>
        <view class="divide"></view>
        <view class="content">
            <view class="barcode-detail" v-show="CommonUtils.isEmpty(Object.assign(barCodeInfo, {})) === false">
                <view class="title">条码信息</view>
                <uni-card>
                    <view class="detail" style="display: none;">
                        <text>条码ID:</text>{{barCodeInfo['HItemID'] || '0'}}
                    </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="dWetail">
                        <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>
                </uni-card>
            </view>
            <view class="divide"></view>
            <view class="barcode-split" v-show="barCodeSplitInfo.length>0">
                <view class="title">条码拆码</view>
                <view class="barcode-split-list" v-for="(item,index) in barCodeSplitInfo" :key="index">
                    <uni-card @tap="ModityHQty(item)">
                        <view class="detail">
                            <text>条码编号:</text>{{item['HBarCode'] || ''}}
                        </view>
                        <view class="detail split-num">
                            <text>拆分数量:</text>{{item['HSplitNum'] || '0'}}
                        </view>
                        <view class="detail">
                            <text>物料代码:</text>{{item['HNumber'] || ''}}
                        </view>
                        <view class="detail">
                            <text>物料名称:</text>{{item['HName'] || ''}}
                        </view>
                        <view class="detail">
                            <text>规格型号:</text>{{item['HModel'] || ''}}
                        </view>
                        <view class="detail">
                            <text>计量单位:</text>{{barCodeInfo['计量单位'] || ''}}
                        </view>
                    </uni-card>
                </view>
            </view>
        </view>
        <view class="over" v-if="barCodeSplitInfo.length == 0">暂无数据</view>
        <view class="over" v-if="barCodeSplitInfo.length != 0">已到底</view>
        <view>
            <!-- 输入框示例 -->
            <uni-popup ref="inputDialog" type="dialog">
                <uni-popup-dialog ref="inputClose" mode="input" title="请输入拆码数量" :value="dialogVal" placeholder="请输入拆码数量"
                    @confirm="dialogInputConfirm"></uni-popup-dialog>
            </uni-popup>
        </view>
        <labelPrinterComponentVue ref="labelPrinter" :printInfo="printInfo" :printMode="'cpcl'">
        </labelPrinterComponentVue>
    </view>
</template>
<script>
    import labelPrinterComponentVue from '../../components/labelPrinterComponent/labelPrinterComponent.vue';
    import {
        CBar,
        CBox,
        CForm,
        CImage,
        CLine,
        CCodeRotation,
        CCodeType,
        CPage,
        CText,
        CFont,
        CBold,
        CRotation,
        CInverse,
        CMag,
        CQRCode,
        CCorrectLevel,
        CSN,
        CStatus,
        CPCL,
    } from "@psdk/cpcl";
    import {
        getUserInfo
    } from "@/utils/auth.js";
    import {
        CommonUtils
    } from "@/utils/common.js"
    export default {
        data() {
            return {
                CommonUtils,
                userInfo: getUserInfo(),
                serverUrl: 'http://192.168.2.227:8082/API',
                barCodeInfoMeta: {
                    barCodeNo: "",
                    splitNum: "",
                    billMaker: getUserInfo().HEmpName,
                    billMakerID: getUserInfo().HEmpID
                },
                barCodeInfo: {
                },
                barCodeSplitInfo: [],
                dialogVal: 0,
                itemCache: {},
                cantGenerate: true,
                cantPrint:true,
                 printInfo: ""//打印
            };
        },
        components: {
            labelPrinterComponentVue
        },
        methods: {
            doRequest(url, data, resFunction, errFunction, method) {
                uni.showLoading({
                    title: '加载中...'
                })
                uni.request({
                    method: method || "GET",
                    url: this.serverUrl + url,
                    data: data || "",
                    success: (res) => {
                        if (typeof resFunction === 'function') {
                            resFunction.call(this, res)
                        } else if (typeof errFunction === 'undefined') {
                            return
                        } else {
                            throw new TypeError("访问成功回调函数类型异常!")
                        }
                    },
                    fail: (err) => {
                        uni.showToast({
                            icon: "error",
                            title: "接口访问异常!",
                            duration: 2000
                        })
                        if (typeof errFunction === 'function') {
                            errFunction.call(this, err)
                        } else if (typeof errFunction === 'undefined') {
                            return
                        } else {
                            throw new TypeError("访问失败回调函数类型异常!")
                        }
                    }
                })
                uni.hideLoading()
            },
            //摄像头调用
            async searchbarCodeInfo() {
                await this.$nextTick()
                let urlEncode =
                    `/Gy_BarCodeBillList/page?sWhere= and 条码编号=\'\'${this.barCodeInfoMeta.barCodeNo}\'\'&user=${this.userInfo.HEmpName}&page=1&size=1`
                    .toString()
                if (CommonUtils.isEmpty(this.barCodeInfoMeta.barCodeNo) == true) {
                    return uni.showToast({
                        icon: "fail",
                        title: "条码编号不能为空!"
                    })
                }
                this.doRequest(
                    urlEncode,
                    null,
                    function(res) {
                        console.log(res)
                        let res1 = res.data
                        let {data,count} = res1
                        if (count > 0) {
                            this.barCodeInfo = data[0]
                            this.barCodeSplitInfo= []
                        }
                    },
                    function(err) {
                        console.err(err)
                    }
                )
            },
            //拆码按钮调用
            async searchbarCodeInfoMeta() {
                this.cantGenerate = true
                this.cantPrint=true
                if (CommonUtils.isEmpty(this.barCodeInfoMeta.barCodeNo) === true) {
                    return uni.showToast({
                        icon: 'none',
                        title: '条码编号不得为空!'
                    });
                }
                if (CommonUtils.isEmpty(this.barCodeInfoMeta.splitNum, true) === true) {
                    return uni.showToast({
                        icon: 'none',
                        title: '拆分数量不得为空!'
                    });
                }
                if (CommonUtils.isEmpty(this.barCodeInfoMeta.splitNum, true) === true) {
                    return uni.showToast({
                        icon: 'none',
                        title: '拆分数量不得为空!'
                    });
                }
                if (parseFloat(this.barCodeInfoMeta.splitNum) > parseFloat(this.barCodeInfo['数量'])) {
                    return uni.showToast({
                        icon: 'none',
                        title: '拆分数量不能大于条码原数量!'
                    });
                }
                this.doRequest(
                    "/Sc_BarCode/SplitBarCode_Sub", {
                        HBarCodeNo: this.barCodeInfoMeta.barCodeNo
                    },
                    function(res) {
                        console.log(res)
                        this.barCodeSplitInfo = []
                        if (res.data.count > 0) {
                            if (res.data.data.length < 1) {
                                return uni.showToast({
                                    icon: 'none',
                                    title: Message
                                });
                            }
                            //拆分条码:数量为 splitNum
                            let barCodeItem1 = JSON.parse(JSON.stringify(res.data.data.SubBarCodes[0]));
                            barCodeItem1.HSplitNum = this.barCodeInfoMeta.splitNum;
                            barCodeItem1.HBarCode = res.data.data.NextBarCode;
                            this.barCodeSplitInfo.push(barCodeItem1);
                            //更新原先条码数量
                            this.barCodeInfo['剩余数量'] = this.barCodeInfo['数量'] - this.barCodeInfoMeta.splitNum;
                            this.cantGenerate = false;
                        } else {
                            uni.showToast({
                                icon: 'none',
                                title: '没有找到对应的单据'
                            });
                        }
                    },
                    function(err) {
                        console.error(err)
                    }
                )
            },
            //保存方法
            SaveBarCodeCreate() {
                // 校验拆码数量
                let sum = this.barCodeSplitInfo.reduce((acc, obj) => {
                    return acc + obj["HSplitNum"]
                }, 0)
                if (sum > this.barCodeInfo["HQty"]) {
                    return uni.showToast({
                        icon: 'none',
                        title: '拆码数量和不得大于条码数量'
                    });
                }
                let msg =
                    `${this.barCodeInfoMeta["barCodeNo"]};${this.barCodeInfoMeta["splitNum"]};${JSON.stringify(this.barCodeSplitInfo)};${this.userInfo["HEmpName"]}`
                this.doRequest(
                    "/Sc_BarCode/SplitBarCode_Save", {
                        msg: msg
                    },
                    function(res) {
                        if (res.data.code == 1) {
                            this.cantGenerate = true
                            this.cantPrint=false
                            uni.showToast({
                                title: '生成成功!'
                            });
                        }else{
                            this.cantGenerate = false
                            uni.showToast({
                                title: res.data.Message
                            });
                        }
                    },
                    function(err) {
                        console.err(err)
                    },
                    "POST"
                )
            },
            //打印按钮
            async PrintHBarCode() {
                if (this.$printer.isConnected() === false) {
                    this.$refs.labelPrinter.openPopup()
                }
                else
                {
                let HBarCodeNoStr =`${this.barCodeSplitInfo[0]['HBarCode']}`
                this.printInfo = `! 0 200 200 400 1
                    PAGE-WIDTH 608
                    SETQRVER 3
                    B QR 475 15 Q 0 U 3
                    LA,${HBarCodeNoStr}
                    ENDQR
                    T 24 0 0 30 供应商: ${this.lailiaoInfo.HSupName}
                    T 55 0 0 55 (Supplier)
                    T 24 0 0 75 供应商料号:  ${this.lailiaoInfo.HMaterNumber}
                    T 55 0 0 100 (Supplier Sku No.)
                    T 24 0 0 120 物料名称: ${this.lailiaoInfo.HMaterName}
                    T 55 0 0 145 (Material Code)
                    T 24 0 0 165 款号: ${this.lailiaoInfo.HCoilNO}
                    T 55 0 0 190 (Style No.)
                    T 24 0 300 165 客户编号: ${this.lailiaoInfo.HFactory}
                    T 55 0 300 190 (Consumer No.)
                    T 24 0 0 210 分组: ${this.lailiaoInfo.HFurnaceNO || ''}
                    T 55 0 0 235 (Group)
                    T 24 0 300 210 规格: ${this.lailiaoInfo.HMaterModel}
                    T 55 0 300 235 (SKU NO.)
                    T 24 0 0 255 数量:  ${ parseFloat(this.lailiaoInfo.HQty || 0).toFixed(0) } ${pcsInfo}
                    T 55 0 0 280 (Quantity)
                    T 24 0 300 255 日期: ${this.lailiaoInfo.HDate || ''}
                    T 55 0 300 280 (Date)
                    T 24 0 0 300 检验员:
                    T 55 0 0 325 (QC)
                    T 24 0 300 300 采购单号: ${this.lailiaoInfo.HBillNo || ''}
                    T 55 0 300 325 (Purchase Order No.)
                    T 24 0 0 345 检验结果:
                    T 55 0 0 370 (Inspection status)
                    BOX 240 345 260 365 4
                    T 24 0 270 345 合格
                    T 55 0 250 370 (Pass)
                    BOX 340 345 360 365 4
                    T 24 0 370 345 不合格
                    T 55 0 370 370 (Fail)
                    BOX 460 345 480 365 4
                    T 24 0 490 345 特采
                    T 55 0 440 370 (Spec. accepted)
                    FORM
                    PRINT`
                    await this.$nextTick(() => {
                    this.$refs.labelPrinter.execPrint()
                    })
                }
            },
            toScanCode() {
                var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
                mpaasScanModule.mpaasScan({
                    'hideAlbum': true,
                    'timeoutInterval':'10', //超时时间
                    'timeoutText':'未识别到二维码' //超时提醒
                },(ret) => {
                    console.log(ret.resp_result)
                    if (this.CommonUtils.isEmpty(ret.resp_result) === false) {
                        console.log('条码内容:' + ret.resp_result);
                        this.barCodeInfoMeta.barCodeNo = ret.resp_result
                        this.searchbarCodeInfo()
                    }
                })
            }
        },
        onLoad() {
        }
    }
</script>
<style lang="scss">
    * {
        box-sizing: border-box;
    }
    input {
        padding: 8rpx 20rpx;
        font-size: 30rpx;
        line-height: 30rpx;
    }
    button {
        padding: 0;
        width: 150rpx;
        font-size: 25rpx;
    }
    .uni-card {
        margin: 0 !important;
    }
    .container {
        .header {
            padding: 20rpx 10rpx;
            display: flex;
            flex-direction: column;
            gap: 20rpx;
            .item {
                display: flex;
                flex-direction: row;
                padding: 0 10rpx;
                gap: 20rpx;
                font-size: 30rpx;
                // height: 1.5rem;
                // justify-content: center;
                align-items: center;
                .left {
                    text-align: right;
                    width: 5rem;
                }
                .right {
                    flex: 1;
                    height: 100%;
                    padding: 6rpx 0;
                    border-radius: 22rpx;
                    border: 1px solid #e4e4e4;
                    background-color: #e4e4e4;
                    >input {
                        height: auto;
                    }
                }
            }
            .operation-zone {
                display: flex;
                flex-direction: row;
                justify-content: space-evenly;
                .btn-c {
                    background-color: #3a78ff;
                    color: #fff;
                }
            }
        }
        .divide {
            width: 100%;
            height: 16rpx;
            background-color: #e5e5e5;
        }
        .content {
            flex: 1;
            .barcode-detail,
            .barcode-split {
                padding: 30rpx;
                display: flex;
                flex-direction: column;
                gap: 30rpx;
            }
        }
    }
</style>