Browse Source

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

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

23
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() {

92
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;

Loading…
Cancel
Save