#
whycq
2023-10-06 60567b1b3fbb19334ee794b70e4794527a967d5d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<template>
    <view>
        <z-input v-for="it in zInputList" 
            :desc="it.desc" :btn="it.btn" :btn-name="it.btnName" v-model="it.val" 
            :lenCheck="it.lenCheck" :focus="it.focus" @clickBtn='entry(it.name)'>
        </z-input>
        <view>输入框1</view>
        <view>{{zInputList[0].val}}</view>
        
        <view>输入框2</view>
        <view>{{zInputList[1].val}}</view>
        
        <view>输入框2</view>
        <view>{{zInputList[2].val}}</view>
        
        <button @click="focus">focus</button>
        
        <hr>
        
        <z-data-list></z-data-list>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                zInputList: [ 
                    {name: 'ccc',desc: '订单号',btn: true,btnName: '阿斯顿',val: 'orderNo',focus: true},
                    {name: 'yyy',desc: '托盘码',val: '2',lenCheck: 8,focus: false},
                    {name: 'aaa',desc: '物料码',btn: true,btnName: '提取',placeholder: '',val: '1',focus: false}
                ],
                zDataList: [
                    {name: 'asd',orderNo: 'CK123',barcode: 'bar321'}
                ]
                
            }
        },
        methods: {
            entry(e) {
            },
            ccc() {
            },
            aaa() {
                
            },
            focus() {
                if (this.zInputList[0].focus) {
                    this.zInputList[0].focus = false
                    this.zInputList[1].focus = true
                    this.zInputList[2].focus = false
                } else if (this.zInputList[1].focus){
                    this.zInputList[0].focus = false
                    this.zInputList[1].focus = false
                    this.zInputList[2].focus = true
                } else {
                    this.zInputList[0].focus = true
                    this.zInputList[1].focus = false
                    this.zInputList[2].focus = false
                }
                
            }
        }
        
    }
</script>
 
<style>
</style>