|
|
@ -1,16 +1,14 @@ |
|
|
|
<!-- 发料任务详情 --> |
|
|
|
<template> |
|
|
|
<page-meta root-font-size="16px"></page-meta> |
|
|
|
<page-meta root-font-size="18px"></page-meta> |
|
|
|
<view class=""> |
|
|
|
<view class="top_card"> |
|
|
|
<com-job-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount"> |
|
|
|
</com-job-scan-detail> |
|
|
|
</view> |
|
|
|
<scroll-view :scroll-top="scrollTop" scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" |
|
|
|
@scroll="scroll" class="scroll-detail"> |
|
|
|
|
|
|
|
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll" |
|
|
|
class="scroll-detail"> |
|
|
|
<view class="detail-list margin_top" v-for="(item, index) in details" :key="item.id"> |
|
|
|
<!-- <comDeliverBoardDetail :dataContent="item" :isShowPacking="true"></comDeliverBoardDetail> --> |
|
|
|
<view class="detail-content"> |
|
|
|
<view class="choose_main"> |
|
|
|
<view class="ljh_box"> |
|
|
@ -72,63 +70,58 @@ |
|
|
|
<button class="btn_single" hover-class="btn_single_after" @click="unPacking(item)">拆箱</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
<view class="uni-flex uni-row new_btn_bot"> |
|
|
|
<button class="new_clear_btn btn_double" @click="clear()">清空</button> |
|
|
|
<button class="new_save_btn btn_double" @click="submit()">提交</button> |
|
|
|
|
|
|
|
<view class="new_btn_bot count_shadow"> |
|
|
|
<button type="primary" class="new_save_btn" @click="submit()">提交</button> |
|
|
|
</view> |
|
|
|
<com-balance ref='issueitems' @selectedItem='selectedBalanceItem'></com-balance> |
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
|
<winScanByContainer ref="scanPopup" @getScanResult='getScanResult'></winScanByContainer> |
|
|
|
<winScanByContainer ref="scanPopup" @getScanResult='getScanResult'></winScanByContainer> |
|
|
|
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance> |
|
|
|
<comUnPacking ref='comUnPacking' |
|
|
|
@getvalue="getUnPackingCount" title="拆箱"> |
|
|
|
</comUnPacking> |
|
|
|
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()' |
|
|
|
@afterCloseScanMessage='closeScanMessage'></com-message> |
|
|
|
<comMessage ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></comMessage> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
getDeliverJobDetail, |
|
|
|
takeDeliverBoardJob, |
|
|
|
cancelTakeDeliverBoardJob, |
|
|
|
finshIssueJob, |
|
|
|
issueBalances |
|
|
|
getDeliverDetail, |
|
|
|
takeDeliverJob, |
|
|
|
cancelTakeDeliverJob, |
|
|
|
finshDeliverJob, |
|
|
|
balances |
|
|
|
} from '@/api/index.js'; |
|
|
|
import { |
|
|
|
getJobStatuStyle, |
|
|
|
getJobStatuDesc, |
|
|
|
showConfirmMsg, |
|
|
|
goHome, |
|
|
|
compareDesc, |
|
|
|
compareStr, |
|
|
|
getCurrDateTime, |
|
|
|
navigateBack |
|
|
|
goHome |
|
|
|
} from '@/common/basic.js'; |
|
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
|
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|
|
|
import winScanByContainer from '@/mycomponents/wincom/winScanByContainer.vue' |
|
|
|
import comBalance from '@/mycomponents/common/comBalance.vue' |
|
|
|
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue' |
|
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
|
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue' |
|
|
|
import comDeliverBoardDetail from '@/mycomponents/coms/comDeliverBoardDetail.vue' |
|
|
|
import comNumberBox from '@/mycomponents/common/comNumberBox.vue'; |
|
|
|
import comBalance from '@/mycomponents/common/comBalance.vue' |
|
|
|
import comUnPacking from '@/mycomponents/coms/comUnPacking.vue' |
|
|
|
import winScanByContainer from '@/mycomponents/wincom/winScanByContainer.vue' |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
comMessage, |
|
|
|
winScanButton, |
|
|
|
winMulitScan, |
|
|
|
winScanByContainer, |
|
|
|
comBalance, |
|
|
|
comMessage, |
|
|
|
comJobScanDetail, |
|
|
|
comDeliverBoardDetail, |
|
|
|
comNumberBox, |
|
|
|
comBalance, |
|
|
|
comUnPacking |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
type: '', |
|
|
|
id: "", |
|
|
|
datacontent: {}, |
|
|
|
details: {}, |
|
|
@ -138,15 +131,24 @@ |
|
|
|
scrollTop: 0 |
|
|
|
}, |
|
|
|
ispending: false, |
|
|
|
balancesItem: null, |
|
|
|
currentItem: null, |
|
|
|
balancesItem: {}, |
|
|
|
received: false, |
|
|
|
titleArray: ['箱标签', '目标库位'], |
|
|
|
allCount: 0, |
|
|
|
scanCount: 0, |
|
|
|
jobStatus: "" |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
filters: { |
|
|
|
statusStyle: function(val) { |
|
|
|
return getJobStatuStyle(val); |
|
|
|
}, |
|
|
|
statusColor: function(val) { |
|
|
|
return getJobStatuDesc(val); |
|
|
|
} |
|
|
|
}, |
|
|
|
props: { |
|
|
|
itemCode: "", |
|
|
|
}, |
|
|
|
onLoad(param) { |
|
|
|
this.id = param.id; |
|
|
|
if (param.jobStatus == 1) { |
|
|
@ -162,28 +164,21 @@ |
|
|
|
onNavigationBarButtonTap(e) { |
|
|
|
if (e.index === 0) { |
|
|
|
goHome(); |
|
|
|
} else if (e.index === 1) { |
|
|
|
}else if(e.index === 1){ |
|
|
|
window.location.reload(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//拦截返回按钮事件 |
|
|
|
onBackPress(e) { |
|
|
|
//已经接收但是没提交任务 |
|
|
|
if (e.from == 'backbutton') { |
|
|
|
if (this.jobStatus == 2) { |
|
|
|
//取消承接任务 |
|
|
|
cancelTakeDeliverBoardJob(this.id).then(res => { |
|
|
|
uni.navigateBack(); |
|
|
|
}).catch(error => { |
|
|
|
uni.navigateBack(); |
|
|
|
}) |
|
|
|
} else { |
|
|
|
uni.navigateBack(); |
|
|
|
} |
|
|
|
return true; |
|
|
|
if (this.received) { |
|
|
|
//取消承接任务 |
|
|
|
cancelTakeDeliverJob(this.id) |
|
|
|
.then(res => {}) |
|
|
|
.catch(err => { |
|
|
|
this.showMessage(err.message); |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
mounted() { |
|
|
|
uni.setNavigationBarColor({ |
|
|
|
frontColor: '#ffffff', |
|
|
@ -197,75 +192,138 @@ |
|
|
|
//加载零件信息 |
|
|
|
getDetail() { |
|
|
|
let that = this; |
|
|
|
if (that.id == undefined) { |
|
|
|
return; |
|
|
|
} |
|
|
|
uni.showLoading({ |
|
|
|
title: '加载中...', |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
let params = { |
|
|
|
id: that.id, |
|
|
|
}; |
|
|
|
getDeliverJobDetail(params) |
|
|
|
getDeliverDetail(params) |
|
|
|
.then(item => { |
|
|
|
console.log('item', item); |
|
|
|
that.datacontent = item; |
|
|
|
that.details = item.details; |
|
|
|
that.details[0].recommendContainerCode = "C19" |
|
|
|
that.jobStatus = item.jobStatus |
|
|
|
if (that.details != null) { |
|
|
|
that.details.forEach( |
|
|
|
r => { |
|
|
|
r.scaned = false; |
|
|
|
r.scanDate = new Date() |
|
|
|
} |
|
|
|
); |
|
|
|
that.ispending = item.jobStatus === 2; |
|
|
|
// if (that.toLocation === '') { |
|
|
|
// that.toLocation = item.details[0].requestLocationCode; |
|
|
|
// } |
|
|
|
this.allCount = that.details.length; |
|
|
|
this.scanCount = 0; |
|
|
|
|
|
|
|
} |
|
|
|
uni.hideLoading(); |
|
|
|
that.details.forEach(r => r.scaned = false); |
|
|
|
that.ispending = item.jobStatus === 2; |
|
|
|
that.allCount = item.details.length; |
|
|
|
// that.toLocation = item.details[0].recommendLocationCode; |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
this.showMessage('未查找到详细信息') |
|
|
|
|
|
|
|
uni.hideLoading(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
//扫描箱标签 |
|
|
|
getScanResult(result) { |
|
|
|
//零件是否已经被扫描过 |
|
|
|
let item = this.details.find(r => r.recommendContainerCode == result.containerCode); |
|
|
|
if (item == undefined) { |
|
|
|
this.showMessage("器具码【" + result.containerCode + "】不在列表中") |
|
|
|
let that = this; |
|
|
|
let code = result.data.code; |
|
|
|
let item = this.details.find(r => { |
|
|
|
return r.recommendPackingCode === code |
|
|
|
}); |
|
|
|
|
|
|
|
if (item === undefined) { |
|
|
|
this.showMessage('在发货任务详情中,未找到箱码【' + code + '】'); |
|
|
|
return; |
|
|
|
} else { |
|
|
|
if (item.scaned) { |
|
|
|
this.showMessage("器具码【" + result.containerCode + "】已经扫描") |
|
|
|
} else { |
|
|
|
if (this.allCount == this.scanCount) { |
|
|
|
this.showMessage("零件已经全部扫描完成"); |
|
|
|
return; |
|
|
|
} |
|
|
|
item.containerCode = result.containerCode; |
|
|
|
item.scaned = true; |
|
|
|
item.handleQty = 10; |
|
|
|
this.calcScanCount() |
|
|
|
this.$forceUpdate(); |
|
|
|
this.showMessage('箱码【' + code + '】已经扫描,请扫描下一箱零件'); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
//按照零件号和箱码去查询库存 |
|
|
|
let params = { |
|
|
|
pageSize: 1000, |
|
|
|
pageIndex: 1, |
|
|
|
packingCode: code, |
|
|
|
locationTypes: [4], //成品 |
|
|
|
inventoryStatuses: [2], //合格 |
|
|
|
}; |
|
|
|
balances(params) |
|
|
|
.then(res => { |
|
|
|
try { |
|
|
|
if (res.totalCount == 0) { |
|
|
|
this.showMessage('箱码【' + code + '】在【成品库】未查询到库存信息'); |
|
|
|
} else if (res.totalCount == 1) { |
|
|
|
that.balancesItem = res.items[0]; |
|
|
|
this.createItem(item); |
|
|
|
} else { |
|
|
|
this.$refs.balanceItems.openPopup(res.items); |
|
|
|
} |
|
|
|
uni.hideLoading(); |
|
|
|
} catch (e) { |
|
|
|
this.showMessage(e.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
this.showMessage(err.message) |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
createItem(item) { |
|
|
|
let that = this; |
|
|
|
if (that.balancesItem != null || that.balancesItem != undefined) { |
|
|
|
// if (that.balancesItem.qty != item.recommendQty) { |
|
|
|
// this.showMessage('库存余额数量【' + that.balancesItem.qty + '】不等于推荐数量【' + item.recommendQty + '】,不可以进行发货') |
|
|
|
// } else { |
|
|
|
item.scaned = true; |
|
|
|
item.handledContainerCode = that.balancesItem.containerCode; |
|
|
|
item.handledPackingCode = that.balancesItem.packingCode; |
|
|
|
item.handledBatch = that.balancesItem.batch; |
|
|
|
item.handledLot = that.balancesItem.lot; |
|
|
|
item.handledFromLocationArea = that.balancesItem.locationCode; |
|
|
|
item.handledQty = that.balancesItem.qty; |
|
|
|
|
|
|
|
|
|
|
|
// ================================== |
|
|
|
// item.recommendFromLocationCode = string; |
|
|
|
// item.recommendFromLocationArea = string; |
|
|
|
// item.recommendFromLocationGroup = string; |
|
|
|
// item.recommendFromLocationErpCode = string; |
|
|
|
// item.recommendFromWarehouseCode = string; |
|
|
|
// item.uom = string; |
|
|
|
// item.recommendQty = 0; |
|
|
|
// item.handledFromLocationCode = string; |
|
|
|
// item.handledFromLocationArea = string; |
|
|
|
// item.handledFromLocationGroup = string; |
|
|
|
// item.handledFromLocationErpCode = string; |
|
|
|
// item.handledFromWarehouseCode = string; |
|
|
|
// item.handledQty = that.balancesItem.qty; |
|
|
|
// item.toLocationCode = string; |
|
|
|
// item.toLocationArea = string; |
|
|
|
// item.toLocationGroup = string; |
|
|
|
// item.toLocationErpCode = string; |
|
|
|
// item.toWarehouseCode = string; |
|
|
|
// item.onTheWayLocationCode = string; |
|
|
|
|
|
|
|
|
|
|
|
this.getScanCount(); |
|
|
|
this.closeScanPopup(); |
|
|
|
that.$forceUpdate(); |
|
|
|
// } |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
unPacking(item) { |
|
|
|
this.$refs.comUnPacking.openPopup3(this.datacontent,item,item.handledQty,item.recommendQty,false); |
|
|
|
}, |
|
|
|
|
|
|
|
getScanCount() { |
|
|
|
this.scanCount = this.datacontent.details.filter(r => r.scaned).length; |
|
|
|
}, |
|
|
|
|
|
|
|
closeScanPopup() { |
|
|
|
if (this.allCount == this.scanCount) { |
|
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
selectedBalanceItem(balanceItem) { |
|
|
|
that.balancesItem = balanceItem; |
|
|
|
this.createItem(item); |
|
|
|
}, |
|
|
|
|
|
|
|
// //接收 |
|
|
|
//接收 |
|
|
|
receive(callback) { |
|
|
|
let params = { |
|
|
|
id: this.id |
|
|
|
}; |
|
|
|
takeDeliverBoardJob(params) |
|
|
|
takeDeliverJob(params) |
|
|
|
.then(res => { |
|
|
|
callback(true); |
|
|
|
}) |
|
|
@ -274,59 +332,54 @@ |
|
|
|
callback(false); |
|
|
|
}); |
|
|
|
}, |
|
|
|
calcScanCount() { |
|
|
|
this.scanCount = this.details.filter(r => r.scaned === true).length; |
|
|
|
this.closeScanPopup(); |
|
|
|
}, |
|
|
|
|
|
|
|
submit() { |
|
|
|
this.calcScanCount() |
|
|
|
if (this.scanCount != this.allCount) { |
|
|
|
this.showMessage('当前扫描数量【'+this.scanCount+"】,总数量为【"+this.allCount+"】,未全部扫描"); |
|
|
|
let that = this; |
|
|
|
if (that.datacontent.details.length === 0) { |
|
|
|
this.showMessage('该任务没有要发货的零件'); |
|
|
|
return; |
|
|
|
} |
|
|
|
let items = that.datacontent.details.filter(r => r.scaned); |
|
|
|
if (items.length === 0) { |
|
|
|
this.showMessage('请扫描要发货的零件'); |
|
|
|
return; |
|
|
|
} else if (items.length < that.datacontent.details.length) { |
|
|
|
this.showMessage('还有未扫描的零件,不可以发货'); |
|
|
|
return; |
|
|
|
} else { |
|
|
|
that.finsh(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
finsh() { |
|
|
|
let that = this; |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中...", |
|
|
|
mask: true |
|
|
|
title: "提交中..." |
|
|
|
}); |
|
|
|
let params = that.datacontent; |
|
|
|
// finshIssueJob(that.id, params) |
|
|
|
|
|
|
|
let params = JSON.stringify(that.datacontent); |
|
|
|
console.log(params); |
|
|
|
// finshDeliverJob(that.id, params) |
|
|
|
// .then(res => { |
|
|
|
// uni.hideLoading(); |
|
|
|
// if (res != null) { |
|
|
|
// that.showCommitSuccessMessage(); |
|
|
|
// that.backJobList(); |
|
|
|
// that.backJobList(1000); |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// .catch(err => { |
|
|
|
// that.showMessage(err.message); |
|
|
|
// this.showMessage(err.message); |
|
|
|
// uni.hideLoading(); |
|
|
|
// }); |
|
|
|
}, |
|
|
|
|
|
|
|
//返回任务列表页 |
|
|
|
backJobList() { |
|
|
|
navigateBack(1) |
|
|
|
}, |
|
|
|
|
|
|
|
clear() { |
|
|
|
this.scanCount = 0; |
|
|
|
this.getDetail(); |
|
|
|
}, |
|
|
|
showMessage(message) { |
|
|
|
this.$refs.comMessage.showMessage(message); |
|
|
|
}, |
|
|
|
showScanMessage(message) { |
|
|
|
this.$refs.comMessage.showScanMessage(message); |
|
|
|
}, |
|
|
|
|
|
|
|
closeScanMessage() { |
|
|
|
this.$refs.scanPopup.getfocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
calcScanCount() { |
|
|
|
this.scanCount = this.details.filter(r => r.scaned === true).length; |
|
|
|
this.closeScanPopup(); |
|
|
|
backJobList(delay) { |
|
|
|
setTimeout(() => { |
|
|
|
uni.navigateTo({ |
|
|
|
url: './deliver' |
|
|
|
}) |
|
|
|
}, delay) |
|
|
|
}, |
|
|
|
|
|
|
|
showCommitSuccessMessage() { |
|
|
@ -344,21 +397,12 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
closeScanMessage() { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
scanPopupGetFocus() { |
|
|
|
this.$refs.scanPopup.getfocus(); |
|
|
|
clearScanLocation() { |
|
|
|
// this.$refs.scanLocation.getfocus(); |
|
|
|
// this.$refs.scanLocation.clear(); |
|
|
|
}, |
|
|
|
|
|
|
|
scrollToTop() { |
|
|
|
let that = this; |
|
|
|
// 解决view层不同步的问题 |
|
|
|
that.scrollTop = that.old.scrollTop |
|
|
|
this.$nextTick(function() { |
|
|
|
that.scrollTop = 0 |
|
|
|
}); |
|
|
|
showMessage(message) { |
|
|
|
this.$refs.comMessage.showMessage(message); |
|
|
|
}, |
|
|
|
|
|
|
|
upper: function(e) { |
|
|
@ -371,13 +415,6 @@ |
|
|
|
// console.log(e) |
|
|
|
this.old.scrollTop = e.detail.scrollTop; |
|
|
|
}, |
|
|
|
qtyChanged(value, item, index) { |
|
|
|
if (value <= 0) { |
|
|
|
this.showMessage('发料数量不能小于或等于0') |
|
|
|
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|