#
whycq
2023-10-30 1340ce90ce3405315ed18954d1c581e053b63ac5
#
1个文件已修改
136 ■■■■ 已修改文件
pages/tzsk/pakin/locChage.vue 136 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tzsk/pakin/locChage.vue
@@ -8,7 +8,8 @@
            </view>
            <view class="item">
                <view class="code-decs">新库位:</view>
                <input type="text" placeholder=" 扫码 / 输入" v-model="targetLoc" :focus="targetLocFocus">
                <input type="text" placeholder=" 扫码 / 输入" v-model="targetLoc" :focus="targetLocFocus"
                    @input="barcodeInput2()">
                <view class="item-right">
                    <button></button>
                </view>
@@ -51,20 +52,14 @@
                        </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">
                <!-- <view class="list-right">
                    <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> -->
            </view>
        </scroll-view>
        <!-- 底部操作按钮 -->
@@ -90,10 +85,6 @@
                        <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>
                        <view class="popup-item-right" style="border: none;justify-content: center;">
@@ -205,12 +196,81 @@
            },
            // barcode input 事件
            barcodeInput() {
                // 不设置定时器 会出现扫入的字符串不全
                setTimeout(() => {
                    var len = this.barcode.length
                    this.focuss()
                }, 200)
                let that = this
                that.dataList = []
                uni.request({
                    url: `${that.baseUrl}/manLocDetl/list/auth`,
                    header: { 'token': uni.getStorageSync('token') },
                    data: { loc_no: that.sourceLoc },
                    success(res) {
                        res = res.data
                        console.log(res);
                        if (res.code === 200) {
                            if (res.data.records.length > 0) {
                                for (let k of res.data.records) {
                                    console.log(k.status);
                                    if (k.status != 1) {
                                        that.messageText = '当前库不在状态'
                                        that.messageToggle('error')
                                        that.dataList = []
                                        that.sourceLoc = ''
                                        that.sourceLocRE()
                                        break
                                    }  else {
                                        that.dataList.push(k)
                                        that.sourceLocFocus = false
                                        that.targetLoc = ''
                                        that.targetLocFocus = true
                                    }
                                }
                            } else {
                                that.messageText = '当前库位暂无数据'
                                that.messageToggle('error')
                                that.sourceLocRE()
                            }
                        }
                    }
                })
            },
            barcodeInput2() {
                let that = this
                uni.request({
                    url: `${that.baseUrl}/manLocDetl/list/auth`,
                    header: { 'token': uni.getStorageSync('token') },
                    data: { loc_no: that.targetLoc},
                    success(res) {
                        res = res.data
                        if (res.code === 200) {
                            if (res.data.records != 0) {
                                that.messageText = '新库位有货'
                                that.messageToggle('error')
                                that.targetLocRE()
                            }
                        }
                    }
                })
            },
            // 源库位重置
            sourceLocRE() {
                this.sourceLocFocus = false
                setTimeout(()=>{
                    this.sourceLoc = ''
                    this.sourceLocFocus = true
                },100)
            },
            // 源库位重置
            targetLocRE() {
                this.targetLocFocus = false
                setTimeout(()=>{
                    this.targetLoc = ''
                    this.targetLocFocus = true
                },100)
            },
            // 托盘码有误重置
            barcodeFocuss() {
                let that = this;
@@ -326,35 +386,33 @@
                }
            },
            combConfirm(type) {
                if (this.sourceLoc == '') {
                    this.messageText = '请扫描/添加源库位'
                    this.messageToggle('error')
                    return
                }
                if (this.targetLoc == '') {
                    this.messageText = '请扫描/添加转移库位'
                    this.messageToggle('error')
                    return
                }
                this.msgType = type
                this.title = '警告'
                this.content = '是否现在组托!'
                this.$refs.combConfirm.open()
            },
            comb() {
                uni.vibrateShort();
                let that = this;
                if (that.barcode === '') {
                    this.messageText = "请扫描托盘条码"
                    this.messageToggle('error')
                    return;
                }
                uni.request({
                    url: that.baseUrl + '/mobile/manDetl/in/barcode',
                    data: JSON.stringify({
                        locNo: that.locno,
                        barcode: that.barcode
                    }),
                    method: 'POST',
                    header: {
                        'token': uni.getStorageSync('token')
                    },
                    url: `${that.baseUrl}/node/move/start`,
                    data: {sourceLocNo: that.sourceLoc,
                        targetLocNo: that.targetLoc},
                    header: { 'token': uni.getStorageSync('token') },
                    success(result) {
                        var res = result.data
                        if (res.code === 200) {
                            that.resst();
                            that.messageText = "组托成功"
                            that.messageText = "移库成功"
                            that.messageToggle('success')
                        } else if (res.code == 403) {
                            that.messageText = res.msg
@@ -382,6 +440,8 @@
                this.dataList = []
                this.order = ''
                this.barcode = ''
                this.sourceLoc = ''
                this.targetLoc = ''
                this.messageText = "重置完成"
                this.messageToggle('success')
            },
@@ -434,8 +494,8 @@
            // 清空
            resst() {
                this.dataList = []
                this.locno = ''
                this.barcode = ''
                this.sourceLoc = ''
                this.targetLoc = ''
                this.barcodeFocuss()
            },
            combClose() {
@@ -455,7 +515,7 @@
        display: flex;
        min-height: 80rpx;
        background-color: #FFF;
        margin: auto 20rpx;
        margin: 20rpx 20rpx;
        border-radius: 20rpx;
        box-shadow: 0px 0px 30px 0px rgba(0,0,0,0.2);
    }