Flatten nested repos
This commit is contained in:
50
test/vuex/one-sampling-v2/api/patient.js
Normal file
50
test/vuex/one-sampling-v2/api/patient.js
Normal file
@@ -0,0 +1,50 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/sampling/sampling/";
|
||||
|
||||
export async function search(nolab, search, station, status) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient_list/search', {
|
||||
search: search,
|
||||
nolab: nolab,
|
||||
station: station,
|
||||
status: status
|
||||
});
|
||||
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_stations(tokenx) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient_list/get_stations',
|
||||
{token:tokenx}
|
||||
);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
52
test/vuex/one-sampling-v2/api/queue.js
Normal file
52
test/vuex/one-sampling-v2/api/queue.js
Normal file
@@ -0,0 +1,52 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/sampling/sampling/";
|
||||
|
||||
export async function call(token, order_id, station_id, act) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'queue/call_skip_process', {
|
||||
token: token,
|
||||
order_id: order_id,
|
||||
station_id: station_id,
|
||||
act: act
|
||||
});
|
||||
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 recall(token, order_id, station_id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'queue/recall', {
|
||||
token: token,
|
||||
order_id: order_id,
|
||||
station_id: station_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
|
||||
};
|
||||
}
|
||||
}
|
||||
166
test/vuex/one-sampling-v2/api/sampling.js
Normal file
166
test/vuex/one-sampling-v2/api/sampling.js
Normal file
@@ -0,0 +1,166 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/sampling/sampling/";
|
||||
|
||||
export async function get_samples(order_id, station_id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sampling/get_samples', {
|
||||
orderid: order_id,
|
||||
stationid: station_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 get_sample(order_id, sample_id, barcode) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sampling/get_sample', {
|
||||
orderid: order_id,
|
||||
sampleid: sample_id,
|
||||
barcode: barcode
|
||||
});
|
||||
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(token, order_id, sample_id, barcode, json_data) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sampling/save_2', {
|
||||
token: token,
|
||||
orderid: order_id,
|
||||
sampleid: sample_id,
|
||||
barcode: barcode,
|
||||
json_data: json_data
|
||||
});
|
||||
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_note_supervisor(order_id, message) {
|
||||
try {
|
||||
let token = one_token()
|
||||
var resp = await axios.post(URL + 'sampling/save_note_supervisor', {
|
||||
orderid: order_id,
|
||||
message: message,
|
||||
token: token
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function barcode_add(token, order_id, sample_id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sampling/barcode_add', {
|
||||
token: token,
|
||||
order_id: order_id,
|
||||
sample_id: sample_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 get_requirement() {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sampling/get_requirement', {});
|
||||
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_requirement(token, order_id, station_id, status, reqs) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sampling/save_requirement', {
|
||||
token: token,
|
||||
order_id: order_id,
|
||||
station_id: station_id,
|
||||
status: status,
|
||||
reqs: reqs
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
46
test/vuex/one-sampling-v2/api/ver_patient.js
Normal file
46
test/vuex/one-sampling-v2/api/ver_patient.js
Normal file
@@ -0,0 +1,46 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/sampling/verification/";
|
||||
|
||||
export async function search(nolab, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient_list/search', {
|
||||
search: search,
|
||||
nolab: nolab
|
||||
});
|
||||
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_sent() {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient_list/search_sent', {});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
47
test/vuex/one-sampling-v2/api/ver_verification.js
Normal file
47
test/vuex/one-sampling-v2/api/ver_verification.js
Normal file
@@ -0,0 +1,47 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/sampling/verification/";
|
||||
|
||||
export async function send(ids) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'verification/send', {
|
||||
ids: ids
|
||||
});
|
||||
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 remove(id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'verification/remove', {
|
||||
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
|
||||
};
|
||||
}
|
||||
}
|
||||
60
test/vuex/one-sampling-v2/components/oneDatePicker.vue
Normal file
60
test/vuex/one-sampling-v2/components/oneDatePicker.vue
Normal file
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<v-menu
|
||||
ref="init_menu_date"
|
||||
v-model="init_menu_date"
|
||||
:close-on-content-click="false"
|
||||
:nudge-right="40"
|
||||
:return-value.sync="init_date"
|
||||
lazy
|
||||
transition="scale-transition"
|
||||
offset-y
|
||||
full-width
|
||||
min-width="290px"
|
||||
>
|
||||
<v-text-field
|
||||
slot="activator"
|
||||
placeholder="-"
|
||||
label="Sampling Date"
|
||||
hide-details
|
||||
v-model="formatted_date"
|
||||
></v-text-field>
|
||||
|
||||
<v-date-picker v-model="init_date" no-title scrollable>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn flat color="primary" @click="init_menu_date = false">Cancel</v-btn>
|
||||
<v-btn flat color="primary" @click="$refs.init_menu_date.save(init_date)">OK</v-btn>
|
||||
</v-date-picker>
|
||||
</v-menu>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props : ['menu_date', 'date'],
|
||||
|
||||
data () {
|
||||
return {
|
||||
init_menu_date : this.menu_date,
|
||||
init_date : this.date,
|
||||
formatted_date : this.date
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
},
|
||||
|
||||
watch : {
|
||||
init_date (n, o) {
|
||||
// this.formatted_date = this.formatDate(this.init_date);
|
||||
}
|
||||
}
|
||||
|
||||
methods : {
|
||||
formatDate (date) {
|
||||
if (!date) return null
|
||||
|
||||
const [year, month, day] = date.split('-')
|
||||
return `${day}-${month}-${year}`
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
77
test/vuex/one-sampling-v2/components/oneDatePicker2.vue
Normal file
77
test/vuex/one-sampling-v2/components/oneDatePicker2.vue
Normal file
@@ -0,0 +1,77 @@
|
||||
<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="MM/DD/YYYY format"
|
||||
persistent-hint
|
||||
readonly
|
||||
browser-autocomplete="off"
|
||||
></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'],
|
||||
|
||||
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)),
|
||||
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>
|
||||
88
test/vuex/one-sampling-v2/components/oneDatePicker3.vue
Normal file
88
test/vuex/one-sampling-v2/components/oneDatePicker3.vue
Normal file
@@ -0,0 +1,88 @@
|
||||
<template>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<v-dialog
|
||||
ref="dialog"
|
||||
v-model="modal"
|
||||
:return-value.sync="date"
|
||||
persistent
|
||||
lazy
|
||||
full-width
|
||||
width="290px"
|
||||
>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field
|
||||
v-model="computedDateFormatted"
|
||||
:label=init_label
|
||||
readonly
|
||||
v-on="on"
|
||||
hint="MM/DD/YYYY format"
|
||||
browser-autocomplete="off"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker v-model="init_date" no-title @input="modal = false" :max="init_max_date" scrollable>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn flat color="primary" @click="modal = false">Cancel</v-btn>
|
||||
<!-- <v-btn flat color="primary" @click="$refs.dialog.save(date)">OK</v-btn> -->
|
||||
</v-date-picker>
|
||||
</v-dialog>
|
||||
</v-flex>
|
||||
|
||||
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props : ['label', 'date', 'data', 'max_date'],
|
||||
|
||||
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)),
|
||||
menu1: false,
|
||||
menu2: false,
|
||||
|
||||
init_label: this.label ? this.label : 'Date',
|
||||
init_data: this.data ? this.data : '',
|
||||
|
||||
modal: false
|
||||
}
|
||||
},
|
||||
|
||||
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,58 @@
|
||||
<template>
|
||||
<v-flex class="pl-2">
|
||||
<v-layout row>
|
||||
<v-checkbox @change="checkedChange()"
|
||||
:color="value.checked ? 'success' : 'warning' "
|
||||
v-model="value.checked" hide-details class="shrink">
|
||||
</v-checkbox>
|
||||
<v-text-field
|
||||
class="grow"
|
||||
:label="value.label"
|
||||
:placeholder="value.placeholder"
|
||||
:background-color="value.checked ? 'success' : value.note == '' ? 'error' : 'warning' "
|
||||
outline
|
||||
:error-messages="value.is_error? value.error_message : ''"
|
||||
:error="is_error"
|
||||
:disabled="value.checked"
|
||||
v-model="value.note"
|
||||
@input="noteChange()"
|
||||
></v-text-field>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props : ['value'],
|
||||
methods : {
|
||||
noteChange(note) {
|
||||
if (! this.value.checked ) {
|
||||
this.value.is_error = this.value.note.trim() == ""
|
||||
} else {
|
||||
this.value.is_error = false
|
||||
this.value.note = ""
|
||||
}
|
||||
console.log("value")
|
||||
console.log(this.value)
|
||||
this.$emit("input", this.value )
|
||||
},
|
||||
checkedChange() {
|
||||
if (this.value.checked) {
|
||||
this.value.note = "";
|
||||
this.value.is_error = false;
|
||||
} else {
|
||||
this.value.is_error = (this.value.note.trim() == "" )
|
||||
}
|
||||
this.$emit("input", this.value)
|
||||
}
|
||||
},
|
||||
computed : {
|
||||
is_error () {
|
||||
return false
|
||||
console.log("e:"+this.value.is_error)
|
||||
return this.value.is_error
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,227 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<v-layout>
|
||||
<v-text-field class="flex xs4 ma-1"
|
||||
placeholder="No Lab"
|
||||
single-line
|
||||
outline
|
||||
hide-details
|
||||
v-model="nolab"
|
||||
@keyup.native="keySearch"
|
||||
></v-text-field>
|
||||
<v-text-field class="flex xs8 ma-1"
|
||||
label=""
|
||||
placeholder="Nama"
|
||||
single-line
|
||||
outline
|
||||
hide-details
|
||||
v-model="search"
|
||||
@keyup.native="keySearch"
|
||||
></v-text-field>
|
||||
|
||||
<v-btn class="mr-1 ml-1 one-btn-icon fz-2" color="success" @click="search_patient" large block fill-height>
|
||||
<span class="icon-search"></span>
|
||||
</v-btn>
|
||||
<v-btn class="mr-1 ml-1 one-btn-icon fz-2" color="info" @click="send" large block fill-height>
|
||||
<v-icon>send</v-icon>
|
||||
</v-btn>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<!-- <v-flex xs4>
|
||||
<v-layout>
|
||||
<v-btn class="mr-1 ml-1 one-btn-icon fz-2" color="success" @click="search_patient" large block fill-height>
|
||||
<span class="icon-search"></span>
|
||||
</v-btn>
|
||||
<v-btn class="mr-1 ml-1 one-btn-icon fz-2" color="info" @click="send" large block fill-height>
|
||||
<v-icon>send</v-icon>
|
||||
</v-btn>
|
||||
</v-layout>
|
||||
</v-flex> -->
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
|
||||
<v-card class="grow">
|
||||
<v-subheader>
|
||||
<h3 class="title">SPECIMEN SIAP KIRIM</h3>
|
||||
</v-subheader>
|
||||
<v-data-table
|
||||
:headers="headers" :items="patients"
|
||||
:loading="isLoading"
|
||||
hide-actions class="xelevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2"
|
||||
@click="select(props.item)">
|
||||
{{ oneMoment(props.item.date)}}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.lab }}
|
||||
</td>
|
||||
<td class="pa-2"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.sid}}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.name }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2"
|
||||
@click="select(props.item)">
|
||||
<v-checkbox :value="props.item.id" v-model="ids" hide-details></v-checkbox>
|
||||
</td>
|
||||
</template>
|
||||
|
||||
</v-data-table>
|
||||
|
||||
</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;
|
||||
} */
|
||||
.v-btn--large {
|
||||
height: 52px;
|
||||
}
|
||||
|
||||
table.v-table tbody td,xtable.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.fz-2 {
|
||||
font-size: 1.5em
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
query: "",
|
||||
items: [],
|
||||
headers: [
|
||||
{
|
||||
text: "SAMPLING",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NO LAB",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "SAMPLE ID",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "25%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
|
||||
{
|
||||
text: "Pilih",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "5%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
isLoading: false,
|
||||
// patients: [
|
||||
// {"status":"","date":"2019-02-21 10:00:00",
|
||||
// "lab":"08000198909", "sid": "08000198909-S",
|
||||
// "name": "Pasien Umum", "selected":false},
|
||||
// {"status":"","date":"2019-02-22 06:30:00",
|
||||
// "lab":"08000198111", "sid": "08000198111-2",
|
||||
// "name": "Heri Suryawan", "selected":false},
|
||||
// {"status":"","date":"2019-02-22 06:45:00",
|
||||
// "lab":"08000198222", "sid": "08000198222-U",
|
||||
// "name": "LUKA MODRIC","selected":true},
|
||||
// ]
|
||||
};
|
||||
},
|
||||
methods : {
|
||||
oneMoment : function(d) {
|
||||
return window.oneMoment(d)
|
||||
},
|
||||
|
||||
search_patient () {
|
||||
this.$store.dispatch('ver_patient/search')
|
||||
},
|
||||
|
||||
send () {
|
||||
this.$store.dispatch('ver_verification/send')
|
||||
},
|
||||
|
||||
select(item) {
|
||||
this.$store.commit('ver_patient/update_selected_patient', item)
|
||||
},
|
||||
|
||||
keySearch(e) {
|
||||
if (e.which == 13) {
|
||||
this.search_patient()
|
||||
}
|
||||
}
|
||||
},
|
||||
computed : {
|
||||
patients () {
|
||||
return this.$store.state.ver_patient.patients
|
||||
},
|
||||
|
||||
nolab : {
|
||||
get () {
|
||||
return this.$store.state.ver_patient.nolab
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('ver_patient/update_nolab', v)
|
||||
}
|
||||
},
|
||||
|
||||
search : {
|
||||
get () {
|
||||
return this.$store.state.ver_patient.search
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('ver_patient/update_search', v)
|
||||
}
|
||||
},
|
||||
|
||||
ids : {
|
||||
get () {
|
||||
return this.$store.state.ver_verification.ids
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('ver_verification/update_ids', v)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,156 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-card class="grow">
|
||||
<v-subheader>
|
||||
<h3 class="title">PENGIRIMAN KE SPECIMEN VERIFICATION</h3>
|
||||
</v-subheader>
|
||||
<hr style="border-top:0px solid #c8c8c8;"></hr>
|
||||
<v-data-table
|
||||
:headers="headers" :items="patients"
|
||||
:loading="isLoading"
|
||||
hide-actions class="xelevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2"
|
||||
@click="select(props.item)">
|
||||
{{ oneMoment(props.item.date) }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.lab }}
|
||||
</td>
|
||||
<td class="pa-2"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.sid}}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2"
|
||||
@click="select(props.item)">
|
||||
{{ props.item.name }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2"
|
||||
@click="select(props.item)">
|
||||
<v-btn v-show="props.item.status == 'SAMPLING.Sampling.To.Verification'" block flat>Pending</v-btn>
|
||||
<v-btn v-show="props.item.status == 'SAMPLING.Verification.From.Sampling'" block color="primary" flat>Diterima</v-btn>
|
||||
<v-btn v-show="props.item.status == 'SAMPLING.Verification.Verify'" block color="success" flat>Diverifikasi</v-btn>
|
||||
<v-btn v-show="props.item.status == 'SAMPLING.Verification.Reject'" block color="red" dark flat>Ditolak</v-btn>
|
||||
|
||||
</td>
|
||||
<td class="text-xs-left pa-2 text-xs-center">
|
||||
<v-btn flat icon color="red"
|
||||
@click="remove(props.item)"
|
||||
v-show="props.item.status == 'SAMPLING.Sampling.To.Verification'">
|
||||
<v-icon>delete</v-icon>
|
||||
</v-btn>
|
||||
|
||||
</td>
|
||||
</template>
|
||||
|
||||
</v-data-table>
|
||||
|
||||
</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: "KIRIM",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NO LAB",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "SAMPLE ID",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "25%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
|
||||
{
|
||||
text: "STATUS",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
|
||||
{
|
||||
text: "ACTION",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
isLoading: false
|
||||
|
||||
};
|
||||
},
|
||||
|
||||
methods : {
|
||||
oneMoment : function(d) {
|
||||
return window.oneMoment(d)
|
||||
},
|
||||
|
||||
select (item) {
|
||||
this.$store.commit('ver_verification/update_selected_sent_sample', item)
|
||||
},
|
||||
|
||||
remove (item) {
|
||||
this.$store.commit('ver_verification/update_selected_sent_sample', item)
|
||||
this.$store.dispatch('ver_verification/remove')
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
patients () {
|
||||
return this.$store.state.ver_patient.sent_patients
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
42
test/vuex/one-sampling-v2/components/oneSamplingInfo.vue
Normal file
42
test/vuex/one-sampling-v2/components/oneSamplingInfo.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<template>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<v-card class="pa-1">
|
||||
<one-sampling-info-detail></one-sampling-info-detail>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12>
|
||||
<one-sampling-info-tube></one-sampling-info-tube>
|
||||
</v-flex>
|
||||
|
||||
|
||||
</v-layout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-sampling-info-detail' : httpVueLoader('./oneSamplingInfoDetail.vue'),
|
||||
'one-sampling-info-tube' : httpVueLoader('./oneSamplingInfoTube.vue')
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
415
test/vuex/one-sampling-v2/components/oneSamplingInfoDetail.vue
Normal file
415
test/vuex/one-sampling-v2/components/oneSamplingInfoDetail.vue
Normal file
@@ -0,0 +1,415 @@
|
||||
<template>
|
||||
|
||||
<v-card flat>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<v-layout>
|
||||
|
||||
<v-flex xs2>
|
||||
<v-img
|
||||
:src="patient_photo"
|
||||
aspect-ratio="1"
|
||||
class="grey lighten-2 elevation-2"
|
||||
>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs10 pl-2>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs6>
|
||||
<v-layout column>
|
||||
<v-flex>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs6>
|
||||
<h5 class="headline">{{ labno }}</h5>
|
||||
</v-flex>
|
||||
<v-flex xs6 class="text-xs-right">
|
||||
<v-btn
|
||||
:color="btn_call.color"
|
||||
class="pr-2 pl-2 ml-0 mr-1 one-btn-icon"
|
||||
|
||||
@click="call(btn_call.act)"
|
||||
:disabled="!btn_order_enable || !btn_call.enable"
|
||||
:dark="btn_order_enable && btn_call.enable">
|
||||
<span :class="btn_call.icon"></span>
|
||||
|
||||
</v-btn>
|
||||
|
||||
<v-btn
|
||||
color="blue"
|
||||
class="pr-2 pl-2 ml-0 one-btn-icon"
|
||||
@click="process()"
|
||||
:disabled="!btn_process_enable"
|
||||
:dark="btn_process_enable"
|
||||
v-show="btn_process_show">
|
||||
<span class="icon-process"></span>
|
||||
</v-btn>
|
||||
|
||||
<v-btn
|
||||
color="orange"
|
||||
class="pr-2 pl-2 ml-0 one-btn-icon"
|
||||
@click="recall()"
|
||||
v-show="btn_recall_show"
|
||||
dark>
|
||||
<span class="icon-speaker"></span>
|
||||
</v-btn>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
|
||||
</v-flex>
|
||||
<v-flex pt-3>
|
||||
<v-layout row wrap>
|
||||
|
||||
<v-text-field
|
||||
v-model="mr"
|
||||
label="No RM"
|
||||
readonly
|
||||
hide-details
|
||||
>
|
||||
</v-text-field>
|
||||
|
||||
|
||||
</v-layout>
|
||||
|
||||
</v-flex>
|
||||
<v-flex>
|
||||
<v-text-field
|
||||
v-model="name"
|
||||
label="Nama"
|
||||
readonly
|
||||
hide-details
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
|
||||
|
||||
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs6 pl-2>
|
||||
<v-layout column>
|
||||
<v-flex>
|
||||
<v-layout row>
|
||||
<v-flex xs6>
|
||||
<v-text-field
|
||||
v-model="dob"
|
||||
label="Tanggal lahir"
|
||||
readonly
|
||||
hide-details
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs6 pl-1>
|
||||
<v-text-field
|
||||
v-model="age"
|
||||
label="Umur"
|
||||
readonly
|
||||
hide-details
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-flex>
|
||||
|
||||
<v-flex>
|
||||
<v-text-field
|
||||
v-model="phone"
|
||||
label="HP"
|
||||
readonly
|
||||
hide-details
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<v-flex>
|
||||
|
||||
|
||||
<v-btn
|
||||
color="orange"
|
||||
:dark="btn_order_enable && btn_order_enable_by_call"
|
||||
class="mt-3 one-btn-icon"
|
||||
|
||||
@click="print_barcode"
|
||||
:disabled="!btn_order_enable || !btn_order_enable_by_call">
|
||||
<span class="icon-barcode"></span>
|
||||
</v-btn>
|
||||
|
||||
<v-btn
|
||||
color="brown"
|
||||
:dark="btn_order_enable && btn_order_enable_by_call"
|
||||
class="mt-3"
|
||||
|
||||
@click="update_dialog_supervisor"
|
||||
:disabled="!btn_order_enable || !btn_order_enable_by_call">
|
||||
Catatan SPV
|
||||
</v-btn>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
|
||||
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 pt-1>
|
||||
<v-layout row>
|
||||
<v-flex xs2>
|
||||
<one-field-verification
|
||||
label="Foto sesuai dengan pasien"
|
||||
:value="ver_photo.checked"
|
||||
:note="ver_photo.note"
|
||||
@change="update_ver_photo"
|
||||
v-if="if_ver_photo"
|
||||
:disabled="!btn_order_enable || !btn_order_enable_by_call"
|
||||
>
|
||||
</one-field-verification>
|
||||
</v-flex>
|
||||
<v-flex xs5 pl-1>
|
||||
<v-textarea
|
||||
auto-grow
|
||||
label="Catatan FO"
|
||||
rows="1"
|
||||
:value="note_fo"
|
||||
readonly
|
||||
outline
|
||||
class="mb-0"
|
||||
hide-details
|
||||
></v-textarea>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs5 pl-1>
|
||||
<v-textarea
|
||||
auto-grow
|
||||
label="Catatan Sampling"
|
||||
rows="1"
|
||||
v-model="note_sampling"
|
||||
outline
|
||||
hide-details
|
||||
:disabled="!btn_order_enable || !btn_order_enable_by_call"
|
||||
></v-textarea>
|
||||
</v-flex>
|
||||
|
||||
|
||||
</v-layout>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<one-sampling-supervisor></one-sampling-supervisor>
|
||||
</v-card>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.v-text-field--outline>.v-input__control>.v-input__slot {
|
||||
min-height: 62px;
|
||||
}
|
||||
.one-btn-icon { font-size: 1.5em }
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-field-verification' : httpVueLoader('./../../common/oneFieldVerification.vue'),
|
||||
'one-sampling-supervisor' : httpVueLoader('./oneSamplingSupervisorNote.vue')
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
mr () {
|
||||
return this.$store.state.patient.selected_patient.mr;
|
||||
},
|
||||
|
||||
name () {
|
||||
return this.$store.state.patient.selected_patient.name;
|
||||
},
|
||||
|
||||
dob () {
|
||||
try {
|
||||
return this.$store.state.patient.selected_patient.dob.split('-').reverse().join('-');
|
||||
} catch(e) {
|
||||
console.log(e.message)
|
||||
return '-';
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
phone () {
|
||||
return this.$store.state.patient.selected_patient.phone;
|
||||
},
|
||||
|
||||
labno () {
|
||||
return this.$store.state.patient.selected_patient.lab_no
|
||||
},
|
||||
|
||||
age () {
|
||||
return this.$store.state.patient.selected_patient.age
|
||||
},
|
||||
|
||||
sex () {
|
||||
return this.$store.state.patient.selected_patient.sex
|
||||
},
|
||||
|
||||
ver_photo : {
|
||||
get () {
|
||||
return this.$store.state.sampling.ver_photo
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('sampling/update_ver_photo', v)
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
note_sampling : {
|
||||
get () {
|
||||
return this.$store.state.sampling.note_sampling
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('sampling/update_note_sampling', v)
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
note_fo () {
|
||||
return this.$store.state.sampling.note_fo
|
||||
},
|
||||
|
||||
if_ver_photo () {
|
||||
return this.$store.state.sampling.if_ver_photo
|
||||
},
|
||||
|
||||
btn_order_enable () {
|
||||
|
||||
if (this.$store.state.patient.selected_patient.order_id) {
|
||||
let x = this.$store.state.patient.patients
|
||||
let y = {}
|
||||
for (let i in x) {
|
||||
if (x[i].T_OrderHeaderID == this.$store.state.patient.selected_patient.order_id)
|
||||
y = x[i]
|
||||
}
|
||||
|
||||
if (y.status_code == "Y")
|
||||
return false
|
||||
|
||||
if (this.$store.state.patient.selected_patient.order_id != 0)
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
},
|
||||
|
||||
btn_order_enable_by_call () {
|
||||
if (this.call_status != 'QUE.Sampling.Process')
|
||||
return false
|
||||
|
||||
return true
|
||||
},
|
||||
|
||||
btn_call () {
|
||||
let x = this.$store.state.queue.call_status
|
||||
if (x == null || x == 'QUE.Sampling.Skip')
|
||||
{ return { text: "Panggil", color: "green", act: "CALL", enable: true, icon: "icon-speaker" } }
|
||||
else if (x == 'QUE.Sampling.Call')
|
||||
{ return { text: "Skip", color: "orange", act: "SKIP", enable: true, icon: "icon-skip" } }
|
||||
else if (x == 'QUE.Sampling.Process')
|
||||
{ return { text: "Done", color: "blue", act: "DONE", enable: true, icon: "icon-check" } }
|
||||
else
|
||||
{ return { text: "Done", color: "blue", act: "DONE", enable: false, icon: "icon-check" } }
|
||||
},
|
||||
|
||||
btn_process_enable () {
|
||||
let x = this.$store.state.queue.call_status
|
||||
if (x == 'QUE.Sampling.Call')
|
||||
return true
|
||||
|
||||
return false
|
||||
},
|
||||
|
||||
btn_process_show () {
|
||||
let x = this.$store.state.queue.call_status
|
||||
if (x == 'QUE.Sampling.Done')
|
||||
return false
|
||||
|
||||
return true
|
||||
},
|
||||
|
||||
btn_recall_show () {
|
||||
return !this.btn_process_show
|
||||
},
|
||||
|
||||
req_status () {
|
||||
return this.$store.state.patient.req_status
|
||||
},
|
||||
|
||||
patient_photo () {
|
||||
|
||||
let x = this.$store.state.patient.selected_patient.photo
|
||||
if (x != null)
|
||||
return x
|
||||
|
||||
return "https://www.sgm-inc.com/wp-content/uploads/2014/06/no-profile-male-img.gif"
|
||||
},
|
||||
|
||||
call_status () {
|
||||
return this.$store.state.queue.call_status
|
||||
},
|
||||
|
||||
btn_req_enabled () {
|
||||
return this.btn_process_show
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
update_ver_photo (v) {
|
||||
this.ver_photo = v
|
||||
},
|
||||
|
||||
update_dialog_supervisor () {
|
||||
this.$store.commit('sampling/update_supervisor_dialog_is_active', true)
|
||||
},
|
||||
|
||||
call (act) {
|
||||
this.$store.commit('queue/update_act', act)
|
||||
this.$store.dispatch('queue/call')
|
||||
},
|
||||
|
||||
process () {
|
||||
this.$store.commit('queue/update_act', 'PROCESS')
|
||||
this.$store.dispatch('queue/call')
|
||||
},
|
||||
|
||||
recall () {
|
||||
this.$store.commit('queue/update_act', 'CALL')
|
||||
this.$store.dispatch('queue/recall')
|
||||
},
|
||||
|
||||
print_barcode () {
|
||||
this.$store.commit('sampling/update_dialog_barcode', true)
|
||||
},
|
||||
|
||||
sampleReq () {
|
||||
this.$store.commit('sampling/update_dialog_requirement', true)
|
||||
},
|
||||
|
||||
sampleReqOK () {
|
||||
this.$store.commit('sampling/update_selected_requirements', [])
|
||||
// this.$store.dispatch('sampling/save_requirement', 'Y')
|
||||
|
||||
this.$store.commit('patient/update_req', {req_status:'Y', reqs:[]})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
412
test/vuex/one-sampling-v2/components/oneSamplingInfoTube.vue
Normal file
412
test/vuex/one-sampling-v2/components/oneSamplingInfoTube.vue
Normal file
@@ -0,0 +1,412 @@
|
||||
<template>
|
||||
|
||||
<v-card flat class="transparent">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<v-layout row wrap>
|
||||
|
||||
<v-flex
|
||||
v-for="(tube, n) in tubes"
|
||||
xs4
|
||||
:class="['pr-'+ (n % 3 == 2 ? '0' : '2'), 'pt-2']"
|
||||
v-bind:key="n">
|
||||
<v-card
|
||||
elevation-2
|
||||
color=""
|
||||
class="pa-1">
|
||||
|
||||
<v-layout>
|
||||
<v-flex xs5>
|
||||
<v-card class="card-tube pt-1 mr-1 flexcard" height="100%">
|
||||
<v-img
|
||||
class="white--text ma-3"
|
||||
|
||||
:src="tube.sample_img"
|
||||
>
|
||||
</v-img>
|
||||
|
||||
<v-card-text class="grow"></v-card-text>
|
||||
<v-card-actions class="pa-0">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pl-1 pr-1>
|
||||
<v-btn color="green" class="xs12" block depressed @click="barcodeAdd(tube)" :disabled="!btn_sampling_enabled" :dark="btn_sampling_enabled">
|
||||
<span class="icon-add"></span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-btn color="orange" class="xs12" block dark outline depressed>{{ tube.status }}</v-btn>
|
||||
</v-flex>
|
||||
|
||||
|
||||
</v-layout>
|
||||
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
|
||||
</v-flex>
|
||||
<v-flex xs7>
|
||||
<v-card class="card-tube flexcard transparent" height="100%" flat>
|
||||
<v-card-text class="pa-1 grow">
|
||||
<v-layout column wrap>
|
||||
|
||||
<v-flex xs12 mb-2>
|
||||
<h6 class="title">{{ tube.sample_name }}</h6>
|
||||
<h6 class="body-2 orange--text">{{ tube.barcode_id }}</h6>
|
||||
</v-flex>
|
||||
|
||||
<v-layout row wrap>
|
||||
<v-flex xs7 mb-3>
|
||||
<!-- <one-date-picker
|
||||
label="Sampling Date"
|
||||
:date="tube.sampling_date == '0000-00-00' ? null : tube.sampling_date"
|
||||
@change="samplingDateChange"
|
||||
:data="n"
|
||||
:max_date="max_sampling_date"
|
||||
></one-date-picker> -->
|
||||
<one-date-picker-3
|
||||
label="Sampling Date"
|
||||
:date="tube.sampling_date == '0000-00-00' ? null : tube.sampling_date"
|
||||
@change="samplingDateChange"
|
||||
:data="n"
|
||||
:max_date="max_sampling_date">
|
||||
</one-date-picker-3>
|
||||
|
||||
</v-flex>
|
||||
<v-flex xs5 pl-1 mb-3>
|
||||
<v-text-field
|
||||
hide-details
|
||||
mask="##:##"
|
||||
:value="tube.sampling_time == '00:00' ? null : tube.sampling_time"
|
||||
@change="samplingTimeChange(n, $event)"
|
||||
return-masked-value
|
||||
label="Time"
|
||||
></v-text-field>
|
||||
<!-- <one-time-picker
|
||||
label="Time"
|
||||
:time="tube.sampling_time == '00:00:00' ? null : tube.sampling_time"
|
||||
:data="n"
|
||||
@change="samplingTimeChange"
|
||||
:max_time="max_sampling_time"
|
||||
>
|
||||
</one-time-picker> -->
|
||||
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs7>
|
||||
<v-text-field
|
||||
v-model="tube.receive_date"
|
||||
label="Receive Date"
|
||||
readonly
|
||||
browser-autocomplete="off"
|
||||
></v-text-field>
|
||||
<!-- <one-date-picker
|
||||
label="Receive Date"
|
||||
:date="tube.receive_date == '0000-00-00' ? null : tube.receive_date"
|
||||
@change="receiveDateChange"
|
||||
:data="n"
|
||||
:disabled="!dateEnabled(tube)"
|
||||
></one-date-picker> -->
|
||||
</v-flex>
|
||||
<v-flex xs5 pl-1>
|
||||
<v-text-field
|
||||
v-model="tube.receive_time"
|
||||
label="Time"
|
||||
readonly
|
||||
browser-autocomplete="off"
|
||||
></v-text-field>
|
||||
<!-- <one-time-picker
|
||||
label="Time"
|
||||
:time="tube.receive_time == '00:00:00' ? null : tube.receive_time"
|
||||
:data="n"
|
||||
@change="receiveTimeChange"
|
||||
:disabled="!dateEnabled(tube)"
|
||||
> -->
|
||||
<!-- </one-time-picker> -->
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
<v-card-actions class="pa-0">
|
||||
|
||||
<v-btn class="one-btn-icon mr-1 ma-0"
|
||||
:color="tube.req_status == 'N' ? 'red' : 'white'"
|
||||
v-show="tube.req_status == 'N' || tube.req_status == 'X'"
|
||||
@click="samplingNotOK(tube)"
|
||||
:disabled="!btn_sampling_enabled"
|
||||
:dark="btn_sampling_enabled && tube.req_status != 'X'">
|
||||
<v-icon>clear</v-icon>
|
||||
</v-btn>
|
||||
<v-spacer v-show="tube.req_status == 'Y' || tube.req_status == 'X'"></v-spacer>
|
||||
<v-btn
|
||||
v-show="tube.req_status == 'Y' || tube.req_status == 'X'"
|
||||
class="one-btn-icon mr-1 ma-0"
|
||||
:color="tube.req_status == 'Y' ? 'success' : 'white'"
|
||||
:dark="btn_sampling_enabled && tube.req_status != 'X'"
|
||||
@click="samplingOK(tube)"
|
||||
:disabled="!btn_sampling_enabled">
|
||||
<v-icon>done</v-icon>
|
||||
</v-btn>
|
||||
<!-- <v-btn
|
||||
block
|
||||
:dark="tube.status_name != 'SAMPLING.Sampling.Sampled' && btn_sampling_enabled && tube.sampling_date != null && tube.sampling_time != null"
|
||||
color="green"
|
||||
@click="sampling(tube)"
|
||||
:disabled="tube.status_name == 'SAMPLING.Sampling.Sampled' || !btn_sampling_enabled || tube.sampling_date == null || tube.sampling_time == null">
|
||||
Simpan
|
||||
|
||||
|
||||
</v-btn> -->
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
|
||||
<v-snackbar
|
||||
v-model="snackbar.status"
|
||||
top
|
||||
right
|
||||
:timeout="snackbar.timeout"
|
||||
>
|
||||
{{ snackbar.text }}
|
||||
<v-btn
|
||||
color="pink"
|
||||
flat
|
||||
@click="snackbar.status = false"
|
||||
>
|
||||
Close
|
||||
</v-btn>
|
||||
</v-snackbar>
|
||||
<one-dialog-confirm
|
||||
:text="'Anda akan menambah jumlah Sampel : ' + selected_sample_name"
|
||||
button_confirm="OK"
|
||||
@confirm="getMe"
|
||||
v-if="dialog_confirm"
|
||||
></one-dialog-confirm>
|
||||
</v-card>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.v-input__slot {
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
|
||||
.v-messages {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.v-text-field--box>.v-input__control>.v-input__slot,.v-text-field--full-width>.v-input__control>.v-input__slot,.v-text-field--outline>.v-input__control>.v-input__slot {
|
||||
min-height: 38px;
|
||||
}
|
||||
|
||||
.v-text-field--box.v-text-field--single-line input,.v-text-field--full-width.v-text-field--single-line input,.v-text-field--outline.v-text-field--single-line input {
|
||||
margin-top: 0px;
|
||||
font-size: .9em;
|
||||
}
|
||||
|
||||
.card-tube {
|
||||
min-height: 225px;
|
||||
}
|
||||
|
||||
.v-btn {
|
||||
min-width: 0px;
|
||||
}
|
||||
|
||||
.flexcard {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-date-picker' : httpVueLoader('./oneDatePicker2.vue'),
|
||||
'one-date-picker-3' : httpVueLoader('./oneDatePicker3.vue'),
|
||||
'one-time-picker' : httpVueLoader('./oneTimePicker.vue'),
|
||||
'one-dialog-confirm': httpVueLoader('../../common/oneDialogConfirm.vue')
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
|
||||
menu: false,
|
||||
modal: false,
|
||||
selected_sample_name: "",
|
||||
selected_sample_id: 0,
|
||||
selected_order_id: 0
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
sampling_btn_disabled () {
|
||||
|
||||
return true;
|
||||
|
||||
},
|
||||
tubes : {
|
||||
get() {
|
||||
return this.$store.state.sampling.samples
|
||||
},
|
||||
|
||||
set(v) {
|
||||
this.$store.commit('sampling/update_samples', {records:v})
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
snackbar : {
|
||||
get () {
|
||||
return this.$store.state.sampling.snackbar
|
||||
},
|
||||
|
||||
set(v) {
|
||||
this.$store.commit('sampling/update/snackbar', v)
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
max_sampling_date () {
|
||||
let today = new Date();
|
||||
let date = today.getFullYear()+'-'+("0" + (today.getMonth()+1)).slice(-2)+'-'+("0" + today.getDate()).slice(-2);
|
||||
|
||||
return date
|
||||
},
|
||||
|
||||
max_sampling_time () {
|
||||
let today = new Date();
|
||||
let time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
|
||||
|
||||
return time
|
||||
},
|
||||
|
||||
btn_sampling_enabled () {
|
||||
let x = this.$store.state.queue.call_status
|
||||
if ((x == "QUE.Sampling.Process" || x == "QUE.Sampling.Partial") &&
|
||||
this.$store.state.sampling.ver_photo.error == false)
|
||||
return true
|
||||
|
||||
return false
|
||||
},
|
||||
|
||||
dialog_confirm () {
|
||||
return this.$store.state.dialog_confirm
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
samplingDateChange (prm) {
|
||||
|
||||
let tbs = this.tubes;
|
||||
|
||||
if (prm.data == "") prm.data = "0"
|
||||
tbs[prm.data].sampling_date = prm.new_date;
|
||||
|
||||
this.tubes = tbs;
|
||||
},
|
||||
|
||||
samplingTimeChange (n, data) {
|
||||
let tbs = this.tubes;
|
||||
|
||||
if (n == "") n = "0"
|
||||
tbs[n].sampling_time = data;
|
||||
|
||||
this.tubes = tbs;
|
||||
},
|
||||
|
||||
receiveDateChange (prm) {
|
||||
|
||||
let tbs = this.tubes;
|
||||
|
||||
if (prm.data == "") prm.data = "0"
|
||||
tbs[prm.data].receive_date = prm.new_date;
|
||||
|
||||
this.tubes = tbs;
|
||||
},
|
||||
|
||||
receiveTimeChange (prm) {
|
||||
|
||||
let tbs = this.tubes;
|
||||
|
||||
if (prm.data == "") prm.data = "0"
|
||||
tbs[prm.data].receive_time = prm.new_time;
|
||||
|
||||
this.tubes = tbs;
|
||||
},
|
||||
|
||||
samplingNotOK (tube) {
|
||||
if (tube.receive == "Y" && tube.sampling == "Y") {
|
||||
alert('Specimen sudah disampling')
|
||||
return
|
||||
}
|
||||
|
||||
if (!tube.sampling_time.match(/(?:[01]\d|2[0123]):(?:[012345]\d)/g)) {
|
||||
alert('Cek kembali isian Sampling Time')
|
||||
return
|
||||
}
|
||||
|
||||
this.$store.commit('sampling/update_selected_sample', tube)
|
||||
this.$store.commit('sampling/update_requirements', tube.reqs)
|
||||
this.$store.commit('sampling/update_dialog_requirement', true)
|
||||
// this.$store.dispatch('sampling/save')
|
||||
},
|
||||
|
||||
samplingOK (tube) {
|
||||
if (tube.receive == "Y" && tube.sampling == "Y") {
|
||||
alert('Specimen sudah disampling')
|
||||
return
|
||||
}
|
||||
|
||||
if (!tube.sampling_time.match(/(?:[01]\d|2[0123]):(?:[012345]\d)/g)) {
|
||||
alert('Cek kembali isian Sampling Time')
|
||||
return
|
||||
}
|
||||
|
||||
// this.$store.commit('sampling/update_reqstate', 'Y')
|
||||
tube.req_status = "Y"
|
||||
let x = this.tubes
|
||||
for (let i in x)
|
||||
if (tube.barcode == x[i].barcode)
|
||||
x[i].req_status = "Y"
|
||||
|
||||
this.tubes = x
|
||||
this.$store.commit('sampling/update_selected_sample', tube)
|
||||
|
||||
this.$store.dispatch('sampling/save')
|
||||
},
|
||||
|
||||
dateEnabled (tube) {
|
||||
if (tube.status_name == 'SAMPLING.Sampling.Sampled')
|
||||
return false
|
||||
|
||||
return true
|
||||
},
|
||||
|
||||
barcodeAdd(t) {
|
||||
|
||||
|
||||
|
||||
this.selected_sample_name = t.sample_name
|
||||
this.selected_sample_id = t.sample_id
|
||||
this.selected_order_id = t.order_id
|
||||
|
||||
this.$store.commit('update_dialog_confirm', true)
|
||||
|
||||
},
|
||||
|
||||
getMe() {
|
||||
this.$store.dispatch('sampling/barcode_add', {order_id:this.selected_order_id, sample_id:this.selected_sample_id})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,66 @@
|
||||
<template>
|
||||
<v-layout column fill-height>
|
||||
<!-- <v-flex xs12> -->
|
||||
<v-card class="pa-1 mb-2">
|
||||
<v-card-text class="pa-0">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<patient-search-box></patient-search-box>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
<!-- <v-card-actions class="text-xs-right">
|
||||
|
||||
<v-btn color="orange" class="white--text">Lanjut</v-btn>
|
||||
</v-card-actions> -->
|
||||
|
||||
</v-card>
|
||||
<!-- </v-flex> -->
|
||||
|
||||
<!-- <v-flex xs12 grow> -->
|
||||
<v-card class="pa-1 p-left-side grow fill-height">
|
||||
<v-card-text class="pa-0 grow">
|
||||
<v-layout column>
|
||||
|
||||
<v-flex xs12>
|
||||
<!-- <patient-detail></patient-detail> -->
|
||||
<patient-search-result></patient-search-result>
|
||||
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12>
|
||||
<!-- <patient-notes></patient-notes> -->
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
<!-- <v-card-actions class="text-xs-right">
|
||||
|
||||
<v-btn color="orange" class="white--text">Lanjut</v-btn>
|
||||
</v-card-actions> -->
|
||||
|
||||
</v-card>
|
||||
<!-- </v-flex> -->
|
||||
</v-layout>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* .p-left-side {
|
||||
min-height: 500px;
|
||||
} */
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'patient-search-box' : httpVueLoader('./oneSamplingPatientSearchBox.vue'),
|
||||
'patient-search-result' : httpVueLoader('./oneSamplingPatientSearchResult.vue')
|
||||
// 'patient-detail': httpVueLoader('./patientDetail.vue'),
|
||||
// 'patient-search-result' : httpVueLoader('./patientSearchResult.vue')
|
||||
// 'patient-notes' : httpVueLoader('./patientNotes.vue')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<v-card class="pa-2" flat>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs3 pa-1>
|
||||
<v-text-field
|
||||
label="Search"
|
||||
placeholder="No Lab"
|
||||
single-line
|
||||
outline
|
||||
hide-details
|
||||
v-model="nolab"
|
||||
@keyup.native="keySearch"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs3 pa-1>
|
||||
<v-text-field
|
||||
label=""
|
||||
placeholder="Nama"
|
||||
single-line
|
||||
outline
|
||||
hide-details
|
||||
v-model="search_x"
|
||||
@keyup.native="keySearch"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs3 pa-1>
|
||||
<v-select
|
||||
outline
|
||||
label="Station"
|
||||
:items="stations"
|
||||
item-value="id"
|
||||
item-text="text"
|
||||
return-object
|
||||
v-model="selected_station"
|
||||
></v-select>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs2 pa-1>
|
||||
<v-select
|
||||
outline
|
||||
label="Status"
|
||||
:items="statuses"
|
||||
item-value="id"
|
||||
item-text="text"
|
||||
return-object
|
||||
v-model="selected_status"
|
||||
></v-select>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs1>
|
||||
<v-btn color="success" class="mr-1 ml-1 one-btn-icon" large block fill-height @click="search">
|
||||
<span class="icon-search"></span>
|
||||
</v-btn>
|
||||
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-card>
|
||||
</template>
|
||||
<style scoped>
|
||||
.v-btn {
|
||||
min-width: auto;
|
||||
}
|
||||
|
||||
.v-btn--large {
|
||||
height: 52px;
|
||||
}
|
||||
.one-btn-icon {
|
||||
font-size: 1.5em
|
||||
}
|
||||
/* .v-input__slot {
|
||||
margin-bottom: 0px !important;
|
||||
} */
|
||||
|
||||
/* .v-messages {
|
||||
display: none;
|
||||
} */
|
||||
|
||||
/* .v-text-field--box>.v-input__control>.v-input__slot,.v-text-field--full-width>.v-input__control>.v-input__slot,.v-text-field--outline>.v-input__control>.v-input__slot {
|
||||
min-height: 44px;
|
||||
} */
|
||||
|
||||
/* .v-text-field--box.v-text-field--single-line input,.v-text-field--full-width.v-text-field--single-line input,.v-text-field--outline.v-text-field--single-line input {
|
||||
margin-top: 6px;
|
||||
} */
|
||||
|
||||
.v-select.v-text-field--enclosed:not(.v-text-field--single-line) .v-select__selections {
|
||||
padding-top: 20px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
// 'patient-search-dialog': httpVueLoader('./patientSearchDialog.vue'),
|
||||
// 'patient-new-dialog': httpVueLoader('./patientNewDialog.vue')
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
search : function() {
|
||||
this.$store.dispatch('patient/search')
|
||||
},
|
||||
|
||||
keySearch(e) {
|
||||
if (e.which == 13) {
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
search_x: {
|
||||
get() {
|
||||
return this.$store.state.patient.search
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('patient/update_search',val)
|
||||
}
|
||||
},
|
||||
|
||||
statuses () {
|
||||
return this.$store.state.patient.statuses
|
||||
},
|
||||
|
||||
stations () {
|
||||
return this.$store.state.patient.station
|
||||
},
|
||||
|
||||
selected_status : {
|
||||
get () {
|
||||
return this.$store.state.patient.selected_status
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('patient/update_selected_status', v)
|
||||
}
|
||||
},
|
||||
|
||||
selected_station : {
|
||||
get () {
|
||||
return this.$store.state.patient.selected_station
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('patient/update_selected_station', v)
|
||||
this.$store.commit('queue/update_station_id', v.id)
|
||||
}
|
||||
},
|
||||
|
||||
nolab : {
|
||||
get () {
|
||||
return this.$store.state.patient.nolab
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('patient/update_nolab', v)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$store.dispatch('patient/get_stations')
|
||||
// let st = this.$store.state.patient.statuses[0]
|
||||
// this.$store.commit('patient/update_selected_status', st)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,213 @@
|
||||
<template>
|
||||
<v-card class="xs12 md12 mt-2" >
|
||||
|
||||
<v-data-table :headers="headers" :items="patients"
|
||||
:loading="isLoading"
|
||||
hide-actions class="elevation-1">
|
||||
|
||||
<template slot="no-data">
|
||||
<v-alert :value="isError" color="error" icon="warning">
|
||||
Data Pasien tidak di temukan
|
||||
{{errorMessage}}
|
||||
</v-alert>
|
||||
</template>
|
||||
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)" @click="selectMe(props.item)">{{ props.item.T_OrderHeaderLabNumber }}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)" @click="selectMe(props.item)">{{ props.item.M_PatientNoReg }}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)" @click="selectMe(props.item)">{{ props.item.M_PatientName }}</td>
|
||||
<td class="pa-2" v-bind:class="is_selected(props.item)" @click="selectMe(props.item)">
|
||||
<v-btn outline small :color="status_code(props.item.status_code).color" dark class="mb-0 mt-0">
|
||||
{{ status_code(props.item.status_code).text }}
|
||||
</v-btn>
|
||||
</td>
|
||||
<td class="pa-2" v-bind:class="is_selected(props.item)" @click="selectMe(props.item)">
|
||||
<v-btn outline small :color="call_status_code(props.item.call_status_code).color" dark class="mb-0 mt-0">
|
||||
{{ call_status_code(props.item.call_status_code).text }}
|
||||
</v-btn>
|
||||
|
||||
</td>
|
||||
|
||||
</template>
|
||||
|
||||
</v-data-table>
|
||||
</v-card>
|
||||
</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: "",
|
||||
headers: [
|
||||
{
|
||||
text: "NO LAB",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NO RM",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "55%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "SAMPLING STATUS",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "hp",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "PEMANGGILAN",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "hp",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
|
||||
computed : {
|
||||
isError() {
|
||||
// return true;
|
||||
return this.$store.state.patient.search_status == 3
|
||||
},
|
||||
errorMessage() {
|
||||
return this.$store.state.patient.search_error_message
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.patient.search_status == 1
|
||||
},
|
||||
patients() {
|
||||
return this.$store.state.patient.patients
|
||||
},
|
||||
total() {
|
||||
return this.$store.state.patient.total_patient
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
selectMe (a) {
|
||||
let z = {
|
||||
mr: a.M_PatientNoReg,
|
||||
name: a.M_PatientName,
|
||||
phone: a.M_PatientHP,
|
||||
dob: a.M_PatientDOB,
|
||||
age: a.T_OrderHeaderM_PatientAge,
|
||||
order_id: a.T_OrderHeaderID,
|
||||
photo: a.M_PatientPhoto,
|
||||
lab_no: a.T_OrderHeaderLabNumber,
|
||||
sex: a.M_SexName
|
||||
}
|
||||
|
||||
this.$store.commit('patient/update_selected_patient', z)
|
||||
this.$store.dispatch('sampling/get_samples', {
|
||||
order_id:a.T_OrderHeaderID,
|
||||
station_id:this.$store.state.patient.selected_station.id
|
||||
})
|
||||
|
||||
this.$store.commit('sampling/update_note_sampling', a.T_OrderHeaderSamplingNote)
|
||||
this.$store.commit('sampling/update_note_fo', a.T_OrderHeaderFoNote)
|
||||
this.$store.commit('sampling/update_if_ver_photo', false)
|
||||
this.$store.commit('sampling/update_ver_photo',
|
||||
{ checked:(a.ver_photo=='Y'?true:false),
|
||||
note:a.ver_photo_note,
|
||||
error:(a.ver_photo=='Y' || (a.ver_photo_note!='' && a.ver_photo_note!=null)) ? false : true })
|
||||
var x = this.$store
|
||||
setTimeout(function(){ x.commit('sampling/update_if_ver_photo', true) }, 50)
|
||||
|
||||
this.$store.commit('sampling/update_note_supervisor', a.note_supervisor)
|
||||
|
||||
// QUEUE
|
||||
this.$store.commit('queue/update_order_id', a.T_OrderHeaderID)
|
||||
this.$store.commit('queue/update_call_status', a.call_status_code)
|
||||
this.$store.commit('queue/update_call_status_id', a.call_status_id)
|
||||
|
||||
// Requirements
|
||||
this.$store.commit('patient/update_req', {req_status:a.req_status, reqs:JSON.parse(a.reqs)})
|
||||
},
|
||||
|
||||
call_status_code(x) {
|
||||
let y = {}
|
||||
switch(x) {
|
||||
case "QUE.Sampling.Call":
|
||||
y = {text:"DIPANGGIL", color:"green"}
|
||||
break
|
||||
case "QUE.Sampling.Skip":
|
||||
y = {text:"DILEWATI", color:"orange"}
|
||||
break
|
||||
case "QUE.Sampling.Process":
|
||||
y = {text:"DIPROSES", color:"green"}
|
||||
break
|
||||
case "QUE.Sampling.Partial":
|
||||
y = {text:"PARSIAL", color:"yellow"}
|
||||
break
|
||||
case "QUE.Sampling.Done":
|
||||
y = {text:"SELESAI", color:"black"}
|
||||
break
|
||||
default:
|
||||
y = {text:"BARU", color:"blue"}
|
||||
}
|
||||
|
||||
return y
|
||||
},
|
||||
|
||||
status_code(x) {
|
||||
let y = {}
|
||||
switch(x) {
|
||||
case "N":
|
||||
y = {text:"BARU", color:"blue"}
|
||||
break
|
||||
case "X":
|
||||
y = {text:"PARSIAL", color:"orange"}
|
||||
break
|
||||
case "Y":
|
||||
y = {text:"SELESAI", color:"black"}
|
||||
break
|
||||
default:
|
||||
y = {text:"BARU", color:"blue"}
|
||||
}
|
||||
|
||||
return y
|
||||
},
|
||||
|
||||
is_selected (item) {
|
||||
let x = this.$store.state.patient.selected_patient
|
||||
if (!x)
|
||||
return ''
|
||||
|
||||
if (x.order_id == item.T_OrderHeaderID)
|
||||
return 'amber lighten-5'
|
||||
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
186
test/vuex/one-sampling-v2/components/oneSamplingPrintBarcode.vue
Normal file
186
test/vuex/one-sampling-v2/components/oneSamplingPrintBarcode.vue
Normal file
@@ -0,0 +1,186 @@
|
||||
<template>
|
||||
|
||||
<v-dialog
|
||||
v-model="dialog"
|
||||
width="500px"
|
||||
>
|
||||
|
||||
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline grey lighten-2 pt-2 pb-2"
|
||||
primary-title
|
||||
>
|
||||
CETAK BARCODE
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
|
||||
<v-layout>
|
||||
<v-flex xs12>
|
||||
<v-data-table :items="samples"
|
||||
|
||||
hide-actions class="elevation-1">
|
||||
|
||||
<template slot="headers" slot-scope="props">
|
||||
<tr>
|
||||
<th width="10%" class="text-xs-left pa-2 primary white--text">
|
||||
<v-checkbox
|
||||
primary
|
||||
hide-details
|
||||
color="white"
|
||||
dark
|
||||
input-value="N"
|
||||
true-value="Y"
|
||||
false-value="N"
|
||||
@change="selectAllBarcode"
|
||||
></v-checkbox>
|
||||
</th>
|
||||
<th width="50%" class="text-xs-left pa-2 primary white--text">
|
||||
NAMA SAMPEL
|
||||
</th>
|
||||
<th width="25%" class="text-xs-left pa-2 primary white--text">
|
||||
NO BARCODE
|
||||
</th>
|
||||
<th width="15%" class="pa-2 primary white--text">
|
||||
CETAK
|
||||
</th>
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
<template slot="no-data">
|
||||
<v-alert :value="true" color="error" icon="warning">
|
||||
Data Pasien tidak di temukan
|
||||
|
||||
</v-alert>
|
||||
</template>
|
||||
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)" @click="selectMe(props.item)">
|
||||
<v-checkbox v-model="selected_barcodes" :value="props.item.barcode" hide-details></v-checkbox>
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)" @click="selectMe(props.item)">{{ props.item.sample_name }}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)" @click="selectMe(props.item)">{{ props.item.barcode }}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="is_selected(props.item)" @click="selectMe(props.item)">
|
||||
<v-btn color="orange" class="one-btn-icon mt-0 mb-0" dark @click="printOne(props.item.barcode)"><span class="icon-print"></span></v-btn>
|
||||
</td>
|
||||
|
||||
</template>
|
||||
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-btn
|
||||
color="primary"
|
||||
@click="dialog = false"
|
||||
flat
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="orange"
|
||||
@click="printMultiple"
|
||||
:dark="selected_barcodes.length > 0"
|
||||
:disabled="selected_barcodes < 1"
|
||||
class="mr-2"
|
||||
>
|
||||
<span class="icon-print"></span>
|
||||
Cetak Terpilih ({{ selected_barcodes.length }})
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
},
|
||||
data () {
|
||||
return {}
|
||||
},
|
||||
|
||||
methods : {
|
||||
selectMe (x) {
|
||||
return
|
||||
},
|
||||
|
||||
is_selected (x) {
|
||||
return
|
||||
},
|
||||
|
||||
selectBarcode (x, e) {
|
||||
let y = this.$store.state.sampling.selected_barcodes
|
||||
y[x] = e
|
||||
this.$store.commit('sampling/update_selected_barcodes', y)
|
||||
},
|
||||
|
||||
selectAllBarcode (e) {
|
||||
let y = []
|
||||
if (e == "Y") {
|
||||
let x = this.$store.state.sampling.samples
|
||||
|
||||
for (let i in x)
|
||||
y.push(x[i].barcode)
|
||||
}
|
||||
|
||||
this.$store.commit('sampling/update_selected_barcodes', y)
|
||||
},
|
||||
|
||||
printOne(x) {
|
||||
return window.one_print_barcode_pk(x)
|
||||
},
|
||||
|
||||
printMultiple () {
|
||||
let y = this.$store.state.sampling.selected_barcodes
|
||||
return window.one_print_barcode_pk(y.join(','))
|
||||
}
|
||||
},
|
||||
computed : {
|
||||
dialog: {
|
||||
get() {
|
||||
return this.$store.state.sampling.dialog_barcode;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('sampling/update_dialog_barcode', val);
|
||||
}
|
||||
},
|
||||
|
||||
samples () {
|
||||
return this.$store.state.sampling.samples
|
||||
},
|
||||
|
||||
selected_barcodes : {
|
||||
get () {
|
||||
return this.$store.state.sampling.selected_barcodes
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('sampling/update_selected_barcodes', v)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
watch : {
|
||||
dialog (n, o) {
|
||||
if (n && !o) {
|
||||
// let x = this.$store.state.sampling.samples
|
||||
let y = []
|
||||
// for (let i in x)
|
||||
// y.push(x[i].barcode)
|
||||
|
||||
this.$store.commit('sampling/update_selected_barcodes', y)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
117
test/vuex/one-sampling-v2/components/oneSamplingRequirement.vue
Normal file
117
test/vuex/one-sampling-v2/components/oneSamplingRequirement.vue
Normal file
@@ -0,0 +1,117 @@
|
||||
<template>
|
||||
|
||||
<v-dialog
|
||||
v-model="dialog"
|
||||
width="500"
|
||||
>
|
||||
|
||||
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline grey lighten-2 pt-2 pb-2"
|
||||
primary-title
|
||||
>
|
||||
Syarat Sampling
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 v-for="(req, i) in requirements" v-bind:key="i">
|
||||
<v-checkbox :label="req.req_name" v-model="selected_requirements" :value="req.req_id"
|
||||
hide-details></v-checkbox>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-btn
|
||||
color="primary"
|
||||
flat
|
||||
@click="dialog = false"
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="primary"
|
||||
@click="save"
|
||||
:disabled="selected_requirements.length < 1"
|
||||
:dark="selected_requirements.length > 0"
|
||||
>
|
||||
Simpan
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
},
|
||||
methods : {
|
||||
save () {
|
||||
// this.$store.dispatch('sampling/save_requirement', "N")
|
||||
// this.$store.commit('patient/update_req', {req_status:'N', reqs:this.selected_requirements})
|
||||
// this.$store.commit('sampling/update_reqstate', "N")
|
||||
let x = this.$store.state.sampling.samples
|
||||
let y = this.$store.state.sampling.selected_sample
|
||||
for (let i in x)
|
||||
if (x[i].barcode == y.barcode) {
|
||||
x[i].req_status = "N"
|
||||
y.req_status = "N"
|
||||
}
|
||||
this.$store.commit('sampling/update_samples', {records:x})
|
||||
this.$store.commit('sampling/update_selected_sample', y)
|
||||
|
||||
this.$store.dispatch('sampling/save');
|
||||
this.$store.commit('sampling/update_dialog_requirement', false)
|
||||
}
|
||||
},
|
||||
computed : {
|
||||
dialog: {
|
||||
get() {
|
||||
return this.$store.state.sampling.dialog_requirement;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('sampling/update_dialog_requirement', val);
|
||||
}
|
||||
},
|
||||
|
||||
requirements : {
|
||||
get () {
|
||||
return this.$store.state.sampling.requirements
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('sampling/update_requirements', v)
|
||||
}
|
||||
},
|
||||
|
||||
selected_requirements : {
|
||||
get () {
|
||||
return this.$store.state.sampling.selected_requirements
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('sampling/update_selected_requirements', v)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$store.dispatch('sampling/get_requirement')
|
||||
},
|
||||
|
||||
watch : {
|
||||
dialog(n, o) {
|
||||
let x = this.$store.state.patient.reqs
|
||||
if (n && !o)
|
||||
this.$store.commit('sampling/update_selected_requirements', x)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,84 @@
|
||||
<template>
|
||||
|
||||
<v-dialog
|
||||
v-model="dialog"
|
||||
width="500"
|
||||
>
|
||||
|
||||
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline grey lighten-2 pt-2 pb-2"
|
||||
primary-title
|
||||
>
|
||||
Catatan Untuk Supervisor
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
<v-textarea
|
||||
auto-grow
|
||||
label="Catatan Untuk Supervisor"
|
||||
rows="2"
|
||||
v-model="note_supervisor"
|
||||
outline
|
||||
class="mb-0"
|
||||
hide-details
|
||||
></v-textarea>
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-btn
|
||||
color="primary"
|
||||
flat
|
||||
@click="dialog = false"
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="primary"
|
||||
dark
|
||||
@click="save"
|
||||
>
|
||||
Simpan
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
},
|
||||
methods : {
|
||||
save () {
|
||||
this.$store.dispatch('sampling/save_note_supervisor')
|
||||
}
|
||||
},
|
||||
computed : {
|
||||
dialog: {
|
||||
get() {
|
||||
return this.$store.state.sampling.supervisor_dialog_is_active;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('sampling/update_supervisor_dialog_is_active', val);
|
||||
}
|
||||
},
|
||||
|
||||
note_supervisor: {
|
||||
get() {
|
||||
return this.$store.state.sampling.note_supervisor
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('sampling/update_note_supervisor', val)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
65
test/vuex/one-sampling-v2/components/oneSamplingTab.vue
Normal file
65
test/vuex/one-sampling-v2/components/oneSamplingTab.vue
Normal file
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<v-layout>
|
||||
<v-flex xs12 text-xs-center mb-2>
|
||||
<v-card color="blue lighten-4">
|
||||
<v-card-text class="pb-0 pt-1">
|
||||
<v-btn
|
||||
v-for="tab in tabs"
|
||||
:color="tab.code == active ? 'white' : 'grey lighten-5'"
|
||||
class="white--text ma-0 tab-btn"
|
||||
:class="[tab.code == active ? 'active' : '']"
|
||||
@click="changeTab(tab.code)"
|
||||
flat
|
||||
:key="tab.code"
|
||||
:data="tab"
|
||||
>
|
||||
<v-icon left dark>{{ tab.icon }}</v-icon>
|
||||
<h6 class="title">{{ tab.label }}</h6>
|
||||
</v-btn>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.active {
|
||||
border-bottom: solid 3px #ffeb3b!important;
|
||||
}
|
||||
|
||||
.tab-btn {
|
||||
min-width: 400px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
changeTab (x) {
|
||||
// this.active = x;
|
||||
this.$store.commit('change_tab', x);
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
tabs : {
|
||||
get () {
|
||||
return this.$store.state.tabs
|
||||
},
|
||||
set (v) {
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
active () {
|
||||
return this.$store.state.tab_active
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
93
test/vuex/one-sampling-v2/components/oneTimePicker.vue
Normal file
93
test/vuex/one-sampling-v2/components/oneTimePicker.vue
Normal file
@@ -0,0 +1,93 @@
|
||||
<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="init_time"
|
||||
:label=init_label
|
||||
persistent-hint
|
||||
readonly
|
||||
browser-autocomplete="off"
|
||||
></v-text-field>
|
||||
<v-time-picker
|
||||
v-if="menu2"
|
||||
v-model="init_time"
|
||||
full-width
|
||||
@click:minute="save(init_time)"
|
||||
:max="init_max_time"
|
||||
format="24hr"
|
||||
></v-time-picker>
|
||||
|
||||
</v-menu>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props : ['label', 'time', 'data', 'max_time'],
|
||||
|
||||
data () {
|
||||
return {
|
||||
init_time: this.time && this.time != "00:00:00" ? this.time : null,
|
||||
init_max_time: this.max_time ? this.max_time : '24:00:00',
|
||||
timeFormatted: "00:00",
|
||||
menu1: false,
|
||||
menu2: false,
|
||||
|
||||
init_label: this.label ? this.label : 'Time',
|
||||
init_data: this.data ? this.data : ''
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
computedTimeFormatted () {
|
||||
return this.formatTime(this.init_time)
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
init_time (n, o) {
|
||||
this.timeFormatted = this.formatTime(this.init_time)
|
||||
|
||||
this.$emit('change', {"old_time":o, "new_time":n, "data":this.init_data});
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
formatTime (time) {
|
||||
return time;
|
||||
// if (!date) return null
|
||||
|
||||
// const [year, month, day] = date.split('-')
|
||||
// return `${day}-${month}-${year}`
|
||||
},
|
||||
parseTime (time) {
|
||||
// if (!date) return null
|
||||
|
||||
// const [month, day, year] = date.split('/')
|
||||
// return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
|
||||
return time;
|
||||
},
|
||||
|
||||
emitChange (n, o) {
|
||||
console.log("old:"+o)
|
||||
console.log("new:"+n)
|
||||
},
|
||||
|
||||
save (time) {
|
||||
console.log("time:"+time)
|
||||
this.$emit('change', {"new_time":time, "data":this.data});
|
||||
this.menu2 = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
104
test/vuex/one-sampling-v2/index.php
Normal file
104
test/vuex/one-sampling-v2/index.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<!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-layout>
|
||||
<one-sampling-tab></one-sampling-tab>
|
||||
</v-layout>
|
||||
<v-layout v-show="tab_active == '01'">
|
||||
<v-flex xs6 pr-1>
|
||||
<one-sampling-patient-list></one-sampling-patient-list>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs6 pl-1>
|
||||
<one-sampling-info> </one-sampling-info>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout v-show="tab_active == '02'">
|
||||
<v-flex xs6 pr-1>
|
||||
<one-fo-verification-from-sampling-list></one-fo-verification-from-sampling-list>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs6 pl-1>
|
||||
<one-fo-verification-receive-list></one-fo-verification-receive-list>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-footer> </one-footer>
|
||||
<one-sampling-print-barcode></one-sampling-print-barcode>
|
||||
<one-sampling-requirement></one-sampling-requirement>
|
||||
</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/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>
|
||||
<script src="../../../libs/one_print_barcode.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-sampling-info': httpVueLoader('./components/oneSamplingInfo.vue'),
|
||||
'one-sampling-tab': httpVueLoader('./components/oneSamplingTab.vue'),
|
||||
'one-sampling-patient-list': httpVueLoader('./components/oneSamplingPatientList.vue'),
|
||||
'one-fo-verification-from-sampling-list': httpVueLoader('./components/oneFoVerificationFromSamplingList.vue'),
|
||||
'one-fo-verification-receive-list': httpVueLoader('./components/oneFoVerificationReceiveList.vue'),
|
||||
'one-sampling-print-barcode': httpVueLoader('./components/oneSamplingPrintBarcode.vue'),
|
||||
'one-sampling-requirement': httpVueLoader('./components/oneSamplingRequirement.vue')
|
||||
},
|
||||
|
||||
computed : {
|
||||
tab_active () {
|
||||
return store.state.tab_active
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
store.dispatch('ver_patient/search')
|
||||
// store.dispatch('ver_patient/search_sent')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
143
test/vuex/one-sampling-v2/modules/patient.js
Normal file
143
test/vuex/one-sampling-v2/modules/patient.js
Normal file
@@ -0,0 +1,143 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/patient.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
nolab:'',
|
||||
search: '',
|
||||
statuses : [{id:'A', text:'Semua'},
|
||||
{id:'N', text:'Belum Sampling'},
|
||||
// {id:'X', text:'Parsial Sampling'},
|
||||
{id:'Y', text:'Selesai Sampling'}],
|
||||
station : [],
|
||||
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
search_dialog_is_active: false,
|
||||
patients: [],
|
||||
total_patient: 0,
|
||||
selected_patient: {
|
||||
mr : '-',
|
||||
name : '-',
|
||||
dob : '-',
|
||||
phone : '-',
|
||||
order_id : 0
|
||||
},
|
||||
|
||||
selected_status : {id:'N', text:'Belum Sampling'},
|
||||
selected_station : {},
|
||||
|
||||
// requirements
|
||||
req_status: "X",
|
||||
reqs: []
|
||||
},
|
||||
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
|
||||
},
|
||||
update_selected_patient(state,val) {
|
||||
state.selected_patient=val
|
||||
},
|
||||
|
||||
update_selected_status(state, val) {
|
||||
state.selected_status = val
|
||||
},
|
||||
|
||||
update_selected_station(state, val) {
|
||||
state.selected_station = val
|
||||
},
|
||||
|
||||
update_nolab(state, val) {
|
||||
state.nolab = val
|
||||
},
|
||||
|
||||
update_stations(state, val) {
|
||||
state.station = val
|
||||
},
|
||||
|
||||
update_req(state, v) {
|
||||
state.req_status = v.req_status
|
||||
state.reqs = v.reqs
|
||||
},
|
||||
|
||||
update_req_status(state, v) {
|
||||
state.req_status = v
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.search(context.state.nolab, context.state.search, context.state.selected_station.id, context.state.selected_status.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,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_patients", data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async get_stations(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let token = one_token()
|
||||
let resp= await api.get_stations(token)
|
||||
|
||||
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.commit("update_stations", resp.data.records)
|
||||
|
||||
if (resp.data.records.length > 0) {
|
||||
context.commit("update_selected_station", resp.data.records[0])
|
||||
context.dispatch("search")
|
||||
|
||||
// QUEUE
|
||||
context.commit("queue/update_station_id", resp.data.records[0].id, {root:true})
|
||||
}
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
118
test/vuex/one-sampling-v2/modules/queue.js
Normal file
118
test/vuex/one-sampling-v2/modules/queue.js
Normal file
@@ -0,0 +1,118 @@
|
||||
import * as api from "../api/queue.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced : true,
|
||||
state : {
|
||||
search_status: 0,
|
||||
search_error_message: '',
|
||||
|
||||
order_id: 0,
|
||||
station_id: 0,
|
||||
act: 'CALL',
|
||||
call_status: null,
|
||||
call_status_id: null
|
||||
},
|
||||
|
||||
mutations : {
|
||||
update_search_status (state, v) {
|
||||
state.search_status = v
|
||||
},
|
||||
|
||||
update_search_error_message (state, v) {
|
||||
state.search_error_message = v
|
||||
},
|
||||
|
||||
update_order_id (state, v) {
|
||||
state.order_id = v
|
||||
},
|
||||
|
||||
update_station_id (state, v) {
|
||||
state.station_id = v
|
||||
},
|
||||
|
||||
update_act (state, v) {
|
||||
state.act = v
|
||||
},
|
||||
|
||||
update_call_status (state, v) {
|
||||
state.call_status = v
|
||||
},
|
||||
|
||||
update_call_status_id (state, v) {
|
||||
state.call_status_id = v
|
||||
}
|
||||
},
|
||||
|
||||
actions : {
|
||||
async call(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp = await api.call(one_token(), context.state.order_id, context.state.station_id, context.state.act)
|
||||
|
||||
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 = JSON.parse(resp.data.data)
|
||||
context.commit("update_call_status", data.call_status_code)
|
||||
context.commit("update_call_status_id", data.call_status_id)
|
||||
|
||||
let x = context.rootState.patient.patients
|
||||
let y = context.rootState.patient.total_patient
|
||||
for (let i in x) {
|
||||
if (x[i].T_OrderHeaderID == context.state.order_id) {
|
||||
x[i].call_status_id = data.call_status_id
|
||||
x[i].call_status_code = data.call_status_code
|
||||
}
|
||||
}
|
||||
|
||||
context.commit('patient/update_patients', {records:x, total:y}, {root:true})
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async recall(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp = await api.recall(one_token(), context.state.order_id, context.state.station_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 = JSON.parse(resp.data.data)
|
||||
context.commit("update_call_status", data.call_status_code)
|
||||
context.commit("update_call_status_id", data.call_status_id)
|
||||
|
||||
let x = context.rootState.patient.patients
|
||||
let y = context.rootState.patient.total_patient
|
||||
for (let i in x) {
|
||||
if (x[i].T_OrderHeaderID == context.state.order_id) {
|
||||
x[i].call_status_id = data.call_status_id
|
||||
x[i].call_status_code = data.call_status_code
|
||||
}
|
||||
}
|
||||
|
||||
context.commit('patient/update_patients', {records:x, total:y}, {root:true})
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
329
test/vuex/one-sampling-v2/modules/sampling.js
Normal file
329
test/vuex/one-sampling-v2/modules/sampling.js
Normal file
@@ -0,0 +1,329 @@
|
||||
import * as api from "../api/sampling.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced : true,
|
||||
state : {
|
||||
samples : [],
|
||||
selected_sample : {},
|
||||
snackbar : {
|
||||
status : false,
|
||||
text : 'Some text',
|
||||
timeout : 3000
|
||||
},
|
||||
ver_photo : {
|
||||
checked : false,
|
||||
note : ""
|
||||
},
|
||||
|
||||
note_sampling : '',
|
||||
note_fo : '',
|
||||
|
||||
if_ver_photo : false,
|
||||
supervisor_dialog_is_active : false,
|
||||
note_supervisor : "",
|
||||
|
||||
// barcode
|
||||
dialog_barcode: false,
|
||||
selected_barcodes: [],
|
||||
|
||||
// requirement
|
||||
dialog_requirement: false,
|
||||
requirements: [],
|
||||
selected_requirements: [],
|
||||
reqstate: "Y"
|
||||
},
|
||||
|
||||
mutations : {
|
||||
update_samples(state, data) {
|
||||
state.samples = []
|
||||
setTimeout(function() { state.samples = data.records }, 100)
|
||||
},
|
||||
|
||||
update_sample(state, data) {
|
||||
let x = state.samples
|
||||
let y = data.records
|
||||
for (let i in x) {
|
||||
if (x[i].order_id == y.order_id &&
|
||||
x[i].sample_id == y.sample_id &&
|
||||
x[i].barcode == y.barcode)
|
||||
x[i] = y
|
||||
}
|
||||
state.samples = x
|
||||
},
|
||||
|
||||
update_selected_sample(state, data) {
|
||||
state.selected_sample = data
|
||||
},
|
||||
|
||||
update_snackbar(state, data) {
|
||||
state.snackbar = data
|
||||
},
|
||||
|
||||
update_ver_photo(state, data) {
|
||||
state.ver_photo = data
|
||||
},
|
||||
|
||||
update_note_sampling(state, data) {
|
||||
state.note_sampling = data
|
||||
},
|
||||
|
||||
update_note_fo(state, data) {
|
||||
state.note_fo = data
|
||||
},
|
||||
|
||||
update_if_ver_photo(state, data) {
|
||||
state.if_ver_photo = data
|
||||
},
|
||||
|
||||
update_supervisor_dialog_is_active(state, data) {
|
||||
state.supervisor_dialog_is_active = data
|
||||
},
|
||||
|
||||
update_note_supervisor(state, data) {
|
||||
state.note_supervisor = data
|
||||
},
|
||||
|
||||
update_dialog_barcode(state, v) {
|
||||
state.dialog_barcode = v
|
||||
},
|
||||
|
||||
update_selected_barcodes(state, v) {
|
||||
state.selected_barcodes = v
|
||||
},
|
||||
|
||||
update_requirements(state, v) {
|
||||
state.requirements = v
|
||||
},
|
||||
|
||||
update_selected_requirements(state, v) {
|
||||
state.selected_requirements = v
|
||||
},
|
||||
|
||||
update_dialog_requirement(state, v) {
|
||||
state.dialog_requirement = v
|
||||
},
|
||||
|
||||
update_reqstate(state, v) {
|
||||
state.reqstate = v
|
||||
}
|
||||
},
|
||||
|
||||
actions : {
|
||||
async get_samples(context, prm) {
|
||||
// context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.get_samples(prm.order_id, prm.station_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_samples", data)
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
// context.commit("update_search_status", 3)
|
||||
// context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async get_sample(context, prm) {
|
||||
// context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.get_sample(prm.order_id, prm.sample_id, prm.barcode)
|
||||
|
||||
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_sample", data)
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
// context.commit("update_search_status", 3)
|
||||
// context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async save(context) {
|
||||
// context.commit("update_search_status", 1)
|
||||
let sample = context.state.selected_sample
|
||||
if (!sample.sampling_time.match(/(?:[01]\d|2[0123]):(?:[012345]\d)/g)) {
|
||||
alert('Cek kembali isian Sampling Time')
|
||||
return
|
||||
}
|
||||
|
||||
let json_data = {
|
||||
sampling_date : sample.sampling_date,
|
||||
sampling_time : sample.sampling_time,
|
||||
receive_date : sample.receive_date,
|
||||
receive_time : sample.receive_time,
|
||||
|
||||
// verification photo
|
||||
ver_photo : context.state.ver_photo.checked ? "Y" : "N",
|
||||
ver_photo_note : context.state.ver_photo.note,
|
||||
|
||||
// note sampling
|
||||
note_sampling : context.state.note_sampling,
|
||||
|
||||
// requirement
|
||||
req_status : sample.req_status,
|
||||
reqs : sample.req_status == "Y" ? [] : context.state.selected_requirements,
|
||||
order_sample_id : sample.order_sample_id
|
||||
}
|
||||
|
||||
try {
|
||||
let resp= await api.save(one_token(), sample.order_id, sample.sample_id, sample.barcode, json_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","")
|
||||
|
||||
// requirement
|
||||
let req_status = context.rootState.patient.req_status
|
||||
context.dispatch('save_requirement', req_status)
|
||||
|
||||
context.commit('update_snackbar', {status:true, text:'Data Sampling telah disimpan', timeout: 3000})
|
||||
context.dispatch('get_sample', { order_id:context.state.selected_sample.order_id,
|
||||
sample_id:context.state.selected_sample.sample_id,
|
||||
barcode:context.state.selected_sample.barcode })
|
||||
|
||||
// UPDATE STATUSES
|
||||
let x = context.rootState.patient.patients
|
||||
let y = context.rootState.patient.total_patient
|
||||
for (let i in x) {
|
||||
if (x[i].T_OrderHeaderID == context.rootState.patient.selected_patient.order_id) {
|
||||
x[i].call_status_id = resp.data.data.call_status_id
|
||||
x[i].call_status_code = resp.data.data.call_status_code
|
||||
x[i].status_code = resp.data.data.status_code
|
||||
}
|
||||
}
|
||||
|
||||
context.commit('queue/update_call_status', 'QUE.Sampling.Done', {root:true})
|
||||
context.commit('patient/update_patients', {records:x, total:y}, {root:true})
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
// context.commit("update_search_status", 3)
|
||||
// context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async save_note_supervisor(context) {
|
||||
|
||||
try {
|
||||
let resp = await api.save_note_supervisor(context.rootState.patient.selected_patient.order_id, context.state.note_supervisor)
|
||||
|
||||
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.commit('update_supervisor_dialog_is_active', false)
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
// context.commit("update_search_status", 3)
|
||||
// context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async barcode_add(context, data) {
|
||||
|
||||
try {
|
||||
let resp = await api.barcode_add(one_token(), data.order_id, data.sample_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","")
|
||||
context.dispatch('get_samples',
|
||||
{ order_id:data.order_id,
|
||||
station_id:context.rootState.patient.selected_station.id
|
||||
})
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
// context.commit("update_search_status", 3)
|
||||
// context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async get_requirement(context) {
|
||||
// context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.get_requirement()
|
||||
|
||||
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.commit("update_requirements", resp.data)
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
// context.commit("update_search_status", 3)
|
||||
// context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async save_requirement(context, status) {
|
||||
// context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.save_requirement(one_token(), context.rootState.patient.selected_patient.order_id,
|
||||
context.rootState.patient.selected_station.id,
|
||||
status,
|
||||
JSON.stringify(context.state.selected_requirements))
|
||||
|
||||
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.commit('update_dialog_requirement', false)
|
||||
context.commit('patient/update_req',
|
||||
{ req_status:status, reqs:context.state.selected_requirements}, {root:true})
|
||||
|
||||
let p = context.rootState.patient
|
||||
let patients = {records:p.patients, total:p.total_patient}
|
||||
for (let i in patients.records)
|
||||
if (patients.records[i].T_OrderHeaderID == p.selected_patient.order_id)
|
||||
{ patients.records[i].req_status = status; patients.records[i].reqs = context.state.selected_requirements; }
|
||||
context.commit('patient/update_patients', patients, {root:true})
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
// context.commit("update_search_status", 3)
|
||||
// context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
107
test/vuex/one-sampling-v2/modules/ver_patient.js
Normal file
107
test/vuex/one-sampling-v2/modules/ver_patient.js
Normal file
@@ -0,0 +1,107 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/ver_patient.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
nolab:'',
|
||||
search: '',
|
||||
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
search_dialog_is_active: false,
|
||||
patients: [],
|
||||
sent_patients: [],
|
||||
total_patient: 0,
|
||||
sent_total_patient: 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
|
||||
},
|
||||
update_selected_patient(state,val) {
|
||||
state.selected_patient=val
|
||||
},
|
||||
|
||||
update_nolab(state, val) {
|
||||
state.nolab = val
|
||||
},
|
||||
|
||||
update_sent_patients(state, data) {
|
||||
state.sent_patients= data.records
|
||||
state.sent_total_patient = data.total
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.search(context.state.nolab, 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_patients", data)
|
||||
context.dispatch('search_sent')
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async search_sent(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.search_sent()
|
||||
|
||||
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_sent_patients", data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
92
test/vuex/one-sampling-v2/modules/ver_verification.js
Normal file
92
test/vuex/one-sampling-v2/modules/ver_verification.js
Normal file
@@ -0,0 +1,92 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/ver_verification.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
nolab:'',
|
||||
search: '',
|
||||
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
search_dialog_is_active: false,
|
||||
|
||||
ids: [],
|
||||
selected_sent_sample : {}
|
||||
},
|
||||
|
||||
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_ids(state, ids) {
|
||||
state.ids = ids
|
||||
},
|
||||
|
||||
update_selected_sent_sample(state, item) {
|
||||
state.selected_sent_sample = item
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
async send(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.send(context.state.ids.join(','))
|
||||
|
||||
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('ver_patient/search', null, {root:true})
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async remove(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.remove(context.state.selected_sent_sample.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","")
|
||||
|
||||
context.dispatch('ver_patient/search', null, {root:true})
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e.message)
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
45
test/vuex/one-sampling-v2/store.js
Normal file
45
test/vuex/one-sampling-v2/store.js
Normal file
@@ -0,0 +1,45 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import patient from "./modules/patient.js";
|
||||
import sampling from "./modules/sampling.js";
|
||||
import queue from "./modules/queue.js";
|
||||
|
||||
import ver_patient from "./modules/ver_patient.js";
|
||||
import ver_verification from "./modules/ver_verification.js";
|
||||
|
||||
import system from "../../../apps/modules/system/system.js";
|
||||
|
||||
export const store = new Vuex.Store({
|
||||
state : {
|
||||
tab_active : '01',
|
||||
tabs : [
|
||||
{"label":"SPECIMEN", "icon":"opacity", "code":"01"},
|
||||
{"label":"KIRIM KE SPECIMEN VERIFICATION", "icon":"verified_user", "code":"02"}
|
||||
],
|
||||
|
||||
dialog_confirm: false
|
||||
},
|
||||
|
||||
mutations : {
|
||||
change_tab(state, tab) {
|
||||
state.tab_active = tab;
|
||||
},
|
||||
|
||||
update_dialog_confirm(state, v) {
|
||||
state.dialog_confirm = v
|
||||
}
|
||||
},
|
||||
|
||||
modules : {
|
||||
patient: patient,
|
||||
sampling: sampling,
|
||||
queue: queue,
|
||||
ver_patient: ver_patient,
|
||||
ver_verification: ver_verification,
|
||||
system: system
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user