Browse Source

计划外出入库

intex
zhang_li 2 weeks ago
parent
commit
be95fc9566
  1. 24
      src/mycomponents/detail/comRecommendDetailCard.vue
  2. 2
      src/mycomponents/qty/compareQty.vue
  3. 2
      src/pages/unPlanned/job/issueJobDetail.vue
  4. 117
      src/pages/unPlanned/job/receiptJobDetail.vue

24
src/mycomponents/detail/comRecommendDetailCard.vue

@ -14,23 +14,23 @@
:right-options="item.scaned?scanOptions:detailOptions" :right-options="item.scaned?scanOptions:detailOptions"
style='padding:0px 0px 5px 0px;align-items: center;'> style='padding:0px 0px 5px 0px;align-items: center;'>
<view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row; align-items: center;background-color: antiquewhite;"> <view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row; align-items: center;">
<view class="" style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;"> <view class="" style="font-size: 32rpx; color: #3c9cff; font-weight: bold; text-align: center;padding: 10px;">
<br/>
</view> </view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false" style="flex:1"> <recommend :detail="item" :isShowStatus="isShowStatus" :isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation" style="flex:1">
</recommend> </recommend>
</view> </view>
<view v-else class="uni-flex" style="flex-direction: row; align-items: center;background-color: antiquewhite; margin-top: 5rpx;"> <view v-else class="uni-flex" style="flex-direction: row; align-items: center; margin-top: 5rpx;" :class="item.scaned?'scan_view':''">
<view class="" style="font-size: 32rpx; color: red; font-weight: bold; text-align: center;"> <view class="" style="font-size: 32rpx; color: rgb(107, 196, 78); font-weight: bold; text-align: center;padding: 10px;">
<br/>
</view> </view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false" style="flex:1"> <recommend :detail="item" :isShowStatus="isShowStatus" :isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation" style="flex:1">
</recommend> </recommend>
</view> </view>
@ -98,6 +98,14 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: true
},
}, },
watch: { watch: {
dataContent: { dataContent: {

2
src/mycomponents/qty/compareQty.vue

@ -1,6 +1,6 @@
<template> <template>
<view > <view >
<status v-show="isShowStatus" :status='dataContent.inventoryStatus'></status> <status v-show="isShowStatus && dataContent.inventoryStatus" :status='dataContent.inventoryStatus'></status>
<view class="uni-flex uni-row center"> <view class="uni-flex uni-row center">
<view class="uni-flex uni-row "> <view class="uni-flex uni-row ">
<view v-if="Number(handleQty)!=0"> <view v-if="Number(handleQty)!=0">

2
src/pages/unPlanned/job/issueJobDetail.vue

@ -19,7 +19,7 @@
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent" <comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail"> @remove="updateData" @updateData="updateData" @openDetail="openDetail" :isShowToLocation='false'>
</comRecommendDetailCard> </comRecommendDetailCard>
</view> </view>
</view> </view>

117
src/pages/unPlanned/job/receiptJobDetail.vue

@ -12,10 +12,13 @@
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent" <!-- <com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @remove="updateData" @updateData="updateData"
:locationAreaTypeList='toLocationAreaTypeList'> :locationAreaTypeList='toLocationAreaTypeList'>
</com-receipt-detail-card> </com-receipt-detail-card> -->
<comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail" :isShowFromLocation='false'>
</comRecommendDetailCard>
</view> </view>
<view class='split_line'></view> <view class='split_line'></view>
</view> </view>
@ -76,6 +79,7 @@
import locationCompare from '@/mycomponents/location/locationCompare.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue'
import comReceiptDetailCard from '@/pages/unPlanned/coms/comReceiptDetailCard.vue' import comReceiptDetailCard from '@/pages/unPlanned/coms/comReceiptDetailCard.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import comRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue"
export default { export default {
name: 'receipt_detail', name: 'receipt_detail',
@ -84,7 +88,8 @@
winScanPack, winScanPack,
comReceiptDetailCard, comReceiptDetailCard,
locationCompare, locationCompare,
jobTop jobTop,
comRecommendDetailCard
}, },
data() { data() {
return { return {
@ -175,6 +180,9 @@
that.jobStatus = res.data.status that.jobStatus = res.data.status
that.toLocationAreaTypeList =getDirectoryItemArray(that.jobContent.toAreaTypes); that.toLocationAreaTypeList =getDirectoryItemArray(that.jobContent.toAreaTypes);
that.subList = res.data.subList; that.subList = res.data.subList;
that.subList.forEach(item=>{
item.isRecommend = true
})
that.jobToLocationCode = that.subList[0].toLocationCode that.jobToLocationCode = that.subList[0].toLocationCode
that.detailSource =await getDataSource(that.subList) that.detailSource =await getDataSource(that.subList)
// //
@ -186,7 +194,7 @@
getManagementPrecisions(itemCodes, that.jobToLocationCode, res => { getManagementPrecisions(itemCodes, that.jobToLocationCode, res => {
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
this.managementType = this.managementList.some(item => item.ManagementPrecision == 'BY_BATCH') ? 'BY_BATCH' : '' this.managementType = this.managementList&&this.managementList[0]&&this.managementList[0].ManagementPrecision
} }
}) })
} else { } else {
@ -236,18 +244,50 @@
}, },
setDataBatch(result){ setDataBatch(result){
try { try {
console.log(222,result)
var packingNumber = result.label.packingNumber; var packingNumber = result.label.packingNumber;
var batch = result.label.batch; var batch = result.label.batch;
var qty = result.label.qty; var qty = result.label.qty;
var itemCode = result.label.itemCode; var itemCode = result.label.itemCode;
var locationCode = result.package.toLocationCode;
// var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode); var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) { if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else { } else {
var itemDetail = detail.subList.find(r => r.batch == batch); // var itemDetail = detail.subList.find(r => r.batch == batch);
var itemDetail = detail.subList.find(r => {
return r.batch == batch &&
r.fromLocationCode == result.fromLocationCode&&
r.isRecommend==false
})
var itemDetail1 = detail.subList.find(r => {
return r.batch == batch &&
r.fromLocationCode == result.fromLocationCode&&
r.isRecommend==true
})
if (itemDetail == undefined) { if (itemDetail == undefined) {
this.showErrorMessage("批次【" + batch + "】" + "不在列表中") // this.showErrorMessage("" + batch + "" + "")
var newAdd = {
...itemDetail1,
itemCode:itemCode,
packingNumber:packingNumber,
batch:batch,
handleQty:Number(result.label.qty),
qty:detail.qty,
toLocationCode:locationCode,
// inventoryStatus:inventoryStatus,
// toInventoryStatus:inventoryStatus,
// balance:result.balance,
isRecommend:false,
isNewAdd:"newAdd"
}
// newAdd.balance.balanceQty = Number(result.balance.qty);
// newAdd.balance.packQty = Number(result.package.packQty)
// newAdd.balance.packUnit = result.package.packUnit
newAdd.scaned = true;
detail.subList.push(newAdd)
} else { } else {
if (itemDetail.scaned) { if (itemDetail.scaned) {
// this.showErrorMessage("" + packingNumber + "," + batch + "" + "") // this.showErrorMessage("" + packingNumber + "," + batch + "" + "")
@ -304,6 +344,68 @@
} }
}, },
commit() { commit() {
if(this.managementType == 'BY_BATCH' ||this.managementType == 'BY_QUANTITY' ){
var scanCount=0;
console.log(77,this.detailSource)
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if(cur.scaned){
scanCount++;
}
})
})
if(scanCount==0){
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
let str = ''
let str1 = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur=>{
if(cur.scaned){
if(parseFloat(cur.qty)>parseFloat(cur.handleQty)){
str += `物料号【${item.itemCode}】实际提交数量【${cur.handleQty}】不可以小于任务数量【${cur.qty}`
}
if(parseFloat(cur.qty)<parseFloat(cur.handleQty)){
str1 += `物料号【${item.itemCode}】实际提交数量【${cur.handleQty}】不可以大于任务数量【${cur.qty}`
}
}
})
})
if(this.jobContent.allowBiggerQty == "FALSE"){
if(str1){
this.$refs.comMessage.showErrorMessage(str1);
return;
}
}
if(this.jobContent.allowSmallerQty == "FALSE"){
if(str){
this.$refs.comMessage.showErrorMessage(str);
return;
}
}
console.log(11,scanCount)
console.log(11,this.subList.length)
if (scanCount < this.subList.length){
if(this.jobContent.allowPartialComplete == "TRUE"){
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}
});
}
}else{
this.submitJob()
}
}else{
this.scanCount = getScanCount(this.subList); this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) { if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描") this.showErrorMessage("扫描数为0,请先扫描")
@ -334,8 +436,11 @@
}); });
} }
} }
}
}, },
checkLocation() { checkLocation() {
var isPass = true; var isPass = true;
if (this.toLocationCode == "" || this.toLocationCode == null) { if (this.toLocationCode == "" || this.toLocationCode == null) {

Loading…
Cancel
Save