From e26121ff5c022039057b2cf17609652651b8f8c4 Mon Sep 17 00:00:00 2001 From: "Mr.sun" <2290907227@qq.com> Date: Mon, 4 Mar 2024 16:56:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=82=B9=E4=BD=8Dvalue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/config.js | 1 + pages/AvgCarry/index.vue | 74 +++++++++++++++---- pages/release/index.vue | 38 +++++++--- .../components/select-lay/select-lay.vue | 24 ++++-- 4 files changed, 107 insertions(+), 30 deletions(-) diff --git a/common/config.js b/common/config.js index 2e1ae6e..de96267 100644 --- a/common/config.js +++ b/common/config.js @@ -12,6 +12,7 @@ const config = { // config.baseUrl = 'http://120.77.94.227:8030' config.baseUrl = 'http://127.0.0.1:8030'; // config.baseUrl = 'http://192.168.7.24:8030'; +// config.baseUrl = 'http://192.168.229.120:8030'; // config.baseUrl = 'http://120.77.94.227:8030'; //现场 // config.baseUrl = 'http://192.168.1.199:8030'; diff --git a/pages/AvgCarry/index.vue b/pages/AvgCarry/index.vue index b403c8e..b493b61 100644 --- a/pages/AvgCarry/index.vue +++ b/pages/AvgCarry/index.vue @@ -9,17 +9,18 @@ 搬运起始点位: - + - - + + + 搬运目标点位: - - + 开始搬运 @@ -41,7 +42,8 @@ containerCode:'', endPoint:'', }, - pointList:[] + pointList:[], + pointList1:[], } }, onLoad(){ @@ -50,15 +52,16 @@ this.$u.api.AvgCarry.getPointList({pageNum: 1, pageSize: 100}).then(res=>{ this.pointList=[] + this.pointList1=[] if(res.code==200){ let dataArry = res.rows; for (var i = 0; i < dataArry.length; i++) { var obj = { - value: dataArry[i].pointName, + value: dataArry[i].pointNo, label: dataArry[i].pointName, }; this.pointList.push(obj); - console.log(this.pointList); + this.pointList1.push(obj); } } }) @@ -76,8 +79,15 @@ // } // this.getDataList() this.$u.api.AvgCarry.queryBillingDByContainerCode({containerCode:this.dataForm.containerCode}).then(res=>{ - this.dataForm.endPoint = res.data - this.pointList = this.pointList.filter(item=>item.value != this.beginValue && item.value != this.dataForm.endPoint) + // console.log(res); + this.endValue = res.data + this.pointList.forEach(item=>{ + if(this.endValue == item.value){ + this.end = item.label + } + }) + // this.end = res.data + this.pointList1 = this.pointList.filter(item=>item.value != this.beginValue && item.value != this.endPoint) } ) }, @@ -91,7 +101,31 @@ // this.judge() // } // }).catch(err=>console.log(err)) - this.$u.api.AvgCarry.agvCarry({startPoint:this.begin,toLocation:this.dataForm.endPoint,containerCode:this.dataForm.containerCode}).then(res=>{ + if(this.dataForm.containerCode == null + || this.dataForm.containerCode === '' + || this.dataForm.containerCode === 0 + || this.dataForm.containerCode === undefined + || this.dataForm.containerCode ==='undefined'){ + this.$u.toast("请扫描台车编号"); + return; + } if(this.beginValue == null + || this.beginValue === '' + || this.beginValue === 0 + || this.beginValue === undefined + || this.beginValue ==='undefined'){ + this.$u.toast("请选择起始位置"); + return; + } + if(this.endValue == null + || this.endValue === '' + || this.endValue === 0 + || this.endValue === undefined + || this.endValue ==='undefined'){ + this.$u.toast("请选择目标位置"); + return; + } + this.$u.api.AvgCarry.agvCarry({startPoint:this.beginValue,toLocation:this.endValue, + containerCode:this.dataForm.containerCode}).then(res=>{ this.$u.toast(res.msg) if(res.code==200){ this.begin='' @@ -103,19 +137,21 @@ this.$u.api.AvgCarry.getPointList({pageNum: 1, pageSize: 100}).then(res=>{ this.pointList=[] + this.pointList1=[] if(res.code==200){ let dataArry = res.rows; for (var i = 0; i < dataArry.length; i++) { var obj = { - value: dataArry[i].pointName, + value: dataArry[i].pointNo, label: dataArry[i].pointName, }; this.pointList.push(obj); + this.pointList1.push(obj); } } }) } - }).catch(err=>console.log(err)) + }).catch(err=>{}) }, //获取点位 async getList(){ @@ -141,7 +177,7 @@ judge(e){ // console.log(e); // console.log(this.pointList); - this.pointList = this.pointList.filter(item=>item.value != this.beginValue && item.value != this.endValue) + this.pointList1 = this.pointList.filter(item=>item.value != this.beginValue && item.value != this.endValue) }, confirm(e) { this.begin = e[0].label @@ -149,7 +185,8 @@ this.judge(e) }, confirmTwo(e) { - this.dataForm.endPoint= e[0].label + // this.dataForm.endPoint= e[0].label + this.end= e[0].label this.endValue = e[0].value this.judge(e) }, @@ -159,4 +196,11 @@ \ No newline at end of file diff --git a/pages/release/index.vue b/pages/release/index.vue index 69e42f8..b1e06f1 100644 --- a/pages/release/index.vue +++ b/pages/release/index.vue @@ -6,8 +6,8 @@ - @@ -105,12 +105,13 @@ showDiv:false, queryFlag: '', dataForm: { - containerCode: null, + pointNo: null, keywords: "", pageNum: 1, pageSize: 10 }, datalist1:[], + pointList:[], pickUpObj:{ pointNo:'', taskCode:'', @@ -150,6 +151,23 @@ // this.$u.api.mouldStorage.queryMouldStorage({pageNum: 1,pageSize:9999,type:'out'}).then(res=>{ // console.log(res); // }) + this.$u.api.AvgCarry.getPointList({pageNum: 1, + pageSize: 100}).then(res=>{ + this.pointList=[] + if(res.code==200){ + let dataArry = res.rows; + for (var i = 0; i < dataArry.length; i++) { + var obj = { + value: dataArry[i].pointNo, + label: dataArry[i].pointName, + }; + this.pointList.push(obj); + } + } + + }) + + }, //上拉刷新(当数据距离底部100时触发,距离在pages.json配置) onReachBottom() { @@ -206,7 +224,7 @@ }, queryList(index,item){ console.log(index,item); - this.dataForm.containerCode=item.containerCode + this.dataForm.pointNo=item.value }, enterUp(item){ @@ -221,7 +239,7 @@ // clearTimeout(this.queryFlag); // this.loadList() // } - if (this.dataForm.containerCode == '' || this.dataForm.containerCode == null || this.dataForm.containerCode == + if (this.dataForm.pointNo == '' || this.dataForm.pointNo == null || this.dataForm.pointNo == undefined) { return } @@ -250,7 +268,7 @@ //节流 let flag = true if(flag===false) return - if (this.dataForm.containerCode == '' || this.dataForm.containerCode == null || this.dataForm.containerCode == + if (this.dataForm.pointNo == '' || this.dataForm.pointNo == null || this.dataForm.pointNo == undefined) { return } @@ -270,9 +288,9 @@ }) this.dataList=res.data setTimeout(()=>{ - this.dataForm.containerCode1=this.dataForm.containerCode - this.dataForm.containerTypeLabel=this.dataForm.containerCode - this.dataForm.containerCode='' + this.dataForm.pointNo=this.dataForm.pointNo + this.dataForm.containerTypeLabel=this.dataForm.pointNo + this.dataForm.pointNo='' },0) this.$nextTick(()=>{ @@ -291,7 +309,7 @@ url: 'pages/BusinPickup/index1', type: 'navigateTo', params:{ - containerCode:item.containerCode + pointNo:item.pointNo } }) }, diff --git a/uni_modules/select-lay/components/select-lay/select-lay.vue b/uni_modules/select-lay/components/select-lay/select-lay.vue index ca74056..9c8a56f 100644 --- a/uni_modules/select-lay/components/select-lay/select-lay.vue +++ b/uni_modules/select-lay/components/select-lay/select-lay.vue @@ -1,6 +1,6 @@