Browse Source

直接合格转隔离

intex
zhang_li 2 weeks ago
parent
commit
5168757416
  1. 28
      src/common/record.js
  2. 26
      src/mycomponents/scan/winScanPackAndLocation.vue
  3. 60
      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;
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;
}

26
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();
//
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) {

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

@ -35,11 +35,11 @@
<win-scan-button @goScan='showPopup'></win-scan-button>
</view>
<!-- 合格转隔离单独的弹窗-->
<okToHoldRecordPack ref="okToHoldRecordPackRef" :showOnePop='showOnePop' @showFromLocationPopup='showFromLocationPopup' @itemCodeClick='openScanPopup' @confirm='okToHoldRecordPackConfirm' @getInputMsgResult="getInputMsgResult" @itemCodeScanMsg='itemCodeScanMsg' @clickBtnClearFromLocation='clearFromLocation' @clickBtnClearItemCode='clearItemCode'></okToHoldRecordPack>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' @clearItemCode='clearItemCode' :title="'箱码'" >
<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' :title="'箱码'" >
</win-scan-pack-and-location>
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation'
:locationAreaTypeList="fromLocationAreaTypeList" @clearFromLocation='clearFromLocation'></win-scan-location>
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -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
if(this.isJustReplay){
this.$refs.okToHoldRecordPackRef.itemCode= result.label.itemCode
this.$refs.okToHoldRecordPackRef.batch = result.label.batch
this.getResult = result//
this.$refs.scanPopup.closeScanPopup()
console.log(11,result)
}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;

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

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

Loading…
Cancel
Save