|
@ -99,8 +99,7 @@ |
|
|
this.getUnFildReason(); |
|
|
this.getUnFildReason(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
onLoad() { |
|
|
onLoad() {}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
created() { |
|
|
created() { |
|
|
|
|
|
|
|
@ -188,39 +187,34 @@ |
|
|
//保存 |
|
|
//保存 |
|
|
save() { |
|
|
save() { |
|
|
let files = this.$refs.uploadImage.getFiles(); |
|
|
let files = this.$refs.uploadImage.getFiles(); |
|
|
console.log("文件个数",files.length) |
|
|
if (this.dataContent.failedReason == ""||this.dataContent.failedReason == null) { |
|
|
if (files.length > 0) { |
|
|
if (this.dataContent.purchaseReceiptInspectStatus == 2 || this.dataContent |
|
|
// this.readImageBuffer(files); |
|
|
.purchaseReceiptInspectStatus == 3) { |
|
|
if (this.dataContent.failedReason || this.dataContent.failedReason.length > 0) { |
|
|
showConfirmMsg('是否要将零件的状态改为合格?', confirm => { |
|
|
showConfirmMsg('是否将【' + this.dataContent.recommendPackingCode + '】箱,标记为不合格?', confirm => { |
|
|
|
|
|
if (confirm) { |
|
|
if (confirm) { |
|
|
this.saveResultNotPass(files) |
|
|
this.saveResultPass(files); |
|
|
} else { |
|
|
|
|
|
this.$refs.uploadImage.clearFiles() |
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
this.showMessage('请选择不合格原因') |
|
|
this.$refs['receiptCheckPopup'].close(); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} else //零件保存为合格 |
|
|
|
|
|
|
|
|
} else //零件不合格提示 |
|
|
{ |
|
|
{ |
|
|
if (this.dataContent.purchaseReceiptInspectStatus == 2||this.dataContent.purchaseReceiptInspectStatus == 3) { |
|
|
showConfirmMsg('是否将【' + this.dataContent.recommendPackingCode + '】箱,标记为不合格?', confirm => { |
|
|
showConfirmMsg('是否要将零件的状态改为合格?', confirm => { |
|
|
|
|
|
if (confirm) { |
|
|
if (confirm) { |
|
|
this.saveResultPass(); |
|
|
this.saveResultNotPass(files) |
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
this.$refs['receiptCheckPopup'].close(); |
|
|
// this.$refs.uploadImage.clearFiles() |
|
|
} |
|
|
} |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//不合格 |
|
|
//不合格 |
|
|
saveResultNotPass(files) { |
|
|
saveResultNotPass(files) { |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: '扫描中...', |
|
|
title: '保存中...', |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}) |
|
|
// let imgFiles = this.getFileBlob(files); |
|
|
// let imgFiles = this.getFileBlob(files); |
|
@ -237,7 +231,7 @@ |
|
|
// console.log('param', param); |
|
|
// console.log('param', param); |
|
|
//保存目检 |
|
|
//保存目检 |
|
|
saveReceiptResult(this.dataContent.masterID, param).then(res => { |
|
|
saveReceiptResult(this.dataContent.masterID, param).then(res => { |
|
|
console.log("保存",res) |
|
|
console.log("保存", res) |
|
|
if (res != null) { |
|
|
if (res != null) { |
|
|
// console.log('param', param); |
|
|
// console.log('param', param); |
|
|
this.afterSave(); |
|
|
this.afterSave(); |
|
@ -251,24 +245,28 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//合格 |
|
|
//合格 |
|
|
saveResultPass() { |
|
|
saveResultPass(files) { |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: '保存中...', |
|
|
title: '保存中...', |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.getFileBlob(files, imgFiles => { |
|
|
let item = { |
|
|
let item = { |
|
|
id: this.dataContent.masterID, |
|
|
id: this.dataContent.masterID, |
|
|
detailId: this.dataContent.id, |
|
|
detailId: this.dataContent.id, |
|
|
failedReason: '', |
|
|
failedReason: this.dataContent.failedReason, |
|
|
massDefect: '', |
|
|
massDefect: this.dataContent.massDefect, |
|
|
purchaseReceiptInspectStatus: 2, |
|
|
purchaseReceiptInspectStatus: 2, |
|
|
fileList: [] |
|
|
filesList: imgFiles |
|
|
}; |
|
|
}; |
|
|
let param = JSON.stringify(item); |
|
|
let param = JSON.stringify(item); |
|
|
|
|
|
// console.log('param', param); |
|
|
//保存目检 |
|
|
//保存目检 |
|
|
saveReceiptResult(this.dataContent.masterID, param).then(res => { |
|
|
saveReceiptResult(this.dataContent.masterID, param).then(res => { |
|
|
|
|
|
console.log("保存", res) |
|
|
if (res != null) { |
|
|
if (res != null) { |
|
|
|
|
|
// console.log('param', param); |
|
|
this.afterSave(); |
|
|
this.afterSave(); |
|
|
} |
|
|
} |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
@ -276,6 +274,7 @@ |
|
|
this.showMessage(err.message) |
|
|
this.showMessage(err.message) |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
}) |
|
|
}) |
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
afterSave() { |
|
|
afterSave() { |
|
@ -285,6 +284,9 @@ |
|
|
|
|
|
|
|
|
getFileBlob(files, callBack) { |
|
|
getFileBlob(files, callBack) { |
|
|
let fileParam = []; |
|
|
let fileParam = []; |
|
|
|
|
|
if(files.length==0){ |
|
|
|
|
|
callBack(fileParam) |
|
|
|
|
|
} |
|
|
for (var i = 0; i < files.length; i++) { |
|
|
for (var i = 0; i < files.length; i++) { |
|
|
let r = files[i]; |
|
|
let r = files[i]; |
|
|
let filePath = r.path; |
|
|
let filePath = r.path; |
|
|