Browse Source

补料任务

intex
张立 1 week ago
parent
commit
0209c50dd2
  1. 22
      src/pages/repleinsh/coms/comRepleishDetailCardBatch.vue
  2. 173
      src/pages/repleinsh/job/repleinshDetailBatch.vue

22
src/pages/repleinsh/coms/comRepleishDetailCardBatch.vue

@ -12,7 +12,7 @@
v-for="(item,index) in dataContent.subList">
<view >
<view class="" :class="item.scaned?'scan_view':''">
<recommendRepleinsh :isShowPackingNumberProps="true" :isShowPack="false" :detail="item" :isShowLocation="false" :isShowFromLocation="true" :isShowToLocation="item.isRecommTaskItem?true:false" :boardNumber='item.boardNumber' :settingParam='settingParam' ref="recommendRepleinshRef" :isShowStatus='false' @updateData='updateData'></recommendRepleinsh>
<recommendRepleinsh :isShowPackingNumberProps="true" :isShowPack="false" :detail="item" :isShowLocation="false" :isShowFromLocation="true" :isShowToLocation="item.isRecommTaskItem?true:false" :boardNumber='item.boardNumber' :settingParam='settingParam' ref="recommendRepleinshRef" :isShowStatus='false' @updateData='updateData' @deleteData='deleteData'></recommendRepleinsh>
</view>
</view>
</view>
@ -43,7 +43,7 @@
} from '@/common/array.js';
export default {
emits: ['updateData'],
emits: ['updateData','deleteData'],
components: {
itemQty,
recommendRepleinsh,
@ -91,10 +91,13 @@
methods: {
resizeCollapse() {
this.$refs.collapse.resize()
// this.$refs.collapse.childrens.forEach(i => {
// i.init();
// })
setTimeout(()=>{
this.$refs.collapse.resize()
this.$refs.collapse.childrens.forEach(i => {
i.init();
})
},200)
},
swipeClick(e, batch, record, index) {
@ -127,8 +130,11 @@
}
});
},
updateData(e, item, index,detail){
this.$emit('updateData',e, item, index,detail)
updateData(){
this.$emit('updateData')
},
deleteData(e, item, index,detail){
this.$emit('deleteData',e, item, index, detail)
},
confirm(val) {
this.editItem.qty = val;

173
src/pages/repleinsh/job/repleinshDetailBatch.vue

@ -15,7 +15,7 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view v-for="(toLocation, index) in detailSource" :key="index">
<comRepleishDetailCardBatch ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'
:settingParam="jobContent">
@deleteData='deleteData' :settingParam="jobContent">
</comRepleishDetailCardBatch>
</view>
</scroll-view>
@ -233,7 +233,7 @@
timer = null
clearTimeout(timer)
}
}, 1000)
})
} else {
that.showMessage('列表数据为0');
}
@ -252,6 +252,7 @@
this.$nextTick(r => {
this.$refs.comIssueDetailCard.forEach(r => {
r.resizeCollapse();
console.log(333,r)
r.$refs.recommendRepleinshRef.forEach(l => {
l.resizeCollapse();
})
@ -272,10 +273,10 @@
str += `物料号【${detail.itemCode}】扫描数量【${detail.handleQty}】小于任务数量【${detail.qty}\n`
}
if (parseFloat(detail.handleQty) > parseFloat(detail.qty)) {
str1 += `物料号【${detail.itemCode}】扫描数量【${detail.handleQty}】大于任务数量【${detail.qty}\n`
str1 += `物料号【${detail.itemCode}】扫描数量【${detail.handleQty}】大于任务数量【${detail.qty}\n`
}
if (parseFloat(detail.handleQty) > parseFloat(detail.balanceQty)) {
str2 += `物料号【${detail.itemCode}】扫描数量【${detail.handleQty}】大于库存数量【${detail.balanceQty}\n`
str2 += `物料号【${detail.itemCode}】扫描数量【${detail.handleQty}】大于库存数量【${detail.balanceQty}\n`
}
}
@ -354,8 +355,10 @@
this.recommendQty = result.balance.qty
}
// this.managementType = managementTypeParams
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") {
if (managementTypeParams == "BY_BATCH") {
this.setDataBatch(result)
} else if (managementTypeParams == "BY_QUANTITY") {
this.setDataQuantity(result)
}
},
setDataBatch(result) {
@ -440,6 +443,7 @@
})
}
}
detail.handleQty = 0
detail.subList.forEach(item => {
item.handleQty = item.handleQty || 0
item.packList.forEach(cur => {
@ -450,13 +454,110 @@
setTimeout(r => {
that.resizeCollapse();
that.$forceUpdate()
}, 3000)
})
}
} catch (e) {
this.showMessage(e.message)
}
},
setDataQuantity(result) {
try {
let that = this
this.balanceinfo = result.balance
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var locationCode = result.fromLocationCode;
if (!result.balance) {
this.showMessage("没有库存余额")
return;
}
// var inventoryStatus = "OK";
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => {
return r.fromLocationCode == result.fromLocationCode
})
//
if (itemDetail == undefined) {
var item = {
scaned: true,
packingNumber: packingNumber,
fromLocationCode: this.fromLocationCode,
toLocationCode: this.toLocationCode,
batch: result.label.batch,
handleQty: result.label.qty,
qty: 0,
inventoryStatus: result.balance.inventoryStatus,
toLocation: result.balance.toLocation,
balanceQty: result.balance.qty,
packQty: result.package.packQty,
packUnit: result.package.packUnit,
uom: result.balance.uom,
isRecommTaskItem: false, //
supplierCode: result.label.supplierCode,
packList: [{
boardNumber: result.package.number.substring(result.package.number.length - 5),
batch: result.label.batch,
packingNumber: result.package.number,
scaned: true,
handleQty: result.label.qty,
uom: result.balance.uom,
balanceQty: result.balance.qty,
packQty: result.package.packQty,
packUnit: result.package.packUnit,
}]
}
detail.subList.push(item)
//
detail.handleQty = 0
detail.qty = 0
} else {
// itemDetail.handleQty = calc.add(itemDetail.handleQty, result.label.qty)
itemDetail.packList = itemDetail.packList && itemDetail.packList.length > 0 ? itemDetail.packList : []
// console.log(())
let boardNumberDetail = itemDetail.packList.find(r => {
return r.packingNumber == result.package.number
})
if (boardNumberDetail) {
this.showErrorMessage('该看板编号已存在,请重新扫描')
return
} else {
itemDetail.packList.push({
boardNumber: result.package.number.substring(result.package.number.length - 5),
batch: result.label.batch,
packingNumber: result.package.number,
scaned: true,
handleQty: result.label.qty,
uom: result.balance.uom,
balanceQty: result.balance.qty,
packQty: result.package.packQty,
packUnit: result.package.packUnit,
})
}
}
detail.handleQty = 0
detail.subList.forEach(item => {
item.handleQty = item.handleQty || 0
item.packList.forEach(cur => {
detail.handleQty = calc.add(detail.handleQty, cur.handleQty)
})
})
console.log(333, this.detailSource)
setTimeout(r => {
that.resizeCollapse();
that.$forceUpdate()
})
}
} catch (e) {
this.showMessage(e.message)
}
},
submit() {
var scanCount = this.getScanCount(this.subList);
@ -507,12 +608,12 @@
title: "提交中....",
mask: true
});
var itemCodes = []
this.detailSource.forEach(item => {
item.Items.forEach(cur => {
itemCodes.push(cur.itemCode)
})
})
// var itemCodes = []
// this.detailSource.forEach(item => {
// item.Items.forEach(cur => {
// itemCodes.push(cur.itemCode)
// })
// })
var params = this.setParams()
if (!params.subList || params.subList.length == 0) {
@ -539,10 +640,26 @@
var commitSubList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(toLocationCode => {
toLocationCode.sublist.forEach(item => {
toLocationCode.subList.forEach(item => {
item.packList.forEach(boardNumber => {
// fromLocation.Batchs.forEach(batch => {
let subItem = boardNumber;
let subItem={
batch:item.batch,
containerNumber: item.containerNumber,
fromAreaCode:item.fromAreaCode,
fromLocationCode:item.fromLocationCode,
inventoryStatus: item.inventoryStatus,
itemCode:item.itemCode,
masterId: item.masterId,
packQty:item.packQty,
packUnit: item.packUnit,
packingNumber:item.packingNumber,
projectCode: item.projectCode,
qty: item.qty,
toAreaCode: item.toAreaCode,
toLocationCode: item.toLocationCode,
uom:item.uom,
};
if (subItem != undefined) {
// if (batch.Records.length > 0) {
@ -560,8 +677,8 @@
record.fromParentPackingNumber = item.parentPackingNumber;
record.fromPackingNumber = item.packingNumber;
record.toPackingNumber = item.packingNumber;
record.fromPackingNumber = boardNumber.packingNumber;
record.toPackingNumber = boardNumber.packingNumber;
record.toPackUnit = item.packUnit;
record.toBatch = item.batch;
subItem.recordList.push(record);
@ -573,8 +690,6 @@
})
})
})
console.log(88, commitSubList)
return
// this.detailSource.forEach(toLocationCode => {
// toLocationCode.Items.forEach(item => {
// item.Locations.forEach(fromLocation => {
@ -613,6 +728,9 @@
this.jobContent.subList = commitSubList
this.jobContent.creator = creator;
console.log(88, this.jobContent)
return
return this.jobContent;
},
@ -647,9 +765,21 @@
},
updateData(e, item, index, detail) {
//
let itemC = this.detailSource.find(r => r.itemCode == detail.itemCode && r.fromLocationCode == detail
.fromLocationCode && r.batch == detail.batch);
this.detailSource.forEach((detail) => {
detail.handleQty = 0
detail.subList.forEach(item => {
item.handleQty = item.handleQty || 0
item.packList.forEach(cur => {
detail.handleQty = calc.add(detail.handleQty, cur.handleQty)
})
})
})
},
deleteData(e, item, index, detail) {
// //
// let item = this.detailSource.find(r => r.itemCode == detail.itemCode && r.fromLocationCode == detail
// .fromLocationCode && r.batch == detail.batch);
//
let itemOriginal = this.detailSourceOriginal.find(r => r.itemCode == detail.itemCode && r.fromLocationCode ==
detail.fromLocationCode && r.batch == detail.batch);
@ -661,6 +791,7 @@
detail.fromLocationCode && r.batch == detail.batch);
}
}
this.updateData()
},
openScanPopup() {
let fromlocationCode = '';

Loading…
Cancel
Save