wtt
2026-03-09 0282f090574f02aa216655ae644b4c2e7049b98f
app登录更新,华远投料添加错误日志
3个文件已修改
240 ■■■■■ 已修改文件
manifest.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/ZLGL/Gy_MaterialPrevention/Gy_MaterialPrevention.vue 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/login.vue 158 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json
@@ -2,8 +2,8 @@
    "name" : "智云LMES",
    "appid" : "__UNI__B002F49",
    "description" : "",
    "versionName" : "2.088",
    "versionCode" : 288,
    "versionName" : "2.089",
    "versionCode" : 289,
    "transformPx" : false,
    /* 5+App特有相关 */
    "app-plus" : {
pages/ZLGL/Gy_MaterialPrevention/Gy_MaterialPrevention.vue
@@ -25,6 +25,7 @@
        <view class="tabs" id="tabs">
            <view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">基本信息</view>
            <view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">物料信息</view>
            <view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">可投料物料</view>
        </view>
        <template v-if="tabs == 0">
            <view class="form" :style="{
@@ -82,11 +83,11 @@
                    <uni-card :title="item.HBarCode" style="margin: 10px;"
                        @tap="showDetail = showDetail==index?-1:index">
                        <view class="card-detail">
                            <view class="detail" v-if="item.HMaterNumber">
                                <text>物料编码:</text>{{item.HMaterNumber}}
                            <view class="detail" v-if="item.物料代码">
                                <text>物料编码:</text>{{item.物料代码}}
                            </view>
                            <view class="detail" v-if="item.HMaterName">
                                <text>物料名称:</text>{{item.HMaterName}}
                            <view class="detail" v-if="item.物料名称">
                                <text>物料名称:</text>{{item.物料名称}}
                            </view>
                            <view class="detail" v-if="item.HMaterModel">
                                <text>规则型号:</text>{{item.HMaterModel}}
@@ -106,7 +107,32 @@
                </view>
            </view>
        </template>
        <template v-if="tabs == 2">
            <view :style="{
            height: containerHeight + 'px',
            overflowY: 'auto'
        }">
                <view v-if="HMaterList.length > 0" class="list" v-for="(item,index) in HMaterList"
                    :key="index" @tap.stop="delMater(index)">
                    <uni-card :title="item.工位代码" style="margin: 10px;"
                        @tap="showDetail = showDetail==index?-1:index">
                        <view class="card-detail">
                            <view class="detail" v-if="item.物料代码">
                                <text>物料编码:</text>{{item.物料代码}}
                            </view>
                            <view class="detail" v-if="item.物料名称">
                                <text>物料名称:</text>{{item.物料名称}}
                            </view>
                        </view>
                    </uni-card>
                </view>
                <view v-if="HMaterUpperList.length == 0" class="over">
                    暂无数据
                </view>
            </view>
        </template>
        <view class="buttons" id="buttons">
            <button :class="editBill?'btn-c':'btn-a'" :disabled="editBill" size="mini" @tap="submit">提交</button>
            <view style="flex: 1"></view>
