zhou zhou
2025-11-21 7da36ae80fbe9d9c125d0ae8b7328f80189339a5
#盘点
5个文件已添加
3个文件已修改
636 ■■■■■ 已修改文件
pages.json 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/check/check.vue 393 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/css/wms.css/wms.css 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
uni_modules/uni-tooltip/changelog.md 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip.vue 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
uni_modules/uni-tooltip/package.json 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
uni_modules/uni-tooltip/readme.md 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json
@@ -300,6 +300,15 @@
                "enablePullDownRefresh": false
            }
            
        },
        {
            "path" : "pages/check/check",
            "style" :
            {
                "navigationBarTitleText": "盘点",
                "enablePullDownRefresh": false
            }
        }
    ],
    "globalStyle": {
pages/check/check.vue
New file
@@ -0,0 +1,393 @@
<template>
    <view>
        <view class="code">
            <view class="item">
                <view class="code-decs">托盘码:</view>
                <input type="text" placeholder=" 扫码 / 输入" v-model="barcode" :focus="barcodeFocus"
                    @input="search()">
            </view>
        </view>
        <view class="mat-list-title">
            商品列表
        </view>
        <scroll-view>
            <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">
                            <uni-tag :text="item.matnr" type="primary"></uni-tag>
                        </view>
                    </view>
                    <view class="list-left-item">
                        <view class="desc">品名:</view>
                        <uni-tooltip class=" left-item" :content="item.maktx" placement="bottom">
                            <view class="left-item tip" style="">{{item.maktx}}</view>
                        </uni-tooltip>
                    </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">{{item.anfme}}</view>
                    </view>
                    <view class="list-left-item">
                        <view class="desc">盘点数量:</view>
                        <view class="left-item" style="border: none;justify-content: center;">
                            <uni-number-box v-model="item.workQty" :max="9999999" color="#747474"/>
                        </view>
                    </view>
                </view>
                <!-- <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>
        </scroll-view>
        <!-- 底部操作按钮 -->
        <view class="buttom">
            <button size="mini" @click="reset('warn')">重置</button>
            <button size="mini" type="primary" @click="combConfirm('warn')" :disabled="pushDisabled">确定</button>
        </view>
        <!-- 弹窗 -->
        <!-- 修改数量 -->
        <view>
            <uni-popup ref="revise" 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="matnr" disabled="true"
                                style="background-color: #f7f7f7;padding: 0;color: #d5d5d5;">
                        </view>
                    </view>
                    <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 class="popup-item-left">数量:</view>
                        <view class="popup-item-right" style="border: none;justify-content: center;">
                            <uni-number-box :value="count" :max="9999999" color="#747474"/>
                        </view>
                    </view>
                    <view class="btn">
                        <view class="btn-left" @click="reviseClose">取消</view>
                        <view class="btn-right" @click="reviseConfirm()">修改</view>
                    </view>
                </view>
            </uni-popup>
        </view>
        <!-- 移除确认 -->
        <view>
            <!-- 提示窗示例 -->
            <uni-popup ref="alertDialog" type="dialog">
                <uni-popup-dialog :type="msgType" confirmText="移除" :title="title" :content="content"
                    @confirm="removeConfirm" @close="removeClose"></uni-popup-dialog>
            </uni-popup>
        </view>
        <view>
            <!-- 提示信息弹窗 -->
            <uni-popup ref="message" type="message">
                <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"
                    @confirm="push" @close="combClose"></uni-popup-dialog>
            </uni-popup>
        </view>
        <!-- 确认重置 -->
        <view>
            <uni-popup ref="resetConfirm" type="dialog">
                <uni-popup-dialog :type="msgType" cancelText="取消" confirmText="确认" :title="title" :content="content"
                    @confirm="resetConfirm" @close="resetClose"></uni-popup-dialog>
            </uni-popup>
        </view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
                baseUrl: '',
                token: '',
                barcode: '',
                dataList: [],
                count: 0,
                rowNum: '',
                matnr: '',
                batch: '',
                msgType1: 'success',
                msgType: 'success',
                messageText: '',
                title: '',
                content: '',
                barcodeFocus: true,
                matFocus: false,
                matData: '',
                pushDisabled:false
            }
        },
        onLoad() {
        },
        onShow() {
            this.baseUrl = uni.getStorageSync('baseUrl');
            this.token = uni.getStorageSync('token');
        },
        methods: {
            messageToggle(type) {
                this.msgType1 = type
                this.$refs.message.open()
            },
            // 根据托盘码搜索
            search() {
                let that = this
                uni.request({
                    url: that.baseUrl + '/checkOrder/getTaskList/auth',
                    header: {
                        'token':uni.getStorageSync('token')
                    },
                    data:JSON.stringify({
                        barcode: that.barcode,
                    }),
                    method:'POST',
                    success(res) {
                        res = res.data
                        if(res.code === 200){
                            that.dataList = res.data
                        } else if (res.code == 403) {
                            that.messageText = res.msg
                            that.messageToggle('error')
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../login/login'
                                });
                            }, 1000);
                        } else {
                            that.messageText = res.msg
                            that.messageToggle('error')
                        }
                    }
                })
            },
            // 托盘码有误重置
            barcodeFocuss() {
                let that = this;
                that.barcodeFocus = false;
                setTimeout(() => {
                    that.barcode = '';
                    that.barcodeFocus = true;
                }, 100);
            },
            // 商品光标清空重置
            focuss() {
                // #ifdef APP
                let that = this;
                that.focus = false;
                setTimeout(() => {
                    that.matnr = '';
                    that.focus = true;
                }, 100);
                // #endif
            },
            // 修改批号
            revise(item, i) {
                this.matnr = this.dataList[i].matnr
                this.count = this.dataList[i].anfme
                this.batch = this.dataList[i].batch
                this.rowNum = i
                this.eject()
            },
            eject(type) {
                this.type = type
                this.$refs.revise.open(type)
            },
            // 列表移除按钮
            remove(item, i, type) {
                this.msgType = type
                this.title = '警告'
                this.content = '是否移除当前商品!'
                this.$refs.alertDialog.open(i)
            },
            // 确认移除
            removeConfirm(i) {
                this.messageText = "移除成功"
                this.messageToggle('success')
                this.dataList.splice(i, 1)
            },
            // 取消移除
            removeClose() {
                this.$refs.alertDialog.close()
            },
            reviseConfirm() {
                this.dataList[this.rowNum].anfme = this.count
                this.dataList[this.rowNum].batch = this.batch
                this.messageText = "修改成功"
                this.messageToggle('success')
                this.$refs.revise.close()
            },
            reviseClose() {
                this.$refs.revise.close()
            },
            changeValue(value,i) {
                console.log(value)
                this.dataList[i].workQty = value
            },
            combConfirm(type) {
                this.msgType = type
                this.title = '警告'
                this.content = '是否确认盘点信息!'
                this.$refs.combConfirm.open()
            },
            combClose() {
                this.$refs.combConfirm.close()
            },
            reset(type) {
                this.msgType = type
                this.title = '警告'
                this.content = '是否重置!'
                this.$refs.resetConfirm.open()
            },
            // 确认重置
            resetConfirm() {
                this.dataList = []
                this.barcode = ''
                this.messageText = "重置完成"
                this.messageToggle('success')
            },
            // 取消重置
            resetClose() {
            },
            // 清空
            resst() {
                this.dataList = []
                this.barcode = ''
                this.barcodeFocuss()
            },
            push() {
                let that = this
                that.pushDisabled = true
                uni.request({
                    url: that.baseUrl + '/checkOrder/pdaComplete/auth',
                    header: {
                        'token':uni.getStorageSync('token')
                    },
                    data:JSON.stringify({
                        barcode: that.barcode,
                        checkOrderDetlList: that.dataList
                    }),
                    method: 'POST',
                    success(result){
                        let res = result.data
                        if (res.code === 200) {
                            that.messageText = "提交成功"
                            that.messageToggle('success')
                            that.dataList = []
                            that.barcode = ''
                            that.pushDisabled = false
                        } else if (res.code == 403) {
                            that.messageText = res.msg
                            that.messageToggle('error')
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../login/login'
                                });
                            }, 1000);
                        } else {
                            that.messageText = res.msg
                            that.messageToggle('error')
                            that.pushDisabled = false
                        }
                    }
                })
            },
        }
    }
