#
whycq
2024-10-21 6f233d299d4d6792404f4ca7ea5083acb845d992
#
4个文件已修改
264 ■■■■ 已修改文件
pages.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/pakin/confirmPakin.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/pakin/repairPakin.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/pakin/stocktaking.vue 190 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json
@@ -272,7 +272,7 @@
            "path" : "pages/pakin/confirmPakin",
            "style" :                                                                                    
            {
                "navigationBarTitleText": "盘点",
                "navigationBarTitleText": "盘点调整",
                "enablePullDownRefresh": false
            }
            
pages/pakin/confirmPakin.vue
@@ -98,7 +98,7 @@
        <!-- 底部操作按钮 -->
        <view class="buttom">
            <button size="mini" @click="reset('warn')">重置</button>
            <button size="mini" type="primary" @click="combConfirm('warn')">组托</button>
            <button size="mini" type="primary" @click="combConfirm('warn')">调整</button>
        </view>
        <!-- 弹窗 -->
        <!-- 修改数量 -->
@@ -149,7 +149,7 @@
                <uni-popup-message :type="msgType1" :message="messageText" :duration="2000"></uni-popup-message>
            </uni-popup>
        </view>
        <!-- 确认组托 -->
        <!-- 确认调整 -->
        <view>
            <uni-popup ref="combConfirm" type="dialog">
                <uni-popup-dialog :type="msgType" cancelText="取消" confirmText="确认" :title="title" :content="content"
@@ -312,10 +312,10 @@
                        if (key.startsWith('卷号')) roll.rollNo = item[key];
                        else if (key.startsWith('箱号')) roll.boxNo = item[key];
                        else if (key.startsWith('规格')) roll.specs = item[key];
                        else if (key.startsWith('长度')) roll.length = item[key];
                        else if (key.startsWith('净重')) roll.netWeight = item[key];
                        else if (key.startsWith('毛重')) roll.grossWeight = item[key];
                        else if (key.startsWith('接头')) roll.splices = item[key];
                        else if (key.startsWith('长度')) roll.length = item[key].split(' ')[0];
                        else if (key.startsWith('净重')) roll.netWeight = item[key].split(' ')[0];
                        else if (key.startsWith('毛重')) roll.grossWeight = item[key].split(' ')[0];
                        else if (key.startsWith('接头')) roll.splices = item[key].split(' ')[0];
                        else if (key.startsWith('分切时间')) roll.fqTime = item[key];
                    })
                    let newObj = {...nedata,...roll}
@@ -447,15 +447,15 @@
                // 不设置定时器 会出现扫入的字符串不全
                setTimeout(() => {
                    var len = this.barcode.length
                    if (len != 8) {
                        uni.showToast({
                            title: '托盘码有误请重试',
                            icon: "none",
                            position: 'top'
                        });
                        this.barcodeFocuss()
                        return;
                    }
                    // if (len != 8) {
                    //     uni.showToast({
                    //         title: '托盘码有误请重试',
                    //         icon: "none",
                    //         position: 'top'
                    //     });
                    //     this.barcodeFocuss()
                    //     return;
                    // }
                    this.bomFocuss()
                }, 200)
            },
@@ -696,7 +696,7 @@
            combConfirm(type) {
                this.msgType = type
                this.title = '警告'
                this.content = '是否现在组托!'
                this.content = '是否现在调整!'
                this.$refs.combConfirm.open()
            },
            combClose() {
@@ -717,7 +717,7 @@
                }
                for (var i = 0; i < that.dataList.length; i++) {
                    if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') {
                        this.messageText = that.dataList[i].matnr + '组托数量不能为0'
                        this.messageText = that.dataList[i].matnr + '调整数量不能为0'
                        this.messageToggle('error')
                        return;
                    }
