#
whycq
2024-03-19 108f0553f4e3d3fe1faca4b10857fb37d7b0e533
#
1个文件已添加
2个文件已修改
570 ■■■■ 已修改文件
pages.json 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tzsk/AGV/AGVPick.vue 456 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tzsk/AGV/orderList.vue 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json
@@ -410,6 +410,14 @@
                "navigationBarTitleText" : "AGV组托",
                "enablePullDownRefresh" : false
            }
        },
        {
            "path" : "pages/tzsk/AGV/orderList",
            "style" :
            {
                "navigationBarTitleText" : "订单列表",
                "enablePullDownRefresh" : false
            }
        }
        
        
pages/tzsk/AGV/AGVPick.vue
@@ -2,31 +2,80 @@
    <view>
        <view class="code">
            <view class="item">
                <view class="code-decs">楼号:</view>
                <uni-combox :candidates="floorList" placeholder="请选择楼号" v-model="floor" @input="getFloor"></uni-combox>
                <view class="code-decs">采购单号:</view>
                <input type="text" placeholder=" 扫码 / 输入" v-model="orderNo" :focus="orderNoFocus"
                    @input="findOrder()">
            </view>
            <view class="item">
                <view class="code-decs">暂存位:</view>
                <input type="text" placeholder=" 扫码 / 输入" v-model="stationCode" :focus="stationCodeFocus"
                    @input="stationCodeInput()">
                <view class="code-decs">料箱码:</view>
                <input type="text" placeholder=" 扫码 / 输入" v-model="barcode" :focus="barcodeFocus"
                    @input="barcodeInput()">
            </view>
        </view>
        <view class="mat-list-title">
            <view style="-webkit-flex: 1;flex: 1;"></view>
            <view style="-webkit-flex: 1;flex: 1;">站点列表</view>
            <view style="-webkit-flex: 1;flex: 1;"><button size="mini" @click="selectAll()">{{btnText}}</button></view>
            商品列表
        </view>
        <scroll-view>
            <view class="list" v-for="(item,i) in dataList" :key="i" :class="'bg-'+item.color">
                <view class="aside">
                    <checkbox :value="item.matnr" :checked="item.checked" @click="set(i)"/>
                </view>
                <view class="list-left" style="display: flex;justify-content: center;">
                    {{item.devNo}}
            <view class="list" v-for="(item,i) in dataList" :key="i">
                <view class="list-left">
                    <view class="list-left-item">
                        <view class="desc">No:</view>
                        <view class="left-item">{{i + 1}}</view>
                    </view>
                    <!-- <view class="list-left-item">
                        <view class="desc">箱码:</view>
                        <view class="left-item">
                            <input type="text" v-model="item.containerCode">
                            <uni-tag :text="item.containerCode" type="primary"></uni-tag>
                        </view>
                    </view> -->
                    <view class="list-left-item">
                        <view class="desc">销售单号:</view>
                        <view class="left-item">
                            <input type="text" v-model="item.csocode">
                            <!-- <uni-tag :text="item.containerCode" type="primary"></uni-tag> -->
                        </view>
                    </view>
                    <view class="list-left-item">
                        <view class="desc">订单行号:</view>
                        <view class="left-item">
                            <input type="text" v-model="item.isoseq">
                            <!-- <uni-tag :text="item.containerCode" type="primary"></uni-tag> -->
                        </view>
                    </view>
                    <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.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">
                            <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>
                </view>
                <view class="list-right">
                    <!-- <uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons> -->
                    <uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons>
                    <uni-icons type="trash" color="#f58a8a" size="24" @click="remove(item,i,'warn')"></uni-icons>
                </view>
            </view>
@@ -34,8 +83,7 @@
        <!-- 底部操作按钮 -->
        <view class="buttom">
            <button size="mini" @click="reset('warn')">重置</button>
            <button size="mini" type="primary" @click="containerMove()">容器离场</button>
            <button size="mini" type="primary" @click="containerPick()">盘点 / 拣货</button>
            <button size="mini" type="primary" @click="combConfirm('warn')">组托</button>
        </view>
        <!-- 弹窗 -->
        <!-- 修改数量 -->
@@ -45,20 +93,20 @@
                    <!-- 标题 -->
                    <view class="title">修改</view>
                    <view class="popup-item">
                        <view class="popup-item-left">编码:</view>
                        <view class="popup-item-left">料号:</view>
                        <view class="popup-item-right">
                            <input type="text" v-model="matnr" disabled="true"
                                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>
                    <!-- <view class="popup-item">
                        <view class="popup-item-left">重量:</view>
                        <view class="popup-item-right"><input type="text" v-model="weight"></view>
                    </view>
                    </view> -->
                    <view class="popup-item">
                        <view class="popup-item-left">数量:</view>
                        <view class="popup-item-right" style="border: none;justify-content: center;">