</script>
<style>
    @import url('../../static/css/wms.css/wms.css');
    .list:first-child {
        margin-top: 210rpx;
    }
    .code {
        width: 100%;
        position: fixed;
        min-height: 100rpx;
        background-color: #FFF;
        z-index: 10;
    }
    .item {
        display: flex;
        align-items: center;
        height: 100rpx;
        margin-left: 20rpx;
        border-bottom: 1px solid #DCDFE6;
    }
    .item input {
        height: 50rpx;
        line-height: 50rpx;
        /* font-family: PingFang SC; uniapp 默认字体不居中 */
        font-size: 36upx;
        font-family: PingFang SC;
        width: 55vw;
    }
    .code-decs {
        width: 20vw;
        font-size: 18px;
        color: #303133;
    }
    .item-right {
        margin-left: auto;
        margin-right: 20rpx;
    }
    .mat-list-title {
        height: 80rpx;
        line-height: 80rpx;
        width: 100%;
        background-color: white;
        position: fixed;
        margin-top: 100rpx;
        z-index: 9;
        /* border-top: 1px solid #DCDFE6; */
        text-align: center;
        box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.5);
    }
    .tip {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        }
</style>
pages/home/home.vue
@@ -81,13 +81,13 @@
                        cuIcon: 'pulldown',
                        url: '/AGV/AGVOutCall'
                    },
                    // {
                    //     title: '呼叫Agv',
                    //     name: 'AGVStart',
                    //     color: 'green',
                    //     cuIcon: 'order',
                    //     url: '/AGV/AGVStart'
                    // },
                    {
                        title: '盘点',
                        name: 'Check',
                        color: 'green',
                        cuIcon: 'order',
                        url: '/check/check'
                    },
                    // {
                    //     title: 'Agv储位解绑',
                    //     name: 'AGVUnbind',
