Browse Source

采购收货,不合格判断通过是否有不合格原因判断

dev_pda
李俊城 2 years ago
parent
commit
8c981e7a90
  1. 17
      fe/PDA/pages/inventory/scrap.vue
  2. 52
      fe/PDA/pages/task/receipt_check.vue

17
fe/PDA/pages/inventory/scrap.vue

@ -372,19 +372,16 @@
let params = JSON.stringify(item); let params = JSON.stringify(item);
console.log('params', params); console.log('params', params);
scrap(params)
.then(res => {
that.showCommitSuccess(); that.showCommitSuccess();
that.clearAll(); that.clearAll();
uni.hideLoading(); uni.hideLoading();
// scrap(params) })
// .then(res => { .catch(err => {
// that.showCommitSuccess(); that.showMessage(err.message);
// that.clearAll(); uni.hideLoading();
// uni.hideLoading(); });
// })
// .catch(err => {
// that.showMessage(err.message);
// uni.hideLoading();
// });
}, },
cancel() { cancel() {

52
fe/PDA/pages/task/receipt_check.vue

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

Loading…
Cancel
Save