<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 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>
|
|
<hr>
|
|
<!-- 垫高 -->
|
<view style="height: 100rpx;"></view>
|
</view>
|
</template>
|
|
<script>
|
import addMat, { isEmpty } from '../api/addMat.js'
|
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: [
|
{
|
detl: [
|
{key: '商品码',value: 'ccc'},
|
{key: '商品名称',value: 'ccc'},
|
{key: '规格',value: 'ccc'},
|
{key: '批号',value: '16',type: 'input'},
|
{key: '数量',value: 0,type: 'number-box'},
|
]
|
}
|
],
|
}
|
},
|
methods: {
|
entry(e) {
|
},
|
ccc() {
|
},
|
async add() {
|
let mat = await addMat.addMat()
|
if (!addMat.isEmpty(mat)) {
|
this.zDataList.push(mat)
|
}
|
},
|
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
|
}
|
|
},
|
goDetail(param) {
|
uni.navigateTo({
|
url: '/pages/common/data-list/dataDetail',
|
// 传
|
success: function(res) {
|
res.eventChannel.emit('mat', {
|
data: param
|
})
|
},
|
// 接
|
events: {
|
dataList: function(data) {
|
console.log(data);
|
},
|
},
|
})
|
}
|
}
|
|
}
|
</script>
|
|
<style>
|
.data-list {
|
|
}
|
.data-list:last-child {
|
margin-bottom: 100px;
|
}
|
hr {
|
margin-top: 10px;
|
margin-bottom: 10px;
|
}
|
</style>
|