Flatten nested repos
This commit is contained in:
109
test/vuex/one-process-reference-out/api/ro_master.js
Normal file
109
test/vuex/one-process-reference-out/api/ro_master.js
Normal file
@@ -0,0 +1,109 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/process/referenceout/";
|
||||
|
||||
export async function search(token, search, page) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'ro_master/search', {
|
||||
token: token,
|
||||
search: search,
|
||||
page: page
|
||||
});
|
||||
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_company(search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'ro_master/search_company', {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 search_px(search, exc) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'ro_master/search_px', {
|
||||
search:search,
|
||||
exclude: exc
|
||||
});
|
||||
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(datax) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'ro_master/save', {
|
||||
data: datax
|
||||
});
|
||||
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_regional(search, exc) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'ro_master/search_regional', null);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
31
test/vuex/one-process-reference-out/api/ro_patient.js
Normal file
31
test/vuex/one-process-reference-out/api/ro_patient.js
Normal file
@@ -0,0 +1,31 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/process/referenceout/";
|
||||
|
||||
export async function search(token, sdate, edate, nolab, search, page) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'ro_patient/search', {
|
||||
token: token,
|
||||
sdate: sdate,
|
||||
edate: edate,
|
||||
nolab: nolab,
|
||||
search: search,
|
||||
page: page
|
||||
});
|
||||
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-process-reference-out/api/ro_send.js
Normal file
27
test/vuex/one-process-reference-out/api/ro_send.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/process/referenceout/";
|
||||
|
||||
export async function send(token, datax) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'ro_patient/send', {
|
||||
token: token,
|
||||
data: datax
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<v-menu
|
||||
v-model="menu2"
|
||||
:close-on-content-click="false"
|
||||
:nudge-right="40"
|
||||
lazy
|
||||
transition="scale-transition"
|
||||
offset-y
|
||||
full-width
|
||||
max-width="290px"
|
||||
min-width="290px"
|
||||
>
|
||||
<v-text-field
|
||||
slot="activator"
|
||||
v-model="computedDateFormatted"
|
||||
:label=init_label
|
||||
:hint="init_solo ? '' : 'MM/DD/YYYY format'"
|
||||
hide-details
|
||||
persistent-hint
|
||||
readonly
|
||||
browser-autocomplete="off"
|
||||
:solo="init_solo"
|
||||
></v-text-field>
|
||||
<v-date-picker v-model="init_date" no-title @input="menu2 = false" :max="init_max_date"></v-date-picker>
|
||||
</v-menu>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props : ['label', 'date', 'data', 'max_date', 'solo'],
|
||||
|
||||
data () {
|
||||
return {
|
||||
init_date: this.date && this.date != "0000-00-00" ? this.date : null, //new Date().toISOString().substr(0, 10),
|
||||
init_max_date: this.max_date ? this.max_date : '2999-09-09',
|
||||
dateFormatted: this.formatDate(new Date().toISOString().substr(0, 10)),
|
||||
init_solo: this.solo ? true : false,
|
||||
menu1: false,
|
||||
menu2: false,
|
||||
|
||||
init_label: this.label ? this.label : 'Date',
|
||||
init_data: this.data ? this.data : ''
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
computedDateFormatted () {
|
||||
return this.formatDate(this.init_date)
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
init_date (n, o) {
|
||||
this.dateFormatted = this.formatDate(this.init_date)
|
||||
|
||||
this.$emit('change', {"old_date":o, "new_date":n, "data":this.init_data});
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
formatDate (date) {
|
||||
if (!date) { return null }
|
||||
|
||||
const [year, month, day] = date.split('-')
|
||||
return `${day}-${month}-${year}`
|
||||
},
|
||||
parseDate (date) {
|
||||
if (!date) return null
|
||||
|
||||
const [month, day, year] = date.split('/')
|
||||
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
|
||||
},
|
||||
|
||||
emitChange (n, o) {
|
||||
console.log("old:"+o)
|
||||
console.log("new:"+n)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,69 @@
|
||||
<template>
|
||||
|
||||
<v-dialog
|
||||
v-model="dialog"
|
||||
width="1000px"
|
||||
>
|
||||
|
||||
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline grey lighten-2 pt-2 pb-2"
|
||||
primary-title
|
||||
>
|
||||
Laporan
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
|
||||
<v-layout>
|
||||
<v-flex xs12>
|
||||
<object :data="rpt_url"
|
||||
width="100%" height="512px"></object>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-btn
|
||||
color="primary"
|
||||
@click="dialog = false"
|
||||
flat
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
},
|
||||
methods : {
|
||||
},
|
||||
computed : {
|
||||
dialog: {
|
||||
get() {
|
||||
return this.$store.state.ro_patient.print_dialog;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('ro_patient/update_print_dialog', val);
|
||||
}
|
||||
},
|
||||
|
||||
rpt_url () {
|
||||
return this.$store.state.ro_patient.rpt_url
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,194 @@
|
||||
<template>
|
||||
<v-dialog
|
||||
v-model="dialog"
|
||||
width="1000px"
|
||||
>
|
||||
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline grey lighten-2 pt-2 pb-2"
|
||||
primary-title
|
||||
>
|
||||
Admin Rujukan Keluar
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
|
||||
<v-layout row wrap>
|
||||
<v-flex xs4>
|
||||
<one-process-ro-master-add></one-process-ro-master-add>
|
||||
</v-flex>
|
||||
<v-flex xs8 pl-4>
|
||||
<v-data-table
|
||||
:headers="headers" :items="pxs"
|
||||
:loading="isLoading"
|
||||
hide-actions class="xelevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2 green--text" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.T_TestCode }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2 green--text" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.T_TestName }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.M_CompanyID == 0 ? props.item.M_BranchName : props.item.M_CompanyName }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-0" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
<v-btn small class="ma-0 one-btn-icon" color="red" dark @click="remove(props.item)"><span class="icon-del"></span></v-btn>
|
||||
</td>
|
||||
</template>
|
||||
|
||||
</v-data-table>
|
||||
<v-pagination
|
||||
v-model="curr_px_page"
|
||||
:length="total_px_page"
|
||||
:total-visible="5"
|
||||
@input="change_page"
|
||||
></v-pagination>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-btn
|
||||
color="primary"
|
||||
@click="dialog = false"
|
||||
flat
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
|
||||
<v-btn
|
||||
color="primary"
|
||||
@click="save"
|
||||
|
||||
>
|
||||
Simpan
|
||||
</v-btn>
|
||||
|
||||
</v-card-actions>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-process-ro-master-add': httpVueLoader('./oneProcessRoMasterAdd.vue')
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
headers: [
|
||||
{
|
||||
text: "TEST CODE",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TEST NAME",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "35%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "COMPANY",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "35%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "ACTION",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
dialog : {
|
||||
get () { return this.$store.state.ro_master.dialog_main },
|
||||
set (v) { this.$store.commit('ro_master/update_dialog_main', v) }
|
||||
},
|
||||
|
||||
pxs () {
|
||||
return this.$store.state.ro_master.pxs
|
||||
},
|
||||
|
||||
total_px () {
|
||||
return this.$store.state.ro_master.total_px
|
||||
},
|
||||
|
||||
total_px_page () {
|
||||
return this.$store.state.ro_master.total_px_page
|
||||
},
|
||||
|
||||
curr_px_page : {
|
||||
get () { return this.$store.state.ro_master.curr_px_page },
|
||||
set (v) { this.$store.commit('ro_master/update_curr_px_page', v) }
|
||||
},
|
||||
|
||||
isLoading() {
|
||||
return this.$store.state.ro_master.search_status == 1
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
is_selected (a) {
|
||||
return ""
|
||||
},
|
||||
|
||||
select (a) {
|
||||
return
|
||||
},
|
||||
|
||||
change_page(x) {
|
||||
this.curr_px = x
|
||||
this.$store.dispatch('re_master/search')
|
||||
},
|
||||
|
||||
save() {
|
||||
this.$store.dispatch('ro_master/save')
|
||||
},
|
||||
|
||||
remove(y) {
|
||||
let x = this.$store.state.ro_master.pxs
|
||||
let z = []
|
||||
|
||||
for (let i in x) {
|
||||
if (x[i].T_TestID == y.T_TestID)
|
||||
{ z = x.splice(i, 1) }
|
||||
}
|
||||
|
||||
let total_px = this.$store.state.ro_master.total_px
|
||||
let total_page = this.$store.state.ro_master.total_page
|
||||
this.$store.commit('ro_master/update_pxs', { records: x, total: total_px, total_page: total_page })
|
||||
}
|
||||
},
|
||||
|
||||
watch : {
|
||||
dialog(n, o) {
|
||||
if (n && !o) {
|
||||
this.$store.dispatch('ro_master/search')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,275 @@
|
||||
<template>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-autocomplete
|
||||
label="Pemeriksaan"
|
||||
v-model="selected_test"
|
||||
:items="tests"
|
||||
:search-input.sync="search_test"
|
||||
auto-select-first
|
||||
no-filter
|
||||
return-object
|
||||
item-text="T_TestName"
|
||||
:loading="is_loading"
|
||||
no-data-text="Pilih Pemeriksaan"
|
||||
hide-details
|
||||
clearable
|
||||
>
|
||||
<template
|
||||
slot="item"
|
||||
slot-scope="{ item }"
|
||||
>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.T_TestName"></v-list-tile-title>
|
||||
<!-- <v-list-tile-sub-title v-text="getMou(item)"></v-list-tile-sub-title> -->
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 pa-2>
|
||||
<v-radio-group v-model="is_internal" row hide-details>
|
||||
<v-radio label="Rujuk Cabang" value="Y"></v-radio>
|
||||
<v-radio label="Rujuk Eksternal" value="N"></v-radio>
|
||||
</v-radio-group>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 pa-2 v-show="is_internal == 'N'">
|
||||
<v-autocomplete
|
||||
label="Rujukan Lab Eksternal"
|
||||
v-model="selected_company"
|
||||
:items="companies"
|
||||
:search-input.sync="search_company"
|
||||
auto-select-first
|
||||
no-filter
|
||||
return-object
|
||||
item-text="M_CompanyName"
|
||||
:loading="is_loading"
|
||||
no-data-text="Pilih Company"
|
||||
hide-details
|
||||
clearable
|
||||
>
|
||||
<template
|
||||
slot="item"
|
||||
slot-scope="{ item }"
|
||||
>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.M_CompanyName"></v-list-tile-title>
|
||||
<!-- <v-list-tile-sub-title v-text="getMou(item)"></v-list-tile-sub-title> -->
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
|
||||
|
||||
|
||||
<v-flex xs12 pa-2 v-show="is_internal == 'Y'">
|
||||
<v-select
|
||||
:items="regionals"
|
||||
v-model="selected_regional"
|
||||
return-object
|
||||
item-text="S_RegionalName"
|
||||
item-value="S_RegionalID"
|
||||
label="Regional"
|
||||
hide-details
|
||||
></v-select>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 pa-2 v-show="is_internal == 'Y'">
|
||||
<v-select
|
||||
:items="branches"
|
||||
v-model="selected_branch"
|
||||
return-object
|
||||
item-text="M_BranchName"
|
||||
item-value="M_BranchID"
|
||||
label="Cabang"
|
||||
hide-details
|
||||
></v-select>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12>
|
||||
<v-btn color="primary" :dark="btnAddEnable" @click="pxAdd" :disabled="!btnAddEnable">Tambahkan</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
computed : {
|
||||
search_company: {
|
||||
get() {
|
||||
return this.$store.state.ro_master.search_company
|
||||
},
|
||||
|
||||
set(val) {
|
||||
if (val == null) return
|
||||
this.$store.commit('ro_master/update_search_company',val)
|
||||
}
|
||||
},
|
||||
|
||||
selected_company: {
|
||||
get() {
|
||||
return this.$store.state.ro_master.selected_company
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("ro_master/update_selected_company",val)
|
||||
}
|
||||
},
|
||||
|
||||
companies() {
|
||||
return this.$store.state.ro_master.companies
|
||||
},
|
||||
|
||||
search_test: {
|
||||
get() {
|
||||
return this.$store.state.ro_master.search_test
|
||||
},
|
||||
|
||||
set(val) {
|
||||
if (val == null) return
|
||||
this.$store.commit('ro_master/update_search_test',val)
|
||||
}
|
||||
},
|
||||
|
||||
selected_test: {
|
||||
get() {
|
||||
return this.$store.state.ro_master.selected_test
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("ro_master/update_selected_test",val)
|
||||
}
|
||||
},
|
||||
|
||||
tests() {
|
||||
return this.$store.state.ro_master.tests
|
||||
},
|
||||
|
||||
is_loading() {
|
||||
return this.$store.state.ro_master.search_status == 1
|
||||
},
|
||||
|
||||
regionals () {
|
||||
return this.$store.state.ro_master.regionals
|
||||
},
|
||||
|
||||
selected_regional : {
|
||||
get () { return this.$store.state.ro_master.selected_regional },
|
||||
set (v) { this.$store.commit('ro_master/update_selected_regional', v) }
|
||||
},
|
||||
|
||||
branches () {
|
||||
return this.$store.state.ro_master.branches
|
||||
},
|
||||
|
||||
selected_branch : {
|
||||
get () { return this.$store.state.ro_master.selected_branch },
|
||||
set (v) { this.$store.commit('ro_master/update_selected_branch', v) }
|
||||
},
|
||||
|
||||
is_internal : {
|
||||
get () { return this.$store.state.ro_master.add_is_internal },
|
||||
set (v) { this.$store.commit('ro_master/update_add_is_internal', v) }
|
||||
},
|
||||
|
||||
btnAddEnable () {
|
||||
let x = this.$store.state.ro_master
|
||||
|
||||
if (!x.selected_test.T_TestID) return false
|
||||
if (x.add_is_internal == "N" && !x.selected_company) return false
|
||||
if (x.add_is_internal == "N" && !x.selected_company.M_CompanyID) return false
|
||||
if (x.add_is_internal == "Y" && !x.selected_branch) return false
|
||||
if (x.add_is_internal == "Y" && !x.selected_branch.M_BranchID) return false
|
||||
if (x.add_is_internal == "Y" && !x.selected_regional) return false
|
||||
if (x.add_is_internal == "Y" && !x.selected_regional.S_RegionalID) return false
|
||||
|
||||
return true
|
||||
}
|
||||
},
|
||||
|
||||
watch : {
|
||||
search_company(val, old) {
|
||||
|
||||
if (val == null || typeof val == 'undefined') val = ""
|
||||
console.log("1-val:"+val)
|
||||
if (val == old ) return
|
||||
console.log("2-val:"+val)
|
||||
// if (! val) return
|
||||
console.log("3-val:"+val)
|
||||
// if (val.length < 1 ) return
|
||||
console.log("4-val:"+val)
|
||||
if (this.$store.state.ro_master.search_status == 1 ) return
|
||||
console.log("5-val:"+val)
|
||||
this.$store.commit("ro_master/update_search_company",val)
|
||||
this.thr_search_company()
|
||||
},
|
||||
|
||||
search_test(val, old) {
|
||||
|
||||
if (val == null || typeof val == 'undefined') val = ""
|
||||
console.log("1-val:"+val)
|
||||
if (val == old ) return
|
||||
console.log("2-val:"+val)
|
||||
// if (! val) return
|
||||
console.log("3-val:"+val)
|
||||
// if (val.length < 1 ) return
|
||||
console.log("4-val:"+val)
|
||||
if (this.$store.state.ro_master.search_status == 1 ) return
|
||||
console.log("5-val:"+val)
|
||||
this.$store.commit("ro_master/update_search_test",val)
|
||||
this.thr_search_test()
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
thr_search_company: _.debounce( function () {
|
||||
this.$store.dispatch("ro_master/search_company")
|
||||
}, 700),
|
||||
|
||||
thr_search_test: _.debounce( function () {
|
||||
this.$store.dispatch("ro_master/search_test")
|
||||
}, 700),
|
||||
|
||||
pxAdd() {
|
||||
let pxs = this.$store.state.ro_master.pxs
|
||||
let total_px = this.$store.state.ro_master.total_px
|
||||
let total_page = this.$store.state.ro_master.total_page
|
||||
|
||||
let x = {
|
||||
T_OrderRefMasterID:0,
|
||||
T_TestID: this.$store.state.ro_master.selected_test.T_TestID,
|
||||
T_TestName: this.$store.state.ro_master.selected_test.T_TestName,
|
||||
M_CompanyID: this.$store.state.ro_master.selected_company.M_CompanyID,
|
||||
M_CompanyName: this.$store.state.ro_master.selected_company.M_CompanyName,
|
||||
M_BranchName: "",
|
||||
M_BranchID: 0,
|
||||
S_RegionalID: 0,
|
||||
S_RegionalName: '',
|
||||
is_internal: this.is_internal }
|
||||
if (this.is_internal == "Y") {
|
||||
x.M_CompanyID = 0
|
||||
x.M_CompanyName = ""
|
||||
x.M_BranchName = this.$store.state.ro_master.selected_branch.M_BranchName
|
||||
x.M_BranchID = this.$store.state.ro_master.selected_branch.M_BranchID
|
||||
x.S_RegionalID = this.$store.state.ro_master.selected_regional.S_RegionalID
|
||||
x.S_RegionalName = this.$store.state.ro_master.selected_regional.S_RegionalName
|
||||
}
|
||||
pxs.push(x)
|
||||
|
||||
this.$store.commit('ro_master/update_pxs', { records: pxs, total: total_px, total_page: total_page })
|
||||
|
||||
this.$store.commit('ro_master/update_selected_company', {})
|
||||
this.$store.commit('ro_master/update_selected_test', {})
|
||||
this.$store.commit('ro_master/update_search_company', "")
|
||||
this.$store.commit('ro_master/update_search_test', "")
|
||||
this.$store.commit('ro_master/update_selected_branch', {})
|
||||
this.$store.commit('ro_master/update_selected_regional', {})
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$store.dispatch('ro_master/search_regional')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,158 @@
|
||||
<template>
|
||||
<v-dialog
|
||||
v-model="dialog"
|
||||
width="500px"
|
||||
>
|
||||
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline grey lighten-2 pt-2 pb-2"
|
||||
primary-title
|
||||
>
|
||||
Kirim Rujukan
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
|
||||
<v-layout row wrap>
|
||||
<v-flex xs3 mb-1>
|
||||
<strong>Nomor Lab</strong>
|
||||
</v-flex>
|
||||
<v-flex xs9 mb-1>
|
||||
{{ labno }}
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs3 mb-3>
|
||||
<strong>Nama</strong>
|
||||
</v-flex>
|
||||
<v-flex xs9 mb-3>
|
||||
{{ name }}
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12>
|
||||
<v-data-table
|
||||
:headers="headers" :items="pxs"
|
||||
:loading="isLoading"
|
||||
hide-actions class="xelevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2 green--text" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.T_TestCode }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2 green--text" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.T_TestName }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.M_CompanyName }}
|
||||
</td>
|
||||
</template>
|
||||
|
||||
</v-data-table>
|
||||
<!-- <v-pagination
|
||||
v-model="curr_px_page"
|
||||
:length="total_px_page"
|
||||
:total-visible="5"
|
||||
@input="change_page"
|
||||
></v-pagination> -->
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-btn
|
||||
color="primary"
|
||||
@click="dialog = false"
|
||||
flat
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
|
||||
<v-btn
|
||||
color="primary"
|
||||
@click="save"
|
||||
|
||||
>
|
||||
Kirim
|
||||
</v-btn>
|
||||
|
||||
</v-card-actions>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
headers: [
|
||||
{
|
||||
text: "TEST CODE",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TEST NAME",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "KIRIM KE",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "60%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
|
||||
isLoading : false
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
dialog : {
|
||||
get () { return this.$store.state.ro_send.dialog_main },
|
||||
set (v) { this.$store.commit('ro_send/update_dialog_main', v) }
|
||||
},
|
||||
|
||||
pxs () {
|
||||
return this.$store.state.ro_patient.selected_patient.T_TestName
|
||||
},
|
||||
|
||||
labno () {
|
||||
return this.$store.state.ro_patient.selected_patient.T_OrderHeaderLabNumber
|
||||
},
|
||||
|
||||
name () {
|
||||
return this.$store.state.ro_patient.selected_patient.M_PatientName
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
save () {
|
||||
this.$store.dispatch('ro_send/send')
|
||||
},
|
||||
|
||||
is_selected(x) {
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
watch : {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,182 @@
|
||||
<template>
|
||||
<v-dialog
|
||||
v-model="dialog"
|
||||
width="800px"
|
||||
>
|
||||
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline grey lighten-2 pt-2 pb-2"
|
||||
primary-title
|
||||
>
|
||||
Kirim Rujukan
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
|
||||
<v-layout row wrap>
|
||||
<!-- <v-flex xs3 mb-1>
|
||||
<strong>Nomor Lab</strong>
|
||||
</v-flex>
|
||||
<v-flex xs9 mb-1>
|
||||
{{ labno }}
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs3 mb-3>
|
||||
<strong>Nama</strong>
|
||||
</v-flex>
|
||||
<v-flex xs9 mb-3>
|
||||
{{ name }}
|
||||
</v-flex> -->
|
||||
|
||||
<v-flex xs12>
|
||||
<v-data-table
|
||||
:headers="headers" :items="pxs"
|
||||
:loading="isLoading"
|
||||
hide-actions class="xelevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-1" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.patient_name }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-1" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.T_TestCode }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-1" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.T_TestName }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-1" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.M_CompanyName }}
|
||||
</td>
|
||||
</template>
|
||||
|
||||
</v-data-table>
|
||||
<!-- <v-pagination
|
||||
v-model="curr_px_page"
|
||||
:length="total_px_page"
|
||||
:total-visible="5"
|
||||
@input="change_page"
|
||||
></v-pagination> -->
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-btn
|
||||
color="primary"
|
||||
@click="dialog = false"
|
||||
flat
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
|
||||
<v-btn
|
||||
color="primary"
|
||||
@click="save"
|
||||
|
||||
>
|
||||
Kirim
|
||||
</v-btn>
|
||||
|
||||
</v-card-actions>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
headers: [
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "30%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TEST CODE",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TEST NAME",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "KIRIM KE",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "30%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
|
||||
isLoading : false
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
dialog : {
|
||||
get () { return this.$store.state.ro_send.dialog_all },
|
||||
set (v) { this.$store.commit('ro_send/update_dialog_all', v) }
|
||||
},
|
||||
|
||||
pxs () {
|
||||
let pxs = []
|
||||
let ptn = this.$store.state.ro_patient.selected_patients
|
||||
|
||||
for (let i in ptn) {
|
||||
for (let j in ptn[i].T_TestName) {
|
||||
ptn[i].T_TestName[j]['lab_number'] = ptn[i].T_OrderHeaderLabNumber
|
||||
ptn[i].T_TestName[j]['patient_name'] = ptn[i].M_PatientName
|
||||
}
|
||||
|
||||
pxs = pxs.concat(ptn[i].T_TestName)
|
||||
}
|
||||
|
||||
return pxs
|
||||
},
|
||||
|
||||
labno () {
|
||||
return this.$store.state.ro_patient.selected_patient.T_OrderHeaderLabNumber
|
||||
},
|
||||
|
||||
name () {
|
||||
return this.$store.state.ro_patient.selected_patient.M_PatientName
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
save () {
|
||||
this.$store.dispatch('ro_send/send_all')
|
||||
},
|
||||
|
||||
is_selected(x) {
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
watch : {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,220 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-card class="grow">
|
||||
<!-- <v-subheader>
|
||||
<h3 class="title">DAFTAR PASIEN</h3>
|
||||
</v-subheader> -->
|
||||
<hr style="border-top:0px solid #c8c8c8;" />
|
||||
<v-data-table
|
||||
:headers="headers" :items="patients"
|
||||
:loading="isLoading"
|
||||
hide-actions class="xelevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-center pa-2 green--text" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
<v-checkbox false-value="N" true-value="Y" :input-value="checked[props.index]" hide-details @change="checkedChange($event, props.index)" v-show="!isSentAll(props.item)"></v-checkbox>
|
||||
</td>
|
||||
<td class="text-xs-left pa-2 green--text" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.T_OrderHeaderDate.substr(0, 10).split('-').reverse().join('-') }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2 green--text" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.T_OrderHeaderLabNumber }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.M_PatientName }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
<v-btn small :color="test.sent == 'Y' ? 'green' : 'blue'" dark v-for="(test, n) in props.item.T_TestName" v-bind:key="n" class="mr-1 ma-0">{{test.T_TestName}}</v-btn>
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)"
|
||||
@click="select(props.item)">
|
||||
<v-btn small color="primary" class="mr-1 ma-0" @click="sendMe(props.item)" :disabled="isSentAll(props.item)">Kirim</v-btn>
|
||||
</td>
|
||||
</template>
|
||||
|
||||
</v-data-table>
|
||||
<v-pagination
|
||||
v-model="curr_patient_page"
|
||||
:length="total_patient_page"
|
||||
:total-visible="5"
|
||||
@input="change_page"
|
||||
></v-pagination>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.searchbox .v-input.v-text-field .v-input__slot{
|
||||
min-height:60px;
|
||||
}
|
||||
.searchbox .v-btn {
|
||||
min-height:60px;
|
||||
}
|
||||
table.v-table tbody td,table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
query: "",
|
||||
items: [],
|
||||
headers: [
|
||||
{
|
||||
text: "X",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "5%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TANGGAL",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NO LAB",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "25%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "PEMERIKSAAN",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "45%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "RUJUKAN",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "5%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
isLoading: false
|
||||
};
|
||||
},
|
||||
|
||||
methods : {
|
||||
oneMoment : function(d) {
|
||||
return window.oneMoment(d)
|
||||
},
|
||||
|
||||
select (item) {
|
||||
this.$store.commit('ro_patient/update_selected_patient', item)
|
||||
},
|
||||
|
||||
is_selected (item) {
|
||||
let x = this.$store.state.ro_patient.selected_patient
|
||||
if (!x)
|
||||
return ''
|
||||
|
||||
if (x.T_OrderHeaderID == item.T_OrderHeaderID)
|
||||
return 'green lighten-4'
|
||||
|
||||
return ''
|
||||
},
|
||||
|
||||
change_page(x) {
|
||||
this.curr_patient_page = x
|
||||
this.$store.dispatch('ro_patient/search')
|
||||
},
|
||||
|
||||
resultPromise(p) {
|
||||
|
||||
let x = p.split(' ')
|
||||
let y = x[0].split('-').reverse().join('-')
|
||||
|
||||
return y + ' ' + x[1]
|
||||
},
|
||||
|
||||
printMe(url) {
|
||||
this.$store.commit('ro_patient/update_rpt_url', url)
|
||||
this.$store.commit('ro_patient/update_print_dialog', true)
|
||||
},
|
||||
|
||||
sendMe(id) {
|
||||
this.$store.commit('ro_send/update_dialog_main', true)
|
||||
},
|
||||
|
||||
checkedChange(e, idx) {
|
||||
this.$store.commit('ro_patient/update_checked', {idx:idx, val:e})
|
||||
},
|
||||
|
||||
isSentAll(item) {
|
||||
let x = item.T_TestName
|
||||
for (let i in x)
|
||||
if (x[i].sent != "Y")
|
||||
return false
|
||||
|
||||
return true
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
patients () {
|
||||
return this.$store.state.ro_patient.patients
|
||||
},
|
||||
|
||||
total_patient () {
|
||||
return this.$store.state.ro_patient.total_patient
|
||||
},
|
||||
|
||||
total_patient_page () {
|
||||
return this.$store.state.ro_patient.total_patient_page
|
||||
},
|
||||
|
||||
curr_patient_page : {
|
||||
get () { return this.$store.state.ro_patient.curr_patient_page },
|
||||
set (v) { this.$store.commit('ro_patient/update_curr_patient_page', v) }
|
||||
},
|
||||
|
||||
button_print () {
|
||||
return [
|
||||
{id:1, label:"Lab", color:"blue"},
|
||||
{id:2, label:"MDT", color:"green"}
|
||||
]
|
||||
},
|
||||
|
||||
checked : {
|
||||
get () { return this.$store.state.ro_patient.checked },
|
||||
set (v) { this.$store.commit('ro_patient/update_checked', v) }
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$store.dispatch('ro_patient/search')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,144 @@
|
||||
<template>
|
||||
<v-card class="mb-1 pa-1">
|
||||
<v-layout row>
|
||||
<v-flex xs2 pt-1>
|
||||
<one-date-picker
|
||||
label="Start Date"
|
||||
:date="null"
|
||||
:solo="true"
|
||||
@change="startDateChange"
|
||||
:max_date="null"
|
||||
class="mr-2"
|
||||
></one-date-picker>
|
||||
</v-flex>
|
||||
<v-flex xs2 pt-1>
|
||||
<one-date-picker
|
||||
label="End Date"
|
||||
:date="null"
|
||||
:solo="true"
|
||||
@change="endDateChange"
|
||||
:max_date="null"
|
||||
class="mr-4"
|
||||
></one-date-picker>
|
||||
</v-flex>
|
||||
<v-flex xs4>
|
||||
<v-layout>
|
||||
<v-text-field class="flex xs4 ma-1"
|
||||
placeholder="No Lab"
|
||||
single-line
|
||||
solo
|
||||
hide-details
|
||||
v-model="nolab"
|
||||
></v-text-field>
|
||||
<v-text-field class="flex xs8 ma-1"
|
||||
label=""
|
||||
placeholder="Nama"
|
||||
single-line
|
||||
solo
|
||||
hide-details
|
||||
v-model="search"
|
||||
></v-text-field>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
|
||||
<!-- <v-flex xs3 pt-1 pl-2>
|
||||
<v-select
|
||||
:items="groups"
|
||||
v-model="selected_group"
|
||||
item-text="name"
|
||||
item-value="id"
|
||||
label="Grup Pemeriksaan"
|
||||
return-object
|
||||
solo
|
||||
hide-details
|
||||
></v-select>
|
||||
</v-flex> -->
|
||||
<v-flex xs2>
|
||||
<v-layout>
|
||||
<v-btn class="ma-1 one-btn-icon" color="success" @click="searchs">
|
||||
<span class="icon-search"></span>
|
||||
</v-btn>
|
||||
<v-btn @click="edit" color="grey" class="ma-1 one-btn-icon" dark>
|
||||
<span class="icon-edit"></span>
|
||||
</v-btn>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs2 class="text-xs-right">
|
||||
|
||||
<v-btn @click="sendAll" color="blue" :dark="checked.length > 0" :disabled="checked.length < 1">
|
||||
Kirim
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
button {
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
.one-btn-icon span {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.one-btn-icon .v-btn__content {
|
||||
/* padding-left: 16px; */
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-date-picker' : httpVueLoader('./oneDatePicker2.vue')
|
||||
},
|
||||
|
||||
computed : {
|
||||
nolab : {
|
||||
get () { return this.$store.state.ro_patient.nolab },
|
||||
set (v) { return this.$store.commit('ro_patient/update_nolab', v) }
|
||||
},
|
||||
|
||||
search : {
|
||||
get () { return this.$store.state.ro_patient.search },
|
||||
set (v) { this.$store.commit('ro_patient/update_search', v) }
|
||||
},
|
||||
|
||||
groups () {
|
||||
return [] // this.$store.state.re_px.groups
|
||||
},
|
||||
|
||||
selected_group : {
|
||||
get () { return {} /*this.$store.state.re_px.selected_group*/ },
|
||||
set (v) { return /*this.$store.commit('re_px/update_selected_group', v)*/ }
|
||||
},
|
||||
|
||||
checked () {
|
||||
return this.$store.state.ro_patient.selected_patients
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
searchs() {
|
||||
this.$store.dispatch('ro_patient/search')
|
||||
},
|
||||
|
||||
startDateChange (prm) {
|
||||
this.$store.commit('ro_patient/update_sdate', prm.new_date)
|
||||
},
|
||||
|
||||
endDateChange (prm) {
|
||||
this.$store.commit('ro_patient/update_edate', prm.new_date)
|
||||
},
|
||||
|
||||
edit () {
|
||||
this.$store.commit('ro_master/update_dialog_main', true)
|
||||
},
|
||||
|
||||
sendAll () {
|
||||
this.$store.commit('ro_send/update_dialog_all', true)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
101
test/vuex/one-process-reference-out/index.php
Normal file
101
test/vuex/one-process-reference-out/index.php
Normal file
@@ -0,0 +1,101 @@
|
||||
<!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 pt-2 pb-2 pl-1 pr-1>
|
||||
<v-layout column>
|
||||
<v-flex>
|
||||
|
||||
<!-- <one-process-re-search-box></one-process-re-search-box> -->
|
||||
|
||||
</v-flex>
|
||||
|
||||
<v-flex>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<one-process-rp-search-box></one-process-rp-search-box>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12>
|
||||
<one-process-rp-patient-list></one-process-rp-patient-list>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-flex>
|
||||
|
||||
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-dialog-print></one-dialog-print>
|
||||
<one-process-ro-master></one-process-ro-master>
|
||||
<one-footer> </one-footer>
|
||||
<one-process-ro-send></one-process-ro-send>
|
||||
<one-process-ro-send-all></one-process-ro-send-all>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<script src="../../../libs/vendor/axios.min.js"></script>
|
||||
<script src="../../../libs/vendor/moment.min.js"></script>
|
||||
<script src="../../../libs/vendor/moment-locale-id.js"></script>
|
||||
<script src="../../../libs/vendor/lodash.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">
|
||||
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-process-re-search-box': httpVueLoader('./components/oneProcessReSearchBox.vue'),
|
||||
'one-process-rp-patient-list': httpVueLoader('./components/oneProcessRpPatientList.vue'),
|
||||
'one-process-rp-search-box': httpVueLoader('./components/oneProcessRpSearchBox.vue'),
|
||||
'one-dialog-print': httpVueLoader('./components/oneDialogPrint.vue'),
|
||||
'one-process-ro-master': httpVueLoader('./components/oneProcessRoMaster.vue'),
|
||||
'one-process-ro-send': httpVueLoader('./components/oneProcessRoSend.vue'),
|
||||
'one-process-ro-send-all': httpVueLoader('./components/oneProcessRoSendAll.vue')
|
||||
},
|
||||
|
||||
computed : {
|
||||
tab_active () {
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
// store.dispatch('receive_patient/search')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
266
test/vuex/one-process-reference-out/modules/ro_master.js
Normal file
266
test/vuex/one-process-reference-out/modules/ro_master.js
Normal file
@@ -0,0 +1,266 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/ro_master.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
search: '',
|
||||
search_company_id: 0,
|
||||
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
search_dialog_is_active: false,
|
||||
|
||||
pxs: [],
|
||||
total_px: 0,
|
||||
total_px_page: 0,
|
||||
curr_px_page: 1,
|
||||
selected_px: { },
|
||||
|
||||
companies: [],
|
||||
total_company: 0,
|
||||
selected_company: {},
|
||||
search_company: "",
|
||||
|
||||
tests: [],
|
||||
total_test: 0,
|
||||
selected_test: {},
|
||||
search_test: "",
|
||||
|
||||
regionals: [],
|
||||
total_regional: 0,
|
||||
selected_regional: {},
|
||||
|
||||
branches: [],
|
||||
total_branch: 0,
|
||||
selected_branch: {},
|
||||
|
||||
dialog_main: false,
|
||||
|
||||
add_is_internal: "N"
|
||||
},
|
||||
mutations: {
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
|
||||
update_search(state,val) {
|
||||
state.search=val
|
||||
},
|
||||
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
|
||||
update_pxs(state, data) {
|
||||
state.pxs= data.records
|
||||
state.total_px = data.total
|
||||
state.total_px_page = data.total_page
|
||||
},
|
||||
|
||||
update_curr_px_page(state, data) {
|
||||
state.curr_px_page = data
|
||||
},
|
||||
|
||||
update_selected_px(state,val) {
|
||||
state.selected_px=val
|
||||
},
|
||||
|
||||
update_search_company_id(state, id) {
|
||||
state.search_company_id = id
|
||||
},
|
||||
|
||||
update_dialog_main(state, v) {
|
||||
state.dialog_main = v
|
||||
},
|
||||
|
||||
update_companies(state, data) {
|
||||
state.companies = data.records
|
||||
state.total_company = data.total
|
||||
},
|
||||
|
||||
update_selected_company(state, val) {
|
||||
state.selected_company = val
|
||||
},
|
||||
|
||||
update_search_company(state, val) {
|
||||
state.search_company = val
|
||||
},
|
||||
|
||||
update_tests(state, data) {
|
||||
state.tests = data.records
|
||||
state.total_test = data.total
|
||||
},
|
||||
|
||||
update_selected_test(state, val) {
|
||||
state.selected_test =val
|
||||
},
|
||||
|
||||
update_search_test(state, val) {
|
||||
state.search_test = val
|
||||
},
|
||||
|
||||
update_regionals(state, data) {
|
||||
state.regionals = data.records
|
||||
state.total_regional = data.total
|
||||
},
|
||||
|
||||
update_selected_regional(state, val) {
|
||||
state.selected_regional = val
|
||||
state.branches = val.branches
|
||||
state.selected_branch = {}
|
||||
},
|
||||
|
||||
update_branches(state, data) {
|
||||
state.branches = data.records
|
||||
state.total_branch = data.total
|
||||
},
|
||||
|
||||
update_selected_branch(state, val) {
|
||||
state.selected_branch =val
|
||||
},
|
||||
|
||||
update_add_is_internal(state, val) {
|
||||
state.add_is_internal = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.search(one_token(), context.state.sdate, context.state.nolab, context.state.search, context.state.curr_patient_page)
|
||||
|
||||
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_page: resp.data.total_page
|
||||
}
|
||||
context.commit("update_pxs", data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async search_company(context, prm) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
let resp= await api.search_company(context.state.search_company)
|
||||
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 )
|
||||
}
|
||||
},
|
||||
|
||||
async search_test(context) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
|
||||
let ids = []
|
||||
for (let i in context.state.pxs)
|
||||
ids.push(context.state.pxs[i].T_TestID)
|
||||
|
||||
let resp = await api.search_px(context.state.search_test, JSON.stringify(ids))
|
||||
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 save(context) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
|
||||
let data = []
|
||||
for (let i in context.state.pxs) {
|
||||
data.push({
|
||||
t_id:context.state.pxs[i].T_TestID,
|
||||
c_id:context.state.pxs[i].M_CompanyID,
|
||||
id:context.state.pxs[i].T_OrderRefMasterID,
|
||||
b_id:context.state.pxs[i].M_BranchID,
|
||||
g_id:context.state.pxs[i].S_RegionalID,
|
||||
is_int:context.state.pxs[i].is_internal
|
||||
})
|
||||
}
|
||||
|
||||
let resp= await api.save(JSON.stringify(data))
|
||||
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","")
|
||||
|
||||
context.dispatch("search")
|
||||
context.commit('update_dialog_main', false)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
|
||||
async search_regional(context) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
|
||||
let resp = await api.search_regional()
|
||||
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_regionals", data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
137
test/vuex/one-process-reference-out/modules/ro_patient.js
Normal file
137
test/vuex/one-process-reference-out/modules/ro_patient.js
Normal file
@@ -0,0 +1,137 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/ro_patient.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
order_id:0,
|
||||
search: '',
|
||||
nolab: '',
|
||||
sdate: null,
|
||||
edate: null,
|
||||
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
search_dialog_is_active: false,
|
||||
|
||||
patients: [],
|
||||
total_patient: 0,
|
||||
total_patient_page: 0,
|
||||
curr_patient_page: 1,
|
||||
selected_patient: { },
|
||||
selected_patients: [],
|
||||
checked: [],
|
||||
|
||||
|
||||
// PX
|
||||
total_px: 0,
|
||||
pxs: [],
|
||||
|
||||
// Print
|
||||
print_dialog: false,
|
||||
rpt_url: ''
|
||||
},
|
||||
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_search(state,val) {
|
||||
state.search=val
|
||||
},
|
||||
|
||||
update_nolab(state, val) {
|
||||
state.nolab = 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_patient_page = data.total_page
|
||||
|
||||
let x = []
|
||||
for (let i in data.records)
|
||||
x.push("N")
|
||||
state.checked = x
|
||||
},
|
||||
|
||||
update_curr_patient_page(state, data) {
|
||||
state.curr_patient_page = data
|
||||
},
|
||||
|
||||
update_selected_patient(state,val) {
|
||||
state.selected_patient=val
|
||||
},
|
||||
|
||||
update_id(state, id) {
|
||||
state.order_id = id
|
||||
},
|
||||
|
||||
update_sdate(state, date) {
|
||||
state.sdate = date
|
||||
},
|
||||
|
||||
update_edate(state, date) {
|
||||
state.edate = date
|
||||
},
|
||||
|
||||
update_print_dialog(state, v) {
|
||||
state.print_dialog = v
|
||||
},
|
||||
|
||||
update_rpt_url(state, v) {
|
||||
state.rpt_url = v
|
||||
},
|
||||
|
||||
update_checked(state, v) {
|
||||
let x = state.checked
|
||||
x[v.idx] = v.val
|
||||
|
||||
// Update selected patients
|
||||
let y = []
|
||||
for (let i in x)
|
||||
if (x[i] == "Y")
|
||||
y.push(state.patients[i])
|
||||
|
||||
state.selected_patients = y
|
||||
state.checked = x
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.search(one_token(), context.state.sdate, context.state.edate, context.state.nolab, context.state.search, context.state.curr_patient_page)
|
||||
|
||||
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_page: resp.data.total_page
|
||||
}
|
||||
context.commit("update_patients", data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
83
test/vuex/one-process-reference-out/modules/ro_send.js
Normal file
83
test/vuex/one-process-reference-out/modules/ro_send.js
Normal file
@@ -0,0 +1,83 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/ro_send.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
order_id: 0,
|
||||
dialog_main: false,
|
||||
dialog_all: false
|
||||
},
|
||||
mutations: {
|
||||
update_dialog_main(state, v) {
|
||||
state.dialog_main = v
|
||||
},
|
||||
|
||||
update_dialog_all(state, v) {
|
||||
state.dialog_all = v
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async send(context) {
|
||||
|
||||
try {
|
||||
|
||||
let data = []
|
||||
let ptn = context.rootState.ro_patient.selected_patient
|
||||
let tst = ptn.T_TestName
|
||||
for (let i in tst) {
|
||||
if (tst[i].sent != "Y")
|
||||
data.push({o_id:ptn.T_OrderHeaderID, t_id:tst[i].T_TestID, c_id:tst[i].M_CompanyID,
|
||||
is_int:tst[i].is_internal, b_id:tst[i].M_BranchID})
|
||||
}
|
||||
|
||||
let resp = await api.send(one_token(), JSON.stringify(data))
|
||||
if (resp.status != "OK") {
|
||||
alert('error')
|
||||
} else {
|
||||
|
||||
|
||||
context.commit("update_dialog_main", false)
|
||||
context.dispatch("ro_patient/search", null, {root:true})
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
|
||||
async send_all(context) {
|
||||
|
||||
try {
|
||||
|
||||
let data = []
|
||||
let ptns = context.rootState.ro_patient.selected_patients
|
||||
|
||||
for (let j in ptns) {
|
||||
let ptn = ptns[j]
|
||||
let tst = ptn.T_TestName
|
||||
|
||||
for (let i in tst) {
|
||||
if (tst[i].sent != "Y")
|
||||
data.push({o_id:ptn.T_OrderHeaderID, t_id:tst[i].T_TestID, c_id:tst[i].M_CompanyID,
|
||||
is_int:tst[i].is_internal, b_id:tst[i].M_BranchID})
|
||||
}
|
||||
}
|
||||
|
||||
let resp = await api.send(one_token(), JSON.stringify(data))
|
||||
if (resp.status != "OK") {
|
||||
alert('error')
|
||||
} else {
|
||||
|
||||
|
||||
context.commit("update_dialog_all", false)
|
||||
context.dispatch("ro_patient/search", null, {root:true})
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
32
test/vuex/one-process-reference-out/store.js
Normal file
32
test/vuex/one-process-reference-out/store.js
Normal file
@@ -0,0 +1,32 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import ro_patient from "./modules/ro_patient.js";
|
||||
import ro_master from "./modules/ro_master.js";
|
||||
import ro_send from "./modules/ro_send.js";
|
||||
import system from "../../../apps/modules/system/system.js";
|
||||
|
||||
export const store = new Vuex.Store({
|
||||
state : {
|
||||
tab_active : '01',
|
||||
tabs : [
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
mutations : {
|
||||
change_tab(state, tab) {
|
||||
state.tab_active = tab;
|
||||
}
|
||||
},
|
||||
|
||||
modules : {
|
||||
ro_patient: ro_patient,
|
||||
ro_master: ro_master,
|
||||
ro_send: ro_send,
|
||||
system: system
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user