chenhaozhe
2025-09-03 346d8baddff15bebed6594e088378ccb64f62df4
调整 条码拆码2 模块
5个文件已修改
147 ■■■■■ 已修改文件
components/PushSeOutStockBillPopup/PushSeOutStockBillPopup.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/caigouruku/form.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tiaomachaima/tiaomachaima.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tiaomachaima/tiaomachaima2.vue 125 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/xiaoshouchuku/form.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/PushSeOutStockBillPopup/PushSeOutStockBillPopup.vue
@@ -3,16 +3,16 @@
        <uni-popup ref="popup" type="bottom" @change="popupChangeHandler">
            <view class="content">
                <view class="search-condition">
                    <view class="title"><text>出库通知单号: </text></view>
                    <view class="right"><input type="text" v-model="HBillNo" /></view>
                    <view class="title"><text>发货通知单号: </text></view>
                    <view class="right"><input type="text" v-model="HBillNo" @confirm="search" /></view>
                </view>
                <view class="search-condition">
                    <view class="title"><text>客户: </text></view>
                    <view class="right"><input type="text" v-model="HCustomer" /></view>
                    <view class="right"><input type="text" v-model="HCustomer" @confirm="search" /></view>
                </view>
                <view class="search-condition">
                    <view class="title"><text>销售员: </text></view>
                    <view class="right"><input type="text" v-model="HSeller" /></view>
                    <view class="right"><input type="text" v-model="HSeller" @confirm="search" /></view>
                </view>
                <view class="search-condition">
                    <view class="title">
