323 lines
11 KiB
PHP
323 lines
11 KiB
PHP
<!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>CPONE</title>
|
|
<link rel="stylesheet" href="../../../libs/vendor/css/google-fonts.css">
|
|
<link rel="stylesheet" href="../../../libs/vendor/css/icomoon-fonts.css">
|
|
<link rel="stylesheet" href="../../../libs/vendor/css/vuetify.min.css">
|
|
</head>
|
|
|
|
<body>
|
|
<div v-cloak id="app">
|
|
<v-app id="smartApp" >
|
|
<!--<one-navbar></one-navbar>-->
|
|
<v-dialog v-model="dialog_success" persistent max-width="290">
|
|
<v-card>
|
|
<v-card-title class="headline">Selesai</v-card-title>
|
|
<v-card-text>{{message_success}}</v-card-text>
|
|
<v-card-actions>
|
|
<v-spacer></v-spacer>
|
|
<v-btn color="green darken-1" flat @click="goToControlCard()">Tutup</v-btn>
|
|
</v-card-actions>
|
|
</v-card>
|
|
</v-dialog>
|
|
<v-dialog v-model="dialog_error" max-width="500px">
|
|
<v-card color="error" dark>
|
|
<v-card-title>
|
|
<span>Error</span>
|
|
<v-spacer></v-spacer>
|
|
</v-menu>
|
|
</v-card-title>
|
|
<v-card-text>
|
|
<p>{{message_error}}</p>
|
|
</v-card-text>
|
|
<v-card-actions>
|
|
<v-spacer></v-spacer>
|
|
<v-btn dark color="white" flat @click="dialog_error=false">Tutup</v-btn>
|
|
</v-card-actions>
|
|
</v-card>
|
|
</v-dialog>
|
|
<v-content style="background:#F5E8DF!important" >
|
|
<v-container fluid >
|
|
<template>
|
|
<div
|
|
id="e3"
|
|
style="max-width: 400px; margin:auto"
|
|
class="grey lighten-3"
|
|
>
|
|
<v-toolbar
|
|
|
|
>
|
|
<v-btn icon>
|
|
<v-icon>assignment</v-icon>
|
|
</v-btn>
|
|
<v-toolbar-title>Survey</v-toolbar-title>
|
|
<v-spacer></v-spacer>
|
|
<!--<v-btn icon>
|
|
<v-icon>search</v-icon>
|
|
</v-btn>-->
|
|
</v-toolbar>
|
|
|
|
<v-card>
|
|
<v-container
|
|
fluid
|
|
grid-list-lg
|
|
>
|
|
<v-layout row wrap>
|
|
<v-flex xs12>
|
|
<v-card v-for="(survey,ks) in surveys" class="mb-1">
|
|
<v-card-text>
|
|
<p class="subheading">{{survey.name}}</p>
|
|
<v-radio-group v-model="survey.value" row>
|
|
<v-radio style="padding-bottom: 0.7em;" label="Sangat Setuju" value="SS"></v-radio>
|
|
<v-radio style="padding-bottom: 0.7em;" label="Setuju" value="S"></v-radio>
|
|
<v-radio style="padding-bottom: 0.7em;" label="Kurang Setuju" value="KS"></v-radio>
|
|
<v-radio style="padding-bottom: 0.7em;" label="Tidak Setuju" value="TS"></v-radio>
|
|
</v-radio-group>
|
|
</v-card-text>
|
|
|
|
</v-card>
|
|
<v-card class="mb-1">
|
|
<v-card-text>
|
|
<v-textarea
|
|
|
|
label="Saran"
|
|
v-model="saran"
|
|
></v-textarea>
|
|
</v-card-text>
|
|
</v-card>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</v-flex>
|
|
</v-layout>
|
|
</v-container>
|
|
</v-card>
|
|
<v-card class="mt-1 pt-1 pa-2">
|
|
<v-btn block color="primary" @click="save_survey()">
|
|
Simpan
|
|
</v-btn>
|
|
<qr-scanner></qr-scanner>
|
|
</v-card>
|
|
</div>
|
|
</template>
|
|
|
|
</v-container>
|
|
</v-content>
|
|
<!--<one-footer> </one-footer>-->
|
|
|
|
</v-app>
|
|
</div>
|
|
|
|
<!-- Vendor -->
|
|
<script src="../../../libs/vendor/html5-qrcode.min.js"></script>
|
|
<script src="../../../libs/vendor/moment.min.js"></script>
|
|
<script src="../../../libs/vendor/numeral.min.js"></script>
|
|
<script src="../../../libs/vendor/moment-locale-id.js"></script>
|
|
<script src="../../../libs/vendor/lodash.js"></script>
|
|
<script src="../../../libs/vendor/axios.min.js"></script>
|
|
<script src="../../../libs/vendor/vue.js"></script>
|
|
<script src="../../../libs/vendor/vuex.js"></script>
|
|
<script src="../../../libs/vendor/vuetify.js"></script>
|
|
<script src="../../../libs/vendor/httpVueLoader.js"></script>
|
|
<script src="../../../libs/one_global.js"></script>
|
|
<script src="../../../libs/one_print_barcode.js"></script>
|
|
<script src="../../../libs/one_print_robo.js"></script>
|
|
|
|
|
|
|
|
<!-- App Script -->
|
|
<?php
|
|
$ts = "?ts=" . Date("ymdhis");
|
|
?>
|
|
<script type="module">
|
|
window.calculate_age = function (inp_dob) {
|
|
var now = moment(new Date())
|
|
var dob = moment(new Date(inp_dob))
|
|
var year = now.diff(dob,'years')
|
|
dob.add(year,'years')
|
|
var month = now.diff(dob,'months')
|
|
dob.add(month,'months')
|
|
var day = now.diff(dob,'days')
|
|
if (isNaN(year)) return ''
|
|
return `${year} tahun ${month} bulan ${day} hari`
|
|
}
|
|
|
|
|
|
import { store } from './store.js<?php echo $ts ?>';
|
|
|
|
//for testing
|
|
window.store = store;
|
|
new Vue({
|
|
store,
|
|
el: '#app',
|
|
methods: {
|
|
tab_selected : function(tab) {
|
|
return this.$store.state.tab_selected == tab
|
|
}
|
|
},
|
|
components: {
|
|
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
|
|
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
|
'one-patient-list': httpVueLoader('./components/onePatientList.vue'),
|
|
'qr-scanner': httpVueLoader('./components/oneQRscanner.vue')
|
|
},
|
|
mounted: function() {
|
|
var url_string = window.location.href
|
|
var url = new URL(url_string);
|
|
var id = url.searchParams.get("id");
|
|
var noreg = url.searchParams.get("noreg");
|
|
|
|
this.$store.commit('patient/update_order_id', id)
|
|
this.$store.commit('patient/update_noreg', noreg)
|
|
|
|
this.$store.dispatch('patient/load_survey')
|
|
|
|
},
|
|
methods : {
|
|
save_survey(){
|
|
let d_survey = this.surveys
|
|
let chk_survey = true
|
|
d_survey.forEach(survey => {
|
|
if(survey.value == ''){
|
|
chk_survey = false
|
|
}
|
|
})
|
|
if(chk_survey){
|
|
this.$store.dispatch('patient/save_survey')
|
|
}else{
|
|
this.dialog_error = true
|
|
this.message_error = "Jangan lupa pilih baik atau kurang di setiap pertanyaan"
|
|
}
|
|
|
|
},
|
|
goToControlCard(){
|
|
let order_id = this.$store.state.patient.order_id
|
|
let noreg = this.$store.state.patient.noreg
|
|
window.location = "/one-ui/test/vuex/cpone-control-card/?noreg="+noreg+"&id="+order_id
|
|
},
|
|
openscanner(){
|
|
//this.dialog_scanner = true
|
|
location.reload()
|
|
}
|
|
},
|
|
computed: {
|
|
saran: {
|
|
get() {
|
|
return this.$store.state.patient.saran
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_saran",val)
|
|
}
|
|
},
|
|
surveys: {
|
|
get() {
|
|
return this.$store.state.patient.surveys
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_surveys",val)
|
|
}
|
|
},
|
|
message_success: {
|
|
get() {
|
|
return this.$store.state.patient.message_success
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_message_success",val)
|
|
}
|
|
},
|
|
dialog_success: {
|
|
get() {
|
|
return this.$store.state.patient.dialog_success
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_dialog_success",val)
|
|
}
|
|
},
|
|
message_error: {
|
|
get() {
|
|
return this.$store.state.patient.message_error
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_message_error",val)
|
|
}
|
|
},
|
|
dialog_error: {
|
|
get() {
|
|
return this.$store.state.patient.dialog_error
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_dialog_error",val)
|
|
}
|
|
},
|
|
dialog_scanner: {
|
|
get() {
|
|
return this.$store.state.patient.dialog_scanner
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_dialog_scanner",val)
|
|
}
|
|
},
|
|
data_patient() {
|
|
return this.$store.state.patient.data_patient
|
|
},
|
|
data_packet() {
|
|
return this.$store.state.patient.data_packet
|
|
},
|
|
data_tests() {
|
|
return this.$store.state.patient.data_tests
|
|
},
|
|
data_sample_lab() {
|
|
return this.$store.state.patient.data_sample_lab
|
|
},
|
|
data_sample_radiodiagnostic() {
|
|
return this.$store.state.patient.data_sample_radiodiagnostic
|
|
},
|
|
data_sample_electromedic() {
|
|
return this.$store.state.patient.data_sample_electromedic
|
|
},
|
|
data_sample_other() {
|
|
return this.$store.state.patient.data_sample_other
|
|
},
|
|
},
|
|
data () {
|
|
return {
|
|
items2: [
|
|
{ icon: 'assignment', iconClass: 'blue white--text', title: 'Vacation itinerary', subtitle: 'Jan 20, 2014' },
|
|
{ icon: 'call_to_action', iconClass: 'amber white--text', title: 'Kitchen remodel', subtitle: 'Jan 10, 2014' }
|
|
],
|
|
items: [
|
|
{
|
|
action: 'healing',
|
|
title: 'Paket Pria 2024',
|
|
items: [
|
|
{ title: 'List Item' },
|
|
{ title: 'List Item' },
|
|
{ title: 'List Item' }
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
})
|
|
</script>
|
|
<style>
|
|
[v-cloak] {
|
|
display: none
|
|
}
|
|
.left {
|
|
}
|
|
.right {
|
|
}
|
|
</style>
|
|
</body>
|
|
|
|
</html>
|