New file |
| | |
| | | # 中扬WMS手持终端 |
| | | |
| | | `addMat` item参数 |
| | | key: 名称 |
| | | value: 值 |
| | | type: 值类型 - input - number-box |
| | |
| | | <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> |
| | |
| | | default() { |
| | | return {} |
| | | } |
| | | }, |
| | | index: { |
| | | type: Number, |
| | | default: 2 |
| | | } |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | .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> |
| | |
| | | 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 |
| | |
| | | {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); |
| | |
| | | <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) { |
| | |
| | | |
| | | // 监听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({ |
| | | |
| | | }) |
| | |
| | | } |
| | | </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> |
| | |
| | | |
| | | <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> |
| | |
| | | {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: { |
| | |
| | | |
| | | }, |
| | | goDetail(param) { |
| | | console.log(param); |
| | | uni.navigateTo({ |
| | | url: '/pages/common/data-list/dataDetail', |
| | | // 传 |
| | |
| | | }, |
| | | // 接 |
| | | events: { |
| | | matList: function(data) { |
| | | dataList: function(data) { |
| | | console.log(data); |
| | | }, |
| | | }, |