From 51687574169c49ce1d4b79f7b9047cad0cf1bfff Mon Sep 17 00:00:00 2001
From: zhang_li <2235006734@qqq.com>
Date: Tue, 12 Nov 2024 10:24:31 +0800
Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E5=90=88=E6=A0=BC=E8=BD=AC?=
=?UTF-8?q?=E9=9A=94=E7=A6=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/common/record.js | 28 ++++++--
.../scan/winScanPackAndLocation.vue | 28 +++++++-
.../inventoryMove/coms/comMoveRecord.vue | 66 +++++++++++--------
.../inventoryMove/coms/okToHoldRecordPack.vue | 22 +++++--
4 files changed, 102 insertions(+), 42 deletions(-)
diff --git a/src/common/record.js b/src/common/record.js
index de6c44e7..02c4dac7 100644
--- a/src/common/record.js
+++ b/src/common/record.js
@@ -31,6 +31,22 @@ export function createItemInfo(balance, pack) {
item.containerNumber = pack.parentNumber ? pack.parentNumber : pack.number;
return item;
}
+export function createItemInfoForLabel(balance, label) {
+ let item = {
+ itemCode: label.itemCode,
+ itemName: label.itemName,
+ packQty: '',
+ packUnit: '',
+ qty: new Decimal(balance.qty).toNumber(),
+ handleQty: new Decimal(0).toNumber(),
+ uom: balance.uom,
+ subList: [],
+ // packingNumber: pack.number,
+ // parentPackingNumber: pack.parentNumber,
+ }
+ item.containerNumber = balance.parentNumber ? balance.parentNumber : balance.number;
+ return item;
+}
export function createDetailInfo(balance, pack) {
balance.scaned = true;
@@ -54,14 +70,14 @@ export function createDetailInfoForLabel(balance, pack,label) {
// data.inventoryStatus = data.inventoryStatus;
let detail = deepCopyData(balance);
detail.balanceQty = new Decimal(detail.qty).toNumber()
- detail.qty = new Decimal(detail.qty).toNumber();
- detail.packQty = pack.packQty ? new Decimal(pack.packQty).toNumber() : 0
- detail.packUnit = pack.packUnit
+ detail.qty = new Decimal(balance.qty).toNumber();
+ detail.packQty =''
+ detail.packUnit =''
console.log(988,label.qty)
detail.handleQty = new Decimal(label.qty).toNumber();
- detail.package = pack;
- detail.productionlineCode = pack.productionLineCode; // 制品回收记录需要加的
- detail.toInventoryStatus = balance.inventoryStatus; // 制品回收记录需要加的
+ // detail.package = pack;
+ // detail.productionlineCode = pack.productionLineCode; // 制品回收记录需要加的
+ // detail.toInventoryStatus = balance.inventoryStatus; // 制品回收记录需要加的
return detail;
}
diff --git a/src/mycomponents/scan/winScanPackAndLocation.vue b/src/mycomponents/scan/winScanPackAndLocation.vue
index 7a25ef9e..10f15f13 100644
--- a/src/mycomponents/scan/winScanPackAndLocation.vue
+++ b/src/mycomponents/scan/winScanPackAndLocation.vue
@@ -125,6 +125,11 @@
type: String,
default: ""
},
+ // 不走库存余额接口,只用于回显
+ isJustReplay: {
+ type: Boolean,
+ default: false
+ },
},
data() {
return {
@@ -273,7 +278,13 @@
if (checkDirectoryItemExist(this.fromLocationAreaTypeList, type)) {
this.location = result;
// this.packGetFocus();
- this.checkPackage(scanResult);
+ // 如果只回显
+ if(this.isJustReplay){
+ this.$emit("getResult",scanResult);
+ uni.hideLoading()
+ }else{
+ this.checkPackage(scanResult);
+ }
} else {
uni.hideLoading();
var hint = getListLocationAreaTypeDesc(this.fromLocationAreaTypeList);
@@ -300,7 +311,7 @@
})
},
- getScanResult(result) {
+ getScanResult(result,businessType) {
// console.log("扫描", result)
// if (this.fromLocationCode == '' || this.fromLocationCode == null) {
// this.showMessage('请先扫描来源库位', callback => {
@@ -308,6 +319,18 @@
// })
// return;
// } else
+ // 直接合格转隔离直接调用的时候需要
+ console.log(88,businessType)
+ if(businessType){
+ this.businessType = businessType;
+ this.fromInventoryStatuses = getDirectoryItemArray(this.businessType.outInventoryStatuses)
+ this.inventoryStatus = getDirectoryItemArray(this.businessType.outInventoryStatuses); //出库库存状态
+ this.fromLocationAreaTypeList = getDirectoryItemArray(this.businessType.outAreaTypes); //出库库区
+ console.log(99,this.fromInventoryStatuses)
+ console.log(99,this.balanceFromInventoryStatuses)
+ }
+
+
this.scanLocation(result);
// debugger
// if(this.isCheck){
@@ -339,7 +362,6 @@
this.chooseWhich = '2'
if(!result.label.itemCode){
this.showErrorMessage('扫描标签不对,请重新扫描')
- this.$emit('clearItemCode',result.label)
return
}
if (res.data && res.data.list && res.data.list.length > 1) {
diff --git a/src/pages/inventoryMove/coms/comMoveRecord.vue b/src/pages/inventoryMove/coms/comMoveRecord.vue
index b2d9ba35..de73700c 100644
--- a/src/pages/inventoryMove/coms/comMoveRecord.vue
+++ b/src/pages/inventoryMove/coms/comMoveRecord.vue
@@ -35,11 +35,11 @@
-
-
+
+
+ :locationAreaTypeList="fromLocationAreaTypeList">
@@ -80,6 +80,8 @@
createItemInfo,
createDetailInfo,
calcHandleQty,
+ createItemInfoForLabel,
+ createDetailInfoForLabel
} from '@/common/record.js';
import {
@@ -147,6 +149,7 @@
fromLocationAreaTypeList: [],
toLocationAreaTypeList: [],
isShowEditLocation: false,
+ isJustReplay:true,//是否只是回显,不走库存余额接口
}
},
@@ -233,7 +236,7 @@
},
openScanPopup() {
-
+ this.isJustReplay = true
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
@@ -275,12 +278,14 @@
getScanResult(result,managementTypeParams) {
this.managementType = managementTypeParams
if(this.showOnePop){
- this.$refs.okToHoldRecordPackRef.itemCode= result.balance.itemCode
- this.$refs.okToHoldRecordPackRef.batch = result.label.batch
- this.getResult = result//存储接受的结果
- this.$refs.scanPopup.closeScanPopup()
- console.log(11,result)
-
+ if(this.isJustReplay){
+ this.$refs.okToHoldRecordPackRef.itemCode= result.label.itemCode
+ this.$refs.okToHoldRecordPackRef.batch = result.label.batch
+ this.getResult = result//存储接受的结果
+ this.$refs.scanPopup.closeScanPopup()
+ }else{
+ this.getScanResultAfterBatch(result,managementTypeParams)
+ }
}else{
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
this.getScanResultAfterBatch(result,managementTypeParams)
@@ -293,21 +298,27 @@
okToHoldRecordPackConfirm(obj){
// this.getResult. = result//存储接受的结果
if(!obj.fromLocationCode){
- this.$refs.comMessage.showErrorMessage('请选择来源库位');
+ this.$refs.comMessage.showErrorMessage('请输入来源库位');
return;
}
if(!obj.itemCode){
- this.$refs.comMessage.showErrorMessage('请选择零件');
+ this.$refs.comMessage.showErrorMessage('请输入零件');
return;
}
if(!obj.handleQty){
this.$refs.comMessage.showErrorMessage('请输入数量');
return;
}
- // this.getResult.fromLocationCode = obj.fromLocationCode
- this.getResult.label.batch = obj.handleQty
+ this.getResult = this.getResult ? this.getResult : {
+ label:{},
+ fromLocationCode:''
+ }
+ this.getResult.fromLocationCode = obj.fromLocationCode
+ this.getResult.label.itemCode = obj.itemCode
+ this.getResult.label.batch = obj.batch
this.getResult.label.qty = obj.handleQty
- this.getScanResultAfterBatch(this.getResult,this.managementType)
+ this.isJustReplay=false
+ this.$refs.scanPopup.getScanResult(this.getResult,this.businessType)
},
getScanResultAfter(result){
var balance = result.balance;
@@ -379,12 +390,12 @@
}
})
if (item == undefined) {
- var itemp = createItemInfo(balance, pack);
- let newDetail = createDetailInfo(balance, pack);
+ var itemp = createItemInfoForLabel(balance, result.label);
+ let newDetail = createDetailInfoForLabel(balance, pack, result.label);
- if (newDetail.packingNumber == '') {
- newDetail.packingNumber = pack.number;
- }
+ // if (newDetail.packingNumber == '') {
+ // newDetail.packingNumber = pack.number;
+ // }
if (this.businessTypeCode == "Move") {
newDetail.toInventoryStatus = balance.inventoryStatus;
@@ -413,7 +424,7 @@
})
}else if(managementTypeParams == 'BY_BATCH'){
detail = item.subList.find(r => {
- if (r.batch == pack.batch &&
+ if (r.batch == result.label.batch &&
r.fromLocationCode == balance.locationCode &&
r.scaned == true) {
return r;
@@ -463,14 +474,14 @@
// 清除来源库位
clearFromLocation(fromLocationCodeParams){
this.$refs.okToHoldRecordPackRef.fromLocationCode = ''
- this.$refs.okToHoldRecordPackRef.itemCode =''
- this.$refs.okToHoldRecordPackRef.batch =''
+ // this.$refs.okToHoldRecordPackRef.itemCode =''
+ // this.$refs.okToHoldRecordPackRef.batch =''
// this.isClearFromLocationCode = true
},
// 清除批次和物料
clearItemCode(label){
this.$refs.okToHoldRecordPackRef.itemCode =''
- this.$refs.okToHoldRecordPackRef.batch =''
+ // this.$refs.okToHoldRecordPackRef.batch =''
},
showErrorMessage(message) {
@@ -632,6 +643,7 @@
setParams() {
var subList = []
var creator = this.$store.state.user.id
+ console.log(233,this.detailSource)
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
@@ -639,9 +651,9 @@
detail.packingNumber, detail.toLocationCode, detail.batch);
var submitItem = deepCopyData(detail)
submitItem.itemCode = detail.itemCode;
- submitItem.itemName = detail.package.itemName;
- submitItem.itemDesc1 = detail.package.itemDesc1;
- submitItem.itemDesc2 = detail.package.itemDesc2;
+ submitItem.itemName = detail.itemName;
+ submitItem.itemDesc1 = detail.itemDesc1;
+ submitItem.itemDesc2 = detail.itemDesc2;
submitItem.fromInventoryStatus = detail.inventoryStatus;
submitItem.toInventoryStatus = detail.toInventoryStatus;
diff --git a/src/pages/inventoryMove/coms/okToHoldRecordPack.vue b/src/pages/inventoryMove/coms/okToHoldRecordPack.vue
index 013b738e..6b70c023 100644
--- a/src/pages/inventoryMove/coms/okToHoldRecordPack.vue
+++ b/src/pages/inventoryMove/coms/okToHoldRecordPack.vue
@@ -10,8 +10,7 @@
来源库位:
-
-
+
@@ -20,8 +19,7 @@
零件:
-
-
+
@@ -30,8 +28,7 @@
批次:
-
-
+
@@ -113,6 +110,19 @@
handleQty:this.handleQty,
}
this.$emit("confirm",obj);
+ // if(!obj.fromLocationCode){
+ // this.$refs.comMessage.showErrorMessage('请选择来源库位');
+ // return;
+ // }
+ // if(!obj.itemCode){
+ // this.$refs.comMessage.showErrorMessage('请选择零件');
+ // return;
+ // }
+ // if(!obj.handleQty){
+ // this.$refs.comMessage.showErrorMessage('请输入数量');
+ // return;
+ // }
+
},
fromLocationScanMsg(){
if (this.fromLocationCode) {