Browse Source

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

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

23
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);
that.showCommitSuccess(); scrap(params)
that.clearAll(); .then(res => {
uni.hideLoading(); that.showCommitSuccess();
// scrap(params) that.clearAll();
// .then(res => { uni.hideLoading();
// that.showCommitSuccess(); })
// that.clearAll(); .catch(err => {
// uni.hideLoading(); that.showMessage(err.message);
// }) uni.hideLoading();
// .catch(err => { });
// that.showMessage(err.message);
// uni.hideLoading();
// });
}, },
cancel() { cancel() {

88
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('是否将【' + 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) {
showConfirmMsg('是否要将零件的状态改为合格?', confirm => { showConfirmMsg('是否要将零件的状态改为合格?', confirm => {
if (confirm) { if (confirm) {
this.saveResultPass(); this.saveResultPass(files);
} }
}) })
} else { } else {
this.$refs['receiptCheckPopup'].close(); this.$refs['receiptCheckPopup'].close();
} }
} else //
{
showConfirmMsg('是否将【' + this.dataContent.recommendPackingCode + '】箱,标记为不合格?', confirm => {
if (confirm) {
this.saveResultNotPass(files)
} else {
// 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,31 +245,36 @@
}, },
// //
saveResultPass() { saveResultPass(files) {
uni.showLoading({ uni.showLoading({
title: '保存中...', title: '保存中...',
mask: true mask: true
}) })
let item = { this.getFileBlob(files, imgFiles => {
id: this.dataContent.masterID, let item = {
detailId: this.dataContent.id, id: this.dataContent.masterID,
failedReason: '', detailId: this.dataContent.id,
massDefect: '', failedReason: this.dataContent.failedReason,
purchaseReceiptInspectStatus: 2, massDefect: this.dataContent.massDefect,
fileList: [] purchaseReceiptInspectStatus: 2,
}; filesList: imgFiles
let param = JSON.stringify(item); };
// let param = JSON.stringify(item);
saveReceiptResult(this.dataContent.masterID, param).then(res => { // console.log('param', param);
if (res != null) { //
this.afterSave(); saveReceiptResult(this.dataContent.masterID, param).then(res => {
} console.log("保存", res)
uni.hideLoading(); if (res != null) {
}).catch(err => { // console.log('param', param);
this.showMessage(err.message) this.afterSave();
uni.hideLoading(); }
}) uni.hideLoading();
}).catch(err => {
this.showMessage(err.message)
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