|
@ -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 { |
|
|