| | |
| | | <view> |
| | | <view class="itemstyle"> |
| | | <uni-forms label-width="180"> |
| | | <uni-forms-item label="æçæ¡ç :"> |
| | | <uni-easyinput type="text" placeholder="è¯·æ«ææçæ¡ç " ref='midInput' :focus="!focus" v-model="barcode" |
| | | @input="barcodeInput" /> |
| | | <uni-forms-item label="ä»»å¡ç¼å·:"> |
| | | <uni-easyinput type="number" v-model="taskNum" placeholder="请è¾å
¥ä»»å¡ç¼å·" ref='midInput'/> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="å°åæ¡ç :"> |
| | | <uni-easyinput type="text" placeholder="è¯·æ«æå°åæ¡ç " ref='midInput' :focus="!focus" v-model="address" @confirm="addressInput" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item> |
| | | <button @click="AGVFinish" type="primary" size="default" style="margin-top: 2%;">ç¡®è®¤å®æ</button> |
| | |
| | | data() { |
| | | return { |
| | | focus: false, |
| | | barcode: "", |
| | | taskNum: "", |
| | | address: "" |
| | | } |
| | | }, |
| | | onShow() {}, |
| | |
| | | this.focus = false; |
| | | }, |
| | | methods: { |
| | | // voiceSpeech(src) { |
| | | // innerAudioContext.src = src; // '../../static/success.mp3'; |
| | | // innerAudioContext.play(); |
| | | // }, |
| | | barcodeInput() { |
| | | addressInput() { |
| | | this.$nextTick(function(x) { |
| | | if (this.barcode.length > 0) { |
| | | if (this.address.length > 0) { |
| | | this.focus = true; |
| | | } |
| | | }) |
| | | }, |
| | | AGVFinish() { |
| | | if (this.barcode == "") { |
| | | if (this.address == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«ææçç ", |
| | | title: "è¯·æ«æå°åæ¡ç ", |
| | | type: 'error' |
| | | }) |
| | | return; |
| | | } |
| | | this.$u.post('http://10.30.4.92:9291/api/CTU_AGV/AGVFinish?barcode=' + this.barcode).then( |
| | | if (this.taskNum == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "请è¾å
¥ä»»å¡ç¼å·", |
| | | type: 'error' |
| | | }) |
| | | return; |
| | | } |
| | | this.$u.post('http://192.168.35.3:9281/api/AGV/AGVFinish?address=' + this.address +'&taskNum='+ this.taskNum).then( |
| | | res => { |
| | | if (res.status) { |
| | | this.$refs.uToast.show({ |
| | | title: "宿æå", |
| | | title: "æå", |
| | | type: "success" |
| | | }) |
| | | this.barcode = ""; |
| | | this.taskNum = ""; |
| | | this.address = ""; |
| | | this.focus = false; |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |