Browse Source

修改到货检验逻辑

wms3.0_pda
lijuncheng 10 months ago
parent
commit
859ae4d107
  1. 254
      pages/inspect/job/inspectResult.vue
  2. 2
      pages/putaway/job/putawayDetail.vue

254
pages/inspect/job/inspectResult.vue

@ -48,38 +48,40 @@
<view class="pda-list-cell"> <view class="pda-list-cell">
<view class="pda-list-cell-left"> <view class="pda-list-cell-left">
<view class="uni-label">不合格数量</view> <view class="uni-label">下一步动作</view>
</view> </view>
<view class="pda-list-cell-db"> <view class="pda-list-cell-db">
<uni-easyinput :inputBorder="true" type="number" placeholder="请输入数字" v-model="jobContent.failedQty" @clear="clearFailedQty" <uni-data-picker class='uni-data-picker' placeholder="请选择下一步动作" popup-title="下一步动作"
@blur="failedQtyConfirm" class="count-input"> @change="nextStepChange" :localdata="nextActionList" v-model="nextAction">
</uni-easyinput> </uni-data-picker>
</view> </view>
</view> </view>
<view class="pda-list-cell"> <view class="pda-list-cell">
<view class="pda-list-cell-left"> <view class="pda-list-cell-left">
<view class="uni-label">报废数量</view> <view class="uni-label">不合格数量</view>
</view> </view>
<view class="pda-list-cell-db"> <view class="pda-list-cell-db">
<uni-easyinput placeholder="请输入数字" type="number" v-model="jobContent.crackQty" @blur="" @clear="clearCrackQty" <uni-easyinput :inputBorder="true" type="number" placeholder="请输入数字" v-model="jobContent.failedQty"
class="count-input"> @clear="clearFailedQty" @blur="failedQtyConfirm" class="count-input">
</uni-easyinput> </uni-easyinput>
</view> </view>
</view> </view>
<view class="pda-list-cell"> <view class="pda-list-cell">
<view class="pda-list-cell-left"> <view class="pda-list-cell-left">
<view class="uni-label">下一步动作</view> <view class="uni-label">报废数量</view>
</view> </view>
<view class="pda-list-cell-db"> <view class="pda-list-cell-db">
<uni-data-picker class='uni-data-picker' placeholder="请选择下一步动作" popup-title="下一步动作" <uni-easyinput placeholder="请输入数字" type="number" v-model="jobContent.crackQty" @blur=""
@change="nextStepChange" :localdata="nextActionList" v-model="nextAction"> @clear="clearCrackQty" class="count-input">
</uni-data-picker> </uni-easyinput>
</view> </view>
</view> </view>
<view class="pda-list-cell"> <view class="pda-list-cell">
<view class="pda-list-cell-left"> <view class="pda-list-cell-left">
<view class="uni-label">最终不合格</view> <view class="uni-label">最终不合格</view>
@ -303,8 +305,10 @@
}, },
nextStepChange(e) { nextStepChange(e) {
if (e.detail.value.length > 0) {
this.nextAction = e.detail.value[0].value; this.nextAction = e.detail.value[0].value;
this.calcNotPassQty(); this.calcNotPassQty();
}
}, },
calcNotPassQty() { calcNotPassQty() {
@ -329,61 +333,26 @@
} }
}, },
clearFailedQty(){ clearFailedQty() {
this.jobContent.failedQty = null; this.jobContent.failedQty = null;
}, },
clearCrackQty(){ clearCrackQty() {
this.jobContent.crackQty = null this.jobContent.crackQty = null
}, },
commit() { commit() {
if (this.nextAction == null) {
if (this.jobContent.failedQty == null) { this.showMessage("请选择下一步动作")
this.showMessage("请输入不合格数量")
return
}
if (this.jobContent.crackQty == null) {
this.showMessage("请输入不报废数量")
return
}
var receiveQty = Number(this.jobContent.receiveQty)
var failedQty = Number(this.jobContent.failedQty);
var crackQty = Number(this.jobContent.crackQty);
if (crackQty + failedQty > receiveQty) {
var total = crackQty + failedQty;
this.showMessage("不合格数[" + failedQty + "]+报废数量[" + crackQty + "]等于[" + total + "]大于收货数量[" +
receiveQty + "]")
return return
} }
//==0() if (this.nextAction == "ALL_OK") {
if (failedQty == 0) { //
if (crackQty == 0) {
if (this.nextAction == "ALL_NOK") {
this.jobContent.subList.forEach(res => {
res.handleQty = res.qty
res.failedQty = res.qty;
res.notPassedQty = res.failedQty;
res.crackQty = 0;
res.goodQty = 0;
res.failedReason = "";
res.photos = ""
res.inspectResult = ""
res.toInventoryStatus = "NOK"
res.inspectUser = this.$store.state.user.id
})
this.jobContent.nextAction = this.nextAction;
this.jobContent.goodQty = 0
this.submitJob(this.jobContent)
}else {
//==0
this.jobContent.subList.forEach(res => { this.jobContent.subList.forEach(res => {
res.handleQty = res.qty res.handleQty = res.qty //
res.failedQty = 0; res.failedQty = 0;
res.notPassedQty = res.failedQty; res.notPassedQty = 0;
res.crackQty = 0; res.crackQty = 0;
res.goodQty = res.qty; res.goodQty = res.qty;
res.failedReason = ""; res.failedReason = "";
@ -392,35 +361,12 @@
res.toInventoryStatus = "OK" res.toInventoryStatus = "OK"
res.inspectUser = this.$store.state.user.id res.inspectUser = this.$store.state.user.id
}) })
this.jobContent.nextAction = "";
this.jobContent.goodQty = this.jobContent.receiveQty this.jobContent.goodQty = this.jobContent.receiveQty
this.jobContent.nextAction = this.nextAction;
this.submitJob(this.jobContent) this.submitJob(this.jobContent)
}
} else { } else if (this.nextAction == "ALL_NOK") {
//0 //
//
uni.navigateTo({
url: './inspectDetail?id=' + this.id +
'&status=' + this.status +
'&failedQty=' + this.jobContent.failedQty +
'&crackQty=' + this.jobContent.crackQty
});
}
} else {
//>0
//
if (this.nextAction == null) {
this.showMessage("请选择下一步动作")
return
}
//
if (this.nextAction == "ALL_NOK") {
//
this.jobContent.subList.forEach(res => { this.jobContent.subList.forEach(res => {
res.handleQty = res.qty res.handleQty = res.qty
res.failedQty = res.qty; res.failedQty = res.qty;
@ -436,24 +382,42 @@
this.jobContent.nextAction = this.nextAction; this.jobContent.nextAction = this.nextAction;
this.jobContent.goodQty = 0 this.jobContent.goodQty = 0
this.submitJob(this.jobContent) this.submitJob(this.jobContent)
//
} else if (this.nextAction == "PARTIAL_OK") { } else if (this.nextAction == "PARTIAL_OK") {
// //
if (this.jobContent.failedQty == null) {
this.showMessage("请输入不合格数量")
return
}
if (this.jobContent.crackQty == null) {
this.showMessage("请输入报废数量")
return
}
var receiveQty = Number(this.jobContent.receiveQty)
var failedQty = Number(this.jobContent.failedQty);
var crackQty = Number(this.jobContent.crackQty);
if (crackQty + failedQty > receiveQty) {
var total = crackQty + failedQty;
this.showMessage("不合格数[" + failedQty + "]+报废数量[" + crackQty + "]等于[" + total + "]大于收货数量[" +
receiveQty + "]")
return
}
uni.navigateTo({ uni.navigateTo({
url: './inspectDetail?id=' + this.id + url: './inspectDetail?id=' + this.id +
'&status=' + this.status + '&status=' + this.status +
'&failedQty=' + this.jobContent.failedQty + '&failedQty=' + this.jobContent.failedQty +
'&crackQty=' + this.jobContent.crackQty '&crackQty=' + this.jobContent.crackQty
}); });
//
} else if (this.nextAction == "FULL_INSPECT") { } else if (this.nextAction == "FULL_INSPECT") {
// //
this.jobContent.subList.forEach(res => { this.jobContent.subList.forEach(res => {
res.handleQty = res.qty res.handleQty = res.qty
res.failedQty = 0; res.failedQty = 0;
res.notPassedQty = res.failedQty; res.notPassedQty = res.failedQty;
res.crackQty = 0; res.crackQty = 0;
res.goodQty = res.qty; // res.goodQty = res.qty;
res.goodQty = 0;
res.failedReason = ""; res.failedReason = "";
res.photos = "" res.photos = ""
res.inspectResult = "" res.inspectResult = ""
@ -465,7 +429,113 @@
this.submitJob(this.jobContent) this.submitJob(this.jobContent)
} }
} //==0()
// if (failedQty == 0) {
// if (crackQty == 0) {
// if (this.nextAction == "ALL_NOK") {
// this.jobContent.subList.forEach(res => {
// res.handleQty = res.qty
// res.failedQty = res.qty;
// res.notPassedQty = res.failedQty;
// res.crackQty = 0;
// res.goodQty = 0;
// res.failedReason = "";
// res.photos = ""
// res.inspectResult = ""
// res.toInventoryStatus = "NOK"
// res.inspectUser = this.$store.state.user.id
// })
// this.jobContent.nextAction = this.nextAction;
// this.jobContent.goodQty = 0
// this.submitJob(this.jobContent)
// }else {
// //==0
// this.jobContent.subList.forEach(res => {
// res.handleQty = res.qty
// res.failedQty = 0;
// res.notPassedQty = res.failedQty;
// res.crackQty = 0;
// res.goodQty = res.qty;
// res.failedReason = "";
// res.photos = ""
// res.inspectResult = ""
// res.toInventoryStatus = "OK"
// res.inspectUser = this.$store.state.user.id
// })
// this.jobContent.nextAction = "";
// this.jobContent.goodQty = this.jobContent.receiveQty
// this.submitJob(this.jobContent)
// }
// } else {
// //0
// //
// uni.navigateTo({
// url: './inspectDetail?id=' + this.id +
// '&status=' + this.status +
// '&failedQty=' + this.jobContent.failedQty +
// '&crackQty=' + this.jobContent.crackQty
// });
// }
// } else {
// //>0
// //
// if (this.nextAction == null) {
// this.showMessage("")
// return
// }
// //
// if (this.nextAction == "ALL_NOK") {
// //
// this.jobContent.subList.forEach(res => {
// res.handleQty = res.qty
// res.failedQty = res.qty;
// res.notPassedQty = res.failedQty;
// res.crackQty = 0;
// res.goodQty = 0;
// res.failedReason = "";
// res.photos = ""
// res.inspectResult = ""
// res.toInventoryStatus = "NOK"
// res.inspectUser = this.$store.state.user.id
// })
// this.jobContent.nextAction = this.nextAction;
// this.jobContent.goodQty = 0
// this.submitJob(this.jobContent)
// //
// } else if (this.nextAction == "PARTIAL_OK") {
// //
// uni.navigateTo({
// url: './inspectDetail?id=' + this.id +
// '&status=' + this.status +
// '&failedQty=' + this.jobContent.failedQty +
// '&crackQty=' + this.jobContent.crackQty
// });
// //
// } else if (this.nextAction == "FULL_INSPECT") {
// //
// this.jobContent.subList.forEach(res => {
// res.handleQty = res.qty
// res.failedQty = 0;
// res.notPassedQty = res.failedQty;
// res.crackQty = 0;
// res.goodQty = res.qty;
// res.failedReason = "";
// res.photos = ""
// res.inspectResult = ""
// res.toInventoryStatus = "OK"
// res.inspectUser = this.$store.state.user.id
// })
// this.jobContent.goodQty = this.jobContent.receiveQty
// this.jobContent.nextAction = this.nextAction;
// this.submitJob(this.jobContent)
// }
// }
}, },
submitJob(params) { submitJob(params) {
@ -477,11 +547,11 @@
inspectJobSubmit(params).then(res => { inspectJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
var hint=""; var hint = "";
if(this.jobContent.nextAction=="FULL_INSPECT"){ if (this.jobContent.nextAction == "FULL_INSPECT") {
hint ="提交成功<br>生成到货检验任务<br>" + res.data hint = "提交成功<br>生成到货检验任务<br>" + res.data
}else { } else {
hint ="提交成功<br>生成到货检验记录<br>" + res.data hint = "提交成功<br>生成到货检验记录<br>" + res.data
} }
this.showCommitSuccessMessage(hint) this.showCommitSuccessMessage(hint)
} else { } else {

2
pages/putaway/job/putawayDetail.vue

@ -425,7 +425,7 @@
putawayJobSubmit(params).then(res => { putawayJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data) this.showCommitSuccessMessage("提交成功<br>生成原料上架记录<br>" + res.data)
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
} }

Loading…
Cancel
Save