Commit 4508ee6e authored by 李苏's avatar 李苏 💬

入库作业对接

parent a4eee81e
......@@ -24,22 +24,62 @@ export function getPower(params) {
}
/* 托盘查询 */
export function getTryinfo(params) {
params.ckid = eventBus.$ckid
return http.post('/xgwcs/tpmx/searchTpmxsByCode', params || {}).then(e => {
return filter(e)
})
}
/* 托盘调整 */
export function adjustTry(params) {
params.ckid = eventBus.$ckid
return http.post('/xgwcs/tp/adjustTpByCode ', params || {}).then(e => {
return filter(e)
})
}
/* 清空托盘 */
export function emptyTry(params) {
params.ckid = eventBus.$ckid
return http.post('/xgwcs/tp/emptyTpByCode', params || {}).then(e => {
return filter(e)
})
}
/* 配盘单号核验 */
export function checkDjid(params){
return http.post('/xgwcs/rktz/queryRktzdByDjid', params || {}).then(e => {
return filter(e)
})
}
/* 查询托盘状态 */
export function checkTpcode(params){
return http.post('/xgwcs/tp/searchTpByCode', params || {}).then(e => {
return filter(e)
})
}
/* 入库绑定 */
export function putinBind(params) {
return http.post('/xgwcs/rkzy/genRkzyByTpAndPhd', params || {}).then(e => {
return filter(e)
})
}
/* 入库登记表查询 */
export function queryUpDrk(params) {
return http.post('/xgwcs/rkzy/queryUpDrk', params || {}).then(e => {
return filter(e)
})
}
/* 检验库位码 */
export function checkKwcode(params) {
return http.post('/xgwcs/kwcx/searchKwByKwCode', params || {}).then(e => {
return filter(e)
})
}
/* 完成入库 */
export function completedRk(params) {
return http.post('/xgwcs/sjrw/completedRkBySjrw ', params || {}).then(e => {
return filter(e)
})
}
/* 删除任务 */
export function deleteRk(params) {
return http.post('/xgwcs/rkzy/delete', params || {}).then(e => {
return filter(e)
})
}
......@@ -76,82 +76,6 @@
<button class="cu-btn bg-gradual-orange wid30" @tap="clearbt()">托盘清空</button>
<button class="cu-btn bg-gradual-orange wid30" @tap="clearbt()">回库</button>
</view>
<view class="cu-modal" :class="modalName=='DialogModal1'?'show':''">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">提示</view>
<view class="action" @tap="hideModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xl bg-white">
是否叫料?
</view>
<view class="cu-bar bg-white justify-end">
<view class="action">
<button class="cu-btn line-green text-green" @tap="hideModal">取消</button>
<button class="cu-btn bg-green margin-left" @tap="apiqqjl()">确定</button>
</view>
</view>
</view>
</view>
<view class="cu-modal" :class="modalName=='DialogModal2'?'show':''">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">提示</view>
<view class="action" @tap="hideModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xl bg-white">
是否清空?
</view>
<view class="cu-bar bg-white justify-end">
<view class="action">
<button class="cu-btn line-green text-green" @tap="hideModal">取消</button>
<button class="cu-btn bg-green margin-left" @tap="clearinfo()">确定</button>
</view>
</view>
</view>
</view>
<view class="cu-modal" :class="modalName=='DialogModal3'?'show':''">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">提示</view>
<view class="action" @tap="hideModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xl bg-white">
是否取消叫料?
</view>
<view class="cu-bar bg-white justify-end">
<view class="action">
<button class="cu-btn line-green text-green" @tap="hideModal">取消</button>
<button class="cu-btn bg-green margin-left" @tap="apiqxjl()">确定</button>
</view>
</view>
</view>
</view>
<view class="cu-modal" :class="modalName=='DialogModal4'?'show':''">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">提示</view>
<view class="action" @tap="hideModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xl bg-white">
是否继续操作?
</view>
<view class="cu-bar bg-white justify-end">
<view class="action">
<button class="cu-btn line-green text-green" @tap="hideModal">取消</button>
<button class="cu-btn bg-green margin-left" @tap="apisd()">确定</button>
</view>
</view>
</view>
</view>
</view>
</template>
......@@ -260,6 +184,7 @@
},
/* 按钮 */
cmbt(){
let that=this
uni.showModal({
title: '提示',
content: '是否叫料',
......@@ -267,7 +192,7 @@
confirmText: "是", // 确认按钮的文字
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
console.log(that.wlinfor)
} else if (res.cancel) {
console.log('用户点击取消');
}
......@@ -613,19 +538,25 @@
/* 查询工位 */
},
onLoad(e) {
console.log("退回执行onload?")
setTimeout(()=>{
this.gwinfor=[{status:1,stationname:"测试站",name:"测试名称"},{status:2,stationname:"测试站",name:"测试名称"},{status:3,stationname:"测试站",name:"测试名称"}]
this.gwObj=this.gwinfor[0]
})
eventBus.$on('addressInfo', function(data){
eventBus.$on('sendInfo', function(data){
this.wlinfor=data.wlinfor
}.bind(this));
if(!e.query){
return
}
let einfor =JSON.parse(e.query)
},
onShow(){
console.log('退回执行onshow?')
},
onUnload(){
eventBus.$off('addressInfo')
console.log("onunload")
eventBus.$off('sendInfo')
clearInterval(this.interval_gwinfor)
},
onHide(){
......
......@@ -41,7 +41,10 @@
status:"",
gwjlinfor:{},
wlinfor:[
{test:"test"}
{wlcode:"code&re2119",wlname:"藏红花",wlgg:"10支/盒",tpcode:"tp001",wlph:"10010",ztsl:"100"},
{wlcode:"code&re2119",wlname:"板蓝根",wlgg:"10支/盒",tpcode:"tp001",wlph:"10010",ztsl:"100"},
{wlcode:"code&re2119",wlname:"兰伽颉",wlgg:"10支/盒",tpcode:"tp001",wlph:"10010",ztsl:"100"},
{wlcode:"code&re2119",wlname:"龙葵叶",wlgg:"10支/盒",tpcode:"tp001",wlph:"10010",ztsl:"100"},
]
}
......@@ -79,7 +82,7 @@
xzwl:"xzwl",
wlinfor:item
}
eventBus.$emit('addressInfo',"info");
eventBus.$emit('sendInfo',info);
uni.navigateBack({
delta: 1
});
......@@ -91,10 +94,8 @@
// })
},
gotoBackPage(){
this.$router.go(-1)
}
},
onLoad(e) {
if(!e.query){
......
<template>
<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="content">托盘信息绑定</block>
</cu-custom>
<view class="padding-xs bg-white">
<view class="cu-form-group ">
<view class="title">配盘单码</view>
<input :focus="ppdmFocus" @confirm="ppdmFocus=false;stpmFocus=true" placeholder="请扫描配盘单码"></input>
<input v-model="djid" :focus="djidFocus" @confirm="apiCheckDjid()" placeholder="请扫描配盘单码"></input>
</view>
</view>
<view class="padding-xs bg-white">
<view class="cu-form-group ">
<view class="title">扫托盘码</view>
<input :focus="stpmFocus" @confirm="searchTpm" placeholder="请扫描配盘单码"></input>
<input v-model="code" :focus="stpmFocus" @confirm="searchTpm" placeholder="请扫描配盘单码"></input>
</view>
</view>
<view class="padding flex justify-around bg-white ">
<button @tap="watchInfo" class="cu-btn bg-gradual-green xs " style="width: 50%;margin-top: 40vh;">查看入库登记信息</button>
<button @tap="watchInfo(true)" class="cu-btn bg-gradual-green xs " style="width: 50%;margin-top: 40vh;">查看入库登记信息</button>
</view>
</view>
</view>
......@@ -25,11 +25,13 @@
</template>
<script>
import {login} from '@/api/dlapi.js';
import {checkDjid,checkTpcode,putinBind} from '@/api/dlapi.js';
export default {
data() {
return {
ppdmFocus:true,
djid:"",
code:"",
djidFocus:true,
stpmFocus:false
}
},
......@@ -44,28 +46,97 @@
}
},
methods: {
apiCheckDjid() {
// djidFocus=false;stpmFocus=true
this.djidFocus=false;
if(this.djid){
checkDjid({djid:this.djid}).then(e=>{
if(e){
this.stpmFocus=true
}else{
this.djid=""
this.djidFocus=true
}
})
}else{
this.$tip.toast("请扫码配盘单码")
}
},
comfirmStpm(){
this.ppdmFocus=true
this.djidFocus=true
this.stpmFocus=false
},
searchTpm(){
this.stpmFocus=false
let that=this
if(!that.djid||!that.code){
that.$tip.toast("请填入必要信息")
return
}
checkTpcode({code:that.code}).then(e=>{
if(!e.records){
this.code=""
that.$tip.toast("请输入正确的托盘号")
this.stpmFocus=true
}else{
if(e.records.zt=="E"){
this.apiPutinBind()
}else if(e.records.zt=="U"){
this.code=""
that.$tip.toast("当前托盘正在使用")
this.stpmFocus=true
}else {
this.code=""
that.$tip.toast("当前托盘为在库状态")
this.stpmFocus=true
}
}
})
},
apiPutinBind(){
let that=this
uni.showModal({
title: '提示',
content: '配盘单码:PPM20220426001\n配盘单码:PPM20220426001',
cancelText: "继续扫描", // 取消按钮的文字
confirmText: "开始入库", // 确认按钮的文字
content: '配盘单码:'+that.djid+'\n配盘单码:'+that.code,
cancelText: "继续扫描",
confirmText: "开始入库",
success: function (res) {
that.comfirmStpm()
if (res.confirm) {
that.comfirmStpm()
that.watchInfo()
} else if (res.cancel) {
that.comfirmStpm()
let data={djid:that.djid,code:that.code}
putinBind(data).then(e=>{
if(e){
that.$tip.toast("绑定成功")
that.code=""
that.djid=""
that.comfirmStpm()
}
})
}
}
});
},
watchInfo(){
this.$Router.push({name:"putin_register"})
watchInfo(e){
if(e){
this.$Router.push({name:"putin_register"})
return
}
let that=this
let data={djid:that.djid,code:that.code}
putinBind(data).then(e=>{
if(e){
that.$tip.toast("绑定成功")
that.code=""
that.djid=""
this.$Router.push({name:"putin_register"})
}
})
},
// 确认按钮
......
<template>
<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="content">入库登记信息</block>
</cu-custom>
......@@ -74,17 +74,22 @@
<view class="tbtit_son">库位</view>
<view style="flex: 1;">状态</view>
</view>
<view class="tbtit_row " :class="item.selected?'selected':''" v-for="(item,index) in rkdjlist" :key="index" @tap="selectTb(item,index)">
<view class="tbtit_row_son1">{{item.tpm}}</view>
<view style="flex: 1">{{item.kw}}</view>
<view class="tbtit_row_son3">{{item.zt}}</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_son1">{{item.tpcode}}</view>
<view style="flex: 1">{{item.kwname}}</view>
<view class="tbtit_row_son3">{{item.zt|ckStatus}}</view>
</view>
<view class="tbtit_row " style="display: flex;" v-if="!rkdjlist[0]" >
<span style="flex: 1;">
暂无数据
</span>
</view>
</view>
<view class="padding flex justify-around bg-white ">
<view class="padding-xs bg-white" style="">
<view class="cu-form-group ">
<view class="title">库位码</view>
<input :focus="kwmFocus" @confirm="searchKwm()" placeholder="扫描库位码"></input>
<input :focus="kwmFocus" v-model="code" @confirm="searchKwm()" placeholder="扫描库位码"></input>
</view>
</view>
</view>
......@@ -95,44 +100,28 @@
<script>
import api from '@/api/api.js';
import {queryUpDrk,checkKwcode,completedRk,deleteRk} from '@/api/dlapi.js'
export default {
watch:{
clicknum(newValue,oldValue){
console.log('新值:'+newValue,'旧值:'+oldValue)
}
},
data() {
return {
index:-1,
code:"",
clicknum:0,
kwmFocus:true,
modalName:"",
rkdjlist:[{
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
}]
rkdjlist:[]
}
},
filters: {
ckStatus:function(e){
let status={I:"待入库",C:"完成"}
return status[e]
},
formatTime: function(time) {
if (time != null && time != "") {
var date = new Date(time);
......@@ -143,32 +132,86 @@
}
},
methods: {
cancelbt(){
uni.showModal({
title: '提示',
content: '是否解除绑定信息',
cancelText: "否", // 取消按钮的文字
confirmText: "是", // 确认按钮的文字
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
let that=this
if(this.index==-1){
this.$tip.toast("请选中一条数据")
return
}else{
uni.showModal({
title: '提示',
content: '是否解除绑定信息',
cancelText: "否", // 取消按钮的文字
confirmText: "是", // 确认按钮的文字
success: function (res) {
if (res.confirm) {
that.modalName=""
let data={rwid:that.rkdjlist[that.index].id}
deleteRk(data).then(e=>{
if(e){
that.$tip.toast("解除绑定信息成功")
that.apiQueryUpDrk()
}
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
},
searchKwm(){
let that=this
this.kwmFocus=false
let that=this
if(!this.code){
this.$tip.toast("请输入库位码")
this.kwmFocus=true
return
}
if(this.index==-1){
this.$tip.toast("请选中一条信息")
this.kwmFocus=true
return
}
checkKwcode({code:this.code,kwid:this.rkdjlist[this.index].kwid}).then(e=>{
if(e){
if(that.code==that.rkdjlist[that.index].kwname&&e.records.zt=="L"){
return {rwid:that.rkdjlist[that.index].id,destKwid:e.records.id,text:"是否确认入库"}
}else if(e.code!=that.code&&e.records.zt=="E"){
return {rwid:that.rkdjlist[that.index].id,destKwid:e.records.id,text:"当前库位和已输库位不一致,是否入库"}
}else{
that.$tip.toast("请核对扫描和已选信息,当前状态无法入库")
}
}else{
that.code=""
}
}).then(s=>{
if(s){
that.apiCompletedRk(s)
}
})
/* 三种状态,1,对应库位入库,2,不对应库位,3,非界面的库位 */
},
apiCompletedRk(data){
let that=this
uni.showModal({
title: '提示',
content: '确认入库',
content: data.text||"",
success: function (res) {
if (res.confirm) {
that.kwmFocus=true
console.log('用户点击确定');
completedRk(data).then(e=>{
if(e){
that.$tip.toast("入库成功")
that.code=""
that.apiQueryUpDrk()
}
})
} else if (res.cancel) {
that.kwmFocus=true
console.log('用户点击取消');
......@@ -176,13 +219,37 @@
}
});
},
longtapTb(item,index){
if(item.selected){
this.modalName="Modal"
}else{
if(this.rkdjlist[index].selected==true){
this.rkdjlist[index].selected=false
this.index=-1
/* 清除选中值 */
}else{
this.rkdjlist[index].selected=true
this.index=index
/* 存储选中值 */
}
/* 清除其他选中值 */
this.rkdjlist.forEach((e,eindex)=>{
if(index!=eindex){
this.rkdjlist[eindex].selected=false
}
})
this.modalName="Modal"
}
},
selectTb(item,index){
this.modalName="Modal"
if(this.rkdjlist[index].selected==true){
this.rkdjlist[index].selected=false
this.index=-1
/* 清除选中值 */
}else{
this.rkdjlist[index].selected=true
this.index=index
/* 存储选中值 */
}
/* 清除其他选中值 */
......@@ -191,14 +258,24 @@
this.rkdjlist[eindex].selected=false
}
})
console.log(this.rkdjlist)
},
watchInfo(){
this.$router.push({name:"putin_register"})
},
// 确认按钮
/* 获取表格数据 */
apiQueryUpDrk(){
queryUpDrk().then(e=>{
if(e.records){
this.index=-1
this.rkdjlist=[]
e.records.forEach(data=>{
data.selected=false
this.rkdjlist.push(data)
})
}
})
},
hideModal(e) {
this.modalName = null
},
......@@ -210,7 +287,7 @@
// 任务列表
},
onLoad(e) {
this.apiQueryUpDrk()
}
}
</script>
......
<template>
<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="content">出库登记信息</block>
</cu-custom>
......@@ -70,7 +70,7 @@
<view class="tbtit_son">库位</view>
<view style="flex: 1;">状态</view>
</view>
<view class="tbtit_row " :class="item.selected?'selected':''" v-for="(item,index) in rkdjlist" :key="index" @tap="selectTb(item,index)">
<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_son1">{{item.tpm}}</view>
<view style="flex: 1">{{item.kw}}</view>
<view class="tbtit_row_son3">{{item.zt}}</view>
......@@ -132,7 +132,8 @@
kw:100031,
zt:'zt',
selected:false
}]
}],
clicknum:0
}
},
filters: {
......@@ -174,8 +175,28 @@
}
});
},
longtapTb(item,index){
if(item.selected){
this.modalName="Modal"
}else{
if(this.rkdjlist[index].selected==true){
this.rkdjlist[index].selected=false
/* 清除选中值 */
}else{
this.rkdjlist[index].selected=true
/* 存储选中值 */
}
/* 清除其他选中值 */
this.rkdjlist.forEach((e,eindex)=>{
if(index!=eindex){
this.rkdjlist[eindex].selected=false
}
})
this.modalName="Modal"
}
},
selectTb(item,index){
this.modalName="Modal"
if(this.rkdjlist[index].selected==true){
this.rkdjlist[index].selected=false
/* 清除选中值 */
......@@ -189,7 +210,6 @@
this.rkdjlist[eindex].selected=false
}
})
console.log(this.rkdjlist)
},
watchInfo(){
this.$router.push({name:"putin_register"})
......
......@@ -24,7 +24,7 @@
<view class="tbtit_son">库位</view>
<view style="flex: 1;">状态</view>
</view>
<view class="tbtit_row " :class="item.selected?'selected':''" v-for="(item,index) in rkdjlist" :key="index" @tap="selectTb(item,index)">
<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_son1">{{item.tpm}}</view>
<view style="flex: 1">{{item.kw}}</view>
<view class="tbtit_row_son3">{{item.zt}}</view>
......@@ -106,8 +106,28 @@
}
});
},
longtapTb(item,index){
if(item.selected){
this.modalName="Modal"
}else{
if(this.rkdjlist[index].selected==true){
this.rkdjlist[index].selected=false
/* 清除选中值 */
}else{
this.rkdjlist[index].selected=true
/* 存储选中值 */
}
/* 清除其他选中值 */
this.rkdjlist.forEach((e,eindex)=>{
if(index!=eindex){
this.rkdjlist[eindex].selected=false
}
})
this.modalName="Modal"
}
},
selectTb(item,index){
this.modalName="Modal"
if(this.rkdjlist[index].selected==true){
this.rkdjlist[index].selected=false
/* 清除选中值 */
......@@ -121,7 +141,6 @@
this.rkdjlist[eindex].selected=false
}
})
console.log(this.rkdjlist)
},
watchInfo(){
this.$router.push({name:"putin_register"})
......
......@@ -2,12 +2,8 @@
<view>
<scroll-view scroll-y class="page">
<!-- 头部logo-->
<view class="UCenter-bg" @click="remove">
<image :src="personalList.avatar" round class="png animation-slide-right margin-bottom-sm" mode="widthFix" :style="[{animationDelay: '0.1s'}]"></image>
<view class="text-xl animation-slide-left" :style="[{animationDelay: '0.2s'}]">
{{personalList.depart}}
</view>
<image src="/static/wave.gif" mode="scaleToFill" class="gif-wave"></image>
<view class="UCenter-bg" >
<img src="/static/home/u3.png" alt="" style="height: 100%;width: 100%;" srcset="">
</view>
<view class="padding flex text-center text-grey bg-white shadow-warp">
<view class="flex flex-sub flex-direction solid-right animation-slide-top" :style="[{animationDelay: '0.2s'}]">
......
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