Browse Source

直接合格转隔离

intex_online20241205
张立 5 months ago
parent
commit
5168757416
  1. 28
      src/common/record.js
  2. 28
      src/mycomponents/scan/winScanPackAndLocation.vue
  3. 66
      src/pages/inventoryMove/coms/comMoveRecord.vue
  4. 22
      src/pages/inventoryMove/coms/okToHoldRecordPack.vue

28
src/common/record.js

@ -31,6 +31,22 @@ export function createItemInfo(balance, pack) {
item.containerNumber = pack.parentNumber ? pack.parentNumber : pack.number; item.containerNumber = pack.parentNumber ? pack.parentNumber : pack.number;
return item; 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) { export function createDetailInfo(balance, pack) {
balance.scaned = true; balance.scaned = true;
@ -54,14 +70,14 @@ export function createDetailInfoForLabel(balance, pack,label) {
// data.inventoryStatus = data.inventoryStatus; // data.inventoryStatus = data.inventoryStatus;
let detail = deepCopyData(balance); let detail = deepCopyData(balance);
detail.balanceQty = new Decimal(detail.qty).toNumber() detail.balanceQty = new Decimal(detail.qty).toNumber()
detail.qty = new Decimal(detail.qty).toNumber(); detail.qty = new Decimal(balance.qty).toNumber();
detail.packQty = pack.packQty ? new Decimal(pack.packQty).toNumber() : 0 detail.packQty =''
detail.packUnit = pack.packUnit detail.packUnit =''
console.log(988,label.qty) console.log(988,label.qty)
detail.handleQty = new Decimal(label.qty).toNumber(); detail.handleQty = new Decimal(label.qty).toNumber();
detail.package = pack; // detail.package = pack;
detail.productionlineCode = pack.productionLineCode; // 制品回收记录需要加的 // detail.productionlineCode = pack.productionLineCode; // 制品回收记录需要加的
detail.toInventoryStatus = balance.inventoryStatus; // 制品回收记录需要加的 // detail.toInventoryStatus = balance.inventoryStatus; // 制品回收记录需要加的
return detail; return detail;
} }

28
src/mycomponents/scan/winScanPackAndLocation.vue

@ -125,6 +125,11 @@
type: String, type: String,
default: "" default: ""
}, },
//
isJustReplay: {
type: Boolean,
default: false
},
}, },
data() { data() {
return { return {
@ -273,7 +278,13 @@
if (checkDirectoryItemExist(this.fromLocationAreaTypeList, type)) { if (checkDirectoryItemExist(this.fromLocationAreaTypeList, type)) {
this.location = result; this.location = result;
// this.packGetFocus(); // this.packGetFocus();
this.checkPackage(scanResult); //
if(this.isJustReplay){
this.$emit("getResult",scanResult);
uni.hideLoading()
}else{
this.checkPackage(scanResult);
}
} else { } else {
uni.hideLoading(); uni.hideLoading();
var hint = getListLocationAreaTypeDesc(this.fromLocationAreaTypeList); var hint = getListLocationAreaTypeDesc(this.fromLocationAreaTypeList);
@ -300,7 +311,7 @@
}) })
}, },
getScanResult(result) { getScanResult(result,businessType) {
// console.log("", result) // console.log("", result)
// if (this.fromLocationCode == '' || this.fromLocationCode == null) { // if (this.fromLocationCode == '' || this.fromLocationCode == null) {
// this.showMessage('', callback => { // this.showMessage('', callback => {
@ -308,6 +319,18 @@
// }) // })
// return; // return;
// } else // } 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); this.scanLocation(result);
// debugger // debugger
// if(this.isCheck){ // if(this.isCheck){
@ -339,7 +362,6 @@
this.chooseWhich = '2' this.chooseWhich = '2'
if(!result.label.itemCode){ if(!result.label.itemCode){
this.showErrorMessage('扫描标签不对,请重新扫描') this.showErrorMessage('扫描标签不对,请重新扫描')
this.$emit('clearItemCode',result.label)
return return
} }
if (res.data && res.data.list && res.data.list.length > 1) { if (res.data && res.data.list && res.data.list.length > 1) {

66
src/pages/inventoryMove/coms/comMoveRecord.vue

@ -35,11 +35,11 @@
<win-scan-button @goScan='showPopup'></win-scan-button> <win-scan-button @goScan='showPopup'></win-scan-button>
</view> </view>
<!-- 合格转隔离单独的弹窗--> <!-- 合格转隔离单独的弹窗-->
<okToHoldRecordPack ref="okToHoldRecordPackRef" :showOnePop='showOnePop' @showFromLocationPopup='showFromLocationPopup' @itemCodeClick='openScanPopup' @confirm='okToHoldRecordPackConfirm' @getInputMsgResult="getInputMsgResult" @itemCodeScanMsg='itemCodeScanMsg' @clickBtnClearFromLocation='clearFromLocation' @clickBtnClearItemCode='clearItemCode'></okToHoldRecordPack> <okToHoldRecordPack ref="okToHoldRecordPackRef" :showOnePop='showOnePop' @showFromLocationPopup='showFromLocationPopup' @itemCodeClick='openScanPopup' @confirm='okToHoldRecordPackConfirm' @getInputMsgResult="getInputMsgResult" @itemCodeScanMsg='itemCodeScanMsg' ></okToHoldRecordPack>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' @clearItemCode='clearItemCode' :title="'箱码'" > <win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'" >
</win-scan-pack-and-location> </win-scan-pack-and-location>
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation' <win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation'
:locationAreaTypeList="fromLocationAreaTypeList" @clearFromLocation='clearFromLocation'></win-scan-location> :locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -80,6 +80,8 @@
createItemInfo, createItemInfo,
createDetailInfo, createDetailInfo,
calcHandleQty, calcHandleQty,
createItemInfoForLabel,
createDetailInfoForLabel
} from '@/common/record.js'; } from '@/common/record.js';
import { import {
@ -147,6 +149,7 @@
fromLocationAreaTypeList: [], fromLocationAreaTypeList: [],
toLocationAreaTypeList: [], toLocationAreaTypeList: [],
isShowEditLocation: false, isShowEditLocation: false,
isJustReplay:true,//
} }
}, },
@ -233,7 +236,7 @@
}, },
openScanPopup() { openScanPopup() {
this.isJustReplay = true
if (this.fromLocationCode == "") { if (this.fromLocationCode == "") {
this.showFromLocationPopup(); this.showFromLocationPopup();
return return
@ -275,12 +278,14 @@
getScanResult(result,managementTypeParams) { getScanResult(result,managementTypeParams) {
this.managementType = managementTypeParams this.managementType = managementTypeParams
if(this.showOnePop){ if(this.showOnePop){
this.$refs.okToHoldRecordPackRef.itemCode= result.balance.itemCode if(this.isJustReplay){
this.$refs.okToHoldRecordPackRef.batch = result.label.batch this.$refs.okToHoldRecordPackRef.itemCode= result.label.itemCode
this.getResult = result// this.$refs.okToHoldRecordPackRef.batch = result.label.batch
this.$refs.scanPopup.closeScanPopup() this.getResult = result//
console.log(11,result) this.$refs.scanPopup.closeScanPopup()
}else{
this.getScanResultAfterBatch(result,managementTypeParams)
}
}else{ }else{
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
this.getScanResultAfterBatch(result,managementTypeParams) this.getScanResultAfterBatch(result,managementTypeParams)
@ -293,21 +298,27 @@
okToHoldRecordPackConfirm(obj){ okToHoldRecordPackConfirm(obj){
// this.getResult. = result// // this.getResult. = result//
if(!obj.fromLocationCode){ if(!obj.fromLocationCode){
this.$refs.comMessage.showErrorMessage('请选择来源库位'); this.$refs.comMessage.showErrorMessage('请输入来源库位');
return; return;
} }
if(!obj.itemCode){ if(!obj.itemCode){
this.$refs.comMessage.showErrorMessage('请选择零件'); this.$refs.comMessage.showErrorMessage('请输入零件');
return; return;
} }
if(!obj.handleQty){ if(!obj.handleQty){
this.$refs.comMessage.showErrorMessage('请输入数量'); this.$refs.comMessage.showErrorMessage('请输入数量');
return; return;
} }
// this.getResult.fromLocationCode = obj.fromLocationCode this.getResult = this.getResult ? this.getResult : {
this.getResult.label.batch = obj.handleQty 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.getResult.label.qty = obj.handleQty
this.getScanResultAfterBatch(this.getResult,this.managementType) this.isJustReplay=false
this.$refs.scanPopup.getScanResult(this.getResult,this.businessType)
}, },
getScanResultAfter(result){ getScanResultAfter(result){
var balance = result.balance; var balance = result.balance;
@ -379,12 +390,12 @@
} }
}) })
if (item == undefined) { if (item == undefined) {
var itemp = createItemInfo(balance, pack); var itemp = createItemInfoForLabel(balance, result.label);
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfoForLabel(balance, pack, result.label);
if (newDetail.packingNumber == '') { // if (newDetail.packingNumber == '') {
newDetail.packingNumber = pack.number; // newDetail.packingNumber = pack.number;
} // }
if (this.businessTypeCode == "Move") { if (this.businessTypeCode == "Move") {
newDetail.toInventoryStatus = balance.inventoryStatus; newDetail.toInventoryStatus = balance.inventoryStatus;
@ -413,7 +424,7 @@
}) })
}else if(managementTypeParams == 'BY_BATCH'){ }else if(managementTypeParams == 'BY_BATCH'){
detail = item.subList.find(r => { detail = item.subList.find(r => {
if (r.batch == pack.batch && if (r.batch == result.label.batch &&
r.fromLocationCode == balance.locationCode && r.fromLocationCode == balance.locationCode &&
r.scaned == true) { r.scaned == true) {
return r; return r;
@ -463,14 +474,14 @@
// //
clearFromLocation(fromLocationCodeParams){ clearFromLocation(fromLocationCodeParams){
this.$refs.okToHoldRecordPackRef.fromLocationCode = '' this.$refs.okToHoldRecordPackRef.fromLocationCode = ''
this.$refs.okToHoldRecordPackRef.itemCode ='' // this.$refs.okToHoldRecordPackRef.itemCode =''
this.$refs.okToHoldRecordPackRef.batch ='' // this.$refs.okToHoldRecordPackRef.batch =''
// this.isClearFromLocationCode = true // this.isClearFromLocationCode = true
}, },
// //
clearItemCode(label){ clearItemCode(label){
this.$refs.okToHoldRecordPackRef.itemCode ='' this.$refs.okToHoldRecordPackRef.itemCode =''
this.$refs.okToHoldRecordPackRef.batch ='' // this.$refs.okToHoldRecordPackRef.batch =''
}, },
showErrorMessage(message) { showErrorMessage(message) {
@ -632,6 +643,7 @@
setParams() { setParams() {
var subList = [] var subList = []
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
console.log(233,this.detailSource)
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
@ -639,9 +651,9 @@
detail.packingNumber, detail.toLocationCode, detail.batch); detail.packingNumber, detail.toLocationCode, detail.batch);
var submitItem = deepCopyData(detail) var submitItem = deepCopyData(detail)
submitItem.itemCode = detail.itemCode; submitItem.itemCode = detail.itemCode;
submitItem.itemName = detail.package.itemName; submitItem.itemName = detail.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1; submitItem.itemDesc1 = detail.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2; submitItem.itemDesc2 = detail.itemDesc2;
submitItem.fromInventoryStatus = detail.inventoryStatus; submitItem.fromInventoryStatus = detail.inventoryStatus;
submitItem.toInventoryStatus = detail.toInventoryStatus; submitItem.toInventoryStatus = detail.toInventoryStatus;

22
src/pages/inventoryMove/coms/okToHoldRecordPack.vue

@ -10,8 +10,7 @@
<view class="item"> <view class="item">
<view class="label">来源库位</view> <view class="label">来源库位</view>
<view class="value"> <view class="value">
<u-input v-model="fromLocationCode" @blur="fromLocationScanMsg"></u-input> <u-input v-model="fromLocationCode" clearable @blur="fromLocationScanMsg"></u-input>
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="clickBtnClearFromLocation"></u-icon>
</view> </view>
<view class="searchIcon"> <view class="searchIcon">
<image src="/static/search.svg" mode="" @click="fromLocationClick"/> <image src="/static/search.svg" mode="" @click="fromLocationClick"/>
@ -20,8 +19,7 @@
<view class="item"> <view class="item">
<view class="label">零件</view> <view class="label">零件</view>
<view class="value"> <view class="value">
<u-input v-model="itemCode" @blur="itemCodeScanMsg"></u-input> <u-input v-model="itemCode" clearable></u-input>
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="clickBtnClearItemCode"></u-icon>
</view> </view>
<view class="searchIcon"> <view class="searchIcon">
<image src="/static/search.svg" mode="" @click="itemCodeClick"/> <image src="/static/search.svg" mode="" @click="itemCodeClick"/>
@ -30,8 +28,7 @@
<view class="item"> <view class="item">
<view class="label">批次</view> <view class="label">批次</view>
<view class="value"> <view class="value">
<u-input v-model='batch'></u-input> <u-input v-model='batch' clearable></u-input>
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="batch = ''"></u-icon>
</view> </view>
<view class="searchIcon"></view> <view class="searchIcon"></view>
</view> </view>
@ -113,6 +110,19 @@
handleQty:this.handleQty, handleQty:this.handleQty,
} }
this.$emit("confirm",obj); 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(){ fromLocationScanMsg(){
if (this.fromLocationCode) { if (this.fromLocationCode) {

Loading…
Cancel
Save