Flatten nested repos
This commit is contained in:
21
test/vuex/one-sample-lab/api/order_info.js
Normal file
21
test/vuex/one-sample-lab/api/order_info.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const URL = "/one-api/mockup/samplinglab/";
|
||||
|
||||
export async function search(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'order/info',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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
449
test/vuex/one-sample-lab/api/samplecall.js
Normal file
449
test/vuex/one-sample-lab/api/samplecall.js
Normal file
@@ -0,0 +1,449 @@
|
||||
const URL = "/one-api/mockup/samplinglab/";
|
||||
|
||||
export async function search(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/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 saverequirement(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/saverequirement',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 receivesample(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/receivesample',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 search_staff(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/search_staff',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 searchcompany(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/searchcompany',{token:token,search:prm});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function search_patient(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/search_patient',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 getrequirements(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/getrequirements',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 getstationstatus(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/getstationstatus',{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 save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/save',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 newsamplingcall(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/newsamplingcall',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function xdelete(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/deletesamplingcall',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 getaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/getaddress',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 searchcity(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/searchcity',{token:token,search:prm});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getdistrict(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/getdistrict',{id:prm.M_CityID,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 getkelurahan(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/getkelurahan',{token:token,id:prm.M_DistrictID});
|
||||
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 savenewaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/savenewaddress',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 saveeditaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/saveeditaddress',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 deleteaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/deleteaddress',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 getsampletypes(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/getsampletypes',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 doaction(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/doaction',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 addnewlabel(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/addnewlabel',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 getdatanoterequirement(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/getdatanoterequirement',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 savenotesampling(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'samplingcall/savenotesampling',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
|
||||
};
|
||||
}
|
||||
}
|
||||
69
test/vuex/one-sample-lab/components/oneOrderInfo.vue
Normal file
69
test/vuex/one-sample-lab/components/oneOrderInfo.vue
Normal file
@@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<div v-show="show" class="orderbox">
|
||||
<h3>Daftar Pemeriksaan
|
||||
<v-progress-circular
|
||||
style="height:20px"
|
||||
v-show="loading" :indeterminate="true">
|
||||
</v-progress-circular>
|
||||
<v-icon style="float:right;top:-10px;height:20px;" @click="show=false"> close</v-icon>
|
||||
</h3>
|
||||
|
||||
<div class="px" v-for="order in orders" >
|
||||
{{order.name}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.orderbox{
|
||||
position: fixed;
|
||||
bottom:0px;
|
||||
left:50%;
|
||||
width: 640px;
|
||||
height:300px;
|
||||
margin-left:-320px;
|
||||
z-index:99;
|
||||
background-color: rgba(230, 255, 230,0.9);
|
||||
color: #004d00;
|
||||
padding:20px;
|
||||
border-radius-top: 10px;
|
||||
overflow-y:scroll;
|
||||
overflow-x:hidden;
|
||||
}
|
||||
.px {
|
||||
padding:5px;
|
||||
width: 280px;
|
||||
border: 1px solid #004d00;
|
||||
display:inline-block;
|
||||
margin: 0px 2px 0px 2px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
},
|
||||
computed: {
|
||||
orders() {
|
||||
return this.$store.state.order_info.orders
|
||||
},
|
||||
loading() {
|
||||
return this.$store.state.order_info.loading
|
||||
}
|
||||
,show : {
|
||||
get() { return this.$store.state.order_info.show}
|
||||
,set(v) { return this.$store.commit("order_info/update_show",v) }
|
||||
}
|
||||
,sel_patient() {
|
||||
return this.$store.state.samplecall.selected_patient
|
||||
}
|
||||
},
|
||||
methods : {
|
||||
},
|
||||
watch : {
|
||||
async sel_patient(n,o) {
|
||||
this.$store.dispatch("order_info/search",{id:n.T_OrderHeaderID})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
470
test/vuex/one-sample-lab/components/oneSampleCallSODetail.vue
Normal file
470
test/vuex/one-sample-lab/components/oneSampleCallSODetail.vue
Normal file
@@ -0,0 +1,470 @@
|
||||
<template>
|
||||
<v-layout class="mb-2 mt-2" column >
|
||||
<v-dialog
|
||||
v-model="dialognote"
|
||||
width="40%"
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline white--text error"
|
||||
primary-title
|
||||
>
|
||||
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text>
|
||||
|
||||
<v-layout v-if="selected_patient.fo_note != ''" mb-2 row>
|
||||
<v-flex mb-2 xs3>
|
||||
<span style="color: #0e6fbc" class="mono name">Catatan </span>
|
||||
</v-flex>
|
||||
<v-flex xs9>
|
||||
<v-layout row>
|
||||
<v-flex mb-1 xs12>
|
||||
<code style="box-shadow: none !important;color: #0e6fbc !important;background-color: #2196f34d !important;">front office</code>
|
||||
<div class="v-markdown">
|
||||
<p style="margin-top:2px;margin-bottom:0">{{selected_patient.fo_note}}</p>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<!--<v-layout row>
|
||||
<v-flex mb-1 xs12>
|
||||
<code style="box-shadow: none !important;color: #0e6fbc !important;background-color: #2196f34d !important;">specimen</code>
|
||||
<div class="v-markdown">
|
||||
<p style="margin-bottom:0">Specifies which DOM element that this component</p>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>-->
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout v-if="xnoterequirement.length > 0" mb-2 row>
|
||||
<v-flex mb-2 xs3>
|
||||
<span style="color: #c0341d" class="mono name">Requirement </span>
|
||||
</v-flex>
|
||||
<v-flex xs9>
|
||||
<v-layout v-for="notereq in xnoterequirement" row>
|
||||
<v-flex mb-1 xs12>
|
||||
<code style="box-shadow: none !important;color: #c0341d !important;background-color: #fbe5e1 !important;">{{notereq.position}}</code>
|
||||
<div class="v-markdown">
|
||||
<p style="margin-top:2px;margin-bottom:0">{{notereq.requirements}}</p>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<!--<v-layout row>
|
||||
<v-flex mb-1 xs12>
|
||||
<code style="box-shadow: none !important;color: #c0341d !important;background-color: #fbe5e1 !important;">Specimen</code>
|
||||
<div class="v-markdown">
|
||||
<p style="margin-bottom:0">Tidak Puasa, Puasa Lebih, Obat Diuretik dan Cafein</p>
|
||||
</div>
|
||||
</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="grey"
|
||||
dark
|
||||
flat
|
||||
text
|
||||
@click="dialognote = false"
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog
|
||||
v-model="dialogformnote"
|
||||
width="40%"
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline white--text primary"
|
||||
primary-title
|
||||
>
|
||||
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text>
|
||||
<v-layout mb-2 row>
|
||||
<v-flex xs12>
|
||||
<v-textarea
|
||||
outline
|
||||
label="Catatan"
|
||||
v-model="selected_patient.sampling_note"
|
||||
></v-textarea>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="grey"
|
||||
dark
|
||||
flat
|
||||
text
|
||||
@click="searchPatientLastSelect"
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-btn
|
||||
color="primary"
|
||||
dark
|
||||
flat
|
||||
text
|
||||
@click="saveNoteSampling()"
|
||||
>
|
||||
Simpan
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogrequirement" persistent max-width="45%">
|
||||
<v-card>
|
||||
<v-card-title color="success" class="headline">Pilih yang tidak terpenuhi</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout wrap>
|
||||
<v-flex v-for="(req,idx) in requirements" xs6>
|
||||
<one-x-check
|
||||
:xdatalabel="req.name"
|
||||
:xdatacbx="req.chex"
|
||||
@update-data-cbx="(val) =>checkReq(val,idx)"
|
||||
></one-x-check>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="green darken-1" flat @click="saveRequirement">Tutup</v-btn>
|
||||
<!--<v-btn color="green darken-1" flat @click="saveRequirement()">Simpan</v-btn>-->
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-card style="overflow-y: auto;max-height:550px" v-if="xsampletypes.length > 0">
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<v-subheader style="background:#03a9f4;padding:5px">
|
||||
<v-icon dark large left>assignment_ind</v-icon><h3 style="font-size:x-large" dark class="font-weight-bold white--text">{{staff.name.toUpperCase()}}</h3>
|
||||
<v-flex text-md-right>
|
||||
<v-btn v-if="selected_patient.fo_note !== '' || selected_patient.fo_requirements_status !== 'Y' || selected_patient.fo_verification_status !== 'X'" @click="openDialogFoNoteRequirement()" style="min-width:20px;margin-left:1px;margin-right:1px" deppressed small color="error"><v-icon small>info</v-icon></v-btn>
|
||||
<v-btn @click="openDialogFormNote()" style="min-width:20px;margin-left:1px;margin-right:1px" deppressed small color="warning"><v-icon small>speaker_notes</v-icon></v-btn>
|
||||
</v-flex>
|
||||
</v-subheader>
|
||||
<v-divider></v-divider>
|
||||
<v-layout align-center pa-2 mb-1 class="grey lighten-2" row>
|
||||
<v-flex xs4>
|
||||
SPECIMEN
|
||||
</v-flex>
|
||||
<v-flex xs3>
|
||||
BARCODE
|
||||
</v-flex>
|
||||
<v-flex xs2>
|
||||
REQUIREMENT
|
||||
</v-flex>
|
||||
<v-flex class="text-xs-center" xs3>
|
||||
AKSI
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout pb-1 row v-for="(sampletype,idx) in xsampletypes" :key="sampletype.T_BarcodeLabBarcode">
|
||||
<v-flex xs12>
|
||||
<v-layout align-center class="pa-2 grey lighten-4" row>
|
||||
<!--<v-flex class="text-xs-center" xs1>
|
||||
<v-btn v-if="selected_patient.status !== 'Process'" depressed small style="min-width:30px" class="white--text" color="grey"><v-icon>block</v-icon></v-btn>
|
||||
<v-btn @click="addNewLabel(sampletype)" v-if="selected_patient.status === 'Process'" small style="min-width:30px" class="white--text" color="#00bcd4"><v-icon>add</v-icon></v-btn>
|
||||
</v-flex>-->
|
||||
<v-flex pl-2 xs4>
|
||||
{{sampletype.T_SampleTypeName}}
|
||||
</v-flex>
|
||||
<v-flex xs3>
|
||||
<span v-if="sampletype.T_OrderSampleSampling === 'X'" style="text-decoration:line-through" class="red--text">{{sampletype.T_BarcodeLabBarcode}}</span>
|
||||
<span v-if="sampletype.T_OrderSampleSampling !== 'X'" >{{sampletype.T_BarcodeLabBarcode}}</span>
|
||||
</v-flex>
|
||||
<v-flex xs2>
|
||||
<div v-if="selected_patient.status === 'Process' || selected_patient.status === 'Done'">
|
||||
<span @click="openDialogRequirement(sampletype,idx)" v-bind:class="{ 'white': sampletype.requirement_status === 'X', 'error': sampletype.requirement_status === 'N' }" class="icon-medium-fill-base-small white"><v-icon :dark="sampletype.requirement_status === 'N'">close</v-icon></span>
|
||||
<span @click="confirmRequirement(sampletype,idx)" v-bind:class="{ 'white': sampletype.requirement_status === 'X', 'success': sampletype.requirement_status === 'Y' }" class="icon-medium-fill-base-small white"><v-icon :dark="sampletype.requirement_status === 'Y'">check</v-icon></span>
|
||||
</div>
|
||||
<div v-if="selected_patient.status === 'New' || selected_patient.status === 'Call' || selected_patient.status === 'Skip'">-</div>
|
||||
</v-flex>
|
||||
<v-flex class="text-xs-center" xs3>
|
||||
<v-btn v-if="selected_patient.status === 'Process' || selected_patient.status === 'Done'" style="margin:3px 2px;" small color="warning">{{sampletype.process_date}} {{sampletype.process_time}}</v-btn>
|
||||
<v-btn v-if="(selected_patient.status === 'Process' && sampletype.T_OrderSampleSampling === 'Y' ) && sampletype.requirement_status !== 'X'" @click="receiveSample(sampletype)" style="margin:3px 2px;" small color="success">{{sampletype.done_date}} {{sampletype.done_time}}</v-btn>
|
||||
<v-btn depressed dark v-if="selected_patient.status === 'Process' && sampletype.T_OrderSampleReceive === 'N' && sampletype.requirement_status === 'X'" style="margin:3px 2px;" small color="grey">00-00-0000 00:00</v-btn>
|
||||
<div v-if="selected_patient.status === 'New' || selected_patient.status === 'Call' || selected_patient.status === 'Skip'">-</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<v-layout wrap>
|
||||
<v-flex v-for="inf in info" :key="inf.id" pb-1 pl-1 pr-1 xs3>
|
||||
<v-btn block small color="primary" v-bind:class="{ 'success': inf.status_bahan === 'R', 'warning': inf.status_bahan === 'P' }" dark>{{inf.T_BahanName}}</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.overline {
|
||||
font-size: 0.625rem !important;
|
||||
font-weight: 400;
|
||||
letter-spacing: 0.1666666667em !important;
|
||||
line-height: 1rem;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.redcode {
|
||||
box-shadow: none !important;
|
||||
color: #c0341d !important;
|
||||
background-color: #fbe5e1 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-x-check':httpVueLoader('../../common/onexcheck.vue')
|
||||
},
|
||||
data: () => ({
|
||||
checkbox:false,
|
||||
//dialognote:false,
|
||||
dialognotecolor:'warning',
|
||||
// msgnote:''
|
||||
}),
|
||||
computed: {
|
||||
xnoterequirement(){
|
||||
return this.$store.state.samplecall.note_requirement
|
||||
},
|
||||
xsampletypes(){
|
||||
return this.$store.state.samplecall.sampletypes
|
||||
},
|
||||
xstatus(){
|
||||
return this.$store.state.samplecall.selected_status
|
||||
},
|
||||
selected_patient(){
|
||||
return this.$store.state.samplecall.selected_patient
|
||||
},
|
||||
dialogrequirement: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.dialog_requirement
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_dialog_requirement",val)
|
||||
}
|
||||
},
|
||||
dialognote: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.dialog_note
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_dialog_note",val)
|
||||
}
|
||||
},
|
||||
dialogformnote: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.dialog_form_note
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_dialog_form_note",val)
|
||||
}
|
||||
},
|
||||
msgnote: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.msg_note
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_msg_note",val)
|
||||
}
|
||||
},
|
||||
requirements: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.requirements
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_requirements",val)
|
||||
}
|
||||
},
|
||||
info: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.information_bahan
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_information_bahan",val)
|
||||
}
|
||||
},
|
||||
staff: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.staff
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_staff",val)
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
methods : {
|
||||
processSample(sampletype){
|
||||
var patient = this.$store.state.samplecall.selected_patient
|
||||
var msg = "Anda yakin akan melakukan proses untuk "+sampletype.T_SampleTypeName+" dari "+patient.patient_fullname+" ? "
|
||||
this.$store.commit("samplecall/update_msg_action",msg)
|
||||
this.$store.commit("samplecall/update_act",'samplingprocess')
|
||||
this.$store.commit("samplecall/update_selected_sampletype",sampletype)
|
||||
this.$store.commit("samplecall/update_dialog_action",true)
|
||||
},
|
||||
doneSample(sampletype){
|
||||
var patient = this.$store.state.samplecall.selected_patient
|
||||
var msg = "Anda yakin proses untuk "+sampletype.T_SampleTypeName+" dari "+patient.patient_fullname+" telah selesai ? "
|
||||
this.$store.commit("samplecall/update_msg_action",msg)
|
||||
this.$store.commit("samplecall/update_act",'samplingdone')
|
||||
this.$store.commit("samplecall/update_selected_sampletype",sampletype)
|
||||
this.$store.commit("samplecall/update_dialog_action",true)
|
||||
},
|
||||
printBarcodeGroup(){
|
||||
var id = this.selected_patient.T_OrderHeaderID
|
||||
one_print_barcode_so_group(id)
|
||||
},
|
||||
printBarcode(sampletype){
|
||||
var id = sampletype.T_OrderDetailID
|
||||
one_print_barcode_so(id)
|
||||
},
|
||||
openDialogRequirement(value,idx){
|
||||
if(value.status === 'D' && value.requirement_status === 'Y'){
|
||||
|
||||
}
|
||||
else{
|
||||
this.$store.commit("samplecall/update_selected_sample",value)
|
||||
var sampletypes = this.$store.state.samplecall.sampletypes
|
||||
sampletypes[idx].requirement_status = 'N'
|
||||
this.$store.commit("samplecall/update_requirements", sampletypes[idx].requirements)
|
||||
this.$store.commit("samplecall/update_dialog_requirement", true)
|
||||
}
|
||||
|
||||
},
|
||||
confirmRequirement(value,idx){
|
||||
if(value.status === 'P'){
|
||||
var sampletypes = this.$store.state.samplecall.sampletypes
|
||||
sampletypes[idx].requirement_status = 'Y'
|
||||
this.$store.commit("samplecall/update_sampletypes",sampletypes)
|
||||
|
||||
sampletypes[idx].requirements.forEach((el)=>{el.chex = "N"})
|
||||
}
|
||||
},
|
||||
saveRequirement(){
|
||||
//console.log(this.$store.state.samplecall.selected_sample)
|
||||
|
||||
var sampletypes = this.$store.state.samplecall.sampletypes
|
||||
var selected_sample = this.$store.state.samplecall.selected_sample
|
||||
var idx = _.findIndex(sampletypes, function(o) {
|
||||
return o.T_BarcodeLabBarcode == selected_sample.T_BarcodeLabBarcode
|
||||
})
|
||||
if(sampletypes[idx].status === 'P'){
|
||||
sampletypes[idx].requirements = this.$store.state.samplecall.requirements
|
||||
}
|
||||
this.$store.commit("samplecall/update_dialog_requirement",false)
|
||||
},
|
||||
checkReq(val,idx){
|
||||
var xrequirements = this.requirements
|
||||
console.log(xrequirements[idx])
|
||||
if(xrequirements[idx].T_OrderSampleReceive === 'N'){
|
||||
xrequirements[idx].chex = val
|
||||
this.$store.commit("samplecall/update_requirements",xrequirements)
|
||||
}
|
||||
},
|
||||
receiveSample(value){
|
||||
var goaction = true
|
||||
if(value.requirement_status === 'N'){
|
||||
var req_check = _.filter(value.requirements, function(o) { return o.chex === 'Y' })
|
||||
if(req_check.length === 0){
|
||||
goaction = false
|
||||
}
|
||||
}
|
||||
if(value.T_OrderSampleReceive === 'N' && value.requirement_status !== 'X' && goaction){
|
||||
this.$store.commit("samplecall/update_act",'samplingdone')
|
||||
var prm = this.selected_patient
|
||||
prm.id = this.selected_patient.T_OrderHeaderID
|
||||
prm.act = 'samplingdone'
|
||||
prm.sample = value
|
||||
prm.staff = this.$store.state.samplecall.staff
|
||||
prm.search = {
|
||||
name:this.$store.state.samplecall.name,
|
||||
nolab:this.$store.state.samplecall.nolab,
|
||||
stationid: this.$store.state.samplecall.selected_station.id,
|
||||
statusid: this.$store.state.samplecall.selected_status.id,
|
||||
companyid: this.$store.state.samplecall.selected_company.id,
|
||||
lastid: this.$store.state.samplecall.last_id
|
||||
}
|
||||
this.$store.dispatch("samplecall/receivesample",prm)
|
||||
}else{
|
||||
//console.log('oeey')
|
||||
if(value.status === 'P'){
|
||||
this.$store.commit("samplecall/update_msg_info","Jalan - jalan ke gunung merapi, Requirement-nya tolong dilengkapi")
|
||||
this.$store.commit("samplecall/update_open_dialog_info",true)
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
addNewLabel(sampletype){
|
||||
this.$store.commit("samplecall/update_selected_sampletype",sampletype)
|
||||
var sample = sampletype.T_SampleTypeName
|
||||
var patient = this.$store.state.samplecall.selected_patient
|
||||
var msg = "Anda yakin akan melakukan penambahan label spesimen "+sample+" untuk pasien "+patient.patient_fullname+" ? "
|
||||
this.$store.commit("samplecall/update_msg_action",msg)
|
||||
this.$store.commit("samplecall/update_act",'addnewlabel')
|
||||
//this.closeDialogAction()
|
||||
this.$store.commit("samplecall/update_dialog_action",true)
|
||||
},
|
||||
openDialogNote(){
|
||||
this.msgnote = '<p><code color="red">catatan dari fo : </code></p>'
|
||||
this.msgnote += '<p>'+this.$store.state.samplecall.selected_patient.T_OrderHeaderFoNote+'</p>'
|
||||
this.dialognotecolor = 'warning'
|
||||
this.dialognote = true
|
||||
},
|
||||
openDialogFormNote(){
|
||||
|
||||
this.dialogformnote = true
|
||||
},
|
||||
openDialogFoNoteRequirement(){
|
||||
var prm = this.$store.state.samplecall.selected_patient
|
||||
this.$store.dispatch("samplecall/getdatanoterequirement",prm)
|
||||
},
|
||||
searchPatientLastSelect() {
|
||||
this.dialogformnote = false
|
||||
this.$store.dispatch("samplecall/search",{
|
||||
name:this.$store.state.samplecall.name,
|
||||
nolab:this.$store.state.samplecall.nolab,
|
||||
stationid: this.$store.state.samplecall.selected_station.id,
|
||||
statusid: this.$store.state.samplecall.selected_status.id,
|
||||
companyid: this.$store.state.samplecall.selected_company.id,
|
||||
lastid: this.$store.state.samplecall.last_id
|
||||
})
|
||||
},
|
||||
saveNoteSampling(){
|
||||
var prm = this.$store.state.samplecall.selected_patient
|
||||
prm.search = {
|
||||
name:this.$store.state.samplecall.name,
|
||||
nolab:this.$store.state.samplecall.nolab,
|
||||
stationid: this.$store.state.samplecall.selected_station.id,
|
||||
statusid: this.$store.state.samplecall.selected_status.id,
|
||||
companyid: this.$store.state.samplecall.selected_company.id,
|
||||
lastid: this.$store.state.samplecall.last_id
|
||||
}
|
||||
this.$store.dispatch("samplecall/savenotesampling",prm)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
352
test/vuex/one-sample-lab/components/oneSampleCallSOInfo.vue
Normal file
352
test/vuex/one-sample-lab/components/oneSampleCallSOInfo.vue
Normal file
@@ -0,0 +1,352 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-dialog v-model="xdialogaction" persistent max-width="350">
|
||||
<v-card>
|
||||
<v-card-title color="warning" class="headline">Konfirmasi</v-card-title>
|
||||
<v-card-text v-html="xmsgaction">
|
||||
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary darken-1" flat @click="closeDialogAction()">OK</v-btn>
|
||||
<v-btn color="error darken-1" flat @click="xdialogaction = false">Tutup</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
<v-layout wrap>
|
||||
|
||||
<v-flex xs12>
|
||||
<v-card class="pt-1 pb-1 pr-1" elevation="3" color="light-blue">
|
||||
<v-layout align-center justify-center row shrink fill-height>
|
||||
<v-flex xs2>
|
||||
<v-card flat>
|
||||
<v-img
|
||||
:src="xselected_patient.M_PatientPhotoThumb"
|
||||
:lazy-src="xselected_patient.M_PatientPhotoThumb"
|
||||
aspect-ratio="1"
|
||||
width="100%"
|
||||
class="light-blue"
|
||||
contain
|
||||
>
|
||||
</v-card>
|
||||
|
||||
</v-flex>
|
||||
<v-flex xs10>
|
||||
<v-card flat>
|
||||
<v-layout pt-1 pl-2 pb-1 pr-2 row>
|
||||
<v-flex>
|
||||
<v-subheader style="color:black;height:auto;padding:0px">
|
||||
<h3 style="font-size:x-large" class="font-weight-bold">{{ xselected_patient.T_OrderHeaderLabNumber }}</h3>
|
||||
|
||||
<v-flex text-md-right>
|
||||
<span @click="callPatient()" v-if="xselected_patient.statusid === '0' || xselected_patient.statusid === '2'" style="font-size:24px;" class="icon-medium-fill-base-small xs1 white--text info"><v-icon dark>volume_up</v-icon></span>
|
||||
<span @click="skip()" v-if="xselected_patient.statusid === '1' || xselected_patient.statusid === '3'" style="font-size:24px;" class="icon-medium-fill-base-small xs1 white--text black"><v-icon dark>fast_rewind</v-icon></span>
|
||||
<span @click="processNow(xselected_patient.statusid)" v-if="xselected_patient.statusid === '1'" v-bind:class="{ 'warning':xselected_patient.statusid === '1','grey':xselected_patient.statusid !== '1' }" style="font-size:24px;" class="icon-medium-fill-base-small xs1 white--text"><v-icon dark>loop</v-icon></span>
|
||||
|
||||
</v-flex>
|
||||
</v-subheader>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout pl-2 pr-2 row>
|
||||
<v-flex xs4>
|
||||
<v-layout column>
|
||||
<v-flex pt-1>
|
||||
<v-text-field
|
||||
v-model=" xselected_patient.M_PatientNoReg"
|
||||
label="PID"
|
||||
readonly
|
||||
hide-details
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs8 pl-2>
|
||||
<v-layout column>
|
||||
<v-flex pt-1 >
|
||||
<v-layout row>
|
||||
<v-flex xs4>
|
||||
<v-text-field
|
||||
v-model="xselected_patient.patient_dob"
|
||||
label="Tanggal lahir"
|
||||
readonly
|
||||
hide-details
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs8 pl-1>
|
||||
<v-text-field
|
||||
v-model=" xselected_patient.T_OrderHeaderM_PatientAge"
|
||||
label="Umur"
|
||||
readonly
|
||||
hide-details
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout pb-2 pt-1 pl-2 pr-2 row>
|
||||
<v-flex xs8>
|
||||
<v-text-field
|
||||
v-model=" xselected_patient.patient_fullname"
|
||||
label="Nama"
|
||||
readonly
|
||||
hide-details
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs4 pl-1>
|
||||
<v-text-field
|
||||
v-model="xselected_patient.M_PatientHP"
|
||||
label="HP"
|
||||
readonly
|
||||
hide-details
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
|
||||
|
||||
<!--<v-card v-if="xselected_patient">
|
||||
<v-layout row>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-layout align-center row>
|
||||
<v-flex xs2>
|
||||
<v-card>
|
||||
<v-img
|
||||
:src="xselected_patient.M_PatientPhotoThumb"
|
||||
aspect-ratio="1"
|
||||
class="grey lighten-2 elevation-2"
|
||||
>
|
||||
|
||||
</v-img>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
<v-flex xs10 pl-2 pt-1>
|
||||
<v-card>
|
||||
<v-layout pa-2 row>
|
||||
<v-flex>
|
||||
<v-subheader style="color:black;height:auto;padding:0px">
|
||||
<h3 style="font-size:x-large" class="font-weight-bold">{{ xselected_patient.T_OrderHeaderLabNumber }}</h3>
|
||||
|
||||
<v-flex text-md-right>
|
||||
<span @click="callPatient()" v-if="xselected_patient.statusid === '0' || xselected_patient.statusid === '2'" style="font-size:24px;" class="icon-medium-fill-base-small xs1 white--text info"><v-icon dark>volume_up</v-icon></span>
|
||||
<span @click="skip()" v-if="xselected_patient.statusid === '1' || xselected_patient.statusid === '3'" style="font-size:24px;" class="icon-medium-fill-base-small xs1 white--text black"><v-icon dark>fast_rewind</v-icon></span>
|
||||
<span @click="processNow(xselected_patient.statusid)" v-if="xselected_patient.statusid === '1'" v-bind:class="{ 'warning':xselected_patient.statusid === '1','grey':xselected_patient.statusid !== '1' }" style="font-size:24px;" class="icon-medium-fill-base-small xs1 white--text"><v-icon dark>loop</v-icon></span>
|
||||
|
||||
</v-flex>
|
||||
</v-subheader>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout pa-2 row wrap>
|
||||
<v-flex xs4>
|
||||
<v-layout column>
|
||||
<v-flex pt-1>
|
||||
<v-text-field
|
||||
v-model=" xselected_patient.M_PatientNoReg"
|
||||
label="PID"
|
||||
readonly
|
||||
hide-details
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
<v-flex pt-1 >
|
||||
<v-text-field
|
||||
v-model=" xselected_patient.patient_fullname"
|
||||
label="Nama"
|
||||
readonly
|
||||
hide-details
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs8 pl-2>
|
||||
<v-layout column>
|
||||
<v-flex pt-1 >
|
||||
<v-layout row>
|
||||
<v-flex xs4>
|
||||
<v-text-field
|
||||
v-model="xselected_patient.patient_dob"
|
||||
label="Tanggal lahir"
|
||||
readonly
|
||||
hide-details
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs8 pl-1>
|
||||
<v-text-field
|
||||
v-model=" xselected_patient.T_OrderHeaderM_PatientAge"
|
||||
label="Umur"
|
||||
readonly
|
||||
hide-details
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-flex>
|
||||
|
||||
<v-flex pt-1>
|
||||
<v-text-field
|
||||
v-model="xselected_patient.M_PatientHP"
|
||||
label="HP"
|
||||
readonly
|
||||
hide-details
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data: () => ({
|
||||
|
||||
}),
|
||||
computed: {
|
||||
xselected_patient:{
|
||||
get() {
|
||||
return this.$store.state.samplecall.selected_patient
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_selected_patient",val)
|
||||
}
|
||||
},
|
||||
xdialogaction:{
|
||||
get() {
|
||||
return this.$store.state.samplecall.dialog_action
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_dialog_action",val)
|
||||
}
|
||||
},
|
||||
xmsgaction:{
|
||||
get() {
|
||||
return this.$store.state.samplecall.msg_action
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_msg_action",val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods : {
|
||||
closeDialogAction(){
|
||||
var act = this.$store.state.samplecall.act
|
||||
var sample = this.$store.state.samplecall.selected_sampletype
|
||||
var status = 1
|
||||
if(act === 'process'){
|
||||
status = 3
|
||||
}
|
||||
if(act === 'skip'){
|
||||
status = 2
|
||||
}
|
||||
if(act === 'samplingprocess'){
|
||||
status = 3
|
||||
}
|
||||
if(act === 'samplingdone'){
|
||||
status = 4
|
||||
}
|
||||
|
||||
if(act != 'addnewlabel'){
|
||||
var patient = this.$store.state.samplecall.selected_patient
|
||||
var lastid = this.$store.state.samplecall.last_id
|
||||
this.$store.dispatch("samplecall/doaction",{
|
||||
act:act,
|
||||
id:patient.T_OrderHeaderID,
|
||||
name:this.$store.state.samplecall.name,
|
||||
nolab:this.$store.state.samplecall.nolab,
|
||||
stationid: patient.T_SampleStationID,
|
||||
statusid:this.$store.state.samplecall.selected_status.id,
|
||||
statusnextid : status,
|
||||
sample:sample,
|
||||
lastid:lastid,
|
||||
companyid: this.$store.state.samplecall.selected_company.id,
|
||||
staff:this.$store.state.samplecall.staff
|
||||
})
|
||||
}
|
||||
else{
|
||||
var patient = this.$store.state.samplecall.selected_patient
|
||||
var lastid = this.$store.state.samplecall.last_id
|
||||
this.$store.dispatch("samplecall/addnewlabel",{
|
||||
act:act,
|
||||
id:patient.T_OrderHeaderID,
|
||||
name:this.$store.state.samplecall.name,
|
||||
nolab:this.$store.state.samplecall.nolab,
|
||||
stationid: patient.T_SampleStationID,
|
||||
statusid:this.$store.state.samplecall.selected_status.id,
|
||||
statusnextid : status,
|
||||
sample:this.$store.state.samplecall.selected_sampletype,
|
||||
lastid:lastid,
|
||||
companyid: this.$store.state.samplecall.selected_company.id,
|
||||
staff:this.$store.state.samplecall.staff
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
callPatient(){
|
||||
//var patient = this.$store.state.samplecall.selected_patient
|
||||
//var msg = "Anda yakin akan melakukan panggilan kepada pasien "+patient.patient_fullname+" ? "
|
||||
//this.$store.commit("samplecall/update_msg_action",msg)
|
||||
this.$store.commit("samplecall/update_act",'call')
|
||||
this.closeDialogAction()
|
||||
//this.$store.commit("samplecall/update_dialog_action",true)
|
||||
},
|
||||
processNow(value){
|
||||
if(value === '1'){
|
||||
//var patient = this.$store.state.samplecall.selected_patient
|
||||
//var msg = "Anda yakin akan merubah status <span style='color:ff5252;font-weight:bold'>PROCESS</span> untuk pasien "+patient.patient_fullname+" ? "
|
||||
//this.$store.commit("samplecall/update_msg_action",msg)
|
||||
this.$store.commit("samplecall/update_act",'process')
|
||||
this.closeDialogAction()
|
||||
//this.$store.commit("samplecall/update_dialog_action",true)
|
||||
}
|
||||
|
||||
},
|
||||
skip(){
|
||||
//var patient = this.$store.state.samplecall.selected_patient
|
||||
//var msg = "Anda yakin akan merubah status <span style='color:ff5252;font-weight:bold'>SKIP</span> untuk pasien "+patient.patient_fullname+" ? "
|
||||
//this.$store.commit("samplecall/update_msg_action",msg)
|
||||
this.$store.commit("samplecall/update_act",'skip')
|
||||
this.closeDialogAction()
|
||||
//this.$store.commit("samplecall/update_dialog_action",true)
|
||||
},
|
||||
patient_photo(){
|
||||
var photo = "https://www.sgm-inc.com/wp-content/uploads/2014/06/no-profile-male-img.gif"
|
||||
if(this.xselected_patient.M_PatientPhoto){
|
||||
photo = this.xselected_patient.M_PatientPhoto
|
||||
}
|
||||
console.log(photo)
|
||||
return photo
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
394
test/vuex/one-sample-lab/components/oneSampleCallSOList.vue
Normal file
394
test/vuex/one-sample-lab/components/oneSampleCallSOList.vue
Normal file
@@ -0,0 +1,394 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-dialog v-model="dialogsuccess" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title color="success" class="headline">Berhasil !</v-card-title>
|
||||
<v-card-text>
|
||||
{{msgsuccess}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="green darken-1" flat @click="closeDialogSuccess">OK</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout row>
|
||||
<v-flex pt-1 xs4>
|
||||
<v-text-field
|
||||
style="font-size:14px"
|
||||
label="No Reg"
|
||||
class="mr-1"
|
||||
|
||||
outline
|
||||
v-on:keyup.enter="searchPatient"
|
||||
v-model="nolab"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs4>
|
||||
<v-autocomplete
|
||||
label="Kel. Pelanggan"
|
||||
v-model="selected_company"
|
||||
class="ma-1"
|
||||
:items="xcompanies"
|
||||
:search-input.sync="search_company"
|
||||
auto-select-first
|
||||
hide-details
|
||||
style="font-size:14px"
|
||||
outline
|
||||
no-filter
|
||||
item-text="name"
|
||||
return-object
|
||||
:loading="isLoading"
|
||||
no-data-text="Semua Kel. Pelanggan"
|
||||
>
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.name"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs4>
|
||||
<v-select class="mini-select ma-1" :items="xstations"
|
||||
item-text="name"
|
||||
return-object
|
||||
style="font-size:14px"
|
||||
v-model="xselectedstation"
|
||||
label="Station" outline hide-details></v-select>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<v-card >
|
||||
<v-layout row>
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="patients"
|
||||
:loading="isLoading"
|
||||
hide-actions
|
||||
class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'teal white--text':props.item.coming === 'Y','amber':props.item.iscito === 'Y'}" @click="selectMe(props.item)">{{ format_date(props.item.T_OrderHeaderDate) }}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'teal white--text':props.item.coming === 'Y','amber':props.item.iscito === 'Y'}" @click="selectMe(props.item)">
|
||||
<span class="font-weight-black caption">{{ props.item.T_OrderHeaderLabNumber }}</span>
|
||||
<span style="color:#800000" class="font-weight-bold caption">{{props.item.T_OrderHeaderLabNumberExt}}</span>
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'teal white--text':props.item.coming === 'Y','amber':props.item.iscito === 'Y'}" @click="selectMe(props.item)">{{ props.item.M_CompanyName}}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'teal white--text':props.item.coming === 'Y','amber':props.item.iscito === 'Y'}" @click="selectMe(props.item)">{{ props.item.patient_fullname}}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'teal white--text':props.item.coming === 'Y','amber':props.item.iscito === 'Y'}" @click="selectMe(props.item)">{{ props.item.status}}</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="closeDialogInfo()"></one-dialog-info>
|
||||
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()" @close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
|
||||
<one-order-info></one-order-info>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.searchbox .v-input.v-text-field .v-input__slot{
|
||||
min-height:60px;
|
||||
}
|
||||
.v-table__overflow {
|
||||
height:600px;
|
||||
overflow-y:scroll;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
table.v-table body {
|
||||
height:500px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-dialog-info':httpVueLoader('../../common/oneDialogInfo.vue'),
|
||||
'one-dialog-alert':httpVueLoader('../../common/oneDialogAlert.vue'),
|
||||
'one-order-info':httpVueLoader('./oneOrderInfo.vue')
|
||||
},
|
||||
mounted() {
|
||||
//this.$store.dispatch("samplecall/getinitdata")
|
||||
this.$store.dispatch("samplecall/getstationstatus",{
|
||||
name:this.name,
|
||||
nolab:this.nolab,
|
||||
stationid: this.xselectedstation.id,
|
||||
statusid: this.xselectedstatus.id,
|
||||
companyid:this.selected_company.id,
|
||||
// current_page:1,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
methods : {
|
||||
format_date(d) {
|
||||
return moment(d).format("DD.MM.YYYY")
|
||||
},
|
||||
isSelected(p) {
|
||||
if(p.coming === 'Y' || p.iscito === 'Y')
|
||||
return false
|
||||
else
|
||||
return p.T_OrderHeaderID == this.$store.state.samplecall.selected_patient.T_OrderHeaderID
|
||||
},
|
||||
searchPatient() {
|
||||
this.$store.dispatch("samplecall/search",{
|
||||
name:this.name,
|
||||
nolab:this.nolab,
|
||||
stationid: this.xselectedstation.id,
|
||||
statusid: this.xselectedstatus.id,
|
||||
companyid:this.selected_company.id,
|
||||
//current_page:1,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
selectMe(pat) {
|
||||
if(this.$store.state.samplecall.no_save == 0 ){
|
||||
var patients = this.$store.state.samplecall.patients
|
||||
this.$store.commit("samplecall/update_selected_patient",pat)
|
||||
var idx = _.findIndex(patients, function(o) { return o.T_OrderHeaderID == pat.T_OrderHeaderID })
|
||||
this.$store.commit("samplecall/update_last_id",idx)
|
||||
this.$store.dispatch("samplecall/getsampletypes",{
|
||||
orderid:pat.T_OrderHeaderID,
|
||||
stationid: pat.T_SampleStationID,
|
||||
statusid: pat.statusid
|
||||
})
|
||||
}else{
|
||||
this.$store.commit("samplecall/update_open_alert_confirmation",true)
|
||||
}
|
||||
|
||||
},
|
||||
closeAlertConfirmation(){
|
||||
this.$store.commit("samplecall/update_open_alert_confirmation",false)
|
||||
},
|
||||
forgetAlertConfirmation(){
|
||||
this.$store.commit("samplecall/update_no_save",0)
|
||||
this.$store.commit("samplecall/update_open_alert_confirmation",false)
|
||||
},
|
||||
updateAlert_success(val){
|
||||
this.$store.commit("samplecall/update_alert_success",val)
|
||||
},
|
||||
setNewPatient(){
|
||||
|
||||
},
|
||||
closeDialogSuccess(){
|
||||
let arrPatient = this.$store.state.samplecall.patients
|
||||
var idx = _.findIndex(arrPatient, item => item.M_PatientID === this.$store.state.samplecall.last_id)
|
||||
console.log(idx)
|
||||
var xcur_page = 1
|
||||
|
||||
this.$store.dispatch("samplecall/search",{
|
||||
name:this.name,
|
||||
nolab:this.nolab,
|
||||
stationid: this.xselectedstation.id,
|
||||
statusid: this.xselectedstatus.id,
|
||||
lastid: idx
|
||||
})
|
||||
|
||||
this.$store.commit("samplecall/update_dialog_success",false)
|
||||
},
|
||||
closeDialogInfo(){
|
||||
this.$store.commit("samplecall/update_open_dialog_info",false)
|
||||
},
|
||||
thr_search_company: _.debounce(function() {
|
||||
this.$store.dispatch("samplecall/searchcompany", this.search_company);
|
||||
}, 2000),
|
||||
},
|
||||
computed: {
|
||||
dialogsuccess: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.dialog_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_dialog_success",val)
|
||||
}
|
||||
},
|
||||
msgsuccess(){
|
||||
return this.$store.state.samplecall.msg_success
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_alert_success",val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.samplecall.search_status == 1
|
||||
},
|
||||
xstations() {
|
||||
return this.$store.state.samplecall.stations
|
||||
},
|
||||
xselectedstation: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.selected_station
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_selected_station",val)
|
||||
this.searchPatient()
|
||||
}
|
||||
},
|
||||
xstatuses() {
|
||||
return this.$store.state.samplecall.statuses
|
||||
},
|
||||
xselectedstatus: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.selected_status
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_selected_status",val)
|
||||
this.searchPatient()
|
||||
}
|
||||
},
|
||||
patients() {
|
||||
return this.$store.state.samplecall.patients
|
||||
},
|
||||
openalertconfirmation: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.open_alert_confirmation
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_open_alert_confirmation",val)
|
||||
}
|
||||
},
|
||||
curr_page: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.current_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_current_page",val)
|
||||
this.$store.dispatch("samplecall/search",{
|
||||
name:this.name,
|
||||
nolab:this.nolab,
|
||||
stationid: this.xselectedstation.id,
|
||||
statusid: this.xselectedstatus.id,
|
||||
current_page:val,
|
||||
lastid: idx
|
||||
})
|
||||
}
|
||||
},
|
||||
xtotal_page: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.total_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_total_page",val)
|
||||
}
|
||||
},
|
||||
opendialoginfo: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.open_dialog_info
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_open_dialog_info",false)
|
||||
}
|
||||
},
|
||||
msginfo(){
|
||||
return this.$store.state.samplecall.msg_info
|
||||
},
|
||||
name: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.name
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_name",val)
|
||||
}
|
||||
},
|
||||
nolab: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.nolab
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_nolab",val)
|
||||
//this.searchPatient()
|
||||
}
|
||||
},
|
||||
xcompanies() {
|
||||
return this.$store.state.samplecall.companies;
|
||||
},
|
||||
selected_company: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.selected_company;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_selected_company", val)
|
||||
this.searchPatient()
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
search_company(val, old) {
|
||||
if (val == old) return;
|
||||
if (!val) return;
|
||||
if (val.length < 1) return;
|
||||
if (this.$store.state.samplecall.update_autocomplete_status == 1) return;
|
||||
this.thr_search_company();
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
msgalertconfirmation:"Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
items: [],
|
||||
search_company: "",
|
||||
//isLoading: false,
|
||||
page:1,
|
||||
headers: [
|
||||
{
|
||||
text: "TANGGAL",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NO REG",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "KEL. PELANGGAN",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "30%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
|
||||
{
|
||||
text: "STATUS",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
138
test/vuex/one-sample-lab/index.php
Normal file
138
test/vuex/one-sample-lab/index.php
Normal file
@@ -0,0 +1,138 @@
|
||||
<!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 v-on:key="doSomething">
|
||||
<div v-cloak id="app">
|
||||
<v-app id="smartApp" >
|
||||
<one-navbar></one-navbar>
|
||||
<v-content style="background:#F5E8DF!important" >
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap >
|
||||
<v-flex xs6 class="left" fill-height pa-1>
|
||||
<one-sample-call-so-list></one-sample-call-so-list>
|
||||
</v-flex>
|
||||
<v-flex xs6 class="right" fill-height pa-1>
|
||||
<one-sample-call-so-info></one-sample-call-so-info>
|
||||
<one-sample-call-so-detail></one-sample-call-so-detail>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-footer> </one-footer>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<script src="../../../libs/vendor/moment.min.js"></script>
|
||||
<script src="../../../libs/vendor/numeral.min.js"></script>
|
||||
<script src="../../../libs/vendor/moment-locale-id.js"></script>
|
||||
<script src="../../../libs/vendor/lodash.js"></script>
|
||||
<script src="../../../libs/vendor/axios.min.js"></script>
|
||||
<script src="../../../libs/vendor/vue.js"></script>
|
||||
<script src="../../../libs/vendor/vuex.js"></script>
|
||||
<script src="../../../libs/vendor/vuetify.js"></script>
|
||||
<script src="../../../libs/vendor/httpVueLoader.js"></script>
|
||||
<script src="../../../libs/one_global.js"></script>
|
||||
<script src="../../../libs/one_print_barcode.js"></script>
|
||||
<script src="../../../libs/vendor/socket.io.js"></script>
|
||||
<!-- App Script -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
window.calculate_age = function (inp_dob) {
|
||||
var now = moment(new Date())
|
||||
var dob = moment(new Date(inp_dob))
|
||||
var year = now.diff(dob,'years')
|
||||
dob.add(year,'years')
|
||||
var month = now.diff(dob,'months')
|
||||
dob.add(month,'months')
|
||||
var day = now.diff(dob,'days')
|
||||
if (isNaN(year)) return ''
|
||||
return `${year} tahun ${month} bulan ${day} hari`
|
||||
}
|
||||
|
||||
var socketIoUrl = "http://" + window.location.host + ":9090/";
|
||||
|
||||
import { store } from './store.js<?php echo $ts ?>';
|
||||
|
||||
//for testing
|
||||
window.store = store;
|
||||
new Vue({
|
||||
data : {
|
||||
socket : io.connect(socketIoUrl,{forceNew:false})
|
||||
},
|
||||
store,
|
||||
el: '#app',
|
||||
mounted(){
|
||||
document.addEventListener('keypress',logKeyboard)
|
||||
window.key_enter = ''
|
||||
async function logKeyboard(e) {
|
||||
|
||||
window.key_enter = (window.key_enter + e.key).toUpperCase()
|
||||
if(e.key == 'Enter') {
|
||||
if(window.key_enter.includes('STF')){
|
||||
var prm = {search:window.key_enter.replace('ENTER','').trim()}
|
||||
await store.dispatch("samplecall/search_staff",prm)
|
||||
}else{
|
||||
var prm = {search:window.key_enter.replace('ENTER','').trim()}
|
||||
store.dispatch("samplecall/search_patient_enter",prm)
|
||||
}
|
||||
window.key_enter = ''
|
||||
}
|
||||
|
||||
}
|
||||
let self = this;
|
||||
this.socket.on("notification", function(msg) {
|
||||
switch(msg.type) {
|
||||
case "specimen-col-process" :
|
||||
case "fo-verification-y" :
|
||||
self.$store.dispatch("samplecall/search",{
|
||||
name : self.$store.state.samplecall.name,
|
||||
nolab: self.$store.state.samplecall.nolab,
|
||||
stationid: self.$store.state.samplecall.selected_station.id,
|
||||
statusid: self.$store.state.samplecall.selected_status.id,
|
||||
companyid: self.$store.state.samplecall.selected_company.id,
|
||||
lastid: self.$store.state.samplecall.last_id
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
methods: {
|
||||
tab_selected : function(tab) {
|
||||
return this.$store.state.tab_selected == tab
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-sample-call-so-list': httpVueLoader('./components/oneSampleCallSOList.vue'),
|
||||
'one-sample-call-so-info': httpVueLoader('./components/oneSampleCallSOInfo.vue'),
|
||||
'one-sample-call-so-detail': httpVueLoader('./components/oneSampleCallSODetail.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
.left {
|
||||
}
|
||||
.right {
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
45
test/vuex/one-sample-lab/modules/order_info.js
Normal file
45
test/vuex/one-sample-lab/modules/order_info.js
Normal file
@@ -0,0 +1,45 @@
|
||||
import * as api from "../api/order_info.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
show:false,
|
||||
loading: false,
|
||||
error_message: '',
|
||||
orders: []
|
||||
},
|
||||
mutations: {
|
||||
update_loading(state, val) {
|
||||
state.loading = val
|
||||
},
|
||||
update_show(state, val) {
|
||||
state.show= val
|
||||
},
|
||||
update_error_message(state, val) {
|
||||
state.error_message= val
|
||||
},
|
||||
update_orders(state,val) {
|
||||
state.orders = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context, prm) {
|
||||
context.commit("update_loading", true)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
context.commit("update_loading",true)
|
||||
context.commit("update_show",true)
|
||||
let resp = await api.search(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_error_message", "")
|
||||
context.commit("update_orders", resp.data)
|
||||
context.commit("update_loading",false)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_error_message", e.message)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
981
test/vuex/one-sample-lab/modules/samplecall.js
Normal file
981
test/vuex/one-sample-lab/modules/samplecall.js
Normal file
@@ -0,0 +1,981 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/samplecall.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
last_id:-1,
|
||||
last_saved_id:-1,
|
||||
x_addr_id:0,
|
||||
act:'edit',
|
||||
act_addr:'new',
|
||||
get_data_status:0,
|
||||
search_patient: 0,
|
||||
search_status: 0,
|
||||
search_error_message: '',
|
||||
preffix:'',
|
||||
patient_name:'',
|
||||
suffix:'',
|
||||
patients: [],
|
||||
selected_patient: {},
|
||||
sampletypes:[],
|
||||
selected_sampletype:{},
|
||||
companies:[{id:0,name:'Semua'}],
|
||||
selected_company:{id:0,name:'Semua'},
|
||||
total_patients:0,
|
||||
patient_address: [],
|
||||
stations:[],
|
||||
selected_station:{},
|
||||
statuses:[],
|
||||
selected_status:{},
|
||||
transaction_date:moment(new Date()).format('DD-MM-YYYY'),
|
||||
transaction_time:moment(new Date()).format("hh:mm"),
|
||||
phone:'',
|
||||
hp:'',
|
||||
email:'',
|
||||
pj:'N',
|
||||
dpj:'N',
|
||||
clinic:'N',
|
||||
is_default:'N',
|
||||
marketing_confirm:'N',
|
||||
save_status: 0,
|
||||
btn_save_seen: true,
|
||||
pgrs_save: false,
|
||||
save_error_message: '',
|
||||
no_save: 0,
|
||||
open_alert_confirmation:false,
|
||||
alert_success: false,
|
||||
msg_success: "",
|
||||
dialog_success: false,
|
||||
dialog_confirmation_delete: false,
|
||||
msg_confirmation_delete: "",
|
||||
dialog_confirmation_delete_addr: false,
|
||||
msg_confirmation_delete_addr: "",
|
||||
autocomplete_status:0,
|
||||
dialog_form_address: false,
|
||||
label_address:'',
|
||||
addresses:[],
|
||||
cities:[],
|
||||
city_address:{},
|
||||
districts:[],
|
||||
district_address:{},
|
||||
kelurahans:[],
|
||||
kelurahan_address:{},
|
||||
description_address:'',
|
||||
errors:[],
|
||||
dialog_action:false,
|
||||
msg_action:'',
|
||||
current_page:1,
|
||||
total_page:1,
|
||||
dialog_requirement:false,
|
||||
requirements:[],
|
||||
selected_sample:{},
|
||||
open_dialog_info:false,
|
||||
msg_info:'',
|
||||
name:'',
|
||||
nolab:'',
|
||||
information_bahan:[],
|
||||
staff:{id:0,code:'',name:'BELUM ADA STAF',code:'',userid:''},
|
||||
dialog_note:false,
|
||||
msg_note:'',
|
||||
note_requirement:[],
|
||||
dialog_form_note:'',
|
||||
barcode_search_tube:false,
|
||||
barcode_search:false,
|
||||
barcode_search_string:''
|
||||
},
|
||||
mutations: {
|
||||
update_barcode_search_string(state, val) {
|
||||
state.barcode_search_string = val
|
||||
},
|
||||
update_barcode_search(state, val) {
|
||||
state.barcode_search = val
|
||||
},
|
||||
update_barcode_search_tube(state, val) {
|
||||
state.barcode_search_tube = val
|
||||
},
|
||||
update_dialog_form_note(state, val) {
|
||||
state.dialog_form_note = val
|
||||
},
|
||||
update_note_requirement(state, val) {
|
||||
state.note_requirement = val
|
||||
},
|
||||
update_dialog_note(state, val) {
|
||||
state.dialog_note = val
|
||||
},
|
||||
update_msg_note(state, val) {
|
||||
state.msg_note = val
|
||||
},
|
||||
update_companies(state, val) {
|
||||
state.companies = val
|
||||
},
|
||||
update_selected_company(state, val) {
|
||||
state.selected_company = val
|
||||
},
|
||||
update_staff(state, val) {
|
||||
state.staff = val
|
||||
},
|
||||
update_information_bahan(state, val) {
|
||||
state.information_bahan = val
|
||||
},
|
||||
update_name(state, val) {
|
||||
state.name = val
|
||||
},
|
||||
update_nolab(state, val) {
|
||||
state.nolab = val
|
||||
},
|
||||
update_open_dialog_info(state, val) {
|
||||
state.open_dialog_info = val
|
||||
},
|
||||
update_msg_info(state, val) {
|
||||
state.msg_info = val
|
||||
},
|
||||
update_selected_sample(state, val) {
|
||||
state.selected_sample = val
|
||||
},
|
||||
update_requirements(state, val) {
|
||||
state.requirements = val
|
||||
},
|
||||
update_dialog_requirement(state, val) {
|
||||
state.dialog_requirement = val
|
||||
},
|
||||
update_total_page(state, val) {
|
||||
state.total_page = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_x_addr_id(state, val) {
|
||||
state.x_addr_id = val
|
||||
},
|
||||
update_last_id(state, val) {
|
||||
state.last_id = val
|
||||
},
|
||||
update_last_saved_id(state, val) {
|
||||
state.last_saved_id = val
|
||||
},
|
||||
update_act(state, val) {
|
||||
state.act = val
|
||||
},
|
||||
update_act_addr(state, val) {
|
||||
state.act_addr = val
|
||||
},
|
||||
update_get_data_status(state, val) {
|
||||
state.get_data_status = val
|
||||
},
|
||||
update_search_error_message(state, patient) {
|
||||
state.search_error_message = patient
|
||||
},
|
||||
update_search_patient(state, patient) {
|
||||
state.search_patient = patient
|
||||
},
|
||||
update_preffix(state, val) {
|
||||
state.preffix = val
|
||||
},
|
||||
update_patient_name(state, val) {
|
||||
state.patient_name = val
|
||||
},
|
||||
update_suffix(state, val) {
|
||||
state.suffix = val
|
||||
},
|
||||
update_patients(state, data) {
|
||||
state.patients = data
|
||||
},
|
||||
update_selected_patient(state, val) {
|
||||
state.selected_patient = val
|
||||
},
|
||||
update_sampletypes(state, data) {
|
||||
state.sampletypes = data
|
||||
},
|
||||
update_selected_sampletype(state, val) {
|
||||
state.selected_sampletype = val
|
||||
},
|
||||
update_stations(state, val) {
|
||||
state.stations = val
|
||||
},
|
||||
update_selected_station(state, val) {
|
||||
state.selected_station = val
|
||||
},
|
||||
update_statuses(state, val) {
|
||||
state.statuses = val
|
||||
},
|
||||
update_selected_status(state, val) {
|
||||
state.selected_status = val
|
||||
},
|
||||
update_phone(state, val) {
|
||||
state.phone = val
|
||||
},
|
||||
update_email(state, val) {
|
||||
state.email = val
|
||||
},
|
||||
update_hp(state, val) {
|
||||
state.hp = val
|
||||
},
|
||||
update_pj(state, val) {
|
||||
state.pj = val
|
||||
},
|
||||
update_dpj(state, val) {
|
||||
state.dpj = val
|
||||
},
|
||||
update_clinic(state, val) {
|
||||
state.clinic = val
|
||||
},
|
||||
update_marketing_confirm(state, val) {
|
||||
state.marketing_confirm = val
|
||||
},
|
||||
update_is_default(state, val) {
|
||||
state.is_default = val
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_btn_save_seen(state, val) {
|
||||
state.btn_save_seen = val
|
||||
},
|
||||
update_pgrs_save(state, val) {
|
||||
state.pgrs_save = val
|
||||
},
|
||||
update_save_error_message(state, msg) {
|
||||
state.save_error_message = ''
|
||||
},
|
||||
update_no_save(state, val) {
|
||||
state.no_save = val
|
||||
},
|
||||
update_open_alert_confirmation(state, val) {
|
||||
state.open_alert_confirmation = val
|
||||
},
|
||||
update_alert_success(state, val) {
|
||||
state.alert_success = val
|
||||
},
|
||||
update_msg_success(state, val) {
|
||||
state.msg_success = val
|
||||
},
|
||||
update_dialog_success(state, val) {
|
||||
state.dialog_success = val
|
||||
},
|
||||
update_dialog_confirmation_delete(state, val) {
|
||||
state.dialog_confirmation_delete = val
|
||||
},
|
||||
update_msg_confirmation_delete(state, val) {
|
||||
state.msg_confirmation_delete = val
|
||||
},
|
||||
update_dialog_confirmation_delete_addr(state, val) {
|
||||
state.dialog_confirmation_delete_addr = val
|
||||
},
|
||||
update_msg_confirmation_delete_addr(state, val) {
|
||||
state.msg_confirmation_delete_addr = val
|
||||
},
|
||||
update_addresses(state, val) {
|
||||
state.addresses = val
|
||||
},
|
||||
update_autocomplete_status(state,val){
|
||||
state.autocomplete_status = val
|
||||
},
|
||||
update_dialog_form_address(state, val) {
|
||||
state.dialog_form_address = val
|
||||
},
|
||||
update_label_address(state, val) {
|
||||
state.label_address = val
|
||||
},
|
||||
update_cities(state, val) {
|
||||
state.cities = val
|
||||
},
|
||||
update_city_address(state, val) {
|
||||
state.city_address = val
|
||||
},
|
||||
update_districts(state, val) {
|
||||
state.districts = val
|
||||
},
|
||||
update_district_address(state, val) {
|
||||
state.district_address = val
|
||||
},
|
||||
update_kelurahans(state, val) {
|
||||
state.kelurahans = val
|
||||
},
|
||||
update_kelurahan_address(state, val) {
|
||||
state.kelurahan_address = val
|
||||
},
|
||||
update_description_address(state, val) {
|
||||
state.description_address = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_total_patients(state, val) {
|
||||
state.total_patients = val
|
||||
},
|
||||
update_dialog_action(state, val) {
|
||||
state.dialog_action = val
|
||||
},
|
||||
update_msg_action(state, val) {
|
||||
state.msg_action = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context, prm) {
|
||||
context.commit("update_search_patient", 1)
|
||||
window.key_enter = ''
|
||||
try {
|
||||
console.log(prm)
|
||||
console.log('search')
|
||||
prm.token = one_token()
|
||||
console.log(prm)
|
||||
let resp = await api.search(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_patient", 3)
|
||||
context.commit("update_search_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_search_patient", 2)
|
||||
context.commit("update_search_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_patients", data.records)
|
||||
context.commit("update_total_patients", data.total)
|
||||
//context.commit("update_total_page", data.total)
|
||||
context.commit("update_no_save", 0)
|
||||
//context.commit("update_barcode_search",false)
|
||||
//context.commit("update_barcode_search_tube",false)
|
||||
if(prm.lastid === -1){
|
||||
var pat = data.records[0]
|
||||
if(data.records.length === 0){
|
||||
context.commit("update_selected_patient", {})
|
||||
context.commit("update_sampletypes", {})
|
||||
}else{
|
||||
context.commit("update_selected_patient", data.records[0])
|
||||
context.dispatch("getsampletypes",{
|
||||
orderid:pat.T_OrderHeaderID,
|
||||
stationid: pat.T_SampleStationID,
|
||||
statusid: pat.statusid
|
||||
})
|
||||
}
|
||||
}
|
||||
else{
|
||||
console.log("oyyeee")
|
||||
context.commit("update_last_id", prm.lastid)
|
||||
context.commit("update_selected_patient", data.records[prm.lastid])
|
||||
var pat = data.records[prm.lastid]
|
||||
context.dispatch("getsampletypes",{
|
||||
orderid:pat.T_OrderHeaderID,
|
||||
stationid: pat.T_SampleStationID,
|
||||
statusid: pat.statusid
|
||||
})
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_patient", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async getstationstatus(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
let resp= await api.getstationstatus(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status",3)
|
||||
} else {
|
||||
context.commit("update_get_data_status",2)
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_stations",data.records.stations)
|
||||
context.commit("update_selected_station",data.records.stations[0])
|
||||
context.commit("update_statuses",data.records.statuses)
|
||||
context.commit("update_selected_status",data.records.statuses[0])
|
||||
prm.stationid = data.records.stations[0].id
|
||||
prm.statusid = data.records.statuses[0].id
|
||||
console.log(prm)
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async savenotesampling(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.savenotesampling(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status",3)
|
||||
} else {
|
||||
context.commit("update_get_data_status",2)
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_dialog_form_note",false)
|
||||
console.log(prm)
|
||||
context.dispatch("search",prm.search)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async getrequirements(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getrequirements(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status",3)
|
||||
} else {
|
||||
context.commit("update_get_data_status",2)
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_requirements",data.records)
|
||||
context.commit("update_dialog_requirement",true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async getdatanoterequirement(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getdatanoterequirement(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status",3)
|
||||
} else {
|
||||
context.commit("update_get_data_status",2)
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_note_requirement",data.records)
|
||||
context.commit("update_dialog_note",true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async save(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.save(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_last_id", prm.M_patientID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Data dokter " + prm.M_patientName + " sudah terupdate dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async receivesample(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.doaction(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_barcode_search",false)
|
||||
context.commit("update_barcode_search_tube",false)
|
||||
context.commit("update_barcode_search_string","")
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if(data.records.status === 'OK')
|
||||
prm.search.lastid = -1
|
||||
|
||||
context.dispatch("search",prm.search)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async addnewlabel(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.addnewlabel(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_dialog_action",false)
|
||||
/*let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if(data.records.status === 'OK')
|
||||
prm.search.lastid = -1*/
|
||||
console.log(prm)
|
||||
console.log('beofre')
|
||||
console.log(prm)
|
||||
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async saverequirement(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.saverequirement(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_dialog_requirement", false)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async newpatient(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.newpatient(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
console.log(resp.data.id)
|
||||
context.commit("update_last_id", resp.data.id)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Data dokter " + prm.M_patientName + " sudah tersimpan dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async delete(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.xdelete(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_last_id", 0)
|
||||
context.commit("update_dialog_confirmation_delete",false)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Data dokter " + prm.M_patientName + " sudah dihapus dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_preffix",'')
|
||||
context.commit("update_patient_name",'')
|
||||
context.commit("update_suffix",'')
|
||||
context.commit("update_selected_sex",{})
|
||||
context.commit("update_selected_religion",{})
|
||||
context.commit("update_phone",'')
|
||||
context.commit("update_email",'')
|
||||
context.commit("update_hp",'')
|
||||
context.commit("update_pj",'N')
|
||||
context.commit("update_dpj",'N')
|
||||
context.commit("update_clinic",'N')
|
||||
context.commit("update_marketing_confirm",'N')
|
||||
context.commit("update_is_default",'N')
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async getaddress(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getaddress(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_addresses",data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async searchcity(context,prm) {
|
||||
context.commit("update_autocomplete_status",1)
|
||||
try {
|
||||
let resp= await api.searchcity(one_token(),prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status",2)
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_cities",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
}
|
||||
},
|
||||
async getdistrict(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
let resp= await api.getdistrict(one_token(),prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status",3)
|
||||
} else {
|
||||
context.commit("update_get_data_status",2)
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_districts",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async search_staff(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.search_staff(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status",3)
|
||||
} else {
|
||||
context.commit("update_get_data_status",2)
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if(data.records)
|
||||
context.commit("update_staff",resp.data.records)
|
||||
else{
|
||||
context.commit("update_staff",{id:0,code:'',name:'STAF TIDAK DITEMUKAN',code:'',userid:''})
|
||||
}
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
search_patient_enter(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
//console.log(prm)
|
||||
//console.log(context.state.nolab)
|
||||
|
||||
if(context.state.nolab === ''){
|
||||
// console.log(prm)
|
||||
context.commit("update_barcode_search",false)
|
||||
context.commit("update_barcode_search_tube",false)
|
||||
|
||||
var last_selected = context.state.selected_patient
|
||||
var xsearch = prm.search
|
||||
|
||||
if(prm.search.length > 10){
|
||||
xsearch = xsearch.substring(0,xsearch.length-2)
|
||||
}
|
||||
console.log(xsearch)
|
||||
if(last_selected.T_OrderHeaderLabNumber === xsearch){
|
||||
var act = 'call'
|
||||
var status = 1
|
||||
if(last_selected.status === 'Call'){
|
||||
act = 'process'
|
||||
status = 3
|
||||
}
|
||||
if(prm.search.length > 10){
|
||||
context.commit("update_barcode_search",true)
|
||||
context.commit("update_barcode_search_tube",true)
|
||||
context.commit("update_barcode_search_string",prm.search)
|
||||
}
|
||||
|
||||
var patients = context.state.patients
|
||||
var patient = context.state.selected_patient
|
||||
var lastid = _.findIndex(patients, function(o) { return o.T_OrderHeaderID == patient.T_OrderHeaderID })
|
||||
if(last_selected.status !== 'Process'){
|
||||
context.dispatch("doaction",{
|
||||
act:act,
|
||||
id:patient.T_OrderHeaderID,
|
||||
name:context.state.name,
|
||||
nolab:context.state.nolab,
|
||||
stationid: patient.T_SampleStationID,
|
||||
statusid:context.state.selected_status.id,
|
||||
statusnextid : status,
|
||||
sample:{},
|
||||
lastid:lastid,
|
||||
companyid: context.state.selected_company.id,
|
||||
staff:context.state.staff
|
||||
})
|
||||
}
|
||||
else{
|
||||
console.log(context.state.barcode_search_string)
|
||||
console.log(context.state.barcode_search)
|
||||
console.log(context.state.barcode_search_tube)
|
||||
context.dispatch("search",{
|
||||
act:act,
|
||||
id:patient.T_OrderHeaderID,
|
||||
name:context.state.name,
|
||||
nolab:context.state.nolab,
|
||||
stationid: patient.T_SampleStationID,
|
||||
statusid:context.state.selected_status.id,
|
||||
statusnextid : status,
|
||||
sample:{},
|
||||
lastid:lastid,
|
||||
companyid: context.state.selected_company.id,
|
||||
staff:context.state.staff
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
var patients = context.state.patients
|
||||
var idx = _.findIndex(patients, function(o) { return o.T_OrderHeaderLabNumber === xsearch })
|
||||
context.commit("update_selected_patient",patients[idx])
|
||||
var pat = context.state.selected_patient
|
||||
context.dispatch("getsampletypes",{
|
||||
orderid:pat.T_OrderHeaderID,
|
||||
stationid: pat.T_SampleStationID,
|
||||
statusid: pat.statusid
|
||||
})
|
||||
}
|
||||
}else{
|
||||
var param = {
|
||||
name:context.state.name,
|
||||
nolab:context.state.nolab,
|
||||
stationid: context.state.selected_station.id,
|
||||
statusid: context.state.selected_status.id,
|
||||
companyid:context.state.selected_company.id,
|
||||
lastid: -1
|
||||
}
|
||||
context.dispatch('search',param)
|
||||
}
|
||||
},
|
||||
search_patientx(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
prm.token = one_token()
|
||||
},
|
||||
async getkelurahan(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
let resp= await api.getkelurahan(one_token(),prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status",3)
|
||||
} else {
|
||||
context.commit("update_get_data_status",2)
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_kelurahans",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async savenewaddress(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.savenewaddress(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_dialog_form_address",false)
|
||||
context.commit("update_last_id", prm.M_patientAddressM_patientID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Penambahan data alamat dokter " + prm.M_patientName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async saveeditaddress(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.saveeditaddress(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_dialog_form_address",false)
|
||||
context.commit("update_last_id", prm.M_patientAddressM_patientID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Perubahan data alamat dokter " + prm.M_patientName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async deleteaddress(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.deleteaddress(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_dialog_confirmation_delete_addr",false)
|
||||
context.commit("update_last_id", prm.M_patientAddressM_patientID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Penghapusan data alamat "+prm.M_patientAddressNote+" dari dokter " + prm.M_patientName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async getsampletypes(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getsampletypes(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_sampletypes",data.records['sampletypes'])
|
||||
context.commit("update_information_bahan",data.records['information_bahan'])
|
||||
if(context.state.barcode_search){
|
||||
var patients = context.state.patients
|
||||
var selected_patient = context.state.selected_patient
|
||||
var last_id = _.findIndex(patients, function(o) { return o.T_OrderHeaderID == selected_patient.T_OrderHeaderID })
|
||||
context.commit("update_last_id",last_id)
|
||||
//console.log("YIiiiiihaa")
|
||||
//console.log(selected_patient.status)
|
||||
//console.log(context.state.barcode_search_tube)
|
||||
if(context.state.barcode_search_tube && selected_patient.status === "Process"){
|
||||
var xsearch = context.state.barcode_search_string
|
||||
var sampletypes = context.state.sampletypes
|
||||
console.log("start")
|
||||
console.log(context.state.barcode_search_tube)
|
||||
var search_minus_one = xsearch.substring(0,xsearch.length)
|
||||
//console.log(search_minus_one)
|
||||
var samples = _.filter(sampletypes, function(o) {
|
||||
return o.T_BarcodeLabBarcode.substring(0,o.T_BarcodeLabBarcode.length-1) == search_minus_one
|
||||
})
|
||||
//console.log(samples)
|
||||
if(samples && samples.length != -1 && samples[0].status === 'P'){
|
||||
//console.log("masuk")
|
||||
samples.forEach((el)=>{el.requirement_status = "Y"})
|
||||
_.forEach(samples, function(value,idxx) {
|
||||
samples[idxx].requirements.forEach((el)=>{el.chex = "N"})
|
||||
});
|
||||
|
||||
|
||||
context.commit("update_sampletypes",sampletypes)
|
||||
|
||||
context.commit("update_act",'samplingdone')
|
||||
var barcode_prm = selected_patient
|
||||
barcode_prm.id = selected_patient.T_OrderHeaderID
|
||||
barcode_prm.act = 'samplingdone'
|
||||
barcode_prm.typeaction = 'multi'
|
||||
barcode_prm.sample = samples
|
||||
barcode_prm.staff = context.state.staff
|
||||
barcode_prm.search = {
|
||||
name:context.state.name,
|
||||
nolab:context.state.nolab,
|
||||
stationid: context.state.selected_station.id,
|
||||
statusid: context.state.selected_status.id,
|
||||
companyid: context.state.selected_company.id,
|
||||
lastid: context.state.last_id
|
||||
}
|
||||
context.dispatch("receivesample",barcode_prm)
|
||||
}
|
||||
else{
|
||||
context.commit("update_msg_info","Tetap fokus, yang sudah biarlah sudah")
|
||||
context.commit("update_open_dialog_info",true)
|
||||
}
|
||||
}else{
|
||||
context.commit("update_barcode_search",false)
|
||||
context.commit("update_barcode_search_tube",false)
|
||||
context.commit("update_barcode_search_string","")
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async searchcompany(context,prm) {
|
||||
context.commit("update_autocomplete_status",1)
|
||||
try {
|
||||
let resp= await api.searchcompany(one_token(),prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status",2)
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_companies",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
}
|
||||
},
|
||||
async doaction(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.doaction(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_act",'-')
|
||||
|
||||
context.commit("update_dialog_action",false)
|
||||
if(data.records['status'] === 'NOTCALL'){
|
||||
var dt = data.records['data']
|
||||
var msg = " Bagai pinang dibelah dua, pasiennya lagi dipanggil di "+dt.T_SampleStationName
|
||||
context.commit("update_msg_info",msg)
|
||||
context.commit("update_open_dialog_info",true)
|
||||
}
|
||||
//prm.lastid = -1
|
||||
if(data.records['status'] === 'OK'){
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
29
test/vuex/one-sample-lab/store.js
Normal file
29
test/vuex/one-sample-lab/store.js
Normal file
@@ -0,0 +1,29 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import samplecall from "./modules/samplecall.js";
|
||||
import order_info from "./modules/order_info.js";
|
||||
import system from "../../../apps/modules/system/system.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
samplecall: samplecall,
|
||||
system: system,
|
||||
order_info: order_info
|
||||
},
|
||||
state: {
|
||||
tab_selected: 'pasien-dokter'
|
||||
},
|
||||
mutations: {
|
||||
change_tab(state, ntab) {
|
||||
state.tab_selected = ntab
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
change_tab(context, ntab) {
|
||||
context.commit('change_tab', ntab)
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user