|
|
@ -50,9 +50,9 @@ |
|
|
|
<view class="pda-list-cell-left"> |
|
|
|
<view class="uni-label">不合格数量</view> |
|
|
|
</view> |
|
|
|
<view class="pda-list-cell-db" > |
|
|
|
<uni-easyinput :inputBorder="true" type="number" placeholder="请输入数字" |
|
|
|
v-model="jobContent.failedQty" @blur="failedQtyConfirm" class="count-input"> |
|
|
|
<view class="pda-list-cell-db"> |
|
|
|
<uni-easyinput :inputBorder="true" type="number" placeholder="请输入数字" v-model="jobContent.failedQty" |
|
|
|
@blur="failedQtyConfirm" class="count-input"> |
|
|
|
</uni-easyinput> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -62,18 +62,18 @@ |
|
|
|
<view class="pda-list-cell-left"> |
|
|
|
<view class="uni-label">报废数量</view> |
|
|
|
</view> |
|
|
|
<view class="pda-list-cell-db" > |
|
|
|
<view class="pda-list-cell-db"> |
|
|
|
<uni-easyinput placeholder="请输入数字" type="number" v-model="jobContent.crackQty" @blur="" |
|
|
|
class="count-input"> |
|
|
|
</uni-easyinput> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="pda-list-cell" > |
|
|
|
<view class="pda-list-cell"> |
|
|
|
<view class="pda-list-cell-left"> |
|
|
|
<view class="uni-label">下一步动作</view> |
|
|
|
</view> |
|
|
|
<view class="pda-list-cell-db" > |
|
|
|
<view class="pda-list-cell-db"> |
|
|
|
<uni-data-picker class='uni-data-picker' placeholder="请选择下一步动作" popup-title="下一步动作" |
|
|
|
@change="nextStepChange" :localdata="nextActionList" v-model="nextAction"> |
|
|
|
</uni-data-picker> |
|
|
@ -84,9 +84,9 @@ |
|
|
|
<view class="pda-list-cell-left"> |
|
|
|
<view class="uni-label">最终不合格</view> |
|
|
|
</view> |
|
|
|
<view class="pda-list-cell-db" > |
|
|
|
<uni-easyinput placeholder="待计算" type="number" :disabled="true" |
|
|
|
v-model="jobContent.notPassedQty" class="count-input"> |
|
|
|
<view class="pda-list-cell-db"> |
|
|
|
<uni-easyinput placeholder="待计算" type="number" :disabled="true" v-model="jobContent.notPassedQty" |
|
|
|
class="count-input"> |
|
|
|
</uni-easyinput> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -248,10 +248,10 @@ |
|
|
|
if (res.data.subList.length > 0) { |
|
|
|
that.jobContent = res.data; |
|
|
|
that.detailList = res.data.subList; |
|
|
|
that.inspectType =that.jobContent.inspectType; |
|
|
|
that.inspectType = that.jobContent.inspectType; |
|
|
|
that.jobContent.goodQty = null, //合格数量 |
|
|
|
that.jobContent.failedQty = null,//不合格数量 |
|
|
|
that.jobContent.crackQty = null,//报废数量 |
|
|
|
that.jobContent.failedQty = null, //不合格数量 |
|
|
|
that.jobContent.crackQty = null, //报废数量 |
|
|
|
that.jobContent.notPassedQty = null; //最终不合格数量 |
|
|
|
} else { |
|
|
|
that.showMessage('列表数据为0'); |
|
|
@ -291,27 +291,28 @@ |
|
|
|
return getUnitInfo(value).label |
|
|
|
}, |
|
|
|
|
|
|
|
nextStepChange(e){ |
|
|
|
nextStepChange(e) { |
|
|
|
this.nextAction = e.detail.value[0].value; |
|
|
|
this.calcNotPassQty(); |
|
|
|
}, |
|
|
|
|
|
|
|
calcNotPassQty(){ |
|
|
|
calcNotPassQty() { |
|
|
|
var failedQty = Number(this.jobContent.failedQty == null ? 0 : this.jobContent.failedQty) |
|
|
|
//检验类型:全检(全部合格) |
|
|
|
if (this.inspectType == 'FUll' ) { |
|
|
|
if (this.inspectType == 'FUll') { |
|
|
|
//最终不合格数量等于不合格数量 |
|
|
|
this.jobContent.notPassedQty = failedQty |
|
|
|
}else if(this.inspectType == 'SAMPLING'){ |
|
|
|
} else if (this.inspectType == 'SAMPLING') { |
|
|
|
//检验类型:抽检 |
|
|
|
//下一步动作 |
|
|
|
//全检、部分合格 |
|
|
|
if (this.nextAction == "FULL_INSPECT"||this.nextAction == "PARTIAL_OK") { |
|
|
|
if (this.nextAction == "FULL_INSPECT" || this.nextAction == "PARTIAL_OK") { |
|
|
|
// 最终不合格数量=不合格数量 |
|
|
|
this.jobContent.notPassedQty = failedQty |
|
|
|
}else if(this.nextAction=="ALL_NOK"){ |
|
|
|
} else if (this.nextAction == "ALL_NOK") { |
|
|
|
//最终不合格数量=收货数量-报废数量 |
|
|
|
this.jobContent.notPassedQty = Number(this.jobContent.receiveQty)-Number(this.jobContent.crackQty==null?0:this.jobContent.crackQty) |
|
|
|
this.jobContent.notPassedQty = Number(this.jobContent.receiveQty) - Number(this.jobContent |
|
|
|
.crackQty == null ? 0 : this.jobContent.crackQty) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -342,24 +343,38 @@ |
|
|
|
|
|
|
|
//不合格数量==0、(全部合格)、明细全部合格 |
|
|
|
if (failedQty == 0) { |
|
|
|
//直接提交 |
|
|
|
this.jobContent.subList.forEach(res=>{ |
|
|
|
if (crackQty == 0) { |
|
|
|
//报废数==0,直接提交 |
|
|
|
this.jobContent.subList.forEach(res => { |
|
|
|
res.handleQty = res.qty |
|
|
|
res.failedQty = 0; |
|
|
|
res.notPassedQty = 0; |
|
|
|
res.crackQty = 0; |
|
|
|
res.goodQty = this.jobContent.receiveQty; |
|
|
|
res.toInventoryStatus = res.inventoryStatus |
|
|
|
res.failedReason =""; |
|
|
|
res.goodQty = res.qty; |
|
|
|
res.failedReason = ""; |
|
|
|
res.photos = "" |
|
|
|
res.inspectResult ="" |
|
|
|
res.inspectUser =this.$store.state.user.id |
|
|
|
res.inspectResult = "" |
|
|
|
res.toInventoryStatus = "OK" |
|
|
|
res.inspectUser = this.$store.state.user.id |
|
|
|
}) |
|
|
|
|
|
|
|
this.jobContent.nextAction = this.nextAction; |
|
|
|
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) { |
|
|
@ -369,64 +384,74 @@ |
|
|
|
//全不合格 |
|
|
|
if (this.nextAction == "ALL_NOK") { |
|
|
|
//提交 |
|
|
|
this.jobContent.subList.forEach(res=>{ |
|
|
|
this.jobContent.subList.forEach(res => { |
|
|
|
res.handleQty = res.qty |
|
|
|
res.failedQty = this.jobContent.receiveQty; |
|
|
|
res.notPassedQty = this.jobContent.receiveQty; |
|
|
|
res.failedQty = res.qty; |
|
|
|
res.notPassedQty = res.qty; |
|
|
|
res.crackQty = 0; |
|
|
|
res.goodQty = 0; |
|
|
|
res.toInventoryStatus = "NOK" |
|
|
|
res.failedReason =""; |
|
|
|
res.failedReason = ""; |
|
|
|
res.photos = "" |
|
|
|
res.inspectResult ="" |
|
|
|
re.inspectUser =this.$store.state.user.id |
|
|
|
res.inspectResult = "" |
|
|
|
res.toInventoryStatus = "NOK" |
|
|
|
re.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+ |
|
|
|
'&status=' + this.status + |
|
|
|
'&failedQty=' + this.jobContent.failedQty + |
|
|
|
'&crackQty=' + this.jobContent.crackQty |
|
|
|
}); |
|
|
|
//全检===全部合格 |
|
|
|
//全检 生成全检任务 |
|
|
|
} else if (this.nextAction == "FULL_INSPECT") { |
|
|
|
//提交 |
|
|
|
this.jobContent.subList.forEach(res=>{ |
|
|
|
this.jobContent.subList.forEach(res => { |
|
|
|
res.handleQty = res.qty |
|
|
|
res.failedQty = 0; |
|
|
|
res.notPassedQty = 0; |
|
|
|
res.crackQty = 0; |
|
|
|
res.goodQty = this.jobContent.receiveQty; |
|
|
|
res.toInventoryStatus = res.inventoryStatus |
|
|
|
res.failedReason =""; |
|
|
|
res.goodQty = res.qty; |
|
|
|
res.failedReason = ""; |
|
|
|
res.photos = "" |
|
|
|
res.inspectResult ="" |
|
|
|
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) { |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
inspectJobSubmit(params).then(res=>{ |
|
|
|
inspectJobSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
this.showCommitSuccessMessage("提交成功<br>生成到货检验记录" + res.data, ) |
|
|
|
var hint=""; |
|
|
|
if(this.jobContent.nextAction=="FULL_INSPECT"){ |
|
|
|
hint ="提交成功<br>生成到货检验任务" + res.data |
|
|
|
}else { |
|
|
|
hint ="提交成功<br>生成到货检验记录" + res.data |
|
|
|
} |
|
|
|
this.showCommitSuccessMessage(hint) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败["+res.msg+"]") |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(error=>{ |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
@ -440,8 +465,7 @@ |
|
|
|
}, |
|
|
|
showErrorMessage(message) { |
|
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
|
if (res) { |
|
|
|
} |
|
|
|
if (res) {} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|