Initial import

This commit is contained in:
sas.fajri
2026-05-25 20:01:37 +07:00
commit 710d7c1b97
10371 changed files with 2381698 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
const URL = "/one-api/v1/one-doctor/doctortestv3/";
export async function lookup(prm) {
try {
var resp = await axios.post(URL + 'lookup', prm);
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,97 @@
const URL = "/one-api/v1/one-doctor/doctortestv3/";
export async function lookuptest(prm) {
try {
var resp = await axios.post(URL + 'lookuptest', prm);
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 saveeditstatus(prm) {
try {
var resp = await axios.post(URL + 'saveeditstatus', prm);
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 getstatus(prm) {
try {
var resp = await axios.post(URL + 'getstatus', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
// dropdown doctors
export async function getdoctor(prm) {
try {
var resp = await axios.post(URL + 'getdoctor', prm);
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 copyfromdoctor(prm) {
try {
var resp = await axios.post(URL + 'copyfromdoctor', prm);
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,271 @@
<template>
<v-layout>
<template>
<v-dialog max-width="30%">
<v-card>
</v-card>
</v-dialog>
</template>
<v-flex xs12>
<v-card>
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>DOKTER</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
<v-layout row style="background:white;padding-top:5px;" justify-left>
<v-text-field class=" xs4 ma-1" label="Cari"
placeholder="Ketikkan Dokter atau Nama Agreement atau Perusahaan" outline v-model="xsearch"
hide-details></v-text-field>
</v-layout>
<v-divider></v-divider>
<div>
<v-layout row class="scroll-container" style="max-height:600px;overflow: auto;">
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="vdoctor" :loading="isLoading" hide-actions
class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">{{ props.item.doctorName }}</td>
<td class="text-xs-left pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">{{ props.item.M_MouName }}</td>
<td class="text-xs-left pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">{{ props.item.M_CompanyName }}</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-flex xs12 class="text-xs-left pt-3 pb-3">
<v-pagination v-model="curr_page" :length="xtotal_page"></v-pagination>
</v-flex>
</div>
</v-card>
</v-flex>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
.textinput {
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
background-color: white;
background-position: 10px 10px;
background-repeat: no-repeat;
padding-left: 40px;
width: 100%;
padding: 8px 10px;
margin-bottom: 5px;
box-sizing: border-box;
border: 1px solid #607d8b;
}
.textinput:focus {
width: 100%;
}
.textinput:focus::-webkit-input-placeholder {
color: transparent;
}
.textinput:focus::-moz-placeholder {
color: transparent;
}
.textinput:-moz-placeholder {
color: transparent;
}
.boxoutline {
color: red;
border: 1px solid red;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #ffffff;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxoutline:hover {
background: rgba(0, 0, 0, 0.07) !important;
font-size: 15px;
font-weight: 700;
}
.boxsolid {
color: #ffffff;
border: 1px solid #ffffff;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #f44336;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxsolid:hover {
background: #f44336de;
font-size: 15px;
font-weight: 700;
}
.scroll-container {
scroll-padding: 50px 0 0 50px;
}
::-webkit-scrollbar {
width: 7px;
}
/* this targets the default scrollbar (compulsory) */
::-webkit-scrollbar-track {
background-color: #73baf3;
}
/* the new scrollbar will have a flat appearance with the set background color */
::-webkit-scrollbar-thumb {
background-color: #2196f3;
}
/* this will style the thumb, ignoring the track */
::-webkit-scrollbar-button {
background-color: #0079da;
}
/* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
::-webkit-scrollbar-corner {
background-color: black;
}
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
</style>
<script>
module.exports = {
data() {
return {
headers: [{
text: "DOKTER",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA AGREEMENT",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA PERUSAHAAN",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
}
]
};
},
mounted() {
this.$store.dispatch("doctor/lookup")
},
computed: {
vdoctor() {
return this.$store.state.doctor.doctors
},
isLoading() {
return this.$store.state.doctor.lookup_status == 1
},
curr_page: {
get() {
return this.$store.state.doctor.current_page
},
set(val) {
this.$store.commit("doctor/update_current_page", val)
this.$store.dispatch("doctor/lookup")
}
},
xtotal_page: {
get() {
return this.$store.state.doctor.total_doctors
},
set(val) {
this.$store.commit("doctor/update_total_doctors", val)
}
},
xsearch: {
get() {
return this.$store.state.doctor.x_search
},
set(val) {
this.$store.commit("doctor/update_x_search", val)
}
},
selected_doctor() {
return this.$store.state.doctor.selected_doctor
}
},
methods: {
isSelected(p) {
return p.doctor_id == this.$store.state.doctor.selected_doctor.doctor_id
},
selectMe(selected) {
this.$store.commit("doctor/update_selected_doctor", selected)
this.$store.commit("doctortest/update_selected_doctor_id", selected.doctor_id)
this.$store.commit("doctortest/update_selected_mou_id", selected.M_UserM_MouID)
},
thr_search: _.debounce(function () {
this.$store.dispatch("doctor/lookup")
}, 1000)
},
watch: {
xsearch(val, old) {
this.xsearch = val
this.thr_search()
},
selected_doctor(val, old) {
this.$store.commit("doctortest/update_selected_doctor_id", val.doctor_id)
}
}
}
</script>

View File

@@ -0,0 +1,456 @@
<template>
<v-layout>
<!-- ERROR DIALOG -->
<v-dialog v-model="dialog_error" max-width="500px">
<v-card>
<v-card-title>
<span>ERROR !</span>
<v-spacer></v-spacer>
</v-card-title>
<v-divider></v-divider>
<div class="ma-3 red--text">{{ msgError }}</div>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialog_error = false">Close</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<!-- END ERROR DIALOG -->
<!-- Snackbar -->
<v-snackbar v-model="snackbar" :timeout="5000" :multi-line="false" :vertical="false" :top="true" :color="clr"
:value="snackbar">
{{ msgsnackbar }}
<v-btn flat @click="snackbar = false"> Tutup </v-btn>
</v-snackbar>
<!-- End Snackbar -->
<!-- dialog dokter -->
<v-dialog v-model="dialog_form" persistent width="50%">
<v-card>
<v-card-title>
<span class="title">Form Dokter</span>
</v-card-title>
<v-divider></v-divider>
<v-progress-linear v-if="loading_save" :indeterminate="true"></v-progress-linear>
<v-card-text class="pt-3 pb-0">
<v-layout row wrap>
<v-flex xs12>
<v-select v-model="xdoctors" autocomplete :items="doctorss" item-text="doctorName"
item-value="doctor_id" return-object label="Pilih Nama Dokter"
:error="error_doctor_message !== ''" :error-messages="error_doctor_message"
@blur="doctorValidation" required>
</v-select>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialog_form = false" :disabled="loading_save">Tutup</v-btn>
<v-btn color="primary" flat :disabled="loading_save" @click="saveAdd()">Pilih Dokter</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<!-- end dialog dokter -->
<v-flex xs12>
<v-card class="mb-2" color="white">
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>PEMERIKSAAN</v-toolbar-title>
<v-spacer></v-spacer>
<div>
<v-btn small @click="openFormDoctor()">COPY FROM DOCTOR</v-btn>
</div>
</v-toolbar>
<v-layout row style="background:white">
<v-layout row justify-space-between>
<v-flex xs4>
<v-text-field class="ma-1" label="Cari" placeholder="Ketikkan Kode atau Pemeriksaan" outline
v-model="xsearch" hide-details></v-text-field>
</v-flex>
<v-flex xs3>
<v-select item-text="M_StatusName" return-object :items="f_statuss" style="font-size:14px"
class="mini-select ma-1" v-model="selected_filter_status" outline hide-details
label="Status"></v-select>
</v-flex>
</v-layout>
</v-layout>
<v-divider></v-divider>
<v-layout row wrap class="scroll-container" style="max-height:600px;overflow: auto;">
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="vdoctortest" :loading="isLoading" hide-actions
class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-html="props.item.T_TestSasCode">
</td>
<td class="text-xs-left pa-2" v-html="props.item.T_TestName">
</td>
<td class="text-xs-left pa-2">
<div>
<v-btn @click="changeBtn(props.item)" v-if="props.item.status === 'N'" small
color="error">
<v-icon left>close</v-icon> Belum dipilih</v-btn>
<v-btn @click="changeBtn(props.item)" v-if="props.item.status === 'Y'" small
color="success">
<v-icon left>check</v-icon> Sudah terpilih</v-btn>
</div>
</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page"
:length="xtotal_page"></v-pagination>
</v-card>
</v-flex>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
.textinput {
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
background-color: white;
background-position: 10px 10px;
background-repeat: no-repeat;
padding-left: 40px;
width: 100%;
padding: 8px 10px;
margin-bottom: 5px;
box-sizing: border-box;
border: 1px solid #607d8b;
}
.textinput:focus {
width: 100%;
}
.textinput:focus::-webkit-input-placeholder {
color: transparent;
}
.textinput:focus::-moz-placeholder {
color: transparent;
}
.textinput:-moz-placeholder {
color: transparent;
}
.boxoutline {
color: red;
border: 1px solid red;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #ffffff;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxoutline:hover {
background: rgba(0, 0, 0, 0.07) !important;
font-size: 15px;
font-weight: 700;
}
.boxsolid {
color: #ffffff;
border: 1px solid #ffffff;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #f44336;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxsolid:hover {
background: #f44336de;
font-size: 15px;
font-weight: 700;
}
.scroll-container {
scroll-padding: 50px 0 0 50px;
}
::-webkit-scrollbar {
width: 7px;
}
/* this targets the default scrollbar (compulsory) */
::-webkit-scrollbar-track {
background-color: #73baf3;
}
/* the new scrollbar will have a flat appearance with the set background color */
::-webkit-scrollbar-thumb {
background-color: #2196f3;
}
/* this will style the thumb, ignoring the track */
::-webkit-scrollbar-button {
background-color: #0079da;
}
/* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
::-webkit-scrollbar-corner {
background-color: black;
}
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
</style>
<script>
module.exports = {
data() {
return {
clr: "success",
xdoctors: 0,
error_doctor_message: "",
headers: [
{
text: "KODE",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "blue lighten-3 white--text"
},
{
text: "PEMERIKSAAN",
align: "left",
sortable: false,
value: "mr",
width: "30%",
class: "blue lighten-3 white--text"
},
{
text: "STATUS",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "blue lighten-3 white--text"
}
]
};
},
mounted() {
this.$store.dispatch("doctortest/getstatus")
},
computed: {
selected_filter_status: {
get() {
return this.$store.state.doctortest.selected_filter_status
},
set(val) {
this.$store.commit("doctortest/update_selected_filter_status", val)
}
},
f_statuss: {
get() {
return this.$store.state.doctortest.f_statuss
},
set(val) {
this.$store.commit("doctortest/update_f_statuss", val)
}
},
vdoctortest() {
return this.$store.state.doctortest.doctortests
},
xdoctor() {
return this.$store.state.doctor.selected_doctor
},
isLoading() {
return this.$store.state.doctortest.lookup_status == 1
},
curr_page: {
get() {
return this.$store.state.doctortest.current_page
},
set(val) {
this.$store.commit("doctortest/update_current_page", val)
this.$store.commit("doctortest/update_last_id", -1)
this.$store.dispatch("doctortest/lookuptest")
}
},
xtotal_page: {
get() {
return this.$store.state.doctortest.total_doctortests
},
set(val) {
this.$store.commit("doctortest/update_total_doctortests", val)
}
},
xsearch: {
get() {
return this.$store.state.doctortest.x_search
},
set(val) {
this.$store.commit("doctortest/update_x_search", val)
}
},
selected_doctor_id() {
return this.$store.state.doctortest.selected_doctor_id
},
snackbar: {
get() {
return this.$store.state.doctortest.alert_success;
},
set(val) {
this.$store.commit("doctortest/update_alert_success", val);
}
},
msgsnackbar() {
return this.$store.state.doctortest.msg_success;
},
msgError() {
return this.$store.state.doctortest.save_error_message;
},
dialog_error: {
get() {
return this.$store.state.doctortest.alert_error;
},
set(val) {
this.$store.commit("doctortest/update_alert_error", val);
},
},
loading_save: {
get() {
return this.$store.state.doctortest.loading_save
},
set(val) {
this.$store.commit("doctortest/update_loading_save", val)
},
},
dialog_form: {
get() {
return this.$store.state.doctortest.dialog_form
},
set(val) {
this.$store.commit("doctortest/update_dialog_form", val)
},
},
// dropdown doctor
doctorss() {
return this.$store.state.doctortest.doctors
},
xdoctorr() {
return this.$store.state.doctor.selected_doctor
},
xact: {
get() {
return this.$store.state.doctortest.act
},
set(val) {
this.$store.commit("doctortest/update_act", val)
}
},
},
methods: {
thr_search: _.debounce(function () {
this.$store.dispatch("doctortest/lookuptest")
}, 1000),
thr_search_doctor: _.debounce(function () {
this.$store.dispatch("doctortest/lookuptest")
}, 300),
thr_search_doctor_mou: _.debounce(function () {
this.$store.dispatch("doctortest/getdoctor")
}, 1000),
changeBtn(value) {
var prm = {
doctor_id: this.$store.state.doctortest.selected_doctor_id,
test_id: value.testid,
status: value.status === 'N' ? 'Y' : 'N',
T_TestName: value.T_TestName
}
this.$store.dispatch("doctortest/saveeditstatus", prm)
},
doctorValidation() {
if (_.isEmpty(this.xdoctors)) {
this.error_doctor_message = 'Anda belum mengisi'
}
if (this.xdoctors) {
this.error_doctor_message = ""
}
},
resetAllInput() {
this.xdoctors = ""
this.error_doctor_message = ""
},
openFormDoctor() {
this.dialog_form = true
this.$store.commit("doctortest/update_act", "add")
this.xdoctors = ""
this.resetAllInput()
this.$store.commit("doctortest/update_last_id", -1)
},
saveAdd() {
this.doctorValidation()
if (this.error_doctor_message === "") {
var prm = {
doctor_name: this.xdoctors.doctorName,
doctoridfrom: this.xdoctors.doctor_id,
doctoridto: this.$store.state.doctor.selected_doctor.doctor_id
}
this.$store.dispatch("doctortest/copyfromdoctor", prm)
this.dialog_form = false
}
}
},
watch: {
xsearch(val, old) {
this.xsearch = val
this.thr_search()
},
xdoctor(val, old) {
this.thr_search_doctor()
},
selected_doctor_id(val, old) {
this.thr_search_doctor()
},
selected_filter_status(val, old) {
if (this.$store.state.doctortest.selected_doctor_id === 0) {
return
}
this.thr_search()
},
xdoctorr(val, old) {
this.thr_search_doctor_mou()
}
}
}
</script>

View File

@@ -0,0 +1,77 @@
<!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/icomoon-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 xs4 class="left" fill-height pa-1>
<!-- komponen kiri -->
<one-doctor-list></one-doctor-list>
</v-flex>
<v-flex xs8 class="right" fill-height pa-1>
<!-- komponen kanan -->
<one-doctortest-list></one-doctortest-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>
<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,
el: '#app',
components: {
'one-navbar': httpVueLoader('../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../apps/components/oneFooter.vue'),
'one-doctor-list': httpVueLoader('./components/oneMdDoctorList.vue'),
'one-doctortest-list': httpVueLoader('./components/oneMdDoctortestList.vue')
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {
}
.right {
}
</style>
</body>
</html>

View File

@@ -0,0 +1,85 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/doctor.js"
export default {
namespaced: true,
state: {
doctors: [],
lookup_status: 0,
current_page: 1,
total_doctors: 0,
x_search: "",
error_message: "",
selected_doctor: {}
},
mutations: {
update_doctors(state, data) {
state.doctors = data
},
update_lookup_status(state, status) {
state.lookup_status = status
},
update_current_page(state, val) {
state.current_page = val
},
update_total_doctors(state, val) {
state.total_doctors = val
},
update_error_message(state, data) {
state.error_message = data
},
update_selected_doctor(state, val) {
state.selected_doctor = val
},
update_x_search(state, val) {
state.x_search = val
state.current_page = 1
}
},
actions: {
async lookup(context, prm) {
context.commit("update_lookup_status", 1)
try {
var prm = {
token: one_token(),
search: context.state.x_search,
current_page: context.state.current_page
}
let resp = await api.lookup(prm)
if (resp.status != "OK") {
context.commit("update_lookup_status", 3)
context.commit("update_error_message", resp.message)
} else {
context.commit("update_lookup_status", 2)
context.commit("update_error_message", "")
let data = {
records: resp.data.records,
total_page: resp.data.total_page,
total_filter: resp.data.total_filter
}
context.commit("update_doctors", resp.data.records)
context.commit("update_total_doctors", resp.data.total_page)
if (
!(
Object.keys(context.state.selected_doctor).length === 0 &&
context.state.selected_doctor.constructor === Object
)
) {
let idx = _.findIndex(resp.data.records, function (o) {
return o.id == context.state.selected_doctor.doctor_id
});
if (idx >= 0) {
context.commit("update_selected_doctor", resp.data.records[idx]);
}
}
}
} catch (e) {
context.commit("update_lookup_status", 3)
context.commit("update_error_message", e.message)
}
}
}
}

View File

@@ -0,0 +1,263 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/doctortest.js"
export default {
namespaced: true,
state: {
doctortests: [],
lookup_status: 0,
current_page: 1,
selected_doctortest: {},
total_doctortests: 0,
last_id: -1,
x_search: "",
selected_doctor_id: 0,
error_message: "",
save_status: 0,
save_error_message: "",
alert_success: false,
msg_success: "",
alert_error: false,
get_data_status: 0,
f_statuss: [],
selected_filter_status: { "M_StatusID": "A", "M_StatusName": "Semua" },
dialog_form: false,
loading_save: false,
autocomplete_status: 0,
doctors: [],
selected_mou_id: 0,
act: "add",
copy_status: 0
},
mutations: {
update_doctortests(state, data) {
state.doctortests = data
},
update_lookup_status(state, status) {
state.lookup_status = status
},
update_current_page(state, val) {
state.current_page = val
},
update_selected_doctortest(state, val) {
state.selected_doctortest = val
},
update_total_doctortests(state, val) {
state.total_doctortests = val
},
update_x_search(state, val) {
state.x_search = val
state.current_page = 1
},
update_selected_doctor_id(state, val) {
state.selected_doctor_id = val
},
update_last_id(state, val) {
state.last_id = val
},
update_error_message(state, data) {
state.error_message = data
},
update_save_status(state, val) {
state.save_status = val
},
update_save_error_message(state, val) {
state.save_error_message = val
},
update_alert_success(state, val) {
state.alert_success = val;
},
update_msg_success(state, val) {
state.msg_success = val
},
update_alert_error(state, val) {
state.alert_error = val;
},
update_dialog_error(state, data) {
state.dialog_error = data
},
update_get_data_status(state, val) {
state.get_data_status = val
},
update_f_statuss(state, val) {
state.f_statuss = val
},
update_selected_filter_status(state, val) {
state.selected_filter_status = val
},
update_dialog_form(state, val) {
state.dialog_form = val
},
update_loading_save(state, val) {
state.loading_save = val
},
update_doctors(state, val) {
state.doctors = val
},
update_autocomplete_status(state, val) {
state.autocomplete_status = val
},
update_selected_mou_id(state, val) {
state.selected_mou_id = val
},
update_act(state, val) {
state.act = val
},
update_copy_status(state, val) {
state.copy_status = val
}
},
actions: {
async lookuptest(context, prm) {
context.commit("update_lookup_status", 1)
try {
var prm = {
token: one_token(),
doctor_id: context.state.selected_doctor_id,
search: context.state.x_search,
current_page: context.state.current_page,
status: context.state.selected_filter_status.M_StatusID
}
let resp = await api.lookuptest(prm)
if (resp.status != "OK") {
context.commit("update_lookup_status", 3)
context.commit("update_error_message", resp.message)
} else {
context.commit("update_lookup_status", 2)
context.commit("update_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_doctortests", resp.data.records)
context.commit("update_total_doctortests", resp.data.total)
if (context.state.last_id == -1) {
if (resp.data && resp.data.records.length > 0) {
context.commit("update_selected_doctortest", resp.data.records[0])
}
}
else {
if (resp.data && resp.data.records.length > 0) {
let idx = _.findIndex(resp.data.records, function (o) { return o.testid == context.state.last_id })
context.commit("update_selected_doctortest", resp.data.records[idx])
}
}
}
} catch (e) {
context.commit("update_lookup_status", 3)
context.commit("update_error_message", e.message)
console.log(e)
}
},
async saveeditstatus(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.saveeditstatus(prm)
if (resp.status != 'OK') {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
context.commit("update_dialog_error", true)
context.commit("update_alert_error", true)
} else {
context.commit("update_save_status", 2)
let data = resp.data
var msg = ''
if (prm.status === 'N') {
msg = "Pemeriksaan " + prm.T_TestName + " batal dipilih"
} else {
msg = "Pemeriksaan " + prm.T_TestName + " berhasil dipilih"
}
context.commit("update_msg_success", msg)
context.commit("update_alert_success", true)
context.dispatch("lookuptest")
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_dialog_error", true)
context.commit("update_save_error_message", resp.message)
context.commit("update_alert_error", true)
console.log(e)
}
},
async getstatus(context, prm) {
context.commit("update_get_data_status", 1)
try {
var prm = {
token: one_token()
}
let resp = await api.getstatus(prm)
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
} else {
context.commit("update_get_data_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_f_statuss", data.records.f_statuss)
context.commit("update_selected_filter_status", data.records.f_statuss[0])
// context.dispatch("lookuptest")
}
} catch (e) {
context.commit("update_get_data_status", 3)
console.log(e)
}
},
// dropdown doctors
async getdoctor(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
var prm = {
token: one_token(),
mouid: context.state.selected_mou_id
}
let resp = await api.getdoctor(prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records
}
context.commit("update_doctors", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async copyfromdoctor(context, prm) {
context.commit("update_copy_status", 1)
try {
prm.token = one_token()
let resp = await api.copyfromdoctor(prm)
if (resp.status != 'OK') {
context.commit("update_copy_status", 3)
context.commit("update_save_error_message", resp.message)
context.commit("update_dialog_error", true)
context.commit("update_alert_error", true)
} else {
context.commit("update_copy_status", 2)
let data = resp.total
var msg = "Pemeriksaan berhasil di copy dari dokter " + prm.doctor_name
context.commit("update_msg_success", msg)
context.commit("update_alert_success", true)
context.dispatch("lookuptest")
}
} catch (e) {
context.commit("update_copy_status", 3)
context.commit("update_dialog_error", true)
context.commit("update_save_error_message", resp.message)
context.commit("update_alert_error", true)
console.log(e)
}
}
}
}

View File

@@ -0,0 +1,25 @@
// State
// data ...
// Mutations
//
//
// Actions
import doctor from "./modules/doctor.js";
import doctortest from "./modules/doctortest.js";
import system from "../../apps/modules/system/system.js";
export const store = new Vuex.Store({
modules: {
doctor: doctor,
doctortest: doctortest,
system:system
},
state: {
},
mutations: {
},
actions: {
}
});

View File

@@ -0,0 +1,116 @@
const URL = "/one-api/v1/one-doctor/";
export async function search(prm) {
try {
var resp = await axios.post(URL + 'dokterapi/search', prm);
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 searchdokterautocomplete(token,prm){
try {
var resp = await axios.post(URL + 'dokterapi/search_doctor',{token:token,search:prm});
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 searchmouautocomplete(token,prm){
try {
var resp = await axios.post(URL + 'dokterapi/search_mou',{token:token,search:prm});
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 add(prm) {
try {
var resp = await axios.post(URL + 'dokterapi/add', prm);
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 update(prm) {
try {
var resp = await axios.post(URL + 'dokterapi/edit', prm);
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 xdelete(token,id) {
try {
var resp = await axios.post(URL + 'dokterapi/delete',
{ id: id, token:token });
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,976 @@
<template>
<v-layout>
<template>
<v-dialog v-model="dialogdeletealert" max-width="30%">
<v-card>
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
Peringatan !
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{ msgalert }}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialogdeletealert = false">
Tutup
</v-btn>
<v-btn color="primary" flat @click="closeDeleteAlert()">
Yakin lah
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<!-- Alert dialog Form Kosong Start -->
<v-dialog v-model="dialogalertshow" max-width="30%">
<v-card>
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
Peringatan Form Kosong!
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
<!-- <p id="error-break-line">{{ msgalertshow }}</p> -->
<p style="white-space:pre-wrap;">{{ msgalertshow }}</p>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialogalertshow = false">
Tutup
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<!-- End alert dialog Form Kosong End -->
<v-dialog v-model="dialogdokter" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="headline">FORM USER DOKTER</span></v-card-title>
<v-card-text class="pt-0 pb-0">
<v-form ref="formdokter" v-model="valid" lazy-validation>
<v-layout wrap>
<!-- dokter -->
<v-flex xs12>
<v-autocomplete label="Dokter*" v-model="xitemdokter" :items="xitemdokters"
:search-input.sync="search_autocomplete_dokter" auto-select-first no-filter
item-text="M_DoctorName" return-object :loading="isLoading"
no-data-text="Pilih Dokter" placeholder="Ketikkan minimal 3 karakter">
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.M_DoctorName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
</v-flex>
<!-- doctor id -->
<v-flex xs12>
<v-text-field v-model="xdoctorid" label="Doktor ID*" type="number"
readonly></v-text-field>
</v-flex>
<!-- username -->
<v-flex xs12>
<v-text-field v-model="xusername" label="Username*"></v-text-field>
</v-flex>
<!-- password -->
<v-flex xs12 v-if="xact === 'new'">
<v-text-field v-if="xact === 'new'" v-model="xpassword" type="password"
label="Password*"></v-text-field>
</v-flex>
<!-- konfirmasi password -->
<v-flex xs12 v-if="xact === 'new'">
<v-text-field v-if="xact === 'new'" v-model="xpasswordconfirm" type="password"
label="Konfirmasi Password*"></v-text-field>
</v-flex>
<!-- aggrement -->
<v-flex xs12>
<v-autocomplete label="Aggrement*" v-model="xitemmou" :items="xitemmous"
:search-input.sync="search_autocomplete_mou" auto-select-first no-filter
item-text="M_MouName" return-object :loading="isLoading"
no-data-text="Pilih Aggrement" placeholder="Ketikkan minimal 3 karakter">
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.M_MouName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
</v-flex>
<v-flex>
<p v-for="(xerror, idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">
{{ xerror.msg }}</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="updateDialogFormdokter()">Tutup</v-btn>
<v-btn v-if="xact === 'new'" color="blue darken-1" flat @click="saveFormdokter()">Simpan</v-btn>
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat @click="updateFormdokter()">Simpan
Perubahan</v-btn>
</v-card-actions>
</v-form>
</v-card>
</v-dialog>
</template>
<v-flex xs12>
<v-card>
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>USER DOKTER</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn @click="openFormdokter(0)" icon>
<v-icon>library_add</v-icon>
</v-btn>
</v-toolbar>
<v-snackbar v-model="snackbar" :timeout="5000" :multi-line="false" :vertical="false" :top="true">
{{ msgsnackbar }}
<v-btn flat @click="updateAlert_success(false)">
Tutup
</v-btn>
</v-snackbar>
<v-snackbar v-model="alerterror" :timeout="5000" :multi-line="false" :vertical="false" :top="true">
{{ msgerror }}
<v-btn flat @click="updateAlert_error(false)">
Tutup
</v-btn>
</v-snackbar>
<v-layout row style="background:#bbdefb;padding-top:5px;" justify-left>
<v-flex xs3>
<v-list-tile>
<input type="text" v-model="xsearch" class="textinput" label="Nama Spesialist"
placeholder="Cari ..." />
</v-list-tile-content>
</v-list-tile>
</v-flex>
<v-flex xs6>
<v-btn @click="doPrint()" small color="default" dark>cetak <v-icon small right
dark>print</v-icon></v-btn>
</v-flex>
</v-layout>
<v-divider></v-divider>
<div>
<v-layout row class="scroll-container" style="max-height:600px;overflow: auto;">
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="vdokters" :loading="isLoading" hide-actions
class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2"
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
{{ props.item.M_UserM_DoctorCode }}</td>
<td class="text-xs-left pa-2"
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
{{ props.item.M_DoctorName }}</td>
<td class="text-xs-left pa-2"
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
{{ props.item.M_UserUsername }}</td>
<td class="text-xs-left pa-2"
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
{{ props.item.M_MouName }}</td>
<td class="text-xs-left pa-2"
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
<v-icon small class="ml-3" color="primary"
@click="editdokter(props.item)">edit</v-icon>
<v-icon small class="ml-3" color="error"
@click="deletedokter(props.item)">clear</v-icon>
</td>
</template>
</v-data-table>
</v-flex>
<!-- print -->
<one-dialog-print :title="printtitle" :width="printwidth" :height="550" :status="openprintnote"
:urlprint="urlprintnote" @close-dialog-print="openprintnote = false"></one-dialog-print>
</v-layout>
<v-divider></v-divider>
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page"
:length="xtotal_page"></v-pagination>
</div>
</v-card>
</v-flex>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
.textinput {
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
background-color: white;
background-position: 10px 10px;
background-repeat: no-repeat;
padding-left: 40px;
width: 100%;
padding: 8px 10px;
margin-bottom: 5px;
box-sizing: border-box;
border: 1px solid #607d8b;
}
.textinput:focus {
width: 100%;
}
.textinput:focus::-webkit-input-placeholder {
color: transparent;
}
.textinput:focus::-moz-placeholder {
color: transparent;
}
.textinput:-moz-placeholder {
color: transparent;
}
.boxoutline {
color: red;
border: 1px solid red;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #ffffff;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxoutline:hover {
background: rgba(0, 0, 0, 0.07) !important;
font-size: 15px;
font-weight: 700;
}
.boxsolid {
color: #ffffff;
border: 1px solid #ffffff;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #f44336;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxsolid:hover {
background: #f44336de;
font-size: 15px;
font-weight: 700;
}
.scroll-container {
scroll-padding: 50px 0 0 50px;
}
::-webkit-scrollbar {
width: 7px;
}
/* this targets the default scrollbar (compulsory) */
::-webkit-scrollbar-track {
background-color: #73baf3;
}
/* the new scrollbar will have a flat appearance with the set background color */
::-webkit-scrollbar-thumb {
background-color: #2196f3;
}
/* this will style the thumb, ignoring the track */
::-webkit-scrollbar-button {
background-color: #0079da;
}
/* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
::-webkit-scrollbar-corner {
background-color: black;
}
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
</style>
<script>
module.exports = {
components: {
'one-dialog-print': httpVueLoader('../../../common/oneDialogPrintX.vue')
},
data() {
return {
urlprintnote: '',
printtitle: '',
printwidth: '80%',
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
dialogdeletealert: false,
msgalert: "",
valid: false,
xid: 0,
search_instrument: '',
items: [],
// tambahan
xdoctorid: '',
xusername: '',
xpassword: '',
xpasswordconfirm: '',
// dropdown dokter
search_autocomplete_dokter: '',
// dropdown mou
search_autocomplete_mou: '',
dialogalertshow: false,
msgalertshow: '',
msgalertshowobj: {},
xname: '',
xcode: '',
xnameRules: [
v => !!v || 'Nama harus diisi'
],
instrumentRules: [
v => !!v || 'Instrument harus dipilih'
],
name: '',
isdefault: false,
scode: '',
search_dokter: '',
search_testheader: '',
search_template: '',
page: 1,
headers: [
{
text: "DOCTOR ID",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "USERNAME",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "AGGREMENT",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "AKSI",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
}
],
pagination: {
descending: true,
page: 1,
rowsPerPage: 100,
sortBy: 'M_UserID DESC',
totalItems: this.$store.state.dokter.total_filter_dokters
}
};
},
mounted() {
this.$store.dispatch("dokter/search", {
search: this.xsearch,
search: this.$store.state.dokter.x_search,
current_page: 1,
lastid: -1
})
// dropdown item dokter initial load
this.$store.dispatch("dokter/searchdokterautocomplete", this.search_autocomplete_dokter)
// dropdown item mou initial load
// this.$store.dispatch("dokter/searchmouautocomplete", this.search_autocomplete_mou)
},
computed: {
// dropdown dokter
xitemdokters() {
return this.$store.state.dokter.itemdokters
},
xitemdokter: {
get() {
return this.$store.state.dokter.itemdokter
},
set(val) {
this.$store.commit("dokter/update_itemdokter", val)
// set doctor code
!_.isEmpty(val) ? this.xdoctorid = val.M_DoctorCode : this.xdoctorid = ''
}
},
// dropdown mou
xitemmous() {
return this.$store.state.dokter.itemmous
},
xitemmou: {
get() {
// console.log('item mou ', this.$store.state.dokter.itemmou)
return this.$store.state.dokter.itemmou
},
set(val) {
this.$store.commit("dokter/update_itemmou", val)
}
},
xact() {
return this.$store.state.dokter.act
},
xerrors() {
return this.$store.state.dokter.errors
},
xshowall() {
return this.$store.state.dokter.show_all
},
vdokters() {
return this.$store.state.dokter.dokters
},
xtotaldokters() {
return this.$store.state.dokter.total_dokters
},
xtotalfilterdokters() {
return this.$store.state.dokter.total_filter_dokters
},
xsearch: {
get() {
return this.$store.state.dokter.x_search
},
set(val) {
this.$store.commit("dokter/update_x_search", val)
}
},
curr_page: {
get() {
return this.$store.state.dokter.current_page
},
set(val) {
this.$store.commit("dokter/update_current_page", val)
this.$store.dispatch("dokter/search", {
search: this.xsearch,
search: this.$store.state.dokter.x_search,
current_page: val,
lastid: -1
})
}
},
xtotal_page: {
get() {
return this.$store.state.dokter.total_dokters
},
set(val) {
this.$store.commit("dokter/update_total_dokters", val)
}
},
dialogdokter() {
return this.$store.state.dokter.dialog_form_dokter
},
snackbar: {
get() {
return this.$store.state.dokter.alert_success
},
set(val) {
this.$store.commit("dokter/update_alert_success", val)
}
},
msgsnackbar() {
return this.$store.state.dokter.msg_success
},
// error
alerterror: {
get() {
return this.$store.state.dokter.alert_error
},
set(val) {
this.$store.commit("dokter/update_alert_error", val)
}
},
msgerror() {
return this.$store.state.dokter.msg_error
},
lookupstatus() {
return this.$store.state.dokter.lookup_dokter
},
isLoading() {
return this.$store.state.dokter.search_status == 1
},
// print
openprintnote: {
get() {
return this.$store.state.dokter.open_print_note
},
set(val) {
this.$store.commit("dokter/update_open_print_note", false)
}
}
},
methods: {
isSelected(p) {
return p.id == this.$store.state.dokter.selected_dokter.M_UserID
},
selectMe(sc) {
this.$store.commit("dokter/update_selected_dokter", sc)
},
updateDialogFormdokter() {
this.$store.commit("dokter/update_dialog_form_dokter", false)
},
openFormdokter() {
// this.xcode = ""
// this.xname = ""
this.xusername = ""
this.xpassword = ""
this.xpasswordconfirm = ""
this.xdoctorid = ""
// this.isdefault = "N"
this.$store.commit("dokter/update_itemdokters", [
{
M_DoctorID: '',
M_DoctorName: ''
}
])
this.$store.commit("dokter/update_itemdokter",
{
M_DoctorID: '',
M_DoctorName: ''
}
)
if (this.xact == 'new') {
// console.log('update xact ',this.xact)
this.$store.commit("dokter/update_itemmous", [
{
M_MouID: '',
M_MouName: ''
}
])
this.$store.commit("dokter/update_itemmou",
{
M_MouID: '',
M_MouName: ''
}
)
}
this.$refs.formdokter.reset()
this.$refs.formdokter.resetValidation()
this.$store.commit("dokter/update_act", 'new')
this.$store.commit("dokter/update_dialog_form_dokter", true)
},
// thr_search_instrument: _.debounce(function () {
// this.$store.dispatch("dokter/searchinstrument", {
// tes: this.search_instrument
// })
// }, 2000),
// tambahan
// dropdown item dokter
thr_search_autocomplete_dokter: _.debounce(function () {
this.$store.dispatch("dokter/searchdokterautocomplete", this.search_autocomplete_dokter)
}, 2000),
// dropdown item mou
thr_search_autocomplete_mou: _.debounce(function () {
this.$store.dispatch("dokter/searchmouautocomplete", this.search_autocomplete_mou)
}, 2000),
saveFormdokter() {
this.msgalertshow = ''
// var prm = {};
// console.log(this.xitemdokter.M_DoctorID)
// prm = {
// M_UserUsername: this.xusername,
// M_UserPassword: this.xpassword,
// M_UserM_DoctorID : this.xitemdokter.M_DoctorID
// };
// console.log(prm);
if (_.isEmpty(this.xitemdokter)) {
this.msgalertshow = 'Anda belum memilih dokter'
// this.error_form = true
this.dialogalertshow = true
} else {
if (_.isEmpty(this.xdoctorid)) {
this.msgalertshow = 'Anda belum mengisi doctor id'
// this.error_form = true
this.dialogalertshow = true
} else {
if (_.isEmpty(this.xusername)) {
this.msgalertshow = 'Anda belum mengisi username'
// this.error_form = true
this.dialogalertshow = true
} else {
if (_.isEmpty(this.xpassword)) {
this.msgalertshow = 'Anda belum mengisi password'
// this.error_form = true
this.dialogalertshow = true
} else {
if (_.isEmpty(this.xpasswordconfirm)) {
this.msgalertshow = 'Anda belum mengisi konfirmasi password'
// this.error_form = true
this.dialogalertshow = true
} else {
if (_.isEmpty(this.xitemmou)) {
this.msgalertshow = 'Anda belum memilih aggrement'
// this.error_form = true
this.dialogalertshow = true
} else {
// if (this.xdoctorid == this.xusername) {
// this.msgalertshow = 'doctor id dan username tidak boleh sama'
// // this.error_form = true
// this.dialogalertshow = true
// } else {
if (this.xpassword == this.xpasswordconfirm) {
// console.log('masuk sini')
this.$store.dispatch("dokter/save", {
// name: this.xname,
search: this.xsearch,
username: this.xusername,
password: this.xpassword,
confirm_password: this.xpasswordconfirm,
id_doctor_prm: this.xitemdokter.M_DoctorID,
id_mou: this.xitemmou.M_MouID,
doctor_id: this.xdoctorid,
// sdokter: this.xsearch,
// sdokter: this.$store.state.dokter.x_search
})
} else {
this.msgalertshow = 'password dan konfirmasi password harus sama'
// this.error_form = true
this.dialogalertshow = true
}
// }
}
}
}
}
}
}
// if (this.$refs.formdokter.validate()) {
// }
},
updateFormdokter() {
// if (this.$refs.formdokter.validate()) {
this.msgalertshow = ''
if (_.isEmpty(this.xitemdokter)) {
this.msgalertshow = 'Anda belum memilih dokter'
// this.error_form = true
this.dialogalertshow = true
} else {
if (_.isEmpty(this.xdoctorid)) {
this.msgalertshow = 'Anda belum mengisi doctor id'
// this.error_form = true
this.dialogalertshow = true
} else {
if (_.isEmpty(this.xusername)) {
this.msgalertshow = 'Anda belum mengisi username'
// this.error_form = true
this.dialogalertshow = true
} else {
if (_.isEmpty(this.xitemmou)) {
this.msgalertshow = 'Anda belum memilih aggrement'
// this.error_form = true
this.dialogalertshow = true
} else {
// if (this.xdoctorid == this.xusername) {
// this.msgalertshow = 'doctor id dan username tidak boleh sama'
// // this.error_form = true
// this.dialogalertshow = true
// } else {
if (this.xpassword == this.xpasswordconfirm) {
// console.log('masuk sini')
// console.log("current page : ", this.$store.state.dokter.current_page)
// console.log("current page x : ", this.$store.state.dokter.curr_page)
this.$store.dispatch("dokter/update", {
// name: this.xname,
id: this.xid,
search: this.xsearch,
search:this.$store.state.dokter.x_search,
username: this.xusername,
id_doctor_prm: this.xitemdokter.M_DoctorID,
id_mou: this.xitemmou.M_MouID,
doctor_id: this.xdoctorid,
curr_pagex: this.$store.state.dokter.current_page
// sdokter: this.xsearch,
// sdokter: this.$store.state.dokter.x_search
})
} else {
this.msgalertshow = 'password dan konfirmasi password harus sama'
// this.error_form = true
this.dialogalertshow = true
}
// }
}
}
}
}
// }
},
updateAlert_success(val) {
this.$store.commit("dokter/update_alert_success", val)
},
// error backend
updateAlert_error(val) {
this.$store.commit("dokter/update_alert_error", val)
this.alerterror = false
},
editdokter(data) {
// console.log("edit data ", data)
this.xid = data.id
// this.xcode = data.code
// dropdown dokter
this.$store.commit("dokter/update_itemdokters", [
{
M_DoctorID: data.M_UserM_DoctorID,
M_DoctorName: data.M_DoctorName
}
])
this.$store.commit("dokter/update_itemdokter",
{
M_DoctorID: data.M_UserM_DoctorID,
M_DoctorName: data.M_DoctorName
}
)
// this.xname = data.name
this.xusername = data.M_UserUsername
this.xdoctorid = data.M_UserM_DoctorCode
// dropdown mou
// if (data.M_MouID !== "") {
// console.log("update mou", data)
this.$store.commit("dokter/update_itemmous", [
{
M_MouID: data.M_MouID,
M_MouName: data.M_MouName
}
])
this.$store.commit("dokter/update_itemmou",
{
M_MouID: data.M_MouID,
M_MouName: data.M_MouName
}
)
// }
// this.xitemmous.M_MouID = data.M_MouID
// this.xitemmous.M_MouName = data.M_MouName
// this.$store.commit("dokter/update_itemmou",
// {
// M_MouID: data.M_MouID,
// M_MouName: data.M_MouName
// }
// )
// this.xpassword = data.M_UserPassword
// this.isdefault = data.T_dokterIsDefault === 'N' ? false : true
this.$store.commit("dokter/update_act", 'edit')
this.$store.commit("dokter/update_dialog_form_dokter", true)
},
deletedokter(data) {
this.xid = data.id
var xdata = {
id: data.id,
M_UserUsername: data.M_UserUsername,
// dokters: 'xxx'
}
this.$store.commit("dokter/update_selected_dokter", xdata)
this.msgalert = "Yakin, mau hapus dokter " + data.M_UserUsername + " ?"
this.dialogdeletealert = true
},
closeDeleteAlert() {
// console.log(this.$store.state.dokter.selected_dokter.id)
this.$store.dispatch("dokter/delete", {
id: this.$store.state.dokter.selected_dokter.id,
M_UserUsername: this.$store.state.dokter.selected_dokter.M_UserUsername
})
this.dialogdeletealert = false
},
thr_search: _.debounce(function () {
this.$store.dispatch("dokter/search", {
search: this.xsearch,
search: this.$store.state.dokter.x_search,
current_page: 1,
lastid: -1
})
}, 1000),
// print
doPrint() {
const d = new Date();
let time = d.getTime();
let user = one_user()
console.log(user)
this.printwidth = 1200
this.printtitle = ""
let rpt = 'rpt_user_doctor'
this.urlprintnote = "/birt/run?__report=report/one/regional/" + rpt + ".rptdesign&__format=pdf&username=" + user.M_UserUsername + "&PID=" + user.M_UserID + "&tm=" + time
this.$store.commit("dokter/update_open_print_note", true)
}
},
watch: {
xsearch(val, old) {
// console.log(val)
this.xsearch = val
this.thr_search()
},
// autocomplete dokter
search_autocomplete_dokter(val, old) {
// console.log(this.$store.state.dokter.update_autocomplete_status)
if (val == old) return
if (!val) return
if (val.length < 1) {
// console.log('cek dropdown dokter');
// console.log("test search dropdown item dokter length < 1")
this.$store.dispatch("dokter/searchdokterautocomplete", this.search_autocomplete_dokter)
return this.thr_search_autocomplete_dokter()
}
// setelah di search load data max 10 item sesuai filter
if (val.length > 2) {
// console.log('cek dropdown dokter');
// console.log("test search dropdown item dokter");
// if (this.$store.state.item.update_autocomplete_status == 1) {
this.$store.dispatch("dokter/searchdokterautocomplete", this.search_autocomplete_dokter)
return this.thr_search_autocomplete_dokter()
// }
}
},
// autocomplete mou
search_autocomplete_mou(val, old) {
// console.log(this.$store.state.dokter.update_autocomplete_status)
if (val == old) return
if (!val) return
// if (val.length < 1) {
// console.log('cek dropdown mou');
// // console.log("test search dropdown item mou length < 1")
// this.$store.dispatch("dokter/searchmouautocomplete", this.search_autocomplete_mou)
// return this.thr_search_autocomplete_mou()
// }
// setelah di search load data max 10 item sesuai filter
if (val.length >= 2) {
// console.log('cek dropdown mou',val);
// console.log("test search dropdown item mou", val);
// if (this.$store.state.item.update_autocomplete_status == 1) {
// this.$store.dispatch("dokter/searchmouautocomplete", this.search_autocomplete_mou)
return this.thr_search_autocomplete_mou()
// }
}
},
}
}
</script>

View File

@@ -0,0 +1,70 @@
<!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 xs12 class="left" fill-height pa-1>
<one-md-dokter-list></one-md-dokter-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>
<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,
el: '#app',
components: {
'one-navbar': httpVueLoader('../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../apps/components/oneFooter.vue'),
'one-md-dokter-list': httpVueLoader('./components/oneDokterList.vue')
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {
}
.right {
}
</style>
</body>
</html>

View File

@@ -0,0 +1,412 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/dokter.js"
export default {
namespaced: true,
state: {
last_id: -1,
act: 'new',
lookup_dokter: 0,
lookup_error_message: '',
dokters: [],
total_dokters: 0,
total_filter_dokters: 0,
selected_dokter: {
name: ""
},
save_status: 0,
save_error_message: '',
dialog_form_dokter: false,
dialog_edit_form_dokter: false,
alert_success: false,
alert_error: false,
msg_success: "",
msg_error:"",
show_all: 'N',
errors: [],
doktertypes: [],
doktertype: {},
doctors: [],
doctor: {},
get_data_status: 0,
get_data_error_message: '',
cities: [],
doctor_address: {},
autocomplete_status: 0,
search_status: 0,
districts: [],
district_address: {},
kelurahans: [],
kelurahan_address: {},
instruments: [],
instrument: {},
autotemplates: [],
autotemplate: {},
nonlabs: [],
selected_nonlab: {},
current_page:1,
x_search: '',
// dropdown dokter
itemdokters:[],
itemdokter:{},
// dropdown mou
itemmous:[],
itemmou:{},
open_print_note: false
},
mutations: {
// tambahan dokter
update_itemdokter(state, val) {
state.itemdokter = val
},
update_itemdokters(state, val) {
state.itemdokters = val
},
// tambahan mou
update_itemmou(state, val) {
state.itemmou = val
},
update_itemmous(state, val) {
// console.log("update itemmous",val)
// console.log()
state.itemmous = val
},
update_x_search(state, val) {
state.x_search = val
},
update_current_page(state, val) {
state.current_page = val
},
update_last_id(state, val) {
state.last_id = val
},
update_act(state, val) {
state.act = val
},
update_errors(state, val) {
state.errors = val
},
update_show_all(state, val) {
state.show_all = val
},
update_lookup_error_message(state, status) {
state.lookup_error_message = status
},
update_lookup_dokter(state, status) {
state.lookup_dokter = status
},
update_dokters(state, data) {
state.dokters = data.records
state.total_dokters = data.total
state.total_filter_dokters = data.total_filter
},
update_selected_dokter(state, val) {
state.selected_dokter = val
},
update_save_status(state, val) {
state.save_status = val
},
update_save_error_message(state, val) {
state.save_error_message = val
},
update_dialog_form_dokter(state, val) {
state.dialog_form_dokter = val
},
update_dialog_edit_form_dokter(state, val) {
state.dialog_edit_form_dokter = val
},
update_alert_success(state, val) {
state.alert_success = val
},
update_msg_success(state, val) {
state.msg_success = val
},
// error
update_alert_error(state, val) {
state.alert_error = val
},
update_msg_error(state, val) {
state.msg_error = val
},
update_doktertypes(state, data) {
state.doktertypes = data
},
update_doktertype(state, val) {
state.doktertype = val
},
update_doctors(state, data) {
state.doctors = data
},
update_doctor(state, val) {
state.doctor = val
},
update_get_data_status(state, val) {
state.get_data_status = val
},
update_get_data_error_message(state, val) {
state.get_data_error_message = val
},
update_cities(state, val) {
state.cities = val
},
update_doctor_address(state, val) {
state.doctor_address = val
},
update_autocomplete_status(state, val) {
state.autocomplete_status = val
},
update_districts(state, val) {
state.districts = val
},
update_district_address(state, val) {
state.district_address = val
},
update_kelurahans(state, val) {
state.kelurahans = val
},
update_kelurahan_address(state, val) {
state.kelurahan_address = val
},
update_instruments(state, data) {
state.instruments = data
},
update_instrument(state, val) {
state.instrument = val
},
update_autotemplates(state, data) {
state.autotemplates = data
},
update_autotemplate(state, val) {
state.autotemplate = val
},
update_nonlabs(state, val) {
state.nonlabs = val
},
update_selected_nonlab(state, val) {
state.selected_nonlab = val
},
// print
update_open_print_note(state, val) {
state.open_print_note = val
}
},
actions: {
async search(context, prm) {
context.commit("update_lookup_dokter", 1)
try {
prm.token = one_token()
let resp = await api.search(prm)
if (resp.status != "OK") {
context.commit("update_lookup_dokter", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_dokter", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_dokters", data)
}
} catch (e) {
context.commit("update_lookup_dokter", 3)
context.commit("update_lookup_error_message", e.message)
}
},
// dokter autocomplete
async searchdokterautocomplete(context, prm) {
// console.log("module");
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchdokterautocomplete(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_itemdokters", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
// mou autocomplete
async searchmouautocomplete(context, prm) {
// console.log("module", prm);
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchmouautocomplete(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_itemmous", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async save(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.add(prm)
if (resp.status != "OK") {
context.commit("update_alert_error", true)
console.log(resp.message)
context.commit("update_msg_error", resp.message)
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
// context.commit("update_errors", resp.data.errors)
context.commit("update_alert_success", true)
context.commit("update_dialog_form_dokter", false)
var msg = " " + resp.message;
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_save_error_message", resp.message)
var data = {
records: resp.data.records,
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_errors", [])
context.commit("update_alert_success", true)
context.commit("update_dialog_form_dokter", false)
var msg =" dokter " + prm.username + " sudah tersimpan dong ..."
context.commit("update_msg_success", msg)
context.dispatch("search", {
// dokter: prm.sdokter,
search: "",
current_page: 1,
lastid: -1
})
// context.dispatch("search", {
// search: prm.M_UserUsername,
// current_page: 1,
// lastid: -1
// })
} else {
context.commit("update_errors", resp.data.errors)
}
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async update(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.update(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
// // context.commit("update_errors", resp.data.errors)
// context.commit("update_alert_success", true)
// context.commit("update_dialog_form_dokter", false)
// var msg = " " + resp.message;
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_save_error_message", resp.message)
let data = {
records: resp.data.records,
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_alert_success", true)
context.commit("update_dialog_form_dokter", false)
var msg = " dokter " + prm.username + " sudah terupdate dong ..."
context.commit("update_msg_success", msg)
// console.log("current page : ", prm.curr_pagex)
context.dispatch("search", {
search: "",
// search: this.$store.state.dokter.x_search,
// current_page: 1,
current_page: prm.curr_pagex,
lastid: -1
})
}else {
context.commit("update_msg_success", msg)
}
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async delete(context, prm) {
context.commit("update_save_status", 1)
try {
let resp = await api.xdelete(one_token(), prm.id)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_alert_success", true)
var msg = " dokter " + prm.M_UserUsername + " sudah dihapus dong"
context.commit("update_msg_success", msg)
context.commit("update_alert_success", true)
context.commit("update_selected_dokter", {})
// context.dispatch("search", {
// search: prm.M_UserUsername,
// search: this.$store.state.dokter.x_search,
// current_page: 1,
// lastid: -1
// })
context.dispatch("search", {
// search: prm.M_UserUsername,
search: "",
current_page: 1,
lastid: -1
})
}
} catch (e) {
context.commit("update_save_status", 3)
console.log(e)
}
},
}
}

View File

@@ -0,0 +1,26 @@
// State
// data ...
// Mutations
//
//
// Actions
import system from "../../apps/modules/system/system.js";
// dokter
import dokter from "./modules/dokter.js";
export const store = new Vuex.Store({
modules: {
system:system,
dokter:dokter
},
state: {
},
mutations: {
},
actions: {
}
});