From bb78eba9be59bc1c5dee027161b97bf6a7a021af Mon Sep 17 00:00:00 2001 From: zwl <1051256694@qq.com> Date: 星期三, 03 九月 2025 09:42:05 +0800 Subject: [PATCH] 1.新增agv组托入库和组托并补空托盘 2.新增agv搬运任务 3.新增agv补空托盘功能 --- pages/home/home.vue | 21 +++- pages/mat/matSelected.vue | 6 pages/pakin/pakin.vue | 6 pages/AGV/AGVPakin.vue | 148 ++++++++++++++++++++++++++++++------ 4 files changed, 142 insertions(+), 39 deletions(-) diff --git a/pages/AGV/AGVPakin.vue b/pages/AGV/AGVPakin.vue index 6f92ee6..67c80d9 100644 --- a/pages/AGV/AGVPakin.vue +++ b/pages/AGV/AGVPakin.vue @@ -2,9 +2,9 @@ <view> <view class="code"> <view class="item"> - <view class="code-decs">璁㈠崟鍙�:</view> - <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="orderNo" :focus="orderNoFocus" - @input="orderNoInput()"> + <view class="code-decs">绔欑偣鍙�:</view> + <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="rsta" :focus="rstaFocus" + @input="rstaInput()"> </view> <view class="item"> <view class="code-decs">鎵樼洏鐮�:</view> @@ -19,6 +19,17 @@ <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" style="width: 25vw;">澶у皬鎵樼洏:</view> + <radio-group @change="isFullPlt"> + <label> + <radio :checked="ck1" style="transform: scale(0.7)"/><text>灏忔墭鐩�</text> + </label> + <label> + <radio :checked="ck2" style="margin-left: 50rpx;transform: scale(0.7);"/><text>澶ф墭鐩�</text> + </label> + </radio-group> </view> </view> <view class="mat-list-title"> @@ -69,9 +80,10 @@ </view> </scroll-view> <!-- 搴曢儴鎿嶄綔鎸夐挳 --> - <view class="buttom"> - <button size="mini" @click="reset('warn')">閲嶇疆</button> + <view class="buttom">銆� <button size="mini" type="primary" @click="combConfirm('warn')">缁勬墭</button> + <button size="mini" @click="reset('warn')">閲嶇疆</button> + <button size="mini" type="primary" @click="combConfirmAndFillEmptyPallets('warn')">缁勬墭骞惰ˉ绌烘墭鐩�</button> </view> <!-- 寮圭獥 --> <!-- 淇敼鏁伴噺 --> @@ -129,6 +141,13 @@ @confirm="comb" @close="combClose"></uni-popup-dialog> </uni-popup> </view> + <view> + <uni-popup ref="combConfirmAndFillEmptyPallets" type="dialog"> + <uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content" + @confirm="combAndFillEmptyPallets" @close="combClose"></uni-popup-dialog> + </uni-popup> + </view> + <!-- 纭閲嶇疆 --> <view> <uni-popup ref="resetConfirm" type="dialog"> @@ -146,7 +165,7 @@ baseUrl: '', token: '', barcode: '', - orderNo: '', + rsta: '', dataList: [], count: 0, rowNum: '', @@ -160,9 +179,12 @@ content: '', barcodeFocus: true, matFocus: false, - orderNoFocus: false, + rstaFocus: false, matData: '', removeNum: 0, + ck1: true, + ck2: false, + fullPlt: '1' } }, onLoad() { @@ -173,15 +195,26 @@ this.token = uni.getStorageSync('token'); }, methods: { + // 澶у皬鎵樼洏 + isFullPlt() { + var temp = this.ck1 + this.ck1 = this.ck2 + this.ck2 = temp + if (this.ck1) { + this.fullPlt = '1' + } else { + this.fullPlt = '2' + } + }, messageToggle(type) { this.msgType1 = type this.$refs.message.open() }, // barcode input 浜嬩欢 - orderNoInput() { + rstaInput() { // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏� setTimeout(() => { - var len = this.orderNo.length + var len = this.rsta.length this.barcodeFocuss() }, 200) }, @@ -189,7 +222,7 @@ // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏� setTimeout(() => { var len = this.barcode.length - if (len != 10) { + if (len != 8) { uni.showToast({ title: '鎵樼洏鐮佹湁璇閲嶈瘯', icon: "none", @@ -219,15 +252,8 @@ }, 100); }, // 鎼滅储鐗╂枡 - findMat() { + findMat() { let that = this - // 鍒ゆ柇鐗╂枡闀垮害鏄惁涓�1 - if (that.dataList.length >= 1) { - this.messageText = "鍙兘娣诲姞涓�绉嶇墿鏂�" - this.messageToggle('warn') - that.matnr = '' - return - } uni.request({ url: that.baseUrl + '/mat/auth', data: { @@ -247,8 +273,10 @@ // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� success: function(res) { res.eventChannel.emit('mat', { + data: result.data }) + console.log(res); }, // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� events: { @@ -322,12 +350,13 @@ add = true } - } else { - // 鐩稿悓鐗╂枡鐩稿悓鎵瑰彿 鏁伴噺绱姞 - this.dataList[i].anfme += mat.anfme - this.$forceUpdate() // 寮哄埗鍒锋柊 - add = false - } + } + // else { + // // 鐩稿悓鐗╂枡鐩稿悓鎵瑰彿 鏁伴噺绱姞 + // this.dataList[i].anfme += mat.anfme + // this.$forceUpdate() // 寮哄埗鍒锋柊 + // add = false + // } } } if (add) { @@ -386,10 +415,17 @@ this.content = '鏄惁鐜板湪缁勬墭!' this.$refs.combConfirm.open() }, + combConfirmAndFillEmptyPallets(type) { + this.msgType = type + this.title = '璀﹀憡' + this.content = '鏄惁鐜板湪缁勬墭骞惰ˉ绌烘澘!' + this.$refs.combConfirmAndFillEmptyPallets.open() + }, combClose() { this.$refs.combConfirm.close() }, comb() { + console.log("鏅�氱粍鎵�") uni.vibrateShort(); let that = this; if (that.barcode === '') { @@ -410,9 +446,69 @@ } } uni.request({ - url: that.baseUrl + '/agvMobile/comb/auth', + url: that.baseUrl + '/mobile/comb/auth', data: JSON.stringify({ - orderNo: that.orderNo, + beBatch : 1, + barcodeSize: '0', + rsta: that.rsta, + barcode: that.barcode, + combMats: that.dataList + }), + method: 'POST', + header: { + 'token': uni.getStorageSync('token') + }, + success(result) { + var res = result.data + if (res.code === 200) { + 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); + } else { + that.messageText = res.msg + that.messageToggle('error') + } + } + }); + }, + //缁勬墭骞惰ˉ绌烘墭鐩� + combAndFillEmptyPallets() { + uni.vibrateShort(); + let that = this; + if (that.barcode === '') { + this.messageText = "璇锋壂鎻忔墭鐩樻潯鐮�" + this.messageToggle('error') + return; + } + if (that.dataList.length === 0) { + this.messageText = "璇锋坊鍔犲晢鍝佸垪琛�" + this.messageToggle('error') + return; + } + for (var i = 0; i < that.dataList.length; i++) { + if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') { + this.messageText = that.dataList[i].matnr + '缁勬墭鏁伴噺涓嶈兘涓�0' + this.messageToggle('error') + return; + } + } + uni.request({ + url: that.baseUrl + '/mobile/comb/auth', + data: JSON.stringify({ + beBatch : 1, + barcodeSize : this.fullPlt, + rsta: that.rsta, barcode: that.barcode, combMats: that.dataList }), diff --git a/pages/home/home.vue b/pages/home/home.vue index 10f0a94..74054dc 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -31,6 +31,13 @@ cuIcon: 'pullup', url: '/pakin/pakin' }, + { + title: 'AGV缁勬墭鍏ュ簱', + name: 'AGVPakin', + color: 'cyan', + cuIcon: 'pullup', + url: '/AGV/AGVPakin' + }, // { // title: '鍐嶆鎷f枡', // name: 'changePallet', @@ -38,13 +45,13 @@ // cuIcon: 'order', // url: '/pakin/pickAgain' // }, - { - title: '璁㈠崟鍏ュ簱', - name: 'orderPakin', - color: 'red', - cuIcon: 'pullup', - url: '/order/orderPakin' - }, + // { + // title: '璁㈠崟鍏ュ簱', + // name: 'orderPakin', + // color: 'red', + // cuIcon: 'pullup', + // url: '/order/orderPakin' + // }, { title: 'AGV绉诲姩浠诲姟', name: 'AGVStart', diff --git a/pages/mat/matSelected.vue b/pages/mat/matSelected.vue index 7947d04..1a0cb71 100644 --- a/pages/mat/matSelected.vue +++ b/pages/mat/matSelected.vue @@ -14,7 +14,7 @@ <view class="form-item-content"><text>{{mat.specs}}</text></view> </view> <view class="form-item"> - <view class="form-item-desc"><text>鎯呭喌璇存槑</text></view> + <view class="form-item-desc"><text>鎵瑰彿</text></view> <view class="form-item-content"> <view class="form-input"> <input type="text" v-model="mat.batch"> @@ -62,9 +62,10 @@ // 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� eventChannel.on('mat', function(data) { - console.log(data.data); + data.data['anfme'] = 1 that.mat = data.data + log.console(data.data) if (data.data.maxNum > 0) { that.mat.anfme = data.data.maxNum that.max = data.data.maxNum @@ -89,7 +90,6 @@ this.mat.anfme = value }, back() { - console.log(this.mat); if (this.mat.anfme === 0) { uni.showToast({title: '璇疯緭鍏ユ暟閲�', icon: "none", position: 'top'}); return; diff --git a/pages/pakin/pakin.vue b/pages/pakin/pakin.vue index 2eb054b..25b3330 100644 --- a/pages/pakin/pakin.vue +++ b/pages/pakin/pakin.vue @@ -2,7 +2,7 @@ <view> <view class="code"> <view class="item"> - <view class="code-decs">绔欑偣鐮�:</view> + <view class="code-decs">鎵樼洏鐮�:</view> <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus" @input="barcodeInput()"> </view> @@ -41,7 +41,7 @@ <view class="left-item">{{item.specs}}</view> </view> <view class="list-left-item"> - <view class="desc" style="width: 38%;">鎯呭喌璇存槑锛�</view> + <view class="desc" style="width: 38%;">鎵瑰彿锛�</view> <view class="left-item"> <uni-tag :text="item.batch" type="warning"></uni-tag> </view> @@ -176,7 +176,7 @@ // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏� setTimeout(() => { var len = this.barcode.length - if (len != 3) { + if (len != 8) { uni.showToast({ title: '鎵樼洏鐮佹湁璇閲嶈瘯', icon: "none", -- Gitblit v1.9.1