Flatten nested repos
This commit is contained in:
0
test/vuex/one-queue-fo/action.js
Normal file
0
test/vuex/one-queue-fo/action.js
Normal file
20
test/vuex/one-queue-fo/api/company.js
Normal file
20
test/vuex/one-queue-fo/api/company.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const URL = "/one-api/mockup/fo/registration/";
|
||||
|
||||
export async function search(search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'company/search',{search:search});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
24
test/vuex/one-queue-fo/api/delivery.js
Normal file
24
test/vuex/one-queue-fo/api/delivery.js
Normal file
@@ -0,0 +1,24 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/fo/registration/";
|
||||
|
||||
export async function search(o_id, p_id, d_id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'delivery/search', { order_id: o_id, patient_id: p_id, doctor_id: d_id });
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
45
test/vuex/one-queue-fo/api/doctor.js
Normal file
45
test/vuex/one-queue-fo/api/doctor.js
Normal file
@@ -0,0 +1,45 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/fo/registration/";
|
||||
|
||||
export async function search(search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'doctor/search', {
|
||||
search: search
|
||||
});
|
||||
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 searchPj() {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'doctor/search_pj', { });
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
24
test/vuex/one-queue-fo/api/language.js
Normal file
24
test/vuex/one-queue-fo/api/language.js
Normal file
@@ -0,0 +1,24 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/fo/registration/";
|
||||
|
||||
export async function search() {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'language/search', { });
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
121
test/vuex/one-queue-fo/api/order.js
Normal file
121
test/vuex/one-queue-fo/api/order.js
Normal file
@@ -0,0 +1,121 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/fo/registration/";
|
||||
|
||||
export async function save(order_id, header, delivery, detail) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'order/save', {
|
||||
order_id: order_id,
|
||||
header: header,
|
||||
delivery: delivery,
|
||||
detail: detail
|
||||
});
|
||||
|
||||
return resp
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function patientSearch(noreg, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/search', {
|
||||
search: search,
|
||||
noreg: noreg
|
||||
});
|
||||
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 doctorSearch(search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'doctor/search', {
|
||||
search: search
|
||||
});
|
||||
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 doctorSearchPj() {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'doctor/search_pj', { });
|
||||
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 languageSearch() {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'language/search', { });
|
||||
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 deliverySearch() {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'delivery/search', { });
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
27
test/vuex/one-queue-fo/api/patient.js
Normal file
27
test/vuex/one-queue-fo/api/patient.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/fo/registration/";
|
||||
|
||||
export async function search(noreg, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/search', {
|
||||
search: search,
|
||||
noreg: noreg
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
26
test/vuex/one-queue-fo/api/patientaddress.js
Normal file
26
test/vuex/one-queue-fo/api/patientaddress.js
Normal file
@@ -0,0 +1,26 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/fo/registration/";
|
||||
|
||||
export async function getAll(id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patientaddress/get_all', {
|
||||
patient_id: id
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
39
test/vuex/one-queue-fo/api/payment.js
Normal file
39
test/vuex/one-queue-fo/api/payment.js
Normal file
@@ -0,0 +1,39 @@
|
||||
const URL = "/one-api/mockup/fo/registration/";
|
||||
|
||||
export async function get_order(id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'payment/get_order',{id:id});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search(search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'payment/search', {search:search});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
74
test/vuex/one-queue-fo/api/px.js
Normal file
74
test/vuex/one-queue-fo/api/px.js
Normal file
@@ -0,0 +1,74 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/fo/registration/";
|
||||
|
||||
export async function search(mouCompanyID,search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'px/search', {
|
||||
search:search,
|
||||
mouCompanyID:mouCompanyID
|
||||
});
|
||||
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 panel(mouCompanyID,search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'px/panel', {
|
||||
search:search,
|
||||
mouCompanyID:mouCompanyID
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function get_price(test_id, mou_id, cito) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'px/get_price', {
|
||||
test_id:test_id,
|
||||
mou_id:mou_id,
|
||||
cito:cito
|
||||
});
|
||||
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
141
test/vuex/one-queue-fo/api/queue.js
Normal file
141
test/vuex/one-queue-fo/api/queue.js
Normal file
@@ -0,0 +1,141 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL = "http://" + window.location.host + ":9090/";
|
||||
|
||||
export async function loadx(serviceid) {
|
||||
try {
|
||||
var resp = await axios.get(URL + 'list/'+serviceid);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function loadservice() {
|
||||
try {
|
||||
var resp = await axios.get(URL + 'list_service');
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function docall(numbx) {
|
||||
try {
|
||||
var resp = await axios.get(URL + 'call/'+numbx);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function dorecall(numbx) {
|
||||
try {
|
||||
var resp = await axios.get(URL + 'recall/'+numbx);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function doserve(numbx) {
|
||||
try {
|
||||
var resp = await axios.get(URL + 'serve/'+numbx);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function dodone(numbx) {
|
||||
try {
|
||||
var resp = await axios.get(URL + 'done/'+numbx);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function doskip(numbx) {
|
||||
try {
|
||||
var resp = await axios.get(URL + 'skip/'+numbx);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
23
test/vuex/one-queue-fo/api/summary.js
Normal file
23
test/vuex/one-queue-fo/api/summary.js
Normal file
@@ -0,0 +1,23 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL = "http://" + window.location.host + ":9090/";
|
||||
|
||||
export async function loadx() {
|
||||
try {
|
||||
var resp = await axios.get(URL + 'info');
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
190
test/vuex/one-queue-fo/components/oneQueueFo.vue
Normal file
190
test/vuex/one-queue-fo/components/oneQueueFo.vue
Normal file
@@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<v-layout column fill-height>
|
||||
<one-dialog-info :status="xinfo" :msg="xmsginfo" @close-dialog-info="closeInfo()"></one-dialog-info>
|
||||
|
||||
<v-toolbar class="pa-1 mb-2" color="blue lighten-3" dark height="60px">
|
||||
<v-toolbar-title>DAFTAR ANTRIAN</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-select
|
||||
|
||||
item-text="serviceName"
|
||||
return-object
|
||||
:items="xservices"
|
||||
v-model="xservice"
|
||||
label="Layanan"
|
||||
></v-select>
|
||||
</v-toolbar>
|
||||
|
||||
|
||||
<v-card class="pa-1 p-left-side grow" grow>
|
||||
<v-card-text class="pa-0 mb-5">
|
||||
<v-layout row wrap>
|
||||
|
||||
<v-flex >
|
||||
<v-data-table :headers="headers" :items="xqueues" :loading="isLoading" hide-actions class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td :class="redClass(props.item)" style="text-align:left" v-bind:class="{'amber lighten-4':props.item.selected}">{{ getTime(props.item.queueCreated) }}</td>
|
||||
<td :class="redClass(props.item)" v-bind:class="{'amber lighten-4':props.item.selected}">{{ props.item.serviceName }}</td>
|
||||
<td :class="redClass(props.item)" v-bind:class="{'amber lighten-4':props.item.selected}">{{ props.item.queueNumber }}</td>
|
||||
<td :class="redClass(props.item)" v-bind:class="{'amber lighten-4':props.item.selected}">{{ props.item.statusName }}</td>
|
||||
<td :class="redClass(props.item)" class="justify-center layout px-0">
|
||||
<v-btn v-if="props.item.statusName !== 'Queue Called' && props.item.statusName !== 'Queue Recall'" title="Panggil" @click="doCall(props.item.queueNumber)" flat icon color="warning">
|
||||
<v-icon>mic</v-icon>
|
||||
</v-btn>
|
||||
<v-btn v-if="props.item.statusName === 'Queue Called' || props.item.statusName === 'Queue Recall'" title="Panggil Ulang" @click="doRecall(props.item.queueNumber)" flat icon color="brown">
|
||||
<v-icon>mic</v-icon>
|
||||
</v-btn>
|
||||
<v-btn title="Proses" @click="doServe(props.item.queueNumber)" flat icon color="info">
|
||||
<v-icon>account_box</v-icon>
|
||||
</v-btn>
|
||||
<v-btn title="Skip" @click="doSkip(props.item.queueNumber)" flat icon color="red">
|
||||
<v-icon>skip_next</v-icon>
|
||||
</v-btn>
|
||||
<v-btn title="Selesai" @click="doDone(props.item.queueNumber)" flat icon color="success">
|
||||
<v-icon>done</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
|
||||
|
||||
</v-card>
|
||||
</v-layout>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
table.v-table tbody td,table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
.v-input__slot{
|
||||
margin-bottom:0;
|
||||
}
|
||||
td.isRed {
|
||||
color: #e63900;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-dialog-info':httpVueLoader('../../common/oneDialogInfo.vue'),
|
||||
'one-dialog-alert':httpVueLoader('../../common/oneDialogAlert.vue')
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("queue/loadx",{serviceid:0})
|
||||
this.$store.dispatch("queue/loadservice")
|
||||
},
|
||||
methods : {
|
||||
redClass(que) {
|
||||
let cls = { 'isRed' : false }
|
||||
if ( que.queueIsRed == 'Y' ) {
|
||||
cls = { 'isRed' : true}
|
||||
}
|
||||
return cls
|
||||
},
|
||||
getTime(val){
|
||||
//return moment(val).fromNow()
|
||||
return moment(val).format("HH:mm")
|
||||
},
|
||||
doCall(numbx){
|
||||
this.$store.dispatch("queue/docall",{number:numbx})
|
||||
},
|
||||
doRecall(numbx){
|
||||
this.$store.dispatch("queue/dorecall",{number:numbx})
|
||||
},
|
||||
doServe(numbx){
|
||||
this.$store.dispatch("queue/doserve",{number:numbx})
|
||||
},
|
||||
doDone(numbx){
|
||||
this.$store.dispatch("queue/dodone",{number:numbx})
|
||||
},
|
||||
doSkip(numbx){
|
||||
this.$store.dispatch("queue/doskip",{number:numbx})
|
||||
},
|
||||
closeInfo(){
|
||||
this.$store.commit("queue/update_info",false)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
xqueues(){
|
||||
return this.$store.state.queue.queues
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.queue.load_queue == 1
|
||||
},
|
||||
xinfo(){
|
||||
return this.$store.state.queue.info
|
||||
},
|
||||
xmsginfo(){
|
||||
return this.$store.state.queue.msg_info
|
||||
},
|
||||
xservices(){
|
||||
return this.$store.state.queue.services
|
||||
},
|
||||
xservice : {
|
||||
get() {
|
||||
return this.$store.state.queue.selected_service
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("queue/update_selected_service",val)
|
||||
this.$store.dispatch("queue/loadx",{serviceid:val.serviceID})
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
headers: [
|
||||
{
|
||||
text: "Jam",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: " blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "Layanan",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "25%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "No Antrian",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "5%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "Status",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "10%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "Action",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "5%",
|
||||
class: "blue lighten-4"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
128
test/vuex/one-queue-fo/components/oneQueueStatus.vue
Normal file
128
test/vuex/one-queue-fo/components/oneQueueStatus.vue
Normal file
@@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<v-layout column fill-height>
|
||||
|
||||
|
||||
<v-toolbar class="pa-1 mb-2" color="blue lighten-3" dark height="60px">
|
||||
<v-toolbar-title>STATUS ANTRIAN</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
</v-toolbar>
|
||||
|
||||
|
||||
<v-card class="pa-1 p-left-side grow" grow>
|
||||
<v-card-text class="pa-0">
|
||||
<v-layout row wrap>
|
||||
|
||||
<v-flex >
|
||||
<v-data-table :headers="headers" :items="xsummaries" :loading="isLoading" hide-actions class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.serviceName }}</td>
|
||||
<td style="text-align:center" v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.total_queue }}</td>
|
||||
<td style="text-align:center" v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.total_queue - props.item.total_served }}</td>
|
||||
</template>
|
||||
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<v-progress-circular
|
||||
v-if="false"
|
||||
:rotate="360"
|
||||
:size="100"
|
||||
:width="15"
|
||||
:value="persentase"
|
||||
color="teal"
|
||||
>
|
||||
{{ value }}
|
||||
</v-progress-circular>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
|
||||
|
||||
</v-card>
|
||||
</v-layout>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
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() {
|
||||
|
||||
},
|
||||
methods : {
|
||||
getTime(val){
|
||||
return moment(val).format("HH:mm")
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
persentase(){
|
||||
var total = 0
|
||||
var sisa = 0
|
||||
var alldata = this.$store.state.summary.summaries
|
||||
/*
|
||||
_.forEach(alldata, function(value) {
|
||||
total += total + value.total_queue
|
||||
sisa += sisa + value.total_served
|
||||
})
|
||||
return (sisa/total) * 100
|
||||
*/
|
||||
},
|
||||
xsummaries(){
|
||||
return this.$store.state.summary.summaries
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.summary.load_summary == 1
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
headers: [
|
||||
{
|
||||
text: "Layanan",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "25%",
|
||||
class: " blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "Total Antrian",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "Sisa Antrian",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "10%",
|
||||
class: "blue lighten-4"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
138
test/vuex/one-queue-fo/components/queueNumbering.vue
Normal file
138
test/vuex/one-queue-fo/components/queueNumbering.vue
Normal file
@@ -0,0 +1,138 @@
|
||||
<template>
|
||||
<v-layout column fill-height>
|
||||
|
||||
|
||||
<v-toolbar class="pa-1 mb-2" color="blue lighten-3" dark height="50px">
|
||||
<v-toolbar-title>NUMBERING</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn icon>
|
||||
<v-icon>library_add</v-icon>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
|
||||
|
||||
<v-card class="pa-1 p-left-side grow" grow>
|
||||
<v-card-text class="pa-0">
|
||||
<v-layout row wrap>
|
||||
|
||||
<v-flex xs12>
|
||||
<v-data-table :headers="headers" :items="patients" :loading="isLoading" hide-actions class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.service }}</td>
|
||||
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.prefix }}</td>
|
||||
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.date }}</td>
|
||||
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.digit }}</td>
|
||||
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.sufix }}</td>
|
||||
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.counter }}</td>
|
||||
<td v-bind:class="{'amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.reset }}</td>
|
||||
<td class="justify-center layout px-0">
|
||||
<v-icon small class="mr-2" @click="editItem(props.item)" > edit </v-icon>
|
||||
<v-icon small @click="deleteItem(props.item)" > delete </v-icon> </td>
|
||||
</template>
|
||||
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
|
||||
|
||||
</v-card>
|
||||
</v-layout>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
table.v-table tbody td,table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
query: "",
|
||||
items: [],
|
||||
headers: [
|
||||
{
|
||||
text: "Service Name",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: " blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "Prefix",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "15%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "Prefix Date",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "Digit",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "Sufix",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "Counter",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "Reset",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "Action",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "blue lighten-4"
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
isLoading: true,
|
||||
patients: [
|
||||
{"service":"Antrian Umum","prefix":"001", "date": "%y%m", "digit": "6", "sufix": "1", "counter": "100", "reset": "D","action":""},
|
||||
{"service":"Antrian Perusahaan","prefix":"001", "date": "%y%m", "digit": "6", "sufix": "1", "counter": "100", "reset": "D","action":""},
|
||||
{"service":"Ambil Hasil","prefix":"001", "date": "%y%m", "digit": "6", "sufix": "1", "counter": "100", "reset": "D","action":""} ]
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
90
test/vuex/one-queue-fo/fajri.php
Normal file
90
test/vuex/one-queue-fo/fajri.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>One</title>
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/google-fonts.css">
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/vuetify.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div v-cloak id="app">
|
||||
<v-app id="smartApp" >
|
||||
<one-navbar>
|
||||
</one-navbar>
|
||||
<v-content class="blue lighten-5" >
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap >
|
||||
<v-flex xs6 class="left" fill-height pa-1>
|
||||
<!-- komponen kiri -->
|
||||
<one-mou-px-left></one-mou-px-left>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs6 class="right" fill-height pa-1>
|
||||
<!-- komponen kanan -->
|
||||
<one-fo-registration-price-list></one-fo-registration-price-list>
|
||||
</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>
|
||||
<!-- App Script -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
function one_money(inp) {
|
||||
return numeral(inp).format('0,000.00')
|
||||
}
|
||||
window.one_money = one_money
|
||||
function one_float(inp) {
|
||||
try {
|
||||
let val = parseFloat(inp)
|
||||
if (isNaN(val)) return 0.0
|
||||
return val
|
||||
} catch(e) {
|
||||
return 0.0
|
||||
}
|
||||
}
|
||||
window.one_float = one_float
|
||||
|
||||
import { store } from './store.js<?php echo $ts ?>';
|
||||
//for testing
|
||||
window.store = store;
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-mou-px-left' : httpVueLoader('./components/oneMouPxLeft.vue'),
|
||||
'one-fo-registration-price-list' : httpVueLoader('./components/oneFoRegistrationPriceList.vue?ts='
|
||||
+ new Date().toISOString())
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
105
test/vuex/one-queue-fo/index.php
Normal file
105
test/vuex/one-queue-fo/index.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>One</title>
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/google-fonts.css">
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/vuetify.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div v-cloak id="app">
|
||||
<v-app id="smartApp" >
|
||||
<one-navbar></one-navbar>
|
||||
<br/>
|
||||
<v-content class="blue lighten-5 one" >
|
||||
<v-container fluid pt-2 pb-2 pl-1 pr-1>
|
||||
<v-layout row wrap >
|
||||
<v-flex xs8 class="left" fill-height pa-1>
|
||||
<one-queue-fo></one-queue-fo>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs4 class="right" fill-height pa-1>
|
||||
<one-queue-status></one-queue-status>
|
||||
</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/vendor/socket.io.js"></script>
|
||||
|
||||
<script src="../../../libs/one_global.js"></script>
|
||||
<!-- App Script -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
|
||||
|
||||
import { store } from './store.js<?php echo $ts ?>';
|
||||
|
||||
//for testing
|
||||
window.store = store;
|
||||
let g_timeout = 0;
|
||||
|
||||
var socketIoUrl = "http://" + window.location.host + ":9090/";
|
||||
new Vue({
|
||||
store,
|
||||
data : {
|
||||
socket : io.connect(socketIoUrl,{forceNew:false})
|
||||
},
|
||||
mounted: async function() {
|
||||
this.socket.on("notification", function(msg) {
|
||||
switch(msg.type) {
|
||||
case "reload-fo" :
|
||||
store.dispatch("queue/loadx",{serviceid:0});
|
||||
if (g_timeout > 0 ) clearTimeout(g_timeout);
|
||||
g_timeout = setTimeout(function() {
|
||||
store.dispatch("queue/loadx",{serviceid:0});
|
||||
},60000);
|
||||
break;
|
||||
}
|
||||
});
|
||||
},
|
||||
computed : {
|
||||
tab_active () {
|
||||
return store.state.tab_active
|
||||
}
|
||||
},
|
||||
el: '#app',
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-queue-fo': httpVueLoader('./components/oneQueueFo.vue'),
|
||||
'one-queue-status': httpVueLoader('./components/oneQueueStatus.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
main {
|
||||
padding:40px 0px 0px !important;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
72
test/vuex/one-queue-fo/modules/company.js
Normal file
72
test/vuex/one-queue-fo/modules/company.js
Normal file
@@ -0,0 +1,72 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/company.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
search: '',
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
companies: [],
|
||||
total_company: 0,
|
||||
selected_company: {},
|
||||
selected_mou: {},
|
||||
|
||||
selected_px_tab: 'px'
|
||||
},
|
||||
mutations: {
|
||||
update_selected_px_tab(state,tab) {
|
||||
state.selected_px_tab = tab
|
||||
},
|
||||
|
||||
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
update_selected_mou(state,val) {
|
||||
state.selected_mou = val
|
||||
},
|
||||
update_search(state,val) {
|
||||
state.search=val
|
||||
},
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
update_companies(state,data) {
|
||||
state.companies= data.records
|
||||
state.total_company= data.total
|
||||
},
|
||||
update_selected_company(state,val) {
|
||||
console.log('company aaaaa')
|
||||
console.log('1:'+JSON.stringify(store.state.company.selected_company))
|
||||
state.selected_company=val
|
||||
console.log('2:'+JSON.stringify(store.state.company.selected_company))
|
||||
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context,prm) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
let resp= await api.search(context.state.search)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_companies",data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
83
test/vuex/one-queue-fo/modules/delivery.js
Normal file
83
test/vuex/one-queue-fo/modules/delivery.js
Normal file
@@ -0,0 +1,83 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/delivery.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
deliveries: [],
|
||||
patient_id: 0,
|
||||
doctor_id: 0,
|
||||
order_id: 0,
|
||||
|
||||
checked_id: []
|
||||
},
|
||||
mutations: {
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
update_deliveries(state,data) {
|
||||
for (var i in data) {
|
||||
if (state.checked_id.indexOf(data[i].idx) > -1)
|
||||
data[i].selected = true
|
||||
else
|
||||
data[i].selected = false
|
||||
}
|
||||
|
||||
state.deliveries = data
|
||||
},
|
||||
update_deliveries_2(state) {
|
||||
for (var i in state.deliveries) {
|
||||
if (state.checked_id.indexOf(state.deliveries[i].idx) > -1)
|
||||
state.deliveries[i].selected = true
|
||||
else
|
||||
state.deliveries[i].selected = false
|
||||
}
|
||||
// state.deliveries= data
|
||||
},
|
||||
update_selected_delivery(state,val) {
|
||||
state.selected_delivery=val
|
||||
},
|
||||
update_params(state, val) {
|
||||
if (val.p_id)
|
||||
state.patient_id = val.p_id;
|
||||
if (val.o_id)
|
||||
state.order_id = val.o_id;
|
||||
if (val.d_id)
|
||||
state.doctor_id = val.d_id;
|
||||
},
|
||||
update_checked_id(state, val) {
|
||||
state.checked_id = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
let resp= await api.search(store.state.delivery.order_id,
|
||||
store.state.delivery.patient_id,
|
||||
store.state.delivery.doctor_id)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
records : resp.data.records
|
||||
}
|
||||
context.commit("update_deliveries",data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
test/vuex/one-queue-fo/modules/doctor.js
Normal file
120
test/vuex/one-queue-fo/modules/doctor.js
Normal file
@@ -0,0 +1,120 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/doctor.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
search : '',
|
||||
search_status: 0,
|
||||
search_error_message: "",
|
||||
doctors: [],
|
||||
total_doctor: 0,
|
||||
selected_doctor: {},
|
||||
selected_address: {},
|
||||
|
||||
doctors_pj: [],
|
||||
selected_doctor_pj : {},
|
||||
search_pj_status: 0,
|
||||
search_pj_error_message: "",
|
||||
|
||||
mounted: 0
|
||||
},
|
||||
mutations: {
|
||||
update_search(state,val) {
|
||||
state.search=val
|
||||
},
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
update_doctors(state,data) {
|
||||
state.doctors = data.records
|
||||
state.total_doctor= data.total
|
||||
},
|
||||
update_selected_doctor(state,doc) {
|
||||
state.selected_doctor= doc
|
||||
|
||||
if (!doc) return
|
||||
if (doc.address.length> 0) {
|
||||
state.selected_address = doc.address[0]
|
||||
} else {
|
||||
state.selected_address = {}
|
||||
}
|
||||
},
|
||||
update_selected_address(state,addr) {
|
||||
state.selected_address = addr
|
||||
},
|
||||
update_search_pj_error_message(state,status) {
|
||||
state.search_pj_error_message = status
|
||||
},
|
||||
update_search_pj_status(state,status) {
|
||||
state.search_pj_status = status
|
||||
},
|
||||
update_doctors_pj(state,data) {
|
||||
state.doctors_pj = data.records
|
||||
let flag_found = false
|
||||
data.records.forEach(function(d) {
|
||||
if (d.M_DoctorIsDefaultPJ == 'Y' ) {
|
||||
state.selected_doctor_pj = d
|
||||
flag_found = true
|
||||
}
|
||||
})
|
||||
if (! flag_found & data.records.length > 0 ) state.selected_doctor_pj = data.records[0]
|
||||
},
|
||||
update_selected_doctor_pj(state,doc) {
|
||||
state.selected_doctor_pj = doc
|
||||
},
|
||||
|
||||
increment_mounted(state, n) {
|
||||
state.mounted = state.mounted + n;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search_pj(context) {
|
||||
context.commit("update_search_pj_status",1)
|
||||
try {
|
||||
let resp= await api.searchPj()
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_pj_status",3)
|
||||
context.commit("update_search_pj_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_pj_status",2)
|
||||
context.commit("update_search_pj_error_message","")
|
||||
let data = {
|
||||
total : resp.data.total,
|
||||
records : resp.data.records
|
||||
}
|
||||
context.commit("update_doctors_pj",data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_pj_status",3)
|
||||
context.commit("update_search_pj_error_message",e.message )
|
||||
}
|
||||
},
|
||||
async search(context) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
let resp= await api.search(context.state.search)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
total : resp.data.total,
|
||||
records : resp.data.records
|
||||
}
|
||||
context.commit("update_doctors",data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
51
test/vuex/one-queue-fo/modules/language.js
Normal file
51
test/vuex/one-queue-fo/modules/language.js
Normal file
@@ -0,0 +1,51 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/language.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
languages: [],
|
||||
selected_language: {},
|
||||
},
|
||||
mutations: {
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
update_languages(state,data) {
|
||||
state.languages= data.records
|
||||
if (data.records.length > 0) state.selected_language = data.records[0]
|
||||
},
|
||||
update_selected_language(state,val) {
|
||||
state.selected_language=val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
let resp= await api.search()
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
records : resp.data.records
|
||||
}
|
||||
context.commit("update_languages",data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
112
test/vuex/one-queue-fo/modules/order.js
Normal file
112
test/vuex/one-queue-fo/modules/order.js
Normal file
@@ -0,0 +1,112 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/order.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
catatan_fo:'',
|
||||
diagnosa:'',
|
||||
patient_note: '',
|
||||
|
||||
finish_dialog_is_active: false,
|
||||
current_order: {},
|
||||
|
||||
received_sample: 'N'
|
||||
},
|
||||
mutations: {
|
||||
update_patient_note(state,val) {
|
||||
state.patient_note=val
|
||||
},
|
||||
update_catatan_fo(state,val) {
|
||||
state.catatan_fo=val
|
||||
},
|
||||
update_diagnosa(state,val) {
|
||||
state.diagnosa=val
|
||||
},
|
||||
update_finish_dialog_is_active(state, val) {
|
||||
state.finish_dialog_is_active = val
|
||||
},
|
||||
update_current_order(state, val) {
|
||||
state.current_order = val
|
||||
},
|
||||
|
||||
update_received_sample(state, val) {
|
||||
state.received_sample = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async save(context) {
|
||||
var order_id = 0;
|
||||
var delivery = [];
|
||||
var detail = [];
|
||||
var header = {
|
||||
patient_id: context.rootState.patient.selected_patient.M_PatientID,
|
||||
age: context.rootState.patient.selected_patient.patient_age,
|
||||
sender_doctor_id: context.rootState.doctor.selected_doctor.M_DoctorID,
|
||||
sender_address_id: context.rootState.doctor.selected_address.M_DoctorAddressID,
|
||||
pj_doctor_id: context.rootState.doctor.selected_doctor_pj.M_DoctorID,
|
||||
lang_id: context.rootState.language.selected_language.id,
|
||||
doctor_note: "",
|
||||
fo_note: "",
|
||||
company_id: context.rootState.company.selected_company.M_CompanyID,
|
||||
mou_id: context.rootState.company.selected_mou.M_MouID,
|
||||
received_sample: context.rootState.order.received_sample
|
||||
};
|
||||
|
||||
let dlv = context.rootState.delivery.deliveries
|
||||
for (var i in dlv) {
|
||||
if (dlv[i].selected == true) {
|
||||
let e = dlv[i].idx.split('-')
|
||||
delivery.push({
|
||||
delivery_id:e[0],
|
||||
delivery_type_id:e[1],
|
||||
address_id:e[2],
|
||||
note:dlv[i].note
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var px_tmp = [];
|
||||
var st = context.rootState.px.selected_test;
|
||||
for (var i in st) {
|
||||
px_tmp.push({
|
||||
t_id: st[i]['T_PriceID'],
|
||||
t_price: st[i]['T_PriceAmount'],
|
||||
t_disc: st[i]['T_PriceDisc'],
|
||||
t_discrp: st[i]['T_PriceDiscRp'],
|
||||
t_cito: st[i]['T_TestIsCito']
|
||||
})
|
||||
}
|
||||
|
||||
detail = px_tmp;
|
||||
|
||||
console.log(header);
|
||||
console.log(delivery)
|
||||
|
||||
// context.commit("update_search_status",1)
|
||||
try {
|
||||
let resp= await api.save(0, header, delivery, detail)
|
||||
|
||||
if (resp.status != "200") {
|
||||
// context.commit("update_search_status",3)
|
||||
// context.commit("update_search_error_message",resp.message)
|
||||
alert('error')
|
||||
} else {
|
||||
|
||||
context.commit("update_current_order", resp.data.data)
|
||||
context.commit('update_finish_dialog_is_active', true)
|
||||
|
||||
context.commit('payment/update_order_id', resp.data.data.id, {root:true})
|
||||
context.dispatch('payment/get_order', resp.data.data.id, {root:true})
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
// context.commit("update_search_status",3)
|
||||
// context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
82
test/vuex/one-queue-fo/modules/patient.js
Normal file
82
test/vuex/one-queue-fo/modules/patient.js
Normal file
@@ -0,0 +1,82 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/patient.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
noreg:'',
|
||||
search: '',
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
search_dialog_is_active: false,
|
||||
patients: [],
|
||||
total_patient: 0,
|
||||
total_display: 0,
|
||||
selected_patient: {},
|
||||
},
|
||||
mutations: {
|
||||
update_search_dialog_is_active(state,status) {
|
||||
state.search_dialog_is_active = status
|
||||
},
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
update_noreg(state,val) {
|
||||
state.noreg=val
|
||||
},
|
||||
update_search(state,val) {
|
||||
state.search=val
|
||||
},
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
update_patients(state,data) {
|
||||
state.patients= data.records
|
||||
state.total_patient = data.total
|
||||
state.total_display = data.total_display
|
||||
},
|
||||
update_selected_patient(state,val) {
|
||||
var now = moment(new Date())
|
||||
var dob = moment(new Date(val.M_PatientDOB))
|
||||
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)) val.patient_age = ''
|
||||
else val.patient_age = `${year} tahun ${month} bulan ${day} hari`
|
||||
|
||||
state.selected_patient=val
|
||||
// store.state.patientaddress.patient_id = val.M_PatientID
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context,prm) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
let resp= await api.search(context.state.noreg,context.state.search)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_display: resp.data.total_display
|
||||
}
|
||||
context.commit("update_patients",data)
|
||||
|
||||
// commit("patientaddress/test", "X", { root: true })
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
86
test/vuex/one-queue-fo/modules/patientaddress.js
Normal file
86
test/vuex/one-queue-fo/modules/patientaddress.js
Normal file
@@ -0,0 +1,86 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/patientaddress.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
noreg:'',
|
||||
search: '',
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
search_dialog_is_active: false,
|
||||
patients: [],
|
||||
total_patient: 0,
|
||||
total_display: 0,
|
||||
selected_patient: {},
|
||||
|
||||
address: [],
|
||||
patient_id: 0
|
||||
},
|
||||
mutations: {
|
||||
update_search_dialog_is_active(state,status) {
|
||||
state.search_dialog_is_active = status
|
||||
},
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
update_noreg(state,val) {
|
||||
state.noreg=val
|
||||
},
|
||||
update_search(state,val) {
|
||||
state.search=val
|
||||
},
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
update_patients(state,data) {
|
||||
state.patients= data.records
|
||||
state.total_patient = data.total
|
||||
state.total_display = data.total_display
|
||||
},
|
||||
update_selected_patient(state,val) {
|
||||
state.selected_patient=val
|
||||
},
|
||||
|
||||
update_address(state, val) {
|
||||
state.address = val;
|
||||
},
|
||||
|
||||
testx(state, val) {
|
||||
state.patient_id = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context,prm) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
let resp= await api.getAll(context.state.patient_id)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = resp.data;
|
||||
context.commit("update_address",data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async loadAddress(context, prm) {
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
tests (a) {
|
||||
alert(a)
|
||||
}
|
||||
}
|
||||
}
|
||||
107
test/vuex/one-queue-fo/modules/payment.js
Normal file
107
test/vuex/one-queue-fo/modules/payment.js
Normal file
@@ -0,0 +1,107 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/payment.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
order_id: 0,
|
||||
|
||||
selected_patient: {
|
||||
order_no: '-',
|
||||
order_date: '-',
|
||||
order_mou: '-',
|
||||
order_company: '-',
|
||||
patient_name: '-',
|
||||
patient_mr: '-',
|
||||
doctor_sender: '-',
|
||||
doctor_pj: '-'
|
||||
},
|
||||
|
||||
order_detail: [
|
||||
// { n:1, d_id:1, t_id:1, t_name:'SGOT', t_price:80000, t_disctotal:7000, t_total:73000 },
|
||||
// { n:2, d_id:2, t_id:2, t_name:'SGPT', t_price:75000, t_disctotal:8000, t_total:67000 }
|
||||
],
|
||||
|
||||
order_subtotal: 0,
|
||||
order_rounding: 0,
|
||||
order_total: 0,
|
||||
|
||||
payment_cash_amount: 0,
|
||||
payment_debit_amount: 0,
|
||||
payment_credit_amount: 0,
|
||||
|
||||
payments: []
|
||||
},
|
||||
mutations: {
|
||||
update_order (state, data) {
|
||||
state.selected_patient = data.order_header
|
||||
state.order_detail = data.order_detail
|
||||
|
||||
state.order_subtotal = data.order_header.order_subtotal
|
||||
state.order_rounding = data.order_header.order_rounding
|
||||
state.order_total = data.order_header.order_total
|
||||
},
|
||||
|
||||
update_order_id (state, id) {
|
||||
state.order_id = id
|
||||
},
|
||||
|
||||
update_payment(state, o) {
|
||||
if (o.type == 'cash')
|
||||
state.payment_cash_amount = o.amount
|
||||
if (o.type == 'debit')
|
||||
state.payment_debit_amount = o.amount
|
||||
if (o.type == 'credit')
|
||||
state.payment_credit_amount = o.amount
|
||||
},
|
||||
|
||||
update_payments(state, o) {
|
||||
state.payments = o
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async get_order(context, prm) {
|
||||
// context.commit("update_search_status",1)
|
||||
try {
|
||||
let resp= await api.get_order(prm)
|
||||
if (resp.status != "OK") {
|
||||
// context.commit("update_search_status",3)
|
||||
// context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
// context.commit("update_search_status",2)
|
||||
// context.commit("update_search_error_message","")
|
||||
let data = resp.data.data
|
||||
context.commit("update_order", data)
|
||||
|
||||
// commit("patientaddress/test", "X", { root: true })
|
||||
}
|
||||
} catch(e) {
|
||||
// context.commit("update_search_status",3)
|
||||
// context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async search(context, prm) {
|
||||
// context.commit("update_search_status",1)
|
||||
try {
|
||||
let resp= await api.search(prm)
|
||||
if (resp.status != "OK") {
|
||||
// context.commit("update_search_status",3)
|
||||
// context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
// context.commit("update_search_status",2)
|
||||
// context.commit("update_search_error_message","")
|
||||
let data = resp.data
|
||||
context.commit("update_payments", data)
|
||||
|
||||
// commit("patientaddress/test", "X", { root: true })
|
||||
}
|
||||
} catch(e) {
|
||||
// context.commit("update_search_status",3)
|
||||
// context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
250
test/vuex/one-queue-fo/modules/px.js
Normal file
250
test/vuex/one-queue-fo/modules/px.js
Normal file
@@ -0,0 +1,250 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/px.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
search: '',
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
tests: [],
|
||||
total_test: 0,
|
||||
selected_test: [],
|
||||
|
||||
search_panel: '',
|
||||
search_panel_status:0,
|
||||
panels: [],
|
||||
total_panel: 0,
|
||||
selected_panel: [],
|
||||
requirement: [],
|
||||
|
||||
cito: {test:[], panel:[]}
|
||||
},
|
||||
mutations: {
|
||||
update_requirement(state,val) {
|
||||
state.requirement = val
|
||||
},
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
update_selected_test(state,val) {
|
||||
// if (state.cito.length > 0) {
|
||||
for (var i in val) {
|
||||
val[i]['T_TestIsCito'] = 'N'
|
||||
if (state.cito.test.indexOf(val[i]['T_TestID']) > -1)
|
||||
val[i]['T_TestIsCito'] = 'Y'
|
||||
}
|
||||
// }
|
||||
|
||||
state.selected_test = val
|
||||
},
|
||||
update_mouCompanyID(state,val) {
|
||||
state.mouCompanyID=val
|
||||
},
|
||||
update_search(state,val) {
|
||||
state.search=val
|
||||
},
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
update_tests(state,data) {
|
||||
state.tests= data.records
|
||||
state.total_test= data.total
|
||||
},
|
||||
update_search_panel(state,val) {
|
||||
state.search_panel=val
|
||||
},
|
||||
update_search_panel_status(state,status) {
|
||||
state.search_panel_status = status
|
||||
},
|
||||
update_panels(state,data) {
|
||||
console.log('--comit--',data)
|
||||
state.panels = data.records
|
||||
state.total_panel = data.total
|
||||
},
|
||||
update_selected_panel(state,val) {
|
||||
state.selected_panel= val
|
||||
},
|
||||
|
||||
update_cito(state, val) {
|
||||
let test = state.selected_test
|
||||
// if (val.length > 0) {
|
||||
|
||||
for (var i in test) {
|
||||
test[i]['T_TestIsCito'] = 'N'
|
||||
if (val.v.indexOf(test[i]['T_TestID']) > -1)
|
||||
test[i]['T_TestIsCito'] = 'Y'
|
||||
}
|
||||
// }
|
||||
|
||||
state.cito[val.t] = val.v
|
||||
state.selected_test = test
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
delete_px (context, test) {
|
||||
let sel = context.state.selected_test
|
||||
sel.forEach(function(t, idx) {
|
||||
if(t.T_PriceID == test.T_PriceID) {
|
||||
sel.splice(idx,1)
|
||||
}
|
||||
});
|
||||
|
||||
context.commit("update_selected_test", sel)
|
||||
let tests = context.state.tests
|
||||
if (tests == undefined ) tests = []
|
||||
tests.push(test)
|
||||
|
||||
let dt = {
|
||||
records : tests,
|
||||
total: tests.length
|
||||
}
|
||||
|
||||
context.commit("update_tests", dt)
|
||||
context.dispatch("update_req", null)
|
||||
},
|
||||
|
||||
update_req(context, px) {
|
||||
|
||||
let reqs = []
|
||||
let tests = context.state.selected_test
|
||||
tests.forEach( function(t) {
|
||||
let label = t.T_TestRequirement
|
||||
if (_.indexOf(reqs,label) == -1 ) reqs.push(label)
|
||||
})
|
||||
|
||||
let panels = context.state.selected_panel
|
||||
panels.forEach( function(p) {
|
||||
let tests = p.test
|
||||
tests.forEach( function(t) {
|
||||
let label = t.T_TestRequirement
|
||||
if (_.indexOf(reqs,label) == -1 ) reqs.push(label)
|
||||
})
|
||||
})
|
||||
|
||||
let requirement = context.state.requirement
|
||||
let flag_update_requirement = false
|
||||
if (reqs.length == 0 ) {
|
||||
requirement = []
|
||||
flag_update_requirement = true
|
||||
}
|
||||
requirement.forEach(function(r,idx) {
|
||||
if ( _.indexOf(reqs,r.label) == -1) {
|
||||
flag_update_requirement = true
|
||||
requirement.splice(idx,1)
|
||||
}
|
||||
})
|
||||
|
||||
if (flag_update_requirement) {
|
||||
context.commit('update_requirement', requirement)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
async search(context,prm) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
let mouCompanyID = 0
|
||||
if (context.rootState.company.selected_mou.M_MouID) {
|
||||
mouCompanyID = context.rootState.company.selected_mou.M_MouID
|
||||
}
|
||||
let resp= await api.search(mouCompanyID,context.state.search)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_tests",data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
|
||||
async panel(context,prm) {
|
||||
context.commit("update_search_panel_status",1)
|
||||
try {
|
||||
let mouCompanyID = 0
|
||||
if (context.rootState.company.selected_mou.M_MouCompanyID) {
|
||||
mouCompanyID = context.rootState.company.selected_mou.M_MouCompanyID
|
||||
}
|
||||
let resp= await api.panel(mouCompanyID,context.state.search)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_panel_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_panel_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_panels",data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_panel_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async get_price(context, prm) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
|
||||
let mou_id = context.rootState.company.selected_mou.M_MouID
|
||||
let resp = await api.get_price(prm.test_id, mou_id, prm.cito)
|
||||
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
|
||||
let x = context.state.selected_test
|
||||
for (let i in x) {
|
||||
if (x[i].T_TestID == prm.test_id) {
|
||||
if (Math.round(resp.data.test_price) == 0) {
|
||||
x[i].T_TestIsCito = "N"
|
||||
let n = context.state.cito.test.indexOf(x[i].T_TestID)
|
||||
if (n > -1)
|
||||
context.state.cito.test.splice(n, 1)
|
||||
|
||||
let tests = context.state.tests
|
||||
if (tests == undefined ) tests = []
|
||||
tests.push(x[i])
|
||||
let dt = {
|
||||
records : tests,
|
||||
total: tests.length
|
||||
}
|
||||
context.commit("update_tests", dt)
|
||||
|
||||
x.splice(i, 1);
|
||||
}
|
||||
|
||||
else {
|
||||
x[i].T_PriceAmount = resp.data.test_price
|
||||
x[i].T_PriceDisc = resp.data.test_disc
|
||||
x[i].T_PriceDiscRp = resp.data.test_discrp
|
||||
}
|
||||
}
|
||||
}
|
||||
context.commit("update_selected_test", x)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
194
test/vuex/one-queue-fo/modules/queue.js
Normal file
194
test/vuex/one-queue-fo/modules/queue.js
Normal file
@@ -0,0 +1,194 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/queue.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
load_queue:0,
|
||||
load_service:0,
|
||||
load_error_message:'',
|
||||
queues: [],
|
||||
total_queue: 0,
|
||||
selected_queue: {},
|
||||
info:false,
|
||||
msg_info:'',
|
||||
services:[],
|
||||
selected_service:{"serviceID":0,"serviceName":"All Service"}
|
||||
},
|
||||
mutations: {
|
||||
update_load_queue(state,status) {
|
||||
state.load_queue = status
|
||||
},
|
||||
update_load_error_message(state,val) {
|
||||
state.load_error_message = val
|
||||
},
|
||||
update_queues(state,data){
|
||||
state.queues = data.records
|
||||
state.total_queue = data.total
|
||||
},
|
||||
update_info(state,val) {
|
||||
state.info = val
|
||||
},
|
||||
update_msg_info(state,val) {
|
||||
state.msg_info = val
|
||||
},
|
||||
update_load_service(state,status) {
|
||||
state.load_service = status
|
||||
},
|
||||
update_services(state,data) {
|
||||
state.services = data.records
|
||||
},
|
||||
update_selected_service(state,val) {
|
||||
state.selected_service = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async loadx(context,prm) {
|
||||
context.commit("update_load_queue",1)
|
||||
try {
|
||||
let resp= await api.loadx(prm.serviceid)
|
||||
//console.log(resp)
|
||||
if (resp.statusText != "OK") {
|
||||
context.commit("update_load_queue",3)
|
||||
context.commit("update_load_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_load_queue",2)
|
||||
context.commit("update_load_error_message","")
|
||||
//console.log(resp)
|
||||
let data = {
|
||||
records : resp.data,
|
||||
total: resp.length
|
||||
}
|
||||
context.commit("update_queues",data)
|
||||
context.dispatch("summary/loadx",{}, {root:true})
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_load_queue",3)
|
||||
context.commit("update_load_error_message",e.message )
|
||||
}
|
||||
},
|
||||
async loadservice(context) {
|
||||
context.commit("update_load_service",1)
|
||||
try {
|
||||
let resp= await api.loadservice()
|
||||
//console.log(resp)
|
||||
if (resp.statusText != "OK") {
|
||||
context.commit("update_load_service",3)
|
||||
context.commit("update_load_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_load_service",2)
|
||||
context.commit("update_load_error_message","")
|
||||
//console.log(resp)
|
||||
let data = {
|
||||
records : resp.data,
|
||||
total: resp.length
|
||||
}
|
||||
context.commit("update_services",data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_load_queue",3)
|
||||
context.commit("update_load_error_message",e.message )
|
||||
}
|
||||
},
|
||||
async docall(context,prm) {
|
||||
context.commit("update_load_queue",1)
|
||||
try {
|
||||
let resp= await api.docall(prm.number)
|
||||
//console.log(resp)
|
||||
if (resp.data.status != "OK") {
|
||||
context.commit("update_load_queue",3)
|
||||
context.commit("update_info",true)
|
||||
context.commit("update_msg_info",resp.data.message)
|
||||
context.dispatch("loadx")
|
||||
} else {
|
||||
context.commit("update_load_queue",2)
|
||||
context.commit("update_load_error_message","")
|
||||
context.dispatch("loadx")
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_load_queue",3)
|
||||
context.commit("update_load_error_message",e.message )
|
||||
}
|
||||
},
|
||||
async dorecall(context,prm) {
|
||||
context.commit("update_load_queue",1)
|
||||
try {
|
||||
let resp= await api.dorecall(prm.number)
|
||||
//console.log(resp)
|
||||
if (resp.data.status != "OK") {
|
||||
context.commit("update_load_queue",3)
|
||||
context.commit("update_info",true)
|
||||
context.commit("update_msg_info",resp.data.message)
|
||||
context.dispatch("loadx")
|
||||
} else {
|
||||
context.commit("update_load_queue",2)
|
||||
context.commit("update_load_error_message","")
|
||||
context.dispatch("loadx")
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_load_queue",3)
|
||||
context.commit("update_load_error_message",e.message )
|
||||
}
|
||||
},
|
||||
async doserve(context,prm) {
|
||||
context.commit("update_load_queue",1)
|
||||
try {
|
||||
let resp= await api.doserve(prm.number)
|
||||
if (resp.data.status != "OK") {
|
||||
context.commit("update_load_queue",3)
|
||||
context.commit("update_info",true)
|
||||
context.commit("update_msg_info",resp.data.message)
|
||||
context.dispatch("loadx")
|
||||
} else {
|
||||
context.commit("update_load_queue",2)
|
||||
context.commit("update_load_error_message","")
|
||||
context.dispatch("loadx")
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_load_queue",3)
|
||||
context.commit("update_load_error_message",e.message )
|
||||
}
|
||||
},
|
||||
async dodone(context,prm) {
|
||||
context.commit("update_load_queue",1)
|
||||
try {
|
||||
let resp= await api.dodone(prm.number)
|
||||
if (resp.data.status != "OK") {
|
||||
context.commit("update_load_queue",3)
|
||||
context.commit("update_info",true)
|
||||
context.commit("update_msg_info",resp.data.message)
|
||||
context.dispatch("loadx")
|
||||
} else {
|
||||
context.commit("update_load_queue",2)
|
||||
context.commit("update_load_error_message","")
|
||||
context.dispatch("loadx")
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_load_queue",3)
|
||||
context.commit("update_load_error_message",e.message )
|
||||
}
|
||||
},
|
||||
async doskip(context,prm) {
|
||||
context.commit("update_load_queue",1)
|
||||
try {
|
||||
let resp= await api.doskip(prm.number)
|
||||
if (resp.data.status != "OK") {
|
||||
context.commit("update_load_queue",3)
|
||||
context.commit("update_info",true)
|
||||
context.commit("update_msg_info",resp.data.message)
|
||||
context.dispatch("loadx")
|
||||
} else {
|
||||
context.commit("update_load_queue",2)
|
||||
context.commit("update_load_error_message","")
|
||||
context.dispatch("loadx")
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_load_queue",3)
|
||||
context.commit("update_load_error_message",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
51
test/vuex/one-queue-fo/modules/summary.js
Normal file
51
test/vuex/one-queue-fo/modules/summary.js
Normal file
@@ -0,0 +1,51 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/summary.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
load_summary:0,
|
||||
load_error_message:'',
|
||||
summaries: [],
|
||||
total_summary: 0
|
||||
},
|
||||
mutations: {
|
||||
update_load_summary(state,status) {
|
||||
state.load_summary = status
|
||||
},
|
||||
update_load_error_message(state,val) {
|
||||
state.load_error_message = val
|
||||
},
|
||||
update_summaries(state,data){
|
||||
state.summaries = data.records
|
||||
state.total_summary = data.total
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async loadx(context) {
|
||||
context.commit("update_load_summary",1)
|
||||
try {
|
||||
let resp= await api.loadx()
|
||||
console.log(resp)
|
||||
if (resp.data.status != "OK") {
|
||||
context.commit("update_load_summary",3)
|
||||
context.commit("update_load_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_load_summary",2)
|
||||
context.commit("update_load_error_message","")
|
||||
let data = {
|
||||
records : resp.data.data,
|
||||
total: resp.count
|
||||
}
|
||||
context.commit("update_summaries",data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_load_summary",3)
|
||||
context.commit("update_load_error_message",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
0
test/vuex/one-queue-fo/mutation.js
Normal file
0
test/vuex/one-queue-fo/mutation.js
Normal file
27
test/vuex/one-queue-fo/store.js
Normal file
27
test/vuex/one-queue-fo/store.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import queue from "./modules/queue.js";
|
||||
import summary from "./modules/summary.js";
|
||||
import system from "../../../apps/modules/system/system.js";
|
||||
|
||||
export const store = new Vuex.Store({
|
||||
state : {
|
||||
tab_active : '01'
|
||||
},
|
||||
|
||||
mutations : {
|
||||
change_tab(state, tab) {
|
||||
state.tab_active = tab;
|
||||
}
|
||||
},
|
||||
|
||||
modules : {
|
||||
queue:queue,
|
||||
summary:summary,
|
||||
system: system
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user