|
|
@ -3,9 +3,12 @@ |
|
|
|
<view class=""> |
|
|
|
<view class="top_card"> |
|
|
|
<com-job-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount" scanHint="已收数量" |
|
|
|
:isShowOther="true" showOther="未发数量"> |
|
|
|
:isShowOther="true" showOther="未收数量" > |
|
|
|
</com-job-scan-detail> |
|
|
|
</view> |
|
|
|
<view class="" style="background-color: #fff; padding: 20rpx; font-size: 32rpx;"> |
|
|
|
承接人 :{{datacontent.claimsUserName}} |
|
|
|
</view> |
|
|
|
<button v-if="showFinishButton" type="primary" @click="finish" style="margin: 20rpx;"> 任务终止</button> |
|
|
|
|
|
|
|
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll" |
|
|
@ -22,6 +25,11 @@ |
|
|
|
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="" style="margin-left: 20rpx; font-size: 35rpx;"> |
|
|
|
<view>未收数量 : {{item.notFinishQty }}</view> |
|
|
|
<view>已收数量 : {{item.receivedQty}}</view> |
|
|
|
<view>需求数量 : {{item.issuedQty}}</view> |
|
|
|
</view> |
|
|
|
<view class="list_form hold_form"> |
|
|
|
<view class="uni-container"> |
|
|
|
<uni-table style="overflow-x: hidden;"> |
|
|
@ -88,7 +96,7 @@ |
|
|
|
<win-collapse-location scanTitle='扫描目标库位' ref='comCollapseLocation' @getLocationCode='getDefaultToLocation' |
|
|
|
@clear='clearDefaultLocation'> |
|
|
|
</win-collapse-location> |
|
|
|
<view class="new_btn_bot bot_pos uni-flex"> |
|
|
|
<view class="new_btn_bot bot_pos uni-flex" v-if="showBtn"> |
|
|
|
<button class="new_clear_btn btn_double" @click="cancel()">清空</button> |
|
|
|
<button class="new_save_btn btn_double" @click="submit()">提交</button> |
|
|
|
</view> |
|
|
@ -106,13 +114,18 @@ |
|
|
|
cancelTakeThirdLocationJob, |
|
|
|
finshThirdLocationJob, |
|
|
|
locations, |
|
|
|
thirdLocationRequestClose |
|
|
|
thirdLocationRequestComplete |
|
|
|
} from '@/api/index.js'; |
|
|
|
import { |
|
|
|
showConfirmMsg, |
|
|
|
goHome, |
|
|
|
navigateBack |
|
|
|
navigateBack, |
|
|
|
deepCopyData |
|
|
|
} from '@/common/basic.js'; |
|
|
|
import { |
|
|
|
calc |
|
|
|
} from '@/common/calc.js'; |
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|
|
|
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue' |
|
|
|
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue' |
|
|
@ -155,22 +168,22 @@ |
|
|
|
scanCount: 0, |
|
|
|
jobStatus: "", |
|
|
|
toLocationInfo: null, |
|
|
|
showFinishButton: false |
|
|
|
showFinishButton: false, |
|
|
|
showBtn: true, |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(param) { |
|
|
|
this.id = param.id; |
|
|
|
if (param.jobStatus == 1) { |
|
|
|
this.receive((callback => { |
|
|
|
this.getDetail(); |
|
|
|
})); |
|
|
|
} else { |
|
|
|
this.getDetail(); |
|
|
|
} |
|
|
|
this.getDetail(); |
|
|
|
}, |
|
|
|
//返回首页 |
|
|
|
onNavigationBarButtonTap(e) { |
|
|
|
if (e.index === 0) { |
|
|
|
|
|
|
|
if (this.datacontent.isClaims && this.datacontent.claimsUserId == localStorage.getItem('userId')) { |
|
|
|
cancelTakeThirdLocationJob(this.id).then(res => {}).catch(error => {}) |
|
|
|
} |
|
|
|
|
|
|
|
goHome(); |
|
|
|
} else if (e.index === 1) { |
|
|
|
window.location.reload(); |
|
|
@ -180,7 +193,7 @@ |
|
|
|
onBackPress(e) { |
|
|
|
//已经接收但是没提交任务 |
|
|
|
if (e.from == 'backbutton') { |
|
|
|
if (this.jobStatus == 2) { |
|
|
|
if (this.datacontent.isClaims && this.datacontent.claimsUserId == localStorage.getItem('userId')) { |
|
|
|
//取消承接任务 |
|
|
|
cancelTakeThirdLocationJob(this.id).then(res => { |
|
|
|
uni.navigateBack(); |
|
|
@ -190,6 +203,7 @@ |
|
|
|
} else { |
|
|
|
uni.navigateBack(); |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
}, |
|
|
@ -232,7 +246,7 @@ |
|
|
|
title: "加载中", |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
thirdLocationRequestClose(this.id).then(res => { |
|
|
|
thirdLocationRequestComplete(this.id).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
uni.showToast({ |
|
|
|
title: "终止成功" |
|
|
@ -286,7 +300,7 @@ |
|
|
|
that.allCount = 0; |
|
|
|
that.details.forEach(res => { |
|
|
|
res.scaned = false; |
|
|
|
that.allCount = that.allCount + res.recommendQty + res.handledQty |
|
|
|
that.allCount = that.allCount + res.issuedQty; |
|
|
|
}) |
|
|
|
that.ispending = item.jobStatus === 2; |
|
|
|
this.getScanCount() |
|
|
@ -295,6 +309,7 @@ |
|
|
|
} else { |
|
|
|
this.showFinishButton = false |
|
|
|
} |
|
|
|
this.setReceived() |
|
|
|
|
|
|
|
// that.toLocation = item.details[0].recommendLocationCode; |
|
|
|
}) |
|
|
@ -302,6 +317,38 @@ |
|
|
|
this.showMessage('未查找到详细信息') |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
setReceived(){ |
|
|
|
//是否承接 |
|
|
|
//已经承接 |
|
|
|
if (this.datacontent.isClaims) { |
|
|
|
this.datacontent.jobStatus = 2 |
|
|
|
//承接并且承接人是自己显示,不是自己隐藏 |
|
|
|
if (this.datacontent.claimsUserId == localStorage.getItem('userId')) { |
|
|
|
this.showBtn = true |
|
|
|
} else { |
|
|
|
this.showBtn = false |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
//未承接,调用承接接口,承接成功后显示按钮 |
|
|
|
this.receive((callback => { |
|
|
|
if (callback) { |
|
|
|
this.datacontent.isClaims = true; |
|
|
|
this.datacontent.jobStatus = 2 |
|
|
|
this.showBtn = true |
|
|
|
this.datacontent.claimsUserName = localStorage.getItem('userName') |
|
|
|
this.datacontent.claimsUserId = localStorage.getItem('userId') |
|
|
|
} else { |
|
|
|
this.showBtn = false |
|
|
|
this.datacontent.isClaims = false; |
|
|
|
this.datacontent.jobStatus = 1 |
|
|
|
this.datacontent.claimsUserId = "" |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//扫描箱标签 |
|
|
|
getScanResult(result) { |
|
|
|
let item = this.details.find(r => { |
|
|
@ -331,9 +378,8 @@ |
|
|
|
getScanCount() { |
|
|
|
this.scanCount = 0; |
|
|
|
this.datacontent.details.forEach(res => { |
|
|
|
this.scanCount = this.scanCount + res.handledQty |
|
|
|
this.scanCount = calc.add(this.scanCount,res.receivedQty ) |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
closeScanPopup() { |
|
|
@ -402,10 +448,13 @@ |
|
|
|
title: "提交中...", |
|
|
|
mask:true |
|
|
|
}); |
|
|
|
this.setParams(); |
|
|
|
let params = JSON.stringify(this.datacontent); |
|
|
|
console.log("提交", params); |
|
|
|
finshThirdLocationJob(this.id, params) |
|
|
|
let params =this.setParams(); |
|
|
|
if (params.length== 0) { |
|
|
|
this.showMessage('请先扫描数据'); |
|
|
|
return; |
|
|
|
} |
|
|
|
console.log("提交", JSON.stringify(params)); |
|
|
|
finshThirdLocationJob( params) |
|
|
|
.then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
if (res != null) { |
|
|
@ -418,19 +467,18 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
setParams() { |
|
|
|
var commitDetails=[] |
|
|
|
this.datacontent.details.forEach(res => { |
|
|
|
// res.handledFromLocationCode = res.recommendFromLocationCode; |
|
|
|
// res.handledFromLocationA rea = res.recommendFromLocationArea; |
|
|
|
// res.handledFromLocationGroup = res.recommendFromLocationGroup; |
|
|
|
// res.handledFromLocationErpCode = res.recommendFromLocationErpCode |
|
|
|
// res.handledFromWarehouseCode = res.recommendFromWarehouseCode; |
|
|
|
|
|
|
|
res.toLocationCode = this.toLocationInfo.code; |
|
|
|
res.toLocationArea = this.toLocationInfo.areaCode; |
|
|
|
// res.toLocationGroup = this.toLocationInfo.locationGroupCode; |
|
|
|
// res.toLocationErpCode = this.toLocationInfo.erpLocationCode; |
|
|
|
|
|
|
|
if(res.scaned){ |
|
|
|
res.toLocationCode = this.toLocationInfo.code; |
|
|
|
res.toLocationArea = this.toLocationInfo.areaCode; |
|
|
|
|
|
|
|
var data=deepCopyData(res); |
|
|
|
data.recommendQty =res.handledQty; |
|
|
|
commitDetails.push(data) |
|
|
|
} |
|
|
|
}) |
|
|
|
return commitDetails; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|