Flatten nested repos

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

View File

@@ -0,0 +1,270 @@
const URL = "/one-api/homeservice/masterdata/";
export async function search(prm) {
try {
var resp = await axios.post(URL + 'test/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 getsexreg(token) {
try {
var resp = await axios.post(URL + 'test/getsexreg',{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 checkedhs(prm) {
try {
var resp = await axios.post(URL + 'test/checkedhs',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 checkedfavorite(prm) {
try {
var resp = await axios.post(URL + 'test/checkedfavorite',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 save(prm) {
try {
var resp = await axios.post(URL + 'test/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 newtest(prm) {
try {
var resp = await axios.post(URL + 'test/newtest',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 + 'test/deletetest',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 + 'test/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 searchsample(token,prm) {
try {
var resp = await axios.post(URL + 'test/searchsample',{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 getsubarea(token,prm) {
try {
var resp = await axios.post(URL + 'test/getsubarea',{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 savenewaddress(prm) {
try {
var resp = await axios.post(URL + 'test/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 + 'test/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 + 'test/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 check_exist_code(prm) {
try {
var resp = await axios.post(URL + 'test/check_exist_code',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,809 @@
<template>
<div>
<v-layout class="mb-2" column>
<v-dialog v-model="dialogconfirmationdelete" persistent max-width="290">
<v-card>
<v-card-title dark class="headline error pt-2 pb-2" primary-title style="color:white">
<h4 dark>Konfirmasi</h4>
</v-card-title>
<v-card-text>
{{msgconfirmationdelete}}
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn small color="error darken-1 text-sm-left" flat @click="doDeleteData()">Hapus</v-btn>
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdelete = false">Batal</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card>
<v-layout row>
<v-flex xs12>
<v-subheader red--text text--lighten-1> DETAIL PEMERIKSAAN
</v-subheader>
<v-divider></v-divider>
<v-layout wrap>
<v-flex xs12 pa-2>
<v-layout row>
<v-flex xs6 pa-1>
<v-text-field class="pr-1" v-model="xcode" label="Kode*"></v-text-field>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requirecode')" class="error pl-2 pr-2" style="color:#fff">Kode harus diisi ya</p>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requirecodeexist')" class="error pl-2 pr-2" style="color:#fff">Sudah dipake dong</p>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requirecodedigit')" class="error pl-2 pr-2" style="color:#fff">Kode harus 8 karakter</p>
</v-flex>
<v-flex xs6 pa-1>
<v-text-field class="pr-1" v-model="xtestname" label="Nama*"></v-text-field>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requirename')" class="error pl-2 pr-2" style="color:#fff">Kalo gak ada namanya, bingung dong</p>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs4 pa-1>
<v-text-field class="pr-1" v-model="xshortname" label="Singkatan"></v-text-field>
</v-flex>
<v-flex xs4 pa-1>
<v-text-field class="pr-1" v-model="xnamebarcode" label="Kode bar" hint="Kode yang ditampilkan pada kode bar"></v-text-field>
</v-flex>
<v-flex xs4 pa-1>
<v-text-field class="pr-1" v-model="xworklistname" label="Nama worklist"></v-text-field>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs6 pa-1>
<v-select item-text="Nat_GroupName" return-object :items="xgroups" v-model="xgroup" label="Grup"></v-select>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requiregrup')" class="error pl-2 pr-2" style="color:#fff">Masukin grup dong</p>
</v-flex>
<v-flex xs6 pa-1>
<v-select item-text="Nat_SubGroupName" return-object :items="xsubgroups" v-model="xsubgroup" label="Sub Grup"></v-select>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requiresubgrup')" class="error pl-2 pr-2" style="color:#fff">Subgrup-nya jangan lupa</p>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs6 pa-1>
<v-select readonly class="pr-1" item-text="Nat_TestTypeName" return-object :items="xtypes" v-model="xtype" label="Tipe"></v-select>
</v-flex>
<v-flex xs6 pa-1>
<v-select class="pr-1" item-text="T_TestIsNonLab" return-object :items="xnonlabs" v-model="xnonlab" label="Tipe hasil"></v-select>
</v-flex>
</v-layout>
<v-layout row>
<v-flex v-bind:class="{ 'x6': xisresult === 'N','x3': xisresult === 'Y' && xflagquantitative === 'N','xs2': xisresult === 'Y' && xflagquantitative === 'Y'}">
<v-text-field class="pr-1" v-model="xfontsize" label="Ukuran huruf"></v-text-field>
</v-flex>
<v-flex v-bind:class="{ 'x6': xisresult === 'N','x3': xisresult === 'Y' && xflagquantitative === 'N','xs2': xisresult === 'Y' && xflagquantitative === 'Y' }">
<v-text-field class="pr-1" v-model="xfontcolor" label="Warna huruf"></v-text-field>
</v-flex>
<v-flex xs1 v-if="xisresult === 'Y' && xflagquantitative === 'Y'">
<v-text-field readonly class="pr-1" v-model="xflaglow" label="Low"></v-text-field>
</v-flex>
<v-flex xs1 v-if="xisresult === 'Y' && xflagquantitative === 'Y'">
<v-text-field readonly class="pr-1" v-model="xflaghigh" label="High"></v-text-field>
</v-flex>
<!--<v-flex v-bind:class="{ 'x4': xisresult === 'N','x3': xisresult === 'Y' }">
<v-text-field
class="pr-1"
v-model="xflaggluc"
label="Flag gluc"
hide-details
></v-text-field>
</v-flex>-->
<v-flex v-if="xisresult === 'Y'" v-bind:class="{ 'xs4': xisresult === 'Y' && xflagquantitative === 'N','xs3': xisresult === 'Y' && xflagquantitative === 'Y' }">
<v-autocomplete class="pr-1" label="Tipe Bahan" v-model="sampletypeaddress" :items="xsampletypees" :search-input.sync="search_sample"
auto-select-first no-filter item-text="T_SampleTypeName" return-object no-data-text="Pilih jenis sample">
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.T_SampleTypeName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requiresample')" class="error pl-2 pr-2" style="color:#fff">Ada hasil, ada sample dong</p>
</v-flex>
<v-flex v-if="xisresult === 'Y'" v-bind:class="{ 'xs4': xisresult === 'Y' && xflagquantitative === 'N','xs3': xisresult === 'Y' && xflagquantitative === 'Y' }">
<v-text-field class="pr-1" v-model="xunit" label="Satuan"></v-text-field>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs6>
<div>
<v-btn v-if="xflagbold === 'N'" small color="error">
<v-icon left>close</v-icon> Huruf dibuat tebal</v-btn>
<v-btn v-if="xflagbold === 'Y'" small color="success">
<v-icon left>check</v-icon> Huruf dibuat tebal</v-btn>
</div>
<div>
<v-btn v-if="xflagitalic === 'N'" small color="error">
<v-icon left>close</v-icon> Huruf dibuat miring</v-btn>
<v-btn v-if="xflagitalic === 'Y'" small color="success">
<v-icon left>check</v-icon> Huruf dibuat miring</v-btn>
</div>
<div>
<v-btn v-if="xisprice === 'N'" small color="error">
<v-icon left>close</v-icon> Bisa diberi harga</v-btn>
<v-btn v-if="xisprice === 'Y'" small color="success">
<v-icon left>check</v-icon> Bisa diberi harga</v-btn>
</div>
<div>
<v-btn v-if="xprintnote === 'N' && xisprice === 'Y'" small color="error">
<v-icon left>close</v-icon> Dicetak dinota</v-btn>
<v-btn v-if="xprintnote === 'Y' && xisprice === 'Y'" small color="success">
<v-icon left>check</v-icon> Dicetak dinota</v-btn>
</div>
</v-flex>
<v-flex xs6 class="text-sm-right align-right">
<div>
<v-btn v-if="xisresult === 'N'" small color="error">
<v-icon left>close</v-icon> Ada hasil</v-btn>
<v-btn v-if="xisresult === 'Y'" small color="success">
<v-icon left>check</v-icon> Ada hasil</v-btn>
</div>
<div>
<v-btn v-if="xflagquantitative === 'N' && xisresult === 'Y'"
small color="error">
<v-icon left>close</v-icon> Hasil Kuantitatif</v-btn>
<v-btn v-if="xflagquantitative === 'Y' && xisresult === 'Y'"
small color="success">
<v-icon left>check</v-icon> Hasil Kuantitatif</v-btn>
</div>
<div>
<v-btn v-if="xdeltacheck === 'N' && xisresult === 'Y'" small color="error">
<v-icon left>close</v-icon> Delta check</v-btn>
<v-btn v-if="xdeltacheck === 'Y' && xisresult === 'Y'" small color="success">
<v-icon left>check</v-icon> Delta check</v-btn>
</div>
<div>
<v-btn v-if="xtrendanalysis === 'N' && xisresult === 'Y'" small color="error">
<v-icon left>close</v-icon> Trend Analysis</v-btn>
<v-btn v-if="xtrendanalysis === 'Y' && xisresult === 'Y'" small color="success">
<v-icon left>check</v-icon> Trend Analysis</v-btn>
</div>
<div>
<v-btn v-if="xprintresult === 'N' && xisresult === 'Y'" small color="error">
<v-icon left>close</v-icon> Dicetak dihasil</v-btn>
<v-btn v-if="xprintresult === 'Y' && xisresult === 'Y'" small color="success">
<v-icon left>check</v-icon> Dicetak dihasil</v-btn>
</div>
<div>
<v-btn v-if="xisworklist === 'N'" small color="error">
<v-icon left>close</v-icon> Masuk worklist</v-btn>
<v-btn v-if="xisworklist === 'Y'" small color="success">
<v-icon left>check</v-icon> Masuk worklist</v-btn>
</div>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card>
</v-layout>
<template>
<v-dialog v-model="dialogerrormsg" max-width="30%">
<v-card>
<v-card-title class="headline red en-1 pt-2 pb-2" primary-title>
<h4 style="color:#FFEBEE">Peringatan !</h4>
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 v-html="errormsg" xs12>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="error" flat @click="dialogerrormsg = false">
Tutup
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
</div>
</template>
<style scoped>
table,
td,
th {
border: 1px solid #ddd;
text-align: left;
}
table {
border-collapse: collapse;
width: 100%;
}
th,
td {
padding-top: 5px;
padding-bottom: 5px;
padding-left: 8px;
padding-right: 5px;
}
.mini-input .v-input {
margin-top: 0px;
}
.mini-input .v-input,
.mini-input .v-input--selection-controls,
.mini-input .v-input__slot {
margin-top: 0px;
margin-bottom: 0px;
margin-left: 3px;
}
.mini-input .v-messages {
min-height: 0px;
}
input.fhm-input {
border: 1px solid black;
border-radius: 2px;
-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
0 0 4px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
0 0 4px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
0 0 4px rgba(0, 0, 0, 0.1);
padding: 2px 4px;
background: rgba(255, 255, 255, 0.5);
margin: 0 0 1px 0;
width: 30px;
text-align: center;
}
</style>
<script>
module.exports = {
data: () => ({
dialogerrormsg: false,
errormsg: '',
search_sample: '',
startdate: '',
enddate: '',
menustartdate: false,
menuenddate: false,
date: new Date().toISOString().substr(0, 10)
}),
computed: {
dialogconfirmationdelete: {
get() {
return this.$store.state.test.dialog_confirmation_delete
},
set(val) {
this.$store.commit("test/update_dialog_confirmation_delete", val)
}
},
msgconfirmationdelete() {
return this.$store.state.test.msg_confirmation_delete
},
isLoading() {
return this.$store.state.test.search_status == 1
},
xact() {
return this.$store.state.test.act
},
detail() {
return this.$store.state.test.selected_test
},
xgroups() {
return this.$store.state.test.groups
},
xgroup: {
get() {
return this.$store.state.test.selected_group
},
set(val) {
this.$store.commit("test/update_selected_group", val)
this.$store.commit("test/update_no_save", 1)
}
},
xtypes() {
return this.$store.state.test.types
},
xtype: {
get() {
return this.$store.state.test.selected_type
},
set(val) {
this.$store.commit("test/update_selected_type", val)
this.$store.commit("test/update_no_save", 1)
}
},
xnonlabs() {
return this.$store.state.test.nonlabs
},
xnonlab: {
get() {
return this.$store.state.test.selected_nonlab
},
set(val) {
this.$store.commit("test/update_selected_nonlab", val)
this.$store.commit("test/update_no_save", 1)
}
},
xtestname: {
get() {
return this.$store.state.test.test_name
},
set(val) {
this.$store.commit("test/update_test_name", val)
this.$store.commit("test/update_no_save", 1)
}
},
xnamebarcode: {
get() {
return this.$store.state.test.namebarcode
},
set(val) {
this.$store.commit("test/update_namebarcode", val)
this.$store.commit("test/update_no_save", 1)
}
},
xdob: {
get() {
return this.$store.state.test.dob
},
set(val) {
this.$store.commit("test/update_dob", val)
this.$store.commit("test/update_no_save", 1)
}
},
xsubgroups() {
return this.$store.state.test.subgroups
},
xsubgroup: {
get() {
return this.$store.state.test.selected_subgroup
},
set(val) {
this.$store.commit("test/update_selected_subgroup", val)
this.$store.commit("test/update_no_save", 1)
}
},
xreligions() {
return this.$store.state.test.religions
},
xreligion: {
get() {
return this.$store.state.test.selected_religion
},
set(val) {
this.$store.commit("test/update_selected_religion", val)
this.$store.commit("test/update_no_save", 1)
}
},
xcode: {
get() {
return this.$store.state.test.code
},
set(val) {
this.$store.commit("test/update_code", val)
this.$store.dispatch("test/check_exist_code", {trx:this.$store.state.test.selected_test,newcode:val})
this.$store.commit("test/update_no_save", 1)
}
},
xshortname: {
get() {
return this.$store.state.test.shortname
},
set(val) {
this.$store.commit("test/update_shortname", val)
this.$store.commit("test/update_no_save", 1)
}
},
xunit: {
get() {
return this.$store.state.test.unit
},
set(val) {
this.$store.commit("test/update_unit", val)
this.$store.commit("test/update_no_save", 1)
}
},
xflaglow: {
get() {
return this.$store.state.test.flaglow
},
set(val) {
this.$store.commit("test/update_flaglow", val)
this.$store.commit("test/update_no_save", 1)
}
},
xflaghigh: {
get() {
return this.$store.state.test.flaghigh
},
set(val) {
this.$store.commit("test/update_flaghigh", val)
this.$store.commit("test/update_no_save", 1)
}
},
xaddress: {
get() {
return this.$store.state.test.address
},
set(val) {
this.$store.commit("test/update_address", val)
this.$store.commit("test/update_no_save", 1)
}
},
xsamples() {
return this.$store.state.test.samples
},
xsample: {
get() {
return this.$store.state.test.sample
},
set(val) {
this.$store.commit("test/update_sample", val)
}
},
xsampletypees() {
return this.$store.state.test.sampletypees
},
sampletypeaddress: {
get() {
return this.$store.state.test.sampletype_address
},
set(val) {
this.$store.commit("test/update_sampletype_address", val)
}
},
xpositions() {
return this.$store.state.test.positions
},
xposition: {
get() {
return this.$store.state.test.selected_position
},
set(val) {
this.$store.commit("test/update_selected_position", val)
this.$store.commit("test/update_no_save", 1)
}
},
xworklistname: {
get() {
return this.$store.state.test.worklistname
},
set(val) {
this.$store.commit("test/update_worklistname", val)
this.$store.commit("test/update_no_save", 1)
}
},
xfontsize: {
get() {
return this.$store.state.test.fontsize
},
set(val) {
this.$store.commit("test/update_fontsize", val)
this.$store.commit("test/update_no_save", 1)
}
},
xfontcolor: {
get() {
return this.$store.state.test.fontcolor
},
set(val) {
this.$store.commit("test/update_fontcolor", val)
this.$store.commit("test/update_no_save", 1)
}
},
xmaxdiscount: {
get() {
return this.$store.state.test.maxdiscount
},
set(val) {
this.$store.commit("test/update_maxdiscount", val)
this.$store.commit("test/update_no_save", 1)
}
},
xflagbold: {
get() {
return this.$store.state.test.flagbold
},
set(val) {
this.$store.commit("test/update_flagbold", val)
this.$store.commit("test/update_no_save", 1)
}
},
xflagitalic: {
get() {
return this.$store.state.test.flagitalic
},
set(val) {
this.$store.commit("test/update_flagitalic", val)
this.$store.commit("test/update_no_save", 1)
}
},
xflagquantitative: {
get() {
return this.$store.state.test.flagquantitative
},
set(val) {
this.$store.commit("test/update_flagquantitative", val)
this.$store.commit("test/update_no_save", 1)
}
},
xdeltacheck: {
get() {
return this.$store.state.test.deltacheck
},
set(val) {
this.$store.commit("test/update_deltacheck", val)
this.$store.commit("test/update_no_save", 1)
}
},
xtrendanalysis: {
get() {
return this.$store.state.test.trendanalysis
},
set(val) {
this.$store.commit("test/update_trendanalysis", val)
this.$store.commit("test/update_no_save", 1)
}
},
xisresult: {
get() {
return this.$store.state.test.isresult
},
set(val) {
this.$store.commit("test/update_isresult", val)
this.$store.commit("test/update_no_save", 1)
}
},
xisprice: {
get() {
return this.$store.state.test.isprice
},
set(val) {
this.$store.commit("test/update_isprice", val)
this.$store.commit("test/update_no_save", 1)
}
},
xprintresult: {
get() {
return this.$store.state.test.printresult
},
set(val) {
this.$store.commit("test/update_printresult", val)
this.$store.commit("test/update_no_save", 1)
}
},
xprintnote: {
get() {
return this.$store.state.test.printnote
},
set(val) {
this.$store.commit("test/update_printnote", val)
this.$store.commit("test/update_no_save", 1)
}
},
xisworklist: {
get() {
return this.$store.state.test.isworklist
},
set(val) {
this.$store.commit("test/update_isworklist", val)
this.$store.commit("test/update_no_save", 1)
}
},
startComputedDateFormatted() {
return this.formatDate(this.xstartdate)
},
xstartdate: {
get() {
return this.$store.state.test.startdate
},
set(val) {
this.$store.commit("test/update_startdate", val)
}
},
endComputedDateFormatted() {
return this.formatDate(this.xenddate)
},
xenddate: {
get() {
return this.$store.state.test.enddate
},
set(val) {
this.$store.commit("test/update_enddate", val)
}
},
},
methods: {
changeBtnFlagBold(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xflagbold = newval
},
changeBtnFlagItalic(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xflagitalic = newval
},
changeBtnFlagQuantitative(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xflagquantitative = newval
},
changeBtnFlagDeltacheck(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xdeltacheck = newval
},
changeBtnFlagTrendanalysis(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xtrendanalysis = newval
},
changeBtnFlagIsprice(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xisprice = newval
},
changeBtnFlagIsresult(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xisresult = newval
},
changeBtnFlagPrintresult(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xprintresult = newval
},
changeBtnFlagPrintnote(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xprintnote = newval
},
changeBtnFlagIsworklist(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xisworklist = newval
},
checkError(value) {
var errors = this.$store.state.test.errors
if (errors.includes(value)) {
return true
} else {
return false
}
},
saveData() {
var prm = {}
prm.T_TestID = this.$store.state.test.selected_test.T_TestID
prm.T_TestNat_GroupID = this.$store.state.test.selected_group.Nat_GroupID
prm.T_TestName = this.xtestname
prm.T_TestNat_SubgroupID = this.$store.state.test.selected_subgroup.Nat_SubGroupID
prm.T_TestShortName = this.xshortname
prm.T_TestSasCode = this.xcode
prm.T_TestShortNameBarcode = this.xnamebarcode
prm.T_TestT_SampleTypeID = this.sampletypeaddress.T_SampleTypeID
prm.T_TestWorklistName = this.xworklistname
prm.T_TestFontSize = this.xfontsize
prm.T_TestFontColor = this.xfontcolor
prm.T_TestMaxDiscount = this.xmaxdiscount
prm.T_TestIsNonLab = this.$store.state.test.selected_nonlab.T_TestIsNonLabID
prm.T_TestIsBold = this.xflagbold
prm.T_TestIsItalic = this.xflagitalic
prm.T_TestIsQuantitative = this.xflagquantitative
prm.T_TestIsDeltaCheck = this.xdeltacheck
prm.T_TestIsTrendAnalysis = this.xtrendanalysis
prm.T_TestIsResult = this.xisresult
prm.T_TestIsPrice = this.xisprice
prm.T_TestIsPrintResult = this.xprintresult
prm.T_TestIsPrintNota = this.xprintnote
prm.T_TestIsWorklist = this.xisworklist
this.$store.dispatch("test/save", prm)
},
saveNewTest() {
var error_count = 0
var error_msg = ''
if (_.isEmpty(this.xgroup)) {
error_count++
error_msg +=
"<p><kbd class='text-uppercase'>Cabang</kbd> : Ayo, pilih salah satu cabang</p>"
}
if (this.xtestname === "") {
error_count++
error_msg +=
"<p><kbd class='text-uppercase'>Nama Karyawan</kbd> : Diisi dong nama karyawannya</p>"
}
if (_.isEmpty(this.xsubgroup)) {
error_count++
error_msg +=
"<p><kbd class='text-uppercase'>Jenis Kelamin</kbd> : Ayo, pilih salah satu jenis kelamin</p>"
}
if (this.xdob === "") {
error_count++
error_msg +=
"<p><kbd class='text-uppercase'>Tanggal Lahir</kbd> : Diisi dong tanggal lahirnya</p>"
}
var aDOB = moment(this.xdob, 'DD-MM-YYYY', true)
var isValidDOB = aDOB.isValid()
if (!isValidDOB) {
error_count++
error_msg +=
"<p><kbd class='text-uppercase'>Tanggal Lahir</kbd> : Diisi sesuai format dong (DD-MM-YYYY, contoh : 22-06-1988)</p>"
}
if (error_count > 0) {
this.errormsg = error_msg
this.dialogerrormsg = true
} else {
var prm = {}
prm.T_TestID = 0
prm.T_TestNat_GroupID = this.$store.state.test.selected_group.Nat_GroupID
prm.T_TestName = this.xtestname
prm.T_TestDOB = this.xdob
prm.T_TestNat_SubgroupID = this.$store.state.test.selected_subgroup.Nat_SubGroupID
prm.T_TestM_ReligionID = this.$store.state.test.selected_religion.M_ReligionID
prm.T_TestShortName = this.xshortname
prm.T_TestCode = this.xcode
prm.T_TestAddress = this.xaddress
prm.T_TestShortNameBarcode = this.xnamebarcode
prm.T_TestM_CityID = this.cityaddress.M_CityID
prm.T_TestT_SampleTypeID = this.sampletypeaddress.T_SampleTypeID
prm.T_TestM_PositionID = this.$store.state.test.selected_position.M_PositionID
prm.T_TestStartDate = this.xstartdate
prm.T_TestEndDate = this.xenddate
prm.T_TestWorklistName = this.xworklistname
prm.T_TestFontSize = this.xfontsize
prm.T_TestFontColor = this.xfontcolor
prm.T_TestMaxDiscount = this.xmaxdiscount
prm.T_TestIsBold = this.xisbold
this.$store.dispatch("test/newtest", prm)
}
},
thr_search_sample: _.debounce(function () {
this.$store.dispatch("test/searchsample", this.search_sample)
}, 2000),
formatDate(date) {
if (!date) return null
const [year, month, day] = date.split('-')
return `${day}-${month}-${year}`
},
deFormatedDate(date) {
if (!date) return null
const [day, month, year] = date.split('-')
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
},
deleteData() {
let msg = "Yakin, akan menghapus data pasien " + this.xtestname + " ?"
this.$store.commit("test/update_msg_confirmation_delete", msg)
this.$store.commit("test/update_dialog_confirmation_delete", true)
},
doDeleteData() {
var prm = {}
prm.T_TestID = this.$store.state.test.selected_test.T_TestID
prm.T_TestName = this.xtestname
this.$store.dispatch("test/delete", prm)
}
},
watch: {
search_sample(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.test.update_autocomplete_status == 1) return
this.thr_search_sample()
}
}
}
</script>

View File

@@ -0,0 +1,402 @@
<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 align-center row>
<v-flex xs3>
<v-text-field class=" ma-1" label="" placeholder="Kode" single-line outline v-model="scode" @keyup.enter="searchTest" hide-details></v-text-field>
</v-flex>
<v-flex xs3>
<v-text-field class=" ma-1" label="" placeholder="Nama" single-line outline v-model="name" @keyup.enter="searchTest" hide-details></v-text-field>
</v-flex>
<v-flex xs3 class="text-xs-right">
<v-btn @click="checkAll('Y')" dark color="green">Centang Semua</v-btn>
</v-flex>
<v-flex xs3 class="text-xs-right">
<v-btn @click="checkAll('N')" dark color="red">Un-Centang Semua</v-btn>
</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 hide-actions :headers="headers" :items="tests" :loading="isLoading" class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_TestSasCode}}</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_TestName}}</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.Nat_TestTypeName}}</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.Nat_GroupName}}</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.Nat_SubGroupName}}</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.Nat_SubSubGroupName}}</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-btn dark style="min-width:10px" v-if="props.item.status === 'N'" small @click="changeStatus(props.item)" color="error"><v-icon dark left>close</v-icon></v-btn>
<v-btn dark style="min-width:10px" v-if="props.item.status === 'Y'" small @click="changeStatus(props.item)" color="green"><v-icon dark right>check</v-icon></v-btn>
</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-btn dark style="min-width:10px" v-if="props.item.isfavorite === 'N'" small @click="changeFavorite(props.item)" color="error"><v-icon dark left>close</v-icon></v-btn>
<v-btn dark style="min-width:10px" v-if="props.item.isfavorite === 'Y'" small @click="changeFavorite(props.item)" color="green"><v-icon dark right>check</v-icon></v-btn>
</td>
</template>
</v-data-table>
<v-divider></v-divider>
<v-pagination
style="margin-top:10px;margin-bottom:10px"
v-model="curr_page"
:length="xtotal_page"
></v-pagination>
</v-flex>
</v-layout>
</v-card>
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()"
@close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
components: {
'one-dialog-info': httpVueLoader('../../common/oneDialogInfo.vue'),
'one-dialog-alert': httpVueLoader('../../common/oneDialogAlert.vue')
},
mounted() {
this.$store.dispatch("test/getsexreg")
this.$store.dispatch("test/search", {
current_page:this.curr_page,
name: this.name,
scode: this.scode,
lastid: -1
})
},
methods: {
checkAll(value){
let arrtest = this.$store.state.test.tests
arrtest.forEach((entry,i) => {
arrtest[i].status = value
})
this.$store.dispatch("test/checkedhs", {
test:arrtest
})
},
changeStatus(item){
item.status = item.status === 'N' ? 'Y':'N'
this.$store.dispatch("test/checkedhs", {
test:[item]
})
},
changeFavorite(item){
item.isfavorite = item.isfavorite === 'N' ? 'Y':'N'
this.$store.dispatch("test/checkedfavorite", {
test:[item]
})
},
isSelected(p) {
return p.T_TestID == this.$store.state.test.selected_test.T_TestID
},
searchTest() {
this.$store.dispatch("test/search", {
current_page:this.curr_page,
name: this.name,
scode: this.scode,
lastid: -1
})
},
selectMe(sta) {
if (this.$store.state.test.no_save == 0) {
this.$store.commit("test/update_selected_test", sta)
this.$store.commit("test/update_selected_group", {
Nat_GroupID: sta.T_TestNat_GroupID,
Nat_GroupName: sta.Nat_GroupName
})
this.$store.commit("test/update_selected_type", {
Nat_TestTypeID: sta.Nat_TestNat_TestTypeID,
Nat_TestTypeName: sta.Nat_TestTypeName
})
this.$store.commit("test/update_selected_nonlab", {
T_TestIsNonLabID: sta.T_TestIsNonLabID,
T_TestIsNonLab: sta.T_TestIsNonLabs
})
this.$store.commit("test/update_test_name", sta.T_TestName)
this.$store.commit("test/update_selected_subgroup", {
Nat_SubGroupID: sta.T_TestNat_SubgroupID,
Nat_SubGroupName: sta.Nat_SubGroupName
})
this.$store.commit("test/update_sampletypees", [{
T_SampleTypeID: sta.T_TestT_SampleTypeID,
T_SampleTypeName: sta.T_SampleTypeName
}])
this.$store.commit("test/update_sampletype_address", {
T_SampleTypeID: sta.T_TestT_SampleTypeID,
T_SampleTypeName: sta.T_SampleTypeName
})
this.$store.commit("test/update_code", sta.T_TestSasCode)
this.$store.commit("test/update_shortname", sta.T_TestShortName)
this.$store.commit("test/update_unit", sta.Nat_UnitName)
this.$store.commit("test/update_flaglow", sta.Nat_TestFlagLow)
this.$store.commit("test/update_flaghigh", sta.Nat_TestFlagHigh)
this.$store.commit("test/update_namebarcode", sta.T_TestShortNameBarcode)
this.$store.commit("test/update_worklistname", sta.T_TestWorklistName)
this.$store.commit("test/update_fontsize", sta.T_TestFontSize)
this.$store.commit("test/update_fontcolor", sta.T_TestFontColor)
this.$store.commit("test/update_maxdiscount", sta.T_TestMaxDiscount)
this.$store.commit("test/update_flagbold", sta.T_TestIsBold)
this.$store.commit("test/update_flagitalic", sta.T_TestIsItalic)
this.$store.commit("test/update_flagquantitative", sta.T_TestIsQuantitative)
this.$store.commit("test/update_deltacheck", sta.T_TestIsDeltaCheck)
this.$store.commit("test/update_trendanalysis", sta.T_TestIsTrendAnalysis)
this.$store.commit("test/update_isresult", sta.T_TestIsResult)
this.$store.commit("test/update_isprice", sta.T_TestIsPrice)
this.$store.commit("test/update_printresult", sta.T_TestIsPrintResult)
this.$store.commit("test/update_printnote", sta.T_TestIsPrintNota)
this.$store.commit("test/update_isworklist", sta.T_TestIsWorklist)
this.$store.commit("test/update_act", 'edit')
} else {
this.$store.commit("test/update_open_alert_confirmation", true)
}
},
closeAlertConfirmation() {
this.$store.commit("test/update_open_alert_confirmation", false)
},
forgetAlertConfirmation() {
this.$store.commit("test/update_no_save", 0)
this.$store.commit("test/update_open_alert_confirmation", false)
},
updateAlert_success(val) {
this.$store.commit("test/update_alert_success", val)
},
setNewTest() {
this.$store.commit("test/update_selected_test", {})
this.$store.commit("test/update_selected_group", {})
this.$store.commit("test/update_test_name", '')
this.$store.commit("test/update_dob", '')
this.$store.commit("test/update_selected_subgroup", {})
this.$store.commit("test/update_address", '')
this.$store.commit("test/update_city_address", {})
this.$store.commit("test/update_sample", {})
this.$store.commit("test/update_code", '')
this.$store.commit("test/update_shortname", '')
this.$store.commit("test/update_unit", '')
this.$store.commit("test/update_selected_religion", {})
this.$store.commit("test/update_startdate", '')
this.$store.commit("test/update_enddate", '')
this.$store.commit("test/update_selected_position", {})
this.$store.commit("test/update_namebarcode", '')
this.$store.commit("test/update_worklistname", '')
this.$store.commit("test/update_fontsize", '')
this.$store.commit("test/update_fontcolor", '')
this.$store.commit("test/update_maxdiscount", '')
this.$store.commit("test/update_act", 'new')
},
closeDialogSuccess() {
let arrtest = this.$store.state.test.tests
var idx = _.findIndex(arrtest, item => item.T_TestID === this.$store.state.test.last_id)
console.log(idx)
this.$store.dispatch("test/search", {
name: this.name,
scode: this.scode,
lastid: idx
})
this.$store.commit("test/update_dialog_success", false)
}
},
computed: {
dialogsuccess: {
get() {
return this.$store.state.test.dialog_success
},
set(val) {
this.$store.commit("test/update_dialog_success", val)
}
},
msgsuccess() {
return this.$store.state.test.msg_success
},
snackbar: {
get() {
return this.$store.state.test.alert_success
},
set(val) {
this.$store.commit("test/update_alert_success", val)
}
},
isLoading() {
return this.$store.state.test.search_status == 1
},
xstatuses() {
return this.$store.state.test.statuses
},
xselectedstatus: {
get() {
return this.$store.state.test.selected_status
},
set(val) {
this.$store.commit("test/update_selected_status", val)
}
},
tests() {
return this.$store.state.test.tests
},
openalertconfirmation: {
get() {
return this.$store.state.test.open_alert_confirmation
},
set(val) {
this.$store.commit("test/update_open_alert_confirmation", val)
}
},
curr_page: {
get() {
return this.$store.state.test.current_page
},
set(val) {
this.$store.commit("test/update_current_page",val)
this.$store.dispatch("test/search",{
current_page:val,
name: this.name,
scode: this.scode,
lastid: -1
})
}
},
xtotal_page: {
get() {
return this.$store.state.test.total_tests
},
set(val) {
this.$store.commit("test/update_total_tests",val)
}
},
name: {
get() {
return this.$store.state.test.name
},
set(val) {
this.$store.commit("test/update_name",val)
}
},
scode: {
get() {
return this.$store.state.test.scode
},
set(val) {
this.$store.commit("test/update_scode",val)
}
}
},
data() {
return {
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
items: [],
page: 1,
headers: [{
text: "KODE",
align: "center",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "center",
sortable: false,
value: "lab",
width: "25%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "TIPE",
align: "center",
sortable: false,
value: "name",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "GRUP",
align: "center",
sortable: false,
value: "name",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "SUB GRUP",
align: "center",
sortable: false,
value: "status",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "SUB SUB GRUP",
align: "center",
sortable: false,
value: "status",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "MASUK HS",
align: "center",
sortable: false,
value: "status",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "FAVORIT",
align: "center",
sortable: false,
value: "status",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
}
],
pagination: {
descending: false,
page: 1,
rowsPerPage: 100,
sortBy: 'T_TestID',
totalItems: this.$store.state.test.total_tests
}
};
}
}
</script>

View File

@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>One</title>
<link rel="stylesheet" href="../../../libs/vendor/css/google-fonts.css">
<link rel="stylesheet" href="../../../libs/vendor/css/icomoon-fonts.css">
<link rel="stylesheet" href="../../../libs/vendor/css/vuetify.min.css">
</head>
<body>
<div v-cloak id="app">
<v-app id="smartApp" >
<one-navbar></one-navbar>
<v-content style="background:#F5E8DF!important" >
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
<v-layout row wrap >
<v-flex xs6 class="left" fill-height pa-1>
<one-md-test-list></one-md-test-list>
</v-flex>
<v-flex xs6 class="right" fill-height pa-1>
<one-md-test-detail></one-md-test-detail>
<!-- <one-md-test-address></one-md-test-address> -->
</v-flex>
</v-layout>
</v-container>
</v-content>
<one-footer> </one-footer>
</v-app>
</div>
<!-- Vendor -->
<script src="../../../libs/vendor/moment.min.js"></script>
<script src="../../../libs/vendor/numeral.min.js"></script>
<script src="../../../libs/vendor/moment-locale-id.js"></script>
<script src="../../../libs/vendor/lodash.js"></script>
<script src="../../../libs/vendor/axios.min.js"></script>
<script src="../../../libs/vendor/vue.js"></script>
<script src="../../../libs/vendor/vuex.js"></script>
<script src="../../../libs/vendor/vuetify.js"></script>
<script src="../../../libs/vendor/httpVueLoader.js"></script>
<script src="../../../libs/one_global.js"></script>
<!-- App Script -->
<?php
$ts = "?ts=" . Date("ymdhis");
?>
<script type="module">
window.calculate_age = function (inp_dob) {
var now = moment(new Date())
var dob = moment(new Date(inp_dob))
var year = now.diff(dob,'years')
dob.add(year,'years')
var month = now.diff(dob,'months')
dob.add(month,'months')
var day = now.diff(dob,'days')
if (isNaN(year)) return ''
return `${year} tahun ${month} bulan ${day} hari`
}
import { store } from './store.js<?php echo $ts ?>';
//for testing
window.store = store;
new Vue({
store,
el: '#app',
methods: {
tab_selected : function(tab) {
return this.$store.state.tab_selected == tab
}
},
components: {
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
'one-md-test-list': httpVueLoader('./components/oneMdTestList.vue'),
'one-md-test-detail': httpVueLoader('./components/oneMdTestDetail.vue')
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {
}
.right {
}
</style>
</body>
</html>

View File

@@ -0,0 +1,761 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/test.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_test: 0,
search_status: 0,
statuses: [{
label: 'Bukan Kurir',
value: 'N'
}, {
label: 'Sebagai Kurir',
value: 'Y'
}],
selected_status: {
label: 'Bukan Kurir',
value: 'N'
},
search_error_message: '',
dobs: [],
selected_dob: {},
dob: '',
test_name: '',
tests: [],
total_tests: 0,
subgroups: [],
selected_subgroup: {},
address: '',
cities: [],
city_address: {},
samples: [],
sample: {},
sampletypees: [],
sampletype_address: {},
code: '',
shortname: '',
unit: '',
groups: [],
selected_group: {},
types: [],
selected_type: {},
nonlabs: [],
selected_nonlab: {},
religions: [],
selected_religion: {},
startdate: '',
enddate: '',
positions: [],
selected_position: {},
namebarcode: '',
worklistname: '',
fontsize: '',
fontcolor: '',
maxdiscount: '',
flagbold: 'N',
flagitalic: 'N',
flagquantitative: 'N',
deltacheck: 'N',
trendanalysis: 'N',
isresult: 'N',
isprice: 'N',
printresult: 'N',
printnote: 'N',
isworklist: 'N',
flaglow: '',
flaghigh: '',
total_test: 0,
selected_test: {},
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,
errors: [],
current_page:1,
name:'',
scode:''
},
mutations: {
update_name(state, val) {
state.name = val
},
update_scode(state, val) {
state.scode = 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_test(state, test) {
state.search_test = test
},
update_test_name(state, val) {
state.test_name = val
},
update_tests(state, data) {
state.tests = data
},
update_selected_test(state, val) {
state.selected_test = val
},
update_dob(state, val) {
state.dob = val
},
update_subgroups(state, val) {
state.subgroups = val
},
update_selected_subgroup(state, val) {
state.selected_subgroup = val
},
update_address(state, val) {
state.address = val
},
update_cities(state, val) {
state.cities = val
},
update_city_address(state, val) {
state.city_address = val
},
update_sampletypees(state, val) {
state.sampletypees = val
},
update_sampletype_address(state, val) {
state.sampletype_address = val
},
update_samples(state, val) {
state.samples = val
},
update_sample(state, val) {
state.sample = val
},
update_code(state, val) {
state.code = val
},
update_shortname(state, val) {
state.shortname = val
},
update_unit(state, val) {
state.unit = val
},
update_religions(state, val) {
state.religions = val
},
update_selected_religion(state, val) {
state.selected_religion = val
},
update_groups(state, val) {
state.groups = val
},
update_selected_group(state, val) {
state.selected_group = val
},
update_types(state, val) {
state.types = val
},
update_selected_type(state, val) {
state.selected_type = val
},
update_nonlabs(state, val) {
state.nonlabs = val
},
update_selected_nonlab(state, val) {
state.selected_nonlab = val
},
update_startdate(state, val) {
state.startdate = val
},
update_enddate(state, val) {
state.enddate = val
},
update_positions(state, val) {
state.positions = val
},
update_selected_position(state, val) {
state.selected_position = val
},
update_namebarcode(state, val) {
state.namebarcode = val
},
update_worklistname(state, val) {
state.worklistname = val
},
update_fontsize(state, val) {
state.fontsize = val
},
update_fontcolor(state, val) {
state.fontcolor = val
},
update_maxdiscount(state, val) {
state.maxdiscount = val
},
update_flagbold(state, val) {
state.flagbold = val
},
update_flagitalic(state, val) {
state.flagitalic = val
},
update_flagquantitative(state, val) {
state.flagquantitative = val
},
update_deltacheck(state, val) {
state.deltacheck = val
},
update_trendanalysis(state, val) {
state.trendanalysis = val
},
update_isresult(state, val) {
state.isresult = val
},
update_isprice(state, val) {
state.isprice = val
},
update_printresult(state, val) {
state.printresult = val
},
update_printnote(state, val) {
state.printnote = val
},
update_isworklist(state, val) {
state.isworklist = val
},
update_flaglow(state, val) {
state.flaglow = val
},
update_flaghigh(state, val) {
state.flaghigh = 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_search_status(state, val) {
state.search_status = val
},
update_errors(state, val) {
state.errors = val
},
update_total_tests(state, val) {
state.total_tests = val
},
update_selected_status(state, val) {
state.selected_status = val
}
},
actions: {
async search(context, prm) {
context.commit("update_search_test", 1)
try {
prm.token = one_token()
let resp = await api.search(prm)
if (resp.status != "OK") {
context.commit("update_search_test", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_test", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_tests", data.records)
context.commit("update_total_tests", data.total)
context.commit("update_no_save", 0)
if (prm.lastid === -1) {
context.commit("update_selected_test", data.records[0])
var sta = data.records[0]
context.commit("update_selected_group", {
Nat_GroupID: sta.T_TestNat_GroupID,
Nat_GroupName: sta.Nat_GroupName
})
context.commit("update_selected_type", {
Nat_TestTypeID: sta.Nat_TestNat_TestTypeID,
Nat_TestTypeName: sta.Nat_TestTypeName
})
context.commit("update_selected_nonlab", {
T_TestIsNonLabID: sta.T_TestIsNonLabID,
T_TestIsNonLab: sta.T_TestIsNonLabs
})
context.commit("update_test_name", sta.T_TestName)
context.commit("update_selected_subgroup", {
Nat_SubGroupID: sta.T_TestNat_SubgroupID,
Nat_SubGroupName: sta.Nat_SubGroupName
})
context.commit("update_sampletypees", [{
T_SampleTypeID: sta.T_TestT_SampleTypeID,
T_SampleTypeName: sta.T_SampleTypeName
}])
context.commit("update_sampletype_address", {
T_SampleTypeID: sta.T_TestT_SampleTypeID,
T_SampleTypeName: sta.T_SampleTypeName
})
context.commit("update_code", sta.T_TestSasCode)
context.commit("update_shortname", sta.T_TestShortName)
context.commit("update_unit", sta.Nat_UnitName)
context.commit("update_flaglow", sta.Nat_TestFlagLow)
context.commit("update_flaghigh", sta.Nat_TestFlagHigh)
context.commit("update_namebarcode", sta.T_TestShortNameBarcode)
context.commit("update_worklistname", sta.T_TestWorklistName)
context.commit("update_fontsize", sta.T_TestFontSize)
context.commit("update_fontcolor", sta.T_TestFontColor)
context.commit("update_maxdiscount", sta.T_TestMaxDiscount)
context.commit("update_flagbold", sta.T_TestIsBold)
context.commit("update_flagitalic", sta.T_TestIsItalic)
context.commit("update_flagquantitative", sta.T_TestIsQuantitative)
context.commit("update_deltacheck", sta.T_TestIsDeltaCheck)
context.commit("update_trendanalysis", sta.T_TestIsTrendAnalysis)
context.commit("update_isresult", sta.T_TestIsResult)
context.commit("update_isprice", sta.T_TestIsPrice)
context.commit("update_printresult", sta.T_TestIsPrintResult)
context.commit("update_printnote", sta.T_TestIsPrintNota)
context.commit("update_isworklist", sta.T_TestIsWorklist)
} else {
context.commit("update_selected_test", data.records[prm.lastid])
var sta = data.records[prm.lastid]
context.commit("update_selected_group", {
Nat_GroupID: sta.T_TestNat_GroupID,
Nat_GroupName: sta.Nat_GroupName
})
context.commit("update_selected_type", {
Nat_TestTypeID: sta.Nat_TestNat_TestTypeID,
Nat_TestTypeName: sta.Nat_TestTypeName
})
context.commit("update_selected_nonlab", {
T_TestIsNonLabID: sta.T_TestIsNonLabID,
T_TestIsNonLab: sta.T_TestIsNonLabs
})
context.commit("update_test_name", sta.T_TestName)
context.commit("update_dob", sta.T_TestDOBx)
context.commit("update_selected_subgroup", {
Nat_SubGroupID: sta.T_TestNat_SubgroupID,
Nat_SubGroupName: sta.Nat_SubGroupName
})
context.commit("update_sampletypees", [{
T_SampleTypeID: sta.T_TestT_SampleTypeID,
T_SampleTypeName: sta.T_SampleTypeName
}])
context.commit("update_sampletype_address", {
T_SampleTypeID: sta.T_TestT_SampleTypeID,
T_SampleTypeName: sta.T_SampleTypeName
})
context.commit("update_code", sta.T_TestCode)
context.commit("update_shortname", sta.T_TestShortName)
context.commit("update_flaglow", sta.Nat_TestFlagLow)
context.commit("update_flaghigh", sta.Nat_TestFlagHigh)
context.commit("update_unit", sta.Nat_UnitName)
context.commit("update_selected_religion", {
M_ReligionID: sta.T_TestM_ReligionID,
M_ReligionName: sta.M_ReligionName
})
context.commit("update_startdate", sta.T_TestStartDate)
context.commit("update_enddate", sta.T_TestEndDate)
context.commit("update_selected_position", {
M_PositionID: sta.T_TestM_PositionID,
M_PositionName: sta.M_PositionName
})
context.commit("update_namebarcode", sta.T_TestShortNameBarcode)
context.commit("update_worklistname", sta.T_TestWorklistName)
context.commit("update_fontsize", sta.T_TestFontSize)
context.commit("update_fontcolor", sta.T_TestFontColor)
context.commit("update_maxdiscount", sta.T_TestMaxDiscount)
context.commit("update_flagbold", sta.T_TestIsBold)
context.commit("update_flagitalic", sta.T_TestIsItalic)
context.commit("update_flagquantitative", sta.T_TestIsQuantitative)
context.commit("update_deltacheck", sta.T_TestIsDeltaCheck)
context.commit("update_trendanalysis", sta.T_TestIsTrendAnalysis)
context.commit("update_isresult", sta.T_TestIsResult)
context.commit("update_isprice", sta.T_TestIsPrice)
context.commit("update_printresult", sta.T_TestIsPrintResult)
context.commit("update_printnote", sta.T_TestIsPrintNota)
context.commit("update_isworklist", sta.T_TestIsWorklist)
}
}
} catch (e) {
context.commit("update_search_test", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
async checkedhs(context,prm) {
context.commit("update_get_data_status", 1)
try {
prm.token = one_token()
let resp = await api.checkedhs(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.dispatch("search", {
current_page:context.state.current_page,
name: context.state.name,
scode: context.state.scode,
lastid: -1
})
//context.commit("update_nonlabs", data.records.nonlabs)
}
} catch (e) {
context.commit("update_get_data_status", 3)
}
},
async checkedfavorite(context,prm) {
context.commit("update_get_data_status", 1)
try {
prm.token = one_token()
let resp = await api.checkedfavorite(prm)
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
alert('Jumlah pemeriksaan favorit sudah melebihi 6')
context.dispatch("search", {
current_page:context.state.current_page,
name: context.state.name,
scode: context.state.scode,
lastid: -1
})
} else {
context.commit("update_get_data_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.dispatch("search", {
current_page:context.state.current_page,
name: context.state.name,
scode: context.state.scode,
lastid: -1
})
//context.commit("update_nonlabs", data.records.nonlabs)
}
} catch (e) {
context.commit("update_get_data_status", 3)
}
},
async getsexreg(context) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.getsexreg(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_subgroups", data.records.subgroupes)
context.commit("update_groups", data.records.groups)
context.commit("update_types", data.records.types)
context.commit("update_nonlabs", data.records.nonlabs)
}
} 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.T_TestID)
context.commit("update_dialog_success", true)
var msg = "Data pemeriksaan " + prm.T_TestName + " sudah terupdate dong ..."
context.commit("update_msg_success", msg)
}
} catch (e) {
context.commit("update_save_status", 3)
}
},
async check_exist_code(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.check_exist_code(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
}
if(parseInt(data.records.x_count) > 0){
context.commit("update_code", prm.trx.T_TestSasCode)
}
}
} catch (e) {
context.commit("update_save_status", 3)
}
},
async newtest(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.newtest(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 karyawan " + prm.T_TestName + " 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 karyawan " + prm.T_TestName + " sudah dihapus dong ..."
context.commit("update_msg_success", msg)
context.commit("update_selected_group", {})
context.commit("update_test_name", '')
context.commit("update_dob", '')
context.commit("update_selected_subgroup", {})
context.commit("update_address", '')
context.commit("update_city_address", {})
context.commit("update_sample", {})
context.commit("update_code", '')
context.commit("update_shortname", '')
context.commit("update_flaglow", '')
context.commit("update_flaghigh", '')
context.commit("update_unit", '')
context.commit("update_selected_religion", {})
context.commit("update_startdate", '')
context.commit("update_enddate", '')
context.commit("update_selected_position", {})
context.commit("update_namebarcode", '')
context.commit("update_worklistname", '')
context.commit("update_fontsize", '')
context.commit("update_fontcolor", '')
context.commit("update_maxdiscount", '')
context.commit("update_isbold", '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 searchsample(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchsample(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_sampletypees", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async getsampletype(context, prm) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.getsampletype(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_samples", 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.T_TestAddressT_TestID)
context.commit("update_dialog_success", true)
var msg = "Penambahan data alamat karyawan " + prm.T_TestName + " 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.T_TestAddressT_TestID)
context.commit("update_dialog_success", true)
var msg = "Perubahan data alamat karyawan " + prm.T_TestName + " 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.T_TestAddressT_TestID)
context.commit("update_dialog_success", true)
var msg = "Penghapusan data alamat " + prm.T_TestAddressNote + " dari karyawan " + prm.T_TestName + " sudah berhasil dong ..."
context.commit("update_msg_success", msg)
}
} catch (e) {
context.commit("update_save_status", 3)
}
}
}
}

View File

@@ -0,0 +1,27 @@
// State
// data ...
// Mutations
//
//
// Actions
import test from "./modules/test.js";
import system from "../../../apps/modules/system/system.js";
export const store = new Vuex.Store({
modules: {
test: test,
system: system
},
state: {
tab_selected: 'test'
},
mutations: {
change_tab(state, ntab) {
state.tab_selected = ntab
}
},
actions: {
change_tab(context, ntab) {
context.commit('change_tab', ntab)
}
}
});