#
whycq
2023-07-13 5c8951e28e9f2fbdbe730ddf264eeba313647ea9
#
6个文件已修改
312 ■■■■ 已修改文件
pages/AGV/AGVPakin.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/AGV/AGVPakinBing.vue 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/AGV/AGVPakinOn.vue 168 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/AGV/AGVStart.vue 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/mat/matSelected.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/pakin/pakin.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/AGV/AGVPakin.vue
@@ -175,7 +175,7 @@
                // 不设置定时器 会出现扫入的字符串不全
                setTimeout(() => {
                    var len = this.barcode.length
                    if (len != 8) {
                    if (len != 10) {
                        uni.showToast({
                            title: '托盘码有误请重试',
                            icon: "none",
@@ -438,6 +438,7 @@
            // 确认重置
            resetConfirm() {
                this.dataList = []
                this.barcode = ''
                this.messageText = "重置完成"
                this.messageToggle('success')
            },
pages/AGV/AGVPakinBing.vue
@@ -8,7 +8,8 @@
            </view>
            <view class="item">
                <view class="code-decs">暂存位:</view>
                <input type="text" placeholder=" 扫码 / 输入" v-model="stationCode" :focus="matFocus">
                <input type="text" placeholder=" 扫码 / 输入" v-model="stationCode" :focus="stationCodeFocus"
                    @input="stationCodeInput()">
                <view class="item-right">
                    <button></button>
                    <!-- <text style="text-align: right;color: #409EFF;" @click="selectMat()">提取+</text> -->
@@ -142,6 +143,7 @@
                token: '',
                barcode: '',
                stationCode: '',
                stationCodeFocus: false,
                dataList: [],
                count: 0,
                rowNum: '',
@@ -171,12 +173,28 @@
                this.msgType1 = type
                this.$refs.message.open()
            },
            stationCodeInput() {
                setTimeout(() => {
                    var len = this.stationCode.length
                    if (len != 15) {
                        this.stationCode = ''
                        this.stationCodeFocus = true
                        uni.showToast({
                            title: '暂存码有误请重试',
                            icon: "none",
                            position: 'top'
                        });
                        return;
                    }
                    this.focuss()
                }, 200)
            },
            // barcode input 事件
            barcodeInput() {
                // 不设置定时器 会出现扫入的字符串不全
                setTimeout(() => {
                    var len = this.barcode.length
                    if (len != 8) {
                    if (len != 10) {
                        uni.showToast({
                            title: '托盘码有误请重试',
                            icon: "none",
@@ -185,8 +203,16 @@
                        this.barcodeFocuss()
                        return;
                    }
                    this.focuss()
                    this.stationCodeFocuss()
                }, 200)
            },
            // 暂存位有误重置
            stationCodeFocuss() {
                let that = this;
                that.stationCodeFocus = false;
                setTimeout(() => {
                    that.stationCodeFocus = true;
                }, 100);
            },
            // 托盘码有误重置
            barcodeFocuss() {
@@ -420,6 +446,7 @@
            // 确认重置
            resetConfirm() {
                this.dataList = []
                this.barcode = ''
                this.stationCode = ''
                this.messageText = "重置完成"
                this.messageToggle('success')
pages/AGV/AGVPakinOn.vue
@@ -52,12 +52,6 @@
                        </view>
                    </view>
                    <view class="list-left-item">
                        <view class="desc">重量:</view>
                        <view class="left-item">
                            <uni-tag :text="item.weight" type="warning"></uni-tag>
                        </view>
                    </view>
                    <view class="list-left-item">
                        <view class="desc">数量:</view>
                        <view class="left-item">{{item.anfme}}</view>
                    </view>
@@ -71,6 +65,7 @@
        <!-- 底部操作按钮 -->
        <view class="buttom">
            <button size="mini" @click="reset('warn')">重置</button>
            <button size="mini" type="primary" @click="agvStart('warn')">启动入库</button>
            <button size="mini" type="primary" @click="combConfirm('warn')">组托</button>
        </view>
        <!-- 弹窗 -->
@@ -87,13 +82,9 @@
                                style="background-color: #f7f7f7;padding: 0;color: #d5d5d5;">
                        </view>
                    </view>
                    <!-- <view class="popup-item">
                    <view class="popup-item">
                        <view class="popup-item-left">批号:</view>
                        <view class="popup-item-right"><input type="text" v-model="batch"></view>
                    </view> -->
                    <view class="popup-item">
                        <view class="popup-item-left">重量:</view>
                        <view class="popup-item-right"><input type="text" v-model="weight"></view>
                    </view>
                    <view class="popup-item">
                        <view class="popup-item-left">数量:</view>
@@ -126,7 +117,7 @@
        <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>
                    @confirm="comb(1)" @close="combClose"></uni-popup-dialog>
            </uni-popup>
        </view>
        <!-- 确认重置 -->
@@ -134,6 +125,13 @@
            <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>
            <uni-popup ref="agvStartConfirm" type="dialog">
                <uni-popup-dialog :type="msgType" cancelText="取消" confirmText="确认" :title="title" :content="content"
                    @confirm="agvStartConfirm" @close="resetClose"></uni-popup-dialog>
            </uni-popup>
        </view>
    </view>
@@ -163,6 +161,8 @@
                matFocus: false,
                matData: '',
                removeNum: 0,
                devNo: [],
                flag: 0
            }
        },
        onLoad() {
@@ -178,27 +178,40 @@
                this.$refs.message.open()
            },
            stationCodeInput() {
                setTimeout(() => {
                    var len = this.stationCode.length
                    if (len != 15) {
                        this.stationCode = ''
                        this.stationCodeFocus = true
                        uni.showToast({
                            title: '暂存码有误请重试',
                            icon: "none",
                            position: 'top'
                        });
                        return;
                    }
                    this.focuss()
                }, 200)
            },
            // barcode input 事件
            // 符合条件的跳转到下一栏目
            barcodeInput() {
                // 不设置定时器 会出现扫入的字符串不全
                setTimeout(() => {
                    var len = this.barcode.length
                    if (len != 8) {
                    if (len != 10) {
                        this.barcode = ''
                        this.barcodeFocus = true
                        uni.showToast({
                            title: '托盘码有误请重试',
                            icon: "none",
                            position: 'top'
                        });
                        this.stationCodeFocuss()
                        return;
                    }
                    this.stationCodeFocuss()
                    // this.focuss()
                }, 200)
            },
            // 托盘码有误重置
            // 暂存位有误重置
            stationCodeFocuss() {
                let that = this;
                that.barcodeFocus = false;
@@ -384,7 +397,7 @@
            combClose() {
                this.$refs.combConfirm.close()
            },
            comb() {
            comb(e) {
                uni.vibrateShort();
                let that = this;
                if (that.barcode === '') {
@@ -418,12 +431,96 @@
                    success(result) {
                        var res = result.data
                        if (res.code === 200) {
                            that.flag = 1
                            if (e == 1) {
                                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);
                            that.flag = 0
                        } else {
                            that.messageText = res.msg
                            that.messageToggle('error')
                            that.flag = 0
                        }
                    }
                });
            },
            reset(type) {
                this.msgType = type
                this.title = '警告'
                this.content = '是否重置!'
                this.$refs.resetConfirm.open()
            },
            // 确认重置
            resetConfirm() {
                this.dataList = []
                this.barcode = ''
                this.stationCode = ''
                this.messageText = "重置完成"
                this.messageToggle('success')
            },
            // 取消重置
            resetClose() {
            },
            // 清空
            resst() {
                this.dataList = []
                this.barcode = ''
                this.stationCode = ''
                this.barcodeFocus = true
            },
            // 启动入库
            agvStart(type) {
                this.msgType = type
                this.title = '警告'
                this.content = '是否现在启动入库!'
                this.$refs.agvStartConfirm.open()
            },
            agvStartConfirm() {
                uni.showLoading()
                this.devNo = []
                this.devNo.push(this.stationCode)
                this.comb(2)
                setTimeout(()=>{
                    if (this.flag != 1) {
                        uni.hideLoading()
                        return
                    }
                    this.start()
                    uni.hideLoading()
                },500)
            },
             start() {
                let that = this
                uni.request({
                    url: that.baseUrl + '/agvMobile/pakin/auth',
                    data: JSON.stringify({
                        devNo: that.devNo
                    }),
                    method: 'POST',
                    header: {
                        'token': uni.getStorageSync('token')
                    },
                    success(result) {
                        var res = result.data
                        if (res.code === 200) {
                            that.resst();
                            that.messageText = "组托成功"
                            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')
@@ -439,30 +536,7 @@
                    }
                });
            },
            reset(type) {
                this.msgType = type
                this.title = '警告'
                this.content = '是否重置!'
                this.$refs.resetConfirm.open()
            },
            // 确认重置
            resetConfirm() {
                this.dataList = []
                this.stationCode = ''
                this.messageText = "重置完成"
                this.messageToggle('success')
            },
            // 取消重置
            resetClose() {
            },
            // 清空
            resst() {
                this.dataList = []
                this.barcode = ''
                this.stationCode = ''
                this.barcodeFocuss()
            },
        }
    }
</script>
pages/AGV/AGVStart.vue
@@ -1,29 +1,19 @@
<template>
    <view>
        <view class="code">
            <!-- <view class="item">
                <view class="code-decs">托盘码:</view>
                <input type="text" placeholder=" 扫码 / 输入" v-model="barcode" :focus="barcodeFocus"
                    @input="barcodeInput()">
            </view> -->
            <!-- <view class="item">
                <view class="code-decs">暂存位:</view>
                <input type="text" placeholder=" 扫码 / 输入" v-model="stationCode" :focus="matFocus" @input="stationCodeInput()">
                <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>
            </view> -->
            <view class="item">
                <view class="code-decs">楼号:</view>
                <uni-combox :candidates="floorList" placeholder="请选择楼号" v-model="floor" @input="getFloor"></uni-combox>
            </view>
            <view class="item">
                <view class="code-decs">暂存位:</view>
                <input type="text" placeholder=" 扫码 / 输入" v-model="stationCode" :focus="stationCodeFocus"
                    @input="stationCodeInput()">
            </view>
        </view>
        <view class="mat-list-title">
            <view style="width: 200rpx;"></view>
            <view style="-webkit-flex: 1;flex: 1;">商品列表</view>
            <view style="width: 200rpx;"><button size="mini" type="primary" @click="getChecked">提取</button></view>
            <view style="-webkit-flex: 1;flex: 1;">站点列表</view>
        </view>
        <scroll-view>
            <view class="list" v-for="(item,i) in dataList" :key="i" :class="'bg-'+item.color">
@@ -118,6 +108,7 @@
                token: '',
                barcode: '',
                stationCode: '',
                stationCodeFocus: true,
                dataList: [],
                count: 0,
                rowNum: '',
@@ -145,6 +136,52 @@
            this.token = uni.getStorageSync('token');
        },
        methods: {
            stationCodeInput() {
                setTimeout(() => {
                    var len = this.stationCode.length
                    if (len != 15) {
                        this.stationCode = ''
                        this.stationCodeFocus = true
                        uni.showToast({
                            title: '暂存码有误请重试',
                            icon: "none",
                            position: 'top'
                        });
                        return;
                    }
                    this.pushDevNo()
                    this.stationCodeFocuss()
                }, 200)
            },
            pushDevNo() {
                var devNo = {"devNo":this.stationCode}
                if (this.dataList.length == 0) {
                    this.dataList.push(devNo)
                    return
                }
                var flag = false
                for(var i = 0; i < this.dataList.length; i++ ) {
                    if (this.dataList[i].devNo == devNo.devNo) {
                        this.messageText = "站点重复"
                        this.messageToggle('warn')
                        return
                    } else {
                        flag = true
                    }
                }
                if(flag) {
                    this.dataList.push(devNo)
                }
            },
            stationCodeFocuss() {
                let that = this;
                this.stationCode = ''
                that.stationCodeFocus = false;
                setTimeout(() => {
                    that.stationCodeFocus = true;
                }, 100);
            },
            getChecked() {
                var checkedList = []
                for(var i = 0; i < this.dataList.length; i++) {
@@ -161,6 +198,9 @@
            },
            getFloor() {
                let that = this
                if (this.floor == '') {
                    return
                }
                uni.request({
                    url: that.baseUrl + '/agvMobile/getBasDevp/auth',
                    data: {
@@ -174,20 +214,16 @@
                        res = res.data
                        for(var i = 0; i < res.data.length; i++) {
                            if (res.data[i].locSts === 'F') {
                                res.data[i]["color"] = "red"
                                // res.data[i]["color"] = "red"
                                that.dataList.push(res.data[i])
                            }
                        }
                        that.dataList = res.data
                        console.log(that.dataList);
                    }
                });
            },
            messageToggle(type) {
                this.msgType1 = type
                this.$refs.message.open()
            },
            stationCodeInput() {
                this.dataList.push(this.stationCode)
            },
            // barcode input 事件
            barcodeInput() {
@@ -388,10 +424,13 @@
                this.$refs.combConfirm.close()
            },
            comb() {
                this.devNo = []
                uni.vibrateShort();
                let that = this;
                for (var i = 0; i < that.dataList.length; i++) {
                    that.devNo.push(that.dataList[i].devNo)
                for (var i = 0; i < this.dataList.length; i++) {
                    if (this.dataList[i].checked) {
                        this.devNo.push(this.dataList[i].devNo)
                    }
                }
                uni.request({
                    url: that.baseUrl + '/agvMobile/pakin/auth',
@@ -408,9 +447,6 @@
                            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')
@@ -468,7 +504,7 @@
        color: #666666;
    }
    .list:first-child {
        margin-top: 260rpx;
        margin-top: 360rpx;
    }
    .aside {
        width: 100rpx;
@@ -521,7 +557,7 @@
        width: 100%;
        background-color: white;
        position: fixed;
        margin-top: 100rpx;
        margin-top: 200rpx;
        z-index: 9;
        /* border-top: 1px solid #DCDFE6; */
        text-align: center;
pages/mat/matSelected.vue
@@ -13,18 +13,18 @@
                <view class="form-item-desc"><text>规格</text></view>
                <view class="form-item-content"><text>{{mat.specs}}</text></view>
            </view>
            <!-- <view class="form-item">
            <view class="form-item">
                <view class="form-item-desc"><text>批号</text></view>
                <view class="form-item-content">
                    <view class="form-input">
                        <input type="text" v-model="mat.batch">
                    </view>
                </view>
            </view> -->
            </view>
            <view class="form-item">
                <view class="form-item-desc"><text>数量</text></view>
                <view class="form-item-content">
                    <uni-number-box :value="mat.anfme" :max="99999999" :step='0.01' color="#747474" @change="changeValue" />
                    <uni-number-box :value="mat.anfme" :max="99999999" :step='1' color="#747474" @change="changeValue" />
                </view>
            </view>
        </view>
pages/pakin/pakin.vue
@@ -237,9 +237,9 @@
                                    },
                                },
                            });
                        } else if (res.code == 403) {
                        } else if (result.code == 403) {
                            uni.showToast({
                                title: res.msg,
                                title: result.msg,
                                icon: "none",
                                position: 'top'
                            })
@@ -250,7 +250,7 @@
                            }, 1000);
                        } else {
                            uni.showToast({
                                title: res.msg,
                                title: result.msg,
                                icon: "none",
                                position: 'top'
                            })