Dung Diego

up

......@@ -51,6 +51,32 @@
<button class="btn btn-primary" @click="$refs.pdf.click()"><i class="fas fa-upload"></i>Upload</button>
<input type="file" ref="pdf" accept=".pdf" style="display:none" @change="upload_pdf">
</div></div>
<div class="row mt-3">
<div class="col" v-for="(value, key) in order">
<span>{{ key }} {{ value }}</span>
</div>
</div>
<div class="row mt-3">
<div class="col">
<table>
<thead>
<tr>
<th v-for="(value, key) in items[0]" :key="key">
{{ key }}
</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in items" :key="index">
<td v-for="(value, key) in items[0]" :key="key">
{{ item[key] }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
......@@ -63,7 +89,8 @@
data:{
isLoading:false,
ocr : {!! json_encode($ocr) !!},
ocr_window : null
ocr_window : null,
order:{},table:[]
},
mounted() {
},
......@@ -141,7 +168,7 @@ function appendFormData(form, obj, parentKey = "") {
this.handle_map_field(e.data.template_field,e.data.text)
}
if(e.data.type === 'mapping-customer'){
this.handle_map_customer(e.data.customer)
this.handle_map_template(e.data.template)
}
});
......@@ -151,6 +178,12 @@ function appendFormData(form, obj, parentKey = "") {
}
});
},
handle_map_field(template_field,text){
},
handle_map_template(template){
},
}
})
</script>
......
......@@ -375,7 +375,7 @@
width: x2 - x1,
height: y2 - y1
}
window.opener.postMessage({type: 'mapping-customer',customer:ocr_field.text}, '*');
window.opener.postMessage({type: 'mapping-template',template:ocr_field}, '*');
},
async ocr_map_field(mst_field,ocr_field,coordinate=undefined){
if(!!this.disable) return
......