Initial import
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-card class="mt-2" v-for="(detail,index) in xtests" elevation="3" class="mb-2">
|
||||
<v-layout v-if="parseInt(detail.id) === 0" style="background:lightcoral;font-weight: 900;" align-center class="text-xs-center" row>
|
||||
<v-flex pl-1 pa-1 xs11>
|
||||
<h3 class="mono">{{detail.promisedatetime}}</h3>
|
||||
</v-flex>
|
||||
<v-flex pl-1 pa-1 xs1>
|
||||
<v-flex text-xs-right>
|
||||
<v-btn @click="copypromise(detail)" style="min-width:10px;margin:0" flat small color="#825c59"><v-icon>file_copy</v-icon></v-btn>
|
||||
</v-flex>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row>
|
||||
<v-flex pa-1 xs12>
|
||||
<v-chip v-for="test in detail.arr_test" style="font-size: 16px;font-weight:500" label color="pink" text-color="white">
|
||||
{{test.name}}
|
||||
</v-chip>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</div>
|
||||
</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 = {
|
||||
methods : {
|
||||
isSelected(p) {
|
||||
return p.id == this.$store.state.samplecall.selected_test.id
|
||||
},
|
||||
selectMe(test) {
|
||||
var tests = this.$store.state.samplecall.tests
|
||||
this.$store.commit("samplecall/update_selected_test",test)
|
||||
var idx = _.findIndex(tests, function(o) { return o.orderid == test.orderid })
|
||||
var prm = test
|
||||
prm.orderid = this.$store.state.samplecall.selected_patient.orderid
|
||||
this.$store.dispatch("samplecall/getdatapromises",prm)
|
||||
},
|
||||
copypromise(value){
|
||||
var xdatetime = value.promisedatetime
|
||||
this.$store.commit("samplecall/update_copied_promise",xdatetime)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isLoading() {
|
||||
return this.$store.state.samplecall.search_status == 1
|
||||
},
|
||||
xtests() {
|
||||
return this.$store.state.samplecall.tests
|
||||
},
|
||||
copiedpromise: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.copied_promise
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_copied_promise",val)
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
search_company(val, old) {
|
||||
if (val == old) return;
|
||||
if (!val) return;
|
||||
if (val.length < 1) return;
|
||||
if (this.$store.state.samplecall.update_autocomplete_status == 1) return;
|
||||
this.thr_search_company();
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
msgalertconfirmation:"Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
items: [],
|
||||
search_company: "",
|
||||
//isLoading: false,
|
||||
page:1,
|
||||
headers: [
|
||||
{
|
||||
text: "TEST",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<div >
|
||||
<v-layout style="margin-top:0" row>
|
||||
<v-flex xs12>
|
||||
<v-btn v-if="xdetails.length > 0" @click="save()" block color="primary">SIMPAN JANJI</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout style="max-height:550px;overflow: auto;" wrap>
|
||||
<v-card v-for="(detailinfo,index) in xdetails" elevation="3" class="mb-2">
|
||||
<v-layout v-if="parseInt(detailinfo.id) !== 0" style="background:lightcoral;" align-center class="text-xs-center" row>
|
||||
<v-flex pl-1 pa-1 xs1>
|
||||
|
||||
<v-btn @click="pastepromise(detailinfo,index)" style="min-width:10px;margin:0" flat small color="#825c59"><v-icon>note_add</v-icon></v-btn>
|
||||
</v-flex>
|
||||
<v-flex pl-1 pa-1 xs8>
|
||||
<v-text-field
|
||||
placeholder="dd-mm-yyyy"
|
||||
mask="##-##-####"
|
||||
solo
|
||||
v-model="detailinfo.promisedate"
|
||||
@change="ChangeDate(detailinfo.promisedate,index)"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex pl-1 pa-1 xs3>
|
||||
<v-text-field
|
||||
placeholder="hh:mm"
|
||||
mask="##:##"
|
||||
solo
|
||||
v-model="detailinfo.promisetime"
|
||||
@change="ChangeTime(detailinfo.promisetime,index)"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row>
|
||||
<v-flex pa-1 xs12>
|
||||
<v-chip v-for="testinfo in detailinfo.arr_test" style="font-size: 16px;font-weight:500" label color="pink" text-color="white">
|
||||
{{testinfo.name}}
|
||||
</v-chip>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
|
||||
data: () => ({
|
||||
|
||||
}),
|
||||
computed: {
|
||||
xdetails:{
|
||||
get() {
|
||||
return this.$store.state.samplecall.details
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_details",val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods : {
|
||||
patient_photo(){
|
||||
var photo = "https://www.sgm-inc.com/wp-content/uploads/2014/06/no-profile-male-img.gif"
|
||||
if(this.xselected_patient.M_PatientPhoto){
|
||||
photo = this.xselected_patient.M_PatientPhoto
|
||||
}
|
||||
console.log(photo)
|
||||
return photo
|
||||
},
|
||||
ChangeDate(value,index){
|
||||
console.log(value)
|
||||
console.log(index)
|
||||
var details = this.$store.state.samplecall.details
|
||||
details[index]['promisedate'] = value
|
||||
console.log(details)
|
||||
this.$store.commit("samplecall/update_details",details)
|
||||
},
|
||||
ChangeTime(value,index){
|
||||
var details = this.$store.state.samplecall.details
|
||||
details[index]['promisetime'] = value
|
||||
this.$store.commit("samplecall/update_details",details)
|
||||
},
|
||||
pastepromise(value,index){
|
||||
var xpromise = this.$store.state.samplecall.copied_promise
|
||||
var arr_datetime = xpromise.split(" ")
|
||||
var details = this.$store.state.samplecall.details
|
||||
details[index]['promisedate'] = arr_datetime[0]
|
||||
details[index]['promisetime'] = arr_datetime[1]
|
||||
this.$store.commit("samplecall/update_details",details)
|
||||
|
||||
},
|
||||
save(){
|
||||
var details = this.$store.state.samplecall.details
|
||||
var errors = []
|
||||
var errordate = ''
|
||||
details.forEach(function(arr,index) {
|
||||
var xDate = moment(arr.promisedate, 'DDMMYYYY', true)
|
||||
var isValidDate = xDate.isValid()
|
||||
var xTime = moment(arr.promisetime, 'HHmm', true)
|
||||
var isValidTime = xTime.isValid()
|
||||
var formateddate = moment(arr.promisedate,'DDMMYYYY').format('DD-MM-YYYY')
|
||||
var formatedtime = moment(arr.promisetime,'HHmm').format('HH:mm')
|
||||
if(!isValidDate || !isValidTime){
|
||||
errors.push(formateddate+' '+formatedtime)
|
||||
console.log(formateddate+' '+formatedtime)
|
||||
}
|
||||
else{
|
||||
details[index].promisedate = formateddate
|
||||
details[index].promisetime = formatedtime
|
||||
}
|
||||
console.log(errors)
|
||||
})
|
||||
if(errors.length === 0){
|
||||
var prm = {}
|
||||
prm.act = 'save'
|
||||
prm.orderid = this.$store.state.samplecall.selected_patient.orderid
|
||||
prm.search = {
|
||||
nolab:this.nolab,
|
||||
lastid: -1
|
||||
}
|
||||
prm.newpromise = details
|
||||
this.$store.dispatch("samplecall/savenewpromise",prm)
|
||||
}
|
||||
else{
|
||||
errordate = errors.join(" ")
|
||||
this.$store.commit("samplecall/update_msg_info","<p style='color:red;font-weight:700;'>"+errordate+"</p><p>Janji adalah janji, jangan dibuat permainan, gunakan tanggal dan waktu yang benar</p>")
|
||||
this.$store.commit("samplecall/update_open_dialog_info",true)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,301 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-dialog v-model="dialogsuccess" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title color="success" class="headline">Berhasil !</v-card-title>
|
||||
<v-card-text>
|
||||
{{msgsuccess}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="green darken-1" flat @click="closeDialogSuccess">OK</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout row>
|
||||
<v-flex pt-1 xs9>
|
||||
<v-text-field
|
||||
style="font-size:14px"
|
||||
label="No Reg"
|
||||
class="mr-1"
|
||||
outline
|
||||
v-on:keyup.enter="searchPatient"
|
||||
v-model="nolab"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-card>
|
||||
<v-card >
|
||||
<v-layout style="height:500px;overflow: auto;" row>
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="patients"
|
||||
:loading="isLoading"
|
||||
hide-actions
|
||||
class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'teal white--text':props.item.coming === 'Y','amber':props.item.iscito === 'Y'}" @click="selectMe(props.item)">{{ props.item.labnumber }}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'teal white--text':props.item.coming === 'Y','amber':props.item.iscito === 'Y'}" @click="selectMe(props.item)">{{ props.item.patient_fullname}}</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="closeDialogInfo()"></one-dialog-info>
|
||||
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()" @close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.searchbox .v-input.v-text-field .v-input__slot{
|
||||
min-height:60px;
|
||||
}
|
||||
.searchbox .v-btn {
|
||||
min-height:60px;
|
||||
}
|
||||
table.v-table tbody td,table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-dialog-info':httpVueLoader('../../common/oneDialogInfo.vue'),
|
||||
'one-dialog-alert':httpVueLoader('../../common/oneDialogAlert.vue')
|
||||
},
|
||||
mounted() {
|
||||
//this.$store.dispatch("samplecall/getinitdata")
|
||||
this.$store.dispatch("samplecall/search",{
|
||||
nolab:this.nolab,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
methods : {
|
||||
isSelected(p) {
|
||||
return p.orderid == this.$store.state.samplecall.selected_patient.orderid
|
||||
},
|
||||
searchPatient() {
|
||||
this.$store.dispatch("samplecall/search",{
|
||||
nolab:this.nolab,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
selectMe(pat) {
|
||||
var patients = this.$store.state.samplecall.patients
|
||||
this.$store.commit("samplecall/update_selected_patient",pat)
|
||||
this.$store.dispatch("samplecall/getdatapromises",{
|
||||
orderid:pat.orderid
|
||||
})
|
||||
},
|
||||
closeAlertConfirmation(){
|
||||
this.$store.commit("samplecall/update_open_alert_confirmation",false)
|
||||
},
|
||||
forgetAlertConfirmation(){
|
||||
this.$store.commit("samplecall/update_no_save",0)
|
||||
this.$store.commit("samplecall/update_open_alert_confirmation",false)
|
||||
},
|
||||
updateAlert_success(val){
|
||||
this.$store.commit("samplecall/update_alert_success",val)
|
||||
},
|
||||
setNewPatient(){
|
||||
//this.$store.commit("samplecall/update_selected_Patient",{})
|
||||
|
||||
},
|
||||
closeDialogSuccess(){
|
||||
let arrPatient = this.$store.state.samplecall.patients
|
||||
var idx = _.findIndex(arrPatient, item => item.M_PatientID === this.$store.state.samplecall.last_id)
|
||||
console.log(idx)
|
||||
var xcur_page = 1
|
||||
// if(idx !== -1)
|
||||
// xcur_page = this.$store.state.samplecall.current_page
|
||||
|
||||
this.$store.dispatch("samplecall/search",{
|
||||
name:this.name,
|
||||
nolab:this.nolab,
|
||||
stationid: this.xselectedstation.id,
|
||||
statusid: this.xselectedstatus.id,
|
||||
// current_page:xcur_page,
|
||||
lastid: idx
|
||||
})
|
||||
|
||||
this.$store.commit("samplecall/update_dialog_success",false)
|
||||
},
|
||||
closeDialogInfo(){
|
||||
this.$store.commit("samplecall/update_open_dialog_info",false)
|
||||
},
|
||||
thr_search_company: _.debounce(function() {
|
||||
this.$store.dispatch("samplecall/searchcompany", this.search_company);
|
||||
}, 2000),
|
||||
},
|
||||
computed: {
|
||||
dialogsuccess: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.dialog_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_dialog_success",val)
|
||||
}
|
||||
},
|
||||
msgsuccess(){
|
||||
return this.$store.state.samplecall.msg_success
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_alert_success",val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.samplecall.search_status == 1
|
||||
},
|
||||
xstations() {
|
||||
return this.$store.state.samplecall.stations
|
||||
},
|
||||
xselectedstation: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.selected_station
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_selected_station",val)
|
||||
this.searchPatient()
|
||||
}
|
||||
},
|
||||
xstatuses() {
|
||||
return this.$store.state.samplecall.statuses
|
||||
},
|
||||
xselectedstatus: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.selected_status
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_selected_status",val)
|
||||
this.searchPatient()
|
||||
}
|
||||
},
|
||||
patients() {
|
||||
return this.$store.state.samplecall.patients
|
||||
},
|
||||
openalertconfirmation: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.open_alert_confirmation
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_open_alert_confirmation",val)
|
||||
}
|
||||
},
|
||||
curr_page: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.current_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_current_page",val)
|
||||
this.$store.dispatch("samplecall/search",{
|
||||
name:this.name,
|
||||
nolab:this.nolab,
|
||||
stationid: this.xselectedstation.id,
|
||||
statusid: this.xselectedstatus.id,
|
||||
current_page:val,
|
||||
lastid: idx
|
||||
})
|
||||
}
|
||||
},
|
||||
xtotal_page: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.total_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_total_page",val)
|
||||
}
|
||||
},
|
||||
opendialoginfo: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.open_dialog_info
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_open_dialog_info",false)
|
||||
}
|
||||
},
|
||||
msginfo(){
|
||||
return this.$store.state.samplecall.msg_info
|
||||
},
|
||||
name: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.name
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_name",val)
|
||||
}
|
||||
},
|
||||
nolab: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.nolab
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_nolab",val)
|
||||
//this.searchPatient()
|
||||
}
|
||||
},
|
||||
xcompanies() {
|
||||
return this.$store.state.samplecall.companies;
|
||||
},
|
||||
selected_company: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.selected_company;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_selected_company", val)
|
||||
this.searchPatient()
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
search_company(val, old) {
|
||||
if (val == old) return;
|
||||
if (!val) return;
|
||||
if (val.length < 1) return;
|
||||
if (this.$store.state.samplecall.update_autocomplete_status == 1) return;
|
||||
this.thr_search_company();
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
msgalertconfirmation:"Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
items: [],
|
||||
search_company: "",
|
||||
//isLoading: false,
|
||||
page:1,
|
||||
headers: [
|
||||
{
|
||||
text: "NO REG",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "30%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user