@@ -233,7 +233,7 @@
                }
                if (!CommonUtils.isEmpty(this.HBillNo)) {
                    sWhere += ` and 单据号 like N'%${this.HMaterialID}%'`
                    sWhere += ` and 单据号 like N'%${this.HBillNo}%'`
                }
                if (!CommonUtils.isEmpty(this.HCustomer)) {
                    sWhere += ` and 客户 like N'%${this.HCustomer}%'`
pages/caigouruku/form.vue
@@ -556,6 +556,7 @@
                    inputVal = this.hform.HSourceBillNo
                }
                console.log('inputVal: ',inputVal);
                if (inputVal == '') {
                    CommonUtils.playSound(0)
                    this.refreshHSourceBillState()
@@ -1409,6 +1410,7 @@
                            url: this.serverUrl + '/WEBSController/set_SavePOStockInBill_Json',
                            method: 'POST',
                            dataType: "json",
                            timeout: 10000,
                            data: {
                                oMain: sMainStr
                            },
@@ -1416,7 +1418,7 @@
                                console.log(1, res);
                                uni.hideLoading()
                                if (res.data.count == 1) {
                                    let sMain = JSON.stringify(this.materMeta) + ';' + this.hform.HBillType + ';' + this.hform.HBillNo
                                    let sMain = JSON.stringify(this.materMeta) + ';' + this.hform.HBillType + ';' + this.hform.HSourceBillNo
                                    try {
                                        // 为条码设置出库单号和出库次数
                                        await this.Set_BarCodeBill(sMain)
pages/tiaomachaima/tiaomachaima.vue
@@ -4,8 +4,8 @@
            <view class="item">
                <view class="left">条码编号:</view>
                <view class="right">
                    <input name="HBarCode" disabled v-model="barCodeInfoMeta.barCodeNo" placeholder="请扫描设备"
                        @blur="searchbarCodeInfo" />
                    <input name="HBarCode" v-model="barCodeInfoMeta.barCodeNo" placeholder="请扫描条码"
                        @confirm="searchbarCodeInfo" />
                </view>
                <view>
                    <uni-icons type="scan"
pages/tiaomachaima/tiaomachaima2.vue
@@ -29,8 +29,9 @@
            <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>
                    :disabled="cantGenerate = false">生成</button>
                <button type="default" :class="cantPrint?'':'btn-c'" @click="PrintHBarCode"
                    :disabled="cantPrint = false">打印</button>
            </view>
        </view>
        <view class="divide"></view>
@@ -140,6 +141,7 @@
                CommonUtils,
                userInfo: getUserInfo(),
                serverUrl: 'http://192.168.2.227:8082/API',
                // serverUrl: 'http://47.96.97.237/API/',
                barCodeInfoMeta: {
                    barCodeNo: "",
                    splitNum: "",
@@ -208,21 +210,30 @@
                    })
                }
                this.doRequest(
                    urlEncode,
                    null,
                    function(res) {
                    urlEncode, {},
                    (res) => {
                        console.log(res)
                        let res1 = res.data
                        let {data,count} = res1
                        let {
                            data,
                            count
                        } = res1
                        if (count > 0) {
                            this.barCodeInfo = data[0]
                            this.barCodeSplitInfo= []
                        }
                    },
                    function(err) {
                    (err) => {
                        console.err(err)
                    }
                )
            },
            dialogInputConfirm(val) {
                this.itemCache["HSplitNum"] = val
                // 关闭窗口后,恢复默认内容
                this.$refs.inputDialog.close()
            },
            //拆码按钮调用
            async searchbarCodeInfoMeta() {
@@ -252,12 +263,13 @@
                        title: '拆分数量不能大于条码原数量!'
                    });
                }
                this.doRequest(
                    "/Sc_BarCode/SplitBarCode_Sub", {
                        HBarCodeNo: this.barCodeInfoMeta.barCodeNo
                uni.request({
                    url: this.serverUrl + '/Sc_BarCode/SplitBarCode_Sub',
                    data: {
                        HBarCodeNo: this.barCodeInfoMeta.barCodeNo,
                    },
                    function(res) {
                        console.log(res)
                    success: (res) => {
                        this.barCodeSplitInfo = []
                        if (res.data.count > 0) {
            
@@ -269,10 +281,14 @@
                            }
                            
                            //拆分条码:数量为 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);
                            // let barCodeItem1 = JSON.parse(JSON.stringify(res.data.data.SubBarCodes[0]));
                            let HSplitNum = this.barCodeInfoMeta.splitNum;
                            let HBarCode = res.data.data.NextBarCode;
                            console.log('HBarCode: ',HBarCode);
                            this.barCodeSplitInfo.push({
                                HSplitNum: this.barCodeInfoMeta.splitNum,
                                HBarCode: res.data.data.NextBarCode
                            });
                            
                            //更新原先条码数量
                            this.barCodeInfo['剩余数量'] = this.barCodeInfo['数量'] - this.barCodeInfoMeta.splitNum;
@@ -285,10 +301,51 @@
                            });
                        }
                    },
                    function(err) {
                    fail: (err) => {
                        console.error(err)
                    }
                )
                })
                // this.doRequest(
                //     "/Sc_BarCode/SplitBarCode_Sub",
                //     {
                //         HBarCodeNo: this.barCodeInfoMeta.barCodeNo,
                //     },
                //     (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]));
                //             HSplitNum = this.barCodeInfoMeta.splitNum;
                //             HBarCode = res.data.NextBarCode;
                //             this.barCodeSplitInfo.push({
                //                 HSplitNum: this.barCodeInfoMeta.splitNum,
                //                 HBarCode: res.data.NextBarCode
                //             });
                //             //更新原先条码数量
                //             this.barCodeInfo['剩余数量'] = this.barCodeInfo['数量'] - this.barCodeInfoMeta.splitNum;
                //             this.cantGenerate = false;
                //         } else {
                //             uni.showToast({
                //                 icon: 'none',
                //                 title: '没有找到对应的单据'
                //             });
                //         }
                //     },
                //     (err) => {
                //         console.error(err)
                //     }
                // )
            },
            //保存方法
            SaveBarCodeCreate() {
@@ -309,7 +366,7 @@
                    "/Sc_BarCode/SplitBarCode_Save", {
                        msg: msg
                    },
                    function(res) {
                    (res) => {
                        if (res.data.code == 1) {
                            this.cantGenerate = true
                            this.cantPrint=false
@@ -324,7 +381,7 @@
                        }
                        
                    },
                    function(err) {
                    (err) => {
                        console.err(err)
                    },
                    "POST"
@@ -335,9 +392,7 @@
            async PrintHBarCode() {
                if (this.$printer.isConnected() === false) {
                    this.$refs.labelPrinter.openPopup()
                }
                else
                {
                } else {
                let HBarCodeNoStr =`${this.barCodeSplitInfo[0]['HBarCode']}`
                this.printInfo = `! 0 200 200 400 1
                    PAGE-WIDTH 608
@@ -345,27 +400,27 @@
                    B QR 475 15 Q 0 U 3
                    LA,${HBarCodeNoStr}
                    ENDQR
                    T 24 0 0 30 供应商: ${this.lailiaoInfo.HSupName}
    T 24 0 0 30 供应商:
                    T 55 0 0 55 (Supplier)
                    T 24 0 0 75 供应商料号:  ${this.lailiaoInfo.HMaterNumber}
    T 24 0 0 75 供应商料号:
                    T 55 0 0 100 (Supplier Sku No.)
                    T 24 0 0 120 物料名称: ${this.lailiaoInfo.HMaterName}
    T 24 0 0 120 物料名称:
                    T 55 0 0 145 (Material Code)
                    T 24 0 0 165 款号: ${this.lailiaoInfo.HCoilNO}
    T 24 0 0 165 款号:
                    T 55 0 0 190 (Style No.)
                    T 24 0 300 165 客户编号: ${this.lailiaoInfo.HFactory}
    T 24 0 300 165 客户编号:
                    T 55 0 300 190 (Consumer No.)
                    T 24 0 0 210 分组: ${this.lailiaoInfo.HFurnaceNO || ''}
    T 24 0 0 210 分组:
                    T 55 0 0 235 (Group) 
                    T 24 0 300 210 规格: ${this.lailiaoInfo.HMaterModel}
    T 24 0 300 210 规格:
                    T 55 0 300 235 (SKU NO.) 
                    T 24 0 0 255 数量:  ${ parseFloat(this.lailiaoInfo.HQty || 0).toFixed(0) } ${pcsInfo}
    T 24 0 0 255 数量:
                    T 55 0 0 280 (Quantity) 
                    T 24 0 300 255 日期: ${this.lailiaoInfo.HDate || ''}
    T 24 0 300 255 日期:
                    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 24 0 300 300 采购单号:
                    T 55 0 300 325 (Purchase Order No.)  
                    T 24 0 0 345 检验结果: 
                    T 55 0 0 370 (Inspection status) 
@@ -380,6 +435,7 @@
                    T 55 0 440 370 (Spec. accepted) 
                    FORM
                    PRINT`
                console.log('printInfo: ',this.printInfo);
                    await this.$nextTick(() => {
                    this.$refs.labelPrinter.execPrint()
                    })
@@ -402,8 +458,7 @@
                })
            }
        },
        onLoad() {
        }
        onLoad() {}
    }
</script>
pages/xiaoshouchuku/form.vue
@@ -518,7 +518,7 @@
                if (this.$refs.uniComboxSourceBill) {
                    inputVal = this.$refs.uniComboxSourceBill.inputVal || this.hform.HBillNo
                } else {
                    inputVal = this.hform.HBillNo
                    inputVal = this.hform.HSourceBillNo
                }
                if (inputVal == '') {
@@ -1443,7 +1443,7 @@
                                uni.hideLoading()
                                if (res.data.count == 1) {
                                    let sMain = JSON.stringify(this.materMeta) + ';' + this.hform
                                        .HBillType + ';' + this.hform.HBillNo
                                        .HBillType + ';' + this.hform.HSourceBillNo
                                    try {
                                        await this.Set_BarCodeBill(sMain)
                                        uni.showModal({