Initial import
This commit is contained in:
162
one-ui/masterdata/one-md-pola-kelainan-nonlab-v2/api/kelainan.js
Normal file
162
one-ui/masterdata/one-md-pola-kelainan-nonlab-v2/api/kelainan.js
Normal file
@@ -0,0 +1,162 @@
|
||||
const URL = "/one-api/mockup/masterdata/polakelainannonlab/";
|
||||
|
||||
export async function search(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "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 searchtest(token, prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "searchtest", {
|
||||
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 searchstatusresult(token, prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "searchstatusresult", {
|
||||
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 searchkelainan(token, prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "searchkelainan", {
|
||||
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 + "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 edit(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "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 deleterow(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "deleterow", 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 getfitness(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "getfitness", 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,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,812 @@
|
||||
<template>
|
||||
<v-layout>
|
||||
<!-- Alert dialog -->
|
||||
<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="deleteRow()">
|
||||
Yakin lah
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<!-- End alert dialog -->
|
||||
<!-- 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 -->
|
||||
|
||||
<!-- Form Dialog -->
|
||||
<v-dialog v-model="dialog_form" persistent width="50%">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="title">Form Input Summary Kelainan Non Lab</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-autocomplete :disabled="isEdit" label="Nama Pemeriksaan*" :items="xtests" v-model="vtest"
|
||||
:search-input.sync="search_item_test" auto-select-first no-filter
|
||||
item-text="codeNameTest" return-object no-data-text="Pilih Nama Pemeriksaan" clearable
|
||||
:error="test_error_message !== ''" :error-messages="test_error_message"
|
||||
@blur="testValidation">
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.codeNameTest"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<v-autocomplete :disabled="isEdit" label="Kelainan*" :items="xdatakelainans"
|
||||
v-model="vdatakelainan" :search-input.sync="search_item_datakelainan" auto-select-first
|
||||
no-filter item-text="Mcu_KelainanName" return-object no-data-text="Pilih Nama Kelainan"
|
||||
clearable :error="kelainan_error_message !== ''"
|
||||
:error-messages="kelainan_error_message" @blur="kelainanValidation">
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.Mcu_KelainanName"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
<v-card-text class="pt-0 pb-3">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<v-select
|
||||
:error="fitness_error_message !== ''"
|
||||
:error-messages="fitness_error_message" @blur="fitnessValidation"
|
||||
v-model="vdatafitness"
|
||||
:items="xdatafitness"
|
||||
item-text="fitnessname"
|
||||
item-value="Mcu_FitnessCategoryID"
|
||||
return-object label="Pilih Fitness Kategori">
|
||||
</v-select>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<v-layout>
|
||||
<v-flex xs7 pa-1>
|
||||
<v-autocomplete label="Nilai" v-model="xorderautostatusresult"
|
||||
:items="xorderautostatusresults" :search-input.sync="search_statusresult"
|
||||
auto-select-first no-filter item-text="NonlabConclusionDetailName" return-object
|
||||
no-data-text="Cari Nilai" outline small>
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title
|
||||
v-text="item.NonlabConclusionDetailName"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs5 pa-1>
|
||||
<v-btn @click="addStatus()" color="blue en-3">Tambah Nilai</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-flex>
|
||||
|
||||
<v-flex v-for="(vst, idx) in xorderstatusresults" :key="vst.NonlabConclusionDetailID">
|
||||
<v-btn class="mt-1 mb-2" @click="deleteDataStatus(idx)" small dark :color="'green'">
|
||||
<v-icon left>close</v-icon>{{ vst.NonlabConclusionDetailName }}</v-btn>
|
||||
</v-flex>
|
||||
|
||||
</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 v-if="xact === 'add'" color="primary" flat :disabled="loading_save"
|
||||
@click="saveAdd()">Simpan</v-btn>
|
||||
<v-btn v-if="xact === 'edit'" color="primary" flat :disabled="loading_save"
|
||||
@click="saveEdit()">Simpan
|
||||
Perubahan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<!-- End Form Dialog -->
|
||||
|
||||
<v-flex xs12>
|
||||
<v-card class="mb-2" color="white">
|
||||
<v-toolbar color="blue lighten-3" dark height="50px">
|
||||
<v-toolbar-title>Master Summary Kelainan Non Lab</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="openForm(0)" icon>
|
||||
<v-icon>library_add</v-icon>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
<v-layout row style="background:white;padding-top:5px;padding-left: 2px;">
|
||||
<v-layout row justify-left>
|
||||
<v-flex xs3>
|
||||
<v-text-field class="ma-1" label="Cari" placeholder="Cari Pemeriksaan atau Kelainan" outline
|
||||
v-model="xsearch" hide-details></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row class="scroll-container" style="max-height:645px;overflow: auto;">
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table :headers="headers" :items="xkelainanlab" :loading="isLoading" hide-actions
|
||||
class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-center pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)">{{ props.item.rownumber }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)">{{ props.item.codeNameTest }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)">
|
||||
{{ props.item.Mcu_KelainanName }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)">
|
||||
<v-layout row wrap>
|
||||
<v-flex v-for="(p, i) in props.item.xvalue" v-bind:key="i">
|
||||
<v-btn class="mt-1 mb-2" small dark :color="'green'">{{
|
||||
p.NonlabConclusionDetailName }}</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</td>
|
||||
<td class="text-xs-center pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)">
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon v-bind="attrs" v-on="on" class="mr-3" @click="openEdit(props.item)"
|
||||
color="primary">edit
|
||||
</v-icon>
|
||||
</template>
|
||||
<span>Edit</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon v-bind="attrs" v-on="on" @click="confirmDelete(props.item)"
|
||||
color="error">delete
|
||||
</v-icon>
|
||||
</template>
|
||||
<span>Hapus</span>
|
||||
</v-tooltip>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
<v-divider></v-divider>
|
||||
<v-layout>
|
||||
<v-flex>
|
||||
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page"
|
||||
:length="xtotal_page">
|
||||
</v-pagination>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-card>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.dot-text {
|
||||
position: relative;
|
||||
padding-left: 1.5em;
|
||||
/* Menambahkan padding untuk memberi ruang pada titik */
|
||||
}
|
||||
|
||||
.dot-text::before {
|
||||
content: '•';
|
||||
/* Menambahkan titik di depan teks */
|
||||
position: absolute;
|
||||
left: 1em;
|
||||
/* Atur posisi titik */
|
||||
top: 0;
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
search_item_test: "",
|
||||
search_item_datakelainan: "",
|
||||
search_item_datafitness: "",
|
||||
xOperatorPerbandingan: "",
|
||||
nilaiPerbandingan: "",
|
||||
test_error_message: "",
|
||||
kelainan_error_message: "",
|
||||
fitness_error_message: "",
|
||||
operatorPerbandingan_error_message: "",
|
||||
clr: "success",
|
||||
xid: "",
|
||||
vtestcode: "",
|
||||
dialogdeletealert: false,
|
||||
msgalert: "",
|
||||
search_statusresult: "",
|
||||
headers: [{
|
||||
text: "NO",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "5%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "PEMERIKSAAN",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "KELAINAN",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "STATUS NILAI",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "40%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "AKSI",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}]
|
||||
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("kelainan/search")
|
||||
this.$store.dispatch("kelainan/getfitness")
|
||||
},
|
||||
computed: {
|
||||
xdatafitness() {
|
||||
return this.$store.state.kelainan.fitness
|
||||
},
|
||||
vdatafitness: {
|
||||
get() {
|
||||
return this.$store.state.kelainan.selected_fitness
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("kelainan/update_selected_fitness", val)
|
||||
}
|
||||
},
|
||||
isEdit() {
|
||||
return this.xact === 'edit';
|
||||
},
|
||||
xkelainanlab() {
|
||||
return this.$store.state.kelainan.kelainanlab
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.kelainan.search_status == 1
|
||||
},
|
||||
curr_page: {
|
||||
get() {
|
||||
return this.$store.state.kelainan.current_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("kelainan/update_current_page", val)
|
||||
this.$store.commit("kelainan/update_last_id", -1)
|
||||
this.$store.dispatch("kelainan/search")
|
||||
}
|
||||
},
|
||||
xtotal_page: {
|
||||
get() {
|
||||
return this.$store.state.kelainan.total_kelainanlab_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("kelainan/update_total_kelainanlab_page", val)
|
||||
}
|
||||
},
|
||||
xsearch: {
|
||||
get() {
|
||||
return this.$store.state.kelainan.x_search
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("kelainan/update_x_search", val)
|
||||
}
|
||||
},
|
||||
dialog_form: {
|
||||
get() {
|
||||
return this.$store.state.kelainan.dialog_form
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("kelainan/update_dialog_form", val)
|
||||
},
|
||||
},
|
||||
loading_save: {
|
||||
get() {
|
||||
return this.$store.state.kelainan.loading_save
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("kelainan/update_loading_save", val)
|
||||
},
|
||||
},
|
||||
xact: {
|
||||
get() {
|
||||
return this.$store.state.kelainan.act
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("kelainan/update_act", val)
|
||||
}
|
||||
},
|
||||
xtests() {
|
||||
return this.$store.state.kelainan.tests
|
||||
},
|
||||
vtest: {
|
||||
get() {
|
||||
return this.$store.state.kelainan.selected_test
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("kelainan/update_selected_test", val)
|
||||
}
|
||||
},
|
||||
xdatakelainans() {
|
||||
return this.$store.state.kelainan.datakelainans
|
||||
},
|
||||
vdatakelainan: {
|
||||
get() {
|
||||
return this.$store.state.kelainan.selected_datakelainan
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("kelainan/update_selected_datakelainan", val)
|
||||
}
|
||||
},
|
||||
isNilaiNormal: {
|
||||
get() {
|
||||
return this.$store.state.kelainan.selected_isNilaiNormal
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("kelainan/update_selected_isNilaiNormal", val)
|
||||
}
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.kelainan.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("kelainan/update_alert_success", val)
|
||||
}
|
||||
},
|
||||
msgsnackbar() {
|
||||
return this.$store.state.kelainan.msg_success
|
||||
},
|
||||
dialog_error: {
|
||||
get() {
|
||||
return this.$store.state.kelainan.alert_error
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("kelainan/update_alert_error", val)
|
||||
},
|
||||
},
|
||||
msgError() {
|
||||
return this.$store.state.kelainan.error_message
|
||||
},
|
||||
message_existing: {
|
||||
get() {
|
||||
return this.$store.state.kelainan.message_existing
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("kelainan/update_message_existing", val)
|
||||
},
|
||||
},
|
||||
xorderautostatusresults() {
|
||||
return this.$store.state.kelainan.orderautostatusresults
|
||||
},
|
||||
xorderautostatusresult: {
|
||||
get() {
|
||||
return this.$store.state.kelainan.orderautostatusresult
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("kelainan/update_orderautostatusresult", val)
|
||||
}
|
||||
},
|
||||
xorderstatusresults() {
|
||||
return this.$store.state.kelainan.orderstatusresults
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isSelected(p) {
|
||||
return p.Mcu_SummaryNonlabID == this.$store.state.kelainan.selected_kelainanlab.Mcu_SummaryNonlabID
|
||||
},
|
||||
selectMe(selected) {
|
||||
this.$store.commit("kelainan/update_selected_kelainanlab", selected)
|
||||
this.$store.commit("kelainan/update_last_id", selected.Mcu_SummaryNonlabID)
|
||||
|
||||
// set value selected test
|
||||
this.$store.commit("kelainan/update_tests", [
|
||||
{
|
||||
Nat_TestID: selected.Nat_TestID,
|
||||
codeNameTest: selected.codeNameTest,
|
||||
Nat_TestCode: selected.Nat_TestCode
|
||||
}
|
||||
])
|
||||
this.$store.commit("kelainan/update_selected_test", {
|
||||
Nat_TestID: selected.Nat_TestID,
|
||||
codeNameTest: selected.codeNameTest,
|
||||
Nat_TestCode: selected.Nat_TestCode
|
||||
})
|
||||
|
||||
// set value selected kelainan
|
||||
this.$store.commit("kelainan/update_datakelainans", [
|
||||
{
|
||||
Mcu_KelainanID: selected.Mcu_KelainanID,
|
||||
Mcu_KelainanName: selected.Mcu_KelainanName
|
||||
}
|
||||
])
|
||||
this.$store.commit("kelainan/update_selected_datakelainan", {
|
||||
Mcu_KelainanID: selected.Mcu_KelainanID,
|
||||
Mcu_KelainanName: selected.Mcu_KelainanName
|
||||
})
|
||||
|
||||
// set value selected fitness
|
||||
this.$store.commit("kelainan/update_fitness", [
|
||||
{
|
||||
Mcu_FitnessCategoryID: selected.Mcu_FitnessCategoryID,
|
||||
fitnessname: selected.fitnessname
|
||||
}
|
||||
])
|
||||
this.$store.commit("kelainan/update_selected_fitness", {
|
||||
Mcu_FitnessCategoryID: selected.Mcu_FitnessCategoryID,
|
||||
fitnessname: selected.fitnessname
|
||||
})
|
||||
|
||||
this.$store.dispatch("kelainan/getfitness")
|
||||
},
|
||||
thr_search: _.debounce(function () {
|
||||
this.$store.dispatch("kelainan/search")
|
||||
}, 1000),
|
||||
thr_search_test: _.debounce(function () {
|
||||
this.$store.dispatch("kelainan/searchtest", this.search_item_test)
|
||||
}, 2000),
|
||||
thr_search_datakelainan: _.debounce(function () {
|
||||
this.$store.dispatch("kelainan/searchkelainan", this.search_item_datakelainan)
|
||||
}, 2000),
|
||||
thr_search_statusresult: _.debounce(function () {
|
||||
this.$store.dispatch("kelainan/search_statusresult", this.search_statusresult)
|
||||
}, 2000),
|
||||
testValidation() {
|
||||
if (_.isEmpty(this.vtest)) {
|
||||
this.test_error_message = 'Anda belum memilih pemeriksaan'
|
||||
}
|
||||
if (this.vtest) {
|
||||
this.test_error_message = ""
|
||||
}
|
||||
},
|
||||
addStatus() {
|
||||
var oldArr = this.$store.state.kelainan.orderstatusresults
|
||||
oldArr.push(this.$store.state.kelainan.orderautostatusresult)
|
||||
this.search_statusresult = ''
|
||||
this.$store.commit("kelainan/update_orderautostatusresults", [])
|
||||
this.$store.commit("kelainan/update_orderautostatusresult", {})
|
||||
},
|
||||
deleteDataStatus(idx) {
|
||||
var inx = parseInt(idx);
|
||||
var xrow = this.$store.state.kelainan.orderstatusresults[inx]
|
||||
if (parseInt(xrow.xid) !== 0) {
|
||||
var xdeltest = this.$store.state.kelainan.deleted_orderstatusresults
|
||||
xdeltest.push(xrow)
|
||||
this.$store.commit("kelainan/update_deleted_orderstatusresults", xdeltest)
|
||||
}
|
||||
var oldArr = this.$store.state.kelainan.orderstatusresults
|
||||
oldArr.splice(inx, 1)
|
||||
this.$store.commit("kelainan/update_orderstatusresults", oldArr)
|
||||
},
|
||||
kelainanValidation() {
|
||||
if (_.isEmpty(this.vdatakelainan)) {
|
||||
this.kelainan_error_message = 'Anda belum memilih kelainan'
|
||||
}
|
||||
if (this.vdatakelainan) {
|
||||
this.kelainan_error_message = ""
|
||||
}
|
||||
},
|
||||
operatorValidation() {
|
||||
if (_.isEmpty(this.xOperatorPerbandingan)) {
|
||||
this.operatorPerbandingan_error_message = 'Anda belum memilih operator perbandingan'
|
||||
}
|
||||
if (this.xOperatorPerbandingan) {
|
||||
this.operatorPerbandingan_error_message = ""
|
||||
}
|
||||
},
|
||||
fitnessValidation() {
|
||||
if (_.isEmpty(this.vdatafitness)) {
|
||||
this.fitness_error_message = 'Anda belum memilih fitness'
|
||||
}
|
||||
if (this.vdatafitness) {
|
||||
this.fitness_error_message = ""
|
||||
}
|
||||
},
|
||||
resetAllInput() {
|
||||
this.vtest = ""
|
||||
this.vdatakelainan = ""
|
||||
this.vdatafitness = ""
|
||||
this.xorderstatusresults = [{NonlabConclusionDetailID:"0",NonlabConclusionDetailCode:"",NonlabConclusionDetailName:""}]
|
||||
this.test_error_message = ""
|
||||
this.kelainan_error_message = ""
|
||||
this.operatorPerbandingan_error_message = ""
|
||||
this.fitness_error_message = ""
|
||||
this.message_existing = ""
|
||||
},
|
||||
resetAllError() {
|
||||
this.test_error_message = ""
|
||||
this.kelainan_error_message = ""
|
||||
this.operatorPerbandingan_error_message = ""
|
||||
this.fitness_error_message = ""
|
||||
this.message_existing = ""
|
||||
},
|
||||
openForm() {
|
||||
this.dialog_form = true
|
||||
this.$store.commit("kelainan/update_act", "add")
|
||||
this.$store.commit("kelainan/update_last_id", -1)
|
||||
this.resetAllInput()
|
||||
},
|
||||
handleSwitchChange() {
|
||||
if (this.isNilaiNormal) {
|
||||
this.nilaiPerbandingan = '';
|
||||
}
|
||||
},
|
||||
saveAdd() {
|
||||
this.testValidation()
|
||||
this.kelainanValidation()
|
||||
this.fitnessValidation()
|
||||
if (this.test_error_message === "" &&
|
||||
this.kelainan_error_message === "" &&
|
||||
this.fitness_error_message === ""
|
||||
) {
|
||||
let prm = {
|
||||
testId: this.vtest.Nat_TestID,
|
||||
testCode: this.vtest.Nat_TestCode,
|
||||
kelainanId: this.vdatakelainan.Mcu_KelainanID,
|
||||
orderstatusresults: this.xorderstatusresults,
|
||||
fitnessId: this.vdatafitness.Mcu_FitnessCategoryID
|
||||
}
|
||||
|
||||
// console.log('cek prm',prm)
|
||||
this.$store.dispatch("kelainan/add", prm)
|
||||
}
|
||||
},
|
||||
openEdit(data) {
|
||||
|
||||
|
||||
this.selectMe(data)
|
||||
this.dialog_form = true
|
||||
this.$store.commit("kelainan/update_act", "edit")
|
||||
this.xid = data.Mcu_SummaryNonlabID
|
||||
this.vtest = data.Nat_TestID
|
||||
this.vdatakelainan = data.Mcu_KelainanID
|
||||
this.vdatafitness = data.Mcu_FitnessCategoryID
|
||||
this.$store.commit("kelainan/update_orderstatusresults", data.xvalue)
|
||||
this.$store.commit("kelainan/update_last_id", data.Mcu_SummaryNonlabID)
|
||||
this.resetAllError()
|
||||
},
|
||||
saveEdit() {
|
||||
this.testValidation()
|
||||
this.kelainanValidation()
|
||||
this.fitnessValidation()
|
||||
if (this.test_error_message === "" &&
|
||||
this.kelainan_error_message === "" &&
|
||||
this.fitness_error_message === ""
|
||||
) {
|
||||
let prm = {
|
||||
xid: this.xid,
|
||||
orderstatusresults: this.xorderstatusresults,
|
||||
fitnessId: this.vdatafitness.Mcu_FitnessCategoryID
|
||||
}
|
||||
this.$store.dispatch("kelainan/edit", prm)
|
||||
}
|
||||
},
|
||||
confirmDelete(data) {
|
||||
this.selectMe(data)
|
||||
this.xid = data.Mcu_SummaryNonlabID
|
||||
this.msgalert = "Yakin, mau hapus kelainan lab " + data.codeNameTest + " ?"
|
||||
|
||||
this.dialogdeletealert = true
|
||||
},
|
||||
deleteRow() {
|
||||
this.$store.commit("kelainan/update_last_id", -1)
|
||||
let prm = {
|
||||
xid: this.xid
|
||||
}
|
||||
this.$store.dispatch("kelainan/deleterow", prm)
|
||||
this.dialogdeletealert = false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
xsearch(val, old) {
|
||||
this.xsearch = val
|
||||
this.thr_search()
|
||||
},
|
||||
search_statusresult(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.kelainan.update_autocomplete_status == 1) return
|
||||
this.thr_search_statusresult()
|
||||
},
|
||||
search_item_test(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
|
||||
if (val.length < 1) {
|
||||
this.$store.dispatch("kelainan/searchtest", this.search_item_test)
|
||||
return this.thr_search_test()
|
||||
}
|
||||
|
||||
if (val.length > 2) {
|
||||
this.$store.dispatch("kelainan/searchtest", this.search_item_test)
|
||||
return this.thr_search_test()
|
||||
}
|
||||
},
|
||||
|
||||
search_item_datakelainan(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
|
||||
if (val.length < 1) {
|
||||
this.$store.dispatch("kelainan/searchkelainan", this.search_item_datakelainan)
|
||||
return this.thr_search_datakelainan()
|
||||
}
|
||||
|
||||
if (val.length > 2) {
|
||||
this.$store.dispatch("kelainan/searchkelainan", this.search_item_datakelainan)
|
||||
return this.thr_search_datakelainan()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
93
one-ui/masterdata/one-md-pola-kelainan-nonlab-v2/index.php
Normal file
93
one-ui/masterdata/one-md-pola-kelainan-nonlab-v2/index.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<!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 style="background:#F5E8DF!important">
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 class="center" fill-height pa-1>
|
||||
<one-list-kelainan-lab></one-list-kelainan-lab>
|
||||
</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>
|
||||
<!-- <script src="../../libs/one_print_barcode.js"></script> -->
|
||||
<!-- <script src="../../libs/one_print_robo.js"></script> -->
|
||||
<!-- App Script -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
window.calculate_age = function(inp_dob) {
|
||||
var now = moment(new Date())
|
||||
var dob = moment(new Date(inp_dob))
|
||||
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)) return ''
|
||||
return `${year} tahun ${month} bulan ${day} hari`
|
||||
}
|
||||
|
||||
|
||||
import {
|
||||
store
|
||||
} from './store.js<?php echo $ts ?>';
|
||||
//for testing
|
||||
window.store = store;
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
methods: {
|
||||
tab_selected: function(tab) {
|
||||
return this.$store.state.tab_selected == tab
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../apps/components/oneNavbarComponentNoMenu.vue'),
|
||||
'one-footer': httpVueLoader('../../apps/components/oneFooter.vue'),
|
||||
'one-list-kelainan-lab': httpVueLoader('./components/oneMdKelainanNonLab.vue'),
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
|
||||
.left {}
|
||||
|
||||
.right {}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,358 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/kelainan.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
kelainanlab: [],
|
||||
total_kelainanlab_page: 0,
|
||||
selected_kelainanlab: {},
|
||||
search_status: false,
|
||||
error_message: "",
|
||||
last_id: -1,
|
||||
current_page: 1,
|
||||
x_search: "",
|
||||
act: "",
|
||||
dialog_form: false,
|
||||
loading_save: false,
|
||||
autocomplete_status: 0,
|
||||
tests: [],
|
||||
selected_test: {},
|
||||
datakelainans: [],
|
||||
selected_datakelainan: {},
|
||||
selected_isNilaiNormal: true,
|
||||
save_status: 2,
|
||||
alert_error: false,
|
||||
dialog_error: false,
|
||||
msg_success: "",
|
||||
alert_success: false,
|
||||
message_existing: "",
|
||||
orderautostatusresults:[],
|
||||
orderautostatusresult:{},
|
||||
orderstatusresults:[],
|
||||
deleted_orderstatusresults: [],
|
||||
fitness:[],
|
||||
selected_fitness:{},
|
||||
get_data_status:0
|
||||
},
|
||||
mutations: {
|
||||
update_get_data_status(state, val) {
|
||||
state.get_data_status = val
|
||||
},
|
||||
update_fitness(state, val){
|
||||
state.fitness = val
|
||||
},
|
||||
update_selected_fitness(state, val){
|
||||
state.selected_fitness = val
|
||||
},
|
||||
update_deleted_orderstatusresults(state,data){
|
||||
state.deleted_orderstatusresults = data
|
||||
},
|
||||
update_orderautostatusresults(state,data){
|
||||
state.orderautostatusresults = data
|
||||
},
|
||||
update_orderautostatusresult(state,val){
|
||||
state.orderautostatusresult = val
|
||||
},
|
||||
update_orderstatusresults(state,data){
|
||||
state.orderstatusresults = data
|
||||
},
|
||||
update_kelainanlab(state, val) {
|
||||
state.kelainanlab = val
|
||||
},
|
||||
update_total_kelainanlab_page(state, val) {
|
||||
state.total_kelainanlab_page = val
|
||||
},
|
||||
update_selected_kelainanlab(state, val) {
|
||||
state.selected_kelainanlab = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_error_message(state, val) {
|
||||
state.error_message = val
|
||||
},
|
||||
update_last_id(state, val) {
|
||||
state.last_id = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_x_search(state, val) {
|
||||
state.x_search = val
|
||||
state.current_page = 1
|
||||
},
|
||||
update_act(state, val) {
|
||||
state.act = val
|
||||
},
|
||||
update_dialog_form(state, val) {
|
||||
state.dialog_form = val
|
||||
},
|
||||
update_loading_save(state, val) {
|
||||
state.loading_save = val
|
||||
},
|
||||
update_autocomplete_status(state, val) {
|
||||
state.autocomplete_status = val
|
||||
},
|
||||
update_tests(state, val) {
|
||||
state.tests = val
|
||||
},
|
||||
update_selected_test(state, val) {
|
||||
state.selected_test = val
|
||||
},
|
||||
update_datakelainans(state, val) {
|
||||
state.datakelainans = val
|
||||
},
|
||||
update_selected_datakelainan(state, val) {
|
||||
state.selected_datakelainan = val
|
||||
},
|
||||
update_selected_isNilaiNormal(state, val) {
|
||||
state.selected_isNilaiNormal = val
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_alert_error(state, val) {
|
||||
state.alert_error = val
|
||||
},
|
||||
update_dialog_error(state, val) {
|
||||
state.dialog_error = val
|
||||
},
|
||||
update_msg_success(state, val) {
|
||||
state.msg_success = val
|
||||
},
|
||||
update_alert_success(state, val) {
|
||||
state.alert_success = val
|
||||
},
|
||||
update_message_existing(state, val) {
|
||||
state.message_existing = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async getfitness(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
var prm = {
|
||||
token: one_token()
|
||||
}
|
||||
let resp = await api.getfitness(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.total_display
|
||||
}
|
||||
// console.log('fitness', data.records)
|
||||
context.commit("update_fitness", data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
|
||||
async search(context) {
|
||||
context.commit("update_search_status", true)
|
||||
try {
|
||||
var prm = {
|
||||
token: one_token(),
|
||||
search: context.state.x_search,
|
||||
current_page: context.state.current_page,
|
||||
last_id: context.state.last_id
|
||||
}
|
||||
let resp = await api.search(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status", false)
|
||||
context.commit("update_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status", false)
|
||||
context.commit("update_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_page: resp.data.total_page
|
||||
}
|
||||
context.commit("update_kelainanlab", data.records)
|
||||
context.commit("update_total_kelainanlab_page", data.total_page)
|
||||
if (
|
||||
!(
|
||||
Object.keys(context.state.selected_kelainanlab).length === 0 &&
|
||||
context.state.selected_kelainanlab.constructor === Object
|
||||
)
|
||||
) {
|
||||
let idx = _.findIndex(resp.data.records, function (o) {
|
||||
return o.Mcu_SummaryNonlabID == context.state.selected_kelainanlab.Mcu_SummaryNonlabID
|
||||
});
|
||||
if (idx >= 0) {
|
||||
context.commit("update_selected_kelainanlab", resp.data.records[idx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_status", false)
|
||||
context.commit("update_error_message", e.message)
|
||||
}
|
||||
},
|
||||
|
||||
async searchtest(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchtest(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
|
||||
}
|
||||
context.commit("update_tests", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
|
||||
async search_statusresult(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchstatusresult(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
|
||||
}
|
||||
context.commit("update_orderautostatusresults", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
|
||||
async searchkelainan(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchkelainan(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
|
||||
}
|
||||
context.commit("update_datakelainans", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
|
||||
async add(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
context.commit("update_loading_save", true)
|
||||
prm.token = one_token()
|
||||
let resp = await api.add(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_loading_save", false)
|
||||
context.commit("update_error_message", resp.message)
|
||||
context.commit("update_alert_error", true)
|
||||
context.commit("update_dialog_error", true)
|
||||
} else {
|
||||
if (resp.flag == true) {
|
||||
let data = resp.msg
|
||||
context.commit("update_message_existing", data)
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_loading_save", false)
|
||||
context.commit("update_error_message", "")
|
||||
context.commit("update_dialog_error", false)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_loading_save", false)
|
||||
context.commit("update_error_message", "")
|
||||
context.commit("update_dialog_error", false)
|
||||
context.commit("update_dialog_form", false)
|
||||
|
||||
var msg = "Berhasil disimpan"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_alert_success", true)
|
||||
context.dispatch("search")
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_loading_save", false)
|
||||
context.commit("update_error_message", e.message)
|
||||
context.commit("update_alert_error", true)
|
||||
}
|
||||
},
|
||||
|
||||
async edit(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
context.commit("update_loading_save", true)
|
||||
prm.token = one_token()
|
||||
let resp = await api.edit(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_loading_save", false)
|
||||
context.commit("update_error_message", resp.message)
|
||||
context.commit("update_alert_error", true)
|
||||
context.commit("update_dialog_error", true)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_loading_save", false)
|
||||
context.commit("update_error_message", "")
|
||||
context.commit("update_dialog_error", false)
|
||||
context.commit("update_dialog_form", false)
|
||||
|
||||
var msg = "Berhasil diedit"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_alert_success", true)
|
||||
context.dispatch("search")
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_loading_save", false)
|
||||
context.commit("update_error_message", e.message)
|
||||
context.commit("update_alert_error", true)
|
||||
}
|
||||
},
|
||||
|
||||
async deleterow(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
context.commit("update_loading_save", true)
|
||||
prm.token = one_token()
|
||||
let resp = await api.deleterow(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_loading_save", false)
|
||||
context.commit("update_error_message", resp.message)
|
||||
context.commit("update_alert_error", true)
|
||||
context.commit("update_dialog_error", true)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_loading_save", false)
|
||||
context.commit("update_error_message", "")
|
||||
context.commit("update_dialog_error", false)
|
||||
|
||||
var msg = "Berhasil dihapus"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_alert_success", true)
|
||||
context.dispatch("search")
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_loading_save", false)
|
||||
context.commit("update_error_message", e.message)
|
||||
context.commit("update_alert_error", true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
one-ui/masterdata/one-md-pola-kelainan-nonlab-v2/store.js
Normal file
23
one-ui/masterdata/one-md-pola-kelainan-nonlab-v2/store.js
Normal file
@@ -0,0 +1,23 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import kelainan from "./modules/kelainan.js";
|
||||
import system from "../../apps/modules/system/system.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
kelainan:kelainan,
|
||||
system:system
|
||||
},
|
||||
state: {
|
||||
|
||||
},
|
||||
mutations: {
|
||||
|
||||
},
|
||||
actions: {
|
||||
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user