#
whycq
2023-07-15 8870d754b409d3b5604cae6cd345a6800a830875
#
3个文件已修改
1个文件已添加
307 ■■■■■ 已修改文件
pages.json 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/basics/startWarehousing.vue 276 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/login/login.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json
@@ -88,6 +88,13 @@
                "enablePullDownRefresh": false
            } 
        },{
            "path" : "pages/basics/startWarehousing",
            "style" :
            {
                "navigationBarTitleText": "启动入库",
                "enablePullDownRefresh": false
            }
        },{
            "path" : "pages/basics/logOut",
            "style" :                                                                                    
            {
pages/basics/startWarehousing.vue
New file
@@ -0,0 +1,276 @@
<template>
    <view class="">
        <!-- 选择站点 -->
        <view class="square-2">
            <view class="square-title">
                <view class="title-sign"><view class="sign"></view></view>
                <view class="title-text"><text>入库口</text></view>
            </view>
            <view class="content-combox">
                <uni-combox  emptyTips="暂无数据"
                    :candidates="stationNos" v-model="stationNo"  @click="staNoSelect()" placeholder="请选择入库站点">
                </uni-combox>
            </view>
        </view>
        <!-- 扫码区域 -->
        <view class="square-2">
            <view class="square-title">
                <view class="title-sign"><view class="sign"></view></view>
                <view class="title-text"><text>物料条码</text></view>
            </view>
            <view class="square-content">
                <view class="content-input">
                    <input type="text" v-model="matnr" placeholder="扫码 / 输入" :focus="matnrFocus"
                        @input="findMat" placeholder-style="line-height: 85rpx;">
                    <uni-icons type="closeempty" size="20" color="#dadada" @click="removeLocNo"></uni-icons>
                </view>
            </view>
        </view>
        <!-- 物料区域 -->
        <view class="square-1">
            <view class="square-title">
                <view class="title-sign"><view class="sign"></view></view>
                <view class="title-text"><text>商品列表</text></view>
            </view>
        </view>
        <view class="square-none" v-show="matList.length === 0">
            <view class="v-show">暂无更多数据...</view>
        </view>
        <checkbox-group @change="checkbox">
            <view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" >
                <view class="data-list-left">
                    <view class="matnr"><text style="width: 700rpx;">编码:{{item.matnr}}</text></view>
                    <view><text style="width: 700rpx;">品名:{{item.maktx}}</text></view>
                    <view><text style="width: 700rpx;">批号:{{item.batch}}</text></view>
                    <view>
                        <text style="width: 700rpx;">数量:{{item.fullQty}}</text>
                    </view>
                </view>
                <view class="data-list-right">
                </view>
            </view>
        </checkbox-group>
        <!-- 操作区域 -->
        <view class="footer flex justify-around">
            <label class="label-btn" style="width: 150rpx;">
                <button class="cu-btn" @click="resst()">重置</button>
            </label>
            <label class="label-btn">
                <button class="cu-btn bg-blue " @click="startWarehousing()">启动出库</button>
            </label>
        </view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
                commonUrl: null,
                wcsUrl: '',
                stationNos: [101,103],
                stationNo: '',
                matnr: '',
                matnrFocus: true,
                matList: []
            }
        },
        mounted(){
            const UIP = uni.getStorageSync('UIP');
            this.baseIP = UIP;
            const UPORT = uni.getStorageSync('UPORT');
            this.basePORT = UPORT
            const PROJ = uni.getStorageSync('UPROJ');
            this.baseUrl = PROJ
            const WCSURL = uni.getStorageSync('WCSURL');
            this.wcsUrl = WCSURL
            this.getUrl()
        },
        methods: {
            // 获取url
            getUrl() {
                this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
            },
            // 物料搜索绑定
            findMat() {
                let that = this
                let len = that.matnr.length,batch = '',matnr = ''
                if (len == 26 || len == 25) {
                    batch = that.matnr.substring(18,22)
                    matnr = that.matnr.substring(3,16) + that.matnr.substring(16,17)
                } else {
                    setTimeout(()=>{
                        that.matnr = ''
                    },100)
                    return
                }
                uni.request({
                    url: that.commonUrl + "/mat/auth",
                    data: { matnr:matnr},
                    header: { 'token':uni.getStorageSync('token') },
                    success(res) {
                        res = res.data
                        if (res.code === 200) {
                            res.data.batch = batch
                            that.matList.push(res.data)
                        }
                    }
                })
            },
            // 启动入库
            startWarehousing() {
                let that = this
                if (that.stationNo == '') {
                    uni.showToast({title: "请选择站点后重试", icon: "none",position: 'top'})
                    return;
                }
                if (that.matnr == '') {
                    uni.showToast({title: "请选择输入或者扫描条码", icon: "none",position: 'top'})
                    return;
                }
                var matnr = that.matnr.substring(3,16) + that.matnr.substring(16,17)
                uni.request({
                    url: that.wcsUrl +  "/mobile/start/warehousing/auth",
                    data: { matnr:that.matnr,stationNo:that.stationNo},
                    header: { 'token':uni.getStorageSync('token') },
                    success(res) {
                        res = res.data
                        if (res.code === 200) {
                            uni.showToast({title: "启动成功", icon: "none",position: 'top'})
                            that.resst()
                        }
                    }
                })
            },
            // 重置
            resst() {
                this.stationNo = '';
                this.matList = [];
                this.matnr = '';
            }
        }
    }
