diff --git a/fe/PDA/pages/inventory/scrap.vue b/fe/PDA/pages/inventory/scrap.vue index 4068d347e..0f873eff9 100644 --- a/fe/PDA/pages/inventory/scrap.vue +++ b/fe/PDA/pages/inventory/scrap.vue @@ -372,19 +372,16 @@ let params = JSON.stringify(item); console.log('params', params); - that.showCommitSuccess(); - that.clearAll(); - uni.hideLoading(); - // scrap(params) - // .then(res => { - // that.showCommitSuccess(); - // that.clearAll(); - // uni.hideLoading(); - // }) - // .catch(err => { - // that.showMessage(err.message); - // uni.hideLoading(); - // }); + scrap(params) + .then(res => { + that.showCommitSuccess(); + that.clearAll(); + uni.hideLoading(); + }) + .catch(err => { + that.showMessage(err.message); + uni.hideLoading(); + }); }, cancel() { diff --git a/fe/PDA/pages/task/receipt_check.vue b/fe/PDA/pages/task/receipt_check.vue index 9c0cabc37..527af7ebd 100644 --- a/fe/PDA/pages/task/receipt_check.vue +++ b/fe/PDA/pages/task/receipt_check.vue @@ -99,8 +99,7 @@ this.getUnFildReason(); }, - onLoad() { - }, + onLoad() {}, created() { @@ -134,7 +133,7 @@ let fileKey = file.FileKey; let fileName = file.FileName; getFileByCode(fileKey).then(res => { - + let result = res; var byteString = atob(res.bytes) var arrayBuffer = new ArrayBuffer(byteString.length) // 创建缓冲数组 @@ -188,39 +187,34 @@ //保存 save() { let files = this.$refs.uploadImage.getFiles(); - console.log("文件个数",files.length) - if (files.length > 0) { - // this.readImageBuffer(files); - if (this.dataContent.failedReason || this.dataContent.failedReason.length > 0) { - showConfirmMsg('是否将【' + this.dataContent.recommendPackingCode + '】箱,标记为不合格?', confirm => { - if (confirm) { - this.saveResultNotPass(files) - } else { - this.$refs.uploadImage.clearFiles() - } - }); - } else { - this.showMessage('请选择不合格原因') - - } - } else //零件保存为合格 - { - if (this.dataContent.purchaseReceiptInspectStatus == 2||this.dataContent.purchaseReceiptInspectStatus == 3) { + if (this.dataContent.failedReason == ""||this.dataContent.failedReason == null) { + if (this.dataContent.purchaseReceiptInspectStatus == 2 || this.dataContent + .purchaseReceiptInspectStatus == 3) { showConfirmMsg('是否要将零件的状态改为合格?', confirm => { if (confirm) { - this.saveResultPass(); + this.saveResultPass(files); } }) } else { this.$refs['receiptCheckPopup'].close(); } + + } else //零件不合格提示 + { + showConfirmMsg('是否将【' + this.dataContent.recommendPackingCode + '】箱,标记为不合格?', confirm => { + if (confirm) { + this.saveResultNotPass(files) + } else { + // this.$refs.uploadImage.clearFiles() + } + }); } }, //不合格 saveResultNotPass(files) { uni.showLoading({ - title: '扫描中...', + title: '保存中...', mask: true }) // let imgFiles = this.getFileBlob(files); @@ -237,7 +231,7 @@ // console.log('param', param); //保存目检 saveReceiptResult(this.dataContent.masterID, param).then(res => { - console.log("保存",res) + console.log("保存", res) if (res != null) { // console.log('param', param); this.afterSave(); @@ -251,31 +245,36 @@ }, //合格 - saveResultPass() { + saveResultPass(files) { uni.showLoading({ title: '保存中...', mask: true }) - - let item = { - id: this.dataContent.masterID, - detailId: this.dataContent.id, - failedReason: '', - massDefect: '', - purchaseReceiptInspectStatus: 2, - fileList: [] - }; - let param = JSON.stringify(item); - //保存目检 - saveReceiptResult(this.dataContent.masterID, param).then(res => { - if (res != null) { - this.afterSave(); - } - uni.hideLoading(); - }).catch(err => { - this.showMessage(err.message) - uni.hideLoading(); - }) + + this.getFileBlob(files, imgFiles => { + let item = { + id: this.dataContent.masterID, + detailId: this.dataContent.id, + failedReason: this.dataContent.failedReason, + massDefect: this.dataContent.massDefect, + purchaseReceiptInspectStatus: 2, + filesList: imgFiles + }; + let param = JSON.stringify(item); + // console.log('param', param); + //保存目检 + saveReceiptResult(this.dataContent.masterID, param).then(res => { + console.log("保存", res) + if (res != null) { + // console.log('param', param); + this.afterSave(); + } + uni.hideLoading(); + }).catch(err => { + this.showMessage(err.message) + uni.hideLoading(); + }) + }); }, afterSave() { @@ -285,6 +284,9 @@ getFileBlob(files, callBack) { let fileParam = []; + if(files.length==0){ + callBack(fileParam) + } for (var i = 0; i < files.length; i++) { let r = files[i]; let filePath = r.path;