Dung Diego

up

...@@ -51,6 +51,32 @@ ...@@ -51,6 +51,32 @@
51 <button class="btn btn-primary" @click="$refs.pdf.click()"><i class="fas fa-upload"></i>Upload</button> 51 <button class="btn btn-primary" @click="$refs.pdf.click()"><i class="fas fa-upload"></i>Upload</button>
52 <input type="file" ref="pdf" accept=".pdf" style="display:none" @change="upload_pdf"> 52 <input type="file" ref="pdf" accept=".pdf" style="display:none" @change="upload_pdf">
53 </div></div> 53 </div></div>
54 + <div class="row mt-3">
55 + <div class="col" v-for="(value, key) in order">
56 + <span>{{ key }} {{ value }}</span>
57 + </div>
58 + </div>
59 + <div class="row mt-3">
60 + <div class="col">
61 + <table>
62 + <thead>
63 + <tr>
64 + <th v-for="(value, key) in items[0]" :key="key">
65 + {{ key }}
66 + </th>
67 + </tr>
68 + </thead>
69 +
70 + <tbody>
71 + <tr v-for="(item, index) in items" :key="index">
72 + <td v-for="(value, key) in items[0]" :key="key">
73 + {{ item[key] }}
74 + </td>
75 + </tr>
76 + </tbody>
77 + </table>
78 + </div>
79 + </div>
54 </div> 80 </div>
55 </div> 81 </div>
56 </section> 82 </section>
...@@ -63,7 +89,8 @@ ...@@ -63,7 +89,8 @@
63 data:{ 89 data:{
64 isLoading:false, 90 isLoading:false,
65 ocr : {!! json_encode($ocr) !!}, 91 ocr : {!! json_encode($ocr) !!},
66 - ocr_window : null 92 + ocr_window : null,
93 + order:{},table:[]
67 }, 94 },
68 mounted() { 95 mounted() {
69 }, 96 },
...@@ -141,7 +168,7 @@ function appendFormData(form, obj, parentKey = "") { ...@@ -141,7 +168,7 @@ function appendFormData(form, obj, parentKey = "") {
141 this.handle_map_field(e.data.template_field,e.data.text) 168 this.handle_map_field(e.data.template_field,e.data.text)
142 } 169 }
143 if(e.data.type === 'mapping-customer'){ 170 if(e.data.type === 'mapping-customer'){
144 - this.handle_map_customer(e.data.customer) 171 + this.handle_map_template(e.data.template)
145 } 172 }
146 }); 173 });
147 174
...@@ -151,6 +178,12 @@ function appendFormData(form, obj, parentKey = "") { ...@@ -151,6 +178,12 @@ function appendFormData(form, obj, parentKey = "") {
151 } 178 }
152 }); 179 });
153 }, 180 },
181 + handle_map_field(template_field,text){
182 +
183 + },
184 + handle_map_template(template){
185 +
186 + },
154 } 187 }
155 }) 188 })
156 </script> 189 </script>
......
...@@ -375,7 +375,7 @@ ...@@ -375,7 +375,7 @@
375 width: x2 - x1, 375 width: x2 - x1,
376 height: y2 - y1 376 height: y2 - y1
377 } 377 }
378 - window.opener.postMessage({type: 'mapping-customer',customer:ocr_field.text}, '*'); 378 + window.opener.postMessage({type: 'mapping-template',template:ocr_field}, '*');
379 }, 379 },
380 async ocr_map_field(mst_field,ocr_field,coordinate=undefined){ 380 async ocr_map_field(mst_field,ocr_field,coordinate=undefined){
381 if(!!this.disable) return 381 if(!!this.disable) return
......