From ad4d41f60d4a44e945c8e55d66bfe23ee8c668f6 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期四, 16 五月 2024 11:10:12 +0800
Subject: [PATCH] Merge branch 'phyzasrs' of http://47.97.1.152:5880/r/wms_app into phyzasrs
---
pages/tzsk/AGV/AGVPick.vue | 371 +++++++++++++++++++++++++++-------------------------
1 files changed, 195 insertions(+), 176 deletions(-)
diff --git a/pages/tzsk/AGV/AGVPick.vue b/pages/tzsk/AGV/AGVPick.vue
index b21a541..aa51314 100644
--- a/pages/tzsk/AGV/AGVPick.vue
+++ b/pages/tzsk/AGV/AGVPick.vue
@@ -2,31 +2,80 @@
<view>
<view class="code">
<view class="item">
- <view class="code-decs">妤煎彿:</view>
- <uni-combox :candidates="floorList" placeholder="璇烽�夋嫨妤煎彿" v-model="floor" @input="getFloor"></uni-combox>
+ <view class="code-decs">閲囪喘鍗曞彿:</view>
+ <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="orderNo" :focus="orderNoFocus"
+ @input="findOrder()">
</view>
<view class="item">
- <view class="code-decs">鏆傚瓨浣�:</view>
- <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="stationCode" :focus="stationCodeFocus"
- @input="stationCodeInput()">
+ <view class="code-decs">鏂欑鐮�:</view>
+ <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus"
+ @input="barcodeInput()">
</view>
</view>
-
<view class="mat-list-title">
- <view style="-webkit-flex: 1;flex: 1;"></view>
- <view style="-webkit-flex: 1;flex: 1;">绔欑偣鍒楄〃</view>
- <view style="-webkit-flex: 1;flex: 1;"><button size="mini" @click="selectAll()">{{btnText}}</button></view>
+ 鍟嗗搧鍒楄〃
</view>
<scroll-view>
- <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.devNo}}
+ <view class="list" v-for="(item,i) in dataList" :key="i">
+ <view class="list-left">
+ <view class="list-left-item">
+ <view class="desc">No锛�</view>
+ <view class="left-item">{{i + 1}}</view>
+ </view>
+ <!-- <view class="list-left-item">
+ <view class="desc">绠辩爜锛�</view>
+ <view class="left-item">
+ <input type="text" v-model="item.containerCode">
+ <uni-tag :text="item.containerCode" type="primary"></uni-tag>
+ </view>
+ </view> -->
+ <view class="list-left-item">
+ <view class="desc">閿�鍞崟鍙凤細</view>
+ <view class="left-item">
+ <input type="text" v-model="item.csocode">
+ <!-- <uni-tag :text="item.containerCode" type="primary"></uni-tag> -->
+ </view>
+ </view>
+ <view class="list-left-item">
+ <view class="desc">璁㈠崟琛屽彿锛�</view>
+ <view class="left-item">
+ <input type="text" v-model="item.isoseq">
+ <!-- <uni-tag :text="item.containerCode" type="primary"></uni-tag> -->
+ </view>
+ </view>
+ <view class="list-left-item">
+ <view class="desc">鏂欏彿锛�</view>
+ <view class="left-item">
+ <uni-tag :text="item.matnr" type="primary"></uni-tag>
+ </view>
+ </view>
+ <view class="list-left-item">
+ <view class="desc">鍝佸悕锛�</view>
+ <view class="left-item">{{item.maktx}}</view>
+ </view>
+ <view class="list-left-item">
+ <view class="desc">瑙勬牸锛�</view>
+ <view class="left-item">{{item.specs}}</view>
+ </view>
+ <view class="list-left-item">
+ <view class="desc">鎵瑰彿锛�</view>
+ <view class="left-item">
+ <uni-tag :text="item.batch" type="warning"></uni-tag>
+ </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>
</view>
<view class="list-right">
- <!-- <uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons> -->
+ <uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons>
<uni-icons type="trash" color="#f58a8a" size="24" @click="remove(item,i,'warn')"></uni-icons>
</view>
</view>
@@ -34,8 +83,7 @@
<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
<view class="buttom">
<button size="mini" @click="reset('warn')">閲嶇疆</button>
- <button size="mini" type="primary" @click="containerMove()">瀹瑰櫒绂诲満</button>
- <button size="mini" type="primary" @click="containerPick()">鐩樼偣 / 鎷h揣</button>
+ <button size="mini" type="primary" @click="combConfirm('warn')">缁勬墭</button>
</view>
<!-- 寮圭獥 -->
<!-- 淇敼鏁伴噺 -->
@@ -45,20 +93,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;">
@@ -86,7 +134,7 @@
<uni-popup-message :type="msgType1" :message="messageText" :duration="2000"></uni-popup-message>
</uni-popup>
</view>
- <!-- 纭鍚姩 -->
+ <!-- 纭缁勬墭 -->
<view>
<uni-popup ref="combConfirm" type="dialog">
<uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content"
@@ -114,12 +162,8 @@
baseUrl: '',
token: '',
barcode: '',
- stationCode: '',
- stationCodeFocus: true,
- dataList: [
- // {matnr:'12321321',devNo:'rk123123',color:'red'},
- // {matnr:'12321321',devNo:'rk123123',color:'white'},
- ],
+ orderNo: '',
+ dataList: [],
count: 0,
rowNum: '',
matnr: '',
@@ -130,14 +174,12 @@
messageText: '',
title: '',
content: '',
- barcodeFocus: true,
+ orderNoFocus: true,
+ barcodeFocus: false,
matFocus: false,
matData: '',
removeNum: 0,
- floorList: [1,3],
- floor: "",
- devNo: [],
- btnText: '鍏ㄩ��',
+ tempOrderInfo: {csocode: '',isoseq: ''},
hide: true,
hidebg: 'kb-bgtr'
}
@@ -169,119 +211,80 @@
this.hidebg = 'kb-bgfa'
}
},
- 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++) {
- var t = !this.dataList[i].checked
- if (this.dataList[i].checked) {
- checkedList.push(this.dataList[i])
- }
- }
- this.dataList = checkedList
- },
- set(i) {
- var ck = this.dataList[i].checked
- this.dataList[i].checked = ck ? false:true
-
- },
- selectAll() {
- if (this.btnText == '鍏ㄩ��') {
- for (let i in this.dataList) {
- this.$set(this.dataList[i],'checked',true)
- this.btnText = '鍙栨秷'
- }
- } else {
- for (let i in this.dataList) {
- var ck = this.dataList[i].checked
- this.dataList[i].checked = false
- this.btnText = '鍏ㄩ��'
- }
- }
-
- },
- getFloor() {
+ // 鏍规嵁璁㈠崟鍙疯繑鍥炲晢鍝佽鎯�
+ findOrder() {
let that = this
- if (this.floor == '') {
- return
- }
+ that.tempOrderInfo.csocode = ''
+ that.tempOrderInfo.isoseq = ''
uni.request({
- url: that.baseUrl + '/agvMobile/getBasDevp/auth',
+ url: that.baseUrl + '/mobile/order/search/orderNo/auth',
+ header: {'token': uni.getStorageSync('token')},
data: {
- floor: that.floor
+ orderNo: that.orderNo
},
- 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])
+ console.log(res);
+ if (res.code === 200) {
+ if(res.data && res.data[0].combMats) {
+ for (let i = 0; i < res.data[0].combMats.length; i++) {
+ that.checkMat(res.data[0].combMats[i])
+ }
+ that.orderNoFocus = false
+ setTimeout(() => {
+ that.barcodeFocus = true
+ }, 10);
+ } else {
+ // uni.showToast({
+ // title: that.orderNo + '璇锋鏌ヨ鍗曞彿鏄惁姝g‘',
+ // icon: "none",
+ // position: 'top'
+ // })
}
+ } else if (res.code == 403) {
+ uni.showToast({
+ title: res.msg,
+ icon: "none",
+ position: 'top'
+ })
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '../login/login'
+ });
+ }, 1000);
+ } else {
+ uni.showToast({
+ title: res.msg,
+ icon: "none",
+ position: 'top'
+ })
}
}
- });
+ })
},
messageToggle(type) {
this.msgType1 = type
this.$refs.message.open()
},
// barcode input 浜嬩欢
- barcodeInput() {
+ orderNoInput() {
// 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
setTimeout(() => {
- var len = this.barcode.length
- if (len != 8) {
+ var len = this.orderNo.length
+ this.barcodeFocuss()
+ }, 200)
+ },
+ barcodeInput() {
+ // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
+ if (this.barcode.split('_')[1]) {
+ this.barcode = this.barcode.split('_')[1]
+ }
+ // this.barcode = this.barcode.split('_')[1]
+ setTimeout(() => {
+ let len = this.barcode.length
+ if (len != 10) {
uni.showToast({
- title: '鎵樼洏鐮佹湁璇閲嶈瘯',
+ title: '鏂欑鐮佹湁璇閲嶈瘯',
icon: "none",
position: 'top'
});
@@ -311,14 +314,17 @@
// 鎼滅储鐗╂枡
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: {
- matnr: that.matnr
- },
- header: {
- 'token': uni.getStorageSync('token')
- },
+ data: { matnr: that.matnr },
+ header: { 'token': uni.getStorageSync('token') },
success(result) {
result = result.data
if (result.code === 200 && result.data) {
@@ -326,16 +332,19 @@
that.matnr = ''
that.matData['batch'] = ''
uni.navigateTo({
- url: "../mat/matSelected",
+ url: "../../mat/matSelected",
// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
success: function(res) {
res.eventChannel.emit('mat', {
- data: result.data
+ data: result.data,
+ // tempOrderInfo: that.tempOrderInfo
})
},
// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
events: {
matList: function(data) {
+ data.data['csocode'] = ''
+ data.data['isoseq'] = ''
that.checkMat(data.data)
that.focuss()
},
@@ -367,7 +376,7 @@
selectMat() {
let that = this
uni.navigateTo({
- url: "../mat/matQuery",
+ url: "../../mat/matQuery",
success: function(res) {
// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� 鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
res.eventChannel.emit('commonUrl', {
@@ -466,25 +475,47 @@
combConfirm(type) {
this.msgType = type
this.title = '璀﹀憡'
- this.content = '鏄惁鐜板湪鍚姩!'
+ this.content = '鏄惁鐜板湪缁勬墭!'
this.$refs.combConfirm.open()
},
combClose() {
this.$refs.combConfirm.close()
},
comb() {
- this.devNo = []
uni.vibrateShort();
let that = this;
- for (var i = 0; i < this.dataList.length; i++) {
- if (this.dataList[i].checked) {
- this.devNo.push(this.dataList[i].devNo)
+ if (that.barcode === '') {
+ this.messageText = "璇锋壂鎻忔墭鐩樻潯鐮�"
+ this.messageToggle('error')
+ return;
+ }
+ if (that.dataList.length === 0) {
+ this.messageText = "璇锋坊鍔犲晢鍝佸垪琛�"
+ this.messageToggle('error')
+ return;
+ }
+ // if (that.dataList.length > 1) {
+ // 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;
}
}
+ console.log(that.dataList);
+ console.log(that.barcode);
+ console.log(that.orderNo);
+ // return
uni.request({
- url: that.baseUrl + '/agvMobile/pakin/auth',
+ url: that.baseUrl + '/agvMobile/comb/auth',
data: JSON.stringify({
- devNo: that.devNo
+ orderNo: that.orderNo,
+ barcode: that.barcode,
+ combMats: that.dataList
}),
method: 'POST',
header: {
@@ -493,9 +524,15 @@
success(result) {
var res = result.data
if (res.code === 200) {
- that.resst();
- that.messageText = "鍚姩鎴愬姛"
+ that.dataList = []
+ that.findOrder()
+ // that.resst();
+ that.barcode = ''
+ 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')
@@ -520,8 +557,8 @@
// 纭閲嶇疆
resetConfirm() {
this.dataList = []
- this.stationCode = ''
- this.floor = ''
+ this.barcode = ''
+ this.orderNo = ''
this.messageText = "閲嶇疆瀹屾垚"
this.messageToggle('success')
},
@@ -533,8 +570,7 @@
resst() {
this.dataList = []
this.barcode = ''
- this.stationCode = ''
- this.floor = ''
+ this.orderNo = ''
this.barcodeFocuss()
},
}
@@ -555,29 +591,14 @@
.kb-bgfa {
background-color: #00aeec;
}
-
- .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;
+ margin-top: 340rpx;
}
.code {
width: 100%;
position: fixed;
- min-height: 100rpx;
+ min-height: 140rpx;
background-color: #FFF;
z-index: 10;
}
@@ -585,7 +606,7 @@
.item {
display: flex;
align-items: center;
- height: 100rpx;
+ height: 70rpx;
margin-left: 20rpx;
border-bottom: 1px solid #DCDFE6;
}
@@ -601,7 +622,6 @@
}
.code-decs {
- width: 20vw;
font-size: 18px;
color: #303133;
}
@@ -612,16 +632,15 @@
}
.mat-list-title {
- display: flex;
- align-items: center;
height: 80rpx;
+ line-height: 80rpx;
width: 100%;
background-color: white;
position: fixed;
- margin-top: 200rpx;
+ margin-top: 140rpx;
z-index: 9;
/* border-top: 1px solid #DCDFE6; */
text-align: center;
- box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.5);
+ box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.5);
}
</style>
--
Gitblit v1.9.1