From 5c8951e28e9f2fbdbe730ddf264eeba313647ea9 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期四, 13 七月 2023 16:32:53 +0800 Subject: [PATCH] # --- pages/AGV/AGVPakinOn.vue | 168 ++++++++++++++++++++------- pages/mat/matSelected.vue | 6 pages/AGV/AGVStart.vue | 96 +++++++++++----- pages/pakin/pakin.vue | 6 pages/AGV/AGVPakinBing.vue | 33 +++++ pages/AGV/AGVPakin.vue | 3 6 files changed, 225 insertions(+), 87 deletions(-) diff --git a/pages/AGV/AGVPakin.vue b/pages/AGV/AGVPakin.vue index 7ba522e..1073456 100644 --- a/pages/AGV/AGVPakin.vue +++ b/pages/AGV/AGVPakin.vue @@ -175,7 +175,7 @@ // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏� setTimeout(() => { var len = this.barcode.length - if (len != 8) { + if (len != 10) { uni.showToast({ title: '鎵樼洏鐮佹湁璇閲嶈瘯', icon: "none", @@ -438,6 +438,7 @@ // 纭閲嶇疆 resetConfirm() { this.dataList = [] + this.barcode = '' this.messageText = "閲嶇疆瀹屾垚" this.messageToggle('success') }, diff --git a/pages/AGV/AGVPakinBing.vue b/pages/AGV/AGVPakinBing.vue index 88b9c10..7f1848f 100644 --- a/pages/AGV/AGVPakinBing.vue +++ b/pages/AGV/AGVPakinBing.vue @@ -8,7 +8,8 @@ </view> <view class="item"> <view class="code-decs">鏆傚瓨浣�:</view> - <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="stationCode" :focus="matFocus"> + <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="stationCode" :focus="stationCodeFocus" + @input="stationCodeInput()"> <view class="item-right"> <button></button> <!-- <text style="text-align: right;color: #409EFF;" @click="selectMat()">鎻愬彇+</text> --> @@ -142,6 +143,7 @@ token: '', barcode: '', stationCode: '', + stationCodeFocus: false, dataList: [], count: 0, rowNum: '', @@ -171,12 +173,28 @@ this.msgType1 = type this.$refs.message.open() }, + stationCodeInput() { + setTimeout(() => { + var len = this.stationCode.length + if (len != 15) { + this.stationCode = '' + this.stationCodeFocus = true + uni.showToast({ + title: '鏆傚瓨鐮佹湁璇閲嶈瘯', + icon: "none", + position: 'top' + }); + return; + } + this.focuss() + }, 200) + }, // barcode input 浜嬩欢 barcodeInput() { // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏� setTimeout(() => { var len = this.barcode.length - if (len != 8) { + if (len != 10) { uni.showToast({ title: '鎵樼洏鐮佹湁璇閲嶈瘯', icon: "none", @@ -185,8 +203,16 @@ this.barcodeFocuss() return; } - this.focuss() + this.stationCodeFocuss() }, 200) + }, + // 鏆傚瓨浣嶆湁璇噸缃� + stationCodeFocuss() { + let that = this; + that.stationCodeFocus = false; + setTimeout(() => { + that.stationCodeFocus = true; + }, 100); }, // 鎵樼洏鐮佹湁璇噸缃� barcodeFocuss() { @@ -420,6 +446,7 @@ // 纭閲嶇疆 resetConfirm() { this.dataList = [] + this.barcode = '' this.stationCode = '' this.messageText = "閲嶇疆瀹屾垚" this.messageToggle('success') diff --git a/pages/AGV/AGVPakinOn.vue b/pages/AGV/AGVPakinOn.vue index ebbd3db..753ae47 100644 --- a/pages/AGV/AGVPakinOn.vue +++ b/pages/AGV/AGVPakinOn.vue @@ -52,12 +52,6 @@ </view> </view> <view class="list-left-item"> - <view class="desc">閲嶉噺锛�</view> - <view class="left-item"> - <uni-tag :text="item.weight" type="warning"></uni-tag> - </view> - </view> - <view class="list-left-item"> <view class="desc">鏁伴噺锛�</view> <view class="left-item">{{item.anfme}}</view> </view> @@ -71,6 +65,7 @@ <!-- 搴曢儴鎿嶄綔鎸夐挳 --> <view class="buttom"> <button size="mini" @click="reset('warn')">閲嶇疆</button> + <button size="mini" type="primary" @click="agvStart('warn')">鍚姩鍏ュ簱</button> <button size="mini" type="primary" @click="combConfirm('warn')">缁勬墭</button> </view> <!-- 寮圭獥 --> @@ -87,13 +82,9 @@ style="background-color: #f7f7f7;padding: 0;color: #d5d5d5;"> </view> </view> - <!-- <view class="popup-item"> + <view class="popup-item"> <view class="popup-item-left">鎵瑰彿:</view> <view class="popup-item-right"><input type="text" v-model="batch"></view> - </view> --> - <view class="popup-item"> - <view class="popup-item-left">閲嶉噺:</view> - <view class="popup-item-right"><input type="text" v-model="weight"></view> </view> <view class="popup-item"> <view class="popup-item-left">鏁伴噺:</view> @@ -126,7 +117,7 @@ <view> <uni-popup ref="combConfirm" type="dialog"> <uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content" - @confirm="comb" @close="combClose"></uni-popup-dialog> + @confirm="comb(1)" @close="combClose"></uni-popup-dialog> </uni-popup> </view> <!-- 纭閲嶇疆 --> @@ -134,6 +125,13 @@ <uni-popup ref="resetConfirm" type="dialog"> <uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content" @confirm="resetConfirm" @close="resetClose"></uni-popup-dialog> + </uni-popup> + </view> + <!-- 鍚姩鍏ュ簱 --> + <view> + <uni-popup ref="agvStartConfirm" type="dialog"> + <uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content" + @confirm="agvStartConfirm" @close="resetClose"></uni-popup-dialog> </uni-popup> </view> </view> @@ -163,6 +161,8 @@ matFocus: false, matData: '', removeNum: 0, + devNo: [], + flag: 0 } }, onLoad() { @@ -178,27 +178,40 @@ this.$refs.message.open() }, stationCodeInput() { - + setTimeout(() => { + var len = this.stationCode.length + if (len != 15) { + this.stationCode = '' + this.stationCodeFocus = true + uni.showToast({ + title: '鏆傚瓨鐮佹湁璇閲嶈瘯', + icon: "none", + position: 'top' + }); + return; + } + this.focuss() + }, 200) }, - // barcode input 浜嬩欢 + // 绗﹀悎鏉′欢鐨勮烦杞埌涓嬩竴鏍忕洰 barcodeInput() { // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏� setTimeout(() => { var len = this.barcode.length - if (len != 8) { + if (len != 10) { + this.barcode = '' + this.barcodeFocus = true uni.showToast({ title: '鎵樼洏鐮佹湁璇閲嶈瘯', icon: "none", position: 'top' }); - this.stationCodeFocuss() return; } this.stationCodeFocuss() - // this.focuss() }, 200) }, - // 鎵樼洏鐮佹湁璇噸缃� + // 鏆傚瓨浣嶆湁璇噸缃� stationCodeFocuss() { let that = this; that.barcodeFocus = false; @@ -384,7 +397,7 @@ combClose() { this.$refs.combConfirm.close() }, - comb() { + comb(e) { uni.vibrateShort(); let that = this; if (that.barcode === '') { @@ -418,12 +431,96 @@ success(result) { var res = result.data if (res.code === 200) { + that.flag = 1 + if (e == 1) { + that.resst(); + that.messageText = "缁勬墭鎴愬姛" + that.messageToggle('success') + const innerAudioContext = uni.createInnerAudioContext(); + innerAudioContext.src = '/static/music/pakinOk.mp3'; + innerAudioContext.play() + } + } else if (res.code == 403) { + that.messageText = res.msg + that.messageToggle('error') + setTimeout(() => { + uni.reLaunch({ + url: '../login/login' + }); + }, 1000); + that.flag = 0 + } else { + that.messageText = res.msg + that.messageToggle('error') + that.flag = 0 + } + } + }); + }, + reset(type) { + this.msgType = type + this.title = '璀﹀憡' + this.content = '鏄惁閲嶇疆!' + this.$refs.resetConfirm.open() + }, + // 纭閲嶇疆 + resetConfirm() { + this.dataList = [] + this.barcode = '' + this.stationCode = '' + this.messageText = "閲嶇疆瀹屾垚" + this.messageToggle('success') + }, + // 鍙栨秷閲嶇疆 + resetClose() { + + }, + // 娓呯┖ + resst() { + this.dataList = [] + this.barcode = '' + this.stationCode = '' + this.barcodeFocus = true + }, + // 鍚姩鍏ュ簱 + agvStart(type) { + this.msgType = type + this.title = '璀﹀憡' + this.content = '鏄惁鐜板湪鍚姩鍏ュ簱!' + this.$refs.agvStartConfirm.open() + }, + agvStartConfirm() { + uni.showLoading() + this.devNo = [] + this.devNo.push(this.stationCode) + this.comb(2) + setTimeout(()=>{ + if (this.flag != 1) { + uni.hideLoading() + return + } + this.start() + uni.hideLoading() + },500) + + }, + start() { + let that = this + uni.request({ + url: that.baseUrl + '/agvMobile/pakin/auth', + data: JSON.stringify({ + devNo: that.devNo + }), + method: 'POST', + header: { + 'token': uni.getStorageSync('token') + }, + success(result) { + var res = result.data + if (res.code === 200) { that.resst(); - that.messageText = "缁勬墭鎴愬姛" + that.messageText = "鍚姩鎴愬姛" that.messageToggle('success') - const innerAudioContext = uni.createInnerAudioContext(); - innerAudioContext.src = '/static/music/pakinOk.mp3'; - innerAudioContext.play() } else if (res.code == 403) { that.messageText = res.msg that.messageToggle('error') @@ -439,30 +536,7 @@ } }); }, - reset(type) { - this.msgType = type - this.title = '璀﹀憡' - this.content = '鏄惁閲嶇疆!' - this.$refs.resetConfirm.open() - }, - // 纭閲嶇疆 - resetConfirm() { - this.dataList = [] - this.stationCode = '' - this.messageText = "閲嶇疆瀹屾垚" - this.messageToggle('success') - }, - // 鍙栨秷閲嶇疆 - resetClose() { - - }, - // 娓呯┖ - resst() { - this.dataList = [] - this.barcode = '' - this.stationCode = '' - this.barcodeFocuss() - }, + } } </script> diff --git a/pages/AGV/AGVStart.vue b/pages/AGV/AGVStart.vue index 94f076a..7010001 100644 --- a/pages/AGV/AGVStart.vue +++ b/pages/AGV/AGVStart.vue @@ -1,29 +1,19 @@ <template> <view> <view class="code"> - <!-- <view class="item"> - <view class="code-decs">鎵樼洏鐮�:</view> - <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus" - @input="barcodeInput()"> - </view> --> - <!-- <view class="item"> - <view class="code-decs">鏆傚瓨浣�:</view> - <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="stationCode" :focus="matFocus" @input="stationCodeInput()"> - <view class="item-right"> - <button></button> --> - <!-- <text style="text-align: right;color: #409EFF;" @click="selectMat()">鎻愬彇+</text> --> - <!-- <uni-icons type="right" color="#c1c1c1"></uni-icons> --> - <!-- </view> - </view> --> <view class="item"> <view class="code-decs">妤煎彿:</view> <uni-combox :candidates="floorList" placeholder="璇烽�夋嫨妤煎彿" v-model="floor" @input="getFloor"></uni-combox> </view> + <view class="item"> + <view class="code-decs">鏆傚瓨浣�:</view> + <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="stationCode" :focus="stationCodeFocus" + @input="stationCodeInput()"> + </view> </view> + <view class="mat-list-title"> - <view style="width: 200rpx;"></view> - <view style="-webkit-flex: 1;flex: 1;">鍟嗗搧鍒楄〃</view> - <view style="width: 200rpx;"><button size="mini" type="primary" @click="getChecked">鎻愬彇</button></view> + <view style="-webkit-flex: 1;flex: 1;">绔欑偣鍒楄〃</view> </view> <scroll-view> <view class="list" v-for="(item,i) in dataList" :key="i" :class="'bg-'+item.color"> @@ -118,6 +108,7 @@ token: '', barcode: '', stationCode: '', + stationCodeFocus: true, dataList: [], count: 0, rowNum: '', @@ -145,6 +136,52 @@ this.token = uni.getStorageSync('token'); }, methods: { + stationCodeInput() { + setTimeout(() => { + var len = this.stationCode.length + if (len != 15) { + this.stationCode = '' + this.stationCodeFocus = true + uni.showToast({ + title: '鏆傚瓨鐮佹湁璇閲嶈瘯', + icon: "none", + position: 'top' + }); + return; + } + this.pushDevNo() + this.stationCodeFocuss() + }, 200) + }, + pushDevNo() { + var devNo = {"devNo":this.stationCode} + if (this.dataList.length == 0) { + this.dataList.push(devNo) + return + } + var flag = false + for(var i = 0; i < this.dataList.length; i++ ) { + if (this.dataList[i].devNo == devNo.devNo) { + this.messageText = "绔欑偣閲嶅" + this.messageToggle('warn') + return + } else { + flag = true + } + } + if(flag) { + this.dataList.push(devNo) + } + + }, + stationCodeFocuss() { + let that = this; + this.stationCode = '' + that.stationCodeFocus = false; + setTimeout(() => { + that.stationCodeFocus = true; + }, 100); + }, getChecked() { var checkedList = [] for(var i = 0; i < this.dataList.length; i++) { @@ -161,6 +198,9 @@ }, getFloor() { let that = this + if (this.floor == '') { + return + } uni.request({ url: that.baseUrl + '/agvMobile/getBasDevp/auth', data: { @@ -174,20 +214,16 @@ res = res.data for(var i = 0; i < res.data.length; i++) { if (res.data[i].locSts === 'F') { - res.data[i]["color"] = "red" + // res.data[i]["color"] = "red" + that.dataList.push(res.data[i]) } } - that.dataList = res.data - console.log(that.dataList); } }); }, messageToggle(type) { this.msgType1 = type this.$refs.message.open() - }, - stationCodeInput() { - this.dataList.push(this.stationCode) }, // barcode input 浜嬩欢 barcodeInput() { @@ -388,10 +424,13 @@ this.$refs.combConfirm.close() }, comb() { + this.devNo = [] uni.vibrateShort(); let that = this; - for (var i = 0; i < that.dataList.length; i++) { - that.devNo.push(that.dataList[i].devNo) + for (var i = 0; i < this.dataList.length; i++) { + if (this.dataList[i].checked) { + this.devNo.push(this.dataList[i].devNo) + } } uni.request({ url: that.baseUrl + '/agvMobile/pakin/auth', @@ -408,9 +447,6 @@ that.resst(); that.messageText = "鍚姩鎴愬姛" that.messageToggle('success') - // const innerAudioContext = uni.createInnerAudioContext(); - // innerAudioContext.src = '/static/music/pakinOk.mp3'; - // innerAudioContext.play() } else if (res.code == 403) { that.messageText = res.msg that.messageToggle('error') @@ -468,7 +504,7 @@ color: #666666; } .list:first-child { - margin-top: 260rpx; + margin-top: 360rpx; } .aside { width: 100rpx; @@ -521,7 +557,7 @@ width: 100%; background-color: white; position: fixed; - margin-top: 100rpx; + margin-top: 200rpx; z-index: 9; /* border-top: 1px solid #DCDFE6; */ text-align: center; diff --git a/pages/mat/matSelected.vue b/pages/mat/matSelected.vue index 60560ac..a0d2b69 100644 --- a/pages/mat/matSelected.vue +++ b/pages/mat/matSelected.vue @@ -13,18 +13,18 @@ <view class="form-item-desc"><text>瑙勬牸</text></view> <view class="form-item-content"><text>{{mat.specs}}</text></view> </view> - <!-- <view class="form-item"> + <view class="form-item"> <view class="form-item-desc"><text>鎵瑰彿</text></view> <view class="form-item-content"> <view class="form-input"> <input type="text" v-model="mat.batch"> </view> </view> - </view> --> + </view> <view class="form-item"> <view class="form-item-desc"><text>鏁伴噺</text></view> <view class="form-item-content"> - <uni-number-box :value="mat.anfme" :max="99999999" :step='0.01' color="#747474" @change="changeValue" /> + <uni-number-box :value="mat.anfme" :max="99999999" :step='1' color="#747474" @change="changeValue" /> </view> </view> </view> diff --git a/pages/pakin/pakin.vue b/pages/pakin/pakin.vue index 21fd78a..6cfab75 100644 --- a/pages/pakin/pakin.vue +++ b/pages/pakin/pakin.vue @@ -237,9 +237,9 @@ }, }, }); - } else if (res.code == 403) { + } else if (result.code == 403) { uni.showToast({ - title: res.msg, + title: result.msg, icon: "none", position: 'top' }) @@ -250,7 +250,7 @@ }, 1000); } else { uni.showToast({ - title: res.msg, + title: result.msg, icon: "none", position: 'top' }) -- Gitblit v1.9.1