@@ -262,6 +288,7 @@
                        title: '温馨提示',
                        message: '未扫描工位码,无法扫描物料码,请先扫描工位码后再扫描物料码...'
                    })
                    return
                }
                try {
@@ -284,22 +311,28 @@
                        let findIndexExist = this.HMaterUpperList.findIndex(item => data[0]["HBarCode"] == item[
                            "HBarCode"])
                        if (findIndex == -1) {
                            //写入日志
                            this.WriteErrlog(this.HMaterCode,'录入物料信息失败,工位绑定的物料中没有所扫物料信息。')
                            CommonUtils.playSound(0)
                            this.refreshHMaterCodeFocus()
                            CommonUtils.showTips({
                                title: '温馨提示',
                                message: '录入物料信息失败,工位绑定的物料中没有所扫物料信息。'
                            })
                            return
                        }
                        if (findIndexExist != -1) {
                            CommonUtils.playSound(0)
                            //写入日志
                            this.WriteErrlog(this.HMaterCode,'录入物料信息失败,不允许重复录入物料信息。')
                            this.refreshHMaterCodeFocus()
                            CommonUtils.showTips({
                                title: '温馨提示',
                                message: '录入物料信息失败,不允许重复录入物料信息。'
                            })
                            return
                        }
@@ -310,6 +343,8 @@
                        this.refreshHMaterCodeFocus()
                    } else {
                        CommonUtils.playSound(0)
                        //写入日志
                        this.WriteErrlog(this.HMaterCode,Message)
                        this.refreshHMaterCodeFocus()
                        CommonUtils.showTips({
                            title: '温馨提示',
@@ -318,6 +353,8 @@
                    }
                } catch (err) {
                    this.refreshHMaterCodeFocus()
                    //写入日志
                    this.WriteErrlog(this.HMaterCode,Message)
                    CommonUtils.playSound(0)
                    CommonUtils.showTips({
                        title: '温馨提示',
@@ -325,6 +362,37 @@
                    })
                }
            },
            async WriteErrlog(HMaterCode,Reason) {
                let HRemark = "扫描工位ID"+this.hform.HWorkStationID+",工位名称:"+this.hform.HWorkStationName+",扫描条码编号:"+HMaterCode+",失败原因:"+Reason
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/Sc_FeedingErrorProofingController/WriteErrlog',
                        data: {
                            user:getUserInfo()["Czymc"],
                            HRemark:HRemark
                        }
                    })
                    let {
                        data,
                        Message,
                        count
                    } = res.data
                    if (count == 1) {
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: `日志上传失败: ${Message}`
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: `日志上传失败: ${err}`
                    })
                }
            },
            delMater(index) {
                if (this.editBill) {
                    return
pages/index/login.vue
@@ -299,21 +299,22 @@
                        title: '登录中...',
                        mask: true
                    })
                    var data = {
                        HUserNumber: this.UserName,
                        HPassWord: this.PassWord,
                        HStockOrgID: this.HOrgName,
                        HStockOrgName: this.Organization
                    }
                    //     UserName: this.UserName,
                    //     PassWord: this.PassWord,
                    //     HOrgName: this.HOrgName,
                    //     Organization: this.Organization
                    // }
                    uni.setStorageSync('loginData', JSON.stringify(data));
                    if (this.serverUrlName =="余姚华远"){//华远不需要wms验证
                        var data = {
                            UserName: this.UserName,
                            PassWord: this.PassWord,
                            HOrgName: this.HOrgName,
                            Organization: this.Organization
                        }
                        var data2 = {//用于保存登录信息
                            HUserNumber: this.UserName,
                            HPassWord: this.PassWord,
                            HStockOrgID: this.HOrgName,
                            HStockOrgName: this.Organization
                        }
                    uni.setStorageSync('loginData', JSON.stringify(data2));
                    uni.request({
                        url: this.serverUrl + 'WEBSController/GetUser_Json',
                        url: this.serverUrl + '/Web/GetUser',
                        method: 'GET',
                        data: data,
                        success: (res) => {
@@ -324,7 +325,7 @@
                                icon: 'none'
                            })
                            if (res.data.count == 1) {
                                setLoginData(data)
                                setLoginData(data2)
                                setUserInfo(res.data.data[0])
                                uni.setStorageSync('HUserName', res.data.data[0].Czymc);
                                uni.setStorageSync('HBillerID', res.data.data[0].HK3UserID);
@@ -332,29 +333,7 @@
                                uni.setStorageSync('login', "login");
                                uni.setStorageSync('Organization', this.Organization);
                                uni.setStorageSync('OrganizationID', this.HOrgName);
                                //存储部门 职员 仓库 等信息
                                uni.setStorageSync('HDeptID', res.data.data[0].HDeptID); //部门
                                uni.setStorageSync('HDeptName', res.data.data[0].HDeptName);
                                uni.setStorageSync('HEmpID', res.data.data[0].HEmpID); //职员
                                uni.setStorageSync('HEmpName', res.data.data[0].HEmpName);
                                uni.setStorageSync('HSCWHID', res.data.data[0].HSCWHID); //调入仓库
                                uni.setStorageSync('HSCWHName', res.data.data[0].HSCWHName);
                                uni.setStorageSync('HWhID', res.data.data[0].HWhID); //对应仓库
                                uni.setStorageSync('HWhName', res.data.data[0].HWhName);
                                uni.setStorageSync('HWorkCenterID', res.data.data[0].HWorkCenterID); //工作中心
                                uni.setStorageSync('HWorkCenterName', res.data.data[0].HWorkCenterName);
                                uni.setStorageSync('HSecManagerID', res.data.data[0].HSecManagerID); //对应验收
                                uni.setStorageSync('HSecManagerName', res.data.data[0].HSecManagerName);
                                uni.setStorageSync('HGroupID', res.data.data[0].HGroupID); //对应班组
                                uni.setStorageSync('HGroupName', res.data.data[0].HGroupName);
                                uni.setStorageSync('HProcID', res.data.data[0].HProcID); //对应工序
                                uni.setStorageSync('HProcName', res.data.data[0].HProcName);
                                uni.setStorageSync('HSourceID', res.data.data[0].HSourceID); //对应生产资源
                                uni.setStorageSync('HSourceName', res.data.data[0].HSourceName);
                                this.CommonUtils.setServerUrl(this.serverUrl)
                                // this.WebSocketServices.createConnect(res.data.data[0].Czybm,res.data.data[0].Czymc);
                                // getuiUtils.getClientID()
                                getuiUtils.getClientID(res.data.data[0].Czybm, res.data.data[0].Czymc)
                                uni.reLaunch({
                                    url: '/pages/index/index'
                                })
@@ -369,42 +348,75 @@
                            })
                        },
                    });
                    // uni.request({
                    //     url: this.serverUrl + '/Web/GetUser',
                    //     method: 'GET',
                    //     data: data,
                    //     success: (res) => {
                    //         console.log(res)
                    //         uni.hideLoading()
                    //         uni.showToast({
                    //             title: res.data.Message,
                    //             icon: 'none'
                    //         })
                    //         if (res.data.count == 1) {
                    //             setLoginData(data)
                    //             setUserInfo(res.data.data[0])
                    //             uni.setStorageSync('HUserName', res.data.data[0].Czymc);
                    //             uni.setStorageSync('HBillerID', res.data.data[0].HK3UserID);
                    //             uni.setStorageSync('SourceFlag', false);
                    //             uni.setStorageSync('login', "login");
                    //             uni.setStorageSync('Organization', this.Organization);
                    //             uni.setStorageSync('OrganizationID', this.HOrgName);
                    //             this.CommonUtils.setServerUrl(this.serverUrl)
                    //             uni.reLaunch({
                    //                 url: '/pages/index/index'
                    //             })
                    //         }
                    //     },
                    //     fail: (res) => {
                    //         console.log(res);
                    //         uni.hideLoading()
                    //         uni.showToast({
                    //             title: '接口请求失败',
                    //             icon: 'none'
                    //         })
                    //     },
                    // });
                    }else{
                        var data = {
                            HUserNumber: this.UserName,
                            HPassWord: this.PassWord,
                            HStockOrgID: this.HOrgName,
                            HStockOrgName: this.Organization
                        }
                        uni.setStorageSync('loginData', JSON.stringify(data));
                        uni.request({
                            url: this.serverUrl + 'WEBSController/GetUser_Json',
                            method: 'GET',
                            data: data,
                            success: (res) => {
                                console.log(res)
                                uni.hideLoading()
                                uni.showToast({
                                    title: res.data.Message,
                                    icon: 'none'
                                })
                                if (res.data.count == 1) {
                                    setLoginData(data)
                                    setUserInfo(res.data.data[0])
                                    uni.setStorageSync('HUserName', res.data.data[0].Czymc);
                                    uni.setStorageSync('HBillerID', res.data.data[0].HK3UserID);
                                    uni.setStorageSync('SourceFlag', false);
                                    uni.setStorageSync('login', "login");
                                    uni.setStorageSync('Organization', this.Organization);
                                    uni.setStorageSync('OrganizationID', this.HOrgName);
                                    //存储部门 职员 仓库 等信息
                                    uni.setStorageSync('HDeptID', res.data.data[0].HDeptID); //部门
                                    uni.setStorageSync('HDeptName', res.data.data[0].HDeptName);
                                    uni.setStorageSync('HEmpID', res.data.data[0].HEmpID); //职员
                                    uni.setStorageSync('HEmpName', res.data.data[0].HEmpName);
                                    uni.setStorageSync('HSCWHID', res.data.data[0].HSCWHID); //调入仓库
                                    uni.setStorageSync('HSCWHName', res.data.data[0].HSCWHName);
                                    uni.setStorageSync('HWhID', res.data.data[0].HWhID); //对应仓库
                                    uni.setStorageSync('HWhName', res.data.data[0].HWhName);
                                    uni.setStorageSync('HWorkCenterID', res.data.data[0].HWorkCenterID); //工作中心
                                    uni.setStorageSync('HWorkCenterName', res.data.data[0].HWorkCenterName);
                                    uni.setStorageSync('HSecManagerID', res.data.data[0].HSecManagerID); //对应验收
                                    uni.setStorageSync('HSecManagerName', res.data.data[0].HSecManagerName);
                                    uni.setStorageSync('HGroupID', res.data.data[0].HGroupID); //对应班组
                                    uni.setStorageSync('HGroupName', res.data.data[0].HGroupName);
                                    uni.setStorageSync('HProcID', res.data.data[0].HProcID); //对应工序
                                    uni.setStorageSync('HProcName', res.data.data[0].HProcName);
                                    uni.setStorageSync('HSourceID', res.data.data[0].HSourceID); //对应生产资源
                                    uni.setStorageSync('HSourceName', res.data.data[0].HSourceName);
                                    this.CommonUtils.setServerUrl(this.serverUrl)
                                    // this.WebSocketServices.createConnect(res.data.data[0].Czybm,res.data.data[0].Czymc);
                                    // getuiUtils.getClientID()
                                    getuiUtils.getClientID(res.data.data[0].Czybm, res.data.data[0].Czymc)
                                    uni.reLaunch({
                                        url: '/pages/index/index'
                                    })
                                }
                            },
                            fail: (res) => {
                                console.log(res);
                                uni.hideLoading()
                                uni.showToast({
                                    title: '接口请求失败',
                                    icon: 'none'
                                })
                            },
                        });
                    }
                }
            }
        }