<template>
|
<view>
|
<view class="head">
|
<z-input v-for="it in input"
|
:desc="it.title"
|
:name="it.name"
|
:btn="it.btn"
|
:btn-name="it.btnName"
|
v-model="it.val"
|
:index="it.id"
|
:lenCheck="it.lenCheck"
|
:focus="it.focus"
|
@inputVal='input2'
|
></z-input>
|
</view>
|
|
<u-sticky >
|
<view class="sticky">商品列表</view>
|
</u-sticky>
|
|
<z-data-list class="data-list"
|
v-for="(it,i) in zDataList"
|
:key="i"
|
:lable="lable"
|
:fields="it"
|
:index="i+1"
|
@goDetail='goDetail(it.detl,i)'
|
></z-data-list>
|
|
|
|
|
|
|
<!-- 垫高 -->
|
<view style="height: 100rpx;"></view>
|
|
<view class="z-floor">
|
<view class="z-default">重置</view>
|
<view class="z-primary">组托</view>
|
</view>
|
|
</view>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex'
|
import addMat from '@/pages/api/addMat.js'
|
export default {
|
data() {
|
return {
|
zDataList: [
|
{matnr: 'A1001',maktx: '1号物料',count: 99},
|
{matnr: 'A1002',maktx: '2号物料',count: 77},
|
{matnr: 'A1002',maktx: '2号物料',count: 77}
|
],
|
}
|
},
|
onShow() {
|
// console.log(this.page);
|
},
|
computed: mapState({
|
input: state => state.project.menu[0].page.input,
|
lable: state => state.project.menu[0].page.lable
|
}),
|
methods: {
|
input2(arr) {
|
if(arr[1] == 'matnr') {
|
this.getMat(arr[0])
|
}
|
},
|
async getMat(matnr) {
|
let mat = await addMat.addMat(matnr)
|
this.zDataList.push(mat)
|
},
|
goDetail(param,index) {
|
let _this = this
|
uni.navigateTo({
|
url: '/pages/common/data-list/dataDetail',
|
// 传
|
success: function(data) {
|
data.eventChannel.emit('param', {
|
param: param,
|
index: index
|
})
|
},
|
// 接
|
events: {
|
dataList: function(data) {
|
console.log(data);
|
},
|
del: function(data) {
|
_this.zDataList.splice(data.data,1)
|
}
|
},
|
})
|
}
|
}
|
}
|
</script>
|
|
<style>
|
.head {
|
/* margin-top: -8px; */
|
}
|
.sticky {
|
height: 70rpx;
|
box-shadow: 0px 4px 4px #e2e2e2;
|
text-align: center;
|
background-color: #fff;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
</style>
|