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> </div>
<el-row :gutter="12" type="flex"> <el-row :gutter="12" type="flex">
<el-col :span="12" align="center"> <el-col :span="12" align="center">
<a target="_blank" :href="getURL(booking_details.user_po_path)"> <div v-for="po in booking_details.user_po_path" :key='po'>
<img v-if="isImage(booking_details.user_po_path)" v-bind:src="booking_details.user_po_path" class="image"> <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> <p v-else>Download</p>
<br/>
</a> </a>
</div>
</el-col> </el-col>
</el-row> </el-row>
</el-card> </el-card>
@@ -431,7 +434,8 @@
}, },
// TODO : refactor into library since many pages are using this // TODO : refactor into library since many pages are using this
getExtension(path){ getExtension(path){
return path.slice(-3); let index = path.lastIndexOf('.') + 1;
return path.slice(index);
}, },
isImage(path){ isImage(path){
var ext = this.getExtension(path); var ext = this.getExtension(path);