| | |
| | | :focus="value_rfidfocus" /> |
| | | </u-td> |
| | | </u-tr> |
| | | |
| | | </u-table> |
| | | </view> |
| | | <view style="padding: 0rpx 0rpx;"> |
| | | <u-table> |
| | | <u-tr> |
| | | <u-td> |
| | | <u-button style="width:100px" type="primary" @click="SaveInfomation">确认</u-button> |
| | | <!-- å
³é®1ï¼æ ¹æ®æäº¤ç¶æç¦ç¨æé®ï¼æç¤ºç¨æ·æ£å¨å¤ç --> |
| | | <u-button |
| | | style="width:100px" |
| | | type="primary" |
| | | @click="SaveInfomation" |
| | | :disabled="isSubmitting" |
| | | :loading="isSubmitting" |
| | | > |
| | | {{ isSubmitting ? 'å¤çä¸...' : '确认' }} |
| | | </u-button> |
| | | </u-td> |
| | | </u-tr> |
| | | </u-table> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | var _this; |
| | | var _user; |
| | | // ç§»é¤å
¨å±_thisï¼æ¹ç¨ç®å¤´å½æ°é¿å
thisæåé®é¢ |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | CurrentUser: '', //å½åç¨æ· |
| | | value_rfid: '', |
| | | value_qrcode: '', |
| | | value_rfidfocus: false |
| | | value_rfidfocus: false, |
| | | timer: null, // 宿¶å¨åéï¼è¡¥å
å®ä¹ï¼é¿å
undefinedï¼ |
| | | isSubmitting: false, // å
³é®2ï¼æäº¤ç¶æéï¼æ è®°æ¯å¦æ£å¨å¤çè¯·æ± |
| | | lastSubmitTime: 0, // å
³é®3ï¼è®°å½æå䏿¬¡æäº¤æ¶é´ï¼é²é²æ |
| | | submitInterval: 3000 // 鲿é´éï¼3ç§å
ä¸å
许éå¤æäº¤ï¼å¯è°æ´ï¼ |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | this.date = this.$DateTool.getDate(); |
| | | }, 1000) |
| | | } |
| | | |
| | | }, |
| | | SaveInfomation() { |
| | | if (_this.value_rfid.length == 0) { |
| | | // é²ææ ¡éªï¼3ç§å
éå¤ç¹å»ç´æ¥æ¦æª |
| | | const now = Date.now(); |
| | | if (now - this.lastSubmitTime < this.submitInterval) { |
| | | uni.showToast({ |
| | | title: "请å¿éå¤æäº¤ï¼", |
| | | duration: 2000, |
| | | icon: 'none' |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | // æäº¤ç¶æéï¼æ£å¨å¤çä¸åæ¦æª |
| | | if (this.isSubmitting) { |
| | | uni.showToast({ |
| | | title: "请ç¨åï¼æ£å¨å¤çä¸...", |
| | | duration: 2000, |
| | | icon: 'none' |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | // åæåæ®µæ ¡éª |
| | | if (this.value_rfid.length == 0) { |
| | | uni.showToast({ |
| | | title: "æçç ä¸è½ä¸ºç©º", |
| | | duration: 2000 |
| | | }); |
| | | return; |
| | | } |
| | | if (_this.value_rfid.length > 6) { |
| | | if (this.value_rfid.length > 6) { |
| | | uni.showToast({ |
| | | title: "æçé¿åº¦ä¸è½å¤§äº6使°ã", |
| | | duration: 2000, |
| | |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | // æ 记为æäº¤ä¸ï¼ç¦ç¨æé® |
| | | this.isSubmitting = true; |
| | | // è®°å½æäº¤æ¶é´ï¼ç¨äºé²æ |
| | | this.lastSubmitTime = now; |
| | | |
| | | uni.showModal({ |
| | | title: 'æç¤º', |
| | | content: 'è¯·æ ¸å¯¹æçç æ¯å¦æ£ç¡®?', |
| | | success: function(res) { |
| | | // å
³é®4ï¼æ¹ç¨ç®å¤´å½æ°ï¼é¿å
thisæå丢失 |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | let data = { |
| | | MainData: { |
| | | barcode: _this.value_rfid |
| | | barcode: this.value_rfid |
| | | }, |
| | | }; |
| | | _this.$AjaxRequest.Params('post', 'Dt_boxing_head/CreateEmptyPalletTask', |
| | | data, _user.token); |
| | | _this.$AjaxRequest.Request().then(function(result) { |
| | | this.$AjaxRequest.Params('post', 'Dt_boxing_head/CreateEmptyPalletTask', |
| | | data, this.$UserTool.UserInfo.token); |
| | | this.$AjaxRequest.Request().then((result) => { |
| | | // 请æ±å®æï¼éç½®æäº¤ç¶æ |
| | | this.isSubmitting = false; |
| | | if (result.data.status) { |
| | | uni.showToast({ |
| | | title: "å建空æå
¥åºæå!", |
| | | duration: 2000 |
| | | }); |
| | | _this.value_rfid = ""; |
| | | _this.value_qrcode = ""; |
| | | _this.value_rfidfocus = true; |
| | | this.value_rfid = ""; |
| | | this.value_qrcode = ""; |
| | | this.value_rfidfocus = true; |
| | | } else { |
| | | //console.log(result.data.message); |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: "请æ±é误:" + result.data.message, |
| | | duration: 2000 |
| | | }); |
| | | } |
| | | }).catch(function(err) { |
| | | }).catch((err) => { |
| | | // å¼å¸¸æ
åµï¼ä¹è¦éç½®æäº¤ç¶æ |
| | | this.isSubmitting = false; |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: "请æ±åå°å¼å¸¸,é误信æ¯." + err.errMsg, |
| | | title: "请æ±åå°å¼å¸¸,é误信æ¯:" + err.errMsg, |
| | | duration: 2000 |
| | | }); |
| | | }); |
| | | } else if (res.cancel) { |
| | | // åæ¶ç¡®è®¤ï¼éç½®æäº¤ç¶æ |
| | | this.isSubmitting = false; |
| | | this.value_rfidfocus = true; |
| | | } |
| | | }, |
| | | // å
³é®5ï¼å¼¹çªå
³éï¼å¦ç¹å»ç©ºç½å¤ï¼ï¼å¿
é¡»éç½®æäº¤ç¶æ |
| | | complete: () => { |
| | | if (!this.isSubmitting) return; // å·²å¤ç宿åè·³è¿ |
| | | this.isSubmitting = false; |
| | | } |
| | | }); |
| | | }, |
| | |
| | | clearInterval(this.timer) |
| | | this.timer = null; |
| | | this.setTimer(); |
| | | _user = this.$UserTool.UserInfo; |
| | | this.CurrentUser = _user.userName; |
| | | this.CurrentUser = this.$UserTool.UserInfo.userName; |
| | | this.UserArray = [this.$UserTool.AllUserInfo]; |
| | | this.value_rfidfocus = true; |
| | | }, |
| | |
| | | this.timer = null; |
| | | }, |
| | | mounted() { |
| | | _this = this; |
| | | //_this.queryOrder(); |
| | | }, |
| | | |
| | | |
| | | // ç§»é¤å
¨å±_thisèµå¼ï¼å½»åºé¿å
thisæåé®é¢ |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | .loopItem { |
| | | margin-top: 5px; |
| | | margin-left: 15px; |
| | | |
| | | } |
| | | |
| | | .deleteBtn { |