| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view> |
| | | <view class="itemstyle"> |
| | | <uni-forms label-width="180"> |
| | | <uni-forms-item label="åå§æçæ¡ç :"> |
| | | <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="targetFocus" |
| | | v-model="targetAddress" @input="barcodeInput" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item> |
| | | <button @click="AGVTasks" type="primary" size="default" style="margin-top: 2%;">ç¡®è®¤å®æ</button> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | </view> |
| | | <u-toast ref="uToast" /> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | sourceFocus: true, // é»è®¤åå§æçè¾å
¥æ¡è·å¾ç¦ç¹ |
| | | targetFocus: false, // ç®æ æçè¾å
¥æ¡ä¸è·å¾ç¦ç¹ |
| | | soussAddress: "", |
| | | targetAddress: "", |
| | | warehouseId: "", |
| | | } |
| | | }, |
| | | onLoad(res) { |
| | | this.warehouseId = res.warehouseId; |
| | | }, |
| | | methods: { |
| | | barcodeInput(type) { |
| | | if (type != '') { |
| | | if (this.soussAddress == "") { |
| | | setTimeout(() => { |
| | | this.sourceFocus = false; |
| | | this.targetFocus = true; |
| | | }, 100); |
| | | } |
| | | } |
| | | }, |
| | | AGVTasks() { |
| | | if (this.soussAddress == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«æåå§æçæ¡ç ", |
| | | type: 'error' |
| | | }) |
| | | this.sourceFocus = true; |
| | | this.targetFocus = false; |
| | | return; |
| | | } |
| | | if (this.targetAddress == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«æç®æ æçæ¡ç ", |
| | | type: 'error' |
| | | }) |
| | | this.sourceFocus = false; |
| | | this.targetFocus = true; |
| | | return; |
| | | } |
| | | |
| | | var postDate = { |
| | | MainData: { |
| | | soussAddress: this.soussAddress, |
| | | targetAddress: this.targetAddress, |
| | | warehouseId: this.warehouseId, |
| | | } |
| | | } |
| | | this.$u.post('/api/InboundOrder/SYMaterielGroup', postDate).then( |
| | | res => { |
| | | if (res.status) { |
| | | this.$refs.uToast.show({ |
| | | title: "åææå", |
| | | type: "success" |
| | | }) |
| | | 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; |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | @import '@/common/uni-ui.scss'; |
| | | |
| | | .content { |
| | | display: flex; |
| | | height: 150px; |
| | | } |
| | | |
| | | .content-text { |
| | | font-size: 14px; |
| | | color: #666; |
| | | } |
| | | |
| | | .itemstyle { |
| | | margin-top: 30px; |
| | | margin-left: 5%; |
| | | } |
| | | |
| | | .headerstyle { |
| | | width: 90%; |
| | | } |
| | | </style> |