@@ -737,7 +737,7 @@
                        var res = result.data
                        if (res.code === 200) {
                            that.resst();
                            that.messageText = "组托成功"
                            that.messageText = "调整成功"
                            that.messageToggle('success')
                        } else if (res.code == 403) {
                            that.messageText = res.msg
pages/pakin/repairPakin.vue
@@ -276,10 +276,10 @@
                            if (key.startsWith('卷号')) roll[index].rollNo = value;
                            else if (key.startsWith('箱号')) roll[index].boxNo = value;
                            else if (key.startsWith('规格')) roll[index].specs = value;
                            else if (key.startsWith('长度')) roll[index].length = value;
                            else if (key.startsWith('净重')) roll[index].netWeight = value;
                            else if (key.startsWith('毛重')) roll[index].grossWeight = value;
                            else if (key.startsWith('接头')) roll[index].splices = value;
                            else if (key.startsWith('长度')) roll[index].length = value.split(' ')[0];
                            else if (key.startsWith('净重')) roll[index].netWeight = value.split(' ')[0];
                            else if (key.startsWith('毛重')) roll[index].grossWeight = value.split(' ')[0];
                            else if (key.startsWith('接头')) roll[index].splices = value.split(' ')[0];
                            else if (key.startsWith('分切时间')) roll[index].fqTime = value;
                
                            // 如果有所有参数,则将其推入 rolls 数组
@@ -363,10 +363,10 @@
                        if (key.startsWith('卷号')) roll.rollNo = item[key];
                        else if (key.startsWith('箱号')) roll.boxNo = item[key];
                        else if (key.startsWith('规格')) roll.specs = item[key];
                        else if (key.startsWith('长度')) roll.length = item[key];
                        else if (key.startsWith('净重')) roll.netWeight = item[key];
                        else if (key.startsWith('毛重')) roll.grossWeight = item[key];
                        else if (key.startsWith('接头')) roll.splices = item[key];
                        else if (key.startsWith('长度')) roll.length = item[key].split(' ')[0];
                        else if (key.startsWith('净重')) roll.netWeight = item[key].split(' ')[0];
                        else if (key.startsWith('毛重')) roll.grossWeight = item[key].split(' ')[0];
                        else if (key.startsWith('接头')) roll.splices = item[key].split(' ')[0];
                        else if (key.startsWith('分切时间')) roll.fqTime = item[key];
                    })
                    nedata.rolls.push(roll)
@@ -441,15 +441,15 @@
                // 不设置定时器 会出现扫入的字符串不全
                setTimeout(() => {
                    var len = this.barcode.length
                    if (len != 6) {
                        uni.showToast({
                            title: '托盘码有误请重试',
                            icon: "none",
                            position: 'top'
                        });
                        this.barcodeFocuss()
                        return;
                    }
                    // if (len != 6) {
                    //     uni.showToast({
                    //         title: '托盘码有误请重试',
                    //         icon: "none",
                    //         position: 'top'
                    //     });
                    //     this.barcodeFocuss()
                    //     return;
                    // }
                    this.focuss()
                }, 200)
            },
