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. 163
      src/pages/unPlanned/job/receiptJobDetail.vue

24
src/mycomponents/detail/comRecommendDetailCard.vue

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

2
src/mycomponents/qty/compareQty.vue

@ -1,6 +1,6 @@
<template>
<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 ">
<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="">
<comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail">
@remove="updateData" @updateData="updateData" @openDetail="openDetail" :isShowToLocation='false'>
</comRecommendDetailCard>
</view>
</view>

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

@ -12,10 +12,13 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<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"
: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 class='split_line'></view>
</view>
@ -76,6 +79,7 @@
import locationCompare from '@/mycomponents/location/locationCompare.vue'
import comReceiptDetailCard from '@/pages/unPlanned/coms/comReceiptDetailCard.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import comRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue"
export default {
name: 'receipt_detail',
@ -84,7 +88,8 @@
winScanPack,
comReceiptDetailCard,
locationCompare,
jobTop
jobTop,
comRecommendDetailCard
},
data() {
return {
@ -175,6 +180,9 @@
that.jobStatus = res.data.status
that.toLocationAreaTypeList =getDirectoryItemArray(that.jobContent.toAreaTypes);
that.subList = res.data.subList;
that.subList.forEach(item=>{
item.isRecommend = true
})
that.jobToLocationCode = that.subList[0].toLocationCode
that.detailSource =await getDataSource(that.subList)
//
@ -186,7 +194,7 @@
getManagementPrecisions(itemCodes, that.jobToLocationCode, res => {
if (res.success) {
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 {
@ -236,18 +244,50 @@
},
setDataBatch(result){
try {
console.log(222,result)
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var locationCode = result.package.toLocationCode;
// var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} 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) {
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 {
if (itemDetail.scaned) {
// this.showErrorMessage("" + packingNumber + "," + batch + "" + "")
@ -304,37 +344,102 @@
}
},
commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
//
if (!this.checkLocation()) {
return
}
//
if (this.scanCount == this.subList.length) {
this.submitJob();
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob()
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++;
}
});
} else {
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
})
})
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);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
//
if (!this.checkLocation()) {
return
}
//
if (this.scanCount == this.subList.length) {
this.submitJob();
} else if (this.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();
}
});
}
}
}
},
checkLocation() {
var isPass = true;

Loading…
Cancel
Save