|
|
@ -3,100 +3,90 @@ |
|
|
|
<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> |
|
|
|
<comJobUnScanDetail :jobContent="datacontent" :scanCount="scanCount"> |
|
|
|
</comJobUnScanDetail> |
|
|
|
</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-content"> |
|
|
|
<view class="choose_main"> |
|
|
|
<view class="ljh_box"> |
|
|
|
<view class="tit_ljh">{{ item.itemCode }}</view> |
|
|
|
<view class="ljh_left desc_ljh"> |
|
|
|
<view class="font_xs text_lightblue">{{ item.itemName }}</view> |
|
|
|
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view> |
|
|
|
@scroll="scroll" class="scroll-detail" > |
|
|
|
<view class="" style="margin-bottom:120rpx"> |
|
|
|
<view class="detail-list margin_top" v-for="(item, index) in details" :key="item.id"> |
|
|
|
<uni-swipe-action> |
|
|
|
<uni-swipe-action-item :right-options="options" :auto-close="false" |
|
|
|
@click="swipeClick($event,item,index)" style='background-color: #ffffff;'> |
|
|
|
|
|
|
|
<view class="detail-content"> |
|
|
|
<view class="choose_main"> |
|
|
|
<view class="ljh_box"> |
|
|
|
<view class="tit_ljh">{{ item.itemCode }}</view> |
|
|
|
<view class="ljh_left desc_ljh"> |
|
|
|
<view class="font_xs text_lightblue">{{ item.itemName }}</view> |
|
|
|
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="list_form"> |
|
|
|
<view class="uni-container"> |
|
|
|
<uni-table style="overflow-x: hidden;"> |
|
|
|
|
|
|
|
<uni-tr> |
|
|
|
<uni-th width="50">数量</text></uni-th> |
|
|
|
<uni-th width="0" align="center"> |
|
|
|
</uni-th> |
|
|
|
<uni-th width="360" 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)"> |
|
|
|
</com-number-box> |
|
|
|
<text v-if="false" class="text_black">({{item.uom}})</text> |
|
|
|
</view> |
|
|
|
</uni-th> |
|
|
|
</uni-tr> |
|
|
|
<uni-tr> |
|
|
|
<uni-th width="50">箱码</uni-th> |
|
|
|
<uni-th width="0" align="center"> |
|
|
|
</uni-th> |
|
|
|
<uni-th width="360" align="center"> |
|
|
|
<view class="text_packingCode"> |
|
|
|
{{ item.handledPackingCode }} |
|
|
|
</view> |
|
|
|
</uni-th> |
|
|
|
</uni-tr> |
|
|
|
<uni-tr> |
|
|
|
<uni-th width="50">批次</uni-th> |
|
|
|
<uni-th width="0" align="center"> |
|
|
|
</uni-th> |
|
|
|
<uni-th width="360" align="center"> |
|
|
|
<view class="text_black">{{item.handledLot }}</view> |
|
|
|
</uni-th> |
|
|
|
</uni-tr> |
|
|
|
</uni-table> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-if="item.scaned" class="choose_marked_count" |
|
|
|
style="background-color: #5FCB94; opacity: 0.65"> |
|
|
|
<view class="" style="background-color: #5FCB94; width: 200rpx;height: 300rpx;"> |
|
|
|
|
|
|
|
</view> |
|
|
|
<!-- <image src="@/static/image_marked.svg"></image> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<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> |
|
|
|
<uni-th width="120" align="center"> |
|
|
|
<view v-if="item.scaned" |
|
|
|
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)"> |
|
|
|
</com-number-box> |
|
|
|
<text class="text_black">({{item.uom}})</text> |
|
|
|
</view> |
|
|
|
</uni-th> |
|
|
|
</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> |
|
|
|
<uni-th width="120" align="center"> |
|
|
|
<view v-if="item.scaned" 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> |
|
|
|
<uni-th width="120" align="center"> |
|
|
|
<view v-if="item.scaned" 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.recommendToLocationCode }}</view> |
|
|
|
</uni-th> |
|
|
|
<uni-th width="100" align="center"> |
|
|
|
<view class="text_black" v-if="item.scaned"> |
|
|
|
{{ item.toLocationCode }} |
|
|
|
</view> |
|
|
|
</uni-th> |
|
|
|
</uni-tr> |
|
|
|
</uni-table> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-if="item.scaned" class="choose_marked_count" |
|
|
|
style="background-color: #5FCB94; opacity: 0.65"> |
|
|
|
<view class="" style="background-color: #5FCB94; width: 200rpx;height: 300rpx;"> |
|
|
|
|
|
|
|
</view> |
|
|
|
<!-- <image src="@/static/image_marked.svg"></image> --> |
|
|
|
</view> |
|
|
|
</uni-swipe-action-item> |
|
|
|
</uni-swipe-action> |
|
|
|
</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_bot_box"> |
|
|
|
<win-collapse-location ref='comCollapseLocation' @getLocationCode='getToLocation' @clear='clearLocation'> |
|
|
|
</win-collapse-location> |
|
|
|
<view class="new_btn_bot bot_pos uni-flex"> |
|
|
|
<button class="new_clear_btn btn_double" @click="clear()">清空</button> |
|
|
|
<button class="new_save_btn btn_double" @click="submit()">提交</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<com-balance ref='issueitems' @selectedItem='selectedBalanceItem'></com-balance> |
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
@ -111,9 +101,10 @@ |
|
|
|
<script> |
|
|
|
import { |
|
|
|
getUnProduceReturnDetail, |
|
|
|
takeIssueJob, |
|
|
|
cancelTakeIssueJob, |
|
|
|
takeUnProduceReturnJob, |
|
|
|
cancelTakeUnProduceReturnJob, |
|
|
|
finshUnProduceReturnJob, |
|
|
|
locations |
|
|
|
} from '@/api/index.js'; |
|
|
|
import { |
|
|
|
getJobStatuStyle, |
|
|
@ -123,16 +114,20 @@ |
|
|
|
compareDesc, |
|
|
|
compareStr, |
|
|
|
getCurrDateTime, |
|
|
|
getCurrDateTimeAndT, |
|
|
|
scanSuccessAudio, |
|
|
|
scanFailedAudio |
|
|
|
scanFailedAudio, |
|
|
|
getRemoveOption, |
|
|
|
guid |
|
|
|
} from '@/common/basic.js'; |
|
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
|
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|
|
|
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue' |
|
|
|
import comBalance from '@/mycomponents/common/comBalance.vue' |
|
|
|
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue' |
|
|
|
import comJobUnScanDetail from '@/mycomponents/comjob/comJobUnScanDetail.vue' |
|
|
|
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue' |
|
|
|
import comNumberBox from '@/mycomponents/common/comNumberBox.vue'; |
|
|
|
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue' |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
@ -140,15 +135,16 @@ |
|
|
|
winScanButton, |
|
|
|
winMulitScan, |
|
|
|
comBalance, |
|
|
|
comJobScanDetail, |
|
|
|
comJobUnScanDetail, |
|
|
|
winScanByPack, |
|
|
|
comNumberBox |
|
|
|
comNumberBox, |
|
|
|
winCollapseLocation |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
id: "", |
|
|
|
datacontent: {}, |
|
|
|
details: {}, |
|
|
|
details: [], |
|
|
|
toLocation: '', |
|
|
|
scrollTop: 0, |
|
|
|
old: { |
|
|
@ -162,6 +158,9 @@ |
|
|
|
scanCount: 0, |
|
|
|
isPack: true, |
|
|
|
titleArray: ['箱标签'], |
|
|
|
options: [], |
|
|
|
locationInfo:null, |
|
|
|
jobStatus: "", |
|
|
|
} |
|
|
|
}, |
|
|
|
filters: { |
|
|
@ -177,14 +176,14 @@ |
|
|
|
}, |
|
|
|
onLoad(param) { |
|
|
|
this.id = param.id; |
|
|
|
// if (param.jobStatus == 1) { |
|
|
|
// this.receive((callback => { |
|
|
|
// this.getDetail(); |
|
|
|
// })); |
|
|
|
// } else { |
|
|
|
// this.getDetail(); |
|
|
|
// } |
|
|
|
this.getDetail(); |
|
|
|
this.options = getRemoveOption(); |
|
|
|
if (param.jobStatus == 1) { |
|
|
|
this.receive((callback => { |
|
|
|
this.getDetail(); |
|
|
|
})); |
|
|
|
} else { |
|
|
|
this.getDetail(); |
|
|
|
} |
|
|
|
}, |
|
|
|
onReady() {}, |
|
|
|
//返回首页 |
|
|
@ -197,12 +196,20 @@ |
|
|
|
}, |
|
|
|
//拦截返回按钮事件 |
|
|
|
onBackPress(e) { |
|
|
|
//取消承接任务 |
|
|
|
// cancelTakeIssueJob(this.id) |
|
|
|
// .then(res => {}) |
|
|
|
// .catch(err => { |
|
|
|
// this.showMessage(err.message); |
|
|
|
// }); |
|
|
|
//取消承接任务 |
|
|
|
if (e.from == 'backbutton') { |
|
|
|
if (this.jobStatus == 2) { |
|
|
|
//取消承接任务 |
|
|
|
cancelTakeUnProduceReturnJob(this.id).then(res => { |
|
|
|
uni.navigateBack(); |
|
|
|
}).catch(error => { |
|
|
|
uni.navigateBack(); |
|
|
|
}) |
|
|
|
} else { |
|
|
|
uni.navigateBack(); |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
uni.setNavigationBarColor({ |
|
|
@ -220,6 +227,7 @@ |
|
|
|
}, |
|
|
|
//加载零件信息 |
|
|
|
getDetail() { |
|
|
|
|
|
|
|
let that = this; |
|
|
|
if (that.id == undefined) { |
|
|
|
return; |
|
|
@ -235,180 +243,171 @@ |
|
|
|
.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; |
|
|
|
|
|
|
|
} |
|
|
|
that.jobStatus = item.jobStatus; |
|
|
|
that.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; |
|
|
|
swipeClick(e, item, index) { |
|
|
|
let { |
|
|
|
content |
|
|
|
} = e; |
|
|
|
if (content.text === '移除') { |
|
|
|
uni.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: '是否移除选择的行?', |
|
|
|
success: res => { |
|
|
|
if (res.confirm) { |
|
|
|
this.details.splice(index, 1) |
|
|
|
this.scanCount = 0; |
|
|
|
var tempQty =Number(this.datacontent.qty)/Number(this.details.length) |
|
|
|
this.details.forEach(res => { |
|
|
|
res.handledQty =tempQty |
|
|
|
this.scanCount += res.handledQty |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
if (this.allCount === this.scanCount) { |
|
|
|
scanFailedAudio() |
|
|
|
this.showMessage("零件已经全部扫描完成"); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.handledPackCode(result, false); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
this.scrollToTop(); |
|
|
|
|
|
|
|
|
|
|
|
// //零件是否已经被扫描过 |
|
|
|
// let item = this.details.find(r => r.recommendPackingCode === result.data.packingCode && r |
|
|
|
// .scanPackingCode != result.data.packingCode); |
|
|
|
// if (item != undefined && item.scaned) { |
|
|
|
// showConfirmMsg('扫描的箱码【' + result.data.packingCode + '】匹配到任务中的【' + item.scanPackingCode + |
|
|
|
// '】箱,是否要重新匹配任务中的【' + item.scanPackingCode + '】箱?', |
|
|
|
// confirm => { |
|
|
|
// if (confirm) { |
|
|
|
// this.handledPackCode(result, true); |
|
|
|
// } else { |
|
|
|
// return; |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// } else { |
|
|
|
// if (this.allCount === this.scanCount) { |
|
|
|
// this.showMessage("零件已经全部扫描完成"); |
|
|
|
// return; |
|
|
|
// } |
|
|
|
// this.handledPackCode(result, false); |
|
|
|
// } |
|
|
|
// this.scrollToTop(); |
|
|
|
}, |
|
|
|
|
|
|
|
//处理箱标签 |
|
|
|
//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) { |
|
|
|
this.showScanMessage('箱码【' + that.currentScanLebel.data.packingCode + '】已经扫描,请扫描下一箱零件'); |
|
|
|
} else { |
|
|
|
this.dyIssue(result, scaned); |
|
|
|
getScanResult(result) { |
|
|
|
|
|
|
|
if (result.data.itemCode != this.datacontent.itemCode) { |
|
|
|
this.showScanMessage('扫描箱码【' + result.data.code + '】对应的物料\n【' + result.data.itemCode + '】与任务中的料号不一致'); |
|
|
|
return |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
dyIssue(result, scaned) { |
|
|
|
let that = this; |
|
|
|
var itemCode = that.details.find(r => { |
|
|
|
return r.itemCode === result.data.itemCode && |
|
|
|
r.scaned === scaned |
|
|
|
}) |
|
|
|
if (itemCode == undefined) { |
|
|
|
that.showScanMessage('所扫描的箱码【' + result.data.code + '】对应的物料【' + result.data.itemCode + '】不在任务中'); |
|
|
|
let scanItem = this.details.find(r => r.itemCode === result.data.itemCode && |
|
|
|
r.handledPackingCode === result.data.code) |
|
|
|
|
|
|
|
if (scanItem) { |
|
|
|
this.showScanMessage('箱码【' + result.data.code + '】已经扫描'); |
|
|
|
} 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料号相同、箱码不相同、批次不相同") |
|
|
|
that.currentItem = itemCode; |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
// setTimeout(res => { |
|
|
|
// showConfirmMsg(itemCode.recommendPackingCode+'未执行先进先出或不是最先批次,是否继续?', confirm => { |
|
|
|
// if (confirm) { |
|
|
|
// that.currentItem = itemCode; |
|
|
|
// that.afterScanPackLabel(result); |
|
|
|
// } else { |
|
|
|
// that.scanPopupGetFocus(); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// }, 100) |
|
|
|
// if (this.scanCount == this.datacontent.qty) { |
|
|
|
// this.showMessage("扫描数量已经等于需求数量") |
|
|
|
// return; |
|
|
|
// } |
|
|
|
|
|
|
|
} else { |
|
|
|
console.log("ERP料号相同、箱码不相同、批次相同") |
|
|
|
//ERP料号相同、箱码不相同、批次相同 |
|
|
|
that.currentItem = itemCode2; |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
} |
|
|
|
var item = { |
|
|
|
itemCode: result.data.itemCode, |
|
|
|
handledPackingCode: result.data.code, |
|
|
|
handledLot: result.data.lot, |
|
|
|
handledQty: Number(this.datacontent.qty) |
|
|
|
} |
|
|
|
this.setParam(item,result) |
|
|
|
this.details.push(item) |
|
|
|
var tempQty =Number(this.datacontent.qty)/Number(this.details.length) |
|
|
|
|
|
|
|
this.scanCount = 0; |
|
|
|
this.details.forEach(res => { |
|
|
|
res.handledQty =tempQty |
|
|
|
this.scanCount += res.handledQty |
|
|
|
}) |
|
|
|
this.$forceUpdate() |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getToLocation(code) { |
|
|
|
if (code == '') { |
|
|
|
this.showMessage('目标库位不能为空'); |
|
|
|
return; |
|
|
|
} |
|
|
|
uni.showLoading({ |
|
|
|
title: "扫描中", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
let that = this; |
|
|
|
locations(code).then(res => { |
|
|
|
if (res == null) { |
|
|
|
scanFailedAudio() |
|
|
|
that.showMessage('目标库位【' + code + '】不存在'); |
|
|
|
this.$refs.comCollapseLocation.clearLocation(); |
|
|
|
} 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料号相同、箱码相同、批次不同") |
|
|
|
that.currentItem = itemCode1; |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
// setTimeout(res => { |
|
|
|
// showConfirmMsg(itemCode1.recommendPackingCode+'未执行先进先出或不是最先批次,是否继续?', confirm => { |
|
|
|
// if (confirm) { |
|
|
|
// that.currentItem = itemCode1; |
|
|
|
// that.afterScanPackLabel(result); |
|
|
|
// } else { |
|
|
|
// that.scanPopupGetFocus(); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// }, 100) |
|
|
|
|
|
|
|
if (that.datacontent.fromErpLocationCode != res.erpLocationCode) { |
|
|
|
scanFailedAudio() |
|
|
|
that.showMessage('目标库位的ERP储位【' + res.erpLocationCode + '】与【' + |
|
|
|
this.datacontent.fromErpLocationCode + |
|
|
|
'】不是同一ERP储位,请重新扫描'); |
|
|
|
this.$refs.comCollapseLocation.clearLocation(); |
|
|
|
} else { |
|
|
|
console.log("ERP料号相同、箱码相同、批次相同") |
|
|
|
//ERP料号相同、箱码相同、批次相同 |
|
|
|
that.currentItem = itemCode3; |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
scanSuccessAudio() |
|
|
|
this.locationInfo=res |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
uni.hideLoading(); |
|
|
|
}).catch(err => { |
|
|
|
scanFailedAudio() |
|
|
|
that.locationInfo = null; |
|
|
|
that.showMessage(err.message); |
|
|
|
uni.hideLoading(); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
clearLocation() { |
|
|
|
this.locationInfo = null; |
|
|
|
}, |
|
|
|
|
|
|
|
setParam(item, result) { |
|
|
|
item.id = guid(), |
|
|
|
item.creationTime = getCurrDateTimeAndT() |
|
|
|
item.creatorId =guid() |
|
|
|
item.lastModificationTime = getCurrDateTimeAndT() |
|
|
|
item.lastModifierId = guid() |
|
|
|
item.masterID = this.datacontent.id |
|
|
|
item.number = this.datacontent.number |
|
|
|
item.remark = "" |
|
|
|
item.itemName = result.data.itemName |
|
|
|
item.itemDesc1 = result.data.itemDesc1 |
|
|
|
item.itemDesc2 = result.data.itemDesc2 |
|
|
|
item.itemCode = result.data.itemCode |
|
|
|
item.stdPackQty = result.data.stdPackQty |
|
|
|
item.status = 2 |
|
|
|
item.recommendContainerCode = "" |
|
|
|
item.recommendPackingCode = result.data.packingCode |
|
|
|
item.recommendSupplierBatch = result.data.supplierBatch |
|
|
|
item.recommendArriveDate = result.data.arriveDate |
|
|
|
item.recommendProduceDate = result.data.produceDate |
|
|
|
item.recommendExpireDate = result.data.expireDate |
|
|
|
item.recommendLot = result.data.lot |
|
|
|
item.recommendToLocationCode = "" |
|
|
|
item.recommendToLocationArea = "" |
|
|
|
item.recommendToLocationGroup = "" |
|
|
|
item.recommendToLocationErpCode = "" |
|
|
|
item.recommendToWarehouseCode = "" |
|
|
|
item.recommendQty = item.handledQty |
|
|
|
item.uom = result.data.uom |
|
|
|
|
|
|
|
item.handledContainerCode = result.data.containerCode |
|
|
|
item.handledPackingCode = result.data.packingCode |
|
|
|
item.handledSupplierBatch = result.data.supplierBatch |
|
|
|
item.handledArriveDate = result.data.arriveDate |
|
|
|
item.handledProduceDate = result.data.produceDate |
|
|
|
item.handledExpireDate = result.data.expireDate |
|
|
|
item.handledLot = result.data.lot |
|
|
|
|
|
|
|
item.handledToLocationCode = "" |
|
|
|
item.handledToLocationArea = "" |
|
|
|
item.handledToLocationGroup = "" |
|
|
|
item.handledToLocationErpCode = "" |
|
|
|
item.handledToWarehouseCode = "" |
|
|
|
item.handledQty = item.handledQty |
|
|
|
item.extraProperties= { |
|
|
|
additionalProp1: "", |
|
|
|
additionalProp2: "", |
|
|
|
additionalProp3: "" |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setParams(item, result) { |
|
|
|
item.scaned = true; |
|
|
|
item.scanDate = new Date() //增加扫描信息属性 |
|
|
@ -423,8 +422,8 @@ |
|
|
|
item.handledBatch = result.data.batch; |
|
|
|
item.handledLot = result.data.lot; |
|
|
|
|
|
|
|
item.defaultHandleQty = result.data.qty>item.recommendQty?item.recommendQty:result.data.qty; |
|
|
|
item.handledQty = result.data.qty>item.recommendQty?item.recommendQty:result.data.qty; |
|
|
|
item.defaultHandleQty = result.data.qty > item.recommendQty ? item.recommendQty : result.data.qty; |
|
|
|
item.handledQty = result.data.qty > item.recommendQty ? item.recommendQty : result.data.qty; |
|
|
|
item.handledFromLocationCode = ""; |
|
|
|
item.handledFromLocationArea = ""; |
|
|
|
item.handledFromLocationGroup = ""; |
|
|
@ -470,7 +469,7 @@ |
|
|
|
let params = { |
|
|
|
id: this.id |
|
|
|
}; |
|
|
|
takeIssueJob(params) |
|
|
|
takeUnProduceReturnJob(params) |
|
|
|
.then(res => { |
|
|
|
callback(true); |
|
|
|
}) |
|
|
@ -481,46 +480,18 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
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(); |
|
|
|
if (!this.locationInfo) { |
|
|
|
this.showMessage('请先扫描目标库位'); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.finsh(); |
|
|
|
}, |
|
|
|
|
|
|
|
//判断是否有推荐箱码为空的情况 |
|
|
|
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; |
|
|
@ -532,11 +503,23 @@ |
|
|
|
that.datacontent.completeUserName = localStorage.getItem('userName_CN') |
|
|
|
that.datacontent.completeTime = getCurrDateTime(); |
|
|
|
that.datacontent.worker = localStorage.userName_CN == "" ? localStorage.userName : localStorage |
|
|
|
.userName_CN; |
|
|
|
.userName_CN; |
|
|
|
//目标库位赋值 |
|
|
|
that.details.forEach(res => { |
|
|
|
res.recommendToLocationCode = this.locationInfo.code |
|
|
|
res.recommendToLocationArea = this.locationInfo.areaCode |
|
|
|
res.recommendToLocationGroup = this.locationInfo.locationGroupCode |
|
|
|
res.recommendToLocationErpCode = this.locationInfo.erpLocationCode |
|
|
|
|
|
|
|
res.handledToLocationCode =this.locationInfo.code |
|
|
|
res.handledToLocationArea=this.locationInfo.areaCode |
|
|
|
res.handledToLocationGroup =this.locationInfo.locationGroupCode |
|
|
|
res.handledToLocationErpCode =this.locationInfo.erpLocationCode |
|
|
|
}) |
|
|
|
that.datacontent.details = that.details; |
|
|
|
let params = JSON.stringify(that.datacontent); |
|
|
|
let params = JSON.stringify(that.details); |
|
|
|
console.log("提交", params) |
|
|
|
finshUnProduceReturnJob(that.id, params) |
|
|
|
finshUnProduceReturnJob(that.id,this.datacontent.number,localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN, params) |
|
|
|
.then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
if (res != null) { |
|
|
@ -600,9 +583,6 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
closeScanMessage() { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
scanPopupGetFocus() { |
|
|
|
this.$refs.scanPopup.getfocus(); |
|
|
@ -630,12 +610,14 @@ |
|
|
|
qtyChanged(value, item, index) { |
|
|
|
if (value <= 0) { |
|
|
|
this.showMessage('退料数量不能小于或等于0') |
|
|
|
item.handledQty = item.defaultHandleQty |
|
|
|
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|
|
|
} else if (value > item.defaultHandleQty) { |
|
|
|
item.handledQty = item.defaultHandleQty |
|
|
|
this.scanCount = this.datacontent.qty |
|
|
|
this.$refs['comNumberBox_' + index][0].setValue(this.scanCount); |
|
|
|
} else if (value > this.datacontent.qty) { |
|
|
|
this.scanCount = this.datacontent.qty |
|
|
|
this.showMessage("实际退料数量不能大于申请数量") |
|
|
|
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|
|
|
this.$refs['comNumberBox_' + index][0].setValue(this.scanCount); |
|
|
|
}else { |
|
|
|
this.scanCount=value; |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
@ -643,4 +625,4 @@ |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
</style> |
|
|
|
</style> |