| | |
| | | @input="addressInput" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item> |
| | | <button @click="InEmpty" type="primary" size="default" style="margin-top: 2%;">空æ¡ååº</button> |
| | | <!-- 空æ¡ååºæé®æ·»å ç¦ç¨ç¶æåæåæç¤º --> |
| | | <button |
| | | @click="InEmpty" |
| | | type="primary" |
| | | size="default" |
| | | style="margin-top: 2%;" |
| | | :disabled="isSubmitting" |
| | | > |
| | | {{ isSubmitting ? 'æäº¤ä¸...' : '空æ¡ååº' }} |
| | | </button> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | </view> |
| | |
| | | focusStart:false, |
| | | barcode: "", |
| | | address: "", |
| | | WarehouseId: "" |
| | | WarehouseId: "", |
| | | // æ°å¢ï¼é²éå¤ç¹å»ç¶æåé |
| | | isSubmitting: false |
| | | } |
| | | }, |
| | | onShow() {}, |
| | |
| | | |
| | | }, |
| | | methods: { |
| | | // voiceSpeech(src) { |
| | | // innerAudioContext.src = src; // '../../static/success.mp3'; |
| | | // innerAudioContext.play(); |
| | | // }, |
| | | barcodeInput() { |
| | | this.$nextTick(function(x) { |
| | | if (this.barcode.length > 0) { |
| | |
| | | }) |
| | | }, |
| | | InEmpty() { |
| | | // 1. åç½®æ ¡éª |
| | | if (this.barcode == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«ææçç ", |
| | |
| | | }) |
| | | return; |
| | | } |
| | | |
| | | // 2. 鲿¢éå¤ç¹å»ï¼è¯·æ±ä¸åç´æ¥è¿å |
| | | if (this.isSubmitting) return; |
| | | |
| | | // 3. æ 记为请æ±ä¸ï¼ç¦ç¨æé® |
| | | this.isSubmitting = true; |
| | | |
| | | this.$u.post('/api/Task/EmptyBackTask?barcode=' + this.barcode + '&startPoint=' + this.address).then( |
| | | res => { |
| | | if (res.status) { |
| | |
| | | type: "error" |
| | | }) |
| | | } |
| | | }).catch(err => { |
| | | // æè·è¯·æ±å¼å¸¸ï¼æç¤ºé误 |
| | | this.$refs.uToast.show({ |
| | | title: err.message || "请æ±å¤±è´¥", |
| | | type: "error" |
| | | }) |
| | | }).finally(() => { |
| | | // 4. 请æ±å®æï¼æå/失败/å¼å¸¸ï¼æ¢å¤æé®ç¶æ |
| | | this.isSubmitting = false; |
| | | }) |
| | | } |
| | | } |