From 108f0553f4e3d3fe1faca4b10857fb37d7b0e533 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期二, 19 三月 2024 09:07:57 +0800 Subject: [PATCH] # --- pages/tzsk/AGV/orderList.vue | 106 ++++++++++ pages/tzsk/AGV/AGVPick.vue | 456 +++++++++++++++++++-------------------------- pages.json | 8 3 files changed, 309 insertions(+), 261 deletions(-) diff --git a/pages.json b/pages.json index 9a8f29d..98edef3 100644 --- a/pages.json +++ b/pages.json @@ -410,6 +410,14 @@ "navigationBarTitleText" : "AGV缁勬墭", "enablePullDownRefresh" : false } + }, + { + "path" : "pages/tzsk/AGV/orderList", + "style" : + { + "navigationBarTitleText" : "璁㈠崟鍒楄〃", + "enablePullDownRefresh" : false + } } diff --git a/pages/tzsk/AGV/AGVPick.vue b/pages/tzsk/AGV/AGVPick.vue index 437f835..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' } @@ -161,91 +203,6 @@ this.token = uni.getStorageSync('token'); }, methods: { - containerPick() { - let _this = this - for (var i = 0; i < this.dataList.length; i++) { - if (this.dataList[i].checked) { - this.devNo.push(this.dataList[i].devNo) - } - } - uni.request({ - url: _this.baseUrl + '/agv/basDevp/visualized/container/pickIn', - header: {'token': uni.getStorageSync('token')}, - data: JSON.stringify({devNo: _this.devNo}), - method: 'POST', - success(res) { - res = res.data - console.log(res); - if (res.code === 200) { - _this.pickCode = '' - _this.dataList = [] - _this.devNo = [] - _this.messageText = "鐩樼偣 / 鎷h揣鎴愬姛" - _this.messageToggle('success') - } 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' - }) - } - } - }) - }, - // 瀹瑰櫒绂诲満 - containerMove() { - let _this = this - for (var i = 0; i < this.dataList.length; i++) { - if (this.dataList[i].checked) { - this.devNo.push(this.dataList[i].devNo) - } - } - uni.request({ - url: _this.baseUrl + '/agv/basDevp/visualized/container/moveOut', - header: {'token': uni.getStorageSync('token')}, - data: JSON.stringify({devNo: _this.devNo}), - method: 'POST', - success(res) { - res = res.data - console.log(res); - if (res.code === 200) { - _this.pickCode = '' - _this.dataList = [] - _this.devNo = [] - _this.messageText = "绂诲満鎴愬姛" - _this.messageToggle('success') - } 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' - }) - } - } - }) - }, hideKeyboard() { this.hide = this.hide ? false : true if (this.hide) { @@ -254,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' }); @@ -396,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) { @@ -411,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() }, @@ -452,7 +376,7 @@ selectMat() { let that = this uni.navigateTo({ - url: "../mat/matQuery", + url: "../../mat/matQuery", success: function(res) { // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� 鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑 res.eventChannel.emit('commonUrl', { @@ -551,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: { @@ -578,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') @@ -605,8 +557,8 @@ // 纭閲嶇疆 resetConfirm() { this.dataList = [] - this.stationCode = '' - this.floor = '' + this.barcode = '' + this.orderNo = '' this.messageText = "閲嶇疆瀹屾垚" this.messageToggle('success') }, @@ -618,8 +570,7 @@ resst() { this.dataList = [] this.barcode = '' - this.stationCode = '' - this.floor = '' + this.orderNo = '' this.barcodeFocuss() }, } @@ -640,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: 320rpx; - } - .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; } @@ -670,7 +606,7 @@ .item { display: flex; align-items: center; - height: 100rpx; + height: 70rpx; margin-left: 20rpx; border-bottom: 1px solid #DCDFE6; } @@ -686,7 +622,6 @@ } .code-decs { - width: 20vw; font-size: 18px; color: #303133; } @@ -697,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> diff --git a/pages/tzsk/AGV/orderList.vue b/pages/tzsk/AGV/orderList.vue new file mode 100644 index 0000000..f21a327 --- /dev/null +++ b/pages/tzsk/AGV/orderList.vue @@ -0,0 +1,106 @@ +<template> + <view> + <view class="code"> + <uni-search-bar :focus="matFocus" v-model="matnr" @input="matInput()" + @cancel="cancel" @clear="clear" placeholder="杈撳叆 / 鎵弿鍟嗗搧"> + </uni-search-bar> + </view> + <view class="list" v-for="(item,i) in dataList"> + <view class="list-left"> + <view>缂栧彿锛歿{item.matnr}}</view> + <view>鍚嶇О锛歿{item.maktx}}</view> + <view>瑙勬牸锛歿{item.specs}}</view> + <view>鏁伴噺锛歿{item.anfme}}</view> + <view class="card-id">{{i + 1}}</view> + </view> + <view class="list-right"> + <label @click="checkboxChange(item)"> + <checkbox :value="item.orderNo" color="#FFCC33" style="transform:scale(0.7)" /><text></text> + </label> + </view> + </view> + </view> +</template> + +<script> + export default { + data() { + return { + matFocus: true, + matnr: '', + checck: true, + dataList: [ + { + orderNo: 'cg0931241', + matnr: 'cg0931241', + maktx: '闈爑榛勯噾鍒嗗壊鍝堟墦璧忛粍閲戝垎鍓插搱鎵撹祻榛勯噾鍒嗗壊鍝堟墦璧�', + anfme: 10, + specs: '10-z' + }, + { + orderNo: 'cg0931242', + matnr: 'cg0931241', + maktx: '闈爑榛勯噾鍒嗗壊鍝堟墦璧�', + anfme: 10, + specs: '10-z' + } + ] + } + }, + methods: { + matInput() { + let _this = this + + }, + checkboxChange(e) { + let items = this.dataList, + values = e.orderNo; + if (e.checked) { + this.$set(e,'checked',false) + } else { + this.$set(e,'checked',true) + } + } + } + } +</script> + +<style> + .code { + background-color: #d9d9d9; + } + .list { + margin: 20rpx; + + background-color: #fff; + border-radius: 20rpx; + border: 1px solid #eeeeee; + display: flex; + position: relative; + } + .card-id { + position: absolute; + right: 10rpx; + top: 5rpx; + height: 30rpx; + line-height: 30rpx; + width: 30rpx; + text-align: center; + color: #eeeeee; + background-color: #ddd844; + border-radius: 50%; + font-size: 10px; + } + .list-left { + flex: 1; + padding: 20rpx; + position: relative; + } + .list-right { + width: 100rpx; + border-left: 1px solid #eeeeee; + display: flex; + align-items: center; + justify-content: center; + } +</style> -- Gitblit v1.9.1