Browse Source

补料任务

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

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

@ -12,7 +12,7 @@
v-for="(item,index) in dataContent.subList"> v-for="(item,index) in dataContent.subList">
<view > <view >
<view class="" :class="item.scaned?'scan_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> </view>
</view> </view>
@ -43,7 +43,7 @@
} from '@/common/array.js'; } from '@/common/array.js';
export default { export default {
emits: ['updateData'], emits: ['updateData','deleteData'],
components: { components: {
itemQty, itemQty,
recommendRepleinsh, recommendRepleinsh,
@ -91,10 +91,13 @@
methods: { methods: {
resizeCollapse() { resizeCollapse() {
setTimeout(()=>{
this.$refs.collapse.resize() this.$refs.collapse.resize()
// this.$refs.collapse.childrens.forEach(i => { this.$refs.collapse.childrens.forEach(i => {
// i.init(); i.init();
// }) })
},200)
}, },
swipeClick(e, batch, record, index) { swipeClick(e, batch, record, index) {
@ -127,8 +130,11 @@
} }
}); });
}, },
updateData(e, item, index,detail){ updateData(){
this.$emit('updateData',e, item, index,detail) this.$emit('updateData')
},
deleteData(e, item, index,detail){
this.$emit('deleteData',e, item, index, detail)
}, },
confirm(val) { confirm(val) {
this.editItem.qty = 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"> <scroll-view scroll-y="true" class="page-main-scroll">
<view v-for="(toLocation, index) in detailSource" :key="index"> <view v-for="(toLocation, index) in detailSource" :key="index">
<comRepleishDetailCardBatch ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData' <comRepleishDetailCardBatch ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'
:settingParam="jobContent"> @deleteData='deleteData' :settingParam="jobContent">
</comRepleishDetailCardBatch> </comRepleishDetailCardBatch>
</view> </view>
</scroll-view> </scroll-view>
@ -233,7 +233,7 @@
timer = null timer = null
clearTimeout(timer) clearTimeout(timer)
} }
}, 1000) })
} else { } else {
that.showMessage('列表数据为0'); that.showMessage('列表数据为0');
} }
@ -252,6 +252,7 @@
this.$nextTick(r => { this.$nextTick(r => {
this.$refs.comIssueDetailCard.forEach(r => { this.$refs.comIssueDetailCard.forEach(r => {
r.resizeCollapse(); r.resizeCollapse();
console.log(333,r)
r.$refs.recommendRepleinshRef.forEach(l => { r.$refs.recommendRepleinshRef.forEach(l => {
l.resizeCollapse(); l.resizeCollapse();
}) })
@ -272,10 +273,10 @@
str += `物料号【${detail.itemCode}】扫描数量【${detail.handleQty}】小于任务数量【${detail.qty}\n` str += `物料号【${detail.itemCode}】扫描数量【${detail.handleQty}】小于任务数量【${detail.qty}\n`
} }
if (parseFloat(detail.handleQty) > parseFloat(detail.qty)) { 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)) { 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.recommendQty = result.balance.qty
} }
// this.managementType = managementTypeParams // this.managementType = managementTypeParams
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { if (managementTypeParams == "BY_BATCH") {
this.setDataBatch(result) this.setDataBatch(result)
} else if (managementTypeParams == "BY_QUANTITY") {
this.setDataQuantity(result)
} }
}, },
setDataBatch(result) { setDataBatch(result) {
@ -440,6 +443,7 @@
}) })
} }
} }
detail.handleQty = 0
detail.subList.forEach(item => { detail.subList.forEach(item => {
item.handleQty = item.handleQty || 0 item.handleQty = item.handleQty || 0
item.packList.forEach(cur => { item.packList.forEach(cur => {
@ -450,13 +454,110 @@
setTimeout(r => { setTimeout(r => {
that.resizeCollapse(); that.resizeCollapse();
that.$forceUpdate() that.$forceUpdate()
}, 3000) })
} }
} catch (e) { } catch (e) {
this.showMessage(e.message) 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() { submit() {
var scanCount = this.getScanCount(this.subList); var scanCount = this.getScanCount(this.subList);
@ -507,12 +608,12 @@
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
var itemCodes = [] // var itemCodes = []
this.detailSource.forEach(item => { // this.detailSource.forEach(item => {
item.Items.forEach(cur => { // item.Items.forEach(cur => {
itemCodes.push(cur.itemCode) // itemCodes.push(cur.itemCode)
}) // })
}) // })
var params = this.setParams() var params = this.setParams()
if (!params.subList || params.subList.length == 0) { if (!params.subList || params.subList.length == 0) {
@ -539,10 +640,26 @@
var commitSubList = [] var commitSubList = []
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.forEach(toLocationCode => { this.detailSource.forEach(toLocationCode => {
toLocationCode.sublist.forEach(item => { toLocationCode.subList.forEach(item => {
item.packList.forEach(boardNumber => { item.packList.forEach(boardNumber => {
// fromLocation.Batchs.forEach(batch => { // 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 (subItem != undefined) {
// if (batch.Records.length > 0) { // if (batch.Records.length > 0) {
@ -560,8 +677,8 @@
record.fromParentPackingNumber = item.parentPackingNumber; record.fromParentPackingNumber = item.parentPackingNumber;
record.fromPackingNumber = item.packingNumber; record.fromPackingNumber = boardNumber.packingNumber;
record.toPackingNumber = item.packingNumber; record.toPackingNumber = boardNumber.packingNumber;
record.toPackUnit = item.packUnit; record.toPackUnit = item.packUnit;
record.toBatch = item.batch; record.toBatch = item.batch;
subItem.recordList.push(record); subItem.recordList.push(record);
@ -573,8 +690,6 @@
}) })
}) })
}) })
console.log(88, commitSubList)
return
// this.detailSource.forEach(toLocationCode => { // this.detailSource.forEach(toLocationCode => {
// toLocationCode.Items.forEach(item => { // toLocationCode.Items.forEach(item => {
// item.Locations.forEach(fromLocation => { // item.Locations.forEach(fromLocation => {
@ -613,6 +728,9 @@
this.jobContent.subList = commitSubList this.jobContent.subList = commitSubList
this.jobContent.creator = creator; this.jobContent.creator = creator;
console.log(88, this.jobContent)
return
return this.jobContent; return this.jobContent;
}, },
@ -647,9 +765,21 @@
}, },
updateData(e, item, index, detail) { updateData(e, item, index, detail) {
// this.detailSource.forEach((detail) => {
let itemC = this.detailSource.find(r => r.itemCode == detail.itemCode && r.fromLocationCode == detail detail.handleQty = 0
.fromLocationCode && r.batch == detail.batch); 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 == let itemOriginal = this.detailSourceOriginal.find(r => r.itemCode == detail.itemCode && r.fromLocationCode ==
detail.fromLocationCode && r.batch == detail.batch); detail.fromLocationCode && r.batch == detail.batch);
@ -661,6 +791,7 @@
detail.fromLocationCode && r.batch == detail.batch); detail.fromLocationCode && r.batch == detail.batch);
} }
} }
this.updateData()
}, },
openScanPopup() { openScanPopup() {
let fromlocationCode = ''; let fromlocationCode = '';

Loading…
Cancel
Save