| | |
| | | v-model="barcode" |
| | | :index="input1.id" |
| | | :lenCheck="input1.lenCheck" |
| | | :focus="input1.focus" |
| | | @inputVal='input3' |
| | | :focus="barcodeFocus" |
| | | @inputVal='barcodeInput' |
| | | /> |
| | | <z-input |
| | | :desc="input2.title" |
| | | :name="input2.name" |
| | | :btn="input2.btn" |
| | | :btn-name="input2.btnName" |
| | | v-model="matnr" |
| | | :index="input2.id" |
| | | :lenCheck="input2.lenCheck" |
| | | :focus="input2.focus" |
| | | @inputVal='input3' |
| | | <z-input :desc="input2.title" |
| | | :name="input2.name" |
| | | :btn="input2.btn" |
| | | :btn-name="input2.btnName" |
| | | v-model="matnr" |
| | | :index="input2.id" |
| | | :lenCheck="input2.lenCheck" |
| | | :focus="matnrFocus" |
| | | @inputVal='matnrInput' |
| | | /> |
| | | </view> |
| | | <!-- 基本属性绑定 --> |
| | | <!-- 光标复位 --> |
| | | <!-- 长度判断 --> |
| | | |
| | | |
| | | <u-sticky > |
| | |
| | | <view class="flex1"></view> |
| | | </view> |
| | | </u-sticky> |
| | | <view>barcode:{{barcode}}</view> |
| | | <!-- <zzz v-model="barcode" @change1='change' @input="inputz"></zzz> --> |
| | | <view>matnr:{{matnr}}</view> |
| | | <!-- <zzz v-model="matnr" @change1='change' @input="inputz"></zzz> --> |
| | | |
| | | |
| | | |
| | | <z-data-list class="data-list" |
| | | v-for="(it,i) in zDataList" |
| | |
| | | @goDetail='goDetail(it,i)' |
| | | ></z-data-list> |
| | | <!-- 垫高 --> |
| | | <view style="height: 100rpx;"></view> |
| | | <view style="height: 100rpx;" /> |
| | | |
| | | <view class="z-floor"> |
| | | <view class="z-default">重置</view> |
| | | <view class="z-default" @click="clean">重置</view> |
| | | <view class="z-primary" @click="comb">组托</view> |
| | | </view> |
| | | |
| | |
| | | <script> |
| | | import { mapState } from 'vuex' |
| | | import addMat from '@/pages/api/addMat.js' |
| | | import util from '@/static/js/util.js' |
| | | export default { |
| | | data() { |
| | | return { |
| | | zDataList: [ ], |
| | | barcode: '80009991', |
| | | zDataList: [], |
| | | barcode: '', |
| | | matnr: '', |
| | | inputCode: '托盘码', |
| | | barcodeFocus: true, |
| | | matnrFocus: false |
| | | } |
| | | }, |
| | | onShow() { |
| | |
| | | lable: state => state.project.menu[0].page.lable |
| | | }), |
| | | methods: { |
| | | inputz() { |
| | | // console.log(this.barcode); |
| | | console.log(this.matnr); |
| | | barcodeInput(arr) { |
| | | this.barcodeFocus = false |
| | | setTimeout(()=>{ |
| | | this.matnrFocus = true |
| | | },10) |
| | | }, |
| | | change() { |
| | | // console.log(this.barcode); |
| | | // console.log(this.matnr); |
| | | |
| | | }, |
| | | scanCode(data) { |
| | | // console.log(data); |
| | | |
| | | }, |
| | | input3(arr) { |
| | | if(arr[1] == 'matnr') { |
| | | this.getMat(arr[0]) |
| | | matnrInput(arr) { |
| | | if(arr.title == 'matnr') { |
| | | this.getMat(arr.value) |
| | | } |
| | | }, |
| | | async getMat(matnr) { |
| | | let mat = await addMat.addMat(matnr) |
| | | mat['count'] = 0 |
| | | this.zDataList.push(mat) |
| | | }, |
| | | goDetail(param,index) { |
| | | let _this = this |
| | |
| | | }, |
| | | }) |
| | | }, |
| | | // 获取物料 |
| | | async getMat(matnr) { |
| | | let res = await addMat.addMat(matnr) |
| | | if (res.code === 200 && res.data) { |
| | | res.data['count'] = 1 |
| | | this.zDataList = util.matCheck(res.data,this.zDataList) |
| | | this.matnr = '' |
| | | } else if (res.code === 200 && !res.data) { |
| | | let msg = `${this.matnr} 物料异常,请重试` |
| | | uni.showToast({ title: msg, icon: "none", position: 'top' }) |
| | | } else if (res.code == 403) { |
| | | uni.showToast({ title: res.msg, icon: "none", position: 'top' }) |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../../LoginDemo/LoginDemo' |
| | | }); |
| | | }, 1000); |
| | | } else { |
| | | uni.showToast({ title: res.msg, icon: "none", position: 'top' }) |
| | | } |
| | | }, |
| | | // 跳转物料提取页面 |
| | | matPick() { |
| | | 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) |
| | | } |
| | | }, |
| | | }) |
| | | }, |
| | | // 组托 |
| | | comb() { |
| | | console.log(this.barcode); |
| | | console.log(this.matnr); |
| | | console.log(this.zDataList); |
| | | }, |
| | | clean() { |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |