mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
133 lines
6.8 KiB
Vue
133 lines
6.8 KiB
Vue
<template>
|
|
<div class="row m-b-10 parentContainer">
|
|
<div class="col">
|
|
<loading-component style="height: 200px; top: 0;" key="1" color="success" v-show="isLoading"></loading-component>
|
|
<div class="row align-items-center pointer p-b-5 b-b b-grey" v-show="!isLoading" @click="activate()">
|
|
<div class="col-auto p-r-0">
|
|
<div class="b-grey b-a fs-10 btn-rounded icon-thumbnail icon-25 m-r-0" :class="[{'bg-primary': active}, {'bg-transparent': !active}]">
|
|
<i class="fa fa-check text-white fs-12 fa-fw"></i>
|
|
</div>
|
|
</div>
|
|
<div class="col">
|
|
<div class="row m-b-10">
|
|
<div class="col-auto">
|
|
<div class="font-heading fs-10 muted all-caps">Date</div>
|
|
<div class="font-heading fs-10">
|
|
{{item.created_at}}
|
|
</div>
|
|
</div>
|
|
<div class="col-auto">
|
|
<div class="font-heading fs-10 muted all-caps">Supplier</div>
|
|
<div class="font-heading fs-10">
|
|
{{item.issuer_name}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-auto">
|
|
<div class="font-heading fs-10 muted all-caps">Currency Rate</div>
|
|
<div class="font-heading fs-10">
|
|
{{item.currency_rate}}
|
|
</div>
|
|
</div>
|
|
<div class="col-auto">
|
|
<div class="font-heading fs-10 muted all-caps">Currency Amount</div>
|
|
<div class="font-heading fs-10">
|
|
{{item.original_currency.short_code}} {{(Math.round((item.original_amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
|
|
</div>
|
|
</div>
|
|
<div class="col text-right">
|
|
<div class="font-heading fs-10 muted all-caps">Amount</div>
|
|
<div class="font-heading fs-14 text-success bold">
|
|
{{item.currency.short_code}} {{((Math.round(( item.amount + Number.EPSILON) * 100) / 100)).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-auto">
|
|
<div class="font-heading fs-10 muted all-caps">reference</div>
|
|
<document-file-viewer-component v-if="item.documents.currency_order" :file="item.documents.currency_order.files[0]">
|
|
<template slot="button">
|
|
<button class="btn btn-xs btn-default bg-master-lightest b-rad-none no-border">
|
|
<i class="fa fa-eye"></i>
|
|
</button>
|
|
</template>
|
|
</document-file-viewer-component>
|
|
</div>
|
|
<div class="col">
|
|
<div class="row">
|
|
<div class="col">
|
|
<div class="font-heading fs-10 muted all-caps">PO Completion</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-auto p-r-0" v-if="item.documents.purchase_order" >
|
|
<document-file-viewer-component :file="item.documents.purchase_order.files[0]">
|
|
<template slot="button">
|
|
<button class="btn btn-xs btn-default bg-master-lightest b-rad-none no-border">
|
|
<i class="fa fa-file-pdf-o"></i>
|
|
</button>
|
|
</template>
|
|
</document-file-viewer-component>
|
|
</div>
|
|
<div class="col">
|
|
<p class="font-heading fs-12 bold text-success pointer" @click="expand($event)"><span :class="[{'text-danger': item.complete_transactions.length !== item.transactions.length}]">{{item.complete_transactions.length}}</span>/{{item.transactions.length}}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row" v-if="expanded">
|
|
<div class="col">
|
|
<div class="row" v-for="transaction in item.transactions">
|
|
<div class="col">
|
|
<a :href="route('booking.details', transaction)" target="_blank">
|
|
<span :class="[{'text-success': item.complete_transactions.includes(transaction)}, {'text-danger': !item.complete_transactions.includes(transaction)}]">{{ transaction }}</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import componentHandler from '../../../general/mixins/componentHandler';
|
|
import staticFormHandler from '../../../general/mixins/staticFormHandler'
|
|
export default {
|
|
props: {
|
|
section:{
|
|
type: String,
|
|
required: true
|
|
},
|
|
payments:{
|
|
type: Array,
|
|
required: true
|
|
}
|
|
},
|
|
data(){
|
|
return {
|
|
expanded: false,
|
|
active: this.item ? this.payments.some(payment => payment.id === this.item.id) : false,
|
|
}
|
|
},
|
|
created(){
|
|
this.active = this.payments.some(payment => payment.id === this.item.id);
|
|
},
|
|
methods: {
|
|
activate(){
|
|
this.active = !this.active;
|
|
this.$emit('input', this.item)
|
|
},
|
|
expand(event){
|
|
this.expanded = !this.expanded;
|
|
event.stopPropagation();
|
|
}
|
|
|
|
},
|
|
mixins: [componentHandler, staticFormHandler]
|
|
}
|
|
</script>
|