Browse Source

修改到货检验

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

120
pages/inspect/job/inspectResult.vue

@ -110,7 +110,7 @@
<scroll-view scroll-y="true" class="scroll-detail">
<view class=""
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>
<view class="">
@ -134,17 +134,21 @@
<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>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getInspectJobDetail,
takeInspectJob,
cancleTakeInspectJob,
inspectJobSubmit
} from '@/api/request2.js';
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getInspectFailedReasonList,
getNextActionList,
@ -170,7 +174,7 @@
locations: [],
value: ['0'],
jobContent: {}, //
subList: [], //details
detailList: [], //details
detailSource: [], //
nextActionList: [],
nextAction: null,
@ -184,19 +188,51 @@
if (this.id != undefined) {
// //
// if (option.status == "JOB_PENDING") {
// this.receive((callback => {
// this.received = true;
// this.getDetail();
// }));
// } else {
// this.getDetail();
// }
if (option.status == "1") {
this.receive((callback => {
this.received = true;
this.getDetail();
}));
} else {
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() {
var that = this;
uni.showLoading({
@ -211,7 +247,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.subList = res.data.subList;
that.detailList = res.data.subList;
that.inspectType =that.jobContent.inspectType;
that.jobContent.goodQty = null, //
that.jobContent.failedQty = null,//
@ -280,7 +316,9 @@
}
}
},
submit() {
commit() {
if (this.jobContent.failedQty == null) {
this.showMessage("请输入不合格数量")
@ -306,18 +344,19 @@
if (failedQty == 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.fromInventory_status = res.inventoryStatus
res.toInventoryStatus = res.inventoryStatus
res.failedReason ="";
res.photos = ""
res.inspectResult =""
res.inspectUser =this.$store.state.user.id
})
var tttt = JSON.stringify(this.jobContent);
console.log("提交参数", tttt)
this.submitJob(this.jobContent)
} else {
//>0
//
@ -329,18 +368,18 @@
if (this.nextAction == "ALL_NOK") {
//
this.jobContent.subList.forEach(res=>{
res.handleQty = res.qty
res.failedQty = this.jobContent.receiveQty;
res.notPassedQty = this.jobContent.receiveQty;
res.crackQty = 0;
res.goodQty = 0;
res.from_inventory_status = res.inventoryStatus
res.toInventoryStatus = "NOK"
res.failedReason ="";
res.photos = ""
res.inspectResult =""
re.inspectUser =this.$store.state.user.id
})
var tttt = JSON.stringify(this.jobContent);
console.log("提交参数", tttt)
this.submitJob(this.jobContent)
//
} else if (this.nextAction == "PARTIAL_OK") {
//
@ -351,24 +390,49 @@
} else if (this.nextAction == "FULL_INSPECT") {
//
this.jobContent.subList.forEach(res=>{
res.failedQty =0;
res.handleQty = res.qty
res.failedQty = 0;
res.notPassedQty = 0;
res.crackQty = 0;
res.goodQty =this.jobContent.receiveQty;
res.fromInventory_status = res.inventoryStatus
res.goodQty = this.jobContent.receiveQty;
res.toInventoryStatus = res.inventoryStatus
res.failedReason ="";
res.photos = ""
res.inspectResult =""
res.inspectUser =this.$store.state.user.id
})
var tttt = JSON.stringify(this.jobContent);
console.log("提交参数", tttt)
this.submitJob(this.jobContent)
}
}
},
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>

Loading…
Cancel
Save