Browse Source

修改库存转移错误

wms3.0_pda
lijuncheng 10 months ago
parent
commit
216a67e5e3
  1. 102
      pages/inventoryMove/coms/comMoveRecord.vue
  2. 12
      pages/inventoryMove/coms/comMovebalance.vue
  3. 2
      pages/inventoryMove/record/oktoScrapRecord.vue

102
pages/inventoryMove/coms/comMoveRecord.vue

@ -23,7 +23,7 @@
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocation' <requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocation'
:locationTypeList="toLocationTypeArray" :isShowEdit="allowEditStatus"></requiredLocation> :locationTypeList="tolocationTypeList" :isShowEdit="isShowEditLocation"></requiredLocation>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -63,7 +63,8 @@
} from '@/common/balance.js'; } from '@/common/balance.js';
import { import {
getPackingNumberAndBatchByList getPackingNumberAndBatchByList,
deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -124,6 +125,7 @@
dataContent: {}, dataContent: {},
fromlocationTypeList: [], fromlocationTypeList: [],
tolocationTypeList: [], tolocationTypeList: [],
isShowEditLocation:false
} }
}, },
@ -139,29 +141,11 @@
} }
}); });
this.initData(); this.initData();
this.getLocationInfo();
}, },
onLoad() { onLoad() {
if (this.toLocationCode != '') {
getBasicLocationByCode(this.toLocationCode).then(res => {
if (res.data.total > 0) {
let result = res.data.list[0];
var type = result.type;
var available = result.available;
if (available == "TRUE") {
this.toLocationInfo = res.data.list[0];
} else {
this.showErrorMessage("扫描库位[" + this.code + "]不可用")
}
} else {
this.showErrorMessage('库位[' + this.toLocationCode + ']不存在')
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error)
})
}
}, },
methods: { methods: {
@ -170,10 +154,12 @@
this.title = "库存转移记录"; this.title = "库存转移记录";
this.toInventoryStatus = "" this.toInventoryStatus = ""
this.toLocationCode = "" this.toLocationCode = ""
this.isShowEditLocation =true;
} else if (this.businessTypeCode == "HoldToOk") { } else if (this.businessTypeCode == "HoldToOk") {
this.title = "隔离转合格记录"; this.title = "隔离转合格记录";
this.toInventoryStatus = "OK" this.toInventoryStatus = "OK"
this.toLocationCode = "OK" this.toLocationCode = ""
this.isShowEditLocation =true;
} else if (this.businessTypeCode == "HoldToScrap") { } else if (this.businessTypeCode == "HoldToScrap") {
this.title = "隔离转报废记录"; this.title = "隔离转报废记录";
this.toInventoryStatus = "SCRAP" this.toInventoryStatus = "SCRAP"
@ -182,10 +168,10 @@
this.title = "合格转隔离记录"; this.title = "合格转隔离记录";
this.toInventoryStatus = "HOLD" this.toInventoryStatus = "HOLD"
this.toLocationCode = "HOLD" this.toLocationCode = "HOLD"
} else if (this.businessTypeCode == "OktoScrap") { } else if (this.businessTypeCode == "OkToScrap") {
this.title = "合格转报废记录"; this.title = "合格转报废记录";
this.toInventoryStatus = "SCRAP" this.toInventoryStatus = "SCRAP"
this.toLocationCode = "HOLD" this.toLocationCode = "SCRAP"
} else if (this.businessTypeCode == "ScrapToHold") { } else if (this.businessTypeCode == "ScrapToHold") {
this.title = "报废转隔离记录"; this.title = "报废转隔离记录";
this.toInventoryStatus = "HOLD" this.toInventoryStatus = "HOLD"
@ -195,6 +181,29 @@
title: this.title title: this.title
}) })
}, },
getLocationInfo(){
if (this.toLocationCode != "") {
getBasicLocationByCode(this.toLocationCode).then(res => {
if (res.data.total > 0) {
let result = res.data.list[0];
var type = result.type;
var available = result.available;
if (available == "TRUE") {
this.toLocationInfo = res.data.list[0];
} else {
this.showErrorMessage("扫描库位[" + this.code + "]不可用")
}
} else {
this.showErrorMessage('库位[' + this.toLocationCode + ']不存在')
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error)
})
}
},
openScanPopup() { openScanPopup() {
if (this.fromLocationCode == "") { if (this.fromLocationCode == "") {
this.showFromLocationPopup(); this.showFromLocationPopup();
@ -230,13 +239,14 @@
// newDetail.inventoryStatus = balance.inventoryStatus; // newDetail.inventoryStatus = balance.inventoryStatus;
newDetail.toInventoryStatus = this.toInventoryStatus; newDetail.toInventoryStatus = this.toInventoryStatus;
newDetail.toLocationCode = this.toLocationCode; newDetail.toLocationCode = this.toLocationCode;
newDetail.fromLocationCode = result.fromLocationCode
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
} else { } else {
var detail = item.subList.find(r => { var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber && if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch && r.batch == balance.batch &&
r.locationCode == balance.locationCode && r.fromLocationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus && r.inventoryStatus == balance.inventoryStatus &&
r.scaned == true) { r.scaned == true) {
return r; return r;
@ -248,6 +258,7 @@
// newDetail.inventoryStatus = balance.inventoryStatus; // newDetail.inventoryStatus = balance.inventoryStatus;
newDetail.toInventoryStatus = this.toInventoryStatus; newDetail.toInventoryStatus = this.toInventoryStatus;
newDetail.toLocationCode = this.toLocationCode; newDetail.toLocationCode = this.toLocationCode;
newDetail.fromLocationCode = result.fromLocationCode
item.subList.push(newDetail); item.subList.push(newDetail);
} else { } else {
this.showErrorMessage(balance.packingNumber + "已经在列表中") this.showErrorMessage(balance.packingNumber + "已经在列表中")
@ -326,7 +337,7 @@
inventoryMoveRecordSubmit(params).then(res => { inventoryMoveRecordSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成" + this.title + "记录<br>" + this.showCommitSuccessMessage("提交成功<br>生成" + this.title + "<br>" +
res.data) res.data)
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
@ -386,32 +397,33 @@
if (detail.scaned) { if (detail.scaned) {
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch); detail.packingNumber, detail.toLocationCode, detail.batch);
var subItem = {}; var submitItem = deepCopyData(detail)
Object.assign(subItem, detail) submitItem.itemCode = detail.itemCode;
subItem.itemCode = detail.itemCode; submitItem.itemName = detail.package.itemName;
subItem.itemName = detail.package.itemName; submitItem.itemDesc1 = detail.package.itemDesc1;
subItem.itemDesc1 = detail.package.itemDesc1; submitItem.itemDesc2 = detail.package.itemDesc2;
subItem.itemDesc2 = detail.package.itemDesc2;
submitItem.fromInventoryStatus = detail.inventoryStatus;
submitItem.toInventoryStatus = detail.toInventoryStatus;
subItem.fromInventoryStatus = detail.inventoryStatus; submitItem.fromPackingNumber = info.packingNumber;
subItem.toInventoryStatus = detail.toInventoryStatus; submitItem.toPackingNumber = info.packingNumber;
subItem.fromPackingNumber = info.packingNumber; submitItem.fromContainerNumber = detail.containerNumber;
subItem.toPackingNumber = info.packingNumber; submitItem.toContainerNumber = detail.containerNumber
subItem.fromContainerNumber = detail.containerNumber; submitItem.fromBatch = info.batch;
subItem.toContainerNumber = detail.containerNumber submitItem.toBatch = info.batch;
subItem.fromBatch = info.batch; submitItem.fromLocationCode = detail.fromLocationCode;
subItem.toBatch = info.batch; submitItem.toLocationCode = detail.toLocationCode;
subItem.fromLocationCode = detail.locationCode; submitItem.package = null;
subItem.toLocationCode = detail.toLocationCode; submitItem.Records = null;
subItem.package = null; submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
subItem.Records = null;
subList.push(subItem) subList.push(submitItem)
} }
}) })
}) })

