1
zhang
2025-08-05 29673a4ad10c8c544062b3ca91e81e30cfd56f0c
1
2个文件已修改
1个文件已添加
514 ■■■■■ 已修改文件
pages.json 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/pakin/review.vue 503 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json
@@ -286,6 +286,15 @@
            }
            
        }
        ,{
            "path" : "pages/pakin/review",
            "style" :
            {
                "navigationBarTitleText": "单据复核"
            }
        }
        ,{
            "path" : "pages/pakin/delCheck",
            "style" :                                                                                    
pages/home/home.vue
@@ -58,7 +58,7 @@
                        name: 'review',
                        color: 'blue',
                        cuIcon: 'pullup',
                        url: '/pakin/boxPakin'
                        url: '/pakin/review'
                    },
                    // {
                    //     title: '出库',
pages/pakin/review.vue
New file
@@ -0,0 +1,503 @@
<template>
    <view>
        <view class="combox">
            <view style="flex: 1;"><uni-combox :candidates="orderNoList" placeholder="请选择订单" v-model="orderNo"
                    @input="getOrderDet"></uni-combox></view>
            <view style="width: 80px;display: flex;align-items: center;justify-content: center;"><button size="mini"
                    type="primary" @click="getOrderDetlByOrderNo()">检索</button></view>
        </view>
        <view class="list-header" style="display: flex;text-align: start;align-items: center;padding: 8px;">
            <text style="width: 6em;">扫码确认</text>
            <view style="width: 10px;"></view>
            <textarea style="background-color: #f0f0f0;max-height: 100rpx;padding: 4px;margin: 4px;font-weight: normal;"
                type="textarea" placeholder=" 扫码 / 输入" maxlength="1000" v-model="matnr" :focus="matFocus"
                @input="analysis2()" />
        </view>
        <view class="item">
            <view class="code-decs">复核人:</view>
            <uni-combox emptyTips="暂无数据" :candidates="checkUser" v-model="threeCode" placeholder="复核人"></uni-combox>
        </view>
        <view class="item">
            <view class="code-decs">复核备注:</view>
            <input type="text" placeholder=" 输入" v-model="memo">
        </view>
        <view class="list-header">
            <text>订单明细</text>
        </view>
        <!-- 包装组号:{{item.packageGroupNo}} -->
        <view class="order-item" v-for="item in orderList">
            <view class="list-left">
                <!-- <view class="list-left-item">
                    <view class="desc">物料编码:</view>
                    <view class="left-item">
                        <uni-tag :text="item.matnr" type="primary"></uni-tag>
                    </view>
                </view>
                <view class="list-left-item">
                    <view class="desc">产品名称:</view>
                    <view class="left-item">{{item.maktx}}</view>
                </view>
                <view class="list-left-item">
                    <view class="desc">卷号:</view>
                    <view class="left-item">{{item.model}}</view>
                </view> -->
                <view class="list-left-item">
                    <view class="desc">规格型号:</view>
                    <view class="left-item">{{item.specs}}</view>
                </view>
                <view class="list-left-item">
                    <view class="desc">批次号:</view>
                    <view class="left-item">
                        <uni-tag :text="item.batch" type="warning"></uni-tag>
                    </view>
                </view>
                <view class="list-left-item">
                    <view class="desc">净重:</view>
                    <view class="left-item">{{item.anfme}}</view>
                </view>
            </view>
            <view style="width: 30px;" v-show="item.inspect == 1">
                <uni-icons type="checkbox-filled" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons>
            </view>
            <view style="width: 30px;" v-show="item.inspect != 1">
                <uni-icons type="checkbox-filled" color="#c3c3c3" size="24" @click="revise(item,i)"></uni-icons>
            </view>
        </view>
        <view style="height: 60px;"></view>
        <view class="orderDetl-none" v-if="orderList.length == 0">暂无明细</view>
        <!-- 底部操作按钮 -->
        <view class="buttom">
            <button size="mini" @click="reset('warn')">重置</button>
            <button size="mini" type="primary" @click="combConfirm('warn')">单据核对</button>
        </view>
        <view>
            <uni-popup ref="combConfirm2" type="dialog">
                <uni-popup-dialog :type="msgType" cancelText="取消" confirmText="确认" :title="title" :content="content"
                    @close="combClose"></uni-popup-dialog>
            </uni-popup>
        </view>
        <!-- 确认组托 -->
        <view>
            <uni-popup ref="combConfirm" type="dialog">
                <uni-popup-dialog :type="msgType" cancelText="取消" confirmText="确认" :title="title" :content="content"
                    @confirm="comb" @close="combClose"></uni-popup-dialog>
            </uni-popup>
        </view>
        <!-- 确认重置 -->
        <view>
            <uni-popup ref="resetConfirm" type="dialog">
                <uni-popup-dialog :type="msgType" cancelText="取消" confirmText="确认" :title="title" :content="content"
                    @confirm="resetConfirm" @close="resetClose"></uni-popup-dialog>
            </uni-popup>
        </view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
                baseUrl: '',
                token: '',
                orderNoList: [],
                orderNo: '',
                orderList: [],
                checkUser:[],
                matnr: '',
                matFocus: true,
                msgType: 'success',
                messageText: '',
                title: '',
                content: '',
                threeCode:'',
                memo:'',
            }
        },
        onShow() {
            this.baseUrl = uni.getStorageSync('baseUrl');
            this.token = uni.getStorageSync('token');
            this.getCheckUser();
            this.getOrderDet();
        },
        methods: {
            getOrderDet() {
                let _this = this
                // if (_this.orderNo.length == 0) {
                //     _this.orderList = []
                //     _this.orderNoList = []
                //     return
                // }
                uni.request({
                    url: `${_this.baseUrl}/mobile/getReviewList?orderNo=`+_this.orderNo,
                    header: {
                        'token': uni.getStorageSync('token')
                    },
                    method: 'GET',
                    success(res) {
                        res = res.data
                        if (res.code == 200) {
                            _this.orderNoList = res.data
                        } else if (res.code == 403) {
                            uni.showToast({
                                title: res.msg,
                                icon: "error",
                                position: 'center'
                            })
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../login/login'
                                });
                            }, 1000);
                        } else {
                            uni.showToast({
                                title: res.msg,
                                icon: "error",
                                position: 'center'
                            })
                        }
                    }
                })
            },
            getOrderDetlByOrderNo() {
                let _this = this
                uni.request({
                    url: `${_this.baseUrl}/mobile/getReviewDetlByOrderNo/${_this.orderNo}`,
                    header: {
                        'token': uni.getStorageSync('token')
                    },
                    method: 'GET',
                    success(res) {
                        res = res.data
                        if (res.code === 200) {
                            _this.orderList.length = 0
                            console.log(_this.orderList);
                            _this.orderList = res.data
                        } else if (res.code === 403) {
                            uni.showToast({
                                title: res.msg,
                                icon: "error",
                                position: 'center'
                            })
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../login/login'
                                });
                            }, 1000);
                        } else {
                            uni.showToast({
                                title: res.msg,
                                icon: "error",
                                position: 'center'
                            })
                        }
                    }
                })
            },
            getCheckUser() {
                let _this = this
                uni.request({
                    url: `${_this.baseUrl}/mobile/getCheckUser`,
                    header: {
                        'token': uni.getStorageSync('token')
                    },
                    method: 'GET',
                    success(res) {
                        res = res.data
                        if (res.code === 200) {
                            _this.checkUser.length = 0
                            console.log( res.data);
                            _this.checkUser = res.data
                        } else if (res.code === 403) {
                            uni.showToast({
                                title: res.msg,
                                icon: "error",
                                position: 'center'
                            })
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../login/login'
                                });
                            }, 1000);
                        } else {
                            uni.showToast({
                                title: res.msg,
                                icon: "error",
                                position: 'center'
                            })
                        }
                    }
                })
            },
            choseOne() {
                let _this = this
                uni.navigateTo({
                    url: './orderSelect',
                    success(res) {
                        res.eventChannel.emit('matList', {
                            matList: _this.dataList
                        })
                    },
                    events: {
                        pickList: function(data) {}
                    }
                })
            },
            // 解析产品标签信息
            parseProductInfo() {
                const productInfo = {
                    model: '', // 卷号
                    batch: '', // 箱号
                    specs: '', // 规格
                    length: 0, // 长度
                    anfme: 0, // 净重
                    qty: 0, // 毛重
                    volume: 0 // 接头数量
                };
                // 使用正则表达式提取各项信息
                const patterns = {
                    model: /卷号[::]\s*([^\s<]+)/,
                    batch: /箱号[::]\s*([^\s<]+)/,
                    specs: /规格[::]\s*([^\s<]+)/,
                    length: /长度[::]\s*([\d.]+)\s*&nbsp;?m/,
                    anfme: /净重[::]\s*([\d.]+)\s*&nbsp;?kg/,
                    qty: /毛重[::]\s*([\d.]+)\s*&nbsp;?kg/,
                    volume: /接头[::]\s*([\d.]+)\s*&nbsp;?个/
                };
                // 提取各字段信息
                for (let key in patterns) {
                    const match = this.matnr.match(patterns[key]);
                    if (match && match[1]) {
                        if (['length', 'anfme', 'qty', 'volume'].includes(key)) {
                            productInfo[key] = parseFloat(match[1]);
                        } else {
                            productInfo[key] = match[1].trim();
                        }
                    }
                }
                return productInfo;
            },
            analysis2() {
                const result = this.parseProductInfo()
                console.info(result)
                this.secAnalysis(result)
                // if (this.dataList.length > 0) this.checkAdd(result)
                // else this.dataList.push(result);
                // this.focuss()
            },
            secAnalysis(data) {
                let flag = false;
                for (let k of this.orderList) {
                    if (data.batch == k.batch && data.specs == k.specs && data.anfme == k.anfme) {
                        flag = true
                        if (k.inspect == 1) {
                            uni.showToast({
                                title: '当前条码已确认',
                                icon: "error",
                                position: 'center'
                            })
                        } else {
                            uni.showToast({
                                title: '确认成功',
                                icon: "success",
                                position: 'center',
                                duration: 2000
                            })
                            k.inspect = 1
                        }
                    }
                }
                if (!flag) {
                    this.msgType = 'warn'
                    this.title = '警告'
                    this.content = '批次号:' + data.batch + '规格:' + data.specs + '净重:' + data.qty + '  不存在,请检查!'
                    this.$refs.combConfirm2.open()
                }
                this.focuss()
            },
            focuss() {
                this.matFocus = false;
                setTimeout(() => {
                    this.matnr = '';
                    this.matFocus = true;
                }, 100);
            },
            reset(type) {
                this.msgType = type
                this.title = '警告'
                this.content = '是否重置!'
                this.$refs.resetConfirm.open()
            },
            combConfirm(type) {
                this.msgType = type
                this.title = '警告'
                this.content = '是否现在核对!'
                this.$refs.combConfirm.open()
            },
            combClose() {
                this.$refs.combConfirm.close()
            },
            comb() {
                let _this = this
                if (!_this.memo) {
                    this.messageText = "请选择复核备注"
                    this.messageToggle('error')
                    return;
                }
                if (!_this.threeCode) {
                    this.messageText = "请选择复核人"
                    this.messageToggle('error')
                    return;
                }
                for (let k of this.orderList) {
                    k.memo =this.memo
                    k.threeCode =this.threeCode
                }
                uni.request({
                    url: `${_this.baseUrl}/mobile/reviewCheck`,
                    header: {
                        'token': uni.getStorageSync('token')
                    },
                    data: JSON.stringify(_this.orderList),
                    method: 'POST',
                    success(res) {
                        res = res.data
                        if (res.code === 200) {
                            _this.orderList = [],
                                _this.orderNo = ''
                            uni.showToast({
                                title: res.msg,
                                icon: "success",
                                position: 'center'
                            })
                        } else if (res.code === 403) {
                            uni.showToast({
                                title: res.msg,
                                icon: "error",
                                position: 'center'
                            })
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../login/login'
                                });
                            }, 1000);
                        } else {
                            uni.showToast({
                                title: res.msg,
                                icon: "error",
                                position: 'center'
                            })
                        }
                    }
                })
            },
            // 确认重置
            resetConfirm() {
                this.orderList = [],
                    this.orderNo = ''
                this.messageText = "重置完成"
                this.messageToggle('success')
            },
            // 取消重置
            resetClose() {
            },
        }
    }
