Flatten nested repos

This commit is contained in:
sas.fajri
2026-04-27 10:13:31 +07:00
parent 01c2963a43
commit 8347aef8f4
17935 changed files with 5015229 additions and 3 deletions

View File

View File

@@ -0,0 +1,20 @@
const URL = "/one-api/mockup/fo/registration/";
export async function search(search) {
try {
var resp = await axios.post(URL + 'company/search',{search:search});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,24 @@
// API :
// search bank
// paramater : query , page , rowPerPage
const URL =
"/one-api/mockup/fo/registration/";
export async function search(o_id, p_id, d_id) {
try {
var resp = await axios.post(URL + 'delivery/search', { order_id: o_id, patient_id: p_id, doctor_id: d_id });
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,45 @@
// API :
// search bank
// paramater : query , page , rowPerPage
const URL =
"/one-api/mockup/fo/registration/";
export async function search(search) {
try {
var resp = await axios.post(URL + 'doctor/search', {
search: search
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchPj() {
try {
var resp = await axios.post(URL + 'doctor/search_pj', { });
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,24 @@
// API :
// search bank
// paramater : query , page , rowPerPage
const URL =
"/one-api/mockup/fo/registration/";
export async function search() {
try {
var resp = await axios.post(URL + 'language/search', { });
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,121 @@
// API :
// search bank
// paramater : query , page , rowPerPage
const URL =
"/one-api/mockup/fo/registration/";
export async function save(order_id, header, delivery, detail) {
try {
var resp = await axios.post(URL + 'order/save', {
order_id: order_id,
header: header,
delivery: delivery,
detail: detail
});
return resp
} catch (e) {
return {
status: "ERR",
message: e.message
}
}
}
export async function patientSearch(noreg, search) {
try {
var resp = await axios.post(URL + 'patient/search', {
search: search,
noreg: noreg
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function doctorSearch(search) {
try {
var resp = await axios.post(URL + 'doctor/search', {
search: search
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function doctorSearchPj() {
try {
var resp = await axios.post(URL + 'doctor/search_pj', { });
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function languageSearch() {
try {
var resp = await axios.post(URL + 'language/search', { });
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function deliverySearch() {
try {
var resp = await axios.post(URL + 'delivery/search', { });
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,27 @@
// API :
// search bank
// paramater : query , page , rowPerPage
const URL =
"/one-api/mockup/fo/registration/";
export async function search(noreg, search) {
try {
var resp = await axios.post(URL + 'patient/search', {
search: search,
noreg: noreg
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,26 @@
// API :
// search bank
// paramater : query , page , rowPerPage
const URL =
"/one-api/mockup/fo/registration/";
export async function getAll(id) {
try {
var resp = await axios.post(URL + 'patientaddress/get_all', {
patient_id: id
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,39 @@
const URL = "/one-api/mockup/fo/registration/";
export async function get_order(id) {
try {
var resp = await axios.post(URL + 'payment/get_order',{id:id});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search(search) {
try {
var resp = await axios.post(URL + 'payment/search', {search:search});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,74 @@
// API :
// search bank
// paramater : query , page , rowPerPage
const URL =
"/one-api/mockup/fo/registration/";
export async function search(mouCompanyID,search) {
try {
var resp = await axios.post(URL + 'px/search', {
search:search,
mouCompanyID:mouCompanyID
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function panel(mouCompanyID,search) {
try {
var resp = await axios.post(URL + 'px/panel', {
search:search,
mouCompanyID:mouCompanyID
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function get_price(test_id, mou_id, cito) {
try {
var resp = await axios.post(URL + 'px/get_price', {
test_id:test_id,
mou_id:mou_id,
cito:cito
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,123 @@
<template>
<v-layout column fill-height>
<v-toolbar class="pa-1 mb-2" color="blue lighten-3" dark height="50px">
<v-toolbar-title>DAFTAR ANTRIAN</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
<v-card class="pa-1 p-left-side grow" grow>
<v-card-text class="pa-0">
<v-layout row wrap>
<v-flex >
<v-data-table :headers="headers" :items="patients" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.jam }}</td>
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.layanan }}</td>
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.antrian }}</td>
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.status }}</td>
<td class="justify-center layout px-0">
<v-btn flat icon color="deep-orange">
<v-icon>mic</v-icon>
</v-btn>
<v-btn flat icon color="red">
<v-icon>clear</v-icon>
</v-btn>
<v-btn flat icon color="primary">
<v-icon>done</v-icon>
</v-btn>
</template>
<v-btn fab dark small color="primary">
<v-icon dark>remove</v-icon>
</v-btn>
</v-data-table>
</v-flex>
</v-layout>
</v-card-text>
</v-card>
</v-layout>
</template>
<style scoped>
table.v-table tbody td,table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
data() {
return {
query: "",
items: [],
headers: [
{
text: "Jam",
align: "Center",
sortable: false,
value: "mr",
width: "5%",
class: " blue lighten-4"
},
{
text: "Layanan",
align: "Center",
sortable: false,
value: "lab",
width: "25%",
class: "blue lighten-4"
},
{
text: "No Antrian",
align: "Center",
sortable: false,
value: "name",
width: "5%",
class: "blue lighten-4"
},
{
text: "Status",
align: "Center",
sortable: false,
value: "name",
width: "5%",
class: "blue lighten-4"
},
{
text: "Action",
align: "Center",
sortable: false,
value: "name",
width: "5%",
class: "blue lighten-4"
}
],
isLoading: true,
patients: [
{"jam":"10.00","layanan":"Antrian Umum", "antrian": "A006","status": "call","action":""},
{"jam":"10.10","layanan":"Antrian Rekanan", "antrian": "D001","status": "serve","action":""},
{"jam":"10.20","layanan":"Antrian Perusahaan", "antrian": "E004","status": "sone","action":""},
{"jam":"10.30","layanan":"Antrian Umum", "antrian": "A004","status": "skip","action":""},
]
};
}
}
</script>

View File

@@ -0,0 +1,92 @@
<template>
<v-layout column fill-height>
<v-toolbar class="pa-1 mb-2" color="blue lighten-3" dark height="50px">
<v-toolbar-title>STATUS ANTRIAN</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
<v-card class="pa-1 p-left-side grow" grow>
<v-card-text class="pa-0">
<v-layout row wrap>
<v-flex >
<v-data-table :headers="headers" :items="patients" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.layanan }}</td>
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.antrian }}</td>
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.serve }}</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-card-text>
</v-card>
</v-layout>
</template>
<style scoped>
table.v-table tbody td,table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
data() {
return {
query: "",
items: [],
headers: [
{
text: "Layanan",
align: "Center",
sortable: false,
value: "mr",
width: "25%",
class: " blue lighten-4"
},
{
text: "Total Antrian",
align: "Center",
sortable: false,
value: "lab",
width: "10%",
class: "blue lighten-4"
},
{
text: "Sisa Antrian",
align: "Center",
sortable: false,
value: "name",
width: "10%",
class: "blue lighten-4"
}
],
isLoading: true,
patients: [
{"layanan":"Ambil Hasil","antrian":"3", "serve": "2","action":""},
{"layanan":"Pasien Rekanan","antrian":"5", "serve": "2","action":""},
{"layanan":"Pasien Umum","antrian":"7", "serve": "2","action":""},
]
};
}
}
</script>

View File

@@ -0,0 +1,138 @@
<template>
<v-layout column fill-height>
<v-toolbar class="pa-1 mb-2" color="blue lighten-3" dark height="50px">
<v-toolbar-title>NUMBERING</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn icon>
<v-icon>library_add</v-icon>
</v-btn>
</v-toolbar>
<v-card class="pa-1 p-left-side grow" grow>
<v-card-text class="pa-0">
<v-layout row wrap>
<v-flex xs12>
<v-data-table :headers="headers" :items="patients" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.service }}</td>
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.prefix }}</td>
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.date }}</td>
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.digit }}</td>
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.sufix }}</td>
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.counter }}</td>
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.reset }}</td>
<td class="justify-center layout px-0">
<v-icon small class="mr-2" @click="editItem(props.item)" > edit </v-icon>
<v-icon small @click="deleteItem(props.item)" > delete </v-icon> </td>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-card-text>
</v-card>
</v-layout>
</template>
<style scoped>
table.v-table tbody td,table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
data() {
return {
query: "",
items: [],
headers: [
{
text: "Service Name",
align: "Center",
sortable: false,
value: "mr",
width: "15%",
class: " blue lighten-4"
},
{
text: "Prefix",
align: "Center",
sortable: false,
value: "lab",
width: "15%",
class: "blue lighten-4"
},
{
text: "Prefix Date",
align: "Center",
sortable: false,
value: "name",
width: "15%",
class: "blue lighten-4"
},
{
text: "Digit",
align: "Center",
sortable: false,
value: "name",
width: "15%",
class: "blue lighten-4"
},
{
text: "Sufix",
align: "Center",
sortable: false,
value: "name",
width: "15%",
class: "blue lighten-4"
},
{
text: "Counter",
align: "Center",
sortable: false,
value: "name",
width: "15%",
class: "blue lighten-4"
},
{
text: "Reset",
align: "Center",
sortable: false,
value: "name",
width: "15%",
class: "blue lighten-4"
},
{
text: "Action",
align: "Center",
sortable: false,
value: "name",
width: "15%",
class: "blue lighten-4"
}
],
isLoading: true,
patients: [
{"service":"Antrian Umum","prefix":"001", "date": "%y%m", "digit": "6", "sufix": "1", "counter": "100", "reset": "D","action":""},
{"service":"Antrian Perusahaan","prefix":"001", "date": "%y%m", "digit": "6", "sufix": "1", "counter": "100", "reset": "D","action":""},
{"service":"Ambil Hasil","prefix":"001", "date": "%y%m", "digit": "6", "sufix": "1", "counter": "100", "reset": "D","action":""} ]
};
}
}
</script>

View File

@@ -0,0 +1,90 @@
<!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" >
<one-navbar>
</one-navbar>
<v-content class="blue lighten-5" >
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
<v-layout row wrap >
<v-flex xs6 class="left" fill-height pa-1>
<!-- komponen kiri -->
<one-mou-px-left></one-mou-px-left>
</v-flex>
<v-flex xs6 class="right" fill-height pa-1>
<!-- komponen kanan -->
<one-fo-registration-price-list></one-fo-registration-price-list>
</v-flex>
</v-layout>
</v-container>
</v-content>
<one-footer>
</one-footer>
</v-app>
</div>
<!-- Vendor -->
<script src="../../../libs/vendor/moment.min.js"></script>
<script src="../../../libs/vendor/numeral.min.js"></script>
<script src="../../../libs/vendor/moment-locale-id.js"></script>
<script src="../../../libs/vendor/lodash.js"></script>
<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>
<script src="../../../libs/vendor/httpVueLoader.js"></script>
<!-- App Script -->
<?php
$ts = "?ts=" . Date("ymdhis");
?>
<script type="module">
function one_money(inp) {
return numeral(inp).format('0,000.00')
}
window.one_money = one_money
function one_float(inp) {
try {
let val = parseFloat(inp)
if (isNaN(val)) return 0.0
return val
} catch(e) {
return 0.0
}
}
window.one_float = one_float
import { store } from './store.js<?php echo $ts ?>';
//for testing
window.store = store;
new Vue({
store,
el: '#app',
components: {
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
'one-mou-px-left' : httpVueLoader('./components/oneMouPxLeft.vue'),
'one-fo-registration-price-list' : httpVueLoader('./components/oneFoRegistrationPriceList.vue?ts='
+ new Date().toISOString())
}
})
</script>
<style>
[v-cloak] {
display: none
}
</style>
</body>
</html>

View File

@@ -0,0 +1,95 @@
<!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" >
{{tab_active}}
<one-navbar></one-navbar>
<v-content class="blue lighten-5 one" >
<v-container fluid pt-2 pb-2 pl-1 pr-1>
<v-layout row wrap >
<v-flex xs8 class="left" fill-height pa-1>
<one-queue-fo></one-queue-fo>
</v-flex>
<v-flex xs4 class="right" fill-height pa-1>
<one-queue-status></one-queue-status>
</v-flex>
</v-layout>
</v-container>
</v-content>
<one-footer> </one-footer>
</v-app>
</div>
<!-- Vendor -->
<script src="../../../libs/vendor/moment.min.js"></script>
<script src="../../../libs/vendor/numeral.min.js"></script>
<script src="../../../libs/vendor/moment-locale-id.js"></script>
<script src="../../../libs/vendor/lodash.js"></script>
<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>
<script src="../../../libs/vendor/httpVueLoader.js"></script>
<script src="../../../libs/one_global.js"></script>
<!-- App Script -->
<?php
$ts = "?ts=" . Date("ymdhis");
?>
<script type="module">
import { store } from './store.js<?php echo $ts ?>';
//for testing
window.store = store;
new Vue({
store,
data : {
},
mounted: function() {
this.$store.dispatch("doctor/search_pj")
this.$store.dispatch("language/search")
},
computed : {
tab_active () {
return store.state.tab_active
}
},
el: '#app',
components: {
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
'one-queue-fo': httpVueLoader('./components/oneQueueFo.vue'),
'one-queue-status': httpVueLoader('./components/oneQueueStatus.vue')
}
})
</script>
<style>
[v-cloak] {
display: none
}
.v-content.one {
//padding:64px 0px 0px !important;
}
</style>
</body>
</html>

View File

@@ -0,0 +1,72 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/company.js"
export default {
namespaced: true,
state: {
search: '',
search_status:0,
search_error_message:'',
companies: [],
total_company: 0,
selected_company: {},
selected_mou: {},
selected_px_tab: 'px'
},
mutations: {
update_selected_px_tab(state,tab) {
state.selected_px_tab = tab
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_selected_mou(state,val) {
state.selected_mou = val
},
update_search(state,val) {
state.search=val
},
update_search_status(state,status) {
state.search_status = status
},
update_companies(state,data) {
state.companies= data.records
state.total_company= data.total
},
update_selected_company(state,val) {
console.log('company aaaaa')
console.log('1:'+JSON.stringify(store.state.company.selected_company))
state.selected_company=val
console.log('2:'+JSON.stringify(store.state.company.selected_company))
}
},
actions: {
async search(context,prm) {
context.commit("update_search_status",1)
try {
let resp= await api.search(context.state.search)
if (resp.status != "OK") {
context.commit("update_search_status",3)
context.commit("update_search_error_message",resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_companies",data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,83 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/delivery.js"
export default {
namespaced: true,
state: {
search_status:0,
search_error_message:'',
deliveries: [],
patient_id: 0,
doctor_id: 0,
order_id: 0,
checked_id: []
},
mutations: {
update_search_error_message(state,status) {
state.search_error_message = status
},
update_search_status(state,status) {
state.search_status = status
},
update_deliveries(state,data) {
for (var i in data) {
if (state.checked_id.indexOf(data[i].idx) > -1)
data[i].selected = true
else
data[i].selected = false
}
state.deliveries = data
},
update_deliveries_2(state) {
for (var i in state.deliveries) {
if (state.checked_id.indexOf(state.deliveries[i].idx) > -1)
state.deliveries[i].selected = true
else
state.deliveries[i].selected = false
}
// state.deliveries= data
},
update_selected_delivery(state,val) {
state.selected_delivery=val
},
update_params(state, val) {
if (val.p_id)
state.patient_id = val.p_id;
if (val.o_id)
state.order_id = val.o_id;
if (val.d_id)
state.doctor_id = val.d_id;
},
update_checked_id(state, val) {
state.checked_id = val
}
},
actions: {
async search(context) {
context.commit("update_search_status",1)
try {
let resp= await api.search(store.state.delivery.order_id,
store.state.delivery.patient_id,
store.state.delivery.doctor_id)
if (resp.status != "OK") {
context.commit("update_search_status",3)
context.commit("update_search_error_message",resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let data = {
records : resp.data.records
}
context.commit("update_deliveries",data.records)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,120 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/doctor.js"
export default {
namespaced: true,
state: {
search : '',
search_status: 0,
search_error_message: "",
doctors: [],
total_doctor: 0,
selected_doctor: {},
selected_address: {},
doctors_pj: [],
selected_doctor_pj : {},
search_pj_status: 0,
search_pj_error_message: "",
mounted: 0
},
mutations: {
update_search(state,val) {
state.search=val
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_search_status(state,status) {
state.search_status = status
},
update_doctors(state,data) {
state.doctors = data.records
state.total_doctor= data.total
},
update_selected_doctor(state,doc) {
state.selected_doctor= doc
if (!doc) return
if (doc.address.length> 0) {
state.selected_address = doc.address[0]
} else {
state.selected_address = {}
}
},
update_selected_address(state,addr) {
state.selected_address = addr
},
update_search_pj_error_message(state,status) {
state.search_pj_error_message = status
},
update_search_pj_status(state,status) {
state.search_pj_status = status
},
update_doctors_pj(state,data) {
state.doctors_pj = data.records
let flag_found = false
data.records.forEach(function(d) {
if (d.M_DoctorIsDefaultPJ == 'Y' ) {
state.selected_doctor_pj = d
flag_found = true
}
})
if (! flag_found & data.records.length > 0 ) state.selected_doctor_pj = data.records[0]
},
update_selected_doctor_pj(state,doc) {
state.selected_doctor_pj = doc
},
increment_mounted(state, n) {
state.mounted = state.mounted + n;
}
},
actions: {
async search_pj(context) {
context.commit("update_search_pj_status",1)
try {
let resp= await api.searchPj()
if (resp.status != "OK") {
context.commit("update_search_pj_status",3)
context.commit("update_search_pj_error_message",resp.message)
} else {
context.commit("update_search_pj_status",2)
context.commit("update_search_pj_error_message","")
let data = {
total : resp.data.total,
records : resp.data.records
}
context.commit("update_doctors_pj",data)
}
} catch(e) {
context.commit("update_search_pj_status",3)
context.commit("update_search_pj_error_message",e.message )
}
},
async search(context) {
context.commit("update_search_status",1)
try {
let resp= await api.search(context.state.search)
if (resp.status != "OK") {
context.commit("update_search_status",3)
context.commit("update_search_error_message",resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let data = {
total : resp.data.total,
records : resp.data.records
}
context.commit("update_doctors",data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,51 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/language.js"
export default {
namespaced: true,
state: {
search_status:0,
search_error_message:'',
languages: [],
selected_language: {},
},
mutations: {
update_search_error_message(state,status) {
state.search_error_message = status
},
update_search_status(state,status) {
state.search_status = status
},
update_languages(state,data) {
state.languages= data.records
if (data.records.length > 0) state.selected_language = data.records[0]
},
update_selected_language(state,val) {
state.selected_language=val
}
},
actions: {
async search(context) {
context.commit("update_search_status",1)
try {
let resp= await api.search()
if (resp.status != "OK") {
context.commit("update_search_status",3)
context.commit("update_search_error_message",resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let data = {
records : resp.data.records
}
context.commit("update_languages",data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,112 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/order.js"
export default {
namespaced: true,
state: {
catatan_fo:'',
diagnosa:'',
patient_note: '',
finish_dialog_is_active: false,
current_order: {},
received_sample: 'N'
},
mutations: {
update_patient_note(state,val) {
state.patient_note=val
},
update_catatan_fo(state,val) {
state.catatan_fo=val
},
update_diagnosa(state,val) {
state.diagnosa=val
},
update_finish_dialog_is_active(state, val) {
state.finish_dialog_is_active = val
},
update_current_order(state, val) {
state.current_order = val
},
update_received_sample(state, val) {
state.received_sample = val
}
},
actions: {
async save(context) {
var order_id = 0;
var delivery = [];
var detail = [];
var header = {
patient_id: context.rootState.patient.selected_patient.M_PatientID,
age: context.rootState.patient.selected_patient.patient_age,
sender_doctor_id: context.rootState.doctor.selected_doctor.M_DoctorID,
sender_address_id: context.rootState.doctor.selected_address.M_DoctorAddressID,
pj_doctor_id: context.rootState.doctor.selected_doctor_pj.M_DoctorID,
lang_id: context.rootState.language.selected_language.id,
doctor_note: "",
fo_note: "",
company_id: context.rootState.company.selected_company.M_CompanyID,
mou_id: context.rootState.company.selected_mou.M_MouID,
received_sample: context.rootState.order.received_sample
};
let dlv = context.rootState.delivery.deliveries
for (var i in dlv) {
if (dlv[i].selected == true) {
let e = dlv[i].idx.split('-')
delivery.push({
delivery_id:e[0],
delivery_type_id:e[1],
address_id:e[2],
note:dlv[i].note
})
}
}
var px_tmp = [];
var st = context.rootState.px.selected_test;
for (var i in st) {
px_tmp.push({
t_id: st[i]['T_PriceID'],
t_price: st[i]['T_PriceAmount'],
t_disc: st[i]['T_PriceDisc'],
t_discrp: st[i]['T_PriceDiscRp'],
t_cito: st[i]['T_TestIsCito']
})
}
detail = px_tmp;
console.log(header);
console.log(delivery)
// context.commit("update_search_status",1)
try {
let resp= await api.save(0, header, delivery, detail)
if (resp.status != "200") {
// context.commit("update_search_status",3)
// context.commit("update_search_error_message",resp.message)
alert('error')
} else {
context.commit("update_current_order", resp.data.data)
context.commit('update_finish_dialog_is_active', true)
context.commit('payment/update_order_id', resp.data.data.id, {root:true})
context.dispatch('payment/get_order', resp.data.data.id, {root:true})
}
} catch(e) {
// context.commit("update_search_status",3)
// context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,82 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/patient.js"
window.api = api
export default {
namespaced: true,
state: {
noreg:'',
search: '',
search_status:0,
search_error_message:'',
search_dialog_is_active: false,
patients: [],
total_patient: 0,
total_display: 0,
selected_patient: {},
},
mutations: {
update_search_dialog_is_active(state,status) {
state.search_dialog_is_active = status
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_noreg(state,val) {
state.noreg=val
},
update_search(state,val) {
state.search=val
},
update_search_status(state,status) {
state.search_status = status
},
update_patients(state,data) {
state.patients= data.records
state.total_patient = data.total
state.total_display = data.total_display
},
update_selected_patient(state,val) {
var now = moment(new Date())
var dob = moment(new Date(val.M_PatientDOB))
var year = now.diff(dob,'years')
dob.add(year,'years')
var month = now.diff(dob,'months')
dob.add(month,'months')
var day = now.diff(dob,'days')
if (isNaN(year)) val.patient_age = ''
else val.patient_age = `${year} tahun ${month} bulan ${day} hari`
state.selected_patient=val
// store.state.patientaddress.patient_id = val.M_PatientID
}
},
actions: {
async search(context,prm) {
context.commit("update_search_status",1)
try {
let resp= await api.search(context.state.noreg,context.state.search)
if (resp.status != "OK") {
context.commit("update_search_status",3)
context.commit("update_search_error_message",resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total,
total_display: resp.data.total_display
}
context.commit("update_patients",data)
// commit("patientaddress/test", "X", { root: true })
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,86 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/patientaddress.js"
window.api = api
export default {
namespaced: true,
state: {
noreg:'',
search: '',
search_status:0,
search_error_message:'',
search_dialog_is_active: false,
patients: [],
total_patient: 0,
total_display: 0,
selected_patient: {},
address: [],
patient_id: 0
},
mutations: {
update_search_dialog_is_active(state,status) {
state.search_dialog_is_active = status
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_noreg(state,val) {
state.noreg=val
},
update_search(state,val) {
state.search=val
},
update_search_status(state,status) {
state.search_status = status
},
update_patients(state,data) {
state.patients= data.records
state.total_patient = data.total
state.total_display = data.total_display
},
update_selected_patient(state,val) {
state.selected_patient=val
},
update_address(state, val) {
state.address = val;
},
testx(state, val) {
state.patient_id = val
}
},
actions: {
async search(context,prm) {
context.commit("update_search_status",1)
try {
let resp= await api.getAll(context.state.patient_id)
if (resp.status != "OK") {
context.commit("update_search_status",3)
context.commit("update_search_error_message",resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let data = resp.data;
context.commit("update_address",data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
},
async loadAddress(context, prm) {
}
},
methods: {
tests (a) {
alert(a)
}
}
}

View File

@@ -0,0 +1,107 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/payment.js"
export default {
namespaced: true,
state: {
order_id: 0,
selected_patient: {
order_no: '-',
order_date: '-',
order_mou: '-',
order_company: '-',
patient_name: '-',
patient_mr: '-',
doctor_sender: '-',
doctor_pj: '-'
},
order_detail: [
// { n:1, d_id:1, t_id:1, t_name:'SGOT', t_price:80000, t_disctotal:7000, t_total:73000 },
// { n:2, d_id:2, t_id:2, t_name:'SGPT', t_price:75000, t_disctotal:8000, t_total:67000 }
],
order_subtotal: 0,
order_rounding: 0,
order_total: 0,
payment_cash_amount: 0,
payment_debit_amount: 0,
payment_credit_amount: 0,
payments: []
},
mutations: {
update_order (state, data) {
state.selected_patient = data.order_header
state.order_detail = data.order_detail
state.order_subtotal = data.order_header.order_subtotal
state.order_rounding = data.order_header.order_rounding
state.order_total = data.order_header.order_total
},
update_order_id (state, id) {
state.order_id = id
},
update_payment(state, o) {
if (o.type == 'cash')
state.payment_cash_amount = o.amount
if (o.type == 'debit')
state.payment_debit_amount = o.amount
if (o.type == 'credit')
state.payment_credit_amount = o.amount
},
update_payments(state, o) {
state.payments = o
}
},
actions: {
async get_order(context, prm) {
// context.commit("update_search_status",1)
try {
let resp= await api.get_order(prm)
if (resp.status != "OK") {
// context.commit("update_search_status",3)
// context.commit("update_search_error_message",resp.message)
} else {
// context.commit("update_search_status",2)
// context.commit("update_search_error_message","")
let data = resp.data.data
context.commit("update_order", data)
// commit("patientaddress/test", "X", { root: true })
}
} catch(e) {
// context.commit("update_search_status",3)
// context.commit("update_search_error_message",e.message )
}
},
async search(context, prm) {
// context.commit("update_search_status",1)
try {
let resp= await api.search(prm)
if (resp.status != "OK") {
// context.commit("update_search_status",3)
// context.commit("update_search_error_message",resp.message)
} else {
// context.commit("update_search_status",2)
// context.commit("update_search_error_message","")
let data = resp.data
context.commit("update_payments", data)
// commit("patientaddress/test", "X", { root: true })
}
} catch(e) {
// context.commit("update_search_status",3)
// context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,250 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/px.js"
export default {
namespaced: true,
state: {
search: '',
search_status:0,
search_error_message:'',
tests: [],
total_test: 0,
selected_test: [],
search_panel: '',
search_panel_status:0,
panels: [],
total_panel: 0,
selected_panel: [],
requirement: [],
cito: {test:[], panel:[]}
},
mutations: {
update_requirement(state,val) {
state.requirement = val
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_selected_test(state,val) {
// if (state.cito.length > 0) {
for (var i in val) {
val[i]['T_TestIsCito'] = 'N'
if (state.cito.test.indexOf(val[i]['T_TestID']) > -1)
val[i]['T_TestIsCito'] = 'Y'
}
// }
state.selected_test = val
},
update_mouCompanyID(state,val) {
state.mouCompanyID=val
},
update_search(state,val) {
state.search=val
},
update_search_status(state,status) {
state.search_status = status
},
update_tests(state,data) {
state.tests= data.records
state.total_test= data.total
},
update_search_panel(state,val) {
state.search_panel=val
},
update_search_panel_status(state,status) {
state.search_panel_status = status
},
update_panels(state,data) {
console.log('--comit--',data)
state.panels = data.records
state.total_panel = data.total
},
update_selected_panel(state,val) {
state.selected_panel= val
},
update_cito(state, val) {
let test = state.selected_test
// if (val.length > 0) {
for (var i in test) {
test[i]['T_TestIsCito'] = 'N'
if (val.v.indexOf(test[i]['T_TestID']) > -1)
test[i]['T_TestIsCito'] = 'Y'
}
// }
state.cito[val.t] = val.v
state.selected_test = test
}
},
actions: {
delete_px (context, test) {
let sel = context.state.selected_test
sel.forEach(function(t, idx) {
if(t.T_PriceID == test.T_PriceID) {
sel.splice(idx,1)
}
});
context.commit("update_selected_test", sel)
let tests = context.state.tests
if (tests == undefined ) tests = []
tests.push(test)
let dt = {
records : tests,
total: tests.length
}
context.commit("update_tests", dt)
context.dispatch("update_req", null)
},
update_req(context, px) {
let reqs = []
let tests = context.state.selected_test
tests.forEach( function(t) {
let label = t.T_TestRequirement
if (_.indexOf(reqs,label) == -1 ) reqs.push(label)
})
let panels = context.state.selected_panel
panels.forEach( function(p) {
let tests = p.test
tests.forEach( function(t) {
let label = t.T_TestRequirement
if (_.indexOf(reqs,label) == -1 ) reqs.push(label)
})
})
let requirement = context.state.requirement
let flag_update_requirement = false
if (reqs.length == 0 ) {
requirement = []
flag_update_requirement = true
}
requirement.forEach(function(r,idx) {
if ( _.indexOf(reqs,r.label) == -1) {
flag_update_requirement = true
requirement.splice(idx,1)
}
})
if (flag_update_requirement) {
context.commit('update_requirement', requirement)
}
},
async search(context,prm) {
context.commit("update_search_status",1)
try {
let mouCompanyID = 0
if (context.rootState.company.selected_mou.M_MouID) {
mouCompanyID = context.rootState.company.selected_mou.M_MouID
}
let resp= await api.search(mouCompanyID,context.state.search)
if (resp.status != "OK") {
context.commit("update_search_status",3)
context.commit("update_search_error_message",resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_tests",data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
console.log(e)
}
},
async panel(context,prm) {
context.commit("update_search_panel_status",1)
try {
let mouCompanyID = 0
if (context.rootState.company.selected_mou.M_MouCompanyID) {
mouCompanyID = context.rootState.company.selected_mou.M_MouCompanyID
}
let resp= await api.panel(mouCompanyID,context.state.search)
if (resp.status != "OK") {
context.commit("update_search_panel_status",3)
context.commit("update_search_error_message",resp.message)
} else {
context.commit("update_search_panel_status",2)
context.commit("update_search_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_panels",data)
}
} catch(e) {
context.commit("update_search_panel_status",3)
context.commit("update_search_error_message",e.message )
}
},
async get_price(context, prm) {
context.commit("update_search_status",1)
try {
let mou_id = context.rootState.company.selected_mou.M_MouID
let resp = await api.get_price(prm.test_id, mou_id, prm.cito)
if (resp.status != "OK") {
context.commit("update_search_status",3)
context.commit("update_search_error_message",resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let x = context.state.selected_test
for (let i in x) {
if (x[i].T_TestID == prm.test_id) {
if (Math.round(resp.data.test_price) == 0) {
x[i].T_TestIsCito = "N"
let n = context.state.cito.test.indexOf(x[i].T_TestID)
if (n > -1)
context.state.cito.test.splice(n, 1)
let tests = context.state.tests
if (tests == undefined ) tests = []
tests.push(x[i])
let dt = {
records : tests,
total: tests.length
}
context.commit("update_tests", dt)
x.splice(i, 1);
}
else {
x[i].T_PriceAmount = resp.data.test_price
x[i].T_PriceDisc = resp.data.test_disc
x[i].T_PriceDiscRp = resp.data.test_discrp
}
}
}
context.commit("update_selected_test", x)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
},
}
}

View File

View File

@@ -0,0 +1,39 @@
// State
// data ...
// Mutations
//
//
// Actions
import patient from "./modules/patient.js";
import patientaddress from "./modules/patientaddress.js";
import doctor from "./modules/doctor.js";
import language from "./modules/language.js";
import order from "./modules/order.js";
import delivery from "./modules/delivery.js";
import company from "./modules/company.js";
import px from "./modules/px.js";
import payment from "./modules/payment.js";
export const store = new Vuex.Store({
state : {
tab_active : '01'
},
mutations : {
change_tab(state, tab) {
state.tab_active = tab;
}
},
modules : {
patient: patient,
patientaddress: patientaddress,
doctor: doctor,
language: language,
order: order,
delivery: delivery,
company: company,
px:px,
payment:payment
}
});