Skip to content

Commit

Permalink
{+} Patch button page facture -close #4 {+}
Browse files Browse the repository at this point in the history
  • Loading branch information
Poloriba committed Apr 19, 2021
1 parent 7a9ffa1 commit e04452f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 37 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"alter": "^0.2.0",
"axios": "latest",
"bootstrap": "latest",
"bootstrap-icons": "latest",
"bootstrap-vue": "latest",
"core-js": "latest",
"eslint-plugin-graphql": "^4.0.0",
"jquery": "latest",
"js-yaml": "latest",
"popper.js": "latest",
Expand All @@ -34,10 +34,10 @@
"@vue/cli-plugin-vuex": "latest",
"@vue/cli-service": "latest",
"babel-eslint": "latest",
"eslint": "latest",
"eslint": "^4.19.1",
"eslint-plugin-vue": "latest",
"graphql-tag": "latest",
"vue-cli-plugin-apollo": "latest",
"vue-template-compiler": "latest"
}
}
}
10 changes: 2 additions & 8 deletions src/views/detailsFacture.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,21 @@
<b-row class="align-items-start" v-if="facture && facture.media">
<b-col cols="12" lg="4">
<b-row class="text-left">
<div class="p-5" style="transform: scale(1.2);">
<div class="p-5" style="transform: scale(1.2); align-self: center; mmargin: auto;">
<h4 class="text-center">Infos</h4>
<table class="table table-sm table-hover" style="transform: scale(1.1);">
<tbody>
<tr><th>Ref</th><td>{{ facture.ref }}</td></tr>
<tr><th>Nom</th><td>{{ facture.nom }}</td></tr>
<tr><th>Date</th><td>{{ facture.date }}</td></tr>
<tr><th>Entreprise</th><td>{{ facture.entreprise }}</td></tr>
<tr><th>Télécharger</th><td><b-icon @click="downloadPDF(getPdfLink(facture.media[0].url))" icon="file-earmark-arrow-down-fill" style="transform: scale(1.5); cursor: pointer; margin-left: 20%; margin-top: 10%;"></b-icon></td></tr>
</tbody>
</table>
</div>
</b-row>
<b-icon @click="$refs.factureRef.print()" icon="printer-fill" style="transform: scale(2); cursor: pointer; margin-left: 20%;"></b-icon>
<b-icon @click="downloadPDF(getPdfLink(facture.media[0].url))" icon="file-earmark-arrow-down-fill" style="transform: scale(2); cursor: pointer; margin-left: 20%;"></b-icon>
</b-col>
<embed ref="factureRef" :src= getPdfLink(facture.media[0].url) width="65%" height="880" frameborder="0" allowfullscreen />
<!--<b-col class="mt-5 border border-secondary border-1">
<pdf ref="factureRef" :src="getPdfLink(facture.media[0].url)"></pdf>
</b-col>-->
</b-row>
<div v-else class="text-center pt-3">
<b-icon icon="arrow-clockwise" animation="spin" font-scale="4" v-if="search"></b-icon>
Expand All @@ -32,12 +28,10 @@

<script>
import { userId, facturesId, factureInfo, searchFacture } from '@/graphql/querys.js'
//import pdf from 'vue-pdf'
export default {
name: "factureDetails",
components: {
// pdf
},
data() {
return {
Expand Down
45 changes: 19 additions & 26 deletions src/views/factures.vue
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
<template>
<b-container fluid="sm" style="margin-top: 2%;">

<!--<table class="table table-striped table-hover">
<thead>
</thead>
<tbody>
</tbody>
</table>-->
<b-table
striped hover
:items="factures"
:fields="fields"
:sort-compare="mySortCompare"
:sort-by.sync="sortBy"
:sort-desc.sync="sortDesc"
responsive="sm"
ref="selectableTable"
selectable
@row-selected="onRowSelected"
>
<template #cell(telecharger)="row">
<b-button variant="link" size="sm" @click="downloadPDF(row.item.media[0].url, row.item.ref)" class="mr-1" style="color: inherit;">
<b-icon icon="file-earmark-arrow-down-fill" style="transform: scale(1.25);"></b-icon>
</b-button>
</template>
</b-table>
<b-table
striped hover
:items="factures"
:fields="fields"
:sort-compare="mySortCompare"
:sort-by.sync="sortBy"
:sort-desc.sync="sortDesc"
responsive="sm"
ref="selectableTable"
selectable
@row-selected="onRowSelected"
>
<template #cell(telecharger)="row">
<b-button variant="link" size="sm" @click="downloadPDF(row.item.media[0].url, row.item.ref)" class="mr-1" style="color: inherit;">
<b-icon icon="file-earmark-arrow-down-fill" style="transform: scale(1.25);"></b-icon>
</b-button>
</template>
</b-table>
</b-container>
</template>

Expand All @@ -46,7 +39,7 @@ export default {
{ key: 'nom', sortable: true },
{ key: 'date', sortable: true },
{ key: 'entreprise', sortable: true },
{ key: 'telecharger', label: 'telecharger', sortable: false}
{ key: 'telecharger', label: 'Télécharger', sortable: false}
]
}
},
Expand Down

0 comments on commit e04452f

Please sign in to comment.