chrisdaloa

test

Aug 6th, 2020 (edited)
845
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.86 KB | None | 0 0
  1. <template>
  2.   <div>
  3.     <v-layout id="monitor-dispo">
  4.       <v-card>
  5.         <v-card-title>
  6.           Azienda
  7.           <v-spacer></v-spacer>
  8.           <v-text-field
  9.            v-model="search"
  10.            append-icon="mdi-table-search"
  11.            label="Cerca"
  12.            single-line
  13.            hide-details
  14.          ></v-text-field>
  15.         </v-card-title>
  16.         <v-data-table
  17.          id="dispo-azienda"
  18.          :headers="headers"
  19.          :items="dispo"
  20.          item-key="nr"
  21.          class="elevation-1"
  22.          :items-per-page="50"
  23.          :sortable="false"
  24.          loading
  25.          loading-text="Caricamento dati.. Attendere"
  26.          :search="search"
  27.        >
  28.           <template v-slot:item.desc_articolo="{ item }">
  29.             <p dark class="descartLingua">{{ item.desc_articolo }}</p>
  30.             <p class="descartLatino">{{ item.descart_latino }}</p>
  31.             <p class="noteArticolo">{{ item.note_lingua }}</p>
  32.           </template>
  33.           <template v-slot:item.cc_ord>
  34.             <v-text-field suffix="CC" hint="Quanti CC" type="number" clearable="true"></v-text-field>
  35.           </template>
  36.           <template v-slot:item.cc_pia>
  37.             <v-text-field size="5" suffix="PIA" hint="Quanti PIA" type="number" clearable="true"></v-text-field>
  38.           </template>
  39.         </v-data-table>
  40.       </v-card>
  41.     </v-layout>
  42.   </div>
  43. </template>
  44.  
  45. <script>
  46. import axios from 'axios'
  47. export default {
  48.   watchQuery: true,
  49.   async asyncData() {
  50.     const { data } = await axios.get(
  51.       'http://192.168.0.29:5000/dispoweb'
  52.       // 'http://192.168.0.29/testdwSVIL/moduli/dispoweb/sql_dispoweb.php'
  53.     )
  54.     return { dispo: data, timesta: Date.now() }
  55.   },
  56.  
  57.   data() {
  58.     return {
  59.       expanded: [],
  60.       singleExpand: false,
  61.       search: '',
  62.       dispo: null,
  63.       headers: [
  64.         // { text: 'CAT', value: 'cod_categoria' },
  65.         { text: 'CATEGORIA', value: 'desc_categoria_lingua' },
  66.         { text: 'NR', value: 'NR' },
  67.         // { text: 'NR2', value: 'NR2' },
  68.         // { text: 'IMMAGINE', value: 'immagine' },
  69.         { text: 'DESCRIZIONE', value: 'desc_articolo' },
  70.         // { text: 'INFO', value: 'note_lingua' },
  71.         { text: 'CC', value: 'qta_cc' },
  72.         { text: 'PIA', value: 'qta_pia' },
  73.         // { text: 'SCA', value: 'qta_sca' }
  74.         { text: '€ CC', value: 'prezzo_cc' },
  75.         { text: '€ PIA', value: 'prezzo_pia' },
  76.         { text: 'CC_ORD', value: 'cc_ord' },
  77.         { text: 'CC_PIA', value: 'cc_pia' }
  78.  
  79.         // { text: 'SOGLIA', value: 'Soglia' }
  80.       ]
  81.     }
  82.   },
  83.   creatactivateded() {
  84.     // // Call fetch again if last fetch more than 30 sec ago
  85.     // console.log('timesta:', this.timesta)
  86.     // if (this.timesta <= Date.now() - 30000) {
  87.    //   // this.$fetch()
  88.    //   console.log('rilettura')
  89.    // }
  90.  },
  91.  
  92.  methods: {}
  93. }
  94. </script>
  95.  
Add Comment
Please, Sign In to add comment