chenhaozhe
2025-08-01 cfa236b5b63c351ed0f846cbc511fa64d88f4993
Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev

# Conflicts:
# pages/tiaomadaying/tiaomadaying.vue
3个文件已修改
178 ■■■■■ 已修改文件
pages/index/login.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tiaomadaying/tiaomadaying.vue 161 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/common.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/login.vue
@@ -77,12 +77,16 @@
        setUserInfo
    } from "@/utils/auth.js";
    import hFormAlert from '@/components/h-form-alert/h-form-alert.vue';
    import {
        CommonUtils
    } from "../../utils/common";
    export default {
        components: {
            hFormAlert
        },
        data() {
            return {
                CommonUtils,
                arrayDataBases: [],
                DataBases: '',
 
@@ -104,7 +108,7 @@
                serverUrlCache: '',
            }
        },
        onLoad() {
        onShow() {
            var logindata = uni.getStorageSync('loginData') || ''
            // console.log(logindata)
            if (logindata) {
@@ -268,7 +272,8 @@
                                uni.setStorageSync('login', "login");
                                uni.setStorageSync('Organization', this.Organization);
                                uni.setStorageSync('OrganizationID', this.HOrgName);
                                console.log('this.serverUrl: ', this.serverUrl);
                                this.CommonUtils.setServerUrl(this.serverUrl)
                                uni.reLaunch({
                                    url: '/pages/index/index'
                                })
pages/tiaomadaying/tiaomadaying.vue
@@ -79,8 +79,8 @@
            </view>
        </view>
        <view class="operation-zone">
            <button class="btn-c" @click="GenereateBarCode">生成</button>
            <button class="btn-c" :disabled="buttonStatus.btn2 == false" @click="print">打印</button>
            <button class="btn-c" :disabled="buttonStatus.btn1" @click="GenereateBarCode">生成</button>
            <button class="btn-c" :disabled="buttonStatus.btn2" @click="print">打印</button>
            <view></view>
            <button class="btn-c" @click="setClearLailiaoInfo">新增</button>
            <button class="btn-c" @click="exit">退出</button>
@@ -128,7 +128,7 @@
                userInfo: getUserInfo(),
                buttonStatus: {
                    btn1: true,
                    btn2: false
                    btn2: true
                },
                barCodeMeta: '',
                generatedBarCode: '',
@@ -295,43 +295,48 @@
                    //     this.$refs.labelPrinter.execPrint()
                    // })
                    // T 24 0 300 280 计划跟踪号: ${this.lailiaoInfo.HMTONo || ''}
                    this.printInfo = `! 0 200 200 400 1
PAGE-WIDTH 608
SETQRVER 3
B QR 470 30 M 5 U 5
B QR 480 30 M 4 U 4
LA,${this.lailiaoInfo.barCodeNo}
ENDQR
T 24 0 10 30 供应商: ${this.lailiaoInfo.HSupName}
T 55 0 10 55 (Supplier)
T 24 0 10 80 供应商料号:  ${this.lailiaoInfo.HMaterNumber}
T 55 0 10 105 (Supplier Sku No.)
T 24 0 10 130 物料名称: ${this.lailiaoInfo.HMaterName}
T 55 0 5 155 (Material Code)
T 24 0 300 130 款号:
T 55 0 300 155 (eng)
T 24 0 5 180 分组: ${this.lailiaoInfo.HBatchNo}
T 55 0 5 205 (Group)
T 24 0 300 180 规格: ${this.lailiaoInfo.HMaterModel}
T 55 0 300 205 (SKU NO.)
T 24 0 10 70 供应商料号:  ${this.lailiaoInfo.HMaterNumber}
T 55 0 10 95 (Supplier Sku No.)
T 24 0 10 110 物料名称: ${this.lailiaoInfo.HMaterName}
T 55 0 10 135 (Material Code)
T 24 0 10 150 款号:
T 55 0 10 175 (eng)
T 24 0 300 150 客户编号:
T 55 0 300 175 (eng)
T 24 0 10 190 分组: ${this.lailiaoInfo.HBatchNo}
T 55 0 10 215 (Group)
T 24 0 300 190 规格: ${this.lailiaoInfo.HMaterModel}
T 55 0 300 215 (SKU NO.)
T 24 0 10 230 数量:  ${this.lailiaoInfo.HQty} (${this.lailiaoInfo.HPcsName})
T 55 0 5 255 (Quantity)
T 55 0 10 255 (Quantity)
T 24 0 300 230 日期: ${this.lailiaoInfo.HDate}
T 55 0 300 255 (Date) 
T 24 0 5 280 检验员:
T 55 0 5 305 (QC)
T 24 0 300 280 采购单号: ${this.lailiaoInfo.HBillNo || ''}
T 55 0 300 305 (Purchase Order No.)
T 24 0 5 330 检验结果:
T 55 0 5 355 (Inspection status)
BOX 240 330 260 350 4
T 24 0 270 330 合格
T 55 0 250 355 (Pass)
BOX 340 330 360 350 4
T 24 0 370 330 不合格
T 55 0 370 355 (Fail)
BOX 460 330 480 350 4
T 24 0 490 330 特采
T 55 0 440 355 (Spec. accepted)
T 24 0 10 270 检验员:
T 55 0 10 295 (QC)
T 24 0 300 270 采购单号: ${this.lailiaoInfo.HBillNo || ''}
T 55 0 300 295 (Purchase Order No.)
T 24 0 10 310 检验结果:
T 55 0 10 335 (Inspection status)
BOX 240 310 260 330 4
T 24 0 270 310 合格
T 55 0 250 335 (Pass)
BOX 340 310 360 330 4
T 24 0 370 310 不合格
T 55 0 370 335 (Fail)
BOX 460 310 480 330 4
T 24 0 490 310 特采
T 55 0 440 335 (Spec. accepted)
FORM
PRINT`
@@ -364,7 +369,7 @@
                    HSupName: d['供应商'],
                    HUnitID: d['HUnitID'],
                    HSupNameShort: d['供应商'],
                    HMTONo: d['订单跟踪号'],
                    HMTONo: d['计划跟踪号'],
                    HMainID: d['linterid'],
                    HSubID: d['HEntryID'],
                    HMaterID: d['HMaterID'],
@@ -428,21 +433,34 @@
                            console.log('采购订单: ', res)
                            let {
                                data,
                                count
                                count,
                                Message
                            } = res.data
                            if (count > 0) {
                                this.setLailiaoInfo(data, Row)
                                // uni.showToast({
                                //     icon: 'none',
                                //     title: Message
                                // })
                                this.buttonStatus.btn1 = false
                            } else {
                                CommonUtils.playSound(0)
                                this.refreshBarcodeState()
                                // uni.showToast({
                                //     icon: 'none',
                                //     title: Message
                                // })
                                this.buttonStatus.btn1 = true
                                this.buttonStatus.btn2 = true
                            }
                        },
                        (error) => {
                            CommonUtils.playSound(0)
                            this.refreshBarcodeState()
                            this.buttonStatus.btn2 = false
                            this.buttonStatus.btn1 = true
                            this.buttonStatus.btn2 = true
                        }
                    )
@@ -465,41 +483,41 @@
                                title: '条码格式错误,请重新扫描...'
                            })
                        }
                        let barCodeInfo = ret.resp_result.split("@")
                        let [PurchaseBillNo, Row] = barCodeInfo
                        this.lailiaoInfo.HBillNo = PurchaseBillNo,
                            this.lailiaoInfo.HBillLineNo = Row
                        console.log({
                            sWhere: ` and 单据号 = '${PurchaseBillNo}'`,
                            user: this.userInfo.Czymc,
                        })
                        CommonUtils.doRequest(
                            "/Cg_POOrderBill/list", {
                                sWhere: ` and 单据号 = '${PurchaseBillNo}'`,
                                user: this.userInfo.Czymc,
                            },
                            (res) => {
                                console.log('采购订单: ', res)
                                let {
                                    data,
                                    count
                                } = res.data
                                if (count > 0) {
                                    this.setLailiaoInfo(data, Row)
                                }
                            },
                            (error) => {
                        // let barCodeInfo = ret.resp_result.split("@")
                        // let [PurchaseBillNo, Row] = barCodeInfo
                        // this.lailiaoInfo.HBillNo = PurchaseBillNo,
                        //     this.lailiaoInfo.HBillLineNo = Row
                        // console.log({
                        //     sWhere: ` and 单据号 = '${PurchaseBillNo}'`,
                        //     user: this.userInfo.Czymc,
                        // })
                        // CommonUtils.doRequest(
                        //     "/Cg_POOrderBill/list", {
                        //         sWhere: ` and 单据号 = '${PurchaseBillNo}'`,
                        //         user: this.userInfo.Czymc,
                        //     },
                        //     (res) => {
                        //         console.log('采购订单: ', res)
                        //         let {
                        //             data,
                        //             count
                        //         } = res.data
                        //         if (count > 0) {
                        //             this.setLailiaoInfo(data, Row)
                        //         }
                        //     },
                        //     (error) => {
                    
                            }
                        )
                        //     }
                        // )
                        this.barCodeEntryHandler(ret.resp_result)
                    }
                
                })
            },
            GenereateBarCode() {
                let HBarCodeNoStr =
                    `${this.lailiaoInfo.HBillNo}@${this.lailiaoInfo.HBillLineNo}@${this.lailiaoInfo.HMaterNumber}@${this.lailiaoInfo.HMTONo}@${this.lailiaoInfo.HQty}@${this.lailiaoInfo.HSupID}`
                    `${this.lailiaoInfo.HBillNo}@${this.lailiaoInfo.HBillLineNo}@${this.lailiaoInfo.HMaterNumber || ''}@${this.lailiaoInfo.HMTONo || ''}@${this.lailiaoInfo.HQty || ''}@${this.lailiaoInfo.HSupID || ''}`
                let sMain = []
                sMain[0] = this.lailiaoInfo
                let sMainStr = JSON.stringify(sMain);
@@ -508,9 +526,9 @@
                //获取选择的工厂代码
                let CampanyName = "xxx";
                //获取选择的源单类型
                let HSourceBillType = "来料通知单";
                let HSourceBillType = "采购订单";
                //获取选择的条码类型
                let HSelectBarCodeType = "唯一条码";
                let HSelectBarCodeType = "品种条码";
                //获取当前登录人员
                let UserName = uni.getStorageSync('HUserName');
                let sMainSub = sMainStr + ';' + HOrgType + ';' + HSourceBillType + ';' + HSelectBarCodeType + ';' +
@@ -529,16 +547,16 @@
                            Message
                        } = res.data
                        if (count > 0) {
                            this.buttonStatus = {
                                btn1: false,
                                btn2: true
                            }
                            this.generatedBarCode = data[0]['条码编号']
                            console.log(this.generatedBarCode)
                            // this.generatedBarCode = data[0]['条码编号']/
                            // console.log(this.generatedBarCode)
                            uni.showToast({
                                icon: 'none',
                                title: Message
                            })
                            this.buttonStatus = {
                                btn1: true,
                                btn2: true
                            }
                        } else {
                            uni.showToast({
                                icon: 'none',
@@ -547,7 +565,10 @@
                        }
                    },
                    (err) => {
                        uni.showToast({
                            icon: 'none',
                            title: err
                        })
                    },
                    "POST"
                )
utils/common.js
@@ -2,7 +2,11 @@
    serverUrl
    constructor() {
        this.serverUrl = uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API';
        this.serverUrl = uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API/';
    }
    setServerUrl(url) {
        this.serverUrl = url
    }
    // 防抖函数
@@ -248,4 +252,4 @@
    }
}
export const CommonUtils = Object.freeze(new commonUtils());
export const CommonUtils = new commonUtils()