Initial import
This commit is contained in:
74
mockup/fo/fo01/api.js
Normal file
74
mockup/fo/fo01/api.js
Normal file
@@ -0,0 +1,74 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"http://lebaran.aplikasi.web.id/smartlab_api/vuex/t02/search_bank";
|
||||
|
||||
// export async function searchBank(query, page, rowPerPage = 15) {
|
||||
// try {
|
||||
// var resp = await axios.post(URL, {
|
||||
// query: query,
|
||||
// page: page,
|
||||
// rowPerPage: rowPerPage
|
||||
// });
|
||||
// if (resp.status != 200) {
|
||||
// return {
|
||||
// status: "ERR",
|
||||
// query: query,
|
||||
// message: resp.statusText
|
||||
// };
|
||||
// }
|
||||
// let data = resp.data;
|
||||
// data.query = query;
|
||||
// return data;
|
||||
// } catch (e) {
|
||||
// return {
|
||||
// status: "ERR",
|
||||
// query: query,
|
||||
// message: e.message
|
||||
// };
|
||||
// }
|
||||
// }
|
||||
|
||||
export async function searchPatient(query, page, rowPerPage = 15) {
|
||||
try {
|
||||
if (page == 1) {
|
||||
return {
|
||||
query:query,
|
||||
rows:[
|
||||
{"mr": "MR-18107237", "name": "Pasien Umum", "sex": "Perempuan", "address": "Klero\r\nKabupaten Semarang", "action":""},
|
||||
{"mr": "MR-18107238", "name": "Heri Suryawan", "sex": "Laki - laki", "address": "Ampel", "action":""},
|
||||
{"mr": "MR-18107239", "name": "LUKA MODRIC", "sex": "Laki - laki", "address": "Jl. Raya No 1", "action":""},
|
||||
{"mr": "MR-18107247", "name": "Tyas Medika Pranandita", "sex": "Laki - laki", "address": "KP. Karangpanas", "action":""},
|
||||
{"mr": "MR-18107248", "name": "Astrid", "sex": "Perempuan", "address": "Jl. Ketintang Raya No.81", "action":""},
|
||||
{"mr": "MR-18107249", "name": "Happy", "sex": "Perempuan", "address": "Karangpanas", "action":""},
|
||||
{"mr": "MR-18107251", "name": "Juan Alexis Sukir", "sex": "Laki - laki", "address": "Jl. Sawi", "action":""},
|
||||
{"mr": "MR-18107252", "name": "Alexander Wang", "sex": "Laki - laki", "address": "Jl. Mangga Muda No. 7", "action":""},
|
||||
{"mr": "MR-18107253", "name": "CILA CILANI", "sex": "Perempuan", "address": "Jl. Duren PInang No. 67", "action":""},
|
||||
{"mr": "MR-18107254", "name": "Untung Suropati", "sex": "Laki - laki", "address": "Pasar Kapling Semarang", "action":""}
|
||||
],
|
||||
page:1,
|
||||
totalPage:2,
|
||||
totalRecord:11,
|
||||
midPages:1
|
||||
}
|
||||
} else if (page == 2) {
|
||||
return {
|
||||
query:query,
|
||||
rows:[
|
||||
{"mr": "MR-18107255", "name": "M. Althaf Prawira Ananta", "sex": "Laki - laki", "address": "KP Karangpanas No 11", "action":""}
|
||||
],
|
||||
page:2,
|
||||
totalPage:2,
|
||||
totalRecord:11,
|
||||
midPages:1
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
query: query,
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
139
mockup/fo/fo01/components/listBankComponent.js
Normal file
139
mockup/fo/fo01/components/listBankComponent.js
Normal file
@@ -0,0 +1,139 @@
|
||||
var listPatientComponent = {
|
||||
template: `
|
||||
<v-card class="xs12 md12" >
|
||||
<v-card-title>
|
||||
<v-layout>
|
||||
<v-flex xs12 sm8>
|
||||
<v-toolbar-title>Bank Listing <v-btn depressed small color="primary">New Data</v-btn></v-toolbar-title>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm4>
|
||||
<v-spacer></v-spacer>
|
||||
<v-text-field
|
||||
v-model="query"
|
||||
append-icon="search"
|
||||
@click:clear="clearSearch"
|
||||
@keydown.enter="doSearch"
|
||||
@click:append="doSearch"
|
||||
label="Search"
|
||||
single-line
|
||||
hide-details
|
||||
clearable
|
||||
class="xs12 md3"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-title>
|
||||
<v-data-table :headers="headers" :items="banks"
|
||||
:loading="isLoading"
|
||||
hide-actions class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-center">{{ props.item.M_BankCode }}</td>
|
||||
<td>{{ props.item.M_BankName }}</td>
|
||||
<td>{{ props.item.M_BankAddress }}</td>
|
||||
<td>{{ props.item.M_BankBranch }}</td>
|
||||
<td><v-btn depressed small color="info">Edit</v-btn> <v-btn depressed small color="error">Delete</v-btn></td>
|
||||
</template>
|
||||
<template slot="no-data">
|
||||
<v-alert :value="isError" color="error" icon="warning">
|
||||
{{errorMessage}}
|
||||
</v-alert>
|
||||
<v-spacer></v-spacer>
|
||||
</template>
|
||||
<template slot="footer">
|
||||
<td colspan="2" class="text-xs-left">
|
||||
Total Records : {{totalRecord}}, page {{page}} of {{totalPage}}.
|
||||
</td>
|
||||
<td colspan="3" class="text-xs-right">
|
||||
<v-pagination :length="totalPage" :value="page" :total-visible="10"
|
||||
@next="nextPage" @prev="prevPage"
|
||||
@input="gotoPage" >
|
||||
</v-pagination>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-card>
|
||||
`,
|
||||
mounted() {
|
||||
this.doSearch();
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
query: "",
|
||||
headers: [{
|
||||
text: "Code",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "M_BankCode"
|
||||
},
|
||||
{
|
||||
text: "Name",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "M_BankName"
|
||||
},
|
||||
{
|
||||
text: "Address",
|
||||
value: "M_BankAddress",
|
||||
sortable: false,
|
||||
align: "left",
|
||||
width: "30%"
|
||||
},
|
||||
{
|
||||
text: "Branch",
|
||||
value: "M_BankBranch",
|
||||
sortable: false,
|
||||
align: "left"
|
||||
},
|
||||
{
|
||||
text: "Action",
|
||||
value: "action",
|
||||
sortable: false,
|
||||
align: "center",
|
||||
width: "20%"
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
clearSearch() {
|
||||
this.query = "";
|
||||
this.doSearch();
|
||||
},
|
||||
doSearch(page = 1, rowPerPage = 8) {
|
||||
if (this.query == null) this.query = "";
|
||||
this.$store.dispatch("searchBank", {
|
||||
query: this.query,
|
||||
page,
|
||||
rowPerPage
|
||||
});
|
||||
},
|
||||
prevPage() {
|
||||
let c_page = this.page - 1;
|
||||
this.doSearch(c_page);
|
||||
},
|
||||
nextPage() {
|
||||
let c_page = this.page + 1;
|
||||
this.doSearch(c_page);
|
||||
},
|
||||
gotoPage(e) {
|
||||
let c_page = e;
|
||||
this.doSearch(c_page);
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...Vuex.mapState({
|
||||
isLoading: state => state.isLoading,
|
||||
isError: state => state.isError,
|
||||
errorMessage: state => state.errorMessage,
|
||||
banks: state => state.rows,
|
||||
totalRecord: state => state.totalRecord,
|
||||
page: state => state.page,
|
||||
totalPage: state => state.totalPage
|
||||
})
|
||||
},
|
||||
updated() {
|
||||
console.log("Component Updated");
|
||||
}
|
||||
};
|
||||
|
||||
export { listBankComponent };
|
||||
139
mockup/fo/fo01/components/listPatientComponent.js
Normal file
139
mockup/fo/fo01/components/listPatientComponent.js
Normal file
@@ -0,0 +1,139 @@
|
||||
var listPatientComponent = {
|
||||
template: `
|
||||
<v-card class="xs12 md12" >
|
||||
<v-card-title>
|
||||
<v-layout>
|
||||
<v-flex xs12 sm8>
|
||||
<v-toolbar-title>PATIENT LISTING
|
||||
</v-flex>
|
||||
<v-flex xs12 sm4>
|
||||
<v-spacer></v-spacer>
|
||||
<v-text-field
|
||||
v-model="query"
|
||||
append-icon="search"
|
||||
@click:clear="clearSearch"
|
||||
@keydown.enter="doSearch"
|
||||
@click:append="doSearch"
|
||||
label="Search"
|
||||
single-line
|
||||
hide-details
|
||||
clearable
|
||||
class="xs12 md3"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-title>
|
||||
<v-data-table :headers="headers" :items="patients"
|
||||
:loading="isLoading"
|
||||
hide-actions class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-center">{{ props.item.mr }}</td>
|
||||
<td>{{ props.item.name }}</td>
|
||||
<td>{{ props.item.address }}</td>
|
||||
<td>{{ props.item.sex }}</td>
|
||||
<td><v-btn depressed small color="success">PROCESS</v-btn> <v-btn depressed small color="error">Delete</v-btn></td>
|
||||
</template>
|
||||
<template slot="no-data">
|
||||
<v-alert :value="isError" color="error" icon="warning">
|
||||
{{errorMessage}}
|
||||
</v-alert>
|
||||
<v-spacer></v-spacer>
|
||||
</template>
|
||||
<template slot="footer">
|
||||
<td colspan="2" class="text-xs-left">
|
||||
Total Records : {{totalRecord}}, page {{page}} of {{totalPage}}.
|
||||
</td>
|
||||
<td colspan="3" class="text-xs-right">
|
||||
<v-pagination :length="totalPage" :value="page" :total-visible="10"
|
||||
@next="nextPage" @prev="prevPage"
|
||||
@input="gotoPage" >
|
||||
</v-pagination>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-card>
|
||||
`,
|
||||
mounted() {
|
||||
this.doSearch();
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
query: "",
|
||||
headers: [{
|
||||
text: "MR",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr"
|
||||
},
|
||||
{
|
||||
text: "NAME",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "name"
|
||||
},
|
||||
{
|
||||
text: "ADDRESS",
|
||||
value: "address",
|
||||
sortable: false,
|
||||
align: "left",
|
||||
width: "30%"
|
||||
},
|
||||
{
|
||||
text: "SEX",
|
||||
value: "sex",
|
||||
sortable: false,
|
||||
align: "left"
|
||||
},
|
||||
{
|
||||
text: "ACTION",
|
||||
value: "action",
|
||||
sortable: false,
|
||||
align: "center",
|
||||
width: "20%"
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
clearSearch() {
|
||||
this.query = "";
|
||||
this.doSearch();
|
||||
},
|
||||
doSearch(page = 1, rowPerPage = 8) {
|
||||
if (this.query == null) this.query = "";
|
||||
this.$store.dispatch("searchPatient", {
|
||||
query: this.query,
|
||||
page,
|
||||
rowPerPage
|
||||
});
|
||||
},
|
||||
prevPage() {
|
||||
let c_page = this.page - 1;
|
||||
this.doSearch(c_page);
|
||||
},
|
||||
nextPage() {
|
||||
let c_page = this.page + 1;
|
||||
this.doSearch(c_page);
|
||||
},
|
||||
gotoPage(e) {
|
||||
let c_page = e;
|
||||
this.doSearch(c_page);
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...Vuex.mapState({
|
||||
isLoading: state => state.isLoading,
|
||||
isError: state => state.isError,
|
||||
errorMessage: state => state.errorMessage,
|
||||
patients: state => state.rows,
|
||||
totalRecord: state => state.totalRecord,
|
||||
page: state => state.page,
|
||||
totalPage: state => state.totalPage
|
||||
})
|
||||
},
|
||||
updated() {
|
||||
console.log("Component Updated");
|
||||
}
|
||||
};
|
||||
|
||||
export { listPatientComponent };
|
||||
38
mockup/fo/fo01/components/smartNavbarComponent.js
Normal file
38
mockup/fo/fo01/components/smartNavbarComponent.js
Normal file
@@ -0,0 +1,38 @@
|
||||
var smartNavbarComponent = {
|
||||
template: `
|
||||
<span>
|
||||
<v-navigation-drawer v-model="drawer" fixed app>
|
||||
<v-list dense>
|
||||
<v-list-tile>
|
||||
<v-list-tile-action>
|
||||
<v-icon>home</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>Home</v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
<v-list-tile>
|
||||
<v-list-tile-action>
|
||||
<v-icon>contact_mail</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>Contact</v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
</v-list>
|
||||
</v-navigation-drawer>
|
||||
<v-toolbar color="indigo" dark fixed app>
|
||||
<v-toolbar-side-icon @click.stop="drawer = !drawer"></v-toolbar-side-icon>
|
||||
<v-toolbar-title>SAMPLING</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
</span>
|
||||
`,
|
||||
data: function() {
|
||||
return {
|
||||
drawer: false
|
||||
};
|
||||
},
|
||||
methods: {}
|
||||
};
|
||||
|
||||
export { smartNavbarComponent };
|
||||
127
mockup/fo/fo01/index.php
Normal file
127
mockup/fo/fo01/index.php
Normal file
@@ -0,0 +1,127 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>ONE</title>
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/google-fonts.css">
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/vuetify.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div v-cloak id="app">
|
||||
<v-app id="smartApp">
|
||||
<smart-navbar></smart-navbar>
|
||||
<v-content>
|
||||
|
||||
<v-container fluid fill-height style="height:inherit" pa-2>
|
||||
<v-layout v-bind="binding">
|
||||
|
||||
|
||||
<v-flex>
|
||||
<template>
|
||||
<v-tabs
|
||||
centered
|
||||
color="cyan"
|
||||
dark
|
||||
fixed-tabs
|
||||
>
|
||||
<v-tabs-slider color="yellow"></v-tabs-slider>
|
||||
|
||||
<v-tab href="#tab-1">
|
||||
<v-icon>list</v-icon> PATIENT LIST
|
||||
|
||||
</v-tab>
|
||||
|
||||
<v-tab href="../fo02">
|
||||
<v-icon>opacity</v-icon> SAMPLING
|
||||
|
||||
</v-tab>
|
||||
|
||||
<v-tab href="../fo03">
|
||||
<v-icon>verified_user</v-icon> SAMPLE VERIFICATION
|
||||
|
||||
</v-tab>
|
||||
|
||||
<v-tab href="../fo03">
|
||||
<v-icon>motorcycle</v-icon> SAMPLE DISTRIBUTION
|
||||
|
||||
</v-tab>
|
||||
|
||||
<!-- <v-tab-item
|
||||
v-for="i in 4"
|
||||
:key="i"
|
||||
:value="'tab-' + i"
|
||||
> -->
|
||||
<!-- <v-card flat>
|
||||
<v-card-text>{{ text }}</v-card-text>
|
||||
</v-card>
|
||||
</v-tab-item> -->
|
||||
</v-tabs>
|
||||
</template>
|
||||
</v-flex>
|
||||
|
||||
<v-flex>
|
||||
<list-patient fill-height></list-patient>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-container>
|
||||
</v-content>
|
||||
<v-footer color="indigo" app>
|
||||
<span class="white--text">© 2017</span>
|
||||
</v-footer>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<script src="../../../libs/vendor/axios.min.js"></script>
|
||||
<script src="../../../libs/vendor/vue.js"></script>
|
||||
<script src="../../../libs/vendor/vuex.js"></script>
|
||||
<script src="../../../libs/vendor/vuetify.js"></script>
|
||||
<!-- App Script -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
import { store } from './store.js<?php echo $ts ?>';
|
||||
import { smartNavbarComponent } from './components/smartNavbarComponent.js<?php echo $ts ?>';
|
||||
import { listPatientComponent } from './components/listPatientComponent.js<?php echo $ts ?>';
|
||||
// import { dialogFormComponent } from './components/dialogFormComponent.js<?php echo $ts ?>';
|
||||
//for testing
|
||||
// window.store = store;
|
||||
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
components: {
|
||||
'smart-navbar': smartNavbarComponent,
|
||||
'list-patient': listPatientComponent,
|
||||
// 'dialog-form':dialogFormComponent
|
||||
},
|
||||
data: {
|
||||
drawer: false,
|
||||
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'
|
||||
},
|
||||
|
||||
computed : {
|
||||
binding () {
|
||||
const binding = {}
|
||||
|
||||
if (this.$vuetify.breakpoint.mdAndUp) binding.column = true
|
||||
|
||||
return binding
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
71
mockup/fo/fo01/store.js
Normal file
71
mockup/fo/fo01/store.js
Normal file
@@ -0,0 +1,71 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import * as api from "./api.js";
|
||||
|
||||
export const store = new Vuex.Store({
|
||||
state: {
|
||||
rows: [],
|
||||
midPages: [],
|
||||
isLoading: false,
|
||||
isError: false,
|
||||
errorMessage: "",
|
||||
query: "",
|
||||
page: 1,
|
||||
totalPage: 2,
|
||||
totalRecord: 11
|
||||
},
|
||||
mutations: {
|
||||
updatePatient(state, data) {
|
||||
// console.log(data);
|
||||
if (data.status == "ERR") {
|
||||
state.isError = true;
|
||||
if (data.db_error) {
|
||||
state.errorMessage = data.db_error.message;
|
||||
} else {
|
||||
state.errorMessage = data.message;
|
||||
}
|
||||
state.query = data.query;
|
||||
state.page = 0;
|
||||
state.totalPage = 0;
|
||||
state.totalRecord = 0;
|
||||
state.rows = [];
|
||||
state.midPages = [];
|
||||
} else {
|
||||
state.isError = false;
|
||||
state.errorMessage = "";
|
||||
state.query = data.query;
|
||||
state.page = data.page;
|
||||
state.totalPage = data.totalPage;
|
||||
state.totalRecord = data.totalRecord;
|
||||
state.rows = data.rows;
|
||||
state.midPages = data.midPages;
|
||||
}
|
||||
},
|
||||
updateLoading(state, flag) {
|
||||
state.isLoading = flag;
|
||||
},
|
||||
resetError(state) {
|
||||
state.isError = false;
|
||||
state.errorMessage = "";
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async searchPatient(context, data) {
|
||||
context.commit("updateLoading", true);
|
||||
let resp = await api.searchPatient(
|
||||
data.query,
|
||||
data.page,
|
||||
data.rowPerPage
|
||||
);
|
||||
context.commit("updateLoading", false);
|
||||
context.commit("updatePatient", resp);
|
||||
setTimeout(function() {
|
||||
context.commit("resetError");
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user