Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <template>
  2.    <div id="pageTable">
  3.     <v-container grid-list-xl fluid>
  4.       <v-layout row wrap>
  5.         <v-flex lg12>  
  6.           <v-card class="elevation-1 rounded-card">
  7.             <v-card-text>
  8.              
  9.             </v-card-text>
  10.           </v-card>
  11.          
  12.         </v-flex>
  13.         <v-flex lg12>
  14.           <v-card class="elevation-14">
  15.             <v-toolbar card color="grey lighten-3">
  16.             <v-card-title>
  17.              <h3> Data Mutasi Lama</h3>
  18.             </v-card-title>
  19.             </v-toolbar>
  20.             <v-divider></v-divider>
  21.             <v-card-title>
  22.               <v-text-field
  23.                 append-icon="search"
  24.                 :rules="nameRules"
  25.                 :counter="20"
  26.                 hint="Masukan Data Atau Nomor Handphone Pelanggan"
  27.                 v-model="search"
  28.                 label="Pencarian Data Atau Nomor Handphone"
  29.                 required
  30.                 clearable
  31.               ></v-text-field>
  32.               <v-text-field
  33.                 v-model="addIngAuto"
  34.                 append-icon="search"
  35.                 label="Pencarian Data Atau Nomor Handphone"
  36.               ></v-text-field>
  37.               <v-btn color="success" @click="test">text</v-btn>
  38.             </v-card-title>
  39.             <v-card-text class="pa-0 ">
  40.               <v-data-table
  41.                 :headers="complex.headers"
  42.                 :items="oldMutations"
  43.                 :search="search"
  44.  
  45.                 class="elevation-1"
  46.               >
  47.                 <template slot="items" slot-scope="props">  
  48.                   <td class="text-md-left">{{ props.item.tanggal | formatDates}}</td>
  49.                   <td class="text-md-left">{{ props.item.ket }}</td>
  50.                   <td class="text-md-center"><b>Rp. </b><i>{{ props.item.debet | formatPrices }}</i></td>
  51.                   <td class="text-md-center"><b>Rp. </b><i>{{ props.item.kredit | formatPrices }}</i></td>
  52.                   <td class="text-md-center"><b>Rp. </b><i>{{ props.item.lastbalance | formatPrices }}</i></td>
  53.                   <td class="text-md-center"><b>Rp. </b><i>{{ props.item.currbalance | formatPrices }}</i></td>
  54.                 </template>
  55.                 <template slot="no-data">
  56.                 <isLoadings></isLoadings>
  57.                 </template>
  58.               </v-data-table>
  59.             </v-card-text>
  60.           </v-card>
  61.         </v-flex>
  62.       </v-layout>
  63.     </v-container>
  64.   </div>
  65. </template>
  66.  
  67. <script>
  68. import { mapActions, mapState } from 'vuex'
  69. import _ from 'lodash'
  70. import moment from 'moment'
  71. import isLoadings from '@/components/_tableAgents/dataLoadings'
  72. import XLSX from 'xlsx'
  73. var jsPDF = require('jspdf');
  74. require('jspdf-autotable');
  75. import axios from 'axios'
  76. var CryptoJS = require("crypto-js");
  77.  
  78. export default {
  79.   components :{
  80.     isLoadings
  81.   },
  82.   created () {
  83.  
  84.   },
  85.   mounted() {
  86.     this._onMakeOldMUtations()
  87.   },
  88.   computed: {
  89.   },
  90.   methods: {
  91.    
  92.     test() {
  93.        return  this.addIngAuto++
  94.     },
  95.    _onMakeOldMUtations () {
  96.     let storages = JSON.parse(sessionStorage.getItem("key"))
  97.     let bytes  = CryptoJS.AES.decrypt(storages, 'Updour-S0L4L3+L4L3|L45&C1NT4');
  98.     let decryptedData = JSON.parse(bytes.toString(CryptoJS.enc.Utf8));
  99.  
  100.     let id = decryptedData.agenid
  101.     let uri = 'https://localhost.biz:300/mutasi/' +id+ '/0/' + this.addIngAuto
  102.     axios.get(uri).then(r => r.data).then(res => {
  103.       console.log(res.data)
  104.       this.oldMutations = res.data
  105.     }).catch(err => alert(err))
  106.   }
  107. },
  108.   watch: {
  109.  
  110.   },
  111.   filters: {
  112.     formatPrices(value) {
  113.       let val = (value/1).toFixed().replace('.', '')
  114.       return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".")
  115.     },
  116.     formatDates(value) {
  117.       if (! value) return ''
  118.         value = value.toString()
  119.       return moment(value).format('DD/MM/YYYY HH:mm:ss')
  120.     }
  121.   },
  122.   data () {
  123.     return {
  124.       addIngAuto : 0,
  125.       oldMutations : [],
  126.       startDate : null,
  127.       startDates : null,
  128.       endDate : null,
  129.       endDates : null,
  130.       modal: false,
  131.       modals: false,
  132.       dialog: false,
  133.       dialogs: false,
  134.       valid: false,
  135.       search: '',
  136.       name: '',
  137.       nameRules: [
  138.       v => !!v || 'Pencarian Nomor Handphone Pelanggan',
  139.       ],
  140.       //data Tables
  141.       complex: {
  142.         headers: [
  143.         {
  144.           text: 'Tanggal',
  145.           sortable: true,
  146.           value: 'tanggal'
  147.         },
  148.         {
  149.           text: 'Keterangan',
  150.           sortable: true,
  151.           value: 'ket'
  152.         },
  153.         {
  154.           text: 'Debet',
  155.           sortable: true,
  156.           value: 'debet'
  157.         },
  158.         {
  159.           text: 'Kredit',
  160.           sortable: true,
  161.           value: 'kredit'
  162.         },  
  163.         {
  164.           text: 'Saldo Awal',
  165.           sortable: true,
  166.           value: 'currbalance'
  167.         },    
  168.         {
  169.           text: 'Saldo Akhir',
  170.           sortable: true,
  171.           value: 'lastbalance'
  172.         },      
  173.         ],
  174.       },
  175.     }
  176.   },
  177.  
  178. };
  179. </script>
  180.  
  181. <style scoped lang="css">
  182. .rounded-card{
  183.   border-radius:15px;
  184. }
  185. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement