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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save