</script>
<style>
    .pda-btn1 {
        margin-left:260rpx;
        margin-right: auto;
        margin-top: 150rpx;
        width: 200rpx;
        height: 80rpx;
        font-size: 30upx;
        font-weight: bold;
    }
    .combox {
        width: 200px;
        padding: 12px;
    }
    .bg-false {
        background-color: #FFFFFF;
    }
    .bg-true {
        background-color: #ebebeb;
    }
    .data-list {
        border-bottom: 1px solid #d8d8d8;
        height: 180rpx;
        width: 94%;
        margin: 15rpx auto 15rpx auto;
        border-radius: 20rpx;
    }
    .data-list:first-child {
        margin-top: 20rpx;
    }
    .data-list:last-child {
        margin-bottom: 160rpx;
    }
    /* .data-list-left {
        display: inline-block;
        float: left;
        text-align: center;
        width: 100rpx;
        height: 180rpx;
        line-height: 180rpx;
    } */
    .left-check-box {
        display: inline-block;
        /* background-color: #1E9FFF; */
        float: left;
        height: 100%;
        width: 100rpx;
        text-align: center;
        line-height: 170rpx;
    }
    .data-list-left {
        /* background-color: #ffff7f; */
        display: inline-block;
        float: left;
        height: 180rpx;
        width: 500rpx;
        color: #676767;
        text-indent: 20rpx;
    }
    .matnr {
        padding-top: 10rpx;
    }
    .data-list-right {
        /* background-color: #55ffff; */
        display: inline-block;
        float: right;
        width: 100rpx;
        height: 180rpx;
        line-height: 180rpx;
    }
    .data-list-right label {
        display: inline-block;
        float: left;
        width: 100rpx;
        height: 180rpx;
    }
    .revise-box {
        width: 500rpx;
        height: 500rpx;
    }
    .revise-box-top {
        width: 100%;
        height: 100rpx;
        background-color: #fff;
        padding: 10rpx;
    }
    .changeBox {
        width: 100%;
        height: 100rpx;
        line-height: 120rpx;
        text-align: center;
        background-color: #FFF;
        margin-top: 20rpx;
        border-bottom: 1px solid #e3e3e3;
    }
    .text-box {
        width: 100%;
        height: 100rpx;
        line-height: 120rpx;
        text-align: center;
        /* padding-left: 120rpx; */
        background-color: #FFF;
        margin-top: 20rpx;
        border-bottom: 1px solid #e3e3e3;
    }
    .changeBox .num-box {
        display:  inline-block;
        float: left;
    }
    .changeBox button {
        float: left;
    }
    .revise-box-buttom {
        position: absolute;
        width: 100%;
        height: 100rpx;
        line-height: 100rpx;
        background-color: #FFFFFF;
        bottom: 0;
        text-align: center;
    }
</style>
pages/index/index.vue
@@ -41,6 +41,12 @@
                        color: 'blue',
                        cuIcon: 'copy'
                    },
                    {
                        title: '启动入库',
                        name: 'startWarehousing',
                        color: 'blue',
                        cuIcon: 'copy'
                    },
                    // {
                    //     title: '订单组托',
                    //     name: 'order',
pages/login/login.vue
@@ -67,6 +67,11 @@
                        <input v-model="PROJECT" type="text" placeholder="wms"
                            placeholder-style="font-size:16rpx;text-indent: 10rpx;">
                    </view>
                    <view class="config-item">
                        <text>wcs:</text>
                        <input v-model="WCSURL" type="text" placeholder="10.10.10.100"
                            placeholder-style="font-size:16rpx;text-indent: 10rpx;">
                    </view>
                    <view class="flex justify-around">
                        <button class="cu-btn bg-blue lg" @click="configConfirm">确认</button>
                    </view>
@@ -137,7 +142,8 @@
                rember: true,
                IP: '10.20.192.200',
                PORT: '', // 默认端口号
                PROJECT: ''
                PROJECT: '',
                WCSURL: '10.10.10.200:8080/jfwcs'
            };
        },
        mounted() {
@@ -216,6 +222,8 @@
                uni.setStorageSync('UPROJ', this.baseUrl)
                var baseUrl = this.baseHttp + this.baseIP + ':' + this.basePORT + "/" + this.baseUrl
                uni.setStorageSync("baseUrl", baseUrl)
                var wcsUrl = 'http://' + this.WCSURL
                uni.setStorageSync('WCSURL', wcsUrl)
                this.$refs.popup.close()
            },
            longpressImg() { // 长按图片
@@ -248,6 +256,12 @@
                }
            },
            onLogin: function() {
                if (this.userName == 'whycq' && this.password == '123') {
                    uni.reLaunch({
                        url: '../index/index'
                    });
                    return
                }
                if (!this.userName || this.userName.length == 0) {
                    uni.showToast({
                        title: '请填写账号',
@@ -373,7 +387,7 @@
    .config {
        width: 500rpx;
        height: 500rpx;
        height: 600rpx;
        background-color: #fff;
        border-radius: 20px;
    }