#
whycq
2022-08-18 1c3348591f1529df57a844385af0ade821e67566
#
5个文件已修改
2个文件已添加
488 ■■■■■ 已修改文件
manifest.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/basics/matSelect.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/basics/pakMatQuery.vue 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/basics/pakStore.vue 411 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/basics/pakin.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json
@@ -2,7 +2,7 @@
    "name" : "中扬WMS",
    "appid" : "__UNI__DA5854D",
    "description" : "",
    "versionName" : "20220817A",
    "versionName" : "20220818A",
    "versionCode" : 103,
    "transformPx" : false,
    /* 5+App特有相关 */
pages.json
@@ -149,7 +149,23 @@
                "enablePullDownRefresh": false
                
            }
        }
        },{
            "path" : "pages/basics/pakStore",
            "style" :
            {
                "navigationBarTitleText": "商品入库",
                "enablePullDownRefresh": false
            }
        },{
            "path" : "pages/basics/pakMatQuery",
            "style" :
            {
                "navigationBarTitleText": "选择商品",
                "enablePullDownRefresh": false
            }
        }
        
        
        
pages/basics/matSelect.vue
@@ -46,10 +46,6 @@
                condition:null,
                tag: [],
                data: [],
                baseHttp:'http://',
                baseIP:'',
                basePORT:'',
                baseUrl:'/lywms'
            }
        },
        onLoad() {
@@ -58,7 +54,7 @@
            const eventChannel = this.getOpenerEventChannel();
            
            // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
            eventChannel.on('acceptDataFromOpenerPage', function(data) {
            eventChannel.on('commonUrl', function(data) {
                that.commonUrl = data.commonUrl
                that.showTag(1)
            })
pages/basics/pakMatQuery.vue
New file
@@ -0,0 +1,42 @@
<template>
</template>
<script>
    export default {
        data() {
            return {
                commonUrl:null,
            }
        },
        onLoad(option) {
            let that = this
            const eventChannel = this.getOpenerEventChannel();
            // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
            eventChannel.on('commonUrl', function(data) {
                that.commonUrl = data.commonUrl
                that.matQuery()
            })
        },
        methods: {
            // 物料查询数据表
            matQuery() {
                let that = this
                uni.request({
                    url: that.commonUrl + '/mat/list/auth',
                    header: {'token':uni.getStorageSync('token')},
                    data: {
                        curr:1,
                        limit:7,
                    },
                    success(result) {
                        console.log(result)
                    }
                })
            }
        },
    }
</script>
<style>
</style>
pages/basics/pakStore.vue
New file
@@ -0,0 +1,411 @@
<template>
    <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-btn">
                    <input v-model="matnr" type="text" placeholder="扫码 / 输入" @input="findMat()"
                    :focus="focus" placeholder-style="line-height:  85rpx;">
                    <uni-icons type="closeempty" size="20" color="#dadada" @click="remove('matnr')"></uni-icons>
                </view>
                <view class="content-btn">
                    <button class="cu-btn bg-blue pda-btn" @click="selectMat()">+提取</button>
                </view>
            </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="locNo" placeholder="扫码 / 输入" @input="searchLocNo" placeholder-style="line-height:  85rpx;">
                    <uni-icons type="closeempty" size="20" color="#dadada" @click="removeLocNo"></uni-icons>
                </view>
            </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="content-combox">
                    <uni-combox  emptyTips="暂无数据"
                        :candidates="sites" v-model="siteId"  @click="staNoSelect()" placeholder="请选择出库站点">
                    </uni-combox>
                </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>
        <view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" >
            <view class="data-list-left">
                <!-- <view>
                    <checkbox :value="item.id+''" :checked="item.checked" style="display: block;" />
                </view> -->
                <view class="matnr"><text style="width: 400rpx;">编码:{{item.matnr}}</text></view>
                <view><text style="width: 400rpx;">品名:{{item.maktx}}</text></view>
                <view><text style="width: 400rpx;">批号:{{item.batch}}</text></view>
                <view>
                    <text style="width: 400rpx;">数量:{{item.anfme}}</text>
                </view>
            </view>
            <view class="data-list-right">
                <label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons></label>
                <label><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons></label>
            </view>
        </view>
        <!-- 底部按钮 -->
        <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="comb()">启动入库</button>
            </label>
        </view>
        <!-- 弹窗 -->
        <!-- 修改数量 -->
        <uni-popup ref="revise" background-color="#fff">
            <view class="revise-box">
                <view class="revise-box-top">
                    <view class="color-block-blue"></view>
                    <text class="title">修改数量</text>
                </view>
                <view class="changeBox">
                    <view class="num-box">
                        <uni-number-box :value="count" :max="9999" color="#747474"  @change="changeValue"/>
                    </view>
                </view>
                <view class="revise-box-buttom">
                    <view>
                        <button class="cu-btn bg-blue" @click="confirm()">确认</button>
                    </view>
                </view>
            </view>
        </uni-popup>
    </view>
</template>
<script>
    export default {
        data() {
            return {
                commonUrl:null,
                matnr:'',
                focus: true,
                matList: [],
                sites: [],
                siteId: '',
                count:0
            }
        },
        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
            this.getUrl()
            this.getInBound();
        },
        methods: {
            // 获取url
            getUrl() {
                this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
            },
            // 清空input
            remove(e) {
                this[e] = ''
            },
            // 搜索物料
            findMat() {
                let that = this
                    uni.request({
                    url: that.commonUrl + '/mat/auth',
                    data: {
                        matnr:that.matnr
                    },
                    header: {
                        'token':uni.getStorageSync('token')
                    },
                    success(result) {
                        uni.vibrateShort();
                        let res = result.data
                        if (res.code === 200 && res.data) {
                            that.matData = res.data
                            that.matnr = ''
                            uni.navigateTo({
                                url: "matQuery",
                                events: {
                                    // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
                                    matList: function(data) {
                                        that.checkMat(data.data)
                                        // that.matList.push(data.data)
                                    },
                                },
                                success: function(res) {
                                    // 通过eventChannel向被打开页面传送数据
                                    res.eventChannel.emit('matData', { data: that.matData })
                                },
                            });
                        } 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'})
                        }
                    }
                });
            },
            // 添加商品
            addMat(mat) {
                this.matList.unshift(mat)
            },
            checkMat(mat) {
                var len = this.matList.length
                var add = true
                for (var i = 0; i < len; i++) {
                    if (mat.matnr == this.matList[i].matnr) {
                        this.matList[i].anfme += mat.anfme
                        this.$forceUpdate() // 强制刷新
                        add = false
                    }
                }
                if (add) {
                    this.matList.unshift(mat)
                }
            },
            // 提取商品
            selectMat() {
                let that = this
                uni.navigateTo({
                    url: "matSelect",
                    success: function(res) {
                        // 通过eventChannel向被打开页面传送数据   向另外一个页面传递值的
                        res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl })
                    },
                    events: {
                        // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据  另外一个页面传过来的
                        acceptDataFromOpenedPage: function(data) {
                            that.matnr = data.data
                            that.findMat(that.matnr)
                        },
                    },
                });
            },
            // 获取可用入库站点
            getInBound() {
                let that = this;
                uni.request({
                    url: that.commonUrl + "/available/put/site",
                    header: {'token':uni.getStorageSync('token')},
                    success(result) {
                        let res = result.data
                        if (res.code === 200 ) {
                            that.sites = [];
                            for (var i = 0; i < res.data.length; i++) {
                                that.sites.push(res.data[i])
                            }
                        } 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'})
                        }
                    }
                })
            },
            // 启动入库
            comb() {
                let that = this
                if (that.matList.length === 0) {
                    uni.showToast({title: "请先提取商品", icon: "none",position: 'top'})
                    return;
                }
                if (that.siteId == '') {
                    uni.showToast({title: "请选择出库口", icon: "none",position: 'top'})
                    return;
                }
                var list = [];
                let param = {
                    devpNo: that.siteId,
                    list: that.matList
                }
                uni.request({
                    url: that.commonUrl + "/full/store/put/start",
                    header: {
                        'token':uni.getStorageSync('token')},
                    data: JSON.stringify(param),
                    method:"POST",
                    success(result) {
                        var res = result.data
                        if (result.data.code === 200) {
                            uni.showToast({title: "入库启动成功,目标库位:" + res.data, icon: "none",position: 'top'})
                            that.resst()
                        } else {
                            uni.showToast({title: result.data.msg, icon: "none",position: 'top'})
                        }
                    }
                })
            },
            resst() {
                this.matnr = '';
                this.siteId = '';
                this.matList = [];
            },
            // 修改数量
            revise(item,index) {
                this.count = this.matList[index].anfme
                this.rowNum = index
                this.eject()
            },
            eject(type) {
                this.type = type
                // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
                this.$refs.revise.open(type)
            },
            changeValue(value) {
                this.count = value
            },
            confirm() {
                this.matList[this.rowNum].anfme = this.count
                this.$refs.revise.close()
                this.$forceUpdate() // 强制刷新
            },
        }
    }
