multiple po and invoice fix

This commit is contained in:
Omair Saleh
2019-05-03 12:17:53 +08:00
parent 1b0648c1af
commit 7270f79dd7
@@ -58,10 +58,13 @@
</div>
<el-row :gutter="12" type="flex">
<el-col :span="12" align="center">
<a target="_blank" :href="getURL(booking_details.user_po_path)">
<img v-if="isImage(booking_details.user_po_path)" v-bind:src="booking_details.user_po_path" class="image">
<p v-else>Download</p>
</a>
<div v-for="po in booking_details.user_po_path" :key='po'>
<a target="_blank" :href="getURL(po)">
<img v-if="isImage(po)" v-bind:src="po" class="image" style="max-width: 100%">
<p v-else>Download</p>
<br/>
</a>
</div>
</el-col>
</el-row>
</el-card>
@@ -431,11 +434,12 @@
},
// TODO : refactor into library since many pages are using this
getExtension(path){
return path.slice(-3);
let index = path.lastIndexOf('.') + 1;
return path.slice(index);
},
isImage(path){
var ext = this.getExtension(path);
return ext === 'jpg' || ext === 'jpeg' || ext === 'bmp' || ext === 'png';
var ext = this.getExtension(path);
return ext === 'jpg' || ext === 'jpeg' || ext === 'bmp' || ext === 'png';
},
getURL(path){
var getUrl = window.location;