@@ -618,7 +618,7 @@
                    data: JSON.stringify({
                        palletizingNo: that.sta,
                        barcode: that.barcode,
                        boxList: that.dataList
                        matList: that.dataList
                    }),
                    method: 'POST',
                    header: {
pages/pakin/stocktaking.vue
@@ -8,12 +8,10 @@
            </view>
            <view class="item">
                <view class="code-decs">物料码:</view>
                <input type="text" placeholder=" 扫码 / 输入" v-model="matnr" :focus="matFocus" @input="findMat()">
                <!-- <view class="item-right">
                    <button></button>
                    <text style="text-align: right;color: #409EFF;" @click="selectMat()">提取+</text>
                    <uni-icons type="right" color="#c1c1c1"></uni-icons>
                </view> -->
                <!-- <input type="text" placeholder=" 扫码 / 输入" v-model="matnr" :focus="matFocus" @input="findMat()"> -->
                <textarea style="background-color: #f0f0f0;max-height: 100rpx;padding: 4px;margin: 4px;"
                    type="textarea" placeholder=" 扫码 / 输入" maxlength="1000" v-model="matnr" :focus="matFocus"
                    @input="analysis2()" />
            </view>
        </view>
        <view class="mat-list-title">
@@ -166,6 +164,148 @@
            this.token = uni.getStorageSync('token');
        },
        methods: {
            analysis2() {
                const data = this.matnr
                const parseData = (data) => {
                    const lines = data.split('\n');
                    const t = {
                        packageGroupNo: '',
                        rollType: '',
                        boxType: '',
                        thickness: '',
                        wideInWidth: '',
                        totalGrossWeight: '',
                        totalNetWeight: '',
                        rolls: []
                    };
                    // console.log(lines);
                    // 解析基本信息
                    lines.forEach(line => {
                        if (line.startsWith('包装组号:')) t.packageGroupNo = line.split(':')[1].trim();
                        else if (line.startsWith('管芯类型:')) t.rollType = line.split(':')[1].trim();
                        else if (line.startsWith('木箱类型:')) t.boxType = line.split(':')[1].trim();
                        else if (line.startsWith('厚度:')) t.thickness = line.split(':')[1].trim();
                        else if (line.startsWith('宽幅:')) t.wideInWidth = line.split(':')[1].trim();
                        else if (line.startsWith('总毛重:')) t.totalGrossWeight = line.split(':')[1].trim();
                        else if (line.startsWith('总净重:')) t.totalNetWeight = line.split(':')[1].trim();
                    });
                    // 解析卷号信息
                    let rollData = {};
                    let roll = {
                        rollNo: '',
                        boxNo: '',
                        specs: '',
                        length: '',
                        splices: '',
                        netWeight: '',
                        grossWeight: '',
                        fqTime: '',
                    }
                    lines.forEach(line => {
                        const match = line.match(/卷号(\d+):(.+)/) || line.match(/箱号(\d+):(.+)/) || line.match(/规格(\d+):(.+)/) ||
                                      line.match(/长度(\d+):(.+)/) || line.match(/净重(\d+):(.+)/) || line.match(/毛重(\d+):(.+)/) ||
                                      line.match(/接头(\d+):(.+)/) || line.match(/分切时间(\d+):(.+)/);
                        if (match) {
                            const index = match[1]; // 获取序号
                            const key = match[0].split(':')[0]; // 获取参数名称
                            const value = match[2].trim(); // 获取参数值
                            // 初始化卷信息对象
                            if (!rollData[index]) rollData[index] = {};
                            rollData[index][key] = value;
                            if (!roll[index]) roll[index] = {};
                            if (key.startsWith('卷号')) roll[index].rollNo = value;
                            else if (key.startsWith('箱号')) roll[index].boxNo = value;
                            else if (key.startsWith('规格')) roll[index].specs = value;
                            else if (key.startsWith('长度')) roll[index].length = value;
                            else if (key.startsWith('净重')) roll[index].netWeight = value;
                            else if (key.startsWith('毛重')) roll[index].grossWeight = value;
                            else if (key.startsWith('接头')) roll[index].splices = value;
                            else if (key.startsWith('分切时间')) roll[index].fqTime = value;
                            // 如果有所有参数,则将其推入 rolls 数组
                            if (Object.keys(rollData[index]).length === 8) { // 所有字段都已经填充
                                t.rolls.push(rollData[index]);
                                rollData[index] = {}; // 重置以准备下一个卷
                            }
                        }
                    });
                    return t;
                };
                const result = parseData(data);
                this.secAnalysis(result)
            },
            // 二次解析
            secAnalysis(data) {
                let rolls = data.rolls
                let nedata = {
                    packageGroupNo: data.packageGroupNo,
                    rollType: data.rollType,
                    boxType: data.boxType,
                    thickness: data.thickness,
                    wideInWidth: data.wideInWidth,
                    totalGrossWeight: data.totalGrossWeight,
                    totalNetWeight: data.totalNetWeight,
                }
                for    (let item of rolls) {
                    let roll = {
                        rollNo: '',
                        boxNo: '',
                        specs: '',
                        length: '',
                        splices: '',
                        netWeight: '',
                        grossWeight: '',
                        fqTime: '',
                    }
                    Object.keys(item).forEach(key=>{
                        if (key.startsWith('卷号')) roll.rollNo = item[key];
                        else if (key.startsWith('箱号')) roll.boxNo = item[key];
                        else if (key.startsWith('规格')) roll.specs = item[key];
                        else if (key.startsWith('长度')) roll.length = item[key].split(' ')[0];
                        else if (key.startsWith('净重')) roll.netWeight = item[key].split(' ')[0];
                        else if (key.startsWith('毛重')) roll.grossWeight = item[key].split(' ')[0];
                        else if (key.startsWith('接头')) roll.splices = item[key].split(' ')[0];
                        else if (key.startsWith('分切时间')) roll.fqTime = item[key];
                    })
                    let newObj = {...nedata,...roll}
                    if (this.dataList.length > 0) this.checkAdd(newObj)
                    else this.dataList.push(newObj);
                }
                this.focuss()
            },
            // 确认添加
            checkAdd(newMat) {
                // let mats = this.dataList
                // for (let item of mats) {
                //     if (item.packagingGroupNumber != newMat.packagingGroupNumber) {
                //         if (item.rollNo == newMat.rollNo)
                //     } this.dataList.push(newMat);
                // }
                var len = this.dataList.length
                var add = true
                for    (let k of this.dataList) {
                    if (newMat.packageGroupNo == k.packageGroupNo && newMat.rollNo == k.rollNo) {
                        add = false
                    }
                }
                if (add) {
                    this.dataList.unshift(newMat)
                }
            },
            messageToggle(type) {
                this.msgType1 = type
                this.$refs.message.open()
@@ -175,15 +315,15 @@
                // 不设置定时器 会出现扫入的字符串不全
                setTimeout(() => {
                    var len = this.barcode.length
                    if (len != 6) {
                        uni.showToast({
                            title: '托盘码有误请重试',
                            icon: "none",
                            position: 'top'
                        });
                        this.barcodeFocuss()
                        return;
                    }
                    // if (len != 6) {
                    //     uni.showToast({
                    //         title: '托盘码有误请重试',
                    //         icon: "none",
                    //         position: 'top'
                    //     });
                    //     this.barcodeFocuss()
                    //     return;
                    // }
                    this.focuss()
                }, 200)
            },
@@ -368,9 +508,17 @@
                                });
                            }, 1000);
                        } else {
                            that.goto()
                            that.messageText = res.msg
                            that.messageToggle('error')
                            if (res.msg === '盘点确认异常') {
                                that.messageText = res.msg
                                that.messageToggle('error')
                                setTimeout(()=>{
                                    that.goto()
                                })
                            } else {
                                that.messageText = res.msg
                                that.messageToggle('error')
                            }
                        }
                    }
                });
@@ -427,7 +575,7 @@
    .code {
        width: 100%;
        position: fixed;
        min-height: 200rpx;
        /* min-height: 200rpx; */
        background-color: #FFF;
        z-index: 10;
    }
@@ -435,7 +583,7 @@
    .item {
        display: flex;
        align-items: center;
        height: 100rpx;
        /* height: 100rpx; */
        margin-left: 20rpx;
        border-bottom: 1px solid #DCDFE6;
    }
@@ -467,7 +615,7 @@
        width: 100%;
        background-color: white;
        position: fixed;
        margin-top: 200rpx;
        margin-top: 180rpx;
        z-index: 9;
        /* border-top: 1px solid #DCDFE6; */
        text-align: center;