采购单附件上传
This commit is contained in:
@@ -118,6 +118,25 @@ const so = {
|
||||
vm.oldResult = bomItemRes.rows;
|
||||
return bomItemRes.rows;
|
||||
}
|
||||
},
|
||||
compare: {
|
||||
loading: '正在比较新旧质保单',
|
||||
handler: async (vm) => {
|
||||
// 先检查新旧result是否一致
|
||||
if (vm.oldResult.length !== vm.newResult.length) {
|
||||
vm.resultDiff = true;
|
||||
return;
|
||||
}
|
||||
// 比较新旧result是否一致
|
||||
for (let i = 0; i < vm.oldResult.length; i++) {
|
||||
if (vm.oldResult[i].attrKey !== vm.newResult[i].attrKey || vm.oldResult[i].attrValue !== vm.newResult[i].attrValue) {
|
||||
vm.resultDiff = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
vm.resultDiff = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,18 +199,16 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleOcr() {
|
||||
this.loadingMethod('ocr', (res) => {
|
||||
this.loadingMethod('old').then(() => {
|
||||
this.handleCompareResult()
|
||||
this.active = 2;
|
||||
})
|
||||
this.loadingMethod('ocr', async (res) => {
|
||||
await this.loadingMethod('old')
|
||||
await this.loadingMethod('compare')
|
||||
this.active = 2;
|
||||
})
|
||||
},
|
||||
handleModel() {
|
||||
this.loadingMethod('model', async (res) => {
|
||||
await this.loadingMethod('old')
|
||||
console.log(this);
|
||||
this.handleCompareResult()
|
||||
await this.loadingMethod('compare')
|
||||
this.active = 2;
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user