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/AGV/AGVPakin.vue | 151 +++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 131 insertions(+), 20 deletions(-)
diff --git a/pages/AGV/AGVPakin.vue b/pages/AGV/AGVPakin.vue
index 1073456..67c80d9 100644
--- a/pages/AGV/AGVPakin.vue
+++ b/pages/AGV/AGVPakin.vue
@@ -2,6 +2,11 @@
<view>
<view class="code">
<view class="item">
+ <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>
<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus"
@input="barcodeInput()">
@@ -14,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">
@@ -64,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>
<!-- 寮圭獥 -->
<!-- 淇敼鏁伴噺 -->
@@ -124,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">
@@ -141,6 +165,7 @@
baseUrl: '',
token: '',
barcode: '',
+ rsta: '',
dataList: [],
count: 0,
rowNum: '',
@@ -154,8 +179,12 @@
content: '',
barcodeFocus: true,
matFocus: false,
+ rstaFocus: false,
matData: '',
removeNum: 0,
+ ck1: true,
+ ck2: false,
+ fullPlt: '1'
}
},
onLoad() {
@@ -166,16 +195,34 @@
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 浜嬩欢
+ rstaInput() {
+ // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
+ setTimeout(() => {
+ var len = this.rsta.length
+ this.barcodeFocuss()
+ }, 200)
+ },
barcodeInput() {
// 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
setTimeout(() => {
var len = this.barcode.length
- if (len != 10) {
+ if (len != 8) {
uni.showToast({
title: '鎵樼洏鐮佹湁璇閲嶈瘯',
icon: "none",
@@ -205,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: {
@@ -233,8 +273,10 @@
// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
success: function(res) {
res.eventChannel.emit('mat', {
+
data: result.data
})
+ console.log(res);
},
// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
events: {
@@ -308,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) {
@@ -372,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 === '') {
@@ -396,8 +446,69 @@
}
}
uni.request({
- url: that.baseUrl + '/agvMobile/comb/auth',
+ url: that.baseUrl + '/mobile/comb/auth',
data: JSON.stringify({
+ 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
}),
@@ -460,7 +571,7 @@
@import url('../../static/css/wms.css/wms.css');
.list:first-child {
- margin-top: 360rpx;
+ margin-top: 460rpx;
}
.code {
width: 100%;
@@ -505,7 +616,7 @@
width: 100%;
background-color: white;
position: fixed;
- margin-top: 200rpx;
+ margin-top: 300rpx;
z-index: 9;
/* border-top: 1px solid #DCDFE6; */
text-align: center;
--
Gitblit v1.9.1