From 65c34e1efebee88a5e6630f33291e60e23a287c7 Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期五, 12 九月 2025 10:56:23 +0800
Subject: [PATCH] 1.新增agv组托和组托并呼叫空托盘 2.出库确认 3.空板回库或者拣料回库 4.agv点到点搬运 5.agv点到区搬运 6.agv区到点搬运
---
pages/AGV/AGVPakin.vue | 201 +++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 182 insertions(+), 19 deletions(-)
diff --git a/pages/AGV/AGVPakin.vue b/pages/AGV/AGVPakin.vue
index ba29273..184be19 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()">
@@ -15,6 +20,21 @@
<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"></uni-combox>
+ </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">
鍟嗗搧鍒楄〃
@@ -27,7 +47,7 @@
<view class="left-item">{{i + 1}}</view>
</view>
<view class="list-left-item">
- <view class="desc">缂栫爜锛�</view>
+ <view class="desc">鏂欏彿锛�</view>
<view class="left-item">
<uni-tag :text="item.matnr" type="primary"></uni-tag>
</view>
@@ -46,12 +66,12 @@
<uni-tag :text="item.batch" type="warning"></uni-tag>
</view>
</view>
- <view class="list-left-item">
+ <!-- <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> -->
<view class="list-left-item">
<view class="desc">鏁伴噺锛�</view>
<view class="left-item">{{item.anfme}}</view>
@@ -64,9 +84,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>
<!-- 寮圭獥 -->
<!-- 淇敼鏁伴噺 -->
@@ -76,20 +97,20 @@
<!-- 鏍囬 -->
<view class="title">淇敼</view>
<view class="popup-item">
- <view class="popup-item-left">缂栫爜:</view>
+ <view class="popup-item-left">鏂欏彿:</view>
<view class="popup-item-right">
<input type="text" v-model="matnr" disabled="true"
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>
+ <!-- <view class="popup-item">
<view class="popup-item-left">閲嶉噺:</view>
<view class="popup-item-right"><input type="text" v-model="weight"></view>
- </view>
+ </view> -->
<view class="popup-item">
<view class="popup-item-left">鏁伴噺:</view>
<view class="popup-item-right" style="border: none;justify-content: center;">
@@ -124,6 +145,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 +169,7 @@
baseUrl: '',
token: '',
barcode: '',
+ rsta: '',
dataList: [],
count: 0,
rowNum: '',
@@ -154,8 +183,15 @@
content: '',
barcodeFocus: true,
matFocus: false,
+ rstaFocus: false,
matData: '',
removeNum: 0,
+ ck1: true,
+ ck2: false,
+ fullPlt: '1',
+ ck : '',
+ floorList: [],
+ floor: '',
}
},
onLoad() {
@@ -164,13 +200,59 @@
onShow() {
this.baseUrl = uni.getStorageSync('baseUrl');
this.token = uni.getStorageSync('token');
+ this.getSite();
},
methods: {
+ // 澶у皬鎵樼洏
+ isFullPlt() {
+ var temp = this.ck1
+ this.ck1 = this.ck2
+ this.ck2 = temp
+ if (this.ck1) {
+ this.fullPlt = '1'
+ } else {
+ this.fullPlt = '2'
+ }
+ },
+ //鑾峰彇浠撳簱
+ getSite() {
+ let that = this
+ uni.request({
+ url: that.baseUrl + '/mobile/ck',
+ header: { 'token': uni.getStorageSync('token') },
+ method: 'POST',
+ success(res) {
+ res = res.data
+ console.log(res)
+ if (res.code === 200) {
+ that.floorList = res.data
+ } 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')
+ }
+ }
+ })
+ },
messageToggle(type) {
this.msgType1 = type
this.$refs.message.open()
},
// barcode input 浜嬩欢
+ rstaInput() {
+ // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
+ setTimeout(() => {
+ var len = this.rsta.length
+ this.barcodeFocuss()
+ }, 200)
+ },
barcodeInput() {
// 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
setTimeout(() => {
@@ -205,7 +287,7 @@
}, 100);
},
// 鎼滅储鐗╂枡
- findMat() {
+ findMat() {
let that = this
uni.request({
url: that.baseUrl + '/mat/auth',
@@ -226,8 +308,10 @@
// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
success: function(res) {
res.eventChannel.emit('mat', {
+
data: result.data
})
+ console.log(res);
},
// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
events: {
@@ -301,12 +385,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) {
@@ -365,10 +450,81 @@
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 === '') {
+ this.messageText = "璇锋壂鎻忔墭鐩樻潯鐮�"
+ this.messageToggle('error')
+ return;
+ }
+ if (that.dataList.length === 0) {
+ this.messageText = "璇锋坊鍔犲晢鍝佸垪琛�"
+ this.messageToggle('error')
+ return;
+ }
+ if(that.floor===''){
+ 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: '0',
+ rsta: that.rsta,
+ barcode: that.barcode,
+ combMats: that.dataList,
+ ck : that.floor,
+ }),
+ 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 === '') {
@@ -389,8 +545,11 @@
}
}
uni.request({
- url: that.baseUrl + '/agvMobile/comb/auth',
+ url: that.baseUrl + '/mobile/comb/auth',
data: JSON.stringify({
+ beBatch : 1,
+ barcodeSize : this.fullPlt,
+ rsta: that.rsta,
barcode: that.barcode,
combMats: that.dataList
}),
@@ -431,6 +590,7 @@
// 纭閲嶇疆
resetConfirm() {
this.dataList = []
+ this.barcode = ''
this.messageText = "閲嶇疆瀹屾垚"
this.messageToggle('success')
},
@@ -451,6 +611,9 @@
<style>
@import url('../../static/css/wms.css/wms.css');
+ .list:first-child {
+ margin-top: 460rpx;
+ }
.code {
width: 100%;
position: fixed;
@@ -494,7 +657,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