Browse Source

合格转隔离

intex_online20241111
zhang_li 3 weeks ago
parent
commit
2eab172859
  1. 85
      src/pages/inventoryMove/coms/comMoveRecord.vue
  2. 4
      src/pages/inventoryMove/coms/comMoveRecordCard.vue
  3. 77
      src/pages/inventoryMove/coms/okToHoldRecordPack.vue

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

@ -12,7 +12,7 @@
<com-move-record-card :dataContent="item" :index="index" @removeData="removeData" <com-move-record-card :dataContent="item" :index="index" @removeData="removeData"
:isShowStatus="isShowStatus" @updateData="updateData" @removePack='removePack' :isShowStatus="isShowStatus" @updateData="updateData" @removePack='removePack'
:allowEditQty="true" :allowEditQty="true"
:allowEditStatus="allowEditStatus"> :allowEditStatus="allowEditStatus" >
</com-move-record-card> </com-move-record-card>
</view> </view>
</view> </view>
@ -35,7 +35,7 @@
<win-scan-button @goScan='showFromLocationPopup'></win-scan-button> <win-scan-button @goScan='showFromLocationPopup'></win-scan-button>
</view> </view>
<!-- 合格转隔离单独的弹窗--> <!-- 合格转隔离单独的弹窗-->
<okToHoldRecordPack ref="okToHoldRecordPackRef" :fromLocationCodeProps='fromLocationCode' :itemCodeProps='itemCode' :batchProps='batch' :showOnePop='showOnePop' :isClearFromLocationCode='isClearFromLocationCode' :isClearItemCode='isClearItemCode' @showFromLocationPopup='showFromLocationPopup' @itemCodeClick='openScanPopup' @confirm='okToHoldRecordPackConfirm' @getInputMsgResult="getInputMsgResult" @itemCodeScanMsg='itemCodeScanMsg'></okToHoldRecordPack> <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="'箱码'" > <win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' @clearItemCode='clearItemCode' :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'
@ -147,10 +147,6 @@
fromLocationAreaTypeList: [], fromLocationAreaTypeList: [],
toLocationAreaTypeList: [], toLocationAreaTypeList: [],
isShowEditLocation: false, isShowEditLocation: false,
itemCode:'',
batch:'',
isClearFromLocationCode:false,//
isClearItemCode:false,//
} }
}, },
@ -247,7 +243,12 @@
showFromLocationPopup() { showFromLocationPopup() {
setTimeout(()=>{ setTimeout(()=>{
if(this.showOnePop){ if(this.showOnePop){
this.$refs.okToHoldRecordPackRef.fromLocationCode = ''
this.$refs.okToHoldRecordPackRef.itemCode = ''
this.$refs.okToHoldRecordPackRef.batch = ''
this.$refs.okToHoldRecordPackRef.handleQty = 0
this.$refs.okToHoldRecordPackRef.showOne = true this.$refs.okToHoldRecordPackRef.showOne = true
}else{ }else{
this.$refs.scanFromLocationCode.openScanPopup(); this.$refs.scanFromLocationCode.openScanPopup();
} }
@ -267,20 +268,19 @@
this.toLocationCode = code; this.toLocationCode = code;
this.toLocationInfo = location; this.toLocationInfo = location;
}, },
getScanResult(result,managementType) { getScanResult(result,managementTypeParams) {
this.managementType = managementTypeParams
if(this.showOnePop){ if(this.showOnePop){
this.itemCode= result.balance.itemCode this.$refs.okToHoldRecordPackRef.itemCode= result.balance.itemCode
this.batch = result.balance.batch this.$refs.okToHoldRecordPackRef.batch = result.balance.batch
this.isClearItemCode = false
debugger
this.getResult = result// this.getResult = result//
this.$refs.scanPopup.closeScanPopup() this.$refs.scanPopup.closeScanPopup()
}else{ }else{
if(managementType == "BY_BATCH" ||managementType == "BY_QUANTITY" ){ if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
this.getScanResultAfterBatch(result) this.getScanResultAfterBatch(result,managementTypeParams)
}else{ }else{
this.getScanResultAfter(result) this.getScanResultAfter(result,managementTypeParams)
} }
} }
@ -302,7 +302,7 @@
// this.getResult.fromLocationCode = obj.fromLocationCode // this.getResult.fromLocationCode = obj.fromLocationCode
this.getResult.label.batch = obj.handleQty this.getResult.label.batch = obj.handleQty
this.getResult.label.qty = obj.handleQty this.getResult.label.qty = obj.handleQty
this.getScanResultAfterBatch(this.getResult) this.getScanResultAfterBatch(this.getResult,this.managementType)
}, },
getScanResultAfter(result){ getScanResultAfter(result){
var balance = result.balance; var balance = result.balance;
@ -364,7 +364,7 @@
} }
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
}, },
getScanResultAfterBatch(result){ getScanResultAfterBatch(result,managementTypeParams){
var balance = result.balance; var balance = result.balance;
this.balanceInfo = result.balance; this.balanceInfo = result.balance;
var pack = result.package; var pack = result.package;
@ -387,18 +387,31 @@
newDetail.toInventoryStatus = this.toInventoryStatus; newDetail.toInventoryStatus = this.toInventoryStatus;
} }
newDetail.toLocationCode = this.toLocationCode; newDetail.toLocationCode = this.toLocationCode;
newDetail.managementTypeParams = managementTypeParams;
newDetail.fromLocationCode = result.fromLocationCode newDetail.fromLocationCode = result.fromLocationCode
newDetail.handleQty = Number(result.label.qty) newDetail.handleQty = Number(result.label.qty)
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
} else { } else {
var detail = item.subList.find(r => { var detail = ''
if (r.batch == pack.batch && console.log(9988,managementTypeParams)
r.fromLocationCode == balance.locationCode && if(managementTypeParams == 'BY_QUANTITY'){
r.scaned == true) { detail = item.subList.find(r => {
return r; if (r.fromLocationCode == balance.locationCode &&
} r.scaned == true) {
}) return r;
}
})
}else if(managementTypeParams == 'BY_BATCH'){
detail = item.subList.find(r => {
if (r.batch == pack.batch &&
r.fromLocationCode == balance.locationCode &&
r.scaned == true) {
return r;
}
})
}
console.log(detail)
if (detail == undefined) { if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
// newDetail.inventoryStatus = balance.inventoryStatus; // newDetail.inventoryStatus = balance.inventoryStatus;
@ -412,12 +425,15 @@
newDetail.packingNumber = pack.number; newDetail.packingNumber = pack.number;
} }
newDetail.toLocationCode = this.toLocationCode; newDetail.toLocationCode = this.toLocationCode;
newDetail.managementTypeParams = managementTypeParams;
newDetail.fromLocationCode = result.fromLocationCode newDetail.fromLocationCode = result.fromLocationCode
item.subList.push(newDetail); item.subList.push(newDetail);
} else { } else {
console.log(999,detail.handleQty)
detail.handleQty =calc.add(detail.handleQty, result.label.qty) detail.handleQty =calc.add(detail.handleQty, result.label.qty)
} }
} }
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
}, },
getInputMsgResult(result,fromWitch){ getInputMsgResult(result,fromWitch){
@ -426,17 +442,17 @@
}, },
// //
clearFromLocation(fromLocationCodeParams){ clearFromLocation(fromLocationCodeParams){
this.fromLocationCode = fromLocationCodeParams this.$refs.okToHoldRecordPackRef.fromLocationCode = ''
this.itemCode ='' this.$refs.okToHoldRecordPackRef.itemCode =''
this.batch ='' this.$refs.okToHoldRecordPackRef.batch =''
this.isClearFromLocationCode = true // this.isClearFromLocationCode = true
}, },
// //
clearItemCode(label){ clearItemCode(label){
this.itemCode = label.itemCode this.$refs.okToHoldRecordPackRef.itemCode =''
this.batch ='' this.$refs.okToHoldRecordPackRef.batch =''
this.isClearItemCode = true
}, },
showErrorMessage(message) { showErrorMessage(message) {
if (this.$refs.scanPopup) { if (this.$refs.scanPopup) {
this.$refs.scanPopup.packLoseFocus() this.$refs.scanPopup.packLoseFocus()
@ -547,7 +563,12 @@
} }
// if(this.balanceInfo) // if(this.balanceInfo)
console.log("提交" ,params) console.log("提交" ,params)
let obj = params.subList.find(item=>item.balanceQty < item.handleQty)
if(obj){
this.$refs.comMessage.showConfirmWarningModal('批次[' +obj.batch + ']数量[' + obj.handleQty + ']不允许大于库存数量[' +obj.balanceQty + ']')
uni.hideLoading()
return
}
inventoryMoveRecordSubmit(params).then(res => { inventoryMoveRecordSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {

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

@ -16,9 +16,9 @@
<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" <comMovebalance :dataContent="item" :isShowStdPack="false"
:fromInventoryStatus="item.inventoryStatus" :toInventoryStatus="item.toInventoryStatus" :fromInventoryStatus="item.inventoryStatus" :toInventoryStatus="item.toInventoryStatus"
:isShowLocation="true" :allowEditStatus='allowEditStatus'></comMovebalance> :isShowLocation="true" :allowEditStatus='allowEditStatus' :isShowPack='item.managementTypeParams == "BY_PACKAGING"' :isShowBatch='item.managementTypeParams == "BY_PACKAGING" || item.managementTypeParams == "BY_Batch"'></comMovebalance>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
<view class='split_line'></view> <view class='split_line'></view>

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

@ -10,8 +10,8 @@
<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" @confirm="fromLocationScanMsg"></u-input> <u-input v-model="fromLocationCode" @blur="fromLocationScanMsg"></u-input>
<u-icon name="photo" color="#2979ff" size="28"></u-icon> <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"/>
@ -19,7 +19,10 @@
</view> </view>
<view class="item"> <view class="item">
<view class="label">零件</view> <view class="label">零件</view>
<view class="value"><u-input v-model="itemCode" @confirm="itemCodeScanMsg" clearable></u-input></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>
</view>
<view class="searchIcon"> <view class="searchIcon">
<image src="/static/search.svg" mode="" @click="itemCodeClick"/> <image src="/static/search.svg" mode="" @click="itemCodeClick"/>
</view> </view>
@ -28,6 +31,7 @@
<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'></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>
@ -65,7 +69,7 @@
components: { components: {
winScanLocation winScanLocation
}, },
emits: ["showFromLocationPopup",'itemCodeClick','confirm','getInputMsgResult'], emits: ["showFromLocationPopup",'itemCodeClick','confirm','getInputMsgResult','clearFromLocationCode','clickBtnClearItemCode'],
data() { data() {
return { return {
handleQty:0, handleQty:0,
@ -76,31 +80,11 @@
} }
}, },
props: { props: {
fromLocationCodeProps:{
type: String,
default: ''
},
// //
showOnePop: { showOnePop: {
type: Boolean, type: Boolean,
default: false default: false
}, },
itemCodeProps:{
type: String,
default: ''
},
batchProps:{
type: String,
default: ''
},
isClearFromLocationCode:{
type: Boolean,
default: false
},
isClearItemCode:{
type: Boolean,
default: false
},
}, },
mounted() { mounted() {
}, },
@ -131,12 +115,15 @@
this.$emit("confirm",obj); this.$emit("confirm",obj);
}, },
fromLocationScanMsg(){ fromLocationScanMsg(){
if (this.fromLocationCode) {
console.log(111,this.fromLocationCode) console.log(111,this.fromLocationCode)
this.scanMsg = this.fromLocationCode this.scanMsg = this.fromLocationCode
this.fromWitch = 'fromLocationScanMsg' this.fromWitch = 'fromLocationScanMsg'
this.handelScanMsg() this.handelScanMsg()
}
}, },
itemCodeScanMsg(){ itemCodeScanMsg(){
if (this.itemCode) {
if(!this.fromLocationCode){ if(!this.fromLocationCode){
this.$refs.comMessage.showMessage("请先扫描来源库位") this.$refs.comMessage.showMessage("请先扫描来源库位")
return return
@ -144,6 +131,7 @@
this.fromWitch = 'itemCodeScanMsg' this.fromWitch = 'itemCodeScanMsg'
this.scanMsg = this.itemCode this.scanMsg = this.itemCode
this.handelScanMsg() this.handelScanMsg()
}
}, },
handelScanMsg() { handelScanMsg() {
// //
@ -157,7 +145,7 @@
// that.scanMsg =that.scanMsg + "\n"; // that.scanMsg =that.scanMsg + "\n";
// } // }
console.log(that.scanMsg.includes('\n')) console.log(that.scanMsg.includes('\n'))
// if (that.scanMsg.includes('\n')) { if (that.scanMsg) {
// that.scanMsg = 'HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q50'; // that.scanMsg = 'HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q50';
setTimeout(() => { setTimeout(() => {
that.losefocus(); that.losefocus();
@ -195,7 +183,7 @@
} }
}); });
}, 200); }, 200);
// } }
}, },
losefocus() { losefocus() {
let that = this; let that = this;
@ -203,38 +191,15 @@
that.boxfocus = false; that.boxfocus = false;
}); });
}, },
onClear(){ clickBtnClearFromLocation(){
console.log(111) this.$emit("clickBtnClearFromLocation");
}
},
watch: {
fromLocationCodeProps:{
handler(newVal, oldVal) {
if(this.isClearFromLocationCode){
this.fromLocationCode=''
}else{
this.fromLocationCode = newVal
}
},
// deep: true,
// immediate: true
}, },
itemCodeProps: { clickBtnClearItemCode(){
handler(newVal, oldVal) { this.$emit("clickBtnClearItemCode");
if(this.isClearItemCode){
this.itemCode=''
}else{
this.itemCode = newVal
}
},
},
batchProps(newVal) {
if(this.isClearItemCode){
this.batch=''
}else{
this.batch = newVal
}
}, },
},
watch: {
} }
} }
</script> </script>

Loading…
Cancel
Save