Browse Source

修改移库

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

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

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

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

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

Loading…
Cancel
Save