static/css/wms.css/wms.css
@@ -27,7 +27,7 @@
    min-height: 40rpx;
    display: flex;
    align-items: center;
    width: 25%;
    width: 28%;
}
.left-item {
    display: flex;
uni_modules/uni-tooltip/changelog.md
New file
@@ -0,0 +1,16 @@
## 0.2.4(2024-04-23)
- 修复 弹出位置默认值不一致导致的错位
## 0.2.3(2024-03-20)
- 修复 弹出位置修正
## 0.2.2(2024-01-15)
- 新增 placement支持设置四个方向:top bottom left right
## 0.2.1(2022-05-09)
- 修复 content 为空时仍然弹出的bug
## 0.2.0(2022-05-07)
**注意:破坏性更新**
- 更新 text 属性变更为 content
- 更新 移除 width 属性
## 0.1.1(2022-04-27)
- 修复 组件根 text 嵌套组件 warning
## 0.1.0(2022-04-21)
- 初始化
uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip.vue
New file
@@ -0,0 +1,108 @@
<template>
    <view class="uni-tooltip">
        <slot></slot>
        <view v-if="content || $slots.content" class="uni-tooltip-popup" :style="initPlacement">
            <slot name="content">
                {{content}}
            </slot>
        </view>
    </view>
</template>
<script>
    /**
     * Tooltip 提示文字
     * @description 常用于展示鼠标 hover 时的提示信息。
     * @tutorial https://uniapp.dcloud.io/component/uniui/uni-tooltip
     * @property {String} content   弹出层显示的内容
     * @property {String}  placement出现位置, 目前支持:left right top bottom
     */
    export default {
        name: "uni-tooltip",
        data() {
            return {
            };
        },
        methods: {},
        computed: {
            initPlacement() {
                let style = {};
                switch (this.placement) {
                    case 'left':
                        style = {
                            top: '50%',
                            transform: 'translateY(-50%)',
                            right: '100%',
                            "margin-right": '10rpx',
                        }
                        break;
                    case 'right':
                        style = {
                            top: '50%',
                            transform: 'translateY(-50%)',
                            left: '100%',
                            "margin-left": '10rpx',
                        }
                        break;
                    case 'top':
                        style = {
                            bottom: '100%',
                            transform: 'translateX(-50%)',
                            left: '50%',
                            "margin-bottom": '10rpx',
                        }
                        break;
                    case 'bottom':
                        style = {
                            top: '100%',
                            transform: 'translateX(-50%)',
                            left: '50%',
                            "margin-top": '10rpx',
                        }
                        break;
                }
                return style;
            }
        },
        props: {
            content: {
                type: String,
                default: ''
            },
            placement: {
                type: String,
                default: 'bottom'
            },
        }
    }
</script>
<style>
    .uni-tooltip {
        position: relative;
        cursor: pointer;
        display: inline-block;
    }
    .uni-tooltip-popup {
        z-index: 1;
        display: none;
        position: absolute;
        background-color: #333;
        border-radius: 8px;
        color: #fff;
        font-size: 12px;
        text-align: left;
        line-height: 16px;
        padding: 12px;
        overflow: auto;
    }
    .uni-tooltip:hover .uni-tooltip-popup {
        display: block;
    }
</style>
uni_modules/uni-tooltip/package.json
New file
@@ -0,0 +1,86 @@
{
  "id": "uni-tooltip",
  "displayName": "uni-tooltip 提示文字",
  "version": "0.2.4",
  "description": "Tooltip 提示文字",
  "keywords": [
    "uni-tooltip",
    "uni-ui",
    "tooltip",
    "tip",
    "文字提示"
],
  "repository": "https://github.com/dcloudio/uni-ui",
  "engines": {
    "HBuilderX": ""
  },
  "directories": {
    "example": "../../temps/example_temps"
  },
"dcloudext": {
    "sale": {
      "regular": {
        "price": "0.00"
      },
      "sourcecode": {
        "price": "0.00"
      }
    },
    "contact": {
      "qq": ""
    },
    "declaration": {
      "ads": "无 ",
      "data": "无",
      "permissions": "无"
    },
    "npmurl": "",
    "type": "component-vue"
  },
  "uni_modules": {
    "dependencies": [],
    "encrypt": [],
    "platforms": {
      "cloud": {
        "tcb": "y",
        "aliyun": "y",
        "alipay": "n"
      },
      "client": {
        "Vue": {
          "vue2": "y",
          "vue3": "y"
        },
        "App": {
          "app-vue": "y",
          "app-nvue": "u"
        },
        "H5-mobile": {
          "Safari": "y",
          "Android Browser": "y",
          "微信浏览器(Android)": "y",
          "QQ浏览器(Android)": "y"
        },
        "H5-pc": {
          "Chrome": "y",
          "IE": "y",
          "Edge": "y",
          "Firefox": "y",
          "Safari": "y"
        },
        "小程序": {
          "微信": "y",
          "阿里": "u",
          "百度": "u",
          "字节跳动": "u",
          "QQ": "u",
          "京东": "u"
        },
        "快应用": {
          "华为": "u",
          "联盟": "u"
        }
      }
    }
  }
}
uni_modules/uni-tooltip/readme.md
New file
@@ -0,0 +1,8 @@
## Badge 数字角标
> **组件名:uni-tooltip**
> 代码块: `uTooltip`
数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景,
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-tooltip)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839