Commit a214aa51 authored by 李苏's avatar 李苏 💬

APP入库出库地图接口对接,api防space

parent 4508ee6e
...@@ -4,7 +4,17 @@ import { ...@@ -4,7 +4,17 @@ import {
import configService from '@/common/service/config.service.js'; import configService from '@/common/service/config.service.js';
import tip from '@/common/util/tip.js' import tip from '@/common/util/tip.js'
import eventBus from '@/common/util/eventBus.js' import eventBus from '@/common/util/eventBus.js'
console.log(eventBus.$trim)
/* 过滤对象属性空格 */
function filterSpace(data){
data=data||{}
let dataKeyArry=Object.keys(data)
console.log('dataKeyArry',dataKeyArry)
dataKeyArry.forEach(e=>{
data[e]=eventBus.$trim(data[e])
})
return data
}
function filter(e) { function filter(e) {
if (e.data.success) { if (e.data.success) {
return e.data.data return e.data.data
...@@ -13,73 +23,132 @@ function filter(e) { ...@@ -13,73 +23,132 @@ function filter(e) {
} }
} }
export function login(params) { export function login(params) {
return http.post('/login', params).then(e => { return http.post('/login', filterSpace(params)).then(e => {
return filter(e) return filter(e)
}) })
} }
export function getPower(params) { export function getPower(params) {
return http.post('/frame/init/mobile', params || {}).then(e => { return http.post('/frame/init/mobile', filterSpace(params) || {}).then(e => {
return filter(e) return filter(e)
}) })
} }
/* 托盘查询 */ /* 托盘查询 */
export function getTryinfo(params) { export function getTryinfo(params) {
return http.post('/xgwcs/tpmx/searchTpmxsByCode', params || {}).then(e => { return http.post('/xgwcs/tpmx/searchTpmxsByCode', filterSpace(params) || {}).then(e => {
return filter(e) return filter(e)
}) })
} }
/* 托盘调整 */ /* 托盘调整 */
export function adjustTry(params) { export function adjustTry(params) {
return http.post('/xgwcs/tp/adjustTpByCode ', params || {}).then(e => { return http.post('/xgwcs/tp/adjustTpByCode ', filterSpace(params) || {}).then(e => {
return filter(e) return filter(e)
}) })
} }
/* 清空托盘 */ /* 清空托盘 */
export function emptyTry(params) { export function emptyTry(params) {
return http.post('/xgwcs/tp/emptyTpByCode', params || {}).then(e => { return http.post('/xgwcs/tp/emptyTpByCode', filterSpace(params) || {}).then(e => {
return filter(e) return filter(e)
}) })
} }
/* 配盘单号核验 */ /* 配盘单号核验 */
export function checkDjid(params){ export function checkDjid(params){
return http.post('/xgwcs/rktz/queryRktzdByDjid', params || {}).then(e => { return http.post('/xgwcs/rktz/queryRktzdByDjid',filterSpace(params) || {}).then(e => {
return filter(e) return filter(e)
}) })
} }
/* 查询托盘状态 */ /* 查询托盘状态 */
export function checkTpcode(params){ export function checkTpcode(params){
return http.post('/xgwcs/tp/searchTpByCode', params || {}).then(e => { return http.post('/xgwcs/tp/searchTpByCode', filterSpace(params) || {}).then(e => {
return filter(e) return filter(e)
}) })
} }
/* 入库绑定 */ /* 入库绑定 */
export function putinBind(params) { export function putinBind(params) {
return http.post('/xgwcs/rkzy/genRkzyByTpAndPhd', params || {}).then(e => { return http.post('/xgwcs/rkzy/genRkzyByTpAndPhd', filterSpace(params) || {}).then(e => {
return filter(e) return filter(e)
}) })
} }
/* 入库登记表查询 */ /* 入库登记表查询 */
export function queryUpDrk(params) { export function queryUpDrk(params) {
return http.post('/xgwcs/rkzy/queryUpDrk', params || {}).then(e => { return http.post('/xgwcs/rkzy/queryUpDrk', filterSpace(params) || {}).then(e => {
return filter(e) return filter(e)
}) })
} }
/* 检验库位码 */ /* 检验库位码 */
export function checkKwcode(params) { export function checkKwcode(params) {
return http.post('/xgwcs/kwcx/searchKwByKwCode', params || {}).then(e => { return http.post('/xgwcs/kwcx/searchKwByKwCode', filterSpace(params) || {}).then(e => {
return filter(e) return filter(e)
}) })
} }
/* 完成入库 */ /* 完成入库 */
export function completedRk(params) { export function completedRk(params) {
return http.post('/xgwcs/sjrw/completedRkBySjrw ', params || {}).then(e => { return http.post('/xgwcs/sjrw/completedRkBySjrw ', filterSpace(params) || {}).then(e => {
return filter(e) return filter(e)
}) })
} }
/* 删除任务 */ /* 删除任务 */
export function deleteRk(params) { export function deleteRk(params) {
return http.post('/xgwcs/rkzy/delete', params || {}).then(e => { return http.post('/xgwcs/rkzy/delete', filterSpace(params) || {}).then(e => {
return filter(e)
})
}
/* 入库地图状态查询 */
export function queryKw(params) {
return http.post('/xgwcs/kwcx/queryKw', filterSpace(params) || {}).then(e => {
return filter(e)
})
}
/* 出库表记录查询 */
export function queryDownDrk(params) {
return http.post('/xgwcs/ckzy/queryDownDrk', filterSpace(params) || {}).then(e => {
return filter(e)
})
}
/* 检测出库库位码 */
export function queryValidByKwcode(params) {
return http.post('/xgwcs/ckzy/queryValidByKwcode', filterSpace(params) || {}).then(e => {
return filter(e)
})
}
/* 准备出库 */
export function rwconfirm(params) {
return http.post('/xgwcs/sjrw/rwconfirm', filterSpace(params) || {}).then(e => {
return filter(e)
})
}
/* 出库取料码扫描 */
export function searchGwByCode(params) {
return http.post('/xgwcs/gw/searchGwByCode', filterSpace(params) || {}).then(e => {
return filter(e)
})
}
/* 确认出库 */
export function completedCkBySjrw(params) {
return http.post('/xgwcs/sjrw/completedCkBySjrw ', filterSpace(params) || {}).then(e => {
return filter(e)
})
}
/* 出库状态表格变更后查询 */
export function queryDownConfirmRk(params) {
return http.post('/xgwcs/ckzy/queryDownConfirmRk', filterSpace(params) || {}).then(e => {
return filter(e) return filter(e)
}) })
} }
/* 工位叫料站位信息查询 */
/* agv任务状态查询 */
/*工位对应物料查询 */
/* 工位叫料接口 */
/*工位取消接口*/
/* 工位锁定接口 */
/* 回库接口 */
/* 取消锁定接口 */
/* 物料查询接口 */
...@@ -95,10 +95,10 @@ const routes = [ ...@@ -95,10 +95,10 @@ const routes = [
}, },
}, },
{ {
path: '/pages/dl_putout_storage/putin_register', path: '/pages/dl_putout_storage/putout_register',
name: 'putout_register', name: 'putout_register',
meta: { meta: {
title: '登记信息', title: '取料登记',
}, },
}, },
/* 工位叫料 */ /* 工位叫料 */
......
<template>
<view style="overflow: auto;">
<view class="location_body" :style="bodyWidth" >
<view class="xList" v-for="(xitem,xindex) in xList" :key="xindex">
<!-- <view class="yList">
{{xindex+1}}
</view> -->
<view class="yList" :class="{qhkw:yitem&&yitem[0]&&searchSign(yitem).sign=='Y'}" v-for="(yitem,yindex) in xitem" :key="yindex">
<span>
{{(yitem&&yitem[0])?(searchSign(yitem)?searchSign(yitem).code:yitem[yitem.length-1].code):"空库位"}}
</span>
</view>
</view>
</view>
</view>
</template>
<script>
import LocationMain from '@/components/LocationInfo/LocationMain.vue'
export default {
name:"LocationInfo",
components:{
LocationMain
},
props:{
xList:{
default:[]
}
},
computed:{
bodyWidth(){
return "width:"+100*this.xList.length+'px'
}
},
data() {
return {
};
},
methods:{
searchSign(data){
let obj=false
data.forEach(e=>{
if(e.sign=="Y"){
obj=e
}else{
console.log('NULL',e)
}
})
if(obj){
console.log('Y',obj)
}
return obj
}
},
mounted() {
console.log(this.xList)
}
}
</script>
<style lang="scss">
.qhkw{
background-color: red!important;
}
.location_body{
height: 50vh;width: 300px;
margin-bottom: 20px;
overflow: auto;
display: flex;
.xList{
flex: 1;
height: auto;
width: 40px;
.yList{
width: 100%;
height: 40px;
border: 1px solid #eee;
line-height: 40px;
background-color: #666;
color: #fff;
}
}
}
</style>
\ No newline at end of file
<template>
<view class="main_body">
<view :class="{existItem:item==7}" class="mainItem" v-for="(item,index) in kwnum" :key="index">
<span >{{item==7?'7(3层)':item+"仓"}}</span>
</view>
</view>
</template>
<script>
export default {
name:"LocationMain",
props:{
kwnum:{
default:10
}
},
data() {
return {
};
}
}
</script>
<style lang="scss">
.main_body{
height: 100%;
width: 100%;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
.mainItem{
border: 1px solid #eee;
height: 40px;
line-height: 40px;
width: 41.3px;
}
.existItem{
color: #fff;
background-color:red;
}
}
</style>
\ No newline at end of file
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
} }
,{ ,{
"path" : "pages/dl_putout_storage/putin_register", "path" : "pages/dl_putout_storage/putout_register",
"style" : "style" :
{ {
"navigationBarTitleText": "", "navigationBarTitleText": "",
......
...@@ -86,7 +86,6 @@ ...@@ -86,7 +86,6 @@
export default { export default {
data() { data() {
return { return {
masterid:"",
agvrwdh:"", agvrwdh:"",
agvrwzt:"", agvrwzt:"",
rwdh:"", rwdh:"",
...@@ -231,8 +230,7 @@ ...@@ -231,8 +230,7 @@
}, },
adjustbt(){ adjustbt(){
this.$Router.push({ path:'/pages/dl_tray_adjust/index', query:{ this.$Router.push({ path:'/pages/dl_tray_adjust/index', query:{
tpcode:"10020"
}, },
}) })
}, },
...@@ -251,207 +249,11 @@ ...@@ -251,207 +249,11 @@
} }
}); });
}, },
// 手动
apisd(){
if(this.agvrwdh==""){
this.hideModal()
this.$tip.alert("当前状态操作")
return false
}
let that=this
api.postData("agv/agvtask/doAgvComplete",{
"ckid":that.$ckid,
"taskCode":this.agvrwdh
}).then((resp) => {
if(resp.data.success){
that.$tip.alert("操作成功");
}else{
that.$tip.alert(resp.data.message||"请求失败");
}
}).catch((err) => {
}).finally(()=>{
})
this.hideModal()
},
// 取消叫料
apiqxjl(){
let that=this
api.postData("xgwms/wollzy/delete",{
"ckid":that.$ckid,
"id":this.masterid
}).then((resp) => {
if(resp.data.success){
this.status=1
this.wlinfor={}
this.apigettaskinf()
// that.$tip.alert("取消叫料成功");
that.apiGetgwxx()
}else{
that.$tip.alert(resp.data.message||"请求失败");
}
}).catch((err) => {
// let msg = "请求出现错误,请稍后再试"
// this.$tip.alert(msg);
}).finally(()=>{
})
this.hideModal()
}
,
// 清空小车api
apiqkxc(){
this.gwObj=this.gwinfor[this.gwSelcetdIndex];
let that=this
api.postData("jcsj/gw/free",{
"ckid":that.$ckid,
"id":this.gwObj.id,
}).then((resp) => {
if(resp.data.success){
that.$tip.alert("清空成功");
that.status=1
that.apigettaskinf()
that.apiGetgwxx()
}else{
that.$tip.alert(resp.data.message||"请求失败");
}
}).catch((err) => {
// let msg = "请求出现错误,请稍后再试"
// this.$tip.alert(msg);
}).finally(()=>{
})
},
// 查询任务单号状态以及物料
apigettaskinf(){
api.postData("xgwms/gwcx/query",{
"ckid":this.$ckid,
"code":this.gwObj.code,
}).then((resp) => {
if(resp.data.success){
if(resp.data.data.records.sjrwmxes[0]){
this.masterid=resp.data.data.records.sjrw.id
this.wlinfor.wlname=resp.data.data.records.sjrwmxes[0].wlname||""
this.wlinfor.wlgg=resp.data.data.records.sjrwmxes[0].wlgg||""
this.wlinfor.ztsl=resp.data.data.records.sjrwmxes[0].ztsl||""
this.wlinfor.tpcode=resp.data.data.records.sjrwmxes[0].tpcode||""
this.wlinfor.wlph=resp.data.data.records.sjrwmxes[0].wlph||""
this.wlinfor.wlcode=resp.data.data.records.sjrwmxes[0].wlcode||""
this.rwdh=resp.data.data.records.sjrw.djid
this.rwzt=resp.data.data.records.sjrw.zt
this.agvrwdh=resp.data.data.records.agvtask.taskCode
this.agvrwzt=resp.data.data.records.agvtask.taskStatusString
}else{
this.wlinfor.wlname=""
this.wlinfor.wlgg=""
this.wlinfor.ztsl=""
this.wlinfor.tpcode=""
this.wlinfor.wlph=""
this.wlinfor.wlcode=""
this.rwdh=""
this.rwzt=""
this.agvrwdh=""
this.agvrwzt=""
}
}else{
this.$tip.alert(resp.data.message||"请求失败");
}
}).catch((err) => {
// let msg = "请求出现错误,请稍后再试"
// this.$tip.alert(msg);
}).finally(()=>{
})
},
clearinfo(){
this.apiqkxc()
this.wlinfor={}
this.hideModal()
},
apiqqjl(){
if(!this.wlinfor.wlname){
this.hideModal()
this.$tip.alert("请先选择物料");
return false
}
this.gwObj=this.gwinfor[this.gwSelcetdIndex];
this.wlinfor.gwid=this.gwObj.id
// this.wlinfor.tpid=this.wlinfor.mid
this.wlinfor.code=this.wlinfor.tpcode
api.postData("xgwms/wollzy/genCkzy",{
"ckid":this.$ckid,
"data":this.wlinfor,
}).then((resp) => {
if(resp.data.success){
// this.rwdh=resp.data.data.records.djid
// this.rwzt=resp.data.data.records.zt
this.$tip.alert("叫料成功");
this.apigettaskinf()
this.apiGetgwxx()
this.status=3
this.apigettaskinf()
}else{
this.$tip.alert(resp.data.message||"请求失败");
}
}).catch((err) => {
}).finally(()=>{
})
this.hideModal()
},
interval(){ interval(){
// this.interval_gwinfor=setInterval(()=>{ // this.interval_gwinfor=setInterval(()=>{
// this.apiGetgwxx() // this.apiGetgwxx()
// },3000) // },3000)
}, },
apiGetgwxx(){
let _self=this;
api.postData(_self.urls.gwquery,{
"ckid":_self.$ckid,
stationid:_self.cxinfor.id
}).then((resp) => {
if(resp.data.success){
_self.gwinfor=resp.data.data.records
this.gwObj=this.gwinfor[this.gwSelcetdIndex];
this.status=this.gwObj.status
if(this.status==1){
// this.wlinfor.wlname=""
// this.wlinfor.wlgg=""
// this.wlinfor.ztsl=""
// this.wlinfor.tpcode=""
// this.wlinfor.wlph=""
// this.wlinfor.wlcode=""
// this.rwdh=""
// this.rwzt=""
// this.agvrwdh=""
// this.agvrwzt=""
}
if(_self.status==null){
_self.gwObj=_self.gwinfor[_self.gwSelcetdIndex]
// _self.apigettaskinf()
_self.status=_self.gwinfor[0].status
}
if(_self.status==2||_self.status==3){
_self.apigettaskinf()
}
if(_self.gwObj.zt==0){
_self.gwObj=_self.gwinfor[0]
}
}else{
this.$tip.alert(resp.data.message||"请求失败");
}
}).catch((err) => {
// let msg = "请求出现错误,请稍后再试"
// this.$tip.alert(msg);
}).finally(()=>{
})
},
gotoBackPage(){ gotoBackPage(){
this.$Router.replace('/pages/gwjl/gwxz') this.$Router.replace('/pages/gwjl/gwxz')
}, },
...@@ -459,55 +261,10 @@ ...@@ -459,55 +261,10 @@
nextTo(){ nextTo(){
clearInterval(this.interval_gwinfor) clearInterval(this.interval_gwinfor)
this.$Router.push({ path:'/pages/dl_cmaterial/xzwl', query:{ this.$Router.push({ path:'/pages/dl_cmaterial/xzwl', query:{
gwjlinfor:{
status:this.status,
gwSelcetdIndex:this.gwSelcetdIndex,
cxinfor:this.cxinfor
}
},
})
}, },
confirm2(){ })
this.modalName="DialogModal2"
},
confirm3(){
this.modalName="DialogModal3"
},
confirm4(){
this.modalName="DialogModal4"
},
// 叫料
confirm(e){
if(this.status=="1")
{
this.modalName="DialogModal"+e
}else{
this.$tip.alert("当前工位非空闲")
}
},
showModal(e) {
this.modalName = e.currentTarget.dataset.target
},
hideModal(e) {
this.modalName = null
},
Gridchange(e) {
this.gridCol = e.detail.value
},
Gridswitch(e) {
this.gridBorder = e.detail.value
},
MenuBorder(e) {
this.menuBorder = e.detail.value
},
MenuArrow(e) {
this.menuArrow = e.detail.value
},
MenuCard(e) {
this.menuCard = e.detail.value
}, },
selectedGw(e,item){ selectedGw(e,item){
this.status=item.status this.status=item.status
...@@ -517,32 +274,24 @@ ...@@ -517,32 +274,24 @@
_self.gwObj=_self.gwinfor[e]; _self.gwObj=_self.gwinfor[e];
_self.formData.gwid=_self.gwObj.id; _self.formData.gwid=_self.gwObj.id;
if(this.status!=1){ if(this.status!=1){
this.apigettaskinf()
}else if( }else if(
this.status==1 this.status==1
){ ){
this.wlinfor.wlname=""
this.wlinfor.wlgg=""
this.wlinfor.ztsl=""
this.wlinfor.tpcode=""
this.wlinfor.wlph=""
this.wlinfor.wlcode=""
this.rwdh=""
this.rwzt=""
this.agvrwdh=""
this.agvrwzt=""
} }
// _self.formData.rwdh=_self.gwObj.rwdh;
// _self.formData.rwzt=_self.gwObj.rwzt;
}, },
/* 查询工位 */ /* 查询工位 */
}, },
onLoad(e) { onLoad(e) {
console.log("退回执行onload?") this.a=0
setTimeout(()=>{ setTimeout(()=>{
this.gwinfor=[{status:1,stationname:"测试站",name:"测试名称"},{status:2,stationname:"测试站",name:"测试名称"},{status:3,stationname:"测试站",name:"测试名称"}] this.gwinfor=[{status:1,stationname:"测试站",name:"测试名称"},{status:2,stationname:"测试站",name:"测试名称"},{status:3,stationname:"测试站",name:"测试名称"}]
this.gwObj=this.gwinfor[0] this.gwObj=this.gwinfor[0]
this.gwSelcetdIndex=0
}) })
console.log("退回执行onload?")
eventBus.$on('sendInfo', function(data){ eventBus.$on('sendInfo', function(data){
this.wlinfor=data.wlinfor this.wlinfor=data.wlinfor
}.bind(this)); }.bind(this));
...@@ -552,7 +301,8 @@ ...@@ -552,7 +301,8 @@
let einfor =JSON.parse(e.query) let einfor =JSON.parse(e.query)
}, },
onShow(){ onShow(){
console.log('退回执行onshow?') this.interval_gwinfor=setInterval(()=>{console.log(this.a++)},1000)
console.log('onshow')
}, },
onUnload(){ onUnload(){
console.log("onunload") console.log("onunload")
...@@ -560,7 +310,7 @@ ...@@ -560,7 +310,7 @@
clearInterval(this.interval_gwinfor) clearInterval(this.interval_gwinfor)
}, },
onHide(){ onHide(){
console.log("onHide")
} }
} }
</script> </script>
......
...@@ -12,58 +12,11 @@ ...@@ -12,58 +12,11 @@
<text class="cuIcon-close text-red"></text> <text class="cuIcon-close text-red"></text>
</view> </view>
</view> </view>
<view class="padding-xl"> <view class="padding" style="overflow: auto;">
<view class="" style="height: 250px;width: 90vw;display: flex;flex-wrap:wrap"> <LocationInfo :xList='xList' ></LocationInfo>
<view style="height: 20%;width:90%;display: flex;">
<view style="flex: 1;line-height: 40px;"></view>
<view style="flex: 1;line-height: 40px;">G1</view>
<view style="flex: 1;line-height: 40px;">G2</view>
<view style="flex: 1;line-height: 40px;">G3</view>
<view style="flex: 1;line-height: 40px;">G4</view>
<view style="flex: 1;line-height: 40px;">G5</view>
<view style="flex: 1;line-height: 40px;">G6</view>
</view>
<view style="height: 20%;width:90%;display: flex;">
<view style="flex: 1;line-height: 40px;">S1</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位2</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位3</view>
<view style="flex: 1;height: 40px;"></view>
<view style="flex: 1;height: 40px;"></view>
<view style="flex: 1;height: 40px;"></view>
<view style="flex: 1;height: 40px;"></view>
</view>
<view style="height: 20%;width:90%;display: flex;">
<view style="flex: 1;line-height: 40px;">S2</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位2</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位3</view>
<view style="flex: 1;height: 40px;"></view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位5</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位6</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位7</view>
</view>
<view style="height: 20%;width:90%;display: flex;">
<view style="flex: 1;line-height: 40px;">S3</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位2</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位3</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位4</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位5</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位6</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位7</view>
</view>
<view style="height: 20%;width:90%;display: flex;">
<view style="flex: 1;line-height: 40px;">S4</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位2</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位3</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位4</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位5</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位6</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位7</view>
</view>
</view>
<view class="flex justify-around"> <view class="flex justify-around">
<button class="cu-btn bg-gradual-red wid22" @tap="cancelbt" >解除绑定信息</button> <button class="cu-btn bg-gradual-red wid22" @tap="cancelbt" >解除绑定信息</button>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
...@@ -100,8 +53,12 @@ ...@@ -100,8 +53,12 @@
<script> <script>
import api from '@/api/api.js'; import api from '@/api/api.js';
import {queryUpDrk,checkKwcode,completedRk,deleteRk} from '@/api/dlapi.js' import LocationInfo from '@/components/LocationInfo/LocationInfo.vue'
import {queryUpDrk,checkKwcode,completedRk,deleteRk,queryKw} from '@/api/dlapi.js'
export default { export default {
components:{
LocationInfo
},
watch:{ watch:{
clicknum(newValue,oldValue){ clicknum(newValue,oldValue){
console.log('新值:'+newValue,'旧值:'+oldValue) console.log('新值:'+newValue,'旧值:'+oldValue)
...@@ -109,10 +66,12 @@ ...@@ -109,10 +66,12 @@
}, },
data() { data() {
return { return {
xList:[],
index:-1, index:-1,
code:"", code:"",
clicknum:0, clicknum:0,
kwmFocus:true, kwmFocus:true,
/* test */
modalName:"", modalName:"",
rkdjlist:[] rkdjlist:[]
} }
...@@ -132,14 +91,12 @@ ...@@ -132,14 +91,12 @@
} }
}, },
methods: { methods: {
cancelbt(){ cancelbt(){
let that=this let that=this
if(this.index==-1){ if(this.index==-1){
this.$tip.toast("请选中一条数据") this.$tip.toast("请选中一条数据")
return return
}else{ }else{
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '是否解除绑定信息', content: '是否解除绑定信息',
...@@ -219,6 +176,19 @@ ...@@ -219,6 +176,19 @@
} }
}); });
}, },
transData(data){
let xList=[]
data.forEach(e=>{
if(!xList[e.kwx-1]){
xList[e.kwx-1]=[]
}
if(!xList[e.kwx-1][e.kwy-1]){
xList[e.kwx-1][e.kwy-1]=[]
}
xList[e.kwx-1][e.kwy-1][e.kwz-1]=e
})
this.xList=xList
},
longtapTb(item,index){ longtapTb(item,index){
if(item.selected){ if(item.selected){
this.modalName="Modal" this.modalName="Modal"
...@@ -238,7 +208,15 @@ ...@@ -238,7 +208,15 @@
this.rkdjlist[eindex].selected=false this.rkdjlist[eindex].selected=false
} }
}) })
/* 库位图稍后搞 */
queryKw({ckid:item.ckid,kwid:item.kwid}).then(e=>{
if(e){
this.transData(e.records)
this.modalName="Modal" this.modalName="Modal"
}else{
this.$tip.toast("无库位图数据")
}
})
} }
}, },
......
...@@ -13,53 +13,7 @@ ...@@ -13,53 +13,7 @@
</view> </view>
</view> </view>
<view class="padding-xl"> <view class="padding-xl">
<view class="" style="height: 250px;width: 90vw;display: flex;flex-wrap:wrap"> <LocationInfo :xList="xList" ></LocationInfo>
<view style="height: 20%;width:90%;display: flex;">
<view style="flex: 1;line-height: 40px;"></view>
<view style="flex: 1;line-height: 40px;">G1</view>
<view style="flex: 1;line-height: 40px;">G2</view>
<view style="flex: 1;line-height: 40px;">G3</view>
<view style="flex: 1;line-height: 40px;">G4</view>
<view style="flex: 1;line-height: 40px;">G5</view>
<view style="flex: 1;line-height: 40px;">G6</view>
</view>
<view style="height: 20%;width:90%;display: flex;">
<view style="flex: 1;line-height: 40px;">S1</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位2</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位3</view>
<view style="flex: 1;height: 40px;"></view>
<view style="flex: 1;height: 40px;"></view>
<view style="flex: 1;height: 40px;"></view>
<view style="flex: 1;height: 40px;"></view>
</view>
<view style="height: 20%;width:90%;display: flex;">
<view style="flex: 1;line-height: 40px;">S2</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位2</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位3</view>
<view style="flex: 1;height: 40px;"></view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位5</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位6</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位7</view>
</view>
<view style="height: 20%;width:90%;display: flex;">
<view style="flex: 1;line-height: 40px;">S3</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位2</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位3</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位4</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位5</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位6</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位7</view>
</view>
<view style="height: 20%;width:90%;display: flex;">
<view style="flex: 1;line-height: 40px;">S4</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位2</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位3</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位4</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位5</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位6</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位7</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -70,25 +24,29 @@ ...@@ -70,25 +24,29 @@
<view class="tbtit_son">库位</view> <view class="tbtit_son">库位</view>
<view style="flex: 1;">状态</view> <view style="flex: 1;">状态</view>
</view> </view>
<view class="tbtit_row " :class="item.selected?'selected':''" v-for="(item,index) in rkdjlist" :key="index" @tap="selectTb(item,index)" @longtap="longtapTb(item,index)"> <view class="tbtit_row " :class="item.selected?'selected':''" v-for="(item,index) in ckdjlist" :key="index" @tap="selectTb(item,index)" @longtap="longtapTb(item,index)">
<view class="tbtit_row_son1">{{item.tpm}}</view> <view class="tbtit_row_son1">{{item.tpcode}}</view>
<view style="flex: 1">{{item.kw}}</view> <view style="flex: 1">{{item.kwname}}</view>
<view class="tbtit_row_son3">{{item.zt}}</view> <view class="tbtit_row_son3">{{item.zt|ckStatus}}</view>
</view>
<view class="tbtit_row " style="display: flex;" v-if="!ckdjlist[0]" >
<span style="flex: 1;">
暂无数据
</span>
</view> </view>
</view> </view>
<view class="padding flex justify-around bg-white "> <view class="padding flex justify-around bg-white ">
<view class="padding-xs bg-white" style=""> <view class="padding-xs bg-white" style="">
<view class="cu-form-group "> <view class="cu-form-group ">
<view class="title">库位码</view> <view class="title">库位码</view>
<input focus="true" @confirm="searchKwm()" placeholder="扫描库位码查询"></input> <input focus="true" v-model="kwcode" @confirm="searchKwm()" placeholder="扫描库位码查询"></input>
</view> </view>
</view> </view>
</view> </view>
<view class=" flex justify-around bg-white "> <view class=" flex justify-around bg-white ">
<view class="padding-xs bg-white" style=""> <view class="padding-xs bg-white" style="">
<view class="cu-form-group "> <view class="cu-form-group ">
<view class="title">取料区码</view> <button class="cu-btn bg-gradual-red wid30" @tap="switchbt">进入确认出库任务</button>
<input focus="true" @confirm="searchQlqm()" placeholder="扫描取料区码查询"></input>
</view> </view>
</view> </view>
</view> </view>
...@@ -99,44 +57,27 @@ ...@@ -99,44 +57,27 @@
<script> <script>
import api from '@/api/api.js'; import api from '@/api/api.js';
import {queryKw,queryDownDrk,rwconfirm,queryValidByKwcode} from '@/api/dlapi.js'
import LocationInfo from '@/components/LocationInfo/LocationInfo.vue'
export default { export default {
components:{
LocationInfo
},
data() { data() {
return { return {
xList:[],
index:-1,
kwcode:"",
modalName:"", modalName:"",
rkdjlist:[{ ckdjlist:[],
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
}],
clicknum:0 clicknum:0
} }
}, },
filters: { filters: {
ckStatus:function(e){
let status={I:"待出库",C:"完成",F:"运输中"}
return status[e]
},
formatTime: function(time) { formatTime: function(time) {
if (time != null && time != "") { if (time != null && time != "") {
var date = new Date(time); var date = new Date(time);
...@@ -147,6 +88,22 @@ ...@@ -147,6 +88,22 @@
} }
}, },
methods: { methods: {
switchbt(){
this.$Router.push({name:"putout_register"})
},
apiQueryDownDrk(data){
let params=data||{}
queryDownDrk(params).then(e=>{
if(e){
this.index=-1
this.ckdjlist=[]
e.records.forEach(data=>{
data.selected=false
this.ckdjlist.push(data)
})
}
})
},
searchQlqm(){ searchQlqm(){
/* 三种状态,1,对应库位入库,2,不对应库位,3,非界面的库位 */ /* 三种状态,1,对应库位入库,2,不对应库位,3,非界面的库位 */
uni.showModal({ uni.showModal({
...@@ -162,55 +119,97 @@ ...@@ -162,55 +119,97 @@
}); });
}, },
searchKwm(){ searchKwm(){
/* 三种状态,1,对应库位入库,2,不对应库位,3,非界面的库位 */ let that=this
if(!this.kwcode){
this.$tip.toast("请输入库位码")
return
}
queryValidByKwcode({kwcode:this.kwcode}).then(e=>{
if(e){
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '确认入库', content: '准备出库',
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
console.log('用户点击确定'); rwconfirm({rwid:e.records.id}).then(data=>{
if(data){
that.$tip.toast("状态变更成功")
that.$Router.push({name:"putout_register"})
}
})
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消'); console.log('用户点击取消');
} }
} }
}); });
}else{
this.kwcode=""
}
})
}, },
longtapTb(item,index){ longtapTb(item,index){
if(item.selected){ if(item.selected){
this.modalName="Modal" this.modalName="Modal"
}else{ }else{
if(this.rkdjlist[index].selected==true){ if(this.ckdjlist[index].selected==true){
this.rkdjlist[index].selected=false this.ckdjlist[index].selected=false
this.index=-1
/* 清除选中值 */ /* 清除选中值 */
}else{ }else{
this.rkdjlist[index].selected=true this.ckdjlist[index].selected=true
/* 存储选中值 */ /* 存储选中值 */
this.index=index
} }
/* 清除其他选中值 */ /* 清除其他选中值 */
this.rkdjlist.forEach((e,eindex)=>{ this.ckdjlist.forEach((e,eindex)=>{
if(index!=eindex){ if(index!=eindex){
this.rkdjlist[eindex].selected=false this.ckdjlist[eindex].selected=false
} }
}) })
/* 库位图稍后搞 */
queryKw({ckid:item.ckid,kwid:item.kwid}).then(e=>{
if(e){
this.transData(e.records)
this.modalName="Modal" this.modalName="Modal"
}else{
this.$tip.toast("无库位图数据")
}
})
} }
}, },
selectTb(item,index){ selectTb(item,index){
if(this.rkdjlist[index].selected==true){ if(this.ckdjlist[index].selected==true){
this.rkdjlist[index].selected=false this.ckdjlist[index].selected=false
this.index=-1
/* 清除选中值 */ /* 清除选中值 */
}else{ }else{
this.rkdjlist[index].selected=true this.ckdjlist[index].selected=true
this.index=index
/* 存储选中值 */ /* 存储选中值 */
} }
/* 清除其他选中值 */ /* 清除其他选中值 */
this.rkdjlist.forEach((e,eindex)=>{ this.ckdjlist.forEach((e,eindex)=>{
if(index!=eindex){ if(index!=eindex){
this.rkdjlist[eindex].selected=false this.ckdjlist[eindex].selected=false
} }
}) })
}, },
transData(data){
let xList=[]
data.forEach(e=>{
if(!xList[e.kwx-1]){
xList[e.kwx-1]=[]
}
if(!xList[e.kwx-1][e.kwy-1]){
xList[e.kwx-1][e.kwy-1]=[]
}
xList[e.kwx-1][e.kwy-1][e.kwz-1]=e
})
this.xList=xList
},
watchInfo(){ watchInfo(){
this.$router.push({name:"putin_register"}) this.$router.push({name:"putin_register"})
}, },
...@@ -228,7 +227,10 @@ ...@@ -228,7 +227,10 @@
// 任务列表 // 任务列表
}, },
onLoad(e) { onLoad(e) {
this.apiQueryDownDrk()
},
onShow() {
this.apiQueryDownDrk()
} }
} }
</script> </script>
......
<template> <template>
<view class="bg-white" style="height: 100vh;"> <view class="bg-white" style="height: 100vh;">
<cu-custom bgColor="bg-gradual-blue" :isBack="true" :reWrite="'homepage'"> <cu-custom bgColor="bg-gradual-blue" :isBack="true" >
<block slot="backText">返回</block> <block slot="backText">返回</block>
<block slot="content">入库登记信息</block> <block slot="content">完成出库</block>
</cu-custom> </cu-custom>
<view class="cu-modal" :class="modalName=='Modal'?'show':''"> <view class="cu-modal" :class="modalName=='Modal'?'show':''" v-if="modalName=='Modal'">
<view class="cu-dialog"> <view class="cu-dialog">
<view class="cu-bar bg-white justify-end"> <view class="cu-bar bg-white justify-end">
<view class="content">库位信息</view> <view class="content">库位信息</view>
...@@ -13,31 +13,46 @@ ...@@ -13,31 +13,46 @@
</view> </view>
</view> </view>
<view class="padding-xl"> <view class="padding-xl">
<!-- 库位位置 --> <LocationInfo :xList="xList" ></LocationInfo>
</view> </view>
</view> </view>
</view> </view>
<view class="padding-xs bg-white" style="height: 60vh;overflow: auto;"> <view class=" flex justify-end bg-white ">
<view class="padding-xs bg-white" style="">
<view class="cu-form-group ">
<button class="cu-btn bg-black wid30" @tap="switchbt">{{(switchUser=="N")?"切换所有出库任务":"切换我的出库任务"}}</button>
</view>
</view>
</view>
<view class="padding-xs bg-white" style="height: 45vh;overflow: auto;">
<!-- title --> <!-- title -->
<view class="tbtit"> <view class="tbtit">
<view class="tbtit_son">托盘码</view> <view class="tbtit_son">托盘码</view>
<view class="tbtit_son">库位</view> <view class="tbtit_son">库位</view>
<view style="flex: 1;">状态</view> <view style="flex: 1;">状态</view>
</view> </view>
<view class="tbtit_row " :class="item.selected?'selected':''" v-for="(item,index) in rkdjlist" :key="index" @tap="selectTb(item,index)" @longtap="longtapTb(item,index)"> <view class="tbtit_row " :class="item.selected?'selected':''" v-for="(item,index) in ckdjlist" :key="index" @tap="selectTb(item,index)" @longtap="longtapTb(item,index)">
<view class="tbtit_row_son1">{{item.tpm}}</view> <view class="tbtit_row_son1">{{item.tpcode}}</view>
<view style="flex: 1">{{item.kw}}</view> <view style="flex: 1">{{item.kwname}}</view>
<view class="tbtit_row_son3">{{item.zt}}</view> <view class="tbtit_row_son3">{{item.zt|ckStatus}}</view>
</view>
<view class="tbtit_row " style="display: flex;" v-if="!ckdjlist[0]" >
<span style="flex: 1;">
暂无数据
</span>
</view> </view>
</view> </view>
<view class="padding flex justify-around bg-white "> <view class="padding flex justify-around bg-white ">
</view>
<view class=" flex justify-around bg-white ">
<view class="padding-xs bg-white" style=""> <view class="padding-xs bg-white" style="">
<view class="cu-form-group "> <view class="cu-form-group ">
<view class="title">库位</view> <view class="title">取料区</view>
<input focus="true" @confirm="searchKwm()" placeholder="扫描库位码查询"></input> <input focus="true" @confirm="searchQlqm()" v-model="code" placeholder="扫描取料区码查询"></input>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
...@@ -45,43 +60,29 @@ ...@@ -45,43 +60,29 @@
<script> <script>
import api from '@/api/api.js'; import api from '@/api/api.js';
import {queryKw,queryDownDrk,rwconfirm,queryValidByKwcode,searchGwByCode,completedCkBySjrw,queryDownConfirmRk} from '@/api/dlapi.js'
import LocationInfo from '@/components/LocationInfo/LocationInfo.vue'
export default { export default {
components:{
LocationInfo
},
data() { data() {
return { return {
code:"",
index:-1,
kwcode:"",
modalName:"", modalName:"",
rkdjlist:[{ ckdjlist:[],
tpm:100010, clicknum:0,
kw:100031, switchUser:"N",
zt:'zt', xList:[]
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
}]
} }
}, },
filters: { filters: {
ckStatus:function(e){
let status={I:"待出库",C:"完成",F:"运输中"}
return status[e]
},
formatTime: function(time) { formatTime: function(time) {
if (time != null && time != "") { if (time != null && time != "") {
var date = new Date(time); var date = new Date(time);
...@@ -92,53 +93,152 @@ ...@@ -92,53 +93,152 @@
} }
}, },
methods: { methods: {
searchKwm(){ switchbt(){
/* 三种状态,1,对应库位入库,2,不对应库位,3,非界面的库位 */ if(this.switchUser=="N"){
this.switchUser="Y"
}else{
this.switchUser="N"
}
this.apiQueryDownDrk()
},
apiQueryDownDrk(){
let params={switchUser:this.switchUser}
queryDownConfirmRk(params).then(e=>{
if(e){
this.index=-1
this.ckdjlist=[]
e.records.forEach(data=>{
data.selected=false
this.ckdjlist.push(data)
})
}
})
},
searchQlqm(){
let that=this
if(!this.ckdjlist[0]){
this.$tip.toast("目前无可出库数据")
return
}
if(!this.code){
this.$tip.toast("请输入取料区码")
return
}
searchGwByCode({code:this.code}).then(e=>{
if(e&&e.records&&e.records.id){
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '确认入库', content: '确认入库',
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
console.log('用户点击确定'); completedCkBySjrw({srcGwid:e.records.id,rwid:that.ckdjlist[0].id}).then(e=>{
if(e){
that.$tip.toast("出库成功")
that.apiQueryDownDrk()
}
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}else{
that.$tip.toast("查询错误")
that.code=""
}
})
},
searchKwm(){
let that=this
if(!this.kwcode){
this.$tip.toast("请输入库位码")
return
}
queryValidByKwcode({kwcode:this.kwcode}).then(e=>{
if(e){
uni.showModal({
title: '提示',
content: '准备出库',
success: function (res) {
if (res.confirm) {
rwconfirm({rwid:e.records.id}).then(data=>{
if(data){
that.apiQueryDownDrk
that.$tip.toast("状态变更成功")
}
})
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消'); console.log('用户点击取消');
} }
} }
}); });
}else{
this.kwcode=""
}
})
},
transData(data){
let xList=[]
data.forEach(e=>{
if(!xList[e.kwx-1]){
xList[e.kwx-1]=[]
}
if(!xList[e.kwx-1][e.kwy-1]){
xList[e.kwx-1][e.kwy-1]=[]
}
xList[e.kwx-1][e.kwy-1][e.kwz-1]=e
})
this.xList=xList
}, },
longtapTb(item,index){ longtapTb(item,index){
if(item.selected){ if(item.selected){
this.modalName="Modal" this.modalName="Modal"
}else{ }else{
if(this.rkdjlist[index].selected==true){ if(this.ckdjlist[index].selected==true){
this.rkdjlist[index].selected=false this.ckdjlist[index].selected=false
this.index=-1
/* 清除选中值 */ /* 清除选中值 */
}else{ }else{
this.rkdjlist[index].selected=true this.ckdjlist[index].selected=true
/* 存储选中值 */ /* 存储选中值 */
this.index=index
} }
/* 清除其他选中值 */ /* 清除其他选中值 */
this.rkdjlist.forEach((e,eindex)=>{ this.ckdjlist.forEach((e,eindex)=>{
if(index!=eindex){ if(index!=eindex){
this.rkdjlist[eindex].selected=false this.ckdjlist[eindex].selected=false
} }
}) })
/* 库位图稍后搞 */
queryKw({ckid:item.ckid,kwid:item.kwid}).then(e=>{
if(e){
this.transData(e.records)
this.modalName="Modal" this.modalName="Modal"
}else{
this.$tip.toast("无库位图数据")
}
})
} }
}, },
selectTb(item,index){ selectTb(item,index){
if(this.rkdjlist[index].selected==true){ if(this.ckdjlist[index].selected==true){
this.rkdjlist[index].selected=false this.ckdjlist[index].selected=false
this.index=-1
/* 清除选中值 */ /* 清除选中值 */
}else{ }else{
this.rkdjlist[index].selected=true this.ckdjlist[index].selected=true
this.index=index
/* 存储选中值 */ /* 存储选中值 */
} }
/* 清除其他选中值 */ /* 清除其他选中值 */
this.rkdjlist.forEach((e,eindex)=>{ this.ckdjlist.forEach((e,eindex)=>{
if(index!=eindex){ if(index!=eindex){
this.rkdjlist[eindex].selected=false this.ckdjlist[eindex].selected=false
} }
}) })
}, },
...@@ -159,7 +259,7 @@ ...@@ -159,7 +259,7 @@
// 任务列表 // 任务列表
}, },
onLoad(e) { onLoad(e) {
this.apiQueryDownDrk()
} }
} }
</script> </script>
......
...@@ -135,11 +135,13 @@ ...@@ -135,11 +135,13 @@
} }
}, },
onLoad() { onLoad(e) {
if([]){ if(e.query){
console.log(true) let tpcode=JSON.parse(e.query).tpcode
this.tpcode=tpcode
this.apiGetTryinfo()
}else{ }else{
console.log(false) console.log("no message")
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment