ocr识别正则提取

This commit is contained in:
砂糖
2025-08-04 11:15:42 +08:00
parent 831695e236
commit b8a0792b5d
4 changed files with 218 additions and 57 deletions

View File

@@ -12,9 +12,19 @@
</el-table>
</el-col>
<el-col :span="12">
<el-table :data="newResult" style="width: 100%">
<el-table-column prop="attrKey" label="属性名称" />
<el-table-column prop="attrValue" label="属性值" />
<!-- 默认全部选中 -->
<el-table :data="newResult" style="width: 100%" @selection-change="handleSelectionChange" :default-sort="{ prop: 'attrKey', order: 'ascending' }">
<el-table-column type="selection" width="55" />
<el-table-column prop="attrKey" label="属性名称">
<template slot-scope="scope">
<el-input v-model="scope.row.attrKey" />
</template>
</el-table-column>
<el-table-column prop="attrValue" label="属性值">
<template slot-scope="scope">
<el-input v-model="scope.row.attrValue" />
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
@@ -69,10 +79,14 @@ export default {
],
uploadQualityCertificateForm: {
qualityCertificateType: 1
}
},
selection: []
}
},
methods: {
handleSelectionChange(selection) {
this.selection = selection;
},
async handleConfirm() {
if (!this.uploadQualityCertificateForm.qualityCertificateType) {
this.$modal.msgError('请选择处理方式');
@@ -97,12 +111,12 @@ export default {
rawMaterialId: this.info.rawMaterialId,
bomId: bom.data.bomId,
})
// 逐项创建BOMItem
for (let i = 0; i < this.newResult.length; i++) {
// 逐项创建BOMItem, 只创建选中的
for (let i = 0; i < this.selection.length; i++) {
await addBomItem({
bomId: bom.data.bomId,
attrKey: this.newResult[i].attrKey,
attrValue: this.newResult[i].attrValue,
attrKey: this.selection[i].attrKey,
attrValue: this.selection[i].attrValue,
})
}
this.$store.dispatch('category/getBomMap');
@@ -115,11 +129,11 @@ export default {
bomCode: 'N' + new Date().getTime(),
})
// 逐项创建BOMItem
for (let i = 0; i < this.newResult.length; i++) {
for (let i = 0; i < this.selection.length; i++) {
await addBomItem({
bomId: bom.data.bomId,
attrKey: this.newResult[i].attrKey,
attrValue: this.newResult[i].attrValue,
attrKey: this.selection[i].attrKey,
attrValue: this.selection[i].attrValue,
})
}
// 创建一个新的物料,使用原有物料的信息, code使用时间戳