Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template>
- <div>
- <v-layout id="monitor-dispo">
- <v-card>
- <v-card-title>
- Azienda
- <v-spacer></v-spacer>
- <v-text-field
- v-model="search"
- append-icon="mdi-table-search"
- label="Cerca"
- single-line
- hide-details
- ></v-text-field>
- </v-card-title>
- <v-data-table
- id="dispo-azienda"
- :headers="headers"
- :items="dispo"
- item-key="nr"
- class="elevation-1"
- :items-per-page="50"
- :sortable="false"
- loading
- loading-text="Caricamento dati.. Attendere"
- :search="search"
- >
- <template v-slot:item.desc_articolo="{ item }">
- <p dark class="descartLingua">{{ item.desc_articolo }}</p>
- <p class="descartLatino">{{ item.descart_latino }}</p>
- <p class="noteArticolo">{{ item.note_lingua }}</p>
- </template>
- <template v-slot:item.cc_ord>
- <v-text-field suffix="CC" hint="Quanti CC" type="number" clearable="true"></v-text-field>
- </template>
- <template v-slot:item.cc_pia>
- <v-text-field size="5" suffix="PIA" hint="Quanti PIA" type="number" clearable="true"></v-text-field>
- </template>
- </v-data-table>
- </v-card>
- </v-layout>
- </div>
- </template>
- <script>
- import axios from 'axios'
- export default {
- watchQuery: true,
- async asyncData() {
- const { data } = await axios.get(
- 'http://192.168.0.29:5000/dispoweb'
- // 'http://192.168.0.29/testdwSVIL/moduli/dispoweb/sql_dispoweb.php'
- )
- return { dispo: data, timesta: Date.now() }
- },
- data() {
- return {
- expanded: [],
- singleExpand: false,
- search: '',
- dispo: null,
- headers: [
- // { text: 'CAT', value: 'cod_categoria' },
- { text: 'CATEGORIA', value: 'desc_categoria_lingua' },
- { text: 'NR', value: 'NR' },
- // { text: 'NR2', value: 'NR2' },
- // { text: 'IMMAGINE', value: 'immagine' },
- { text: 'DESCRIZIONE', value: 'desc_articolo' },
- // { text: 'INFO', value: 'note_lingua' },
- { text: 'CC', value: 'qta_cc' },
- { text: 'PIA', value: 'qta_pia' },
- // { text: 'SCA', value: 'qta_sca' }
- { text: '€ CC', value: 'prezzo_cc' },
- { text: '€ PIA', value: 'prezzo_pia' },
- { text: 'CC_ORD', value: 'cc_ord' },
- { text: 'CC_PIA', value: 'cc_pia' }
- // { text: 'SOGLIA', value: 'Soglia' }
- ]
- }
- },
- creatactivateded() {
- // // Call fetch again if last fetch more than 30 sec ago
- // console.log('timesta:', this.timesta)
- // if (this.timesta <= Date.now() - 30000) {
- // // this.$fetch()
- // console.log('rilettura')
- // }
- },
- methods: {}
- }
- </script>
Add Comment
Please, Sign In to add comment