#
whycq
2024-04-05 7839d94fc246556baf6f05db92e3ae20bcf36245
#
1个文件已修改
141 ■■■■■ 已修改文件
pages/phyz/stationManage/stationDetl.vue 141 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/stationManage/stationDetl.vue
@@ -1,7 +1,7 @@
<template>
    <view>
        <!-- 站点详情 -->
        <view class="station" :class="station.style" >
        <view class="station" :class="station.style" v-if="station">
            <view class="mt-flex">
                <view class="station-title" style="flex: 1;">{{station.devNo}}</view>
                <view><button size="mini" :loading="reload.loading" @click="reloadStation()">{{reload.loadingText}}</button></view>
@@ -15,16 +15,34 @@
            </view>
        </view>
        
        <!-- 弹窗 -->
        <!-- 修改数量 -->
        <view>
            <uni-popup ref="emptyPakin" type="dialog">
                <view class="popup">
                    <!-- 标题 -->
                    <view class="title">请输入空货架码</view>
                    <view class="popup-item">
                        <view class="popup-item-left">货架码:</view>
                        <view class="popup-item-right"><input type="text" v-model="barcode"></view>
                    </view>
                    <view class="btn">
                        <view class="btn-left" @click="emptyPakinClose">取消</view>
                        <view class="btn-right" @click="emptyPakinConfirm()">入库</view>
                    </view>
                </view>
            </uni-popup>
        </view>
        
        
        
        
        <!-- 底部操作按钮 -->
        <view class="buttom">
            <button size="mini" type="primary" @click="emptyPakin(searchValue)" v-if="btnType == 'emptyPakin'">空板入库</button>
            <button size="mini" type="primary" @click="containerMoveOut(searchValue)" v-if="btnType == 'out'">确认出库</button>
            <button size="mini" type="primary" @click="pickIn(searchValue)" v-if="btnType == 'pick'">已拣料回库</button>
            <button size="mini" type="primary" @click="emptyPakin()" v-if="btnType == 'emptyPakin'">空板入库</button>
            <button size="mini" type="primary" @click="emptyPakin()" v-if="btnType == 'emptyPakin'">空板入库</button>
            <button size="mini" type="primary" @click="containerMoveOut()" v-if="btnType == 'out'">确认出库</button>
            <button size="mini" type="primary" @click="pickIn()" v-if="btnType == 'pick'">已拣料回库</button>
        </view>
    </view>
</template>
@@ -38,10 +56,11 @@
                    loading: false,
                    loadingText: '更新状态'
                },
                btnType: 'emptyPakin'
                btnType: 'emptyPakin',
                barcode: ''
            }
        },
        onLoad() {
        onShow() {
            let _this = this
            this.baseUrl = uni.getStorageSync('baseUrl');
            this.token = uni.getStorageSync('token');
@@ -51,6 +70,7 @@
            eventChannel.on('item', function(data) {
                console.log(data);
                _this.station = data.item
                _this.reloadStation()
            })
        },
        methods: {
@@ -67,6 +87,13 @@
                    success(res) {
                        res = res.data
                        if (res.code === 200) {
                            if (res.data.records[0].locSts == 'O') {
                                _this.btnType = 'emptyPakin'
                            } else if (res.data.records[0].locSts == 'F') {
                                _this.btnType = 'pakin'
                            } else {
                                _this.btnType = 'working'
                            }
                            setTimeout(()=>{
                                for  (let k of res.data.records) {
                                    if (k.locSts != 'O') {
@@ -112,6 +139,41 @@
                        }
                    }
                })
            },
            // 空板入库确认
            emptyPakin() {
                this.$refs.emptyPakin.open()
            },
            emptyPakinClose() {
                this.$refs.emptyPakin.close()
            },
            emptyPakinConfirm() {
                this.emptyPakinClose()
                let _this = this;
                let params = []
                let param = { devNo: this.station.devNo, containerCode: this.barcode, }
                params.push(param)
                uni.request({
                    url: `${_this.baseUrl}/agvMobile/pakin/empty/auth`,
                    data: { pad: params },
                    method: 'POST',
                    header: { 'token': uni.getStorageSync('token') },
                    success(res) {
                        var res = result.data
                        if (res.code === 200) {
                            setTimeout(()=> {
                                _this.barcode = ''
                                _this.reloadStation()
                            },1000)
                            uni.showToast({ title: '启动入库', icon: "success", position: 'top' })
                        } else if (res.code == 403) {
                            uni.showToast({ title: res.msg, icon: "error", position: 'top' })
                            setTimeout(() => { uni.reLaunch({ url: '../login/login' }); }, 1000);
                        } else {
                            uni.showToast({ title: res.msg, icon: "error", position: 'top' })
                        }
                    }
                });
            }
        }
    }
@@ -141,4 +203,69 @@
        background-color: #3eb689;
        color: #fff;
    }
    .popup {
        width: 80vw;
        min-height: 100rpx;
        background-color: #FFF;
        border-radius: 25rpx;
    }
    .title {
        height: 100rpx;
        line-height: 100rpx;
        width: 100%;
        color: #606266;
        text-align: center;
        font-size: 16px;
    }
    .popup-item {
        height: 80rpx;
        line-height: 80rpx;
        display: flex;
        align-items: center;
        font-size: 14px;
    }
    .popup-item-left {
        width: 16vw;
        padding-right: 20rpx;
        text-align: right;
        color: #606266;
    }
    .popup-item-right {
        display: flex;
        align-items: center;
        width: 50vw;
        height: 50rpx;
        padding: 2px 5px;
        border: 1px solid #E4E7ED;
        border-radius: 5rpx;
    }
    .popup-item-right input{
        color: #606266;
    }
    .btn {
        display: flex;
        height: 90rpx;
        margin-top: 20rpx;
        border-top: 1px solid #DCDFE6;
        justify-content: center;
        align-items: center;
    }
    .btn-left {
        display: flex;
        flex: 1;
        height: 100%;
        justify-content: center;
        align-items: center;
        color: #606266;
        border-right: 1px solid #DCDFE6;
    }
    .btn-right {
        display: flex;
        flex: 1;
        justify-content: center;
        align-items: center;
        color: #409EFF;
    }
</style>