| | |
| | | <view class="itemstyle"> |
| | | <uni-forms label-width="180"> |
| | | <uni-forms-item label="åå§æçæ¡ç :"> |
| | | <uni-easyinput type="text" placeholder="è¯·æ«ææçæ¡ç " ref='midInput' :focus="!focus" |
| | | <uni-easyinput type="text" placeholder="è¯·æ«ææçæ¡ç " ref='midInput' :focus="sourceFocus" |
| | | v-model="soussAddress" @input="barcodeInput" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="ç®æ æçæ¡ç :"> |
| | | <uni-easyinput type="text" placeholder="è¯·æ«ææçæ¡ç " ref='midInput' :focus="!focus" |
| | | <uni-easyinput type="text" placeholder="è¯·æ«ææçæ¡ç " ref='midInput' :focus="targetFocus" |
| | | v-model="targetAddress" @input="barcodeInput" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | const innerAudioContext = uni.createInnerAudioContext(); |
| | | export default { |
| | | data() { |
| | | return { |
| | | focus: false, |
| | | sourceFocus: true, // é»è®¤åå§æçè¾å
¥æ¡è·å¾ç¦ç¹ |
| | | targetFocus: false, // ç®æ æçè¾å
¥æ¡ä¸è·å¾ç¦ç¹ |
| | | soussAddress: "", |
| | | targetAddress: "", |
| | | warehouseId: "", |
| | | } |
| | | }, |
| | | onShow() {}, |
| | | onLoad(res) { |
| | | this.focus = false; |
| | | this.warehouseId = res.warehouseId; |
| | | }, |
| | | methods: { |
| | | barcodeInput() { |
| | | this.$nextTick(function(x) { |
| | | if (this.barcode.length > 0) { |
| | | this.focus = true; |
| | | barcodeInput(type) { |
| | | if (type != '') { |
| | | if (this.soussAddress == "") { |
| | | setTimeout(() => { |
| | | this.sourceFocus = false; |
| | | this.targetFocus = true; |
| | | }, 100); |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | AGVTasks() { |
| | | if (this.soussAddress == "") { |
| | |
| | | title: "è¯·æ«æåå§æçæ¡ç ", |
| | | type: 'error' |
| | | }) |
| | | this.sourceFocus = true; |
| | | this.targetFocus = false; |
| | | return; |
| | | } |
| | | if (this.targetAddress == "") { |
| | |
| | | title: "è¯·æ«æç®æ æçæ¡ç ", |
| | | type: 'error' |
| | | }) |
| | | this.sourceFocus = false; |
| | | this.targetFocus = true; |
| | | return; |
| | | } |
| | | |
| | | var postDate = { |
| | | MainData: { |
| | | soussAddress: this.soussAddress, |
| | |
| | | }) |
| | | this.soussAddress = ""; |
| | | this.targetAddress = ""; |
| | | this.sourceFocus = true; |
| | | this.targetFocus = false; |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | |
| | | this.sourceFocus = true; |
| | | this.targetFocus = false; |
| | | } |
| | | }) |
| | | }, |