|
|
@ -3,13 +3,17 @@ |
|
|
|
<page-meta root-font-size="16px"></page-meta> |
|
|
|
<view class=""> |
|
|
|
<view class="top_card"> |
|
|
|
<com-job-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount"> |
|
|
|
<com-job-scan-detail :jobContent="datacontent" :isShowAllCountHint="false" :isShowScanHint="false" |
|
|
|
:allCount="allCount" :scanCount="scanCount"> |
|
|
|
</com-job-scan-detail> |
|
|
|
</view> |
|
|
|
<view class="" style="margin-top: 20rpx; margin-left: 20rpx; margin-right: 20rpx;"> |
|
|
|
<button type="primary" @click="showRecommend"> 推荐信息</button> |
|
|
|
</view> |
|
|
|
<scroll-view :scroll-top="scrollTop" 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"> |
|
|
|
<view class="detail-list margin_top" v-for="(item, index) in facDetails" :key="item.id"> |
|
|
|
<view class="detail-content"> |
|
|
|
<view class="choose_main"> |
|
|
|
<view class="ljh_box"> |
|
|
@ -22,23 +26,13 @@ |
|
|
|
<view class="list_form"> |
|
|
|
<view class="uni-container"> |
|
|
|
<uni-table style="overflow-x: hidden;"> |
|
|
|
<uni-tr> |
|
|
|
<!-- <uni-th width="90"></uni-th> |
|
|
|
<uni-th width="100" align="center">推荐</uni-th> |
|
|
|
<uni-th width="100" align="center">实际</uni-th> --> |
|
|
|
<uni-th width="50"></uni-th> |
|
|
|
<uni-th width="120" align="center">推荐</uni-th> |
|
|
|
<uni-th width="120" align="center">实际</uni-th> |
|
|
|
</uni-tr> |
|
|
|
<uni-tr> |
|
|
|
<uni-th width="50">数量</text></uni-th> |
|
|
|
<uni-th width="120" align="center"> |
|
|
|
<text class="text_black">{{item.recommendQty}}({{item.uom}})</text> |
|
|
|
<uni-th width="0" align="center"> |
|
|
|
</uni-th> |
|
|
|
<uni-th width="120" align="center"> |
|
|
|
<view v-if="item.scaned" |
|
|
|
<uni-th width="270" align="center"> |
|
|
|
<view |
|
|
|
style="display: flex;flex-direction: row;justify-content:center;align-items: center;"> |
|
|
|
|
|
|
|
<com-number-box :ref="'comNumberBox_'+index" v-model="item.handledQty" |
|
|
|
:max="99999" :min="0" style='width: 100px;' |
|
|
|
@change="qtyChanged($event,item,index)"> |
|
|
@ -49,33 +43,28 @@ |
|
|
|
</uni-tr> |
|
|
|
<uni-tr> |
|
|
|
<uni-th width="50">箱码</uni-th> |
|
|
|
<uni-th width="120" align="center"> |
|
|
|
<view class="text_packingCode"> |
|
|
|
{{ item.recommendPackingCode }} |
|
|
|
</view> |
|
|
|
<uni-th width="0" align="center"> |
|
|
|
</uni-th> |
|
|
|
<uni-th width="120" align="center"> |
|
|
|
<view v-if="item.scaned" class="text_packingCode"> |
|
|
|
<uni-th width="270" align="center"> |
|
|
|
<view class="text_packingCode"> |
|
|
|
{{ item.handledPackingCode }} |
|
|
|
</view> |
|
|
|
</uni-th> |
|
|
|
</uni-tr> |
|
|
|
<uni-tr> |
|
|
|
<uni-th width="50">批次</uni-th> |
|
|
|
<uni-th width="120" align="center"> |
|
|
|
<view class="text_black">{{item.recommendLot }}</view> |
|
|
|
<uni-th width="0" align="center"> |
|
|
|
</uni-th> |
|
|
|
<uni-th width="120" align="center"> |
|
|
|
<view v-if="item.scaned" class="text_black">{{item.handledLot }}</view> |
|
|
|
<uni-th width="270" align="center"> |
|
|
|
<view class="text_black">{{item.handledLot }}</view> |
|
|
|
</uni-th> |
|
|
|
</uni-tr> |
|
|
|
<uni-tr> |
|
|
|
<uni-th width="70">来源库位</uni-th> |
|
|
|
<uni-th width="100" align="center"> |
|
|
|
<view class="text_black">{{ item.recommendFromLocationCode }}</view> |
|
|
|
<uni-th width="0" align="center"> |
|
|
|
</uni-th> |
|
|
|
<uni-th width="100" align="center"> |
|
|
|
<view class="text_black" v-if="item.scaned"> |
|
|
|
<uni-th width="270" align="center"> |
|
|
|
<view class="text_black"> |
|
|
|
{{ item.handledFromLocationCode }} |
|
|
|
</view> |
|
|
|
</uni-th> |
|
|
@ -102,7 +91,7 @@ |
|
|
|
<com-balance ref='issueitems' @selectedItem='selectedBalanceItem'></com-balance> |
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
|
<win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'></win-scan-by-pack> |
|
|
|
|
|
|
|
<recommendList ref="recommendList" title="推荐信息"></recommendList> |
|
|
|
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance> |
|
|
|
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()' |
|
|
|
@afterCloseScanMessage='closeScanMessage'></com-message> |
|
|
@ -112,8 +101,8 @@ |
|
|
|
<script> |
|
|
|
import { |
|
|
|
getUnProducePickDetail, |
|
|
|
takeIssueJob, |
|
|
|
cancelTakeIssueJob, |
|
|
|
takeUnProduceIssueJob, |
|
|
|
cancelTakeUnProduceIssueJob, |
|
|
|
finshUnProducePickJob, |
|
|
|
getBalancesByFilter |
|
|
|
} from '@/api/index.js'; |
|
|
@ -125,8 +114,10 @@ |
|
|
|
compareDesc, |
|
|
|
compareStr, |
|
|
|
getCurrDateTime, |
|
|
|
getCurrDateTimeAndT, |
|
|
|
scanSuccessAudio, |
|
|
|
scanFailedAudio |
|
|
|
scanFailedAudio, |
|
|
|
guid |
|
|
|
} from '@/common/basic.js'; |
|
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
|
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|
|
@ -135,7 +126,7 @@ |
|
|
|
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue' |
|
|
|
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue' |
|
|
|
import comNumberBox from '@/mycomponents/common/comNumberBox.vue'; |
|
|
|
|
|
|
|
import recommendList from '@/mycomponents/popup/recommendList.vue'; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
comMessage, |
|
|
@ -144,13 +135,15 @@ |
|
|
|
comBalance, |
|
|
|
comJobScanDetail, |
|
|
|
winScanByPack, |
|
|
|
comNumberBox |
|
|
|
comNumberBox, |
|
|
|
recommendList |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
id: "", |
|
|
|
datacontent: {}, |
|
|
|
details: {}, |
|
|
|
details: [], |
|
|
|
facDetails: [], |
|
|
|
toLocation: '', |
|
|
|
scrollTop: 0, |
|
|
|
old: { |
|
|
@ -164,6 +157,7 @@ |
|
|
|
scanCount: 0, |
|
|
|
isPack: true, |
|
|
|
titleArray: ['箱标签'], |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
filters: { |
|
|
@ -179,14 +173,14 @@ |
|
|
|
}, |
|
|
|
onLoad(param) { |
|
|
|
this.id = param.id; |
|
|
|
// if (param.jobStatus == 1) { |
|
|
|
// this.receive((callback => { |
|
|
|
// this.getDetail(); |
|
|
|
// })); |
|
|
|
// } else { |
|
|
|
// this.getDetail(); |
|
|
|
// } |
|
|
|
if (param.jobStatus == 1) { |
|
|
|
this.receive((callback => { |
|
|
|
this.getDetail(); |
|
|
|
})); |
|
|
|
} else { |
|
|
|
this.getDetail(); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
onReady() {}, |
|
|
|
//返回首页 |
|
|
@ -200,11 +194,19 @@ |
|
|
|
//拦截返回按钮事件 |
|
|
|
onBackPress(e) { |
|
|
|
//取消承接任务 |
|
|
|
// cancelTakeIssueJob(this.id) |
|
|
|
// .then(res => {}) |
|
|
|
// .catch(err => { |
|
|
|
// this.showMessage(err.message); |
|
|
|
// }); |
|
|
|
if (e.from == 'backbutton') { |
|
|
|
if (this.jobStatus == 2) { |
|
|
|
//取消承接任务 |
|
|
|
cancelTakeUnProduceIssueJob(this.id).then(res => { |
|
|
|
uni.navigateBack(); |
|
|
|
}).catch(error => { |
|
|
|
uni.navigateBack(); |
|
|
|
}) |
|
|
|
} else { |
|
|
|
uni.navigateBack(); |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
uni.setNavigationBarColor({ |
|
|
@ -235,176 +237,117 @@ |
|
|
|
}; |
|
|
|
getUnProducePickDetail(params) |
|
|
|
.then(item => { |
|
|
|
console.log('item', item); |
|
|
|
that.datacontent = item; |
|
|
|
that.details = item.details; |
|
|
|
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(); |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
this.showMessage('未查找到详细信息') |
|
|
|
|
|
|
|
uni.hideLoading(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
|
//零件是否已经被扫描过 |
|
|
|
let item = this.details.find(r => r.recommendPackingCode === result.data.packingCode && r |
|
|
|
.scanPackingCode != result.data.packingCode); |
|
|
|
if (item != undefined && item.scaned) { |
|
|
|
scanFailedAudio() |
|
|
|
showConfirmMsg('扫描的箱码【' + result.data.packingCode + '】匹配到任务中的【' + item.scanPackingCode + |
|
|
|
'】箱,是否要重新匹配任务中的【' + item.scanPackingCode + '】箱?', |
|
|
|
confirm => { |
|
|
|
if (confirm) { |
|
|
|
this.handledPackCode(result, true); |
|
|
|
} else { |
|
|
|
return; |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
if (this.allCount === this.scanCount) { |
|
|
|
scanFailedAudio() |
|
|
|
this.showMessage("零件已经全部扫描完成"); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.handledPackCode(result, false); |
|
|
|
} |
|
|
|
this.scrollToTop(); |
|
|
|
showRecommend() { |
|
|
|
this.$refs.recommendList.openScanPopup(this.details) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//处理箱标签 |
|
|
|
//scaned是否是重新匹配 |
|
|
|
handledPackCode(result, scaned) { |
|
|
|
//获取标签信息 |
|
|
|
let that = this; |
|
|
|
that.currentScanLebel = result; |
|
|
|
let scanItem = this.details.find(r => r.scanItemCode === that.currentScanLebel.data.itemCode && |
|
|
|
r.scanPackingCode === that.currentScanLebel.data.packingCode && |
|
|
|
r.scanLot === that.currentScanLebel.data.lot && |
|
|
|
r.scaned == true) |
|
|
|
if (scanItem != undefined) { |
|
|
|
getScanResult(result) { |
|
|
|
this.currentItem =result; |
|
|
|
//扫描的物料是否在任务列表中 |
|
|
|
let item = this.details.find(r => r.itemCode == result.data.itemCode); |
|
|
|
//在任务列表中 |
|
|
|
if (item) { |
|
|
|
//校验箱码是否已经扫描 |
|
|
|
let scanItem = this.facDetails.find(r => r.handledPackingCode == result.data.code); |
|
|
|
if (scanItem) { |
|
|
|
scanFailedAudio() |
|
|
|
this.showScanMessage('箱码【' + that.currentScanLebel.data.packingCode + '】已经扫描,请扫描下一箱零件'); |
|
|
|
this.showMessage('扫描箱码[' + result.data.code + "]已经在列表中,请勿重复扫描") |
|
|
|
} else { |
|
|
|
this.dyIssue(result, scaned); |
|
|
|
} |
|
|
|
}, |
|
|
|
this.getBalance(result, res => { |
|
|
|
if (res.totalCount === 1) { |
|
|
|
this.balancesItem = res.items[0]; |
|
|
|
if (this.balancesItem) { |
|
|
|
var addItem = this.setItemInfo(result, this.balancesItem) |
|
|
|
|
|
|
|
dyIssue(result, scaned) { |
|
|
|
let that = this; |
|
|
|
result.data.lot ='20240717' |
|
|
|
var itemCode = that.details.find(r => { |
|
|
|
return r.itemCode === result.data.itemCode && |
|
|
|
r.scaned === scaned |
|
|
|
}) |
|
|
|
if (itemCode == undefined) { |
|
|
|
scanFailedAudio() |
|
|
|
that.showScanMessage('所扫描的箱码【' + result.data.code + '】对应的物料【' + result.data.itemCode + '】不在任务中'); |
|
|
|
if( item.recommendFromLocationErpCode !=addItem.handledFromLocationErpCode){ |
|
|
|
this.showMessage('扫描箱码[' + result.data.code + "]的ERP储位与推荐的不在同一个ERP储位") |
|
|
|
}else { |
|
|
|
//ERP料号相同、箱码相同 |
|
|
|
var itemCode1 = that.details.find(r => { |
|
|
|
return r.itemCode === result.data.itemCode && |
|
|
|
r.recommendPackingCode === result.data.code |
|
|
|
r.scaned === scaned |
|
|
|
}) |
|
|
|
//ERP料号相同、箱码不相同 |
|
|
|
if (itemCode1 == undefined) { |
|
|
|
var itemCode2 = that.details.find(r => { |
|
|
|
return r.itemCode === result.data.itemCode && |
|
|
|
r.recommendLot === result.data.lot && |
|
|
|
r.scaned === scaned |
|
|
|
}) |
|
|
|
//ERP料号相同、箱码不相同、批次相同 |
|
|
|
if (itemCode2 == undefined) { |
|
|
|
//ERP料号相同、箱码不相同、批次不相同 |
|
|
|
console.log("ERP料号相同、箱码不相同、批次不相同") |
|
|
|
scanFailedAudio() |
|
|
|
setTimeout(res => { |
|
|
|
showConfirmMsg(itemCode.recommendPackingCode + '未执行先进先出或不是最先批次,是否继续?', confirm => { |
|
|
|
if (confirm) { |
|
|
|
that.currentItem = itemCode; |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
this.facDetails.push(addItem) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
that.scanPopupGetFocus(); |
|
|
|
this.$refs['issueitems'].openPopup(res.items); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, 100) |
|
|
|
|
|
|
|
} else { |
|
|
|
console.log("ERP料号相同、箱码不相同、批次相同") |
|
|
|
//ERP料号相同、箱码不相同、批次相同 |
|
|
|
that.currentItem = itemCode2; |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
//ERP料号相同、箱码相同、批次相同 |
|
|
|
var itemCode3 = that.details.find(r => { |
|
|
|
return r.itemCode === result.data.itemCode && |
|
|
|
r.recommendPackingCode === result.data.code && |
|
|
|
r.recommendLot === result.data.lot && |
|
|
|
r.scaned === scaned |
|
|
|
}) |
|
|
|
if (itemCode3 == undefined) { |
|
|
|
//ERP料号相同、箱码相同、批次不同 |
|
|
|
console.log("ERP料号相同、箱码相同、批次不同") |
|
|
|
scanFailedAudio() |
|
|
|
setTimeout(res => { |
|
|
|
showConfirmMsg(itemCode1.recommendPackingCode + '未执行先进先出或不是最先批次,是否继续?', |
|
|
|
confirm => { |
|
|
|
if (confirm) { |
|
|
|
that.currentItem = itemCode1; |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
} else { |
|
|
|
that.scanPopupGetFocus(); |
|
|
|
//不在任务列表中提示 |
|
|
|
this.showMessage('扫描的物料[' + result.data.itemCode + "]不在推荐任务列表中") |
|
|
|
} |
|
|
|
}); |
|
|
|
}, 100) |
|
|
|
|
|
|
|
} else { |
|
|
|
console.log("ERP料号相同、箱码相同、批次相同") |
|
|
|
//ERP料号相同、箱码相同、批次相同 |
|
|
|
that.currentItem = itemCode3; |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
afterScanPackLabel(result) { |
|
|
|
let that = this; |
|
|
|
that.getBalance(result, res => { |
|
|
|
if (res.totalCount === 1) { |
|
|
|
that.balancesItem = res.items[0]; |
|
|
|
if (that.balancesItem != null || that.balancesItem != undefined) { |
|
|
|
that.setBalanceInfo(this.currentItem, that.balancesItem); |
|
|
|
that.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$refs['issueitems'].openPopup(res.items); |
|
|
|
} |
|
|
|
}); |
|
|
|
setItemInfo(result, balance) { |
|
|
|
var item = { |
|
|
|
id: guid(), |
|
|
|
itemCode: result.data.itemCode, |
|
|
|
itemName: result.data.itemName, |
|
|
|
itemDesc1: result.data.itemDesc1, |
|
|
|
itemDesc2: result.data.itemDesc2, |
|
|
|
stdPackQty: result.data.stdPackQty, |
|
|
|
masterID: this.datacontent.id, |
|
|
|
|
|
|
|
recommendContainerCode: "", |
|
|
|
recommendPackingCode: result.data.packingCode, |
|
|
|
recommendSupplierBatch: result.data.supplierBatch, |
|
|
|
recommendArriveDate: result.data.arriveDate, |
|
|
|
recommendProduceDate: result.data.produceDate, |
|
|
|
recommendExpireDate: result.data.expireDate, |
|
|
|
recommendLot: result.data.lot, |
|
|
|
recommendFromLocationCode: balance.locationCode, |
|
|
|
recommendFromLocationArea: balance.locationArea, |
|
|
|
recommendFromLocationGroup: balance.locationCode, |
|
|
|
recommendFromLocationErpCode: balance.locationErpCode, |
|
|
|
recommendFromWarehouseCode: balance.warehouseCode, |
|
|
|
recommendQty: result.data.qty, |
|
|
|
uom: result.data.uom, |
|
|
|
|
|
|
|
handledContainerCode: "", |
|
|
|
handledPackingCode: result.data.packingCode, |
|
|
|
handledSupplierBatch: result.data.supplierBatch, |
|
|
|
handledArriveDate: result.data.arriveDate, |
|
|
|
handledProduceDate: result.data.produceDate, |
|
|
|
handledExpireDate: result.data.expireDate, |
|
|
|
handledLot: result.data.lot, |
|
|
|
handledFromLocationCode: balance.locationCode, |
|
|
|
handledFromLocationArea: balance.locationArea, |
|
|
|
handledFromLocationGroup: balance.locationCode, |
|
|
|
handledFromLocationErpCode: balance.locationErpCode, |
|
|
|
handledFromWarehouseCode: balance.warehouseCode, |
|
|
|
handledQty: result.data.qty, |
|
|
|
|
|
|
|
creatorId: guid(), |
|
|
|
creationTime: getCurrDateTimeAndT(), |
|
|
|
tenantId: guid(), |
|
|
|
lastModificationTime: getCurrDateTimeAndT(), |
|
|
|
lastModifierId: guid(), |
|
|
|
number: this.datacontent.number, |
|
|
|
remark: "", |
|
|
|
status: 2, |
|
|
|
reasonCode: "", |
|
|
|
caseCode: "", |
|
|
|
projCapacityCode: "", |
|
|
|
onceBusiCode: "", |
|
|
|
explain: "", |
|
|
|
} |
|
|
|
return item; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//查询库存记录 |
|
|
|
getBalance(result, callback) { |
|
|
|
uni.showLoading({ |
|
|
@ -417,17 +360,17 @@ |
|
|
|
packingCode: result.data.code, |
|
|
|
itemCode: result.data.itemCode, |
|
|
|
lot: result.data.lot, |
|
|
|
inventoryStatus: 2, //库存状态默认2 |
|
|
|
locationTypes: [2,3,4], |
|
|
|
sortBy: 'PackingCode asc' |
|
|
|
}; |
|
|
|
getBalancesByFilter(params) |
|
|
|
.then(res => { |
|
|
|
if (res.totalCount === 0) { |
|
|
|
scanFailedAudio() |
|
|
|
this.showScanMessage('按ERP料号【' + result.data.itemCode + '】箱码【' + result.data.code + '】批次【' + |
|
|
|
this.showScanMessage('按ERP料号【' + result.data.itemCode + '】箱码【' + result.data |
|
|
|
.code + |
|
|
|
'】批次【' + |
|
|
|
result |
|
|
|
.data.lot + '】在【原料库】或【半成品库】或【成品库】未查询到库存信息'); |
|
|
|
.data.lot + '】未查询到库存信息'); |
|
|
|
} else { |
|
|
|
scanSuccessAudio() |
|
|
|
callback(res); |
|
|
@ -455,7 +398,8 @@ |
|
|
|
item.handledBatch = balanceItem.batch; |
|
|
|
item.handledLot = balanceItem.lot; |
|
|
|
|
|
|
|
item.defaultHandleQty = balanceItem.qty>item.recommendQty?item.recommendQty:balanceItem.qty; |
|
|
|
item.defaultHandleQty = balanceItem.qty > item.recommendQty ? item.recommendQty : balanceItem |
|
|
|
.qty; |
|
|
|
item.handledQty = balanceItem.qty > item.recommendQty ? item.recommendQty : balanceItem.qty; |
|
|
|
item.handledFromLocationCode = balanceItem.locationCode; |
|
|
|
item.handledFromLocationArea = balanceItem.locationArea; |
|
|
@ -472,16 +416,21 @@ |
|
|
|
item.scanPackingCode = this.currentScanLebel.data.code; |
|
|
|
item.scanLot = this.currentScanLebel.data.lot; |
|
|
|
|
|
|
|
item.worker = localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN; |
|
|
|
item.worker = localStorage.userName_CN == "" ? localStorage.userName : localStorage |
|
|
|
.userName_CN; |
|
|
|
item.uom = balanceItem.uom; |
|
|
|
|
|
|
|
this.details.sort(compareDesc('scanDate')); //按扫描信息排 |
|
|
|
this.calcScanCount(); //计算扫描的数量 |
|
|
|
this.$forceUpdate(); |
|
|
|
}, |
|
|
|
|
|
|
|
selectedBalanceItem(balanceItem) { |
|
|
|
this.setBalanceInfo(this.currentItem, balanceItem); |
|
|
|
var addItem = this.setItemInfo(this.currentItem, this.balancesItem) |
|
|
|
if( item.recommendFromLocationErpCode !=addItem.handledFromLocationErpCode){ |
|
|
|
this.showMessage('扫描箱码[' + this.currentItem.data.code + "]的ERP储位与推荐的不在同一个ERP储位") |
|
|
|
}else { |
|
|
|
this.facDetails.push(addItem) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// //接收 |
|
|
@ -489,7 +438,7 @@ |
|
|
|
let params = { |
|
|
|
id: this.id |
|
|
|
}; |
|
|
|
takeIssueJob(params) |
|
|
|
takeUnProduceIssueJob(params) |
|
|
|
.then(res => { |
|
|
|
callback(true); |
|
|
|
}) |
|
|
@ -500,67 +449,14 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
submit() { |
|
|
|
let that = this; |
|
|
|
if (that.datacontent.details.length === 0) { |
|
|
|
this.showMessage('该任务没有选择的零件'); |
|
|
|
if (this.details.length == 0) { |
|
|
|
this.showMessage('扫描列表为0,请先扫描'); |
|
|
|
return; |
|
|
|
} |
|
|
|
let checkItems = that.details.filter(r => r.scaned === true); |
|
|
|
if (checkItems.length < that.details.length) { |
|
|
|
showConfirmMsg('还有未扫描的零件,是否提交?', confirm => { |
|
|
|
if (confirm) { |
|
|
|
that.finsh(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
that.finsh(); |
|
|
|
} |
|
|
|
this.finsh(); |
|
|
|
}, |
|
|
|
|
|
|
|
handleLocation() { |
|
|
|
let that = this; |
|
|
|
if (that.details[0].requestLocationCode != that.toLocation) { |
|
|
|
showConfirmMsg('目标库位【' + that.toLocation + '】与需求库位不一致,是否要将以上零件发到目标库位?', confirm => { |
|
|
|
if (confirm) { |
|
|
|
that.handledPackingCode(); |
|
|
|
} else { |
|
|
|
that.clearScanLocation(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
showConfirmMsg('是否要将以上零件发到目标库位:【' + that.toLocation + "】", confirm => { |
|
|
|
if (confirm) { |
|
|
|
that.handledPackingCode(); |
|
|
|
} else { |
|
|
|
that.clearScanLocation(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//判断是否有推荐箱码为空的情况 |
|
|
|
handledPackingCode() { |
|
|
|
let that = this; |
|
|
|
let items = this.details.filter(r => { |
|
|
|
return r.scaned && (r.handledPackingCode === null || r.handledPackingCode === '') |
|
|
|
}) |
|
|
|
|
|
|
|
if (items.length > 0) { |
|
|
|
let packingCodes = ''; |
|
|
|
items.forEach(r => { |
|
|
|
packingCodes += r.recommendPackingCode + ',' |
|
|
|
}) |
|
|
|
showConfirmMsg('以下箱码对应的实际箱码为空,是否要继续领料?【' + packingCodes + "】", confirm => { |
|
|
|
if (confirm) { |
|
|
|
that.finsh(); |
|
|
|
} else { |
|
|
|
that.clearScanLocation(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
that.finsh(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
finsh() { |
|
|
|
let that = this; |
|
|
@ -573,7 +469,7 @@ |
|
|
|
that.datacontent.completeTime = getCurrDateTime(); |
|
|
|
that.datacontent.worker = localStorage.userName_CN == "" ? localStorage.userName : localStorage |
|
|
|
.userName_CN; |
|
|
|
that.datacontent.details = that.details; |
|
|
|
that.datacontent.facDetails = that.facDetails; |
|
|
|
let params = JSON.stringify(that.datacontent); |
|
|
|
console.log(params) |
|
|
|
return |
|
|
|