</script>
<style>
    @import url('../../static/css/wms.css/wms.css');
    .list {
        display: flex;
        min-height: 80rpx;
        background-color: #FFF;
        padding: 10rpx;
        margin: 30rpx 20rpx;
        border-radius: 20rpx;
        box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.2);
    }
    .combox {
        background-color: white;
        padding: 8px;
        display: flex;
    }
    .list-header {
        border-top: 1px solid #eee;
        background-color: white;
        text-align: center;
        min-height: 70rpx;
        line-height: 70rpx;
        color: #555;
        font-weight: bold;
    }
    .order-item {
        margin: 8px;
        padding: 16px;
        background-color: white;
        border-radius: 10px;
        display: flex;
    }
    .orderDetl-none {
        height: 100vh;
        text-align: center;
        line-height: 50vh;
        color: #aaa;
    }
    .buttom {
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 100rpx;
        background-color: #FFF;
    }
    .code {
        width: 100%;
        position: fixed;
        min-height: 200rpx;
        background-color: #FFF;
        z-index: 10;
    }
    .item {
        background-color: white;
        display: flex;
        padding: 2px;
        align-items: center;
        height: 100rpx;
        border-bottom: 1px solid #DCDFE6;
    }
    .item input {
        height: 50rpx;
        line-height: 50rpx;
        /* font-family: PingFang SC; uniapp 默认字体不居中 */
        font-size: 36upx;
        font-family: PingFang SC;
        width: 55vw;
    }
    .code-decs {
        width: 20vw;
        font-size: 18px;
        color: #303133;
    }
</style>