<template>
|
<view>
|
<view class="list list-font-color shop-car" :class="orderDetl.color" v-for="(orderDetl,index) in orderCarList" :key="index">
|
<view class="list-left">
|
<view class="detl-threeCode">{{orderDetl.threeCode}}</view>
|
<view>库位号:{{orderDetl.locNo}}</view>
|
<view>托盘码:{{orderDetl.barcode}}</view>
|
<view>库位状态:{{orderDetl.locSts}}</view>
|
<view>满板:{{orderDetl.fullPlt}}</view>
|
</view>
|
<view class="list-right" @click="chageDetl(orderDetl)">
|
<uni-icons type="upload-filled" size="25" color="#fff" v-if="orderDetl.locSts == 'F'"></uni-icons>
|
<uni-icons type="upload-filled" size="25" color="#fff" v-if="orderDetl.locSts == 'R' || orderDetl.locSts == 'S' || orderDetl.locSts == 'Q'"></uni-icons>
|
<uni-icons type="download" size="25" color="#fff" v-if="orderDetl.locSts == 'P'"></uni-icons>
|
</view>
|
</view>
|
<!-- 垫高 -->
|
<view style="height: 120rpx;"></view>
|
<!-- 底部操作按钮 -->
|
<!-- <view class="buttom">
|
<button size="mini" type="primary" @click="agvStart('warn')">确认组托</button>
|
</view> -->
|
<!-- 弹窗 -->
|
<view>
|
<uni-popup ref="chageDetl" type="dialog">
|
<view class="popup">
|
<!-- 标题 -->
|
<view class="title">入库数量</view>
|
<view class="popup-item">
|
<uni-number-box :value="count" :step='1' :max="9999999" color="#747474" @change="changeValue" />
|
</view>
|
<view class="btn">
|
<view class="btn-left" @click="remove()">移除物料</view>
|
<view class="btn-right" @click="changeCount()">修改数量</view>
|
</view>
|
</view>
|
</uni-popup>
|
</view>
|
|
<!-- 弹窗 -->
|
<view>
|
<uni-popup ref="stapop" type="dialog">
|
<view class="popup">
|
<!-- 标题 -->
|
<view class="title">站点选择</view>
|
<view class="popup-item">
|
<uni-combox style="height: 20px;" :candidates="staNos" placeholder="请选择补料出库站点" v-model="staNo"></uni-combox>
|
</view>
|
<view class="btn">
|
<view class="btn-left" @click="mergeOutCancel()">取消</view>
|
<view class="btn-right" @click="mergeOut()">并板出库</view>
|
</view>
|
</view>
|
</uni-popup>
|
</view>
|
|
<!-- 弹窗 -->
|
<view>
|
<uni-popup ref="merge" type="dialog">
|
<view class="popup">
|
<!-- 标题 -->
|
<view class="title">站点选择</view>
|
<view class="popup-item">
|
<view class="popup-item-left">数量:</view>
|
<view class="popup-item-right" style="border: none;">
|
<uni-number-box :value="anfme" :step='1' :max="maxAnfme" color="#747474" @change="changeValue2" />
|
</view>
|
</view>
|
<view class="popup-item">
|
<view class="popup-item-left">满板:</view>
|
<view class="popup-item-right" style="border: none;">
|
<radio-group @change="isFullPlt">
|
<label>
|
<radio :checked="ck1" style="transform: scale(0.7)"/><text>是</text>
|
</label>
|
<label>
|
<radio :checked="ck2" style="margin-left: 50rpx;transform: scale(0.7);"/><text>否</text>
|
</label>
|
</radio-group>
|
</view>
|
</view>
|
<view class="btn">
|
<view class="btn-left" @click="mergeCancel()">取消</view>
|
<view class="btn-right" @click="mergeConfirm()">确认并板</view>
|
</view>
|
</view>
|
</uni-popup>
|
</view>
|
|
<!-- 弹窗 -->
|
<view>
|
<uni-popup ref="agvStart" type="dialog">
|
<view class="popup">
|
<!-- 标题 -->
|
<view class="title">组托</view>
|
<view class="popup-item">
|
<view class="popup-item-left">托盘码:</view>
|
<view class="popup-item-right"><input type="text" focus="true" v-model="barcode"></view>
|
</view>
|
|
<view class="popup-item">
|
<view class="popup-item-left">满板:</view>
|
<view class="popup-item-right" style="border: none;">
|
<radio-group @change="isFullPlt">
|
<label>
|
<radio :checked="ck1" style="transform: scale(0.7)"/><text>是</text>
|
</label>
|
<label>
|
<radio :checked="ck2" style="margin-left: 50rpx;transform: scale(0.7);"/><text>否</text>
|
</label>
|
</radio-group>
|
</view>
|
</view>
|
|
<view class="btn">
|
<button class="btn-left" @click="agvStartClose()">取消</button>
|
<button class="btn-right" @click="agvStartConfirm()" :disabled="agvStartDis">组托</button>
|
</view>
|
</view>
|
</uni-popup>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
// todo: 购物车优化,存储购物车内容,退出页面再进后购物车还在
|
export default {
|
data() {
|
return {
|
orderCarList: [],
|
count: 0,
|
index: 0,
|
barcode: '',
|
agvDevp: '',
|
agvStartDis: false,
|
ck1: false,
|
ck2: true,
|
fullPlt: 'N',
|
locNo: '',
|
staNo: '',
|
staNos: [100,102,104,200,202,204,300,302,304],
|
detls: '',
|
anfme: 0,
|
maxAnfme: 0
|
}
|
},
|
onShow() {
|
let _this = this
|
this.baseUrl = uni.getStorageSync('baseUrl');
|
this.token = uni.getStorageSync('token');
|
// const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
|
const eventChannel = this.getOpenerEventChannel();
|
// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
|
eventChannel.on('locMasts', function(data) {
|
_this.orderCarList = data.locMasts
|
})
|
eventChannel.on('detls', function(data) {
|
_this.detls = data.detls
|
_this.maxAnfme = data.detls.anfme - data.detls.workQty
|
})
|
},
|
methods: {
|
// 是否满板
|
isFullPlt() {
|
var temp = this.ck1
|
this.ck1 = this.ck2
|
this.ck2 = temp
|
if (this.ck1) {
|
this.fullPlt = '1'
|
} else {
|
this.fullPlt = '0'
|
}
|
},
|
chageDetl(locMast) {
|
// 库位状态为 F 可出库
|
// 库位状态为 R,S,Q 不可操作
|
// 库位状态为 P 并板组托操作
|
let _this = this
|
switch (locMast.locSts) {
|
case 'F':
|
this.locNo = locMast.locNo
|
if (locMast.fullPlt == 'Y') {
|
uni.showToast({ title: '当前库位已标记为满板', icon: 'error',position: 'top' })
|
return
|
}
|
this.$refs.stapop.open('center')
|
break;
|
case 'P':
|
this.locNo = locMast.locNo
|
this.barcode = locMast.barcode
|
this.$refs.merge.open('center')
|
break;
|
}
|
|
|
},
|
mergeOutCancel() {
|
this.$refs.stapop.close()
|
},
|
// 并板出库
|
mergeOut() {
|
// 选择出库站,提交出库库位号
|
let _this = this
|
uni.request({
|
url: _this.baseUrl + '/mobile/merge/out/auth',
|
data: {locNo: _this.locNo,
|
staNo: _this.staNo,},
|
method: 'GET',
|
header: {
|
'token': uni.getStorageSync('token')
|
},
|
success(result) {
|
var res = result.data
|
_this.agvStartDis = false
|
if (res.code === 200) {
|
_this.$refs.stapop.close()
|
uni.showToast({ title: '出库成功', icon: "error", position: 'top' })
|
setTimeout(()=> {
|
_this.getOpenerEventChannel().emit('acceptDataFromOpenedPage', {data: 1});
|
uni.navigateBack({
|
delta:2
|
})
|
},1000)
|
} else if (res.code == 403) {
|
uni.showToast({ title: res.msg, icon: "error", position: 'top' })
|
setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000);
|
} else {
|
uni.showToast({ title: res.msg, icon: "error", position: 'top' })
|
}
|
},
|
fail(res) {
|
_this.agvStartDis = false
|
}
|
});
|
},
|
mergeCancel() {
|
this.$refs.merge.close()
|
},
|
// 并板组托
|
mergeConfirm() {
|
let _this = this
|
let combMats = []
|
_this.detls['locNo'] = _this.locNo
|
_this.detls.anfme = _this.anfme
|
combMats.push(_this.detls)
|
uni.request({
|
url: _this.baseUrl + '/mobile/merge/comb2/auth',
|
data: JSON.stringify({
|
barcode: _this.barcode,
|
isFull: _this.fullPlt,
|
combMats: combMats
|
}),
|
method: 'POST',
|
header: {
|
'token': uni.getStorageSync('token')
|
},
|
success(result) {
|
var res = result.data
|
_this.agvStartDis = false
|
if (res.code === 200) {
|
_this.$refs.merge.close()
|
uni.showToast({ title: res.msg, icon: "success", position: 'top' })
|
setTimeout(()=> {
|
_this.getOpenerEventChannel().emit('acceptDataFromOpenedPage', {data: 1});
|
uni.navigateBack({
|
delta:2
|
})
|
},1000)
|
} else if (res.code == 403) {
|
uni.showToast({ title: res.msg, icon: "error", position: 'top' })
|
setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000);
|
} else {
|
uni.showToast({ title: res.msg, icon: "error", position: 'top' })
|
}
|
},
|
fail(res) {
|
_this.agvStartDis = false
|
}
|
});
|
},
|
// 修改数量
|
changeCount() {
|
if (this.count > this.orderCarList[this.index].anfme) {
|
uni.showToast({ title: '数量不合法!', icon: "none", position: 'top' })
|
return
|
}
|
this.orderCarList[this.index].pakinQty = this.count
|
this.$forceUpdate() // 强制刷新
|
this.$refs.chageDetl.close()
|
},
|
// 移除物料
|
remove() {
|
this.orderCarList.splice(this.index, 1)
|
this.$refs.chageDetl.close()
|
},
|
changeValue(value) {
|
this.count = value
|
},
|
changeValue2(value) {
|
this.anfme = value
|
},
|
agvStart() {
|
this.$refs.agvStart.open()
|
},
|
agvStartClose() {
|
this.barcode = ''
|
this.agvDevp = ''
|
this.$refs.agvStart.close()
|
},
|
agvStartConfirm() {
|
this.barcode = this.barcode.replace(/\s+/g, '')
|
let _this = this
|
if (_this.barcode === '') {
|
uni.showToast({ title: '托盘码为空!', icon: "error", position: 'top' })
|
return;
|
}
|
if (_this.orderCarList.length === 0) {
|
uni.showToast({ title: '组托列表为空!', icon: "error", position: 'top' })
|
return;
|
}
|
for (let k of _this.orderCarList) {
|
if (k.pakinQty == 0) {
|
uni.showToast({ title: `${k.matnr}数量不能为 0 !`, icon: "error", position: 'top' })
|
return;
|
}
|
}
|
let combMat = { orderNo:'', barcode: '', locNo: '', combMats: [] }
|
let combMats = []
|
// for (let item of _this.orderCarList) {
|
// combMat.orderNo = item.orderNo
|
// combMat.barcode = _this.barcode
|
// combMat.locNo = _this.agvDevp
|
// combMat.combMats = []
|
// let combM = {csocode: item.threeCode,isoseq: item.deadTime,matnr: item.matnr,batch: item.batch,anfme: item.pakinQty,maktx: item.maktx,specs: item.specs,processSts: item.processSts}
|
// combMat.combMats.push(combM)
|
// combMats.push({...combMat})
|
// }
|
for (let detl of _this.orderCarList) {
|
detl.anfme = detl.pakinQty
|
combMats.push(detl)
|
}
|
this.comb(combMats)
|
|
},
|
comb(combMats) {
|
let _this = this;
|
this.agvStartDis = true
|
uni.request({
|
url: _this.baseUrl + '/mobile/comb/auth3',
|
data: JSON.stringify({
|
barcode: _this.barcode,
|
isFull: _this.fullPlt,
|
combMats: combMats
|
}),
|
method: 'POST',
|
header: {
|
'token': uni.getStorageSync('token')
|
},
|
success(result) {
|
var res = result.data
|
_this.agvStartDis = false
|
if (res.code === 200) {
|
_this.orderCarList = []
|
_this.$refs.agvStart.close()
|
uni.showToast({ title: '启动成功!', icon: "success", position: 'top' })
|
setTimeout(()=> {
|
_this.getOpenerEventChannel().emit('acceptDataFromOpenedPage', {data: 1});
|
uni.navigateBack({})
|
},1000)
|
} else if (res.code == 403) {
|
uni.showToast({ title: res.msg, icon: "error", position: 'top' })
|
setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000);
|
} else {
|
uni.showToast({ title: res.msg, icon: "error", position: 'top' })
|
}
|
},
|
fail(res) {
|
_this.agvStartDis = false
|
}
|
});
|
},
|
}
|
}
|
</script>
|
|
<style>
|
@import url('../../static/css/order.css');
|
.shop-car {
|
background-color: #2299ff;
|
color: #fff;
|
}
|
.detl-threeCode {
|
font-size: 28px;
|
font-weight: bold;
|
}
|
.popup {
|
width: 80vw;
|
min-height: 100rpx;
|
background-color: #FFF;
|
border-radius: 25rpx;
|
position: relative;
|
}
|
.title {
|
height: 100rpx;
|
line-height: 100rpx;
|
width: 100%;
|
color: #606266;
|
text-align: center;
|
font-size: 16px;
|
}
|
.popup-item {
|
height: 80rpx;
|
line-height: 80rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
.popup-item-left {
|
width: 20vw;
|
padding-right: 20rpx;
|
text-align: right;
|
color: #606266;
|
}
|
.popup-item-right {
|
display: flex;
|
align-items: center;
|
width: 50vw;
|
height: 50rpx;
|
padding: 2px 5px;
|
border: 1px solid #E4E7ED;
|
border-radius: 5rpx;
|
}
|
.popup-item-right input{
|
color: #606266;
|
}
|
.btn {
|
display: flex;
|
height: 90rpx;
|
margin-top: 20rpx;
|
border-top: 1px solid #DCDFE6;
|
justify-content: center;
|
align-items: center;
|
}
|
.btn-left {
|
display: flex;
|
flex: 1;
|
height: 100%;
|
justify-content: center;
|
align-items: center;
|
color: #e2231a;
|
border-right: 1px solid #DCDFE6;
|
}
|
.btn-right {
|
display: flex;
|
flex: 1;
|
height: 100%;
|
justify-content: center;
|
align-items: center;
|
color: #409EFF;
|
}
|
</style>
|