Flatten nested repos

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

View File

@@ -0,0 +1,88 @@
// API :
// search bank
// paramater : query , page , rowPerPage
const URL =
"/one-api/mockup/sampling/verification_2/";
export async function search(nolab, search) {
try {
var resp = await axios.post(URL + 'handling_patient/search', {
search: search,
nolab: nolab
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search_sent() {
try {
var resp = await axios.post(URL + 'handling_patient/search_sent', {});
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 send(ids) {
try {
var resp = await axios.post(URL + 'handling_patient/send', {
ids: ids
});
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 remove(id) {
try {
var resp = await axios.post(URL + 'handling_patient/remove', {
id: id
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,67 @@
// API :
// search bank
// paramater : query , page , rowPerPage
const URL =
"/one-api/mockup/sampling/verification_2/";
export async function search(nolab, search) {
try {
var resp = await axios.post(URL + 'receive_patient/search', {
search: search,
nolab: nolab
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search_sent() {
try {
var resp = await axios.post(URL + 'receive_patient/search_sent', {});
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 receive(ids) {
try {
var resp = await axios.post(URL + 'receive_patient/receive', {
ids: ids
});
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,140 @@
// API :
// search bank
// paramater : query , page , rowPerPage
const URL =
"/one-api/mockup/sampling/verification_2/";
export async function search(nolab, search) {
try {
var resp = await axios.post(URL + 'verification_patient/search', {
search: search,
nolab: nolab
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
// export async function search_sent() {
// try {
// var resp = await axios.post(URL + 'receive_patient/search_sent', {});
// 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 verify(token, orderid, laststatusid, datax) {
try {
var resp = await axios.post(URL + 'verification_patient/verify', {
orderid: orderid,
laststatusid: laststatusid,
data: datax,
token: token
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function reject(orderid, laststatusid, datax) {
try {
var resp = await axios.post(URL + 'verification_patient/reject', {
orderid: orderid,
laststatusid: laststatusid,
data: datax
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function get_requirement(order_id, sample_id) {
try {
var resp = await axios.post(URL + 'verification_patient/get_requirement', {
order_id: order_id,
sample_id: sample_id
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function save_requirement(token, order_id, sample_id, status, reqs) {
try {
var resp = await axios.post(URL + 'verification_patient/save_requirement', {
token: token,
order_id: order_id,
sample_id: sample_id,
status: status,
reqs: reqs
});
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,208 @@
<template>
<v-layout class="fill-height" column>
<v-card class="mb-2 pa-2 searchbox">
<v-layout row>
<v-flex xs12>
<v-layout>
<v-text-field class="flex xs4 ma-1"
placeholder="No Lab"
single-line
outline
hide-details
v-model="nolab"
@keyup.native="keySearch"
></v-text-field>
<v-text-field class="flex xs8 ma-1"
label=""
placeholder="Nama"
single-line
outline
hide-details
v-model="search"
@keyup.native="keySearch"
></v-text-field>
<v-btn class="mr-1 ml-1 one-btn-icon fz-2" color="success" @click="search_patient" large block fill-height >
<span class="icon-search"></span>
</v-btn>
<v-btn class="mr-1 ml-1 one-btn-icon fz-2" color="info" @click="receive" large block fill-height >
<v-icon>send</v-icon>
</v-btn>
</v-layout>
</v-flex>
<!-- <v-flex xs4>
<v-layout>
</v-layout>
</v-flex> -->
</v-layout>
</v-card>
<v-card class="grow">
<v-subheader>
<h3 class="title">SPECIMEN DARI SAMPLING</h3>
</v-subheader>
<v-data-table
:headers="headers" :items="patients"
:loading="isLoading"
hide-actions class="xelevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pl-2 pr-2"
@click="select(props.item)">
{{ oneMoment(props.item.date)}}
</td>
<td class="text-xs-left pl-2 pr-2"
@click="select(props.item)">
{{ props.item.lab }}
</td>
<td class="pl-2 pr-2"
@click="select(props.item)">
{{ props.item.sid}}
</td>
<td class="text-xs-left pl-2 pr-2"
@click="select(props.item)">
{{ props.item.name }}
</td>
<td class="text-xs-left pl-2 pr-2"
@click="select(props.item)">
<v-checkbox :value="props.item.id" v-model="ids" hide-details></v-checkbox>
</td>
</template>
</v-data-table>
</v-card>
</v-layout>
</template>
<style scoped>
.fz-2 {
font-size: 1.5em
}
.v-btn--large {
height: 52px;
}
</style>
<script>
module.exports = {
data() {
return {
query: "",
items: [],
headers: [
{
text: "SAMPLING",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NO LAB",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "SAMPLE ID",
align: "left",
sortable: false,
value: "lab",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
value: "name",
width: "25%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "Pilih",
align: "left",
sortable: false,
value: "status",
width: "5%",
class: "pa-2 blue lighten-3 white--text"
}
],
isLoading: false,
// patients: [
// {"status":"","date":"2019-02-21 10:00:00",
// "lab":"08000198909", "sid": "08000198909-S",
// "name": "Pasien Umum", "selected":false},
// {"status":"","date":"2019-02-22 06:30:00",
// "lab":"08000198111", "sid": "08000198111-2",
// "name": "Heri Suryawan", "selected":false},
// {"status":"","date":"2019-02-22 06:45:00",
// "lab":"08000198222", "sid": "08000198222-U",
// "name": "LUKA MODRIC","selected":true},
// ]
};
},
methods : {
oneMoment : function(d) {
return window.oneMoment(d)
},
search_patient () {
this.$store.dispatch('receive_patient/search')
},
receive () {
this.$store.dispatch('receive_patient/receive')
},
select(item) {
this.$store.commit('receive_patient/update_selected_patient', item)
},
keySearch(e) {
if (e.which == 13) {
this.search_patient()
}
}
},
computed : {
patients () {
return this.$store.state.receive_patient.patients
},
nolab : {
get () {
return this.$store.state.receive_patient.nolab
},
set (v) {
this.$store.commit('receive_patient/update_nolab', v)
}
},
search : {
get () {
return this.$store.state.receive_patient.search
},
set (v) {
this.$store.commit('receive_patient/update_search', v)
}
},
ids : {
get () {
return this.$store.state.receive_patient.ids
},
set (v) {
this.$store.commit('receive_patient/update_ids', v)
}
}
}
}
</script>

View File

@@ -0,0 +1,148 @@
<template>
<v-layout class="fill-height" column>
<v-card class="grow">
<v-subheader>
<h3 class="title">DAFTAR PENERIMAAN SPECIMEN</h3>
</v-subheader>
<hr style="border-top:0px solid #c8c8c8;"></hr>
<v-data-table
:headers="headers" :items="patients"
:loading="isLoading"
hide-actions class="xelevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pl-2 pr-2"
@click="select(props.item)">
{{ oneMoment(props.item.date) }}
</td>
<td class="text-xs-left pl-2 pr-2"
@click="select(props.item)">
{{ props.item.lab }}
</td>
<td class="pl-2 pr-2"
@click="select(props.item)">
{{ props.item.sid}}
</td>
<td class="text-xs-left pl-2 pr-2"
@click="select(props.item)">
{{ props.item.name }}
</td>
<td class="text-xs-left pl-2 pr-2"
@click="select(props.item)">
<v-btn v-show="props.item.status == 'SAMPLING.Sampling.To.Verification'" block flat>Pending</v-btn>
<v-btn v-show="props.item.status == 'SAMPLING.Verification.From.Sampling'" block color="primary" flat>Diterima</v-btn>
<v-btn v-show="props.item.status == 'SAMPLING.Verification.Verify'" block color="success" flat>Diverifikasi</v-btn>
<v-btn v-show="props.item.status == 'SAMPLING.Verification.Reject'" block color="red" dark flat>Ditolak</v-btn>
</td>
<td class="text-xs-left pl-2 pr-2 text-xs-center">
<v-btn flat icon color="red"
@click="remove(props.item)"
v-show="props.item.status == 'SAMPLING.Sampling.To.Verification'">
<v-icon>delete</v-icon>
</v-btn>
</td>
</template>
</v-data-table>
</v-card>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot{
min-height:60px;
}
.searchbox .v-btn {
min-height:60px;
}
</style>
<script>
module.exports = {
data() {
return {
query: "",
items: [],
headers: [
{
text: "KIRIM",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NO LAB",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "SAMPLE ID",
align: "left",
sortable: false,
value: "lab",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
value: "name",
width: "25%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "STATUS",
align: "center",
sortable: false,
value: "status",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "ACTION",
align: "center",
sortable: false,
value: "status",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
}
],
isLoading: false
};
},
methods : {
oneMoment : function(d) {
return window.oneMoment(d)
},
select (item) {
// this.$store.commit('ver_verification/update_selected_sent_sample', item)
},
remove (item) {
// this.$store.commit('ver_verification/update_selected_sent_sample', item)
// this.$store.dispatch('ver_verification/remove')
}
},
computed : {
patients () {
return this.$store.state.receive_patient.sent_patients
}
}
}
</script>

View File

@@ -0,0 +1,187 @@
<template>
<v-dialog
v-model="dialog"
:width="this.requirements.length <= 5 ? 500 : 900"
>
<v-card>
<v-card-title
class="headline grey lighten-2 pt-2 pb-2"
primary-title
>
Sample Verification
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row wrap>
<v-flex v-bind:class="this.requirements.length <= 5 ? 'xs12' : 'xs6'">
<v-layout row wrap>
<v-flex xs12 v-for="(req, i) in reqs_odd" v-bind:key="i">
<v-checkbox :label="req.req_name" v-model="selected_requirements" :value="req.req_id"
hide-details
class="mt-2"></v-checkbox>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs6 v-if="this.requirements.length > 5">
<v-layout row wrap>
<v-flex xs12 v-for="(req, i) in reqs_even" v-bind:key="i">
<v-checkbox :label="req.req_name" v-model="selected_requirements" :value="req.req_id"
hide-details
class="mt-2"></v-checkbox>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
<v-layout row wrap>
<v-flex xs12 pt-4>
<v-textarea
auto-grow
label="Catatan"
rows="3"
v-model="note"
outline
></v-textarea>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-btn
color="primary"
flat
@click="dialog = false"
>
Tutup
</v-btn>
<v-spacer></v-spacer>
<v-btn
color="red"
@click="save_reject"
:disabled="selected_requirements.length < 1"
:dark="selected_requirements.length > 0"
>
Tolak
</v-btn>
<v-btn
color="primary"
@click="save_process"
:disabled="selected_requirements.length < 1"
:dark="selected_requirements.length > 0"
>
Proses
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<style scoped>
</style>
<script>
module.exports = {
components : {
},
methods : {
save_reject () {
this.$store.dispatch('verification_patient/reject')
// this.$store.dispatch('verification_patient/save_requirement', "N")
},
save_process () {
this.$store.dispatch('verification_patient/verify')
}
},
computed : {
dialog: {
get() {
return this.$store.state.verification_patient.dialog_requirement;
},
set(val) {
this.$store.commit('verification_patient/update_dialog_requirement', val);
}
},
requirements () {
if (this.$store.state.verification_patient.selected_patient.reqs)
return this.$store.state.verification_patient.selected_patient.reqs
return []
},
selected_requirements : {
get () {
return this.$store.state.verification_patient.selected_requirements
},
set (v) {
this.$store.commit('verification_patient/update_selected_requirements', v)
}
},
note : {
get () {
let x = this.$store.state.verification_patient.selected_patient.data
if (typeof x == "undefined")
return ""
return x.note
},
set (v) {
this.$store.commit('verification_patient/update_verification_note', v)
}
},
reqs_odd () {
if (!this.requirements)
return []
if (this.requirements.length <= 5)
return this.requirements
if (this.requirements <= 10)
return this.requirements.slice(0,4)
else {
let x = Math.ceil(this.requirements.length / 2)
return this.requirements.slice(0, x-1)
}
},
reqs_even () {
if (!this.requirements)
return []
if (this.requirements.length <= 5)
return []
if (this.requirements <= 10)
return this.requirements.slice(5, this.requirements-1)
else {
let x = Math.ceil(this.requirements.length / 2)
return this.requirements.slice(x, this.requirements.length-1)
}
}
},
mounted () {
this.$store.dispatch('verification_patient/get_requirement')
},
watch : {
dialog(n, o) {
let x = this.$store.state.verification_patient.reqs
if (n && !o)
this.$store.commit('verification_patient/update_selected_requirements', x)
}
}
}
</script>

View File

@@ -0,0 +1,65 @@
<template>
<v-layout>
<v-flex xs12 text-xs-center mb-2>
<v-card color="blue lighten-4">
<v-card-text class="pb-0 pt-1">
<v-btn
v-for="tab in tabs"
:color="tab.code == active ? 'white' : 'grey lighten-5'"
class="white--text ma-0 tab-btn"
:class="[tab.code == active ? 'active' : '']"
@click="changeTab(tab.code)"
flat
:key="tab.code"
:data="tab"
>
<v-icon left dark>{{ tab.icon }}</v-icon>
<h6 class="title">{{ tab.label }}</h6>
</v-btn>
</v-card-text>
</v-card>
</v-flex>
</v-layout>
</template>
<style scoped>
.active {
border-bottom: solid 3px #ffeb3b!important;
}
.tab-btn {
min-width: 400px;
}
</style>
<script>
module.exports = {
data () {
return {
}
},
methods : {
changeTab (x) {
// this.active = x;
this.$store.commit('change_tab', x);
}
},
computed : {
tabs : {
get () {
return this.$store.state.tabs
},
set (v) {
return
}
},
active () {
return this.$store.state.tab_active
}
}
}
</script>

View File

@@ -0,0 +1,213 @@
<template>
<v-layout class="fill-height" column>
<v-card class="mb-2 pa-2 searchbox">
<v-layout row>
<v-flex xs12>
<v-layout>
<v-text-field class="flex xs4 ma-1"
placeholder="No Lab"
single-line
outline
hide-details
v-model="nolab"
@keyup.native="keySearch"
></v-text-field>
<v-text-field class="flex xs8 ma-1"
label=""
placeholder="Nama"
single-line
outline
hide-details
v-model="search"
@keyup.native="keySearch"
></v-text-field>
<v-btn class="mr-1 ml-1 one-btn-icon fz-2" color="success" @click="search_patient" large block fill-height >
<span class="icon-search"></span>
</v-btn>
<v-btn class="mr-1 ml-1 one-btn-icon fz-2" color="info" @click="send" large block fill-height >
<v-icon>send</v-icon>
</v-btn>
</v-layout>
</v-flex>
<!-- <v-flex xs4>
<v-layout>
<v-btn class="flex xs6 ma-1" color="success" @click="search_patient" >
Search
</v-btn>
<v-btn class="flex xs6 ma-1" color="info" @click="send" >
Kirim
</v-btn>
</v-layout>
</v-flex> -->
</v-layout>
</v-card>
<v-card class="grow">
<v-subheader>
<h3 class="title">SPECIMEN SIAP KIRIM</h3>
</v-subheader>
<v-data-table
:headers="headers" :items="patients"
:loading="isLoading"
hide-actions class="xelevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2"
@click="select(props.item)">
{{ oneMoment(props.item.date)}}
</td>
<td class="text-xs-left pa-2"
@click="select(props.item)">
{{ props.item.lab }}
</td>
<td class="pa-2"
@click="select(props.item)">
{{ props.item.sid}}
</td>
<td class="text-xs-left pa-2"
@click="select(props.item)">
{{ props.item.name }}
</td>
<td class="text-xs-left pa-2"
@click="select(props.item)">
<v-checkbox :value="props.item.id" v-model="ids" hide-details></v-checkbox>
</td>
</template>
</v-data-table>
</v-card>
</v-layout>
</template>
<style scoped>
.fz-2 {
font-size: 1.5em
}
.v-btn--large {
height: 52px;
}
</style>
<script>
module.exports = {
data() {
return {
query: "",
items: [],
headers: [
{
text: "SAMPLING",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NO LAB",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "SAMPLE ID",
align: "left",
sortable: false,
value: "lab",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
value: "name",
width: "25%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "Pilih",
align: "left",
sortable: false,
value: "status",
width: "5%",
class: "pa-2 blue lighten-3 white--text"
}
],
isLoading: false,
// patients: [
// {"status":"","date":"2019-02-21 10:00:00",
// "lab":"08000198909", "sid": "08000198909-S",
// "name": "Pasien Umum", "selected":false},
// {"status":"","date":"2019-02-22 06:30:00",
// "lab":"08000198111", "sid": "08000198111-2",
// "name": "Heri Suryawan", "selected":false},
// {"status":"","date":"2019-02-22 06:45:00",
// "lab":"08000198222", "sid": "08000198222-U",
// "name": "LUKA MODRIC","selected":true},
// ]
};
},
methods : {
oneMoment : function(d) {
return window.oneMoment(d)
},
search_patient () {
this.$store.dispatch('handling_patient/search')
},
send () {
this.$store.dispatch('handling_patient/send')
},
select(item) {
this.$store.commit('handling_patient/update_selected_patient', item)
},
keySearch(e) {
if (e.which == 13) {
this.search_patient()
}
}
},
computed : {
patients () {
return this.$store.state.handling_patient.patients
},
nolab : {
get () {
return this.$store.state.handling_patient.nolab
},
set (v) {
this.$store.commit('handling_patient/update_nolab', v)
}
},
search : {
get () {
return this.$store.state.handling_patient.search
},
set (v) {
this.$store.commit('handling_patient/update_search', v)
}
},
ids : {
get () {
return this.$store.state.handling_patient.ids
},
set (v) {
this.$store.commit('handling_patient/update_ids', v)
}
}
}
}
</script>

View File

@@ -0,0 +1,145 @@
<template>
<v-layout class="fill-height" column>
<v-card class="grow">
<v-subheader>
<h3 class="title">PENGIRIMAN KE SPECIMEN HANDLING</h3>
</v-subheader>
<hr style="border-top:0px solid #c8c8c8;"></hr>
<v-data-table
:headers="headers" :items="patients"
:loading="isLoading"
hide-actions class="xelevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2"
@click="select(props.item)">
{{ oneMoment(props.item.date) }}
</td>
<td class="text-xs-left pa-2"
@click="select(props.item)">
{{ props.item.lab }}
</td>
<td class="pa-2"
@click="select(props.item)">
{{ props.item.sid}}
</td>
<td class="text-xs-left pa-2"
@click="select(props.item)">
{{ props.item.name }}
</td>
<td class="text-xs-left pa-2"
@click="select(props.item)">
<v-btn v-show="props.item.status == 'SAMPLING.Verification.To.SampleHandling'" block flat>Pending</v-btn>
<v-btn v-show="props.item.status == 'SAMPLING.Handling.From.Verification'" block color="primary" flat>Diterima</v-btn>
</td>
<td class="text-xs-left pa-2 text-xs-center">
<v-btn flat icon color="red"
@click="remove(props.item)"
v-show="props.item.status == 'SAMPLING.Verification.To.Handling'">
<v-icon>delete</v-icon>
</v-btn>
</td>
</template>
</v-data-table>
</v-card>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot{
min-height:60px;
}
.searchbox .v-btn {
min-height:60px;
}
</style>
<script>
module.exports = {
data() {
return {
query: "",
items: [],
headers: [
{
text: "KIRIM",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NO LAB",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "SAMPLE ID",
align: "left",
sortable: false,
value: "lab",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
value: "name",
width: "25%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "STATUS",
align: "center",
sortable: false,
value: "status",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "ACTION",
align: "center",
sortable: false,
value: "status",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
}
],
isLoading: false
};
},
methods : {
oneMoment : function(d) {
return window.oneMoment(d)
},
select (item) {
// this.$store.commit('ver_verification/update_selected_sent_sample', item)
},
remove (item) {
this.$store.commit('handling_patient/update_selected_sent', item)
this.$store.dispatch('handling_patient/remove')
}
},
computed : {
patients () {
return this.$store.state.handling_patient.sent_patients
}
}
}
</script>

View File

@@ -0,0 +1,262 @@
<template>
<v-layout class="fill-height" column>
<v-card class="grow">
<v-layout column ma-3>
<v-flex xs12>
<h3 class="title mb-2">INFORMASI SPECIMEN :</h3>
</v-flex>
<v-flex xs12>
<v-layout row>
<v-flex xs4>
<v-text-field
label="Durasi Sampling"
outline
v-model="duration_sampling"
readonly
hide-details
></v-text-field>
</v-flex>
<v-flex xs8 ml-2>
<v-text-field
label="Petugas Sampling"
outline
v-model="user_sampling"
readonly
hide-details
></v-text-field>
</v-flex>
</v-layout>
</v-flex>
<v-divider class="mb-3 mt-3"></v-divider>
<v-flex xs12>
<!-- <v-layout row wrap>
<v-flex xs12>
<v-btn color="red" dark @click="reject" v-show="verification_show">
<v-icon>clear</v-icon>
</v-btn>
<v-btn color="blue" dark @click="verify" v-show="verification_show">
<v-icon>done</v-icon>
</v-btn>
</v-flex>
</v-layout> -->
<v-layout row wrap v-show="verification_show">
<v-flex xs12 pt-2>
<v-card color="blue lighten-3 white--text" outlined flat v-show="true">
<v-card-text class="pt-2 pb-2">
<v-layout row wrap>
<v-flex xs6>
<p class="title mt-2 mb-0">Specimen sudah sesuai ?</p>
</v-flex>
<v-flex xs6 class="text-xs-right">
<v-btn color="red" dark class="one-btn-icon mr-1 ma-0" @click="reject">
<v-icon>clear</v-icon>
</v-btn>
<v-btn color="green" class="one-btn-icon ma-0" @click="verify"
dark>
<v-icon>done</v-icon>
</v-btn>
</v-flex>
</v-layout>
</v-card-text>
</v-card>
<v-card>
<v-card-text>
<v-btn color="black" outline flat depressed small dark
v-for="(req, i) in reqs" v-bind:key="i"
class="mt-2 mr-2 ma-0">
{{ req.req_name }}
</v-btn>
</v-card-text>
</v-card>
</v-flex>
</v-layout>
<v-layout row v-if="false">
<v-flex xs6>
<v-layout column>
<v-flex xs12>
<one-field-verification
label="Jenis sampel sesuai"
:value="data.sample_checked"
:note="data.sample_note"
@change="update_data_sample"
v-if="verification_show"
></one-field-verification>
</v-flex>
<v-flex xs12 mt-2>
<one-field-verification
label="Kuantitas OK"
:value="data.quantity_checked"
:note="data.quantity_note"
@change="update_data_quantity"
v-if="verification_show"
></one-field-verification>
</v-flex>
<v-flex xs12 mt-2>
<one-field-verification
label="Kualitas OK"
:value="data.quality_checked"
:note="data.quality_note"
@change="update_data_quality"
v-if="verification_show"
></one-field-verification>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs6 pl-2>
<v-layout column fill-height>
<v-flex xs12>
<v-textarea
auto-grow
label="Catatan"
rows="5"
v-model="note"
outline
v-show="verification_show"
></v-textarea>
</v-flex>
<v-flex xs12>
<v-btn color="red" dark @click="reject" v-show="verification_show">TOLAK</v-btn>
<v-btn color="blue" dark @click="verify" v-show="verification_show">PROSES</v-btn>
</v-flex>
</v-layout>
<v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card>
</v-layout>
</template>
<script>
module.exports = {
components : {
'one-field-verification' : httpVueLoader('./../../common/oneFieldVerification.vue')
},
computed : {
data () {
let x = this.$store.state.verification_patient.selected_patient.data
if (typeof x == "undefined")
return {quality_checked:false,quantity_checked:false,sample_checked:false,
quality_note:"",quantity_note:"",sample_note:""}
x.quality_checked = x.quality == "Y" ? true : false
x.quantity_checked = x.quantity == "Y" ? true : false
x.sample_checked = x.sample == "Y" ? true : false
return x
},
patient () {
return this.$store.state.verification_patient.selected_patient
},
user_sampling () {
let x = this.$store.state.verification_patient.selected_patient
if (typeof x == "undefined")
return '-'
return 'Sampling : ' + x.user_sampling + ' / Receive : ' + x.user_receive
},
duration_sampling () {
let x = this.$store.state.verification_patient.selected_patient
if (typeof x == "undefined")
return '0'
return Math.round(moment.duration(x.sampling_duration).asMinutes()) + ' menit'
},
note : {
get () {
let x = this.$store.state.verification_patient.selected_patient.data
if (typeof x == "undefined")
return ""
return x.note
},
set (v) {
this.$store.commit('verification_patient/update_verification_note', v)
}
},
verification_show : {
get () {
return this.$store.state.verification_patient.verification_show
},
set (v) {
this.$store.commit('verification_patient/update_verification_show', v)
}
},
reqs () {
if (this.$store.state.verification_patient.selected_patient.reqs)
return this.$store.state.verification_patient.selected_patient.reqs
return []
}
},
methods : {
update_data_quality (v) {
let data = { type:"quality", quality:v.checked?"Y":"N", quality_note:v.note }
this.$store.commit('verification_patient/update_verification_data', data)
},
update_data_quantity (v) {
let data = { type:"quantity", quantity:v.checked?"Y":"N", quantity_note:v.note }
this.$store.commit('verification_patient/update_verification_data', data)
},
update_data_sample (v) {
let data = { type:"sample", sample:v.checked?"Y":"N", sample_note:v.note }
this.$store.commit('verification_patient/update_verification_data', data)
},
verify () {
this.$store.commit('verification_patient/update_selected_requirements', [])
this.$store.dispatch('verification_patient/verify')
},
reject () {
this.$store.commit('verification_patient/update_dialog_requirement', true)
// this.$store.dispatch('verification_patient/reject')
},
sampleReqOK () {
this.$store.dispatch('verification_patient/save_requirement', "Y")
},
sampleReqNotOK () {
this.$store.commit('verification_patient/update_dialog_requirement', true)
}
},
mounted () {
this.$store.dispatch('verification_patient/get_requirement')
}
}
</script>

View File

@@ -0,0 +1,214 @@
<template>
<v-layout class="fill-height" column>
<v-card class="mb-2 pa-2 searchbox">
<v-layout row>
<v-flex xs12>
<v-layout>
<v-text-field class="flex xs4 ma-1"
placeholder="No Lab"
single-line
outline
hide-details
v-model="nolab"
@keyup.native="keySearch"
></v-text-field>
<v-text-field class="flex xs8 ma-1"
label=""
placeholder="Nama"
single-line
outline
hide-details
v-model="search"
@keyup.native="keySearch"
></v-text-field>
<v-btn class="mr-1 ml-1 one-btn-icon fz-2" color="success" @click="search_patient" large block fill-height >
<span class="icon-search"></span>
</v-btn>
</v-layout>
</v-flex>
</v-layout>
</v-card>
<v-card class="grow">
<v-subheader>
<h3 class="title">SPECIMEN SIAP VERIFIKASI</h3>
</v-subheader>
<v-data-table
:headers="headers" :items="patients"
:loading="isLoading"
hide-actions class="xelevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2"
@click="select(props.item)"
v-bind:class="is_selected(props.item)">
{{ props.item.sid }}
</td>
<td class="text-xs-left pa-2"
@click="select(props.item)"
v-bind:class="is_selected(props.item)">
{{ props.item.lab }}
</td>
<td class="pa-2"
@click="select(props.item)"
v-bind:class="is_selected(props.item)">
{{ props.item.name }}
</td>
<td class="text-xs-left pa-2"
@click="select(props.item)"
v-bind:class="is_selected(props.item)">
{{ props.item.sample_name }}
</td>
</template>
</v-data-table>
</v-card>
</v-layout>
</template>
<style scoped>
table.v-table tbody td,xtable.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
.fz-2 {
font-size: 1.5em
}
.v-btn--large {
height: 52px;
}
</style>
<script>
module.exports = {
data() {
return {
query: "",
items: [],
headers: [
{
text: "BARCODE ID",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NO LAB",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
value: "name",
width: "25%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "JENIS SAMPEL",
align: "left",
sortable: false,
value: "status",
width: "5%",
class: "pa-2 blue lighten-3 white--text"
}
],
isLoading: false,
// patients: [
// {"status":"","date":"2019-02-21 10:00:00",
// "lab":"08000198909", "sid": "08000198909-S",
// "name": "Pasien Umum", "selected":false},
// {"status":"","date":"2019-02-22 06:30:00",
// "lab":"08000198111", "sid": "08000198111-2",
// "name": "Heri Suryawan", "selected":false},
// {"status":"","date":"2019-02-22 06:45:00",
// "lab":"08000198222", "sid": "08000198222-U",
// "name": "LUKA MODRIC","selected":true},
// ]
};
},
methods : {
oneMoment : function(d) {
return window.oneMoment(d)
},
search_patient () {
this.$store.dispatch('verification_patient/search')
},
verify () {
this.$store.dispatch('verification_patient/verify')
},
select(item) {
this.$store.commit('verification_patient/update_selected_patient', item)
this.$store.commit('verification_patient/update_req_status', item)
},
is_selected (item) {
let x = this.$store.state.verification_patient.selected_patient
if (!x)
return ''
if (x.order_sample_id == item.order_sample_id)
return 'amber lighten-5'
return ''
},
keySearch(e) {
if (e.which == 13) {
this.search_patient()
}
}
},
computed : {
patients () {
return this.$store.state.verification_patient.patients
},
nolab : {
get () {
return this.$store.state.verification_patient.nolab
},
set (v) {
this.$store.commit('verification_patient/update_nolab', v)
}
},
search : {
get () {
return this.$store.state.verification_patient.search
},
set (v) {
this.$store.commit('verification_patient/update_search', v)
}
},
id : {
get () {
return this.$store.state.verification_patient.id
},
set (v) {
this.$store.commit('verification_patient/update_id', v)
}
}
}
}
</script>

View File

@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>One</title>
<link rel="stylesheet" href="../../../libs/vendor/css/google-fonts.css">
<link rel="stylesheet" href="../../../libs/vendor/css/vuetify.min.css">
</head>
<body>
<div v-cloak id="app">
<v-app id="smartApp" >
<one-navbar></one-navbar>
<v-content class="blue lighten-5" >
<v-container fluid pt-2 pb-2 pl-1 pr-1>
<v-layout column>
<v-layout>
<one-sampling-verification-tab></one-sampling-verification-tab>
</v-layout>
<v-layout v-show="tab_active == '01'">
<v-flex xs6 pr-1>
<one-sampling-verification-from-sampling-list></one-sampling-verification-from-sampling-list>
</v-flex>
<v-flex xs6 pl-1>
<one-sampling-verification-receive-list></one-sampling-verification-receive-list>
</v-flex>
</v-layout>
<v-layout v-show="tab_active == '02'">
<v-flex xs6 pr-1>
<one-sampling-verification-verify-list></one-sampling-verification-receive-verify-list>
</v-flex>
<v-flex xs6 pl-1>
<one-sampling-verification-verify></one-sampling-verification-receive-verify>
</v-flex>
</v-layout>
<v-layout v-show="tab_active == '03'">
<v-flex xs6 pr-1>
<one-sampling-verification-to-handling></one-sampling-verification-to-handling>
</v-flex>
<v-flex xs6 pl-1>
<one-sampling-verification-to-handling-sent></one-sampling-verification-to-handling-sent>
</v-flex>
</v-layout>
</v-layout>
</v-container>
<one-sampling-verification-requirement></one-sampling-verification-requirement>
</v-content>
<one-footer> </one-footer>
</v-app>
</div>
<!-- Vendor -->
<script src="../../../libs/vendor/axios.min.js"></script>
<script src="../../../libs/vendor/moment.min.js"></script>
<script src="../../../libs/vendor/moment-locale-id.js"></script>
<script src="../../../libs/vendor/vue.js"></script>
<script src="../../../libs/vendor/vuex.js"></script>
<script src="../../../libs/vendor/vuetify.js"></script>
<script src="../../../libs/vendor/httpVueLoader.js"></script>
<script src="../../../libs/one_global.js"></script>
<!-- App Script -->
<?php
$ts = "?ts=" . Date("ymdhis");
?>
<script type="module">
import { store } from './store.js<?php echo $ts ?>';
//for testing
window.store = store;
new Vue({
store,
el: '#app',
components: {
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
'one-sampling-verification-tab': httpVueLoader('./components/oneSamplingVerificationTab.vue'),
'one-sampling-verification-from-sampling-list': httpVueLoader('./components/oneSamplingVerificationFromSamplingList.vue'),
'one-sampling-verification-receive-list': httpVueLoader('./components/oneSamplingVerificationReceiveList.vue'),
'one-sampling-verification-verify-list': httpVueLoader('./components/oneSamplingVerificationVerifyList.vue'),
'one-sampling-verification-verify': httpVueLoader('./components/oneSamplingVerificationVerify.vue'),
'one-sampling-verification-to-handling': httpVueLoader('./components/oneSamplingVerificationToHandling.vue'),
'one-sampling-verification-to-handling-sent': httpVueLoader('./components/oneSamplingVerificationToHandlingSent.vue'),
'one-sampling-verification-requirement': httpVueLoader('./components/oneSamplingVerificationRequirement.vue')
},
computed : {
tab_active () {
return store.state.tab_active
}
},
mounted () {
store.dispatch('receive_patient/search')
}
})
</script>
<style>
[v-cloak] {
display: none
}
</style>
</body>
</html>

View File

@@ -0,0 +1,162 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/handling_patient.js"
window.api = api
export default {
namespaced: true,
state: {
nolab:'',
search: '',
search_status:0,
search_error_message:'',
search_dialog_is_active: false,
patients: [],
sent_patients: [],
total_patient: 0,
sent_total_patient: 0,
selected_patient: {
},
selected_sent: {},
ids : []
},
mutations: {
update_search_dialog_is_active(state,status) {
state.search_dialog_is_active = status
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_noreg(state,val) {
state.noreg=val
},
update_search(state,val) {
state.search=val
},
update_search_status(state,status) {
state.search_status = status
},
update_patients(state, data) {
state.patients= data.records
state.total_patient = data.total
},
update_selected_patient(state,val) {
state.selected_patient=val
},
update_nolab(state, val) {
state.nolab = val
},
update_sent_patients(state, data) {
state.sent_patients= data.records
state.sent_total_patient = data.total
},
update_ids(state, ids) {
state.ids = ids
},
update_selected_sent(state, item) {
state.selected_sent = item
}
},
actions: {
async search(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.search(context.state.nolab, context.state.search)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message",resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_patients", data)
context.dispatch('search_sent')
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
},
async search_sent(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.search_sent()
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_sent_patients", data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
},
async send(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.send(context.state.ids.join(','))
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message",resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
context.dispatch('handling_patient/search', null, {root:true})
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
},
async remove(context) {
context.commit("update_search_status", 1)
try {
let resp = await api.remove(context.state.selected_sent.id)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message",resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
context.dispatch('handling_patient/search', null, {root:true})
}
} catch(e) {
console.log(e.message)
context.commit("update_search_status", 3)
context.commit("update_search_error_message", e.message )
}
}
}
}

View File

@@ -0,0 +1,135 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/receive_patient.js"
window.api = api
export default {
namespaced: true,
state: {
nolab:'',
search: '',
search_status:0,
search_error_message:'',
search_dialog_is_active: false,
patients: [],
sent_patients: [],
total_patient: 0,
sent_total_patient: 0,
selected_patient: {
},
ids : []
},
mutations: {
update_search_dialog_is_active(state,status) {
state.search_dialog_is_active = status
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_noreg(state,val) {
state.noreg=val
},
update_search(state,val) {
state.search=val
},
update_search_status(state,status) {
state.search_status = status
},
update_patients(state, data) {
state.patients= data.records
state.total_patient = data.total
},
update_selected_patient(state,val) {
state.selected_patient=val
},
update_nolab(state, val) {
state.nolab = val
},
update_sent_patients(state, data) {
state.sent_patients= data.records
state.sent_total_patient = data.total
},
update_ids(state, ids) {
state.ids = ids
}
},
actions: {
async search(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.search(context.state.nolab, context.state.search)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message",resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_patients", data)
context.dispatch('search_sent')
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
},
async search_sent(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.search_sent()
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_sent_patients", data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
},
async receive(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.receive(context.state.ids.join(','))
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message",resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
context.dispatch('receive_patient/search', null, {root:true})
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,253 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/verification_patient.js"
window.api = api
export default {
namespaced: true,
state: {
nolab:'',
search: '',
search_status:0,
search_error_message:'',
search_dialog_is_active: false,
patients: [],
sent_patients: [],
total_patient: 0,
sent_total_patient: 0,
selected_patient: {
},
id : [],
verification_show : false,
// requirement
dialog_requirement: false,
requirements: [],
selected_requirements: [],
reqs: [],
req_status: 'X'
},
mutations: {
update_search_dialog_is_active(state,status) {
state.search_dialog_is_active = status
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_noreg(state,val) {
state.noreg=val
},
update_search(state,val) {
state.search=val
},
update_search_status(state,status) {
state.search_status = status
},
update_patients(state, data) {
state.patients= data.records
state.total_patient = data.total
},
update_selected_patient(state,val) {
state.verification_show = false
state.selected_patient=val
setTimeout(function() { state.verification_show = true }, 100)
},
update_nolab(state, val) {
state.nolab = val
},
update_id(state, id) {
state.id = id
},
update_verification_data (state, data) {
let p = state.selected_patient
if (data.type == "quality") {
p.data.quality = data.quality
p.data.quality_note = data.quality_note
} else if (data.type == "quantity") {
p.data.quantity = data.quantity
p.data.quantity_note = data.quantity_note
} else if (data.type == "sample") {
p.data.sample = data.sample
p.data.sample_note = data.sample_note
}
state.selected_patient = p
},
update_verification_note (state, data) {
let p = state.selected_patient
p.data.note = data
state.selected_patient = p
},
update_verification_show(state, v) {
state.verification_show = v
},
update_requirements(state, v) {
state.requirements = v
},
update_selected_requirements(state, v) {
state.selected_requirements = v
},
update_dialog_requirement(state, v) {
state.dialog_requirement = v
},
update_req_status(state, d) {
state.req_status = d.req_status
state.reqs = d.selected_reqs
}
},
actions: {
async search(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.search(context.state.nolab, context.state.search)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_patients", data)
try {
context.commit('update_selected_patient', data.records[0])
} catch (error) {
context.commit('update_selected_patient', {})
}
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
},
async verify(context) {
context.commit("update_search_status", 1)
try {
let data = context.state.selected_patient.data
let resp= await api.verify(one_token(), context.state.selected_patient.order_sample_id,
context.state.selected_patient.id, data)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message","")
// Update REQ
if (context.state.selected_requirements.length > 0)
context.dispatch("save_requirement", "N")
else
context.dispatch("save_requirement", "Y")
// Pindah ke Bawah
// context.dispatch('verification_patient/search', null, {root:true})
}
} catch(e) {
context.commit("update_search_status", 3)
console.log(e.message)
// context.commit("update_search_error_message_2", e.message )
}
},
async reject(context) {
context.commit("update_search_status", 1)
try {
let data = context.state.selected_patient.data
let resp= await api.reject(context.state.selected_patient.order_sample_id,
context.state.selected_patient.id, data)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message","")
context.dispatch("save_requirement", "N")
// context.dispatch('verification_patient/search', null, {root:true})
}
} catch(e) {
context.commit("update_search_status", 3)
context.commit("update_search_error_message_2", e.message )
}
},
async get_requirement(context) {
// context.commit("update_search_status", 1)
try {
let resp= await api.get_requirement()
if (resp.status != "OK") {
// context.commit("update_search_status", 3)
// context.commit("update_search_error_message", resp.message)
} else {
// context.commit("update_search_status",2)
// context.commit("update_search_error_message","")
context.commit("update_requirements", resp.data)
}
} catch(e) {
console.log(e)
// context.commit("update_search_status", 3)
// context.commit("update_search_error_message", e.message )
}
},
async save_requirement(context, status) {
// context.commit("update_search_status", 1)
try {
let resp= await api.save_requirement(one_token(), context.state.selected_patient.T_OrderHeaderID,
context.state.selected_patient.order_sample_id,
status,
JSON.stringify(context.state.selected_requirements))
if (resp.status != "OK") {
// context.commit("update_search_status", 3)
// context.commit("update_search_error_message", resp.message)
} else {
// context.commit("update_search_status",2)
// context.commit("update_search_error_message","")
context.commit('update_dialog_requirement', false)
context.commit('update_req_status',
{ req_status:status, reqs:context.state.selected_requirements})
// Pindahan
context.dispatch('search')
}
} catch(e) {
console.log(e)
// context.commit("update_search_status", 3)
// context.commit("update_search_error_message", e.message )
}
}
}
}

View File

@@ -0,0 +1,34 @@
// State
// data ...
// Mutations
//
//
// Actions
import receive_patient from "./modules/receive_patient.js";
import verification_patient from "./modules/verification_patient.js";
import handling_patient from "./modules/handling_patient.js";
import system from "../../../apps/modules/system/system.js";
export const store = new Vuex.Store({
state : {
tab_active : '01',
tabs : [
{"label":"TERIMA DARI SPECIMEN", "icon":"opacity", "code":"01"},
{"label":"SPECIMEN VERIFICATION", "icon":"verified_user", "code":"02"},
{"label":"KIRIM KE SPECIMEN HANDLING", "icon":"verified_user", "code":"03"}
]
},
mutations : {
change_tab(state, tab) {
state.tab_active = tab;
}
},
modules : {
receive_patient: receive_patient,
verification_patient: verification_patient,
handling_patient: handling_patient,
system: system
}
});