Browse Source

修改到货检验

wms3.0_pda
lijuncheng 12 months ago
parent
commit
5abb3f0562
  1. 52
      pages/inspect/job/inspectDetail.vue
  2. 120
      pages/inspect/job/inspectResult.vue

52
pages/inspect/job/inspectDetail.vue

@ -105,6 +105,7 @@
// } // }
this.getDetail(); this.getDetail();
} }
}, },
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
@ -113,24 +114,24 @@
} }
}, },
onBackPress(e) { // onBackPress(e) {
// // //
if (e.from == 'backbutton') { // if (e.from == 'backbutton') {
if (this.received) { // if (this.received) {
// // //
cancleTakeInspectJob(this.id).then(res => { // cancleTakeInspectJob(this.id).then(res => {
uni.navigateBack(); // uni.navigateBack();
}).catch(error => { // }).catch(error => {
uni.navigateBack(); // uni.navigateBack();
}) // })
} else { // } else {
uni.navigateBack(); // uni.navigateBack();
} // }
return true; // return true;
} // }
}, // },
onPullDownRefresh() { onPullDownRefresh() {
this.getDetail(); this.getDetail();
@ -174,7 +175,7 @@
that.jobContent = res.data; that.jobContent = res.data;
that.subList = res.data.subList; that.subList = res.data.subList;
that.subList.forEach(res => { that.subList.forEach(res => {
res.batch =that.jobContent.batch res.batch = that.jobContent.batch
res.goodQty = 0; res.goodQty = 0;
res.failedQty = 0; res.failedQty = 0;
res.crackQty = 0; res.crackQty = 0;
@ -265,8 +266,8 @@
} else { } else {
var itemDetail = detail.subList.find(r => { var itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber return r.packingNumber == packingNumber
// && &&
// r.batch == batch r.batch == batch
}) })
if (itemDetail == undefined) { if (itemDetail == undefined) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中") this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中")
@ -281,7 +282,7 @@
']不一致,是否继续上架?', res => { ']不一致,是否继续上架?', res => {
if (res) { if (res) {
itemDetail.scaned = true; itemDetail.scaned = true;
// itemDetail.handleQty = Number(result.label.qty); itemDetail.handleQty = Number(result.label.qty)>Number(result.balance.qty)?Number(result.balance.qty):Number(result.label.qty);
this.calcHandleQty(); this.calcHandleQty();
} else { } else {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
@ -289,7 +290,7 @@
}); });
} else { } else {
itemDetail.scaned = true; itemDetail.scaned = true;
// itemDetail.handleQty = Number(result.label.qty); itemDetail.handleQty = Number(result.label.qty)>Number(result.balance.qty)?Number(result.balance.qty):Number(result.label.qty);
this.calcHandleQty(); this.calcHandleQty();
} }
} }
@ -302,6 +303,11 @@
}, },
commit() { commit() {
this.scanCount = getScanCount(this.subList);
if( this.scanCount==0){
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
// //
if (this.scanCount == this.subList.length) { if (this.scanCount == this.subList.length) {
this.submitJob(); this.submitJob();
@ -330,7 +336,7 @@
}); });
var params = this.setParams(); var params = this.setParams();
console.log("提交参数", params) console.log("提交参数", JSON.stringify(params));
inspectJobSubmit(params).then(res => { inspectJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
@ -410,7 +416,6 @@
detail.crackQty = detail.crackQty; detail.crackQty = detail.crackQty;
detail.notPassedQty = detail.notPassedQty; detail.notPassedQty = detail.notPassedQty;
detail.goodQty = detail.qty - detail.failedQty - detail.crackQty; detail.goodQty = detail.qty - detail.failedQty - detail.crackQty;
detail.fromInventoryStatus = detail.inventoryStatus;
detail.inspectUser = this.$store.state.user.id detail.inspectUser = this.$store.state.user.id
//== //==
@ -430,6 +435,7 @@
}) })
}) })
this.jobContent.subList = list this.jobContent.subList = list
return this.jobContent;
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {

120
pages/inspect/job/inspectResult.vue

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

Loading…
Cancel
Save