Browse Source

修改移库

hella_online_20250213
lijuncheng 3 days ago
parent
commit
6f0159b49e
  1. 178
      src/pages/inventoryMove/coms/comMoveRecord.vue
  2. 6
      src/pages/inventoryMove/coms/comMoveRecordCard.vue

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

@ -1,7 +1,7 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
<com-blank-view @goScan='openScanPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class='split_line'></view>
@ -33,10 +33,9 @@
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<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"></win-scan-location>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode"
:isCheckLocationBalance="false">
</winComScanBalance>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -49,6 +48,7 @@
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import {
getInventoryStatusName
@ -71,6 +71,10 @@
deepCopyData
} from '@/common/basic.js';
import {
Decimal
} from 'decimal.js'; //
import {
getBusinessType,
createItemInfo,
@ -87,6 +91,7 @@
comBlankView,
winScanLocation,
winScanPackAndLocation,
winComScanBalance
},
props: {
// fromInventoryStatus: {
@ -130,7 +135,6 @@
detailSource: [], //
title: "",
dataContent: {},
fromLocationAreaTypeList: [],
toLocationAreaTypeList: [],
isShowEditLocation: false
}
@ -140,9 +144,8 @@
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList;
this.toLocationAreaTypeList = res.toLocationAreaTypeList;
this.showFromLocationPopup();
this.openScanPopup();
} else {
this.showErrorMessage(res.message)
}
@ -218,29 +221,26 @@
},
openScanPopup() {
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
if (this.businessType) {
this.$refs.scanPopup.openScanPopup(this.businessType);
} else {
this.getBusinessType()
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanFromLocationCode.openScanPopup();
})
},
getFromLocation(location) {
this.fromLocationCode = location.code;
this.fromLocationInfo = location;
this.openScanPopup();
},
getToLocation(location, code) {
this.toLocationCode = code;
this.toLocationInfo = location;
},
getScanResult(result) {
var balance = result.balance;
var pack = result.package;
let balance = result.balance;
let label = result.label;
let pack = result.package;
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
@ -248,66 +248,142 @@
})
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack);
// itemp.containerNumber=""
let newDetail = createDetailInfo(balance, pack); //
newDetail.fromLocationCode = balance.locationCode
if (newDetail.packingNumber == '') {
newDetail.packingNumber = pack.number;
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = new Decimal(0).toNumber( balance.lableQty)
}
if (this.businessTypeCode == "Move") {
newDetail.toInventoryStatus = balance.inventoryStatus;
} else {
newDetail.toInventoryStatus = this.toInventoryStatus;
}
newDetail.toLocationCode = this.toLocationCode;
newDetail.fromLocationCode = result.fromLocationCode
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
this.scanPopupGetFocus()
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == pack.number &&
r.batch == pack.batch &&
r.batch == balance.batch &&
r.fromLocationCode == balance.locationCode &&
r.toInventoryStatus == balance.inventoryStatus &&
r.scaned == true) {
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
//
//
//,
if (pack.parentNumber) {
var checkData = item.subList.find(r => {
if (r.packingNumber == pack.parentNumber &&
r.batch == balance.batch &&
r.fromLocationCode == balance.locationCode) {
return r;
}
})
if (checkData) {
//
this.showErrorMessage("扫描箱码[" + pack.number + "]批次[" + balance.batch +
"]的父包装已经扫描")
console.log("父包装已经扫描")
} else {
let newDetail = createDetailInfo(balance, pack);
// newDetail.inventoryStatus = balance.inventoryStatus;
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
newDetail.fromLocationCode = balance.locationCode
if (balance.lableQty) {
newDetail.handleQty = new Decimal(0).toNumber( balance.lableQty)
}
if (this.businessTypeCode == "Move") {
newDetail.toInventoryStatus = balance.inventoryStatus;
} else {
newDetail.toInventoryStatus = this.toInventoryStatus;
}
if (newDetail.packingNumber == '') {
newDetail.packingNumber = pack.number;
}
newDetail.toLocationCode = this.toLocationCode;
newDetail.fromLocationCode = result.fromLocationCode
item.subList.push(newDetail);
}
} else {
this.showErrorMessage("包装[" + detail.packingNumber + "]\n" +
"批次[" + detail.batch + "]\n" + "库位[" + detail.fromLocationCode + "]\n" +
"库存状态[" + getInventoryStatusName(detail.toInventoryStatus) + "]\n" +
"重复扫描")
//
var checkData = item.subList.find(r => {
if (r.parentNumber == pack.number &&
r.batch == balance.batch &&
r.fromLocationCode == balance.locationCode) {
return r;
}
})
if (checkData) {
//
this.$refs.comMessage.showQuestionMessage("箱码[" + checkData.parentNumber + "]" + "批次[" +
balance
.batch + "]是父包装,是否移除子包装", res => {
if (res) {
item.subList = [];
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
newDetail.fromLocationCode = balance.locationCode
if (balance.lableQty) {
newDetail.handleQty = new Decimal(0).toNumber( balance.lableQty)
}
if (this.businessTypeCode == "Move") {
newDetail.toInventoryStatus = balance.inventoryStatus;
} else {
newDetail.toInventoryStatus = this.toInventoryStatus;
}
newDetail.toLocationCode = this.toLocationCode;
item.subList.push(newDetail);
calcHandleQty(this.detailSource);
}
})
console.log("扫描的是父包装,是否移除子包装")
} else {
let newDetail = createDetailInfo(balance, pack);
newDetail.fromLocationCode = balance.locationCode
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = new Decimal(0).toNumber( balance.lableQty)
}
if (this.businessTypeCode == "Move") {
newDetail.toInventoryStatus = balance.inventoryStatus;
} else {
newDetail.toInventoryStatus = this.toInventoryStatus;
}
newDetail.toLocationCode = this.toLocationCode;
item.subList.push(newDetail);
}
}
this.scanPopupGetFocus()
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描")
}
}
}
calcHandleQty(this.detailSource);
},
showErrorMessage(message) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.packLoseFocus()
}
this.scanPopupLoseFocus()
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.packGetFocus()
}
this.scanPopupGetFocus()
}
});
},
@ -388,6 +464,18 @@
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
},
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.losefocus();
}
},
submit() {
//
var params = this.setParams()
@ -407,7 +495,6 @@
});
return;
}
console.log("提交" + JSON.stringify(params))
inventoryMoveRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
@ -476,6 +563,7 @@
submitItem.fromLocationCode = detail.fromLocationCode;
submitItem.toLocationCode = detail.toLocationCode;
submitItem.parentNumber =detail.parentNumber
submitItem.package = null;
submitItem.Records = null;

6
src/pages/inventoryMove/coms/comMoveRecordCard.vue

@ -16,9 +16,13 @@
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
<view class="scan_view">
<pack title='父包装' v-if="item.parentNumber" :packingCode='item.parentNumber'></pack>
<comMovebalance :dataContent="item" :isShowStdPack="false" :isShowPack="true"
:fromInventoryStatus="item.inventoryStatus" :toInventoryStatus="item.toInventoryStatus"
:isShowLocation="true" :allowEditStatus='allowEditStatus'></comMovebalance>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
<view class='split_line'></view>
@ -43,6 +47,7 @@
import balanceMove from '@/mycomponents/balance/balanceMove.vue'
import comMovebalance from '@/pages/inventoryMove/coms/comMovebalance.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import pack from '@/mycomponents/balance/pack.vue'
import {
getDetailOption,
@ -58,6 +63,7 @@
balanceQtyEdit,
balanceMove,
comMovebalance,
pack
},
props: {
dataContent: {

Loading…
Cancel
Save