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,96 @@
const URL = "/one-api/mockup/masterdata/one-conclusion/";
export async function searchdetail(prm) {
try {
var resp = await axios.post(URL + "conclusion/searchdetail", 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 adddetail(prm) {
try {
var resp = await axios.post(URL + "conclusion/adddetail", 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 deletedetail(prm) {
try {
var resp = await axios.post(URL + "conclusion/deletedetail", 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 saveeditflag(prm) {
try {
var resp = await axios.post(URL + "conclusion/saveeditflag", 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 editdetail(prm) {
try {
var resp = await axios.post(URL + "conclusion/editdetail", 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,77 @@
const URL = "/one-api/mockup/masterdata/one-conclusion/";
export async function search(prm) {
try {
var resp = await axios.post(URL + "conclusion/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 addnonlab(prm) {
try {
var resp = await axios.post(URL + "conclusion/addnonlab", 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 editnonlab(prm) {
try {
var resp = await axios.post(URL + "conclusion/editnonlab", 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 deletenonlab(prm) {
try {
var resp = await axios.post(URL + "conclusion/deletenonlab", 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,39 @@
const URL = "/one-api/mockup/masterdata/one-conclusion/";
export async function lookuptest(prm) {
try {
var resp = await axios.post(URL + "conclusion/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 saveedittestmap(prm) {
try {
var resp = await axios.post(URL + "conclusion/saveedittestmap", 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,548 @@
<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 -->
<template>
<v-layout row justify-center>
<v-dialog v-model="dialog_form_detail" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="headline">FORM NONLAB CONCLUSION DETAIL</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-0 pb-0">
<v-layout wrap>
<v-flex xs12>
<v-text-field v-model="xcode" label="Kode*"
:error="code_error_message !== ''"
:error-messages="code_error_message" @blur="codeValidation" required></v-text-field>
</v-flex>
<v-flex xs12>
<v-text-field v-model="xname" label="Nama*"
:error="nama_error_message !== ''"
:error-messages="nama_error_message" @blur="namaValidation" required></v-text-field>
</v-flex>
<v-flex xs12>
<v-checkbox v-model="isNormal" label="Normal"></v-checkbox>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialog_form_detail = false" :disabled="loading_save">Tutup</v-btn>
<v-btn v-if="xact === 'new'" color="blue darken-1" flat :disabled="loading_save" @click="saveAdd()">Simpan</v-btn>
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat :disabled="loading_save" @click="saveEdit()">Simpan Perubahan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-layout>
</template>
<v-flex xs12>
<v-card>
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>NONLAB CONCLUSION DETAIL</v-toolbar-title>
<v-spacer></v-spacer>
<div>
<v-btn icon @click="openAddForm()"><v-icon>library_add</v-icon></v-btn>
</div>
</v-toolbar>
<v-layout row style="background:white">
<v-layout row justify-left>
<v-flex xs12>
<v-text-field class="ma-1 ml-2 mr-2" label="Cari" placeholder="Kode atau Nama"
v-model="xsearch" outline hide-details></v-text-field>
</v-flex>
</v-layout>
</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="xnonlabdetail" :isLoading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-center pa-2" @click="selectMe(props.item)">
{{ props.item.NonlabConclusionDetailCode }}
</td>
<td class="text-xs-left pa-2" @click="selectMe(props.item)">
{{ props.item.NonlabConclusionDetailName }}
</td>
<td class="text-xs-center pa-2" @click="selectMe(props.item)">
<div>
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-icon
v-bind="attrs"
v-on="on"
small 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
small
v-bind="attrs"
v-on="on"
@click="confirmDelete(props.item)"
color="error">delete
</v-icon>
</template>
<span>Hapus</span>
</v-tooltip>
<!-- <v-btn @click="changeBtnFlag(props.item)" v-if="props.item.NonlabConclusionDetailFlagActive === 'N'" small color="error">
Tidak</v-btn>
<v-btn @click="changeBtnFlag(props.item)" v-if="props.item.NonlabConclusionDetailFlagActive === 'Y'" small color="success">
Pilih</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>
</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 {
isNormal: false,
xcode: "",
xname: "",
code_error_message: "",
nama_error_message: "",
clr: "success",
dialogdeletealert: false,
msgalert: "",
headers: [{
text: "KODE",
align: "center",
sortable: false,
value: "name",
width: "20%",
class: "blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
value: "name",
width: "50%",
class: "blue lighten-3 white--text"
},
{
text: "AKSI",
align: "center",
sortable: false,
value: "name",
width: "30%",
class: "blue lighten-3 white--text"
},
],
};
},
mounted() {
},
computed: {
xnonlabdetail() {
return this.$store.state.detail.nonlabdetails
},
isLoading() {
return this.$store.state.detail.lookup_search
},
xsearch: {
get() {
return this.$store.state.detail.x_search
},
set(val) {
this.$store.commit("detail/update_x_search", val)
}
},
curr_page: {
get() {
return this.$store.state.detail.current_page
},
set(val) {
this.$store.commit("detail/update_current_page", val)
this.$store.commit("detail/update_last_id", -1)
this.$store.dispatch("detail/searchdetail")
}
},
xtotal_page: {
get() {
return this.$store.state.detail.total_nonlabdetail
},
set(val) {
this.$store.commit("detail/update_total_nonlabdetail", val)
}
},
selected_nonlabconclusion_id() {
return this.$store.state.detail.selected_nonlabconclusion_id
},
dialog_form_detail: {
get() {
return this.$store.state.detail.dialog_form_detail
},
set(val) {
this.$store.commit("detail/update_dialog_form_detail", val)
},
},
xact: {
get() {
return this.$store.state.detail.act
},
set(val) {
this.$store.commit("detail/update_act", val)
}
},
loading_save: {
get() {
return this.$store.state.detail.loading_save
},
set(val) {
this.$store.commit("detail/update_loading_save", val)
},
},
snackbar: {
get() {
return this.$store.state.detail.alert_success
},
set(val) {
this.$store.commit("detail/update_alert_success", val)
}
},
msgsnackbar() {
return this.$store.state.detail.msg_success
},
dialog_error: {
get() {
return this.$store.state.detail.alert_error
},
set(val) {
this.$store.commit("detail/update_alert_error", val)
},
},
msgError() {
return this.$store.state.detail.error_message
}
},
methods: {
selectMe(selected) {
this.$store.commit("detail/update_selected_nonlabdetail", selected)
this.$store.commit("detail/update_last_id", selected.NonlabTemplateDetailID)
},
thr_search: _.debounce(function () {
this.$store.dispatch("detail/searchdetail")
}, 1000),
thr_search_nonlabdetail: _.debounce(function () {
this.$store.dispatch("detail/searchdetail")
}, 1000),
codeValidation() {
if (!this.xcode) {
this.code_error_message = "Anda belum mengisi"
}
if (this.xcode) {
this.code_error_message = ""
}
},
namaValidation() {
if (!this.xname) {
this.nama_error_message = "Anda belum mengisi"
}
if (this.xname) {
this.nama_error_message = ""
}
},
resetAllInput() {
this.isNormal = false
this.xname = ""
this.xcode = ""
this.code_error_message = ""
this.nama_error_message = ""
},
openAddForm() {
this.dialog_form_detail = true
this.$store.commit("detail/update_act", "new")
this.$store.commit("detail/update_last_id", -1)
this.xname = ""
this.xcode = ""
this.isNormal = false
this.resetAllInput()
},
saveAdd() {
this.codeValidation()
this.namaValidation()
if (this.code_error_message === "" && this.nama_error_message === "") {
let prm = {
code: this.xcode,
name: this.xname,
nonlabid: this.selected_nonlabconclusion_id,
isnormal: this.isNormal == true ? "Y" : "N"
}
this.$store.dispatch("detail/adddetail", prm)
}
},
confirmDelete(data) {
this.selectMe(data)
this.xid = data.NonlabConclusionDetailID
this.xname = data.NonlabConclusionDetailName
this.msgalert = "Yakin, mau hapus non lab conclusion detail " + data.NonlabConclusionDetailName + " ?"
this.dialogdeletealert = true
},
deleteRow() {
this.$store.commit("detail/update_last_id", -1)
let prm = {
id: this.xid,
name: this.xname
}
this.$store.dispatch("detail/deletedetail", prm)
this.dialogdeletealert = false
},
changeBtnFlag(value) {
var prm = {
flagstatus: value.NonlabConclusionDetailFlagActive == "N" ? "Y" : "N",
name: value.NonlabConclusionDetailName,
conclusionid: value.NonlabConclusionDetailID,
current_page: this.curr_page
}
this.$store.dispatch("detail/saveeditflag", prm)
},
resetAllError() {
this.code_error_message = ""
this.nama_error_message = ""
},
openEdit(data) {
// console.log(data)
this.selectMe(data)
this.dialog_form_detail = true
this.$store.commit("detail/update_act", "edit")
this.xid = data.NonlabConclusionDetailID
this.xcode = data.NonlabConclusionDetailCode
this.xname = data.NonlabConclusionDetailName
this.isNormal = data.NonlabConclusionDetailIsNormal == "N" ? false : true
this.resetAllError()
this.$store.commit("detail/update_last_id", data.NonlabConclusionDetailID)
},
saveEdit() {
this.codeValidation()
this.namaValidation()
if (this.nama_error_message === "" && this.code_error_message === "") {
let prm = {
id: this.xid,
name: this.xname,
code: this.xcode,
isnormal: this.isNormal == true ? "Y" : "N"
}
this.$store.dispatch("detail/editdetail", prm)
}
},
},
watch: {
xsearch(val, old) {
this.xsearch = val
this.thr_search()
},
selected_nonlabconclusion_id(val, old) {
this.thr_search_nonlabdetail()
}
}
}
</script>

View File

@@ -0,0 +1,475 @@
<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 -->
<v-dialog v-model="dialog_form" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="headline">FORM NONLAB CONCLUSION</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-0 pb-0">
<v-layout wrap>
<v-flex xs12>
<v-text-field v-model="xname" label="Nama*"
:error="nama_error_message !== ''"
:error-messages="nama_error_message" @blur="namaValidation" required></v-text-field>
</v-flex>
</v-layout>
</v-card-text>
<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 === 'new'" color="blue darken-1" flat :disabled="loading_save" @click="saveAdd()">Simpan</v-btn>
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat :disabled="loading_save" @click="saveEdit()">Simpan Perubahan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-flex xs12>
<v-card>
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>MASTER NONLAB CONCLUSION</v-toolbar-title>
<v-spacer></v-spacer>
<div>
<v-btn icon @click="openAddForm()"><v-icon>library_add</v-icon></v-btn>
</div>
</v-toolbar>
<v-layout row style="background:white">
<v-layout row justify-left>
<v-flex xs12>
<v-text-field class="ma-1 ml-2 mr-2" label="Cari" placeholder="Nama conclusion"
v-model="xsearch" outline hide-details></v-text-field>
</v-flex>
</v-layout>
</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="xnonlabconclusion" :isLoading="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.NonlabConclusionName }}
</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<div>
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-icon
v-bind="attrs"
v-on="on"
small 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
small
v-bind="attrs"
v-on="on"
@click="confirmDelete(props.item)"
color="error">delete
</v-icon>
</template>
<span>Hapus</span>
</v-tooltip>
</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>
</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 {
xname: '',
nama_error_message: "",
clr: "success",
xid: "",
dialogdeletealert: false,
msgalert: "",
headers: [{
text: "NAMA CONCLUSION",
align: "left",
sortable: false,
value: "name",
width: "70%",
class: "blue lighten-3 white--text"
},
{
text: "AKSI",
align: "center",
sortable: false,
value: "name",
width: "30%",
class: "blue lighten-3 white--text"
},
],
};
},
mounted() {
this.$store.dispatch("nonlab/search")
},
computed: {
xnonlabconclusion() {
return this.$store.state.nonlab.conclusions
},
isLoading() {
return this.$store.state.nonlab.lookup_search
},
xsearch: {
get() {
return this.$store.state.nonlab.x_search
},
set(val) {
this.$store.commit("nonlab/update_x_search", val)
}
},
curr_page: {
get() {
return this.$store.state.nonlab.current_page
},
set(val) {
this.$store.commit("nonlab/update_current_page", val)
this.$store.commit("nonlab/update_last_id", -1)
this.$store.dispatch("nonlab/search")
}
},
xtotal_page: {
get() {
return this.$store.state.nonlab.total_conclusion
},
set(val) {
this.$store.commit("nonlab/update_total_conclusion", val)
}
},
dialog_form: {
get() {
return this.$store.state.nonlab.dialog_form
},
set(val) {
this.$store.commit("nonlab/update_dialog_form", val)
},
},
xact: {
get() {
return this.$store.state.nonlab.act
},
set(val) {
this.$store.commit("nonlab/update_act", val)
}
},
loading_save: {
get() {
return this.$store.state.nonlab.loading_save
},
set(val) {
this.$store.commit("nonlab/update_loading_save", val)
},
},
snackbar: {
get() {
return this.$store.state.nonlab.alert_success
},
set(val) {
this.$store.commit("nonlab/update_alert_success", val)
}
},
msgsnackbar() {
return this.$store.state.nonlab.msg_success
},
dialog_error: {
get() {
return this.$store.state.nonlab.alert_error
},
set(val) {
this.$store.commit("nonlab/update_alert_error", val)
},
},
msgError() {
return this.$store.state.nonlab.error_message
}
},
methods: {
isSelected(p) {
return p.NonlabConclusionID == this.$store.state.nonlab.selected_conclusion.NonlabConclusionID
},
selectMe(selected) {
this.$store.commit("nonlab/update_selected_conclusion", selected)
this.$store.commit("detail/update_selected_nonlabconclusion_id", selected.NonlabConclusionID)
this.$store.commit("nonlabtest/update_selected_nonlabconclusiontestid", selected.NonlabConclusionID)
},
thr_search: _.debounce(function () {
this.$store.dispatch("nonlab/search")
}, 1000),
namaValidation() {
if (!this.xname) {
this.nama_error_message = "Anda belum mengisi"
}
if (this.xname) {
this.nama_error_message = ""
}
},
resetAllInput() {
this.xname = ""
this.nama_error_message = ""
},
resetAllError() {
this.nama_error_message = ""
},
openAddForm() {
this.dialog_form = true
this.$store.commit("nonlab/update_act", "new")
this.$store.commit("nonlab/update_last_id", -1)
this.xname = ""
this.resetAllInput()
},
saveAdd() {
this.namaValidation()
if (this.nama_error_message === "") {
let prm = {
name: this.xname
}
this.$store.dispatch("nonlab/addnonlab", prm)
}
},
openEdit(data) {
this.selectMe(data)
this.dialog_form = true
this.$store.commit("nonlab/update_act", "edit")
this.xid = data.NonlabConclusionID
this.xname = data.NonlabConclusionName
this.resetAllError()
this.$store.commit("nonlab/update_last_id", data.NonlabConclusionID)
},
saveEdit() {
this.namaValidation()
if (this.nama_error_message === "") {
let prm = {
id: this.xid,
name: this.xname
}
this.$store.dispatch("nonlab/editnonlab", prm)
}
},
confirmDelete(data) {
this.selectMe(data)
this.xid = data.NonlabConclusionID
this.xname = data.NonlabConclusionName
this.msgalert = "Yakin, mau hapus non lab template " + data.NonlabConclusionName + " ?"
this.dialogdeletealert = true
},
deleteRow() {
this.$store.commit("nonlab/update_last_id", -1)
let prm = {
id: this.xid,
name: this.xname
}
this.$store.dispatch("nonlab/deletenonlab", prm)
this.dialogdeletealert = false
}
},
watch: {
xsearch(val, old) {
this.xsearch = val
this.thr_search()
},
}
}
</script>

View File

@@ -0,0 +1,533 @@
<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 -->
<v-dialog v-model="dialog_form" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="headline">FORM NONLAB CONCLUSION</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-0 pb-0">
<v-layout wrap>
<v-flex xs12>
<v-text-field v-model="xcode" label="Kode*"
:error="code_error_message !== ''"
:error-messages="code_error_message" @blur="codeValidation" required></v-text-field>
</v-flex>
<v-flex xs12>
<v-text-field v-model="xname" label="Nama*"
:error="nama_error_message !== ''"
:error-messages="nama_error_message" @blur="namaValidation" required></v-text-field>
</v-flex>
</v-layout>
</v-card-text>
<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 === 'new'" color="blue darken-1" flat :disabled="loading_save" @click="saveAdd()">Simpan</v-btn>
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat :disabled="loading_save" @click="saveEdit()">Simpan Perubahan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-flex xs12>
<v-card>
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>NONLAB CONCLUSION MAPPING TEST</v-toolbar-title>
<v-spacer></v-spacer>
<!-- <div>
<v-btn icon @click="openAddForm()"><v-icon>library_add</v-icon></v-btn>
</div> -->
</v-toolbar>
<v-layout row style="background:white">
<v-layout row justify-left>
<v-flex xs8>
<v-text-field class="ma-1 ml-2 mr-2" label="Cari" placeholder="Kode atau Nama"
v-model="xsearch" outline hide-details></v-text-field>
</v-flex>
<v-flex xs4>
<v-select item-text="M_StatusName" return-object :items="f_statuss" style="font-size:14px"
class="mini-select ma-1 text-md-right" v-model="selected_statuss" outline hide-details
label="Status"></v-select>
</v-flex>
</v-layout>
</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="xnonlabtest" :isLoading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-center pa-2">
{{ props.item.Nat_TestCode }}
</td>
<td class="text-xs-left pa-2">
{{ props.item.Nat_TestName }}
</td>
<td class="text-xs-center pa-2">
<div>
<v-btn @click="changeBtnFlag(props.item)" v-if="props.item.status === 'N'" small color="error">
Belum dipilih</v-btn>
<v-btn @click="changeBtnFlag(props.item)" v-if="props.item.status === 'Y'" small color="success">
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>
</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 {
xcode: "",
xname: "",
code_error_message: "",
nama_error_message: "",
clr: "success",
dialogdeletealert: false,
msgalert: "",
headers: [{
text: "KODE",
align: "center",
sortable: false,
value: "name",
width: "20%",
class: "blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
value: "name",
width: "50%",
class: "blue lighten-3 white--text"
},
{
text: "AKSI",
align: "center",
sortable: false,
value: "name",
width: "30%",
class: "blue lighten-3 white--text"
},
],
};
},
mounted() {
},
computed: {
f_statuss() {
return this.$store.state.nonlabtest.statuss
},
selected_statuss: {
get() {
return this.$store.state.nonlabtest.selected_statuss
},
set(val) {
this.$store.commit("nonlabtest/update_selected_statuss", val)
// this.$store.dispatch("nonlabtest/lookuptest")
}
},
xnonlabtest() {
return this.$store.state.nonlabtest.nonlabtests
},
isLoading() {
return this.$store.state.nonlabtest.lookup_search
},
xsearch: {
get() {
return this.$store.state.nonlabtest.x_search
},
set(val) {
this.$store.commit("nonlabtest/update_x_search", val)
}
},
curr_page: {
get() {
return this.$store.state.nonlabtest.current_page
},
set(val) {
this.$store.commit("nonlabtest/update_current_page", val)
this.$store.commit("nonlabtest/update_last_id", -1)
this.$store.dispatch("nonlabtest/lookuptest")
}
},
xtotal_page: {
get() {
return this.$store.state.nonlabtest.total_nonlabtest
},
set(val) {
this.$store.commit("nonlabtest/update_total_nonlabtest", val)
}
},
selected_nonlabconclusiontestid() {
return this.$store.state.nonlabtest.selected_nonlabconclusiontestid
},
dialog_form: {
get() {
return this.$store.state.detail.dialog_form
},
set(val) {
this.$store.commit("detail/update_dialog_form", val)
},
},
xact: {
get() {
return this.$store.state.detail.act
},
set(val) {
this.$store.commit("detail/update_act", val)
}
},
loading_save: {
get() {
return this.$store.state.nonlabtest.loading_save
},
set(val) {
this.$store.commit("nonlabtest/update_loading_save", val)
},
},
snackbar: {
get() {
return this.$store.state.nonlabtest.alert_success
},
set(val) {
this.$store.commit("nonlabtest/update_alert_success", val)
}
},
msgsnackbar() {
return this.$store.state.nonlabtest.msg_success
},
dialog_error: {
get() {
return this.$store.state.nonlabtest.alert_error
},
set(val) {
this.$store.commit("nonlabtest/update_alert_error", val)
},
},
msgError() {
return this.$store.state.nonlabtest.error_message
}
},
methods: {
// selectMe(selected) {
// this.$store.commit("detail/update_selected_nonlabdetail", selected)
// this.$store.commit("detail/update_last_id", selected.NonlabTemplateDetailID)
// },
thr_search: _.debounce(function () {
this.$store.dispatch("nonlabtest/lookuptest")
}, 1000),
thr_search_nonlabtest: _.debounce(function () {
this.$store.dispatch("nonlabtest/lookuptest")
}, 1000),
thr_search_statuss: _.debounce(function () {
this.$store.dispatch("nonlabtest/lookuptest")
}, 1000),
codeValidation() {
if (!this.xcode) {
this.code_error_message = "Anda belum mengisi"
}
if (this.xcode) {
this.code_error_message = ""
}
},
namaValidation() {
if (!this.xname) {
this.nama_error_message = "Anda belum mengisi"
}
if (this.xname) {
this.nama_error_message = ""
}
},
resetAllInput() {
this.xname = ""
this.xcode = ""
this.code_error_message = ""
this.nama_error_message = ""
},
openAddForm() {
this.dialog_form = true
this.$store.commit("nonlab/update_act", "new")
this.$store.commit("nonlab/update_last_id", -1)
this.xname = ""
this.xcode = ""
this.resetAllInput()
},
saveAdd() {
this.codeValidation()
this.namaValidation()
if (this.code_error_message === "" && this.nama_error_message === "") {
let prm = {
code: this.xcode,
name: this.xname,
nonlabid: this.selected_nonlabtemplate_id
}
this.$store.dispatch("detail/adddetail", prm)
}
},
confirmDelete(data) {
this.selectMe(data)
this.xid = data.NonlabTemplateDetailID
this.xname = data.NonlabTemplateDetailName
this.msgalert = "Yakin, mau hapus non lab template detail " + data.NonlabTemplateDetailName + " ?"
this.dialogdeletealert = true
},
deleteRow() {
this.$store.commit("detail/update_last_id", -1)
let prm = {
id: this.xid,
name: this.xname
}
this.$store.dispatch("detail/deletedetail", prm)
this.dialogdeletealert = false
},
changeBtnFlag(value) {
var prm = {
status: value.status == "N" ? "Y" : "N",
conclusionid: this.selected_nonlabconclusiontestid,
test_id: value.Nat_TestID,
name: value.Nat_TestName
}
// console.log(prm)
this.$store.dispatch("nonlabtest/saveedittestmap", prm)
},
resetAllError() {
this.code_error_message = ""
this.nama_error_message = ""
},
openEdit(data) {
// console.log(data)
this.selectMe(data)
this.dialog_form = true
this.$store.commit("detail/update_act", "edit")
this.xid = data.NonlabTemplateDetailID
this.xcode = data.NonlabTemplateDetailCode
this.xname = data.NonlabTemplateDetailName
this.resetAllError()
this.$store.commit("detail/update_last_id", data.NonlabTemplateDetailID)
},
saveEdit() {
this.codeValidation()
this.namaValidation()
if (this.nama_error_message === "" && this.code_error_message === "") {
let prm = {
id: this.xid,
name: this.xname,
code: this.xcode
}
this.$store.dispatch("detail/editdetail", prm)
}
},
},
watch: {
xsearch(val, old) {
this.xsearch = val
this.thr_search()
},
selected_nonlabconclusiontestid(val, old) {
this.thr_search_nonlabtest()
},
selected_statuss(val, old) {
this.thr_search_statuss()
}
}
}
</script>

View File

@@ -0,0 +1,83 @@
<!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>
<!-- kanan -->
<v-flex xs3 class="center" fill-height pa-1>
<cpone-nonlab-conclusion></cpone-nonlab-conclusion>
</v-flex>
<!-- kiri -->
<v-flex xs4 class="center" fill-height pa-1>
<cpone-nonlab-conclusion-detail></cpone-nonlab-conclusion-detail>
</v-flex>
<v-flex xs5 class="center" fill-height pa-1>
<cpone-nonlab-conclusion-test></cpone-nonlab-conclusion-test>
</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/oneNavbarComponentNoMenu.vue'),
'one-footer': httpVueLoader('../../apps/components/oneFooter.vue'),
'cpone-nonlab-conclusion': httpVueLoader('./components/oneMdNonlabConclusionList.vue'),
'cpone-nonlab-conclusion-detail': httpVueLoader('./components/oneMdNonlabConclusionDetailList.vue'),
'cpone-nonlab-conclusion-test': httpVueLoader('./components/oneMdNonlabConclusionTest.vue'),
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {}
.right {}
</style>
</body>
</html>

View File

@@ -0,0 +1,252 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/detail.js"
export default {
namespaced: true,
state: {
lookup_search: 0,
nonlabdetails: [],
total_nonlabdetail: 0,
error_message: "",
selected_nonlabdetail: {},
last_id: -1,
current_page: 1,
x_search: "",
selected_nonlabconclusion_id: 0,
dialog_form_detail: false,
act: 'new',
loading_save: false,
save_status: 2,
alert_error: false,
dialog_error: false,
msg_success: "",
alert_success: false
},
mutations: {
update_lookup_search(state, val) {
state.lookup_search = val
},
update_nonlabdetails(state, val) {
state.nonlabdetails = val
},
update_total_nonlabdetail(state, val) {
state.total_nonlabdetail = val
},
update_error_message(state, val) {
state.error_message = val
},
update_selected_nonlabdetail(state, val) {
state.selected_nonlabdetail = 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_selected_nonlabconclusion_id(state, val) {
state.selected_nonlabconclusion_id = val
state.current_page = 1
},
update_dialog_form_detail(state, val) {
state.dialog_form_detail = val
},
update_act(state, val) {
state.act = val
},
update_loading_save(state, val) {
state.loading_save = 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
},
},
actions: {
async searchdetail(context, prm) {
context.commit("update_lookup_search", 1)
try {
var prm = {
token: one_token(),
search: context.state.x_search,
current_page: context.state.current_page,
last_id: context.state.last_id,
nonlabID: context.state.selected_nonlabconclusion_id
}
let resp = await api.searchdetail(prm)
if (resp.status != "OK") {
context.commit("update_lookup_search", 3)
} else {
context.commit("update_lookup_search", 2)
context.commit("update_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total_page,
total_filter: resp.data.total_filter
}
context.commit("update_nonlabdetails", data.records)
context.commit("update_total_nonlabdetail", data.total)
if (context.state.last_id == -1) {
if (resp.data && resp.data.records > 0) {
context.commit("update_selected_nonlabdetail", resp.data.records[0])
}
} else {
let idx = _.findIndex(resp.data.records, function(o) {
return o.NonlabConclusionDetailID == context.state.selected_nonlabdetail.NonlabConclusionDetailID
});
if (idx >= 0) {
context.commit("update_selected_nonlabdetail", resp.data.records[idx]);
}
}
}
} catch (e) {
context.commit("update_lookup_search", 3)
context.commit("update_error_message", e.message)
console.log(e)
}
},
async adddetail(context, prm) {
context.commit("update_save_status", 1)
try {
context.commit("update_loading_save", true)
prm.token = one_token()
let resp = await api.adddetail(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_detail", false)
let data = resp.data
var msg = prm.name + " berhasil disimpan"
context.commit("update_msg_success", msg)
context.commit("update_alert_success", true)
context.dispatch("searchdetail")
}
} 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 deletedetail(context, prm) {
context.commit("update_save_status", 1)
try {
context.commit("update_loading_save", true)
prm.token = one_token()
let resp = await api.deletedetail(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 = prm.name + " berhasil dihapus"
context.commit("update_msg_success", msg)
context.commit("update_alert_success", true)
context.dispatch("searchdetail")
}
} catch (e) {
context.commit("update_loading_save", false)
context.commit("update_error_message", e.message)
context.commit("update_alert_error", true)
context.commit("update_dialog_error", true)
}
},
async saveeditflag(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.saveeditflag(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
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_error_message", "")
context.commit("update_dialog_error", false)
var msg = ""
if(prm.flagstatus == "Y") {
var msg = prm.name + " di aktifkan"
} else {
var msg = prm.name + " di nonaktifkan"
}
context.commit("update_msg_success", msg)
context.commit("update_alert_success", true)
context.dispatch("searchdetail")
}
} catch (e) {
context.commit("update_error_message", e.message)
context.commit("update_alert_error", true)
context.commit("update_dialog_error", true)
}
},
async editdetail(context, prm) {
context.commit("update_save_status", 1)
try {
context.commit("update_loading_save", true)
prm.token = one_token()
let resp = await api.editdetail(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_detail", false)
let data = resp.data
var msg = prm.name + " berhasil di edit"
context.commit("update_msg_success", msg)
context.commit("update_alert_success", true)
context.dispatch("searchdetail")
}
} 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)
}
},
}
}

View File

@@ -0,0 +1,216 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/nonlab.js"
export default {
namespaced: true,
state: {
lookup_search: 0,
conclusions: [],
total_conclusion: 0,
error_message: "",
selected_conclusion: {},
last_id: -1,
current_page: 1,
x_search: "",
dialog_form: false,
act: 'new',
loading_save: false,
save_status: 2,
alert_error: false,
dialog_error: false,
msg_success: "",
alert_success: false
},
mutations: {
update_lookup_search(state, val) {
state.lookup_search = val
},
update_conclusions(state, val) {
state.conclusions = val
},
update_total_conclusion(state, val) {
state.total_conclusion = val
},
update_error_message(state, val) {
state.error_message = val
},
update_selected_conclusion(state, val) {
state.selected_conclusion = 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_dialog_form(state, val) {
state.dialog_form = val
},
update_act(state, val) {
state.act = val
},
update_loading_save(state, val) {
state.loading_save = 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
},
},
actions: {
async search(context, prm) {
context.commit("update_lookup_search", 1)
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_lookup_search", 3)
} else {
context.commit("update_lookup_search", 2)
context.commit("update_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total_page,
total_filter: resp.data.total_filter
}
context.commit("update_conclusions", data.records)
context.commit("update_total_conclusion", data.total)
if (context.state.last_id == -1) {
if (resp.data && resp.data.records > 0) {
context.commit("update_selected_conclusion", resp.data.records[0])
}
} else {
let idx = _.findIndex(resp.data.records, function(o) {
return o.NonlabConclusionID == context.state.selected_conclusion.NonlabConclusionID
});
if (idx >= 0) {
context.commit("update_selected_conclusion", resp.data.records[idx]);
}
}
}
} catch (e) {
context.commit("update_lookup_search", 3)
context.commit("update_error_message", e.message)
console.log(e)
}
},
async addnonlab(context, prm) {
context.commit("update_save_status", 1)
try {
context.commit("update_loading_save", true)
prm.token = one_token()
let resp = await api.addnonlab(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)
let data = resp.data
var msg = prm.name + " 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 editnonlab(context, prm) {
context.commit("update_save_status", 1)
try {
context.commit("update_loading_save", true)
prm.token = one_token()
let resp = await api.editnonlab(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)
let data = resp.data
var msg = prm.name + " berhasil di edit"
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 deletenonlab(context, prm) {
context.commit("update_save_status", 1)
try {
context.commit("update_loading_save", true)
prm.token = one_token()
let resp = await api.deletenonlab(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 = prm.name + " berhasil dihapus"
context.commit("update_msg_success", msg)
context.commit("update_alert_success", true)
context.dispatch("search")
}
} catch (e) {
context.commit("update_loading_save", false)
context.commit("update_error_message", e.message)
context.commit("update_alert_error", true)
context.commit("update_dialog_error", true)
}
}
}
}

View File

@@ -0,0 +1,169 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/nonlabtest.js"
export default {
namespaced: true,
state: {
lookup_search: 0,
nonlabtests: [],
total_nonlabtest: 0,
error_message: "",
selected_nonlabtest: {},
last_id: -1,
current_page: 1,
x_search: "",
selected_nonlabconclusiontestid: 0,
dialog_form: false,
act: 'new',
loading_save: false,
save_status: 2,
alert_error: false,
dialog_error: false,
msg_success: "",
alert_success: false,
statuss: [{"M_StatusID": "A", "M_StatusName": "Semua"},{"M_StatusID": "Y", "M_StatusName": "Terpilih"},{"M_StatusID": "N", "M_StatusName": "Belum terpilih"}],
selected_statuss: {"M_StatusID": "A", "M_StatusName": "Semua"}
},
mutations: {
update_lookup_search(state, val) {
state.lookup_search = val
},
update_nonlabtests(state, val) {
state.nonlabtests = val
},
update_total_nonlabtest(state, val) {
state.total_nonlabtest = val
},
update_error_message(state, val) {
state.error_message = val
},
update_selected_nonlabtest(state, val) {
state.selected_nonlabtest = 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_selected_nonlabconclusiontestid(state, val) {
state.selected_nonlabconclusiontestid = val
state.current_page = 1
},
update_dialog_form(state, val) {
state.dialog_form = val
},
update_act(state, val) {
state.act = val
},
update_loading_save(state, val) {
state.loading_save = 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_statuss(state, val) {
state.statuss = val
},
update_selected_statuss(state, val) {
state.selected_statuss = val
}
},
actions: {
async lookuptest(context, prm) {
context.commit("update_lookup_search", 1)
try {
var prm = {
token: one_token(),
search: context.state.x_search,
current_page: context.state.current_page,
last_id: context.state.last_id,
conclusionid: context.state.selected_nonlabconclusiontestid,
status: context.state.selected_statuss.M_StatusID
}
let resp = await api.lookuptest(prm)
if (resp.status != "OK") {
context.commit("update_lookup_search", 3)
} else {
context.commit("update_lookup_search", 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_nonlabtests", data.records)
context.commit("update_total_nonlabtest", data.total)
if (context.state.last_id == -1) {
if (resp.data && resp.data.records > 0) {
context.commit("update_selected_nonlabtest", resp.data.records[0])
}
} else {
let idx = _.findIndex(resp.data.records, function(o) {
return o.Nat_TestID == context.state.selected_nonlabtest.Nat_TestID
});
if (idx >= 0) {
context.commit("update_selected_nonlabtest", resp.data.records[idx]);
}
}
}
} catch (e) {
context.commit("update_lookup_search", 3)
context.commit("update_error_message", e.message)
console.log(e)
}
},
async saveedittestmap(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.saveedittestmap(prm)
if (resp.status != 'OK') {
context.commit("update_save_status", 3)
context.commit("update_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.name + " batal dipilih"
} else {
msg = "Pemeriksaan " + prm.name + " 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_error_message", resp.message)
context.commit("update_alert_error", true)
console.log(e)
}
},
}
}

View File

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