12
pages/inventoryMove/coms/comMovebalance.vue

@ -6,14 +6,14 @@
<pack v-if="isShowPack && dataContent.packingNumber!=''" :packingCode="dataContent.packingNumber"> <pack v-if="isShowPack && dataContent.packingNumber!=''" :packingCode="dataContent.packingNumber">
</pack> </pack>
<batch v-if="isShowBatch" :batch="dataContent.batch"></batch> <batch v-if="isShowBatch" :batch="dataContent.batch"></batch>
<location v-if="isShowLocation" :locationCode="dataContent.locationCode"></location> <location v-if="isShowLocation" title="来源库位" :locationCode="dataContent.fromLocationCode"></location>
</view> </view>
<view> <view>
<qty :isShowStatus="false" <!-- <qty :isShowStatus="false"
v-if="dataContent.record==null ||dataContent.record==undefined " :dataContent="dataContent" :dataContent="dataContent"
:isShowStdPack="isShowStdPack"></qty> :isShowStdPack="isShowStdPack"></qty> -->
<compare-qty v-else :dataContent="dataContent" :recommendQty="dataContent.qty" <compare-qty :dataContent="dataContent" :recommendQty="dataContent.qty"
:handleQty="dataContent.record.qty" :isShowStdPack="isShowStdPack"> :handleQty="dataContent.handleQty" :isShowStdPack="isShowStdPack">
</compare-qty> </compare-qty>
<move-status :fromInventoryStatus="fromInventoryStatus" :toInventoryStatus="toInventoryStatus" :showToInventoryStatus="allowEditStatus"> <move-status :fromInventoryStatus="fromInventoryStatus" :toInventoryStatus="toInventoryStatus" :showToInventoryStatus="allowEditStatus">
</move-status> </move-status>

2
pages/inventoryMove/record/oktoScrapRecord.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comMoveRecord businessTypeCode='OktoScrap' > </comMoveRecord> <comMoveRecord businessTypeCode='OkToScrap' > </comMoveRecord>
</view> </view>
</template> </template>

Loading…
Cancel
Save