From c4717434cb864536b0f40aa97005af04fa50b49b Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期五, 17 十月 2025 09:08:37 +0800
Subject: [PATCH] 12
---
pages/AGV/AGVStart.vue | 160 ++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 121 insertions(+), 39 deletions(-)
diff --git a/pages/AGV/AGVStart.vue b/pages/AGV/AGVStart.vue
index 976d6fe..a6a57ae 100644
--- a/pages/AGV/AGVStart.vue
+++ b/pages/AGV/AGVStart.vue
@@ -1,28 +1,26 @@
<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="code">
<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 class="code-decs">婧愮珯鐐�:</view>
+ <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="stationCode" :focus="stationCodeFocus">
+ </view>
+ <view class="item">
+ <view class="code-decs">鐩爣绔�:</view>
+ <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="sta" :focus="stationCodeFocus">
</view>
</view>
+
<view class="mat-list-title">
- 绔欑偣鍒楄〃
+ <view style="-webkit-flex: 1;flex: 1;"></view>
</view>
<scroll-view>
- <view class="list" v-for="(item,i) in dataList" :key="i">
+ <view class="list" v-for="(item,i) in dataList" :key="i" :class="'bg-'+item.color">
+ <view class="aside">
+ <checkbox :value="item.matnr" :checked="item.checked" @click="set(i)"/>
+ </view>
<view class="list-left" style="display: flex;justify-content: center;">
- {{item}}
+ {{item.devNo}}
</view>
<view class="list-right">
<!-- <uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons> -->
@@ -109,6 +107,7 @@
token: '',
barcode: '',
stationCode: '',
+ stationCodeFocus: true,
dataList: [],
count: 0,
rowNum: '',
@@ -124,6 +123,11 @@
matFocus: false,
matData: '',
removeNum: 0,
+ floorList: [1,3],
+ floor: "",
+ devNo: [],
+ staList:[],
+ sta:'',
}
},
onLoad() {
@@ -133,12 +137,77 @@
this.token = uni.getStorageSync('token');
},
methods: {
+ 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++) {
+ var t = !this.dataList[i].checked
+ if (this.dataList[i].checked) {
+ checkedList.push(this.dataList[i])
+ }
+ }
+ this.dataList = checkedList
+ },
+ set(e) {
+ var ck = this.dataList[e].checked
+ this.dataList[e].checked = ck ? false:true
+ },
+ getFloor() {
+ let that = this
+ if (this.floor == '') {
+ return
+ }
+ uni.request({
+ url: that.baseUrl + '/agvMobile/getBasDevp/auth',
+ data: {
+ floor: that.floor
+ },
+ header: {
+ 'token': uni.getStorageSync('token')
+ },
+ method: 'POST',
+ success(res) {
+ res = res.data
+ for(var i = 0; i < res.data.length; i++) {
+ if (res.data[i].locSts === 'F') {
+ // res.data[i]["color"] = "red"
+ that.dataList.push(res.data[i])
+ }
+ }
+ }
+ });
+ },
messageToggle(type) {
this.msgType1 = type
this.$refs.message.open()
- },
- stationCodeInput() {
- this.dataList.push(this.stationCode)
},
// barcode input 浜嬩欢
barcodeInput() {
@@ -338,34 +407,26 @@
combClose() {
this.$refs.combConfirm.close()
},
- comb() {
- uni.vibrateShort();
+ comb() {
let that = this;
- if (that.barcode === '') {
- this.messageText = "璇锋壂鎻忔墭鐩樻潯鐮�"
+ if (that.stationCode === '') {
+ this.messageText = "璇锋壂鎻忔殏瀛樹綅鏉$爜"
this.messageToggle('error')
return;
}
+ let newSta = that.sta.split("-")
+
uni.request({
- url: that.baseUrl + '/mobile/combBinging/auth',
- data: JSON.stringify({
- barcode: that.barcode,
- stationCode: that.stationCode
- }),
- method: 'POST',
+ url: that.baseUrl + '/mobile/SITESITEAGVMove?sourceStaNo='+that.stationCode+'&staNo='+newSta[0],
header: {
'token': uni.getStorageSync('token')
},
success(result) {
- console.log(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')
@@ -391,6 +452,7 @@
resetConfirm() {
this.dataList = []
this.stationCode = ''
+ this.floor = ''
this.messageText = "閲嶇疆瀹屾垚"
this.messageToggle('success')
},
@@ -400,9 +462,10 @@
},
// 娓呯┖
resst() {
- this.dataList = []
- this.barcode = ''
+ this.staList = []
+ this.sta = ''
this.stationCode = ''
+ this.floor = ''
this.barcodeFocuss()
},
}
@@ -412,6 +475,24 @@
<style>
@import url('../../static/css/wms.css/wms.css');
+ .bg-red {
+ background-color: #e54d42;
+ color: #ffffff;
+ }
+ .bg-white {
+ background-color: #ffffff;
+ color: #666666;
+ }
+ .list:first-child {
+ margin-top: 360rpx;
+ }
+ .aside {
+ width: 100rpx;
+ /* background-color: #303133; */
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
.code {
width: 100%;
position: fixed;
@@ -450,12 +531,13 @@
}
.mat-list-title {
- height: 80rpx;
- line-height: 80rpx;
+ display: flex;
+ align-items: center;
+ height: 30rpx;
width: 100%;
background-color: white;
position: fixed;
- margin-top: 100rpx;
+ margin-top: 200rpx;
z-index: 9;
/* border-top: 1px solid #DCDFE6; */
text-align: center;
--
Gitblit v1.9.1