#
whycq
2023-10-07 e3a9edfa7a5fe7be708eaf84ea534bbde700d1e0
#
4个文件已修改
1个文件已添加
151 ■■■■ 已修改文件
README.md 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/z-data-list/z-data-list.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/api/addMat.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/common/data-list/dataDetail.vue 80 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/component/demo.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
README.md
New file
@@ -0,0 +1,6 @@
# 中扬WMS手持终端
`addMat` item参数
key: 名称
value: 值
type: 值类型 - input - number-box
components/z-data-list/z-data-list.vue
@@ -3,17 +3,20 @@
        <view class="main">
            <view class="main-left" >
                <view class="main-list" v-for="it in dataList" style="width: 100%;">
                    <view style="flex: 1;padding-left: 8rpx;">{{it.key}}</view>
                    <view class="left-key">{{it.key}}</view>
                    <view>:</view>
                    <view style="flex: 3;padding-left: 8rpx;">{{it.value}}</view>
                    <view class="left-val">
                        <text class="val-text" style="">{{it.value}}</text>
                </view>
            </view>
            <view class="main-right" @click="goDetail">
            </view>
            <uni-badge class="main-right uni-badge-left-margin" :text="index" absolute="rightTop" size="small" type="primary">
                <view @click="goDetail">
                <view class="list-options">
                    <view class="list-number">1</view>
                    <uni-icons class="opt-icon" type="right" size="20" color="#707070"></uni-icons>
                </view>
            </view>
            </uni-badge>
        </view>
    </view>
</template>
@@ -55,6 +58,10 @@
                default() {
                    return {}
                }
            },
            index: {
                type: Number,
                default: 2
            }
        }
    }
@@ -78,16 +85,20 @@
        flex-direction: column;
        padding-top: 8rpx;
        padding-bottom: 8rpx;
        color: #444;
        font-size: 14px;
    }
    .main-right {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        border-left: 1px solid #ffffff;
    }
    .main-list {
        display: flex;
        align-items: center;
        margin: 8rpx 0;
    }
    .list-options {
        display: flex;
@@ -101,4 +112,21 @@
    .opt-icon {
        display: flex;
    }
    .left-key {
        width: 130rpx;
        padding-right: 8rpx;
        text-align: end;
        font-weight: 700;
    }
    .left-val {
        flex: 1;
        padding-left: 8rpx;
        color: #666;
    }
    .val-text {
        background-color: blue;
        padding: 2px 4px;
        border-radius: 8rpx;
        color: white;
    }
</style>
pages/api/addMat.js
@@ -1,7 +1,7 @@
async function addMat() {
    let that = this,item = {};
    var ress = await uni.request({
        url: 'http://127.0.0.1:8089/bfwms/mat/auth',
        url: 'http://192.168.4.188:8089/bfwms/mat/auth',
        data: {matnr: '3CPPJ.B.GMB.LZ.QBY4-10/15P316LLZ'},
    }).then((result)=> {
        let mat = result.data.data
@@ -9,7 +9,8 @@
            {key: '商品码',value: mat.matnr},
            {key: '商品名称',value: mat.maktx},
            {key: '规格',value: mat.specs},
            {key: '数量',value: 100},
            {key: '批号',value: '',type: 'input'},
            {key: '数量',value: 0,type: 'number-box'},
        ]
    },(res)=>{
        console.log(res);
pages/common/data-list/dataDetail.vue
@@ -1,20 +1,48 @@
<template>
    <view>
        <view class="main" v-for="(it,i) in dataList" :key="i">
            <view class="main-left">{{it.key}}</view>
            <view class="main-right"
                v-show="!it.type">
                    {{it.value}}
            </view>
            <input class="main-right"
                v-show="it.type == 'input'"
                type="text"
                v-model="it.value"
            >
            <view class="main-right dis-center" v-show="it.type == 'number-box'" @click="numChange(i)">
                <uni-number-box
                    color="#747474"
                    v-show="it.type == 'number-box'"
                    :value="it.value"
                    :max="99999999"
                    :step='1'
                    @change="changeValue"
                />
            </view>
        </view>
        <button @click="back">back</button>
    </view>
</template>
<script>
    export default {
        data() {
            return {
                mat: {
                    matnr: null,
                    maktx: null,
                    specs: null,
                    batch: null,
                    orderNo: null,
                    anfme: 0,
                },
                dataList: [
                    {key: '商品编码',value: 'fbr3dasdasd242fbr3dasdasd242fbr3dasdasd242fbr3dasdasd242fbr2'},
                    {key: '批号',value: '20231006',type: 'input'},
                    {key: '数量',value: 200,type: 'number-box'},
                ],
                baseIP:'',
                basePORT:'',
                index: 0,
                val: 0,
            }
        },
        onLoad(option) {
@@ -28,14 +56,20 @@
            
            // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
            eventChannel.on('mat', function(data) {
                console.log(data);
                that.dataList = data.data
            })
            
            
        },
        methods: {
            numChange(i) {
                this.dataList[i].value = this.val
            },
            changeValue(value) {
                this.val = value
            },
            back() {
                this.getOpenerEventChannel().emit('matList', {data: this.mat});
                this.getOpenerEventChannel().emit('dataList', {data: this.dataList});
                uni.navigateBack({
                    
                })
@@ -44,5 +78,29 @@
    }
</script>
<style>
<style scoped>
    .main {
        display: flex;
        border-bottom: 1px solid #333;
        min-height: 70rpx;
        align-items: center;
        margin-left: 8px;
        padding: 8rpx;
    }
    .main-left {
        width: 140rpx;
        text-align: right;
    }
    .main-right {
        flex: 1;
        background-color: aquamarine;
        margin-left: 8rpx;
        display: flex;
        flex-wrap: wrap;
        /* word-wrap: break-word; */
        word-break: break-all;
    }
    .dis-center {
        justify-content: center;
    }
</style>
pages/component/demo.vue
@@ -17,7 +17,14 @@
        
        <hr>
        
        <z-data-list class="data-list" v-for="it in zDataList"  @goDetail='goDetail(it.item)' :list="it" ></z-data-list>
        <z-data-list class="data-list"
            v-for="(it,i) in zDataList"
            :key="i"
            :list="it"
            :index="i+1"
            @goDetail='goDetail(it.detl)'
        ></z-data-list>
        
        
        <button @click="add">add</button>
@@ -39,7 +46,17 @@
                    {name: 'yyy',desc: '托盘码',val: '2',lenCheck: 8,focus: false},
                    {name: 'aaa',desc: '物料码',btn: true,btnName: '提取',placeholder: '',val: '1',focus: false}
                ],
                zDataList: [],
                zDataList: [
                    {
                        detl: [
                            {key: '商品码',value: 'ccc'},
                            {key: '商品名称',value: 'ccc'},
                            {key: '规格',value: 'ccc'},
                            {key: '批号',value: '16',type: 'input'},
                            {key: '数量',value: 0,type: 'number-box'},
                        ]
                    }
                ],
            }
        },
        methods: {
@@ -70,7 +87,6 @@
                
            },
            goDetail(param) {
                console.log(param);
                uni.navigateTo({
                    url: '/pages/common/data-list/dataDetail',
                    // 传
@@ -81,7 +97,7 @@
                    },
                    // 接
                    events: {
                        matList: function(data) {
                        dataList: function(data) {
                            console.log(data);
                        },
                    },