@@ -86,7 +134,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"
@@ -114,12 +162,8 @@
                baseUrl: '',
                token: '',
                barcode: '',
                stationCode: '',
                stationCodeFocus: true,
                dataList: [
                    // {matnr:'12321321',devNo:'rk123123',color:'red'},
                    // {matnr:'12321321',devNo:'rk123123',color:'white'},
                    ],
                orderNo: '',
                dataList: [],
                count: 0,
                rowNum: '',
                matnr: '',
@@ -130,14 +174,12 @@
                messageText: '',
                title: '',
                content: '',
                barcodeFocus: true,
                orderNoFocus: true,
                barcodeFocus: false,
                matFocus: false,
                matData: '',
                removeNum: 0,
                floorList: [1,3],
                floor: "",
                devNo: [],
                btnText: '全选',
                tempOrderInfo: {csocode: '',isoseq: ''},
                hide: true,
                hidebg: 'kb-bgtr'
            }
@@ -161,91 +203,6 @@
            this.token = uni.getStorageSync('token');
        },
        methods: {
            containerPick() {
                let _this = this
                for (var i = 0; i < this.dataList.length; i++) {
                    if (this.dataList[i].checked) {
                        this.devNo.push(this.dataList[i].devNo)
                    }
                }
                uni.request({
                    url: _this.baseUrl + '/agv/basDevp/visualized/container/pickIn',
                    header: {'token': uni.getStorageSync('token')},
                    data: JSON.stringify({devNo: _this.devNo}),
                    method: 'POST',
                    success(res) {
                        res = res.data
                        console.log(res);
                        if (res.code === 200) {
                            _this.pickCode = ''
                            _this.dataList = []
                            _this.devNo = []
                            _this.messageText = "盘点 / 拣货成功"
                            _this.messageToggle('success')
                        } else if (res.code == 403) {
                            uni.showToast({
                                title: res.msg,
                                icon: "none",
                                position: 'top'
                            })
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../login/login'
                                });
                            }, 1000);
                        } else {
                            uni.showToast({
                                title: res.msg,
                                icon: "none",
                                position: 'top'
                            })
                        }
                    }
                })
            },
            // 容器离场
            containerMove() {
                let _this = this
                for (var i = 0; i < this.dataList.length; i++) {
                    if (this.dataList[i].checked) {
                        this.devNo.push(this.dataList[i].devNo)
                    }
                }
                uni.request({
                    url: _this.baseUrl + '/agv/basDevp/visualized/container/moveOut',
                    header: {'token': uni.getStorageSync('token')},
                    data: JSON.stringify({devNo: _this.devNo}),
                    method: 'POST',
                    success(res) {
                        res = res.data
                        console.log(res);
                        if (res.code === 200) {
                            _this.pickCode = ''
                            _this.dataList = []
                            _this.devNo = []
                            _this.messageText = "离场成功"
                            _this.messageToggle('success')
                        } else if (res.code == 403) {
                            uni.showToast({
                                title: res.msg,
                                icon: "none",
                                position: 'top'
                            })
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../login/login'
                                });
                            }, 1000);
                        } else {
                            uni.showToast({
                                title: res.msg,
                                icon: "none",
                                position: 'top'
                            })
                        }
                    }
                })
            },
            hideKeyboard() {
                this.hide = this.hide ? false : true
                if (this.hide) {
@@ -254,119 +211,80 @@
                    this.hidebg = 'kb-bgfa'
                }
            },
            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++) {
                    var t = !this.dataList[i].checked
                    if (this.dataList[i].checked) {
                        checkedList.push(this.dataList[i])
                    }
                }
                this.dataList = checkedList
            },
            set(i) {
                var ck = this.dataList[i].checked
                this.dataList[i].checked = ck ? false:true
            },
            selectAll() {
                if (this.btnText == '全选') {
                    for (let i in this.dataList) {
                        this.$set(this.dataList[i],'checked',true)
                        this.btnText = '取消'
                    }
                } else {
                    for (let i in this.dataList) {
                        var ck = this.dataList[i].checked
                        this.dataList[i].checked = false
                        this.btnText = '全选'
                    }
                }
            },
            getFloor() {
            // 根据订单号返回商品详情
            findOrder() {
                let that = this
                if (this.floor == '') {
                    return
                }
                that.tempOrderInfo.csocode = ''
                that.tempOrderInfo.isoseq = ''
                uni.request({
                    url: that.baseUrl + '/agvMobile/getBasDevp/auth',
                    url: that.baseUrl + '/mobile/order/search/orderNo/auth',
                    header: {'token': uni.getStorageSync('token')},
                    data: {
                        floor: that.floor
                        orderNo: that.orderNo
                    },
                    header: {
                        'token': uni.getStorageSync('token')
                    },
                    method: 'POST',
                    success(res) {
                        res = res.data
                        for(var i = 0; i < res.data.length; i++) {
                            if (res.data[i].locSts === 'F') {
                                // res.data[i]["color"] = "red"
                                that.dataList.push(res.data[i])
                        console.log(res);
                        if (res.code === 200) {
                            if(res.data && res.data[0].combMats) {
                                for (let i = 0; i < res.data[0].combMats.length; i++) {
                                    that.checkMat(res.data[0].combMats[i])
                                }
                                that.orderNoFocus = false
                                setTimeout(() => {
                                    that.barcodeFocus = true
                                }, 10);
                            } else {
                                // uni.showToast({
                                //     title: that.orderNo + '请检查订单号是否正确',
                                //     icon: "none",
                                //     position: 'top'
                                // })
                            }
                        } else if (res.code == 403) {
                            uni.showToast({
                                title: res.msg,
                                icon: "none",
                                position: 'top'
                            })
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../login/login'
                                });
                            }, 1000);
                        } else {
                            uni.showToast({
                                title: res.msg,
                                icon: "none",
                                position: 'top'
                            })
                        }
                    }
                });
                })
            },
            messageToggle(type) {
                this.msgType1 = type
                this.$refs.message.open()
            },
            // barcode input 事件
            barcodeInput() {
            orderNoInput() {
                // 不设置定时器 会出现扫入的字符串不全
                setTimeout(() => {
                    var len = this.barcode.length
                    if (len != 8) {
                    var len = this.orderNo.length
                    this.barcodeFocuss()
                }, 200)
            },
            barcodeInput() {
                // 不设置定时器 会出现扫入的字符串不全
                if (this.barcode.split('_')[1]) {
                    this.barcode = this.barcode.split('_')[1]
                }
                // this.barcode = this.barcode.split('_')[1]
                setTimeout(() => {
                    let len = this.barcode.length
                    if (len != 10) {
                        uni.showToast({
                            title: '托盘码有误请重试',
                            title: '料箱码有误请重试',
                            icon: "none",
                            position: 'top'
                        });
@@ -396,14 +314,17 @@
            // 搜索物料
            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: {
                        matnr: that.matnr
                    },
                    header: {
                        'token': uni.getStorageSync('token')
                    },
                    data: { matnr: that.matnr },
                    header: { 'token': uni.getStorageSync('token') },
                    success(result) {
                        result = result.data
                        if (result.code === 200 && result.data) {
@@ -411,16 +332,19 @@
                            that.matnr = ''
                            that.matData['batch'] = ''
                            uni.navigateTo({
                                url: "../mat/matSelected",
                                url: "../../mat/matSelected",
                                // 通过eventChannel向被打开页面传送数据
                                success: function(res) {
                                    res.eventChannel.emit('mat', {
                                        data: result.data
                                        data: result.data,
                                        // tempOrderInfo: that.tempOrderInfo
                                    })
                                },
                                // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
                                events: {
                                    matList: function(data) {
                                        data.data['csocode'] = ''
                                        data.data['isoseq'] = ''
                                        that.checkMat(data.data)
                                        that.focuss()
                                    },
@@ -452,7 +376,7 @@
            selectMat() {
                let that = this
                uni.navigateTo({
                    url: "../mat/matQuery",
                    url: "../../mat/matQuery",
                    success: function(res) {
                        // 通过eventChannel向被打开页面传送数据   向另外一个页面传递值的
                        res.eventChannel.emit('commonUrl', {
@@ -551,25 +475,47 @@
            combConfirm(type) {
                this.msgType = type
                this.title = '警告'
                this.content = '是否现在启动!'
                this.content = '是否现在组托!'
                this.$refs.combConfirm.open()
            },
            combClose() {
                this.$refs.combConfirm.close()
            },
            comb() {
                this.devNo = []
                uni.vibrateShort();
                let that = this;
                for (var i = 0; i < this.dataList.length; i++) {
                    if (this.dataList[i].checked) {
                        this.devNo.push(this.dataList[i].devNo)
                if (that.barcode === '') {
                    this.messageText = "请扫描托盘条码"
                    this.messageToggle('error')
                    return;
                }
                if (that.dataList.length === 0) {
                    this.messageText = "请添加商品列表"
                    this.messageToggle('error')
                    return;
                }
                // if (that.dataList.length > 1) {
                //     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;
                    }
                }
                console.log(that.dataList);
                console.log(that.barcode);
                console.log(that.orderNo);
                // return
                uni.request({
                    url: that.baseUrl + '/agvMobile/pakin/auth',
                    url: that.baseUrl + '/agvMobile/comb/auth',
                    data: JSON.stringify({
                        devNo: that.devNo
                        orderNo: that.orderNo,
                        barcode: that.barcode,
                        combMats: that.dataList
                    }),
                    method: 'POST',
                    header: {
@@ -578,9 +524,15 @@
                    success(result) {
                        var res = result.data
                        if (res.code === 200) {
                            that.resst();
                            that.messageText = "启动成功"
                            that.dataList = []
                            that.findOrder()
                            // that.resst();
                            that.barcode = ''
                            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')
@@ -605,8 +557,8 @@
            // 确认重置
            resetConfirm() {
                this.dataList = []
                this.stationCode = ''
                this.floor = ''
                this.barcode = ''
                this.orderNo = ''
                this.messageText = "重置完成"
                this.messageToggle('success')
            },
@@ -618,8 +570,7 @@
            resst() {
                this.dataList = []
                this.barcode = ''
                this.stationCode = ''
                this.floor = ''
                this.orderNo = ''
                this.barcodeFocuss()
            },
        }
@@ -640,29 +591,14 @@
    .kb-bgfa {
        background-color: #00aeec;
    }
    .bg-red {
        background-color: #e54d42;
        color: #ffffff;
    }
    .bg-white {
        background-color: #ffffff;
        color: #666666;
    }
    .list:first-child {
        margin-top: 320rpx;
    }
    .aside {
        width: 100rpx;
        /* background-color: #303133; */
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 340rpx;
    }
    .code {
        width: 100%;
        position: fixed;
        min-height: 100rpx;
        min-height: 140rpx;
        background-color: #FFF;
        z-index: 10;
    }
@@ -670,7 +606,7 @@
    .item {
        display: flex;
        align-items: center;
        height: 100rpx;
        height: 70rpx;
        margin-left: 20rpx;
        border-bottom: 1px solid #DCDFE6;
    }
@@ -686,7 +622,6 @@
    }
    .code-decs {
        width: 20vw;
        font-size: 18px;
        color: #303133;
    }
@@ -697,16 +632,15 @@
    }
    .mat-list-title {
        display: flex;
        align-items: center;
        height: 80rpx;
        line-height: 80rpx;
        width: 100%;
        background-color: white;
        position: fixed;
        margin-top: 200rpx;
        margin-top: 140rpx;
        z-index: 9;
        /* border-top: 1px solid #DCDFE6; */
        text-align: center;
        box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.5);
        box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.5);
    }
</style>
pages/tzsk/AGV/orderList.vue
New file
@@ -0,0 +1,106 @@
<template>
    <view>
        <view class="code">
            <uni-search-bar :focus="matFocus" v-model="matnr"  @input="matInput()"
                @cancel="cancel" @clear="clear" placeholder="输入 / 扫描商品">
            </uni-search-bar>
        </view>
        <view class="list" v-for="(item,i) in dataList">
            <view class="list-left">
                <view>编号:{{item.matnr}}</view>
                <view>名称:{{item.maktx}}</view>
                <view>规格:{{item.specs}}</view>
                <view>数量:{{item.anfme}}</view>
                <view class="card-id">{{i + 1}}</view>
            </view>
            <view class="list-right">
                <label @click="checkboxChange(item)">
                    <checkbox :value="item.orderNo" color="#FFCC33" style="transform:scale(0.7)" /><text></text>
                </label>
            </view>
        </view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
                matFocus: true,
                matnr: '',
                checck: true,
                dataList: [
                    {
                        orderNo: 'cg0931241',
                        matnr: 'cg0931241',
                        maktx: '靠u黄金分割哈打赏黄金分割哈打赏黄金分割哈打赏',
                        anfme: 10,
                        specs: '10-z'
                    },
                    {
                        orderNo: 'cg0931242',
                        matnr: 'cg0931241',
                        maktx: '靠u黄金分割哈打赏',
                        anfme: 10,
                        specs: '10-z'
                    }
                ]
            }
        },
        methods: {
            matInput() {
                let _this = this
            },
            checkboxChange(e) {
                let items = this.dataList,
                values = e.orderNo;
                if (e.checked) {
                    this.$set(e,'checked',false)
                } else {
                    this.$set(e,'checked',true)
                }
            }
        }
    }
</script>
<style>
    .code {
        background-color: #d9d9d9;
    }
    .list {
        margin: 20rpx;
        background-color: #fff;
        border-radius: 20rpx;
        border: 1px solid #eeeeee;
        display: flex;
        position: relative;
    }
    .card-id {
        position: absolute;
        right: 10rpx;
        top: 5rpx;
        height: 30rpx;
        line-height: 30rpx;
        width: 30rpx;
        text-align: center;
        color: #eeeeee;
        background-color: #ddd844;
        border-radius: 50%;
        font-size: 10px;
    }
    .list-left {
        flex: 1;
        padding: 20rpx;
        position: relative;
    }
    .list-right {
        width: 100rpx;
        border-left: 1px solid #eeeeee;
        display: flex;
        align-items: center;
        justify-content: center;
    }
</style>