|
@ -110,7 +110,7 @@ |
|
|
<scroll-view scroll-y="true" class="scroll-detail"> |
|
|
<scroll-view scroll-y="true" class="scroll-detail"> |
|
|
<view class="" |
|
|
<view class="" |
|
|
style="font-size: 35rpx;display: flex;flex-direction: row;align-items: center;width: 100%;" |
|
|
style="font-size: 35rpx;display: flex;flex-direction: row;align-items: center;width: 100%;" |
|
|
v-for="(item, index) in subList" :key="item.id"> |
|
|
v-for="(item, index) in detailList" :key="item.id"> |
|
|
<text style="font-size: 35rpx;margin-right: 20rpx;">{{index+1}}.</text> |
|
|
<text style="font-size: 35rpx;margin-right: 20rpx;">{{index+1}}.</text> |
|
|
|
|
|
|
|
|
<view class=""> |
|
|
<view class=""> |
|
@ -134,17 +134,21 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="bottom" style="padding-bottom: 20rpx;"> |
|
|
<view class="bottom" style="padding-bottom: 20rpx;"> |
|
|
<button :disabled="submitting" type="primary" class="save-button" @click="submit">提交</button> |
|
|
<button :disabled="submitting" type="primary" class="save-button" @click="commit">提交</button> |
|
|
</view> |
|
|
</view> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
|
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
import { |
|
|
import { |
|
|
getInspectJobDetail, |
|
|
getInspectJobDetail, |
|
|
|
|
|
takeInspectJob, |
|
|
|
|
|
cancleTakeInspectJob, |
|
|
|
|
|
inspectJobSubmit |
|
|
} from '@/api/request2.js'; |
|
|
} from '@/api/request2.js'; |
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
|
|
|
import { |
|
|
import { |
|
|
getInspectFailedReasonList, |
|
|
getInspectFailedReasonList, |
|
|
getNextActionList, |
|
|
getNextActionList, |
|
@ -170,7 +174,7 @@ |
|
|
locations: [], |
|
|
locations: [], |
|
|
value: ['0'], |
|
|
value: ['0'], |
|
|
jobContent: {}, //任务内容 |
|
|
jobContent: {}, //任务内容 |
|
|
subList: [], //接口返回的任务details |
|
|
detailList: [], //接口返回的任务details |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
nextActionList: [], |
|
|
nextActionList: [], |
|
|
nextAction: null, |
|
|
nextAction: null, |
|
@ -184,19 +188,51 @@ |
|
|
|
|
|
|
|
|
if (this.id != undefined) { |
|
|
if (this.id != undefined) { |
|
|
// //新建的任务自动接收 |
|
|
// //新建的任务自动接收 |
|
|
// if (option.status == "JOB_PENDING") { |
|
|
if (option.status == "1") { |
|
|
// this.receive((callback => { |
|
|
this.receive((callback => { |
|
|
// this.received = true; |
|
|
this.received = true; |
|
|
// this.getDetail(); |
|
|
this.getDetail(); |
|
|
// })); |
|
|
})); |
|
|
// } else { |
|
|
} else { |
|
|
// this.getDetail(); |
|
|
|
|
|
// } |
|
|
|
|
|
this.getDetail(); |
|
|
this.getDetail(); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
onBackPress(e) { |
|
|
|
|
|
//已经接收但是没提交任务 |
|
|
|
|
|
if (e.from == 'backbutton') { |
|
|
|
|
|
if (this.received) { |
|
|
|
|
|
//取消承接任务 |
|
|
|
|
|
cancleTakeInspectJob(this.id).then(res => { |
|
|
|
|
|
uni.navigateBack(); |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
uni.navigateBack(); |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
uni.navigateBack(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
methods: { |
|
|
|
|
|
//接收 |
|
|
|
|
|
receive(callback) { |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: "加载中....", |
|
|
|
|
|
mask: true |
|
|
|
|
|
}); |
|
|
|
|
|
if (this.id != null) { |
|
|
|
|
|
takeInspectJob(this.id).then(res => { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
callback(); |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
this.showErrorMessage(error) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
getDetail() { |
|
|
getDetail() { |
|
|
var that = this; |
|
|
var that = this; |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
@ -211,7 +247,7 @@ |
|
|
} else { |
|
|
} else { |
|
|
if (res.data.subList.length > 0) { |
|
|
if (res.data.subList.length > 0) { |
|
|
that.jobContent = res.data; |
|
|
that.jobContent = res.data; |
|
|
that.subList = res.data.subList; |
|
|
that.detailList = res.data.subList; |
|
|
that.inspectType =that.jobContent.inspectType; |
|
|
that.inspectType =that.jobContent.inspectType; |
|
|
that.jobContent.goodQty = null, //合格数量 |
|
|
that.jobContent.goodQty = null, //合格数量 |
|
|
that.jobContent.failedQty = null,//不合格数量 |
|
|
that.jobContent.failedQty = null,//不合格数量 |
|
@ -280,7 +316,9 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
submit() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
commit() { |
|
|
|
|
|
|
|
|
if (this.jobContent.failedQty == null) { |
|
|
if (this.jobContent.failedQty == null) { |
|
|
this.showMessage("请输入不合格数量") |
|
|
this.showMessage("请输入不合格数量") |
|
@ -306,18 +344,19 @@ |
|
|
if (failedQty == 0) { |
|
|
if (failedQty == 0) { |
|
|
//直接提交 |
|
|
//直接提交 |
|
|
this.jobContent.subList.forEach(res=>{ |
|
|
this.jobContent.subList.forEach(res=>{ |
|
|
|
|
|
res.handleQty = res.qty |
|
|
res.failedQty = 0; |
|
|
res.failedQty = 0; |
|
|
res.notPassedQty = 0; |
|
|
res.notPassedQty = 0; |
|
|
res.crackQty = 0; |
|
|
res.crackQty = 0; |
|
|
res.goodQty = this.jobContent.receiveQty; |
|
|
res.goodQty = this.jobContent.receiveQty; |
|
|
res.fromInventory_status = res.inventoryStatus |
|
|
|
|
|
res.toInventoryStatus = res.inventoryStatus |
|
|
res.toInventoryStatus = res.inventoryStatus |
|
|
res.failedReason =""; |
|
|
res.failedReason =""; |
|
|
res.photos = "" |
|
|
res.photos = "" |
|
|
res.inspectResult ="" |
|
|
res.inspectResult ="" |
|
|
|
|
|
res.inspectUser =this.$store.state.user.id |
|
|
}) |
|
|
}) |
|
|
var tttt = JSON.stringify(this.jobContent); |
|
|
this.submitJob(this.jobContent) |
|
|
console.log("提交参数", tttt) |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
//不合格数量>0 |
|
|
//不合格数量>0 |
|
|
//下一步动作 |
|
|
//下一步动作 |
|
@ -329,18 +368,18 @@ |
|
|
if (this.nextAction == "ALL_NOK") { |
|
|
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.failedQty = this.jobContent.receiveQty; |
|
|
res.notPassedQty = this.jobContent.receiveQty; |
|
|
res.notPassedQty = this.jobContent.receiveQty; |
|
|
res.crackQty = 0; |
|
|
res.crackQty = 0; |
|
|
res.goodQty = 0; |
|
|
res.goodQty = 0; |
|
|
res.from_inventory_status = res.inventoryStatus |
|
|
|
|
|
res.toInventoryStatus = "NOK" |
|
|
res.toInventoryStatus = "NOK" |
|
|
res.failedReason =""; |
|
|
res.failedReason =""; |
|
|
res.photos = "" |
|
|
res.photos = "" |
|
|
res.inspectResult ="" |
|
|
res.inspectResult ="" |
|
|
|
|
|
re.inspectUser =this.$store.state.user.id |
|
|
}) |
|
|
}) |
|
|
var tttt = JSON.stringify(this.jobContent); |
|
|
this.submitJob(this.jobContent) |
|
|
console.log("提交参数", tttt) |
|
|
|
|
|
//部分合格 |
|
|
//部分合格 |
|
|
} else if (this.nextAction == "PARTIAL_OK") { |
|
|
} else if (this.nextAction == "PARTIAL_OK") { |
|
|
//进入下一页面 |
|
|
//进入下一页面 |
|
@ -351,24 +390,49 @@ |
|
|
} else if (this.nextAction == "FULL_INSPECT") { |
|
|
} else if (this.nextAction == "FULL_INSPECT") { |
|
|
//提交 |
|
|
//提交 |
|
|
this.jobContent.subList.forEach(res=>{ |
|
|
this.jobContent.subList.forEach(res=>{ |
|
|
res.failedQty =0; |
|
|
res.handleQty = res.qty |
|
|
|
|
|
res.failedQty = 0; |
|
|
res.notPassedQty = 0; |
|
|
res.notPassedQty = 0; |
|
|
res.crackQty = 0; |
|
|
res.crackQty = 0; |
|
|
res.goodQty =this.jobContent.receiveQty; |
|
|
res.goodQty = this.jobContent.receiveQty; |
|
|
res.fromInventory_status = res.inventoryStatus |
|
|
|
|
|
res.toInventoryStatus = res.inventoryStatus |
|
|
res.toInventoryStatus = res.inventoryStatus |
|
|
res.failedReason =""; |
|
|
res.failedReason =""; |
|
|
res.photos = "" |
|
|
res.photos = "" |
|
|
res.inspectResult ="" |
|
|
res.inspectResult ="" |
|
|
|
|
|
res.inspectUser =this.$store.state.user.id |
|
|
}) |
|
|
}) |
|
|
var tttt = JSON.stringify(this.jobContent); |
|
|
this.submitJob(this.jobContent) |
|
|
console.log("提交参数", tttt) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
submitJob(params){ |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: "提交中....", |
|
|
|
|
|
mask: true |
|
|
|
|
|
}); |
|
|
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
|
|
inspectJobSubmit(params).then(res=>{ |
|
|
|
|
|
if (res.data) { |
|
|
|
|
|
this.showCommitSuccessMessage("提交成功<br>生成到货检验记录" + res.data, ) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showErrorMessage("提交失败"+res.msg) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}).catch(error=>{ |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
this.showErrorMessage(error) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
url: './inspectJob' |
|
|
|
|
|
}) |
|
|
|
|
|
}, 3000) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|