Initial import
This commit is contained in:
@@ -0,0 +1,320 @@
|
||||
const URL = "/one-api/v1/masterdata/";
|
||||
|
||||
export async function search(token, name) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'testcalculationv2/search', {
|
||||
token:token,
|
||||
nama: name
|
||||
});
|
||||
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(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'testcalculationv2/getsexreg',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 + 'testcalculationv2/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 newtestcalculation(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'testcalculationv2/newtestcalculation',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 + 'testcalculationv2/delete',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 sendorder(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'testcalculationv2/sendorder',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 getdetail(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'testcalculationv2/getdetail',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 getnumberx(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'testcalculationv2/getnumber',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 deletenumberx(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'testcalculationv2/deletenumber',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 + 'testcalculationv2/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 getmou(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'testcalculationv2/getmou',{id:prm.M_CompanyID,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 savenewdetail(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'testcalculationv2/savenewdetail',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 saveeditdetail(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'testcalculationv2/saveeditdetail',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function deletedetail(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'testcalculationv2/deletedetail',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function searchtest(token,tes,mouid) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'testcalculationv2/searchtest',{token:token,search:tes});
|
||||
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 searchtestheader(token,tes,mouid) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'testcalculationv2/searchtestheader',{token:token,search:tes});
|
||||
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 searchtestfavorit(token,mouid) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'testcalculationv2/searchtestfavorit',{token:token,mouid:mouid});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,529 @@
|
||||
<template>
|
||||
<v-layout v-if="xact !== 'new'" column>
|
||||
<v-dialog v-model="dialogconfirmationdeletepat" 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>
|
||||
{{msgconfirmationdeletepat}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small color="error darken-1 text-sm-left" flat @click="doDeletePat()">Hapus</v-btn>
|
||||
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdeletepat = false">Batal</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogconfirmationsend" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title dark class="headline success pt-2 pb-2" primary-title style="color:white">
|
||||
<h4 dark>Konfirmasi</h4>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
{{msgconfirmationsend}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small color="success darken-1 text-sm-left" flat @click="doOrderCalculation()">Kirim</v-btn>
|
||||
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationsend = false">Batal</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogformdetail" persistent max-width="950">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Form Rumus</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-layout row>
|
||||
<v-flex xs12 pr-3>
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<v-layout>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field v-model="xnamacalculation" label="Nama Rumus"></v-text-field>
|
||||
<p v-if="checkError('requirenamacalculation')" class="error pl-2 pr-2" style="color:#fff">Nama diisi dulu dong</p>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-autocomplete label="Test Yang Akan Dihitung" v-model="xautotest" :items="xautotests" :search-input.sync="search_testheader" auto-select-first
|
||||
no-filter item-text="Nat_TestName" return-object no-data-text="Cari Pemeriksaan"
|
||||
small>
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.Nat_TestName"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
<p v-if="checkError('requireautotest')" class="error pl-2 pr-2" style="color:#fff">Pemeriksaan detail dipilih dulu dong</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs6>
|
||||
<v-select item-text="Nat_SexName" return-object :items="xsexes" v-model="xsex" label="Jenis Kelamin"></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-layout row>
|
||||
<v-flex xs10 pa-1>
|
||||
<v-autocomplete label="Tests" v-model="xorderautotest" :items="xorderautotests" :search-input.sync="search_test"
|
||||
auto-select-first no-filter item-text="Nat_TestName" return-object no-data-text="Cari Pemeriksaan"
|
||||
outline small>
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.Nat_TestName"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs-2 class="text-md-left">
|
||||
<v-btn @click="addTest()" color="grey en-3">+</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex class="border-bottom-dashed" xs12 pt-2 pl-4 pr-4 pb-4>
|
||||
<v-layout xs12 row wrap>
|
||||
<p v-if="checkError('requireordertest')" class="error pl-2 pr-2" style="color:#fff">Pemeriksaan dipilih dulu dong</p>
|
||||
<v-flex xs4 v-for="(vst,idx) in xordertests" :key="vst.Nat_TestID" class="pr-2 pb-1">
|
||||
<v-layout row>
|
||||
<v-flex @click="deleteDataPx(idx)" class="boxoutline" style="color: red;border: 1px solid red;justify-content: center;height: 45px;line-height: 45px;padding-left: 10px;background: #ffffff;font-size: 14px;font-weight: 500;border-radius: 1px"
|
||||
xs11>
|
||||
<span>{{vst.Nat_TestName}}</span>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-textarea v-model="xrumus" label="Formula"></v-textarea>
|
||||
<p v-if="checkError('requirerumus')" class="error pl-2 pr-2" style="color:#fff">Rumus nya diisi dulu dong</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="dialogformdetail = false">Tutup</v-btn>
|
||||
<v-btn v-if="xactpat === 'new'" color="blue darken-1" flat @click="saveNewCalculation()">Simpan</v-btn>
|
||||
<v-btn v-if="xactpat === 'edit'" color="blue darken-1" flat @click="saveEditCalculation()">Simpan Perubahan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</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 = {
|
||||
data: () => ({
|
||||
oldlabel: '',
|
||||
search_test: '',
|
||||
search_testheader: '',
|
||||
headers: [
|
||||
|
||||
{
|
||||
text: "PEMERIKSAAN",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "25%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "KODE RUMUS",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "25%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
}
|
||||
]
|
||||
}),
|
||||
computed: {
|
||||
dialogconfirmationdeletepat: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.dialog_confirmation_delete_pat
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_dialog_confirmation_delete_pat", val)
|
||||
}
|
||||
},
|
||||
msgconfirmationdeletepat() {
|
||||
return this.$store.state.testcalculation.msg_confirmation_delete_pat
|
||||
},
|
||||
dialogconfirmationsend: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.dialog_confirmation_send
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_dialog_confirmation_send", val)
|
||||
}
|
||||
},
|
||||
msgconfirmationsend() {
|
||||
return this.$store.state.testcalculation.msg_confirmation_send
|
||||
},
|
||||
xact() {
|
||||
return this.$store.state.testcalculation.act
|
||||
},
|
||||
xactpat() {
|
||||
return this.$store.state.testcalculation.act_pat
|
||||
},
|
||||
xactsend() {
|
||||
return this.$store.state.testcalculation.act_send
|
||||
},
|
||||
|
||||
dialogformdetail: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.dialog_form_detail
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_dialog_form_detail", val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.testcalculation.search_status == 1
|
||||
},
|
||||
xdetails(p) {
|
||||
return this.$store.state.testcalculation.details
|
||||
},
|
||||
xnamacalculation: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.namacalculation
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_namacalculation", val)
|
||||
}
|
||||
},
|
||||
xsexes() {
|
||||
return this.$store.state.testcalculation.sexes
|
||||
},
|
||||
xsex: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.selected_sex
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_selected_sex", val)
|
||||
}
|
||||
},
|
||||
isage: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.isage
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_isage", val)
|
||||
}
|
||||
},
|
||||
issex: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.issex
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_issex", val)
|
||||
}
|
||||
},
|
||||
rumusx: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.rumusx
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_rumusx", val)
|
||||
}
|
||||
},
|
||||
xisage: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.xisage
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_xisage", val)
|
||||
}
|
||||
},
|
||||
xissex: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.xissex
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_xissex", val)
|
||||
}
|
||||
},
|
||||
xrumus: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.rumus
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_rumus", val)
|
||||
}
|
||||
},
|
||||
|
||||
xautotests() {
|
||||
return this.$store.state.testcalculation.autotests
|
||||
},
|
||||
xautotest: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.autotest
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_autotest", val)
|
||||
}
|
||||
},
|
||||
xorderautotests() {
|
||||
return this.$store.state.testcalculation.orderautotests
|
||||
},
|
||||
xorderautotest: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.orderautotest
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_orderautotest", val)
|
||||
}
|
||||
},
|
||||
xordertests() {
|
||||
return this.$store.state.testcalculation.ordertests
|
||||
},
|
||||
xordertestfavorits() {
|
||||
return this.$store.state.testcalculation.ordertestfavorits
|
||||
},
|
||||
sub_total() {
|
||||
let tests = this.xordertests
|
||||
sub_total = 0
|
||||
tests.forEach(function (vpx, idx) {
|
||||
let total = parseInt(vpx.total)
|
||||
sub_total = sub_total + total
|
||||
})
|
||||
return sub_total
|
||||
},
|
||||
dp() {
|
||||
let mindp = this.$store.state.testcalculation.selected_testcalculation.M_MouMinDP
|
||||
let dp = mindp / 100 * this.sub_total
|
||||
return dp
|
||||
},
|
||||
isbill() {
|
||||
let isbill = this.$store.state.testcalculation.selected_testcalculation.M_MouIsBill
|
||||
return isbill
|
||||
},
|
||||
isagingonhold() {
|
||||
let isagingonhold = this.$store.state.testcalculation.selected_testcalculation.M_MouIsAgingOnHold
|
||||
return isagingonhold
|
||||
},
|
||||
agingonhold() {
|
||||
let agingonhold = this.$store.state.testcalculation.selected_testcalculation.M_MouIsAgingOnHoldNote
|
||||
return agingonhold
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeBtnFlagAge(value) {
|
||||
var newval = (value === 'Y') ? 'N' : 'Y'
|
||||
this.isage = newval
|
||||
},
|
||||
xchangeBtnFlagAge(value) {
|
||||
var newval = (value === 'Y') ? 'N' : 'Y'
|
||||
this.xisage = newval
|
||||
},
|
||||
changeBtnFlagSex(value) {
|
||||
var newval = (value === 'Y') ? 'N' : 'Y'
|
||||
this.issex = newval
|
||||
},
|
||||
xchangeBtnFlagSex(value) {
|
||||
var newval = (value === 'Y') ? 'N' : 'Y'
|
||||
this.xissex = newval
|
||||
},
|
||||
changeBtnFlagDefaultAge(value) {
|
||||
var newval = (value === 'Y') ? 'N' : 'Y'
|
||||
this.isage = newval
|
||||
},
|
||||
createNewCalculation() {
|
||||
this.$store.commit("testcalculation/update_act_pat", 'new')
|
||||
this.$store.commit("testcalculation/update_isage", 'N')
|
||||
this.$store.commit("testcalculation/update_issex", 'N')
|
||||
this.$store.commit("testcalculation/update_rumusx", '')
|
||||
|
||||
this.$store.commit("testcalculation/update_x_pat_id", 0)
|
||||
this.$store.commit("testcalculation/update_namacalculation", '')
|
||||
this.$store.commit("testcalculation/update_xisage", 'N')
|
||||
this.$store.commit("testcalculation/update_xissex", 'N')
|
||||
this.$store.commit("testcalculation/update_rumus", '')
|
||||
this.$store.commit("testcalculation/update_autotests", [])
|
||||
this.$store.commit("testcalculation/update_autotest", {})
|
||||
this.$store.commit("testcalculation/update_dialog_form_detail", true)
|
||||
this.$store.dispatch("testcalculation/searchtestfavorit", {
|
||||
mouid: this.$store.state.testcalculation.selected_testcalculation.Nat_TestCalculationM_MouID
|
||||
})
|
||||
},
|
||||
checkError(value) {
|
||||
var errors = this.$store.state.testcalculation.errors
|
||||
if (errors.includes(value)) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
saveNewCalculation() {
|
||||
this.$store.commit("testcalculation/update_errors", [])
|
||||
var errors = this.$store.state.testcalculation.errors
|
||||
if (this.xnamacalculation === '') {
|
||||
errors.push("requirenamacalculation")
|
||||
}
|
||||
if (this.xrumus === '') {
|
||||
errors.push("requirerumus")
|
||||
}
|
||||
if (_.isEmpty(this.xautotest)) {
|
||||
errors.push("requireautotest")
|
||||
}
|
||||
if (this.$store.state.testcalculation.ordertests.length == 0) {
|
||||
errors.push("requireordertest")
|
||||
}
|
||||
if (errors.length === 0) {
|
||||
var prm = {}
|
||||
prm.T_TestCalculationName = this.xnamacalculation
|
||||
prm.T_TestCalculationNat_TestID = this.$store.state.testcalculation.autotest.Nat_TestID
|
||||
prm.T_TestCalculationFormula = this.xrumus
|
||||
prm.T_TestCalculationNat_SexID = this.$store.state.testcalculation.selected_sex.Nat_SexID
|
||||
prm.ordertests = this.xordertests
|
||||
this.$store.dispatch("testcalculation/savenewdetail", prm)
|
||||
}
|
||||
},
|
||||
editCalculation() {
|
||||
this.$store.commit("testcalculation/update_act_pat", 'edit')
|
||||
this.$store.commit("testcalculation/update_dialog_form_detail", true)
|
||||
},
|
||||
saveEditCalculation() {
|
||||
this.$store.commit("testcalculation/update_errors", [])
|
||||
var errors = this.$store.state.testcalculation.errors
|
||||
if (this.xnamacalculation === '') {
|
||||
errors.push("requirenamacalculation")
|
||||
}
|
||||
if (this.xrumus === '') {
|
||||
errors.push("requirerumus")
|
||||
}
|
||||
if (_.isEmpty(this.xautotest)) {
|
||||
errors.push("requireautotest")
|
||||
}
|
||||
if (this.$store.state.testcalculation.ordertests.length == 0) {
|
||||
errors.push("requireordertest")
|
||||
}
|
||||
if (errors.length === 0) {
|
||||
var prm = {}
|
||||
prm.T_TestCalculationID = this.$store.state.testcalculation.x_pat_id
|
||||
prm.T_TestCalculationName = this.xnamacalculation
|
||||
prm.T_TestCalculationNat_TestID = this.$store.state.testcalculation.autotest.Nat_TestID
|
||||
prm.T_TestCalculationFormula = this.xrumus
|
||||
prm.T_TestCalculationNat_SexID = this.$store.state.testcalculation.selected_sex.Nat_SexID
|
||||
prm.ordertests = this.xordertests
|
||||
prm.deleted_ordertests = this.$store.state.testcalculation.deleted_ordertests
|
||||
this.$store.dispatch("testcalculation/saveeditdetail", prm)
|
||||
}
|
||||
},
|
||||
thr_search_test: _.debounce(function () {
|
||||
this.$store.dispatch("testcalculation/searchtest", {
|
||||
tes: this.search_test
|
||||
})
|
||||
}, 2000),
|
||||
thr_search_testheader: _.debounce(function () {
|
||||
this.$store.dispatch("testcalculation/searchtestheader", {
|
||||
tes: this.search_testheader
|
||||
})
|
||||
}, 2000),
|
||||
deleteCalculation() {
|
||||
this.$store.commit("testcalculation/update_act_pat", 'delete')
|
||||
this.$store.commit("testcalculation/update_x_pat_id", this.$store.state.testcalculation.x_pat_id)
|
||||
this.$store.commit("testcalculation/update_errors", [])
|
||||
var errors = this.$store.state.testcalculation.errors
|
||||
var msg = ''
|
||||
msg = "Yakin, akan menghapus data rumus " + this.$store.state.testcalculation.selected_testcalculation
|
||||
.T_TestCalculationName + " ?"
|
||||
this.$store.commit("testcalculation/update_msg_confirmation_delete_pat", msg)
|
||||
this.$store.commit("testcalculation/update_dialog_confirmation_delete_pat", true)
|
||||
},
|
||||
doDeletePat() {
|
||||
var prm = {}
|
||||
prm.T_TestCalculationID = this.$store.state.testcalculation.selected_testcalculation
|
||||
.T_TestCalculationID
|
||||
prm.T_TestCalculationName = this.$store.state.testcalculation.selected_testcalculation
|
||||
.T_TestCalculationName
|
||||
this.$store.dispatch("testcalculation/deletedetail", prm)
|
||||
},
|
||||
sendOrderCalculation(value) {
|
||||
let msg = "Yakin, akan mengirim permintaan nomor " + this.$store.state.testcalculation.selected_testcalculation
|
||||
.Nat_TestCalculationNumber + " ?"
|
||||
this.$store.commit("testcalculation/update_msg_confirmation_send", msg)
|
||||
this.$store.commit("testcalculation/update_dialog_confirmation_send", true)
|
||||
},
|
||||
doOrderCalculation() {
|
||||
var prm = {}
|
||||
prm.Nat_TestCalculationID = this.$store.state.testcalculation.selected_testcalculation
|
||||
.Nat_TestCalculationID
|
||||
prm.Nat_TestCalculationNumber = this.$store.state.testcalculation.selected_testcalculation
|
||||
.Nat_TestCalculationNumber
|
||||
this.$store.dispatch("testcalculation/sendorder", prm)
|
||||
},
|
||||
convertMoney(money) {
|
||||
return one_money(money)
|
||||
},
|
||||
addTest() {
|
||||
this.$store.dispatch("testcalculation/getnumberx", {
|
||||
Nat_TestID: this.$store.state.testcalculation.orderautotest.Nat_TestID,
|
||||
Nat_TestName: this.$store.state.testcalculation.orderautotest.Nat_TestName
|
||||
})
|
||||
this.searchtest = ''
|
||||
},
|
||||
addTestFavorit(val) {
|
||||
var oldArr = this.$store.state.testcalculation.ordertests
|
||||
oldArr.push(val)
|
||||
},
|
||||
deleteDataPx(idx) {
|
||||
this.$store.dispatch("testcalculation/deletenumberx",{id:idx})
|
||||
var inx = parseInt(idx);
|
||||
var xrow = this.$store.state.testcalculation.ordertests[inx]
|
||||
if (parseInt(xrow.xid) !== 0) {
|
||||
var xdeltest = this.$store.state.testcalculation.deleted_ordertests
|
||||
xdeltest.push(xrow)
|
||||
this.$store.commit("testcalculation/update_deleted_ordertests", xdeltest)
|
||||
}
|
||||
var oldArr = this.$store.state.testcalculation.ordertests
|
||||
oldArr.splice(inx, 1)
|
||||
this.$store.commit("testcalculation/update_ordertests", oldArr)
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
search_city(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.testcalculation.update_autocomplete_status == 1) return
|
||||
this.thr_search_city()
|
||||
},
|
||||
search_test(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.testcalculation.update_autocomplete_status == 1) return
|
||||
this.thr_search_test()
|
||||
},
|
||||
search_testheader(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.testcalculation.update_autocomplete_status == 1) return
|
||||
this.thr_search_testheader()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,660 @@
|
||||
<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-dialog v-model="dialogconfirmationdeleteorder" 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>
|
||||
{{msgconfirmationdeleteorder}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small color="error darken-1 text-sm-left" flat @click="doDeleteOrder()">Hapus</v-btn>
|
||||
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdeleteorder = false">Batal</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout>
|
||||
<!-- <v-text-field class="xs4 ma-1" @keyup.enter="searchPatient" label="Kel. Pelanggan" placeholder="Cari..." outline v-model="name"
|
||||
hide-details></v-text-field> -->
|
||||
<v-text-field class="xs4 ma-1" @keyup.enter="searchPatient" label="Nama Rumus / Test" placeholder="Cari..." outline v-model="name"
|
||||
hide-details></v-text-field>
|
||||
<!--<span @click="searchPatient" class="icon-medium-fill-base xs1 white--text success iconsearch-search"></span>-->
|
||||
<span @click="setNewOrder" class="icon-medium-fill-base xs1 white--text primary ml-1 icon-add"></span>
|
||||
</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="testcalculations" :loading="isLoading" :pagination.sync="pagination" 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_TestCalculationName}}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.Nat_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_SexName}}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs8 v-for="(p, i) in props.item.tesx" v-bind:key="i" pb-1 pr-1>
|
||||
<v-btn small :color="'silver'">{{ p.testname }}</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_TestCalculationFormula}}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
|
||||
<v-icon class="ml-3" color="primary" @click="editCalculation(props.item)">edit</v-icon>
|
||||
<v-icon color="error" @click="deleteCalculation(props.item)">delete</v-icon>
|
||||
</td>
|
||||
</template>
|
||||
<template>
|
||||
<div class="text-xs-center">
|
||||
<v-pagination v-model="page" :length="15" :total-visible="6"></v-pagination>
|
||||
</div>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()"
|
||||
@close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
|
||||
|
||||
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogformorder" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Form Kelompok Pelanggan</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-form ref="formcompany">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete readonly label="Kelompok Pelanggan*" v-model="xcompany" :items="xcompanies" :search-input.sync="search_company"
|
||||
auto-select-first no-filter item-text="M_CompanyName" return-object :loading="isLoading"
|
||||
no-data-text="Pilih Perusahaan">
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.M_CompanyName"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
<p v-if="checkError('requirexcompany')" class="error pl-2 pr-2" style="color:#fff">Pilih kelompok pelanggan dulu dong</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-select readonly :search-input.sync="searchMou" item-text="M_MouName" return-object :items="xmous" v-model="xmou" label="Agreement*"
|
||||
autocomplete></v-select>
|
||||
<p v-if="checkError('requirexmou')" class="error pl-2 pr-2" style="color:#fff">Pilih Agreement dulu dong</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-text-field label="Tgl. Order" placeholder="dd-mm-yyyy" mask="##-##-####" v-model="xsdate"></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-text-field v-model="xnote" label="Catatan"></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="updateDialogFormOrder()">Tutup</v-btn>
|
||||
<v-btn v-if="xact === 'new'" color="blue darken-1" flat @click="saveFormPerusahaan()">Simpan</v-btn>
|
||||
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat @click="updateFormPerusahaan()">Simpan Perubahan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogstatusorder" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Status</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-timeline>
|
||||
<v-timeline-item v-for="(status, i) in xstatuss" :key="i" :waktu="status.waktu" :user="status.user" small>
|
||||
<template>
|
||||
<span :class="`headline font-weight-bold cyan--text`" v-text="status.status"></span>
|
||||
</template>
|
||||
<div class="py-3">
|
||||
<h2 :class="`headline font-weight-light mb-3 cyan--text`"></h2>
|
||||
<div>
|
||||
{{status.waktu}}
|
||||
<p> [ {{status.user}} ] </p>
|
||||
</div>
|
||||
</div>
|
||||
</v-timeline-item>
|
||||
</v-timeline>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="updateDialogStatusOrder()">Tutup</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
</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("testcalculation/getsexreg", {
|
||||
sexid: 0
|
||||
})
|
||||
this.$store.dispatch("testcalculation/search", {
|
||||
name: this.name,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkError(value) {
|
||||
var errors = this.$store.state.testcalculation.errors
|
||||
if (errors.includes(value)) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
isSelected(p) {
|
||||
return p.T_TestCalculationID == this.$store.state.testcalculation.selected_testcalculation
|
||||
.T_TestCalculationID
|
||||
},
|
||||
searchPatient() {
|
||||
this.$store.dispatch("testcalculation/search", {
|
||||
name: this.name,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
selectMe(pat) {
|
||||
if (this.$store.state.testcalculation.no_save == 0) {
|
||||
this.$store.commit("testcalculation/update_selected_testcalculation", pat)
|
||||
this.$store.commit("testcalculation/update_act_comp", 'edit')
|
||||
this.$store.commit("testcalculation/update_rumusx", pat.T_TestCalculationFormula)
|
||||
|
||||
this.$store.commit("testcalculation/update_x_pat_id", pat.T_TestCalculationID)
|
||||
this.$store.commit("testcalculation/update_namacalculation", pat.T_TestCalculationName)
|
||||
this.$store.commit("testcalculation/update_rumus", pat.T_TestCalculationFormula)
|
||||
this.$store.commit("testcalculation/update_autotests", [{
|
||||
Nat_TestID: pat.T_TestCalculationNat_TestID,
|
||||
Nat_TestName: pat.Nat_TestName
|
||||
}])
|
||||
this.$store.commit("testcalculation/update_autotest", {
|
||||
Nat_TestID: pat.T_TestCalculationNat_TestID,
|
||||
Nat_TestName: pat.Nat_TestName
|
||||
})
|
||||
this.$store.commit("testcalculation/update_selected_sex", {
|
||||
Nat_SexID: pat.T_TestCalculationNat_SexID,
|
||||
Nat_SexName: pat.Nat_SexName
|
||||
})
|
||||
this.$store.dispatch("testcalculation/getdetail", {
|
||||
id: pat.T_TestCalculationID
|
||||
})
|
||||
this.$store.commit("testcalculation/update_statuss", pat.statuss)
|
||||
} else {
|
||||
this.$store.commit("testcalculation/update_open_alert_confirmation", true)
|
||||
}
|
||||
|
||||
},
|
||||
editCalculation() {
|
||||
this.$store.commit("testcalculation/update_act_pat", 'edit')
|
||||
this.$store.commit("testcalculation/update_dialog_form_detail", true)
|
||||
},
|
||||
deleteCalculation() {
|
||||
this.$store.commit("testcalculation/update_act_pat", 'delete')
|
||||
this.$store.commit("testcalculation/update_x_pat_id", this.$store.state.testcalculation.x_pat_id)
|
||||
this.$store.commit("testcalculation/update_errors", [])
|
||||
var errors = this.$store.state.testcalculation.errors
|
||||
var msg = ''
|
||||
msg = "Yakin, akan menghapus data rumus " + this.$store.state.testcalculation.selected_testcalculation
|
||||
.T_TestCalculationName + " ?"
|
||||
this.$store.commit("testcalculation/update_msg_confirmation_delete_pat", msg)
|
||||
this.$store.commit("testcalculation/update_dialog_confirmation_delete_pat", true)
|
||||
},
|
||||
closeAlertConfirmation() {
|
||||
this.$store.commit("testcalculation/update_open_alert_confirmation", false)
|
||||
},
|
||||
forgetAlertConfirmation() {
|
||||
this.$store.commit("testcalculation/update_no_save", 0)
|
||||
this.$store.commit("testcalculation/update_open_alert_confirmation", false)
|
||||
},
|
||||
updateAlert_success(val) {
|
||||
this.$store.commit("testcalculation/update_alert_success", val)
|
||||
},
|
||||
updateDialogFormOrder() {
|
||||
this.$store.commit("testcalculation/update_dialog_form_order", false)
|
||||
},
|
||||
updateDialogStatusOrder() {
|
||||
this.$store.commit("testcalculation/update_dialog_status_order", false)
|
||||
},
|
||||
setNewOrder() {
|
||||
this.$store.commit("testcalculation/update_selected_testcalculation", {})
|
||||
this.$store.commit("testcalculation/update_act_pat", 'new')
|
||||
this.$store.commit("testcalculation/update_dialog_form_detail", true)
|
||||
this.$store.commit("testcalculation/update_isage", 'N')
|
||||
this.$store.commit("testcalculation/update_issex", 'N')
|
||||
this.$store.commit("testcalculation/update_rumusx", '')
|
||||
this.$store.commit("testcalculation/update_x_pat_id", 0)
|
||||
this.$store.commit("testcalculation/update_namacalculation",'')
|
||||
this.$store.commit("testcalculation/update_xisage", 'N')
|
||||
this.$store.commit("testcalculation/update_xissex", 'N')
|
||||
this.$store.commit("testcalculation/update_rumus", '')
|
||||
this.$store.commit("testcalculation/update_autotests", [])
|
||||
this.$store.commit("testcalculation/update_autotest", {})
|
||||
this.$store.commit("testcalculation/update_selected_sex", [])
|
||||
this.$store.commit("testcalculation/update_ordertests",[])
|
||||
},
|
||||
editOrder(val) {
|
||||
this.$store.commit("testcalculation/update_selected_testcalculation", val)
|
||||
this.$store.commit("testcalculation/update_act_comp", 'edit')
|
||||
this.$store.commit("testcalculation/update_dialog_form_order", true)
|
||||
this.xsdate = val.sdate
|
||||
this.$store.commit("testcalculation/update_companies", [{
|
||||
M_CompanyID: this.xcompanyid,
|
||||
M_CompanyName: this.xcompanyname
|
||||
}])
|
||||
this.xcompany = {
|
||||
M_CompanyID: this.xcompanyid,
|
||||
M_CompanyName: this.xcompanyname
|
||||
}
|
||||
this.$store.commit("testcalculation/update_mous", [{
|
||||
M_MouID: val.T_TestCalculationM_MouID,
|
||||
M_MouName: val.M_MouName
|
||||
}])
|
||||
this.xmou = {
|
||||
M_MouID: val.T_TestCalculationM_MouID,
|
||||
M_MouName: val.M_MouName
|
||||
}
|
||||
this.xnote = val.T_TestCalculationNote
|
||||
},
|
||||
setStatusOrder() {
|
||||
this.$store.commit("testcalculation/update_selected_testcalculation", {})
|
||||
this.$store.commit("testcalculation/update_dialog_status_order", true)
|
||||
this.search_company = ''
|
||||
},
|
||||
saveFormPerusahaan() {
|
||||
this.$store.commit("testcalculation/update_errors", [])
|
||||
var errors = this.$store.state.testcalculation.errors
|
||||
if (_.isEmpty(this.xcompany)) {
|
||||
errors.push("requirexcompany")
|
||||
}
|
||||
if (_.isEmpty(this.xmou)) {
|
||||
errors.push("requirexmou")
|
||||
}
|
||||
if (_.isEmpty(this.xsdate)) {
|
||||
errors.push("requirexsdate")
|
||||
}
|
||||
if (errors.length === 0) {
|
||||
this.$store.dispatch("testcalculation/newtestcalculation", {
|
||||
companyid: this.xcompany.M_CompanyID,
|
||||
mouid: this.xmou.M_MouID,
|
||||
sdate: moment(this.xsdate, 'DDMMYYYY', true),
|
||||
note: this.xnote
|
||||
})
|
||||
}
|
||||
},
|
||||
updateFormPerusahaan() {
|
||||
this.$store.commit("testcalculation/update_errors", [])
|
||||
var errors = this.$store.state.testcalculation.errors
|
||||
if (_.isEmpty(this.xcompany)) {
|
||||
errors.push("requirexcompany")
|
||||
}
|
||||
if (_.isEmpty(this.xmou)) {
|
||||
errors.push("requirexmou")
|
||||
}
|
||||
if (_.isEmpty(this.xsdate)) {
|
||||
errors.push("requirexsdate")
|
||||
}
|
||||
if (errors.length === 0) {
|
||||
this.$store.dispatch("testcalculation/save", {
|
||||
id: this.$store.state.testcalculation.selected_testcalculation.T_TestCalculationID,
|
||||
companyid: this.xcompany.M_CompanyID,
|
||||
mouid: this.xmou.M_MouID,
|
||||
sdate: moment(this.xsdate, 'DDMMYYYY', true),
|
||||
note: this.xnote,
|
||||
nomor: this.$store.state.testcalculation.selected_testcalculation.T_TestCalculationNumber
|
||||
})
|
||||
}
|
||||
},
|
||||
deleteOrder(value) {
|
||||
this.$store.commit("testcalculation/update_act_comp", 'delete')
|
||||
this.$store.commit("testcalculation/update_errors", [])
|
||||
var errors = this.$store.state.testcalculation.errors
|
||||
var msg = ''
|
||||
msg = "Yakin, akan menghapus data nomor " + value.T_TestCalculationNumber + " ?"
|
||||
this.$store.commit("testcalculation/update_msg_confirmation_delete", msg)
|
||||
this.$store.commit("testcalculation/update_dialog_confirmation_delete", true)
|
||||
},
|
||||
doDeleteOrder() {
|
||||
var prm = {}
|
||||
prm.T_TestCalculationID = this.$store.state.testcalculation.selected_testcalculation
|
||||
.T_TestCalculationID
|
||||
prm.T_TestCalculationNumber = this.$store.state.testcalculation.selected_testcalculation
|
||||
.T_TestCalculationNumber
|
||||
this.$store.dispatch("testcalculation/delete", prm)
|
||||
},
|
||||
thr_search_company: _.debounce(function () {
|
||||
this.$store.dispatch("testcalculation/searchcompany", this.search_company)
|
||||
}, 2000),
|
||||
closeDialogSuccess() {
|
||||
let arrtestcalculation = this.$store.state.testcalculation.testcalculations
|
||||
var idx = _.findIndex(arrtestcalculation, item => item.T_TestCalculationID === this.$store.state
|
||||
.testcalculation.last_id)
|
||||
console.log(idx)
|
||||
this.$store.dispatch("testcalculation/search", {
|
||||
name: this.name,
|
||||
lastid: idx
|
||||
})
|
||||
this.$store.commit("testcalculation/update_dialog_success", false)
|
||||
},
|
||||
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')}`
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialogsuccess: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.dialog_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_dialog_success", val)
|
||||
}
|
||||
},
|
||||
msgsuccess() {
|
||||
return this.$store.state.testcalculation.msg_success
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_alert_success", val)
|
||||
}
|
||||
},
|
||||
dialogconfirmationdeleteorder: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.dialog_confirmation_delete
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_dialog_confirmation_delete", val)
|
||||
}
|
||||
},
|
||||
xactsend() {
|
||||
return this.$store.state.testcalculation.act_send
|
||||
},
|
||||
msgconfirmationdeleteorder() {
|
||||
return this.$store.state.testcalculation.msg_confirmation_delete
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.testcalculation.search_status == 1
|
||||
},
|
||||
xact() {
|
||||
return this.$store.state.testcalculation.act_comp
|
||||
},
|
||||
testcalculations() {
|
||||
return this.$store.state.testcalculation.testcalculations
|
||||
},
|
||||
openalertconfirmation: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.open_alert_confirmation
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_open_alert_confirmation", val)
|
||||
}
|
||||
},
|
||||
dialogformorder() {
|
||||
return this.$store.state.testcalculation.dialog_form_order
|
||||
},
|
||||
dialogstatusorder() {
|
||||
return this.$store.state.testcalculation.dialog_status_order
|
||||
},
|
||||
xdate: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_date", val)
|
||||
}
|
||||
},
|
||||
xnote: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.note
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_note", val)
|
||||
}
|
||||
},
|
||||
xcompanyid: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.companyid
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_companyid", val)
|
||||
}
|
||||
},
|
||||
xcompanyname: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.companyname
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_companyname", val)
|
||||
}
|
||||
},
|
||||
xmouid: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.mouid
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_mouid", val)
|
||||
}
|
||||
},
|
||||
xmouname: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.mouname
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_mouname", val)
|
||||
}
|
||||
},
|
||||
xcompanies() {
|
||||
return this.$store.state.testcalculation.companies
|
||||
},
|
||||
xcompany: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.company
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_company", val)
|
||||
}
|
||||
},
|
||||
xmous() {
|
||||
return this.$store.state.testcalculation.mous
|
||||
},
|
||||
xmou: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.mou
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_mou", val)
|
||||
}
|
||||
},
|
||||
startComputedDateFormatted() {
|
||||
return this.formatDate(this.xsdate)
|
||||
},
|
||||
xsdate: {
|
||||
get() {
|
||||
return this.$store.state.testcalculation.sdate
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("testcalculation/update_sdate", val)
|
||||
}
|
||||
},
|
||||
xstatuss() {
|
||||
return this.$store.state.testcalculation.statuss
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
items: [],
|
||||
name: '',
|
||||
search_company: '',
|
||||
searchMou: '',
|
||||
menusdate: false,
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
page: 1,
|
||||
headers: [{
|
||||
text: "NAMA RUMUS",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TEST YANG AKAN DIHITUNG",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "JENIS KELAMIN",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TESTS",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "25%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "FORMULA",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "25%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "AKSI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
pagination: {
|
||||
descending: true,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'T_TestCalculationID',
|
||||
totalItems: this.$store.state.testcalculation.total_testcalculations
|
||||
},
|
||||
statuss: [{
|
||||
waktu: '16-07-2019 10:00',
|
||||
status: 'Order Dibuat',
|
||||
user: 'Nagita Slavina'
|
||||
},
|
||||
{
|
||||
waktu: '16-07-2019 11:00',
|
||||
status: 'Order Dikirim',
|
||||
user: 'Nagita Slavina'
|
||||
},
|
||||
{
|
||||
waktu: '16-07-2019 12:00',
|
||||
status: 'Order dikonfirmasi',
|
||||
user: 'Chacha Frederica'
|
||||
},
|
||||
{
|
||||
waktu: '16-07-2019 13:00',
|
||||
status: 'Telah dibuat Surat Jalan',
|
||||
user: 'Chacha Frederica'
|
||||
},
|
||||
{
|
||||
waktu: '16-07-2019 14:00',
|
||||
status: 'Kurir akan mengambil sampel',
|
||||
user: 'Satria Subiantoro'
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
search_company(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.testcalculation.update_autocomplete_status == 1) return
|
||||
this.thr_search_company()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
91
one-ui/masterdata/one-md-test-calculation-v2/index.php
Normal file
91
one-ui/masterdata/one-md-test-calculation-v2/index.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>One</title>
|
||||
<link rel="stylesheet" href="../../libs/vendor/css/google-fonts.css">
|
||||
<link rel="stylesheet" href="../../libs/vendor/css/icomoon-fonts.css">
|
||||
<link rel="stylesheet" href="../../libs/vendor/css/vuetify.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div v-cloak id="app">
|
||||
<v-app id="smartApp" >
|
||||
<one-navbar></one-navbar>
|
||||
<v-content style="background:#F5E8DF!important" >
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap >
|
||||
<v-flex xs12 class="left" fill-height pa-1>
|
||||
<one-md-test-list></one-md-test-list>
|
||||
<one-md-test-calculation></one-md-test-calculation>
|
||||
</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-calculation': httpVueLoader('./components/oneMdTestCalculation.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
.left {
|
||||
}
|
||||
.right {
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,691 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/testcalculation.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
last_id: -1,
|
||||
last_saved_id: -1,
|
||||
x_pat_id: 0,
|
||||
act: 'edit',
|
||||
act_comp: 'new',
|
||||
act_pat: 'new',
|
||||
act_send: 'N',
|
||||
get_data_status: 0,
|
||||
search_testcalculation: 0,
|
||||
search_status: 0,
|
||||
search_error_message: '',
|
||||
dialog_form_order: false,
|
||||
dialog_edit_form_order:false,
|
||||
dialog_status_order: false,
|
||||
norm: '',
|
||||
testcalculation_name: '',
|
||||
testcalculations: [],
|
||||
total_testcalculations: 0,
|
||||
testcalculation_detail: [],
|
||||
date: '',
|
||||
note: '',
|
||||
companyid: 0,
|
||||
companyname: '',
|
||||
mouid: 0,
|
||||
mouname: '',
|
||||
sdate:moment(new Date()).format('YYYY-MM-DD'),
|
||||
companies: [],
|
||||
company: {},
|
||||
mous: [],
|
||||
mou: {},
|
||||
total_testcalculation: 0,
|
||||
selected_testcalculation: {},
|
||||
codenumber:{},
|
||||
codenumberx:'',
|
||||
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_send: false,
|
||||
msg_confirmation_send: "",
|
||||
dialog_confirmation_delete_pat: false,
|
||||
msg_confirmation_delete_pat: "",
|
||||
autocomplete_status: 0,
|
||||
dialog_form_detail: false,
|
||||
errors: [],
|
||||
details: [],
|
||||
namacalculation: '',
|
||||
rumus: '',
|
||||
dob: '',
|
||||
sexes: [],
|
||||
selected_sex: {},
|
||||
titles: [],
|
||||
selected_title: {},
|
||||
orderautotests:[],
|
||||
orderautotest:{},
|
||||
autotests:[],
|
||||
autotest:{},
|
||||
ordertests:[],
|
||||
deleted_ordertests:[],
|
||||
ordertestfavorits:[],
|
||||
statuss:[],
|
||||
isage: 'N',
|
||||
issex: 'N',
|
||||
xisage: 'N',
|
||||
xissex: 'N',
|
||||
rumusx: ''
|
||||
},
|
||||
mutations: {
|
||||
update_x_pat_id(state, val) {
|
||||
state.x_pat_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_comp(state, val) {
|
||||
state.act_comp = val
|
||||
},
|
||||
update_act_pat(state, val) {
|
||||
state.act_pat = val
|
||||
},
|
||||
update_act_send(state, val) {
|
||||
state.act_send = val
|
||||
},
|
||||
update_get_data_status(state, val) {
|
||||
state.get_data_status = val
|
||||
},
|
||||
update_search_error_message(state, testcalculation) {
|
||||
state.search_error_message = testcalculation
|
||||
},
|
||||
update_search_testcalculation(state, testcalculation) {
|
||||
state.search_testcalculation = testcalculation
|
||||
},
|
||||
update_dialog_form_order(state, val) {
|
||||
state.dialog_form_order = val
|
||||
},
|
||||
update_dialog_edit_form_order(state, val) {
|
||||
state.dialog_edit_form_order = val
|
||||
},
|
||||
update_dialog_status_order(state, val) {
|
||||
state.dialog_status_order = val
|
||||
},
|
||||
update_testcalculation_name(state, val) {
|
||||
state.testcalculation_name = val
|
||||
},
|
||||
update_date(state, val) {
|
||||
state.date = val
|
||||
},
|
||||
update_sdate(state,val){
|
||||
state.sdate = val
|
||||
},
|
||||
update_note(state, val) {
|
||||
state.note = val
|
||||
},
|
||||
update_companyid(state, val) {
|
||||
state.companyid = val
|
||||
},
|
||||
update_companyname(state, val) {
|
||||
state.companyname = val
|
||||
},
|
||||
update_mouid(state, val) {
|
||||
state.mouid = val
|
||||
},
|
||||
update_mouname(state, val) {
|
||||
state.mouname = val
|
||||
},
|
||||
update_testcalculations(state, data) {
|
||||
state.testcalculations = data
|
||||
},
|
||||
update_selected_testcalculation(state, val) {
|
||||
state.selected_testcalculation = val
|
||||
},
|
||||
update_codenumber(state, val) {
|
||||
state.codenumber = val
|
||||
},
|
||||
update_codenumberx(state, val) {
|
||||
state.codenumberx = 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_send(state, val) {
|
||||
state.dialog_confirmation_send = val
|
||||
},
|
||||
update_msg_confirmation_send(state, val) {
|
||||
state.msg_confirmation_send = val
|
||||
},
|
||||
update_dialog_confirmation_delete_pat(state, val) {
|
||||
state.dialog_confirmation_delete_pat = val
|
||||
},
|
||||
update_msg_confirmation_delete_pat(state, val) {
|
||||
state.msg_confirmation_delete_pat = val
|
||||
},
|
||||
update_details(state, val) {
|
||||
state.details = val
|
||||
},
|
||||
update_autocomplete_status(state, val) {
|
||||
state.autocomplete_status = val
|
||||
},
|
||||
update_dialog_form_detail(state, val) {
|
||||
state.dialog_form_detail = val
|
||||
},
|
||||
update_label_detail(state, val) {
|
||||
state.label_detail = val
|
||||
},
|
||||
update_companies(state, val) {
|
||||
state.companies = val
|
||||
},
|
||||
update_company(state, val) {
|
||||
state.company = val
|
||||
},
|
||||
update_mous(state, val) {
|
||||
state.mous = val
|
||||
},
|
||||
update_mou(state, val) {
|
||||
state.mou = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_total_testcalculations(state, val) {
|
||||
state.total_testcalculations = val
|
||||
},
|
||||
update_dob(state, val) {
|
||||
state.dob = val
|
||||
},
|
||||
update_namacalculation(state, val) {
|
||||
state.namacalculation = val
|
||||
},
|
||||
update_rumus(state, val) {
|
||||
state.rumus = val
|
||||
},
|
||||
update_sexes(state, val) {
|
||||
state.sexes = val
|
||||
},
|
||||
update_selected_sex(state, val) {
|
||||
state.selected_sex = val
|
||||
},
|
||||
update_titles(state, val) {
|
||||
state.titles = val
|
||||
},
|
||||
update_selected_title(state, val) {
|
||||
state.selected_title = val
|
||||
},
|
||||
update_orderautotests(state,data){
|
||||
state.orderautotests = data
|
||||
},
|
||||
update_orderautotest(state,val){
|
||||
state.orderautotest = val
|
||||
},
|
||||
update_autotests(state,data){
|
||||
state.autotests = data
|
||||
},
|
||||
update_autotest(state,val){
|
||||
state.autotest = val
|
||||
},
|
||||
update_ordertests(state,data){
|
||||
state.ordertests = data
|
||||
},
|
||||
update_deleted_ordertests(state,data){
|
||||
state.deleted_ordertests = data
|
||||
},
|
||||
update_ordertestfavorits(state,data){
|
||||
state.ordertestfavorits = data
|
||||
},
|
||||
update_statuss(state,data){
|
||||
state.statuss = data
|
||||
},
|
||||
update_isage(state, val) {
|
||||
state.isage = val
|
||||
},
|
||||
update_issex(state, val) {
|
||||
state.issex = val
|
||||
},
|
||||
update_xisage(state, val) {
|
||||
state.xisage = val
|
||||
},
|
||||
update_xissex(state, val) {
|
||||
state.xissex = val
|
||||
},
|
||||
update_rumusx(state, val) {
|
||||
state.rumusx = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context, prm) {
|
||||
context.commit("update_search_testcalculation", 1)
|
||||
try {
|
||||
let resp = await api.search(one_token(), prm.name)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_testcalculation", 3)
|
||||
context.commit("update_search_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_search_testcalculation", 2)
|
||||
context.commit("update_search_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_testcalculations", data.records)
|
||||
context.commit("update_total_testcalculations", data.total)
|
||||
context.commit("update_no_save", 0)
|
||||
if (prm.lastid === -1) {
|
||||
context.commit("update_selected_testcalculation", data.records[0])
|
||||
var pat = data.records[0]
|
||||
context.commit("update_rumusx", pat.T_TestCalculationFormula)
|
||||
|
||||
context.commit("update_x_pat_id", pat.T_TestCalculationID)
|
||||
context.commit("update_namacalculation", pat.T_TestCalculationName)
|
||||
context.commit("update_rumus", pat.T_TestCalculationFormula)
|
||||
context.commit("update_autotests", [{
|
||||
Nat_TestID: pat.T_TestCalculationNat_TestID,
|
||||
Nat_TestName: pat.Nat_TestName
|
||||
}])
|
||||
context.commit("update_autotest", {
|
||||
Nat_TestID: pat.T_TestCalculationNat_TestID,
|
||||
Nat_TestName: pat.Nat_TestName
|
||||
})
|
||||
context.commit("update_selected_sex", {
|
||||
Nat_SexID: pat.T_TestCalculationNat_SexID,
|
||||
Nat_SexName: pat.Nat_SexName
|
||||
})
|
||||
context.dispatch("getdetail", {
|
||||
id: pat.T_TestCalculationID
|
||||
})
|
||||
} else {
|
||||
context.commit("update_selected_testcalculation", data.records[prm.lastid])
|
||||
var pat = data.records[prm.lastid]
|
||||
context.commit("update_isage", pat.T_TestCalculationIsAge)
|
||||
context.commit("update_issex", pat.T_TestCalculationIsSex)
|
||||
context.commit("update_rumusx", pat.T_TestCalculationFormula)
|
||||
|
||||
context.commit("update_x_pat_id", pat.T_TestCalculationID)
|
||||
context.commit("update_namacalculation", pat.T_TestCalculationName)
|
||||
context.commit("update_rumus", pat.T_TestCalculationFormula)
|
||||
context.commit("update_autotests", [{
|
||||
Nat_TestID: pat.T_TestCalculationNat_TestID,
|
||||
Nat_TestName: pat.Nat_TestName
|
||||
}])
|
||||
context.commit("update_autotest", {
|
||||
Nat_TestID: pat.T_TestCalculationNat_TestID,
|
||||
Nat_TestName: pat.Nat_TestName
|
||||
})
|
||||
context.commit("update_selected_sex", {
|
||||
Nat_SexID: pat.T_TestCalculationNat_SexID,
|
||||
Nat_SexName: pat.Nat_SexName
|
||||
})
|
||||
context.dispatch("getdetail", {
|
||||
id: pat.T_TestCalculationID
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_testcalculation", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async getsexreg(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
prm.sexid = prm.sexid
|
||||
let resp = await api.getsexreg(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_titles", data.records.titles)
|
||||
context.commit("update_sexes", data.records.sexes)
|
||||
}
|
||||
} 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.id)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Data nomor " + prm.nomor + " sudah terupdate dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_dialog_form_order", false)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async newtestcalculation(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.newtestcalculation(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 berhasil disimpan"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_dialog_form_order", false)
|
||||
|
||||
}
|
||||
} 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 nomor" + prm.T_ReceiveReferenceHeaderNumber + " sudah dihapus dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async sendorder(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.sendorder(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_dialog_confirmation_send", false)
|
||||
context.commit("update_last_id", prm.T_TestCalculationID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Permintaan nomor " + prm.T_ReceiveReferenceHeaderNumber + " sudah berhasil dikirim ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async getdetail(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.getdetail(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_details", data.records)
|
||||
var pat = data.records[0]
|
||||
context.commit("update_ordertests", pat.tests)
|
||||
|
||||
}
|
||||
} 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 getmou(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getmou(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_mous", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async searchtest(context,prm) {
|
||||
context.commit("update_autocomplete_status",1)
|
||||
try {
|
||||
let resp= await api.searchtest(one_token(), prm.tes)
|
||||
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_orderautotests",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
}
|
||||
},
|
||||
async getnumberx(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.getnumberx(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,
|
||||
number: resp.data.number
|
||||
}
|
||||
context.commit("update_codenumber", data.records[0])
|
||||
context.commit("update_codenumberx", data.number)
|
||||
var oldArr = context.state.ordertests
|
||||
console.log(oldArr)
|
||||
var arrTest = data.records[0]
|
||||
oldArr.push(arrTest)
|
||||
|
||||
context.commit("update_orderautotests", [])
|
||||
context.commit("update_orderautotest", {})
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async deletenumberx(context,prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.deletenumberx(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async searchtestheader(context,prm) {
|
||||
context.commit("update_autocomplete_status",1)
|
||||
try {
|
||||
let resp= await api.searchtestheader(one_token(), prm.tes)
|
||||
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_autotests",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
}
|
||||
},
|
||||
async searchtestfavorit(context,prm) {
|
||||
context.commit("update_autocomplete_status",1)
|
||||
try {
|
||||
let resp= await api.searchtestfavorit(one_token(), prm.mouid)
|
||||
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_ordertestfavorits",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
}
|
||||
},
|
||||
async savenewdetail(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.savenewdetail(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_dialog_form_detail", false)
|
||||
context.commit("update_last_id", resp.data.id)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Penambahan data rumus " + prm.T_TestCalculationName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async saveeditdetail(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.saveeditdetail(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_dialog_form_detail", false)
|
||||
context.commit("update_last_id", prm.T_TestCalculationID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Perubahan data rumus " + prm.T_TestCalculationName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async deletedetail(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.deletedetail(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_dialog_confirmation_delete_pat", false)
|
||||
context.commit("update_last_id", prm.T_TestCalculationID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Penghapusan data rumus " + prm.T_TestCalculationName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
27
one-ui/masterdata/one-md-test-calculation-v2/store.js
Normal file
27
one-ui/masterdata/one-md-test-calculation-v2/store.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import testcalculation from "./modules/testcalculation.js";
|
||||
import system from "../../apps/modules/system/system.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
testcalculation: testcalculation,
|
||||
system: system
|
||||
},
|
||||
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