Browse Source

修改拆箱数量校验

pda_nev
李俊城 11 months ago
parent
commit
f66a56a8c4
  1. 8
      fe/PDA/mycomponents/coms/comUnPacking.vue
  2. 40
      fe/PDA/pages/message/index.vue
  3. 3
      fe/PDA/pages/request/kittingIssueRequest.vue
  4. 96
      fe/PDA/pages/return/productionReturnFg.vue
  5. 12
      fe/PDA/pages/return/productionReturnRaw.vue
  6. 9
      fe/PDA/pages/task/thirdLocationDetail.vue

8
fe/PDA/mycomponents/coms/comUnPacking.vue

@ -24,8 +24,9 @@
</view>
</view>
<comMessage ref="comMessage" @afterClose="cancle()"></comMessage>
<comMessage ref="refMessage" ></comMessage>
</uni-popup>
</view>
</template>
@ -127,8 +128,9 @@
let qty = Number(that.value);
if (that.vaildMaxValue) {
if (qty > that.defaultValue) {
this.showMessage('数量不能大于' + that.defaultValue);
that.value = that.defaultValue;
this.showMessage('数量不能大于' + that.defaultValue);
} else {
if (!that.allowZero) //0
{
@ -255,7 +257,7 @@
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
this.$refs.refMessage.showMessage(message);
},

40
fe/PDA/pages/message/index.vue

@ -1,23 +1,22 @@
<template>
<view class="" style="width: 100%;height: 100%; background-color: #fff;">
<scroll-view scroll-y="" >
<scroll-view class="">
<view class="" v-for="(menuTab,index) in menuTabs" :key="index">
<view class="" v-bind:id="'tabNum'+index" @click="swichMenu(index)" clickable>
<scroll-view scroll-y >
<scroll-view class="top-menu-view" scroll-x="true" :scroll-left="scrollLeft">
<block v-for="(menuTab,index) in menuTabs" :key="index">
<view class="menu-topic-view" v-bind:id="'tabNum'+index" @click="swichMenu(index)" clickable>
<view :class="[currentTab==index ? 'menu-topic-act' : 'menu-topic']">
<view class="menu-topic-txt" style="font-size: 35rpx; margin-left: 10rpx;">{{menuTab.name}}
<text v-if="menuTab.name == '未读'">
({{Math.abs(unreadCount)>99?'99+':unreadCount==0?'':unreadCount}})</text>
<view class="menu-topic-txt">{{menuTab.name}}
<!-- <text v-if="menuTab.name == '全部'"
:class="[allMessageList.length>0?'tipred':'' ]">{{Math.abs(allMessageList.length)>99?'99+':allMessageList.length==0?'':allMessageList.length}}</text> -->
<text v-if="menuTab.name == '未读'"
:class="[unreadCount>0?'tipred':'' ]">{{Math.abs(unreadCount)>99?'99+':unreadCount==0?'':unreadCount}}</text>
</view>
<view class=""
style="width: 150rpx; height: 6rpx; margin: 10rpx; background-color: #5A7CF3">
<view class="menu-topic-bottom">
<view class="menu-topic-bottom-color"></view>
</view>
</view>
</view>
</view>
</block>
</scroll-view>
<uni-list class="list msg_list" style="margin-bottom: 200rpx;" >
<uni-list :border="true" v-for="(item ,index) in allMessageList" :key="item.id">
@ -100,8 +99,11 @@
currentTab: 0,
// Tab
menuTabs: [{
name: '未读'
name: '全部'
},
{
name: '未读'
},
// {
// name: ''
// }, {
@ -158,11 +160,11 @@
swichMenu: async function(current) { // menu
console.log("cc", current)
if (this.currentTab == current) {
return false;
} else {
this.currentTab = current;
this.currentTab =current;
if(this.currentTab==0){
this.getMessageList()
}else if(this.currentTab==1){
this.allMessageList=this.allMessageList.filter(r=>!r.hasRead)
}
},

3
fe/PDA/pages/request/kittingIssueRequest.vue

@ -41,7 +41,8 @@
<uni-th width="80">库位</uni-th>
<uni-th width="240" align="center">
<view class="text_packingCode">
{{ item.locationCode }}({{item.locationName}})
<text>{{ item.locationCode }}</text>
<text v-if="item.locationName">({{item.locationName}})</text>
</view>
</uni-th>
</uni-tr>

96
fe/PDA/pages/return/productionReturnFg.vue

@ -32,15 +32,23 @@
<view class="text_lightblue font_xs">{{item.itemName }}</view>
</view>
<view class="ljh_right">
<text class="tnum">{{item.qty}}</text>
<text class="tunit">{{item.uom}}</text>
<view class="uni-flex uni-row u-col-center">
<com-number-box :ref="'comNumberBox_'+index" v-model="item.qty"
:max="99999" :min="0"
@change="qtyChanged($event,item,index)">
</com-number-box>
<text class="" style="margin-left: 8rpx;">{{item.uom}}</text>
</view>
<!-- <text class="tnum">{{item.qty}}</text> -->
</view>
</view>
</view>
<view class="cell_box">
<view class="uni-flex uni-row fl">
<view class="cell_info">
<view class="text_lightblue">源库位</view>
<view class="text_lightblue">源库位</view>
<view class="text_black font_sm">{{ item.locationCode }}
</view>
</view>
@ -106,6 +114,7 @@
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue'
import SemiCollapseItem from '@/mycomponents/common/SemiCollapseItem.vue'
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue'
import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
export default {
name: 'returnToWarehouse',
@ -120,7 +129,8 @@
comBalance,
winCollapseLocation,
SemiCollapseItem,
winScanByProductCode
winScanByProductCode,
comNumberBox
},
data() {
return {
@ -226,7 +236,7 @@
this.getLabel(result.itemCode);
}
},
async getLabel(itemCode) {
@ -238,7 +248,14 @@
let balanceParams = [this.fromLocation.code]
let balanceRes = await getRecommendBalanceByLocationAsync(balanceParams,itemCode,false);
let balanceRes = await getRecommendBalanceByLocationAsync(balanceParams, itemCode, false);
//
if (balanceRes.error) {
uni.hideLoading();
this.showMessage(balanceRes.error.message)
return;
}
if (balanceRes.length == 0) {
this.showScanMessage('零件【' + itemCode + '】在【' + this.fromLocation.code +
'】库位没有库存信息,不可以退库');
@ -246,12 +263,12 @@
let balanceItem = balanceRes[0];
let item = {
itemCode: itemCode,
itemName:balanceItem.itemName,
itemName: balanceItem.itemName,
totalQty: balanceItem.qty,
uom: balanceItem.uom,
locationCode:this.fromLocation.code,
locationCode: this.fromLocation.code,
scanQty: 0,
qty:balanceItem.qty,
qty: balanceItem.qty,
status: balanceItem.status,
balanceItem: balanceItem,
labelList: []
@ -265,13 +282,13 @@
addLabel(item) {
//
if (item.labelList.length == 0) {
let data = this.itemList.find(r => r.itemCode == item.itemCode)
if (data == undefined) {
this.itemList.push(item)
}
this.calcScanQty(item, 0)
item.labelList.unshift(item);
this.scanPopupGetFocus();
let data = this.itemList.find(r => r.itemCode == item.itemCode)
if (data == undefined) {
this.itemList.push(item)
}
this.calcScanQty(item, 0)
item.labelList.unshift(item);
this.scanPopupGetFocus();
} else {
let scanQty = 0;
item.labelList.forEach(r => {
@ -285,7 +302,7 @@
calcScanQty(item, scanQty) {
item.scanQty = scanQty + item.qty;
//
// this.item.locationCode = this.fromLocation.code;
// this.item.status = 2;
@ -299,17 +316,26 @@
//
getDefaultToLocation(locationCode) {
let that = this;
if (locationCode == this.fromLocation.code) {
this.showMessage('来源库位【' + this.fromLocation.code + '】不能与目标库位【' + locationCode + '】相同');
this.$refs.comCollapseLocation.clearLocation();
return;
}
uni.showLoading({
title: "扫描中",
mask: true
});
locations(locationCode).then(res => {
uni.hideLoading();
if (res == null) {
that.showMessage('目标库位【' + locationCode + '】不存在');
} else {
if (res.type == 2 || res.type == 3 || res.type == 4 || res.type == 6) {
var locationType = res.type
//
if (locationType == 1 || locationType == 6 || locationType == 13) {
that.showMessage('目标库位的库位类型不可以是【待检库】或【隔离库】或【在途】')
} else {
showConfirmMsg('是否要将所有未扫描目标库位的零件,指定目标库位【' + locationCode + '】',
confirm => {
if (confirm) {
@ -324,11 +350,9 @@
})
}
});
} else {
that.showMessage('目标库位的库位类型必须是【原料库】或【半成品库】或【成品库】或【隔离库】')
}
}
uni.hideLoading();
}).catch(err => {
that.toLocation = null;
that.showMessage(err.message);
@ -341,8 +365,8 @@
this.showMessage('目标库位不能为空');
return;
}
if (code == this.currentItem.fromLocationCode) {
this.showMessage('源库位【' + this.currentItem.fromLocationCode + '】与目标库位【' + code + '】不能相同');
if (code == this.fromLocation.code) {
this.showMessage('源库位【' + this.fromLocation.code + '】不能与目标库位【' + code + '】相同');
return;
}
uni.showLoading({
@ -410,7 +434,7 @@
let item = this.getSubmitParam();
let params = JSON.stringify(item);
console.log("提交",params)
console.log("提交", params)
returnToWarehouse(params)
.then(res => {
that.showCommitSuccess();
@ -512,6 +536,27 @@
return item;
},
qtyChanged(value, item, index) {
if (value <= 0) {
this.showMessage('退数量必须大于0')
item.qty = item.totalQty
this.$refs['comNumberBox_' + index][0].setValue(item.qty);
} else {
if (value > item.totalQty) {
this.showMessage("退货数量[" + value + "]不能大于库存数量[" + item.totalQty + "]");
item.qty = item.totalQty
this.$refs['comNumberBox_' + index][0].setValue(item.qty);
}
}
this.itemList.forEach(res => {
res.scanQty = 0
res.labelList.forEach(item => {
res.scanQty = res.scanQty + value
})
})
this.$forceUpdate()
},
cancel() {
let that = this;
showConfirmMsg('是否要清空已扫描的零件和库位信息?', confirm => {
@ -527,6 +572,7 @@
that.fromLocation = null;
that.toLocation = null;
that.defaultToLocation = null;
that.currentItem = null;
},
openScanPopup() {

12
fe/PDA/pages/return/productionReturnRaw.vue

@ -40,7 +40,7 @@
<view class="cell_box">
<view class="uni-flex uni-row fl">
<view class="cell_info">
<view class="text_lightblue">源库位</view>
<view class="text_lightblue">源库位</view>
<view class="text_black font_sm">{{ item.locationCode }}
</view>
</view>
@ -364,6 +364,11 @@
//
getDefaultToLocation(locationCode) {
let that = this;
if (locationCode == this.fromLocation.code) {
this.showMessage('来源库位【' + this.fromLocation.code + '】不能与目标库位【' + locationCode + '】相同');
this.$refs.comCollapseLocation.clearLocation();
return;
}
uni.showLoading({
title: "扫描中",
@ -406,8 +411,8 @@
this.showMessage('目标库位不能为空');
return;
}
if (code == this.currentItem.fromLocationCode) {
this.showMessage('源库位【' + this.currentItem.fromLocationCode + '】与目标库位【' + code + '】不能相同');
if (code == this.fromLocation.code) {
this.showMessage('源库位【' + this.fromLocation.code + '】不能与目标库位【' + code + '】相同');
return;
}
uni.showLoading({
@ -590,6 +595,7 @@
that.fromLocation = null;
that.toLocation = null;
that.defaultToLocation = null;
that.currentItem=null;
},
openScanPopup() {

9
fe/PDA/pages/task/thirdLocationDetail.vue

@ -256,12 +256,12 @@
},
qtyChanged(value, item, index) {
if (value <= 0) {
this.showMessage('收货数量必须大于0')
this.showMessage('收货数量必须大于0')
item.qty = item.handledQty
this.$refs['comNumberBox_' + index][0].setValue(item.qty);
} else {
if (value > item.recommendQty) {
this.showMessage("收货数量[" + value + "]不能大于申请数量[" + item.recommendQty + "]");
this.showMessage("收货数量[" + value + "]不能大于申请数量[" + item.recommendQty + "]");
item.handledQty = item.recommendQty
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
}
@ -377,7 +377,7 @@
this.showMessage('请扫描要收货的零件');
return;
} else if (items.length < that.datacontent.details.length) {
this.showMessage('还有未扫描的零件,不可以收货');
this.showMessage('还有未扫描的零件,不可以收货');
return;
} else {
if (this.toLocationInfo == null) {
@ -391,7 +391,8 @@
finsh() {
uni.showLoading({
title: "提交中..."
title: "提交中...",
mask:true
});
this.setParams();
let params = JSON.stringify(this.datacontent);

Loading…
Cancel
Save