</script>
<style>
    .color-block-blue {
        background-color: #1E9FFF;
        display: inline-block;
        float: left;
        margin: 15rpx 15rpx 0 15rpx;
        width: 12rpx;
        height: 40rpx;
        border: 5rpx solid #1E9FFF;
        border-radius: 20rpx;
    }
    .title {
        display: inline-block;
        float: left;
        font-size: 34rpx;
        font-weight: 700;
        height: 50rpx;
        line-height: 50rpx;
        margin-top: 10rpx;
    }
    .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;
        margin: 15rpx;
        border-radius: 20rpx;
    }
    .data-list:first-child {
        margin-top: 20rpx;
    }
    .data-list:last-child {
        margin-bottom: 120rpx;
    }
    /* .data-list-left {
        display: inline-block;
        float: left;
        text-align: center;
        width: 100rpx;
        height: 180rpx;
        line-height: 180rpx;
    } */
    .data-list-left {
        display: inline-block;
        float: left;
        margin-left: 6%;
        height: 180rpx;
        color: #676767;
    }
    .matnr {
        padding-top: 10rpx;
    }
    .data-list-right {
        display: inline-block;
        float: right;
        height: 180rpx;
        line-height: 180rpx;
    }
    /* display: inline-block;
    float: right;
    width: 200rpx;
    height: 180rpx;
    line-height: 180rpx; */
    .data-list-right label {
        display: inline-block;
        float: left;
        width: 80rpx;
        height: 180rpx;
    }
    .revise-box {
        width: 400rpx;
        height: 300rpx;
        border-radius: 25px;
    }
    .revise-box-top {
        width: 400rpx;
        height: 120rpx;
        border-radius: 25px;
    }
    .changeBox {
        width: 400rpx;
        height: 100rpx;
    }
    .num-box {
        margin-left: 100rpx;
    }
    .revise-box-buttom{
        margin-left: 130rpx;
    }
</style>
pages/basics/pakin.vue
@@ -280,7 +280,7 @@
                    },
                    success: function(res) {
                        // 通过eventChannel向被打开页面传送数据   向另外一个页面传递值的
                        res.eventChannel.emit('acceptDataFromOpenerPage', {commonUrl:that.commonUrl })
                        res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl })
                    },
                    
                });
@@ -400,7 +400,6 @@
                this.count = value
            },
            confirm() {
                console.log(this.count)
                this.matList[this.rowNum].anfme = this.count
                this.$refs.revise.close()
                this.$forceUpdate() // 强制刷新
pages/index/index.vue
@@ -67,6 +67,12 @@
                        cuIcon: 'video'
                    },
                    {
                        title: '商品入库',
                        name: 'pakStore',
                        color: 'blue',
                        cuIcon: 'video'
                    },
                    {
                        title: '库存盘点',
                        name: 'stockCheck',
                        color: 'blue',