Flatten nested repos
This commit is contained in:
173
test/vuex/one-test-physic/api/physic.js
Normal file
173
test/vuex/one-test-physic/api/physic.js
Normal file
@@ -0,0 +1,173 @@
|
||||
const URL = "/one-api/mockup/resultentryso/";
|
||||
|
||||
export async function search(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'physic/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 getdoctorcouriers(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'physic/getdoctorcouriers', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function doaction(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'physic/doaction', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getdoctoraddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'physic/getdoctoraddress', 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 getordersamples(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'physic/getordersamples', 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 + 'physic/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 deletetrx(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'physic/deletetrx', 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 getgroups(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'physic/getgroups', 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 saveresult(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'physic/saveresult', 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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
173
test/vuex/one-test-physic/api/sample.js
Normal file
173
test/vuex/one-test-physic/api/sample.js
Normal file
@@ -0,0 +1,173 @@
|
||||
const URL = "/one-api/mockup/resultentryso/";
|
||||
|
||||
export async function search(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'resultentry/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 getdoctorcouriers(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'resultentry/getdoctorcouriers', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function doaction(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'resultentry/doaction', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getdoctoraddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'resultentry/getdoctoraddress', 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 getordersamples(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'resultentry/getordersamples', 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 + 'resultentry/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 deletetrx(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'resultentry/deletetrx', 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 getgroups(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'resultentry/getgroups', 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 saveresult(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'resultentry/saveresult', 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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
1278
test/vuex/one-test-physic/components/oneResultEntrySoForm.vue
Normal file
1278
test/vuex/one-test-physic/components/oneResultEntrySoForm.vue
Normal file
File diff suppressed because it is too large
Load Diff
425
test/vuex/one-test-physic/components/oneResultEntrySoList.vue
Normal file
425
test/vuex/one-test-physic/components/oneResultEntrySoList.vue
Normal file
@@ -0,0 +1,425 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-dialog v-model="dialogsuccess" persistent max-width="350">
|
||||
<v-card>
|
||||
<v-card-title color="success" class="headline">Berhasil !</v-card-title>
|
||||
<v-card-text v-html="msgsuccess">
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="green darken-1" flat @click="closeDialogSuccess">OK</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout row >
|
||||
<v-menu class="xs3 pr-2"
|
||||
v-model="menufilterdatestart"
|
||||
:close-on-content-click="false"
|
||||
:nudge-right="40"
|
||||
lazy
|
||||
hide-details
|
||||
transition="scale-transition"
|
||||
offset-y
|
||||
full-width
|
||||
max-width="290px"
|
||||
min-width="290px"
|
||||
>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field
|
||||
class="mt-1"
|
||||
hide-details
|
||||
v-model="filterComputedDateFormattedStart"
|
||||
label="Filter Tanggal Awal"
|
||||
outline
|
||||
readonly
|
||||
v-on="on"
|
||||
@blur="date = deFormatedDate(filterComputedDateFormattedStart)"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker v-model="xdatestart" no-title @input="menufilterdatestart = false"></v-date-picker>
|
||||
</v-menu>
|
||||
|
||||
<v-menu class="xs3 pl-2"
|
||||
v-model="menufilterdateend"
|
||||
:close-on-content-click="false"
|
||||
:nudge-right="40"
|
||||
lazy
|
||||
hide-details
|
||||
transition="scale-transition"
|
||||
offset-y
|
||||
full-width
|
||||
max-width="290px"
|
||||
min-width="290px"
|
||||
>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field
|
||||
class="mt-1"
|
||||
v-model="filterComputedDateFormattedEnd"
|
||||
label="Filter Tanggal Akhir"
|
||||
outline
|
||||
hide-details
|
||||
readonly
|
||||
v-on="on"
|
||||
@blur="date = deFormatedDate(filterComputedDateFormattedEnd)"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker v-model="xdateend" no-title @input="menufilterdateend = false"></v-date-picker>
|
||||
</v-menu>
|
||||
<v-text-field class="xs4 ma-1"
|
||||
label="Nomor Transaksi"
|
||||
placeholder="Cari ..."
|
||||
outline
|
||||
v-model="xnamelab"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
<v-select class="xs3 ma-1" :items="xstations"
|
||||
item-text="name"
|
||||
return-object
|
||||
v-model="xselectedstation"
|
||||
label="Status" outline hide-details></v-select>
|
||||
<v-btn class="xs3 ma-1" color="success" @click="searchTransaction" >Cari</v-btn>
|
||||
</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="xtransactions"
|
||||
: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.ordernumber }}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.orderdate}}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.patient_fullname}}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.status_name}}</td>
|
||||
</template>
|
||||
<template>
|
||||
<div class="text-xs-center">
|
||||
<v-pagination
|
||||
v-model="page"
|
||||
:length="15"
|
||||
:total-visible="7"
|
||||
></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>
|
||||
<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="closeDialogInfo()"></one-dialog-info>
|
||||
</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("sample/search",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
search:this.xnamelab,
|
||||
stationid:this.xselectedstation.id,
|
||||
groupid:3,
|
||||
subgroupid:0,
|
||||
lastid:-1
|
||||
})
|
||||
},
|
||||
methods : {
|
||||
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')}`
|
||||
},
|
||||
isSelected(p) {
|
||||
return p.trx_id == this.$store.state.sample.selected_transaction.trx_id
|
||||
},
|
||||
searchTransaction() {
|
||||
this.$store.dispatch("sample/search",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
search:this.xnamelab,
|
||||
stationid:this.xselectedstation.id,
|
||||
groupid:3,
|
||||
subgroupid:0,
|
||||
lastid:-1
|
||||
})
|
||||
},
|
||||
selectMe(trx) {
|
||||
if(this.$store.state.sample.no_save == 0 ){
|
||||
//console.log(trx)
|
||||
this.$store.commit("sample/update_selected_transaction",trx)
|
||||
this.$store.commit("sample/update_act",'edit')
|
||||
|
||||
if(trx.details.length > 0 ){
|
||||
this.$store.commit("sample/update_details", trx.details)
|
||||
}
|
||||
else{
|
||||
this.$store.commit("sample/update_details", [])
|
||||
}
|
||||
|
||||
}else{
|
||||
this.$store.commit("sample/update_open_alert_confirmation",true)
|
||||
}
|
||||
},
|
||||
closeAlertConfirmation(){
|
||||
this.$store.commit("sample/update_open_alert_confirmation",false)
|
||||
},
|
||||
forgetAlertConfirmation(){
|
||||
this.$store.commit("sample/update_no_save",0)
|
||||
this.$store.commit("sample/update_open_alert_confirmation",false)
|
||||
},
|
||||
updateAlert_success(val){
|
||||
this.$store.commit("sample/update_alert_success",val)
|
||||
},
|
||||
setNewTransaction(){
|
||||
this.$store.commit("sample/update_selected_transaction",{})
|
||||
this.$store.commit("sample/update_details",[])
|
||||
this.$store.commit("sample/update_selected_detail",{})
|
||||
this.$store.commit("sample/update_selected_doctor",{})
|
||||
this.$store.commit("sample/update_selected_doctor_address",{})
|
||||
this.$store.commit("sample/update_selected_courier",{})
|
||||
this.$store.commit("sample/update_trx_date",moment(new Date()).format('YYYY-MM-DD'))
|
||||
this.$store.commit("sample/update_trx_note",'')
|
||||
this.$store.commit("sample/update_act",'new')
|
||||
},
|
||||
closeDialogSuccess(){
|
||||
let arrtrx = this.$store.state.sample.transactions
|
||||
var idx = _.findIndex(arrtrx, item => item.trx_id === this.$store.state.sample.last_id)
|
||||
console.log(idx)
|
||||
this.$store.dispatch("sample/search",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
search:this.xnamelab,
|
||||
stationid:this.xselectedstation.id,
|
||||
groupid:this.$store.state.sample.select_item_group.id,
|
||||
subgroupid:this.$store.state.sample.select_item_subgroup.id,
|
||||
lastid:idx
|
||||
})
|
||||
this.$store.commit("sample/update_dialog_success",false)
|
||||
},
|
||||
closeDialogInfo(){
|
||||
this.$store.commit("sample/update_open_dialog_info",false)
|
||||
var trxs = this.$store.state.sample.transactions
|
||||
var trx = this.$store.state.sample.selected_transaction
|
||||
var idx = _.findIndex(trxs, item => item.T_OrderHeaderID === trx.T_OrderHeaderID && item.T_SampleTypeID === trx.T_SampleTypeID)
|
||||
this.$store.dispatch("sample/search",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
search:this.xnamelab,
|
||||
stationid:this.xselectedstation.id,
|
||||
groupid:this.$store.state.sample.select_item_group.id,
|
||||
subgroupid:this.$store.state.sample.select_item_subgroup.id,
|
||||
lastid:idx
|
||||
})
|
||||
|
||||
},
|
||||
selectgroup(value){
|
||||
this.selected_itemgroup = value
|
||||
},
|
||||
selectsubgroup(value){
|
||||
this.selected_itemsubgroup = value
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialogsuccess: {
|
||||
get() {
|
||||
return this.$store.state.sample.dialog_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("sample/update_dialog_success",val)
|
||||
}
|
||||
},
|
||||
msgsuccess(){
|
||||
return this.$store.state.sample.msg_success
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.sample.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("sample/update_alert_success",val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.sample.search_status == 1
|
||||
},
|
||||
itemgroups() {
|
||||
return this.$store.state.sample.item_groups
|
||||
},
|
||||
selected_itemgroupname() {
|
||||
return this.$store.state.sample.selected_itemgroupname
|
||||
},
|
||||
selected_itemgroup: {
|
||||
get() {
|
||||
//console.log(this.$store.state.sample.select_item_group)
|
||||
return this.$store.state.sample.select_item_group
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("sample/update_select_item_group",val)
|
||||
this.$store.commit("sample/update_selected_itemgroupname",val.fulltitle)
|
||||
this.$store.commit("sample/update_item_subgroups",val.childrens)
|
||||
this.$store.commit("sample/update_select_item_subgroup",val.childrens[0])
|
||||
this.$store.commit("sample/update_selected_itemsubgroupname",val.childrens[0].fulltitle)
|
||||
}
|
||||
},
|
||||
itemsubgroups() {
|
||||
return this.$store.state.sample.item_subgroups
|
||||
},
|
||||
selected_itemsubgroupname() {
|
||||
return this.$store.state.sample.selected_itemsubgroupname
|
||||
},
|
||||
selected_itemsubgroup: {
|
||||
get() {
|
||||
return this.$store.state.sample.select_item_subgroup
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("sample/update_select_item_subgroup",val)
|
||||
this.$store.commit("sample/update_selected_itemsubgroupname",val.fulltitle)
|
||||
}
|
||||
},
|
||||
xdatestart : {
|
||||
get() {
|
||||
return this.$store.state.sample.start_date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("sample/update_start_date",val)
|
||||
}
|
||||
},
|
||||
xdateend : {
|
||||
get() {
|
||||
return this.$store.state.sample.end_date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("sample/update_end_date",val)
|
||||
}
|
||||
},
|
||||
xnamelab : {
|
||||
get() {
|
||||
return this.$store.state.sample.name_lab
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("sample/update_name_lab",val)
|
||||
}
|
||||
},
|
||||
filterComputedDateFormattedStart () {
|
||||
return this.formatDate(this.xdatestart)
|
||||
},
|
||||
filterComputedDateFormattedEnd () {
|
||||
return this.formatDate(this.xdateend)
|
||||
},
|
||||
xstations() {
|
||||
return this.$store.state.sample.stations
|
||||
},
|
||||
xselectedstation: {
|
||||
get() {
|
||||
return this.$store.state.sample.selected_station
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("sample/update_selected_station",val)
|
||||
}
|
||||
},
|
||||
xtransactions() {
|
||||
//console.log(this.$store.state.sample.transactions)
|
||||
return this.$store.state.sample.transactions
|
||||
},
|
||||
openalertconfirmation: {
|
||||
get() {
|
||||
return this.$store.state.sample.open_alert_confirmation
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("sample/update_open_alert_confirmation",val)
|
||||
}
|
||||
},
|
||||
opendialoginfo: {
|
||||
get() {
|
||||
return this.$store.state.sample.open_dialog_info
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("sample/update_open_dialog_info",false)
|
||||
}
|
||||
},
|
||||
msginfo(){
|
||||
return this.$store.state.sample.msg_info
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
msgalertconfirmation:"Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
menufilterdatestart:false,
|
||||
menufilterdateend:false,
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
items: [],
|
||||
name: '',
|
||||
page:1,
|
||||
headers: [
|
||||
{
|
||||
text: "NOMOR LAB",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TANGGAL",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "PASIEN",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "STATUS",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
pagination:{
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'trx_id ASC',
|
||||
totalItems: this.$store.state.sample.total_transactions
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
1707
test/vuex/one-test-physic/components/oneTestPhysicForm.vue
Normal file
1707
test/vuex/one-test-physic/components/oneTestPhysicForm.vue
Normal file
File diff suppressed because it is too large
Load Diff
447
test/vuex/one-test-physic/components/oneTestPhysicList.vue
Normal file
447
test/vuex/one-test-physic/components/oneTestPhysicList.vue
Normal file
@@ -0,0 +1,447 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-dialog v-model="dialogsuccess" persistent max-width="350">
|
||||
<v-card>
|
||||
<v-card-title color="success" class="headline">Berhasil !</v-card-title>
|
||||
<v-card-text v-html="msgsuccess">
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="green darken-1" flat @click="closeDialogSuccess">OK</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout row >
|
||||
<v-menu class="xs3 pr-2"
|
||||
v-model="menufilterdatestart"
|
||||
:close-on-content-click="false"
|
||||
:nudge-right="40"
|
||||
lazy
|
||||
hide-details
|
||||
transition="scale-transition"
|
||||
offset-y
|
||||
full-width
|
||||
max-width="290px"
|
||||
min-width="290px"
|
||||
>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field
|
||||
class="mt-1"
|
||||
hide-details
|
||||
v-model="filterComputedDateFormattedStart"
|
||||
label="Tanggal Awal"
|
||||
outline
|
||||
readonly
|
||||
v-on="on"
|
||||
@blur="date = deFormatedDate(filterComputedDateFormattedStart)"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker v-model="xdatestart" no-title @input="menufilterdatestart = false"></v-date-picker>
|
||||
</v-menu>
|
||||
|
||||
<v-menu class="xs3 pl-2"
|
||||
v-model="menufilterdateend"
|
||||
:close-on-content-click="false"
|
||||
:nudge-right="40"
|
||||
lazy
|
||||
hide-details
|
||||
transition="scale-transition"
|
||||
offset-y
|
||||
full-width
|
||||
max-width="290px"
|
||||
min-width="290px"
|
||||
>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field
|
||||
class="mt-1"
|
||||
v-model="filterComputedDateFormattedEnd"
|
||||
label="Tanggal Akhir"
|
||||
outline
|
||||
hide-details
|
||||
readonly
|
||||
v-on="on"
|
||||
@blur="date = deFormatedDate(filterComputedDateFormattedEnd)"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker v-model="xdateend" no-title @input="menufilterdateend = false"></v-date-picker>
|
||||
</v-menu>
|
||||
<v-text-field class="xs4 ma-1"
|
||||
label="Nomor Transaksi"
|
||||
placeholder="Cari ..."
|
||||
outline
|
||||
v-model="xnamelab"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
<v-select class="xs3 mini-select ma-1" :items="xstations"
|
||||
item-text="name"
|
||||
return-object
|
||||
v-model="xselectedstation"
|
||||
label="Status" outline hide-details></v-select>
|
||||
<!--<v-btn class="xs3 ma-1" color="success" @click="searchTransaction" >Cari</v-btn>-->
|
||||
<span @click="searchTransaction" class="icon-medium-fill-base xs1 white--text success iconsearch-search"></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="xtransactions"
|
||||
:loading="isLoading"
|
||||
hide-actions
|
||||
class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.ordernumber }}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.orderdate}}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.patient_fullname}}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.status_name}}</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
<v-divider></v-divider>
|
||||
<v-pagination
|
||||
style="margin-top:10px;margin-bottom:5px"
|
||||
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>
|
||||
<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="closeDialogInfo()"></one-dialog-info>
|
||||
</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("physic/search",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
search:this.xnamelab,
|
||||
stationid:this.xselectedstation.id,
|
||||
current_page:1,
|
||||
lastid:-1
|
||||
})
|
||||
},
|
||||
methods : {
|
||||
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')}`
|
||||
},
|
||||
isSelected(p) {
|
||||
return p.trx_id == this.$store.state.physic.selected_transaction.trx_id
|
||||
},
|
||||
searchTransaction() {
|
||||
this.$store.dispatch("physic/search",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
search:this.xnamelab,
|
||||
stationid:this.xselectedstation.id,
|
||||
current_page:1,
|
||||
lastid:-1
|
||||
})
|
||||
},
|
||||
selectMe(trx) {
|
||||
if(this.$store.state.physic.no_save == 0 ){
|
||||
//console.log(trx)
|
||||
this.$store.commit("physic/update_selected_transaction",trx)
|
||||
this.$store.commit("physic/update_act",'edit')
|
||||
console.log(trx.details)
|
||||
if(!_.isEmpty(trx.details)){
|
||||
this.$store.commit("physic/update_details", trx.details)
|
||||
}
|
||||
else{
|
||||
this.$store.commit("physic/update_details", [])
|
||||
}
|
||||
|
||||
}else{
|
||||
this.$store.commit("physic/update_open_alert_confirmation",true)
|
||||
}
|
||||
},
|
||||
closeAlertConfirmation(){
|
||||
this.$store.commit("physic/update_open_alert_confirmation",false)
|
||||
},
|
||||
forgetAlertConfirmation(){
|
||||
this.$store.commit("physic/update_no_save",0)
|
||||
this.$store.commit("physic/update_open_alert_confirmation",false)
|
||||
},
|
||||
updateAlert_success(val){
|
||||
this.$store.commit("physic/update_alert_success",val)
|
||||
},
|
||||
setNewTransaction(){
|
||||
this.$store.commit("physic/update_selected_transaction",{})
|
||||
this.$store.commit("physic/update_details",[])
|
||||
this.$store.commit("physic/update_selected_detail",{})
|
||||
this.$store.commit("physic/update_selected_doctor",{})
|
||||
this.$store.commit("physic/update_selected_doctor_address",{})
|
||||
this.$store.commit("physic/update_selected_courier",{})
|
||||
this.$store.commit("physic/update_trx_date",moment(new Date()).format('YYYY-MM-DD'))
|
||||
this.$store.commit("physic/update_trx_note",'')
|
||||
this.$store.commit("physic/update_act",'new')
|
||||
},
|
||||
closeDialogSuccess(){
|
||||
let arrtrx = this.$store.state.physic.transactions
|
||||
var idx = _.findIndex(arrtrx, item => item.trx_id === this.$store.state.physic.last_id)
|
||||
console.log(idx)
|
||||
this.$store.dispatch("physic/search",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
search:this.xnamelab,
|
||||
stationid:this.xselectedstation.id,
|
||||
groupid:this.$store.state.physic.select_item_group.id,
|
||||
subgroupid:this.$store.state.physic.select_item_subgroup.id,
|
||||
lastid:idx
|
||||
})
|
||||
this.$store.commit("physic/update_dialog_success",false)
|
||||
},
|
||||
closeDialogInfo(){
|
||||
this.$store.commit("physic/update_open_dialog_info",false)
|
||||
var trxs = this.$store.state.physic.transactions
|
||||
var trx = this.$store.state.physic.selected_transaction
|
||||
var idx = _.findIndex(trxs, item => item.T_OrderHeaderID === trx.T_OrderHeaderID && item.T_SampleTypeID === trx.T_SampleTypeID)
|
||||
this.$store.dispatch("physic/search",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
search:this.xnamelab,
|
||||
stationid:this.xselectedstation.id,
|
||||
groupid:this.$store.state.physic.select_item_group.id,
|
||||
subgroupid:this.$store.state.physic.select_item_subgroup.id,
|
||||
lastid:idx
|
||||
})
|
||||
|
||||
},
|
||||
selectgroup(value){
|
||||
this.selected_itemgroup = value
|
||||
},
|
||||
selectsubgroup(value){
|
||||
this.selected_itemsubgroup = value
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialogsuccess: {
|
||||
get() {
|
||||
return this.$store.state.physic.dialog_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("physic/update_dialog_success",val)
|
||||
}
|
||||
},
|
||||
msgsuccess(){
|
||||
return this.$store.state.physic.msg_success
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.physic.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("physic/update_alert_success",val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.physic.search_status == 1
|
||||
},
|
||||
itemgroups() {
|
||||
return this.$store.state.physic.item_groups
|
||||
},
|
||||
selected_itemgroupname() {
|
||||
return this.$store.state.physic.selected_itemgroupname
|
||||
},
|
||||
selected_itemgroup: {
|
||||
get() {
|
||||
//console.log(this.$store.state.physic.select_item_group)
|
||||
return this.$store.state.physic.select_item_group
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("physic/update_select_item_group",val)
|
||||
this.$store.commit("physic/update_selected_itemgroupname",val.fulltitle)
|
||||
this.$store.commit("physic/update_item_subgroups",val.childrens)
|
||||
this.$store.commit("physic/update_select_item_subgroup",val.childrens[0])
|
||||
this.$store.commit("physic/update_selected_itemsubgroupname",val.childrens[0].fulltitle)
|
||||
}
|
||||
},
|
||||
itemsubgroups() {
|
||||
return this.$store.state.physic.item_subgroups
|
||||
},
|
||||
selected_itemsubgroupname() {
|
||||
return this.$store.state.physic.selected_itemsubgroupname
|
||||
},
|
||||
selected_itemsubgroup: {
|
||||
get() {
|
||||
return this.$store.state.physic.select_item_subgroup
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("physic/update_select_item_subgroup",val)
|
||||
this.$store.commit("physic/update_selected_itemsubgroupname",val.fulltitle)
|
||||
}
|
||||
},
|
||||
xdatestart : {
|
||||
get() {
|
||||
return this.$store.state.physic.start_date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("physic/update_start_date",val)
|
||||
}
|
||||
},
|
||||
xdateend : {
|
||||
get() {
|
||||
return this.$store.state.physic.end_date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("physic/update_end_date",val)
|
||||
}
|
||||
},
|
||||
xnamelab : {
|
||||
get() {
|
||||
return this.$store.state.physic.name_lab
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("physic/update_name_lab",val)
|
||||
}
|
||||
},
|
||||
filterComputedDateFormattedStart () {
|
||||
return this.formatDate(this.xdatestart)
|
||||
},
|
||||
filterComputedDateFormattedEnd () {
|
||||
return this.formatDate(this.xdateend)
|
||||
},
|
||||
xstations() {
|
||||
return this.$store.state.physic.stations
|
||||
},
|
||||
xselectedstation: {
|
||||
get() {
|
||||
return this.$store.state.physic.selected_station
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("physic/update_selected_station",val)
|
||||
}
|
||||
},
|
||||
xtransactions() {
|
||||
//console.log(this.$store.state.physic.transactions)
|
||||
return this.$store.state.physic.transactions
|
||||
},
|
||||
openalertconfirmation: {
|
||||
get() {
|
||||
return this.$store.state.physic.open_alert_confirmation
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("physic/update_open_alert_confirmation",val)
|
||||
}
|
||||
},
|
||||
opendialoginfo: {
|
||||
get() {
|
||||
return this.$store.state.physic.open_dialog_info
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("physic/update_open_dialog_info",false)
|
||||
}
|
||||
},
|
||||
msginfo(){
|
||||
return this.$store.state.physic.msg_info
|
||||
},
|
||||
curr_page: {
|
||||
get() {
|
||||
return this.$store.state.physic.current_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("physic/update_current_page",val)
|
||||
this.$store.dispatch("physic/search",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
search:this.xnamelab,
|
||||
stationid:this.xselectedstation.id,
|
||||
current_page:val,
|
||||
lastid:-1
|
||||
})
|
||||
}
|
||||
},
|
||||
xtotal_page: {
|
||||
get() {
|
||||
return this.$store.state.physic.total_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("physic/update_total_page",val)
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
msgalertconfirmation:"Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
menufilterdatestart:false,
|
||||
menufilterdateend:false,
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
items: [],
|
||||
name: '',
|
||||
page:1,
|
||||
headers: [
|
||||
{
|
||||
text: "NOMOR LAB",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TANGGAL",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "PASIEN",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "STATUS",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
pagination:{
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'trx_id ASC',
|
||||
totalItems: this.$store.state.physic.total_transactions
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
93
test/vuex/one-test-physic/index.php
Normal file
93
test/vuex/one-test-physic/index.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<!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 xs5 class="left" fill-height pa-1>
|
||||
<one-test-physic-list></one-test-physic-list>
|
||||
</v-flex>
|
||||
<v-flex xs7 class="right" fill-height pa-1>
|
||||
<one-test-physic-form></one-test-physic-form>
|
||||
</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-test-physic-list': httpVueLoader('./components/oneTestPhysicList.vue'),
|
||||
'one-test-physic-form': httpVueLoader('./components/oneTestPhysicForm.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
.left {
|
||||
}
|
||||
.right {
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
530
test/vuex/one-test-physic/modules/physic..js
Normal file
530
test/vuex/one-test-physic/modules/physic..js
Normal file
@@ -0,0 +1,530 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/physic"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
last_id:-1,
|
||||
last_saved_id:-1,
|
||||
x_addr_id:0,
|
||||
act:'new',
|
||||
last_trx:{},
|
||||
act_addr:'new',
|
||||
get_data_status:0,
|
||||
search_trx: 0,
|
||||
search_status: 0,
|
||||
search_error_message: '',
|
||||
start_date:moment(new Date()).format('YYYY-MM-DD'),
|
||||
end_date:moment(new Date()).format('YYYY-MM-DD'),
|
||||
total_transaction: 0,
|
||||
transactions:[],
|
||||
details:[],
|
||||
selected_detai:{},
|
||||
stations:[{id:"NEW",name:"BARU"},{id:"VAL1",name:"VERIFIKASI"},{id:"VAL2",name:"VALIDASI"}],
|
||||
selected_station:{id:"NEW",name:"BARU"},
|
||||
selected_transaction: {},
|
||||
save_status: 0,
|
||||
name_lab:'',
|
||||
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: "",
|
||||
autocomplete_status:0,
|
||||
dialog_form_address: false,
|
||||
errors:[],
|
||||
open_dialog_info:false,
|
||||
msg_info:'',
|
||||
dialog_action:false,
|
||||
msg_action:'',
|
||||
current_status:null,
|
||||
uploaded_files:[],
|
||||
uploaded_error:null,
|
||||
photos:[],
|
||||
selected_photo:{},
|
||||
dialog_image:false,
|
||||
image:'',
|
||||
doctors:[],
|
||||
selected_doctor:{},
|
||||
doctor_address:[],
|
||||
selected_doctor_address:{},
|
||||
trx_date:moment(new Date()).format('YYYY-MM-DD'),
|
||||
couriers:[],
|
||||
selected_courier:{},
|
||||
trx_note:'',
|
||||
item_groups:[{fulltitle:''}],
|
||||
selected_item_group:{fulltitle:''},
|
||||
item_subgroups:[{fulltitle:''}],
|
||||
selected_item_subgroup:{fulltitle:''},
|
||||
selected_itemgroupname:'',
|
||||
selected_itemsubgroupname:'',
|
||||
langs:[]
|
||||
},
|
||||
mutations: {
|
||||
update_x_addr_id(state, val) {
|
||||
state.x_addr_id = val
|
||||
},
|
||||
update_last_id(state, val) {
|
||||
state.last_id = val
|
||||
},
|
||||
update_last_trx(state, val) {
|
||||
state.last_trx = val
|
||||
},
|
||||
update_last_saved_id(state, val) {
|
||||
state.last_saved_id = val
|
||||
},
|
||||
update_act(state, val) {
|
||||
state.act = val
|
||||
},
|
||||
update_start_date(state, val) {
|
||||
state.start_date = val
|
||||
},
|
||||
update_end_date(state, val) {
|
||||
state.end_date = val
|
||||
},
|
||||
update_name_lab(state, val) {
|
||||
state.name_lab = val
|
||||
},
|
||||
update_stations(state, val) {
|
||||
state.stations = val
|
||||
},
|
||||
update_selected_station(state, val) {
|
||||
state.selected_station = 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_transaction(state, val) {
|
||||
state.search_transaction = val
|
||||
},
|
||||
update_transactions(state, data) {
|
||||
state.transactions = data
|
||||
},
|
||||
update_selected_transaction(state, val) {
|
||||
state.selected_transaction = val
|
||||
},
|
||||
update_details(state, data) {
|
||||
state.details = data
|
||||
},
|
||||
update_selected_detail(state, val) {
|
||||
state.selected_detail = 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_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_total_transactions(state, val) {
|
||||
state.total_transactions = val
|
||||
},
|
||||
update_open_dialog_info(state, val) {
|
||||
state.open_dialog_info = val
|
||||
},
|
||||
update_msg_info(state, val) {
|
||||
state.msg_info = val
|
||||
},
|
||||
update_dialog_action(state, val) {
|
||||
state.dialog_action = val
|
||||
},
|
||||
update_msg_action(state, val) {
|
||||
state.msg_action = val
|
||||
},
|
||||
update_current_status(state, val) {
|
||||
state.current_status = val
|
||||
},
|
||||
update_uploaded_files(state, val) {
|
||||
state.uploaded_files = val
|
||||
},
|
||||
update_uploaded_error(state, val) {
|
||||
state.uploaded_error = val
|
||||
},
|
||||
update_photos(state, val) {
|
||||
state.photos = val
|
||||
},
|
||||
update_selected_photo(state, val) {
|
||||
state.selected_photo = val
|
||||
},
|
||||
update_dialog_image(state, val) {
|
||||
state.dialog_image = val
|
||||
},
|
||||
update_image(state, val) {
|
||||
state.image = val
|
||||
},
|
||||
update_doctors(state, val) {
|
||||
state.doctors = val
|
||||
},
|
||||
update_selected_doctor(state, val) {
|
||||
state.selected_doctor = val
|
||||
},
|
||||
update_doctor_address(state, val) {
|
||||
state.doctor_address = val
|
||||
},
|
||||
update_selected_doctor_address(state, val) {
|
||||
state.selected_doctor_address = val
|
||||
},
|
||||
update_trx_date(state, val) {
|
||||
state.trx_date = val
|
||||
},
|
||||
update_couriers(state, val) {
|
||||
state.couriers = val
|
||||
},
|
||||
update_selected_courier(state, val) {
|
||||
state.selected_courier = val
|
||||
},
|
||||
update_trx_note(state, val) {
|
||||
state.trx_note = val
|
||||
},
|
||||
update_item_groups(state, val) {
|
||||
state.item_groups = val
|
||||
},
|
||||
update_select_item_group(state, val) {
|
||||
state.select_item_group = val
|
||||
},
|
||||
update_item_subgroups(state, val) {
|
||||
state.item_subgroups = val
|
||||
},
|
||||
update_select_item_subgroup(state, val) {
|
||||
state.select_item_subgroup = val
|
||||
},
|
||||
update_selected_itemgroupname(state, val) {
|
||||
state.selected_itemgroupname = val
|
||||
},
|
||||
update_selected_itemsubgroupname(state, val) {
|
||||
state.selected_itemsubgroupname = val
|
||||
},
|
||||
update_item_langs(state, val) {
|
||||
state.langs = val
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
async search(context, prm) {
|
||||
context.commit("update_search_transaction", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.search(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_transaction", 3)
|
||||
context.commit("update_search_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_search_transaction", 2)
|
||||
context.commit("update_search_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
var trx = []
|
||||
if(data.records.length > 0){
|
||||
context.commit("update_transactions", resp.data.records)
|
||||
if(prm.lastid === -1 || prm.lastid > data.records.length - 1){
|
||||
trx = resp.data.records[0]
|
||||
}
|
||||
else{
|
||||
trx = resp.data.records[prm.lastid]
|
||||
}
|
||||
context.commit("update_selected_transaction", trx)
|
||||
|
||||
if(!_.isEmpty(trx.details)){
|
||||
context.commit("update_details", trx.details)
|
||||
}
|
||||
else{
|
||||
context.commit("update_details", [])
|
||||
}
|
||||
}
|
||||
else{
|
||||
context.commit("update_transactions", [])
|
||||
context.commit("update_selected_transaction", {})
|
||||
}
|
||||
|
||||
context.commit("update_total_transactions", data.total)
|
||||
context.commit("update_no_save", 0)
|
||||
context.commit("update_act",'edit')
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_transaction", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async getdoctorcouriers(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getdoctorcouriers(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_doctors",data.records['doctors'])
|
||||
context.commit("update_couriers",data.records['couriers'])
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async getgroups(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getgroups(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
|
||||
}
|
||||
var groups = data.records['groups']
|
||||
var langs = data.records['langs']
|
||||
context.commit("update_item_langs",langs)
|
||||
context.commit("update_item_groups",groups)
|
||||
context.commit("update_select_item_group",groups[0])
|
||||
context.commit("update_selected_itemgroupname",groups[0].fulltitle)
|
||||
context.commit("update_item_subgroups",groups[0].childrens)
|
||||
context.commit("update_select_item_subgroup",groups[0].childrens[0])
|
||||
context.commit("update_selected_itemsubgroupname",groups[0].childrens[0].fulltitle)
|
||||
prm.groupid = 3
|
||||
prm.subgroupid = 0
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async upload(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
|
||||
let resp= await api.upload(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,
|
||||
error:resp.data.errors.error
|
||||
}
|
||||
context.commit("update_uploaded_files",data.records)
|
||||
|
||||
var msg = "Photo telah berhasil diupload"
|
||||
if(data.error){
|
||||
msg = data.error
|
||||
context.commit("update_current_status",'STATUS_FAILED')
|
||||
}
|
||||
else{
|
||||
context.commit("update_current_status",'STATUS_SUCCESS')
|
||||
}
|
||||
|
||||
context.commit("update_msg_info",msg)
|
||||
context.commit("update_open_dialog_info",true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async doaction(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.doaction(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_dialog_action",false)
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async deletephoto(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.deletephoto(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_act",'-')
|
||||
context.commit("update_dialog_confirmation_delete",false)
|
||||
context.commit("update_selected_photo",{})
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async getdoctoraddress(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getdoctoraddress(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_doctor_address",data.records)
|
||||
context.commit("update_selected_doctor_address",{})
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async getordersamples(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getordersamples(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_details",data.records)
|
||||
context.commit("update_selected_detail",{})
|
||||
}
|
||||
} 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_selected_transaction",{})
|
||||
context.commit("update_details",[])
|
||||
context.commit("update_selected_detail",{})
|
||||
context.commit("update_selected_doctor",{})
|
||||
context.commit("update_selected_doctor_address",{})
|
||||
context.commit("update_selected_courier",{})
|
||||
context.commit("update_trx_date",moment(new Date()).format('YYYY-MM-DD'))
|
||||
context.commit("update_trx_note",'')
|
||||
context.commit("update_act",'new')
|
||||
context.commit("update_dialog_success", true)
|
||||
context.commit("update_last_id", resp.data.id)
|
||||
var msg = "Transaksi penyimpanan " + resp.data.numbering + " berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async deletetrx(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.deletetrx(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_selected_transaction",{})
|
||||
context.commit("update_details",[])
|
||||
context.commit("update_selected_detail",{})
|
||||
context.commit("update_selected_doctor",{})
|
||||
context.commit("update_selected_doctor_address",{})
|
||||
context.commit("update_selected_courier",{})
|
||||
context.commit("update_trx_date",moment(new Date()).format('YYYY-MM-DD'))
|
||||
context.commit("update_trx_note",'')
|
||||
context.commit("update_act",'new')
|
||||
context.commit("update_dialog_confirmation_delete",false)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Transaksi hapus " + prm.trx_numbering + " berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async saveresult(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.saveresult(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_last_id",prm.lastid)
|
||||
context.commit("update_dialog_action",false)
|
||||
var msg = "Order " + prm.trx_numbering + " pemeriksaan <span class='red--text'>"+prm.trx.test_name+"</span> berhasil diupdate dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_dialog_success", true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
560
test/vuex/one-test-physic/modules/physic.js
Normal file
560
test/vuex/one-test-physic/modules/physic.js
Normal file
@@ -0,0 +1,560 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/physic.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
last_id:-1,
|
||||
last_saved_id:-1,
|
||||
x_addr_id:0,
|
||||
act:'new',
|
||||
last_trx:{},
|
||||
act_addr:'new',
|
||||
get_data_status:0,
|
||||
search_trx: 0,
|
||||
search_status: 0,
|
||||
search_error_message: '',
|
||||
start_date:moment(new Date()).format('YYYY-MM-DD'),
|
||||
end_date:moment(new Date()).format('YYYY-MM-DD'),
|
||||
total_transaction: 0,
|
||||
transactions:[],
|
||||
details:[],
|
||||
selected_detai:{},
|
||||
stations:[{id:"NEW",name:"BARU"},{id:"VER",name:"VERIFIKASI"},{id:"VAL",name:"VALIDASI"}],
|
||||
selected_station:{id:"NEW",name:"BARU"},
|
||||
selected_transaction: {},
|
||||
save_status: 0,
|
||||
name_lab:'',
|
||||
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: "",
|
||||
autocomplete_status:0,
|
||||
dialog_form_address: false,
|
||||
errors:[],
|
||||
open_dialog_info:false,
|
||||
msg_info:'',
|
||||
dialog_action:false,
|
||||
msg_action:'',
|
||||
current_status:null,
|
||||
uploaded_files:[],
|
||||
uploaded_error:null,
|
||||
photos:[],
|
||||
selected_photo:{},
|
||||
dialog_image:false,
|
||||
image:'',
|
||||
doctors:[],
|
||||
selected_doctor:{},
|
||||
doctor_address:[],
|
||||
selected_doctor_address:{},
|
||||
trx_date:moment(new Date()).format('YYYY-MM-DD'),
|
||||
couriers:[],
|
||||
selected_courier:{},
|
||||
trx_note:'',
|
||||
item_groups:[{fulltitle:''}],
|
||||
selected_item_group:{fulltitle:''},
|
||||
item_subgroups:[{fulltitle:''}],
|
||||
selected_item_subgroup:{fulltitle:''},
|
||||
selected_itemgroupname:'',
|
||||
selected_itemsubgroupname:'',
|
||||
langs:[],
|
||||
current_page:1,
|
||||
total_page:1,
|
||||
tab_now:'pasien',
|
||||
data_doctors:[],
|
||||
data_patient:[],
|
||||
total_page:0,
|
||||
current_page:1
|
||||
},
|
||||
mutations: {
|
||||
update_total_page(state, val) {
|
||||
state.total_page = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_data_doctors(state, val){
|
||||
state.data_doctors = val
|
||||
},
|
||||
update_data_patients(state, val){
|
||||
state.data_patients = val
|
||||
},
|
||||
update_tab_now(state, val){
|
||||
state.tab_now = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_total_page(state, val) {
|
||||
state.total_page = val
|
||||
},
|
||||
update_x_addr_id(state, val) {
|
||||
state.x_addr_id = val
|
||||
},
|
||||
update_last_id(state, val) {
|
||||
state.last_id = val
|
||||
},
|
||||
update_last_trx(state, val) {
|
||||
state.last_trx = val
|
||||
},
|
||||
update_last_saved_id(state, val) {
|
||||
state.last_saved_id = val
|
||||
},
|
||||
update_act(state, val) {
|
||||
state.act = val
|
||||
},
|
||||
update_start_date(state, val) {
|
||||
state.start_date = val
|
||||
},
|
||||
update_end_date(state, val) {
|
||||
state.end_date = val
|
||||
},
|
||||
update_name_lab(state, val) {
|
||||
state.name_lab = val
|
||||
},
|
||||
update_stations(state, val) {
|
||||
state.stations = val
|
||||
},
|
||||
update_selected_station(state, val) {
|
||||
state.selected_station = 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_transaction(state, val) {
|
||||
state.search_transaction = val
|
||||
},
|
||||
update_transactions(state, data) {
|
||||
state.transactions = data
|
||||
},
|
||||
update_selected_transaction(state, val) {
|
||||
state.selected_transaction = val
|
||||
},
|
||||
update_details(state, data) {
|
||||
state.details = data
|
||||
},
|
||||
update_selected_detail(state, val) {
|
||||
state.selected_detail = 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_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_total_transactions(state, val) {
|
||||
state.total_transactions = val
|
||||
},
|
||||
update_open_dialog_info(state, val) {
|
||||
state.open_dialog_info = val
|
||||
},
|
||||
update_msg_info(state, val) {
|
||||
state.msg_info = val
|
||||
},
|
||||
update_dialog_action(state, val) {
|
||||
state.dialog_action = val
|
||||
},
|
||||
update_msg_action(state, val) {
|
||||
state.msg_action = val
|
||||
},
|
||||
update_current_status(state, val) {
|
||||
state.current_status = val
|
||||
},
|
||||
update_uploaded_files(state, val) {
|
||||
state.uploaded_files = val
|
||||
},
|
||||
update_uploaded_error(state, val) {
|
||||
state.uploaded_error = val
|
||||
},
|
||||
update_photos(state, val) {
|
||||
state.photos = val
|
||||
},
|
||||
update_selected_photo(state, val) {
|
||||
state.selected_photo = val
|
||||
},
|
||||
update_dialog_image(state, val) {
|
||||
state.dialog_image = val
|
||||
},
|
||||
update_image(state, val) {
|
||||
state.image = val
|
||||
},
|
||||
update_doctors(state, val) {
|
||||
state.doctors = val
|
||||
},
|
||||
update_selected_doctor(state, val) {
|
||||
state.selected_doctor = val
|
||||
},
|
||||
update_doctor_address(state, val) {
|
||||
state.doctor_address = val
|
||||
},
|
||||
update_selected_doctor_address(state, val) {
|
||||
state.selected_doctor_address = val
|
||||
},
|
||||
update_trx_date(state, val) {
|
||||
state.trx_date = val
|
||||
},
|
||||
update_couriers(state, val) {
|
||||
state.couriers = val
|
||||
},
|
||||
update_selected_courier(state, val) {
|
||||
state.selected_courier = val
|
||||
},
|
||||
update_trx_note(state, val) {
|
||||
state.trx_note = val
|
||||
},
|
||||
update_item_groups(state, val) {
|
||||
state.item_groups = val
|
||||
},
|
||||
update_select_item_group(state, val) {
|
||||
state.select_item_group = val
|
||||
},
|
||||
update_item_subgroups(state, val) {
|
||||
state.item_subgroups = val
|
||||
},
|
||||
update_select_item_subgroup(state, val) {
|
||||
state.select_item_subgroup = val
|
||||
},
|
||||
update_selected_itemgroupname(state, val) {
|
||||
state.selected_itemgroupname = val
|
||||
},
|
||||
update_selected_itemsubgroupname(state, val) {
|
||||
state.selected_itemsubgroupname = val
|
||||
},
|
||||
update_item_langs(state, val) {
|
||||
state.langs = val
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
async search(context, prm) {
|
||||
context.commit("update_search_transaction", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.search(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_transaction", 3)
|
||||
context.commit("update_search_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_search_transaction", 2)
|
||||
context.commit("update_search_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
var trx = []
|
||||
if(data.records.length > 0){
|
||||
context.commit("update_transactions", resp.data.records)
|
||||
if(prm.lastid === -1 || prm.lastid > data.records.length - 1){
|
||||
trx = resp.data.records[0]
|
||||
}
|
||||
else{
|
||||
trx = resp.data.records[prm.lastid]
|
||||
}
|
||||
context.commit("update_selected_transaction", trx)
|
||||
|
||||
if(!_.isEmpty(trx.details)){
|
||||
context.commit("update_details", trx.details)
|
||||
}
|
||||
else{
|
||||
context.commit("update_details", [])
|
||||
}
|
||||
}
|
||||
else{
|
||||
context.commit("update_transactions", [])
|
||||
context.commit("update_selected_transaction", {})
|
||||
}
|
||||
|
||||
context.commit("update_total_transactions", data.total)
|
||||
context.commit("update_total_page", data.total)
|
||||
context.commit("update_no_save", 0)
|
||||
context.commit("update_act",'edit')
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_transaction", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async getdoctorcouriers(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getdoctorcouriers(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_doctors",data.records['doctors'])
|
||||
context.commit("update_couriers",data.records['couriers'])
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async getgroups(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getgroups(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
|
||||
}
|
||||
var groups = data.records['groups']
|
||||
var langs = data.records['langs']
|
||||
context.commit("update_item_langs",langs)
|
||||
context.commit("update_item_groups",groups)
|
||||
context.commit("update_select_item_group",groups[0])
|
||||
context.commit("update_selected_itemgroupname",groups[0].fulltitle)
|
||||
context.commit("update_item_subgroups",groups[0].childrens)
|
||||
context.commit("update_select_item_subgroup",groups[0].childrens[0])
|
||||
context.commit("update_selected_itemsubgroupname",groups[0].childrens[0].fulltitle)
|
||||
prm.groupid = 3
|
||||
prm.subgroupid = 0
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async upload(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
|
||||
let resp= await api.upload(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,
|
||||
error:resp.data.errors.error
|
||||
}
|
||||
context.commit("update_uploaded_files",data.records)
|
||||
|
||||
var msg = "Photo telah berhasil diupload"
|
||||
if(data.error){
|
||||
msg = data.error
|
||||
context.commit("update_current_status",'STATUS_FAILED')
|
||||
}
|
||||
else{
|
||||
context.commit("update_current_status",'STATUS_SUCCESS')
|
||||
}
|
||||
|
||||
context.commit("update_msg_info",msg)
|
||||
context.commit("update_open_dialog_info",true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async doaction(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.doaction(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_details", [])
|
||||
context.commit("update_dialog_action",false)
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async deletephoto(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.deletephoto(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_act",'-')
|
||||
context.commit("update_dialog_confirmation_delete",false)
|
||||
context.commit("update_selected_photo",{})
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async getdoctoraddress(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getdoctoraddress(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_doctor_address",data.records)
|
||||
context.commit("update_selected_doctor_address",{})
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async getordersamples(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getordersamples(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_details",data.records)
|
||||
context.commit("update_selected_detail",{})
|
||||
}
|
||||
} 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_selected_transaction",{})
|
||||
context.commit("update_details",[])
|
||||
context.commit("update_selected_detail",{})
|
||||
context.commit("update_selected_doctor",{})
|
||||
context.commit("update_selected_doctor_address",{})
|
||||
context.commit("update_selected_courier",{})
|
||||
context.commit("update_trx_date",moment(new Date()).format('YYYY-MM-DD'))
|
||||
context.commit("update_trx_note",'')
|
||||
context.commit("update_act",'new')
|
||||
context.commit("update_dialog_success", true)
|
||||
context.commit("update_last_id", resp.data.id)
|
||||
var msg = "Transaksi penyimpanan " + resp.data.numbering + " berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async deletetrx(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.deletetrx(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_selected_transaction",{})
|
||||
context.commit("update_details",[])
|
||||
context.commit("update_selected_detail",{})
|
||||
context.commit("update_selected_doctor",{})
|
||||
context.commit("update_selected_doctor_address",{})
|
||||
context.commit("update_selected_courier",{})
|
||||
context.commit("update_trx_date",moment(new Date()).format('YYYY-MM-DD'))
|
||||
context.commit("update_trx_note",'')
|
||||
context.commit("update_act",'new')
|
||||
context.commit("update_dialog_confirmation_delete",false)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Transaksi hapus " + prm.trx_numbering + " berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async saveresult(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.saveresult(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_last_id",prm.lastid)
|
||||
context.commit("update_dialog_action",false)
|
||||
var msg = "Order " + prm.trx_numbering + " pemeriksaan <span class='red--text'>"+prm.trx.test_name+"</span> berhasil diupdate dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_dialog_success", true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
530
test/vuex/one-test-physic/modules/sample.js
Normal file
530
test/vuex/one-test-physic/modules/sample.js
Normal file
@@ -0,0 +1,530 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/sample.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
last_id:-1,
|
||||
last_saved_id:-1,
|
||||
x_addr_id:0,
|
||||
act:'new',
|
||||
last_trx:{},
|
||||
act_addr:'new',
|
||||
get_data_status:0,
|
||||
search_trx: 0,
|
||||
search_status: 0,
|
||||
search_error_message: '',
|
||||
start_date:moment(new Date()).format('YYYY-MM-DD'),
|
||||
end_date:moment(new Date()).format('YYYY-MM-DD'),
|
||||
total_transaction: 0,
|
||||
transactions:[],
|
||||
details:[],
|
||||
selected_detai:{},
|
||||
stations:[{id:"NEW",name:"BARU"},{id:"VAL1",name:"VERIFIKASI"},{id:"VAL2",name:"VALIDASI"}],
|
||||
selected_station:{id:"NEW",name:"BARU"},
|
||||
selected_transaction: {},
|
||||
save_status: 0,
|
||||
name_lab:'',
|
||||
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: "",
|
||||
autocomplete_status:0,
|
||||
dialog_form_address: false,
|
||||
errors:[],
|
||||
open_dialog_info:false,
|
||||
msg_info:'',
|
||||
dialog_action:false,
|
||||
msg_action:'',
|
||||
current_status:null,
|
||||
uploaded_files:[],
|
||||
uploaded_error:null,
|
||||
photos:[],
|
||||
selected_photo:{},
|
||||
dialog_image:false,
|
||||
image:'',
|
||||
doctors:[],
|
||||
selected_doctor:{},
|
||||
doctor_address:[],
|
||||
selected_doctor_address:{},
|
||||
trx_date:moment(new Date()).format('YYYY-MM-DD'),
|
||||
couriers:[],
|
||||
selected_courier:{},
|
||||
trx_note:'',
|
||||
item_groups:[{fulltitle:''}],
|
||||
selected_item_group:{fulltitle:''},
|
||||
item_subgroups:[{fulltitle:''}],
|
||||
selected_item_subgroup:{fulltitle:''},
|
||||
selected_itemgroupname:'',
|
||||
selected_itemsubgroupname:'',
|
||||
langs:[]
|
||||
},
|
||||
mutations: {
|
||||
update_x_addr_id(state, val) {
|
||||
state.x_addr_id = val
|
||||
},
|
||||
update_last_id(state, val) {
|
||||
state.last_id = val
|
||||
},
|
||||
update_last_trx(state, val) {
|
||||
state.last_trx = val
|
||||
},
|
||||
update_last_saved_id(state, val) {
|
||||
state.last_saved_id = val
|
||||
},
|
||||
update_act(state, val) {
|
||||
state.act = val
|
||||
},
|
||||
update_start_date(state, val) {
|
||||
state.start_date = val
|
||||
},
|
||||
update_end_date(state, val) {
|
||||
state.end_date = val
|
||||
},
|
||||
update_name_lab(state, val) {
|
||||
state.name_lab = val
|
||||
},
|
||||
update_stations(state, val) {
|
||||
state.stations = val
|
||||
},
|
||||
update_selected_station(state, val) {
|
||||
state.selected_station = 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_transaction(state, val) {
|
||||
state.search_transaction = val
|
||||
},
|
||||
update_transactions(state, data) {
|
||||
state.transactions = data
|
||||
},
|
||||
update_selected_transaction(state, val) {
|
||||
state.selected_transaction = val
|
||||
},
|
||||
update_details(state, data) {
|
||||
state.details = data
|
||||
},
|
||||
update_selected_detail(state, val) {
|
||||
state.selected_detail = 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_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_total_transactions(state, val) {
|
||||
state.total_transactions = val
|
||||
},
|
||||
update_open_dialog_info(state, val) {
|
||||
state.open_dialog_info = val
|
||||
},
|
||||
update_msg_info(state, val) {
|
||||
state.msg_info = val
|
||||
},
|
||||
update_dialog_action(state, val) {
|
||||
state.dialog_action = val
|
||||
},
|
||||
update_msg_action(state, val) {
|
||||
state.msg_action = val
|
||||
},
|
||||
update_current_status(state, val) {
|
||||
state.current_status = val
|
||||
},
|
||||
update_uploaded_files(state, val) {
|
||||
state.uploaded_files = val
|
||||
},
|
||||
update_uploaded_error(state, val) {
|
||||
state.uploaded_error = val
|
||||
},
|
||||
update_photos(state, val) {
|
||||
state.photos = val
|
||||
},
|
||||
update_selected_photo(state, val) {
|
||||
state.selected_photo = val
|
||||
},
|
||||
update_dialog_image(state, val) {
|
||||
state.dialog_image = val
|
||||
},
|
||||
update_image(state, val) {
|
||||
state.image = val
|
||||
},
|
||||
update_doctors(state, val) {
|
||||
state.doctors = val
|
||||
},
|
||||
update_selected_doctor(state, val) {
|
||||
state.selected_doctor = val
|
||||
},
|
||||
update_doctor_address(state, val) {
|
||||
state.doctor_address = val
|
||||
},
|
||||
update_selected_doctor_address(state, val) {
|
||||
state.selected_doctor_address = val
|
||||
},
|
||||
update_trx_date(state, val) {
|
||||
state.trx_date = val
|
||||
},
|
||||
update_couriers(state, val) {
|
||||
state.couriers = val
|
||||
},
|
||||
update_selected_courier(state, val) {
|
||||
state.selected_courier = val
|
||||
},
|
||||
update_trx_note(state, val) {
|
||||
state.trx_note = val
|
||||
},
|
||||
update_item_groups(state, val) {
|
||||
state.item_groups = val
|
||||
},
|
||||
update_select_item_group(state, val) {
|
||||
state.select_item_group = val
|
||||
},
|
||||
update_item_subgroups(state, val) {
|
||||
state.item_subgroups = val
|
||||
},
|
||||
update_select_item_subgroup(state, val) {
|
||||
state.select_item_subgroup = val
|
||||
},
|
||||
update_selected_itemgroupname(state, val) {
|
||||
state.selected_itemgroupname = val
|
||||
},
|
||||
update_selected_itemsubgroupname(state, val) {
|
||||
state.selected_itemsubgroupname = val
|
||||
},
|
||||
update_item_langs(state, val) {
|
||||
state.langs = val
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
async search(context, prm) {
|
||||
context.commit("update_search_transaction", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.search(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_transaction", 3)
|
||||
context.commit("update_search_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_search_transaction", 2)
|
||||
context.commit("update_search_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
var trx = []
|
||||
if(data.records.length > 0){
|
||||
context.commit("update_transactions", resp.data.records)
|
||||
if(prm.lastid === -1 || prm.lastid > data.records.length - 1){
|
||||
trx = resp.data.records[0]
|
||||
}
|
||||
else{
|
||||
trx = resp.data.records[prm.lastid]
|
||||
}
|
||||
context.commit("update_selected_transaction", trx)
|
||||
|
||||
if(!_.isEmpty(trx.details)){
|
||||
context.commit("update_details", trx.details)
|
||||
}
|
||||
else{
|
||||
context.commit("update_details", [])
|
||||
}
|
||||
}
|
||||
else{
|
||||
context.commit("update_transactions", [])
|
||||
context.commit("update_selected_transaction", {})
|
||||
}
|
||||
|
||||
context.commit("update_total_transactions", data.total)
|
||||
context.commit("update_no_save", 0)
|
||||
context.commit("update_act",'edit')
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_transaction", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async getdoctorcouriers(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getdoctorcouriers(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_doctors",data.records['doctors'])
|
||||
context.commit("update_couriers",data.records['couriers'])
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async getgroups(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getgroups(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
|
||||
}
|
||||
var groups = data.records['groups']
|
||||
var langs = data.records['langs']
|
||||
context.commit("update_item_langs",langs)
|
||||
context.commit("update_item_groups",groups)
|
||||
context.commit("update_select_item_group",groups[0])
|
||||
context.commit("update_selected_itemgroupname",groups[0].fulltitle)
|
||||
context.commit("update_item_subgroups",groups[0].childrens)
|
||||
context.commit("update_select_item_subgroup",groups[0].childrens[0])
|
||||
context.commit("update_selected_itemsubgroupname",groups[0].childrens[0].fulltitle)
|
||||
prm.groupid = 3
|
||||
prm.subgroupid = 0
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async upload(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
|
||||
let resp= await api.upload(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,
|
||||
error:resp.data.errors.error
|
||||
}
|
||||
context.commit("update_uploaded_files",data.records)
|
||||
|
||||
var msg = "Photo telah berhasil diupload"
|
||||
if(data.error){
|
||||
msg = data.error
|
||||
context.commit("update_current_status",'STATUS_FAILED')
|
||||
}
|
||||
else{
|
||||
context.commit("update_current_status",'STATUS_SUCCESS')
|
||||
}
|
||||
|
||||
context.commit("update_msg_info",msg)
|
||||
context.commit("update_open_dialog_info",true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async doaction(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.doaction(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_dialog_action",false)
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async deletephoto(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.deletephoto(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_act",'-')
|
||||
context.commit("update_dialog_confirmation_delete",false)
|
||||
context.commit("update_selected_photo",{})
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async getdoctoraddress(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getdoctoraddress(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_doctor_address",data.records)
|
||||
context.commit("update_selected_doctor_address",{})
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async getordersamples(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getordersamples(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_details",data.records)
|
||||
context.commit("update_selected_detail",{})
|
||||
}
|
||||
} 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_selected_transaction",{})
|
||||
context.commit("update_details",[])
|
||||
context.commit("update_selected_detail",{})
|
||||
context.commit("update_selected_doctor",{})
|
||||
context.commit("update_selected_doctor_address",{})
|
||||
context.commit("update_selected_courier",{})
|
||||
context.commit("update_trx_date",moment(new Date()).format('YYYY-MM-DD'))
|
||||
context.commit("update_trx_note",'')
|
||||
context.commit("update_act",'new')
|
||||
context.commit("update_dialog_success", true)
|
||||
context.commit("update_last_id", resp.data.id)
|
||||
var msg = "Transaksi penyimpanan " + resp.data.numbering + " berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async deletetrx(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.deletetrx(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_selected_transaction",{})
|
||||
context.commit("update_details",[])
|
||||
context.commit("update_selected_detail",{})
|
||||
context.commit("update_selected_doctor",{})
|
||||
context.commit("update_selected_doctor_address",{})
|
||||
context.commit("update_selected_courier",{})
|
||||
context.commit("update_trx_date",moment(new Date()).format('YYYY-MM-DD'))
|
||||
context.commit("update_trx_note",'')
|
||||
context.commit("update_act",'new')
|
||||
context.commit("update_dialog_confirmation_delete",false)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Transaksi hapus " + prm.trx_numbering + " berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async saveresult(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.saveresult(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_last_id",prm.lastid)
|
||||
context.commit("update_dialog_action",false)
|
||||
var msg = "Order " + prm.trx_numbering + " pemeriksaan <span class='red--text'>"+prm.trx.test_name+"</span> berhasil diupdate dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_dialog_success", true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
27
test/vuex/one-test-physic/store.js
Normal file
27
test/vuex/one-test-physic/store.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import physic from "./modules/physic.js";
|
||||
import system from "../../../apps/modules/system/system.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
physic: physic,
|
||||
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