1.新增agv组托入库和组托并补空托盘
2.新增agv搬运任务
3.新增agv补空托盘功能
4个文件已修改
181 ■■■■ 已修改文件
pages/AGV/AGVPakin.vue 148 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/mat/matSelected.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/pakin/pakin.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/AGV/AGVPakin.vue
@@ -2,9 +2,9 @@
    <view>
        <view class="code">
            <view class="item">
                <view class="code-decs">订单号:</view>
                <input type="text" placeholder=" 扫码 / 输入" v-model="orderNo" :focus="orderNoFocus"
                    @input="orderNoInput()">
                <view class="code-decs">站点号:</view>
                <input type="text" placeholder=" 扫码 / 输入" v-model="rsta" :focus="rstaFocus"
                    @input="rstaInput()">
            </view>
            <view class="item">
                <view class="code-decs">托盘码:</view>
@@ -19,6 +19,17 @@
                    <text style="text-align: right;color: #409EFF;" @click="selectMat()">提取+</text>
                    <uni-icons type="right" color="#c1c1c1"></uni-icons>
                </view>
            </view>
            <view class="item">
            <view class="code-decs" style="width: 25vw;">大小托盘:</view>
            <radio-group @change="isFullPlt">
                <label>
                    <radio :checked="ck1" style="transform: scale(0.7)"/><text>小托盘</text>
                </label>
                <label>
                    <radio :checked="ck2" style="margin-left: 50rpx;transform: scale(0.7);"/><text>大托盘</text>
                </label>
            </radio-group>
            </view>
        </view>
        <view class="mat-list-title">
@@ -69,9 +80,10 @@
            </view>
        </scroll-view>
        <!-- 底部操作按钮 -->
        <view class="buttom">
            <button size="mini" @click="reset('warn')">重置</button>
        <view class="buttom">、
            <button size="mini" type="primary" @click="combConfirm('warn')">组托</button>
            <button size="mini" @click="reset('warn')">重置</button>
            <button size="mini" type="primary" @click="combConfirmAndFillEmptyPallets('warn')">组托并补空托盘</button>
        </view>
        <!-- 弹窗 -->
        <!-- 修改数量 -->
@@ -129,6 +141,13 @@
                    @confirm="comb" @close="combClose"></uni-popup-dialog>
            </uni-popup>
        </view>
        <view>
            <uni-popup ref="combConfirmAndFillEmptyPallets" type="dialog">
                <uni-popup-dialog :type="msgType" cancelText="取消" confirmText="确认" :title="title" :content="content"
                    @confirm="combAndFillEmptyPallets" @close="combClose"></uni-popup-dialog>
            </uni-popup>
        </view>
        <!-- 确认重置 -->
        <view>
            <uni-popup ref="resetConfirm" type="dialog">
@@ -146,7 +165,7 @@
                baseUrl: '',
                token: '',
                barcode: '',
                orderNo: '',
                rsta: '',
                dataList: [],
                count: 0,
                rowNum: '',
@@ -160,9 +179,12 @@
                content: '',
                barcodeFocus: true,
                matFocus: false,
                orderNoFocus: false,
                rstaFocus: false,
                matData: '',
                removeNum: 0,
                ck1: true,
                ck2: false,
                fullPlt: '1'
            }
        },
        onLoad() {
@@ -173,15 +195,26 @@
            this.token = uni.getStorageSync('token');
        },
        methods: {
            // 大小托盘
            isFullPlt() {
                var temp = this.ck1
                this.ck1 = this.ck2
                this.ck2 = temp
                if (this.ck1) {
                    this.fullPlt = '1'
                } else {
                    this.fullPlt = '2'
                }
            },
            messageToggle(type) {
                this.msgType1 = type
                this.$refs.message.open()
            },
            // barcode input 事件
            orderNoInput() {
            rstaInput() {
                // 不设置定时器 会出现扫入的字符串不全
                setTimeout(() => {
                    var len = this.orderNo.length
                    var len = this.rsta.length
                    this.barcodeFocuss()
                }, 200)
            },
@@ -189,7 +222,7 @@
                // 不设置定时器 会出现扫入的字符串不全
                setTimeout(() => {
                    var len = this.barcode.length
                    if (len != 10) {
                    if (len != 8) {
                        uni.showToast({
                            title: '托盘码有误请重试',
                            icon: "none",
@@ -219,15 +252,8 @@
                }, 100);
            },
            // 搜索物料
            findMat() {
                findMat() {
                let that = this
                // 判断物料长度是否为1
                if (that.dataList.length >= 1) {
                    this.messageText = "只能添加一种物料"
                    this.messageToggle('warn')
                    that.matnr = ''
                    return
                }
                uni.request({
                    url: that.baseUrl + '/mat/auth',
                    data: {
@@ -247,8 +273,10 @@
                                // 通过eventChannel向被打开页面传送数据
                                success: function(res) {
                                    res.eventChannel.emit('mat', {
                                        data: result.data
                                    })
                                    console.log(res);
                                },
                                // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
                                events: {
@@ -322,12 +350,13 @@
                                add = true
                            }
                            
                        } else {
                            // 相同物料相同批号 数量累加
                            this.dataList[i].anfme += mat.anfme
                            this.$forceUpdate() // 强制刷新
                            add = false
                        }
                        }
                        // else {
                        //     // 相同物料相同批号 数量累加
                        //     this.dataList[i].anfme += mat.anfme
                        //     this.$forceUpdate() // 强制刷新
                        //     add = false
                        // }
                    }
                }
                if (add) {
@@ -386,10 +415,17 @@
                this.content = '是否现在组托!'
                this.$refs.combConfirm.open()
            },
            combConfirmAndFillEmptyPallets(type) {
                this.msgType = type
                this.title = '警告'
                this.content = '是否现在组托并补空板!'
                this.$refs.combConfirmAndFillEmptyPallets.open()
            },
            combClose() {
                this.$refs.combConfirm.close()
            },
            comb() {
                console.log("普通组托")
                uni.vibrateShort();
                let that = this;
                if (that.barcode === '') {
@@ -410,9 +446,69 @@
                    }
                }
                uni.request({
                    url: that.baseUrl + '/agvMobile/comb/auth',
                    url: that.baseUrl + '/mobile/comb/auth',
                    data: JSON.stringify({
                        orderNo: that.orderNo,
                        beBatch : 1,
                        barcodeSize: '0',
                        rsta: that.rsta,
                        barcode: that.barcode,
                        combMats: that.dataList
                    }),
                    method: 'POST',
                    header: {
                        'token': uni.getStorageSync('token')
                    },
                    success(result) {
                        var res = result.data
                        if (res.code === 200) {
                            that.resst();
                            that.messageText = "组托成功"
                            that.messageToggle('success')
                            const innerAudioContext = uni.createInnerAudioContext();
                            innerAudioContext.src = '/static/music/pakinOk.mp3';
                            innerAudioContext.play()
                        } else if (res.code == 403) {
                            that.messageText = res.msg
                            that.messageToggle('error')
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../login/login'
                                });
                            }, 1000);
                        } else {
                            that.messageText = res.msg
                            that.messageToggle('error')
                        }
                    }
                });
            },
            //组托并补空托盘
            combAndFillEmptyPallets() {
                uni.vibrateShort();
                let that = this;
                if (that.barcode === '') {
                    this.messageText = "请扫描托盘条码"
                    this.messageToggle('error')
                    return;
                }
                if (that.dataList.length === 0) {
                    this.messageText = "请添加商品列表"
                    this.messageToggle('error')
                    return;
                }
                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.messageToggle('error')
                        return;
                    }
                }
                uni.request({
                    url: that.baseUrl + '/mobile/comb/auth',
                    data: JSON.stringify({
                        beBatch : 1,
                        barcodeSize : this.fullPlt,
                        rsta: that.rsta,
                        barcode: that.barcode,
                        combMats: that.dataList
                    }),
pages/home/home.vue
@@ -31,6 +31,13 @@
                        cuIcon: 'pullup',
                        url: '/pakin/pakin'
                    },
                    {
                        title: 'AGV组托入库',
                        name: 'AGVPakin',
                        color: 'cyan',
                        cuIcon: 'pullup',
                        url: '/AGV/AGVPakin'
                    },
                    // {
                    //     title: '再次拣料',
                    //     name: 'changePallet',
@@ -38,13 +45,13 @@
                    //     cuIcon: 'order',
                    //     url: '/pakin/pickAgain'
                    // },
                    {
                        title: '订单入库',
                        name: 'orderPakin',
                        color: 'red',
                        cuIcon: 'pullup',
                        url: '/order/orderPakin'
                    },
                    // {
                    //     title: '订单入库',
                    //     name: 'orderPakin',
                    //     color: 'red',
                    //     cuIcon: 'pullup',
                    //     url: '/order/orderPakin'
                    // },
                    {
                        title: 'AGV移动任务',
                        name: 'AGVStart',
pages/mat/matSelected.vue
@@ -14,7 +14,7 @@
                <view class="form-item-content"><text>{{mat.specs}}</text></view>
            </view>
            <view class="form-item">
                <view class="form-item-desc"><text>情况说明</text></view>
                <view class="form-item-desc"><text>批号</text></view>
                <view class="form-item-content">
                    <view class="form-input">
                        <input type="text" v-model="mat.batch">
@@ -62,9 +62,10 @@
            
            // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
            eventChannel.on('mat', function(data) {
                console.log(data.data);
                data.data['anfme'] = 1
                that.mat = data.data
                log.console(data.data)
                if (data.data.maxNum > 0) {
                    that.mat.anfme = data.data.maxNum
                    that.max = data.data.maxNum
@@ -89,7 +90,6 @@
                this.mat.anfme = value
            },
            back() {
                console.log(this.mat);
                if (this.mat.anfme === 0) {
                    uni.showToast({title: '请输入数量', icon: "none", position: 'top'});
                    return;
pages/pakin/pakin.vue
@@ -2,7 +2,7 @@
    <view>
        <view class="code">
            <view class="item">
                <view class="code-decs">站点码:</view>
                <view class="code-decs">托盘码:</view>
                <input type="text" placeholder=" 扫码 / 输入" v-model="barcode" :focus="barcodeFocus"
                    @input="barcodeInput()">
            </view>
@@ -41,7 +41,7 @@
                        <view class="left-item">{{item.specs}}</view>
                    </view>
                    <view class="list-left-item">
                        <view class="desc" style="width: 38%;">情况说明:</view>
                        <view class="desc" style="width: 38%;">批号:</view>
                        <view class="left-item">
                            <uni-tag :text="item.batch" type="warning"></uni-tag>
                        </view>
@@ -176,7 +176,7 @@
                // 不设置定时器 会出现扫入的字符串不全
                setTimeout(() => {
                    var len = this.barcode.length
                    if (len != 3) {
                    if (len != 8) {
                        uni.showToast({
                            title: '托盘码有误请重试',
                            icon: "none",