Flatten nested repos

This commit is contained in:
sas.fajri
2026-04-27 10:13:31 +07:00
parent 01c2963a43
commit 8347aef8f4
17935 changed files with 5015229 additions and 3 deletions

View File

@@ -0,0 +1,30 @@
// API :
// search bank
// paramater : query , page , rowPerPage
const URL =
"/one-api/mockup/process/resultprint/";
export async function search(token, date, nolab, search, page) {
try {
var resp = await axios.post(URL + 'rp_patient/search', {
token: token,
date: date,
nolab: nolab,
search: search,
page: page
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,80 @@
<template>
<v-menu
v-model="menu2"
:close-on-content-click="false"
:nudge-right="40"
lazy
transition="scale-transition"
offset-y
full-width
max-width="290px"
min-width="290px"
>
<v-text-field
slot="activator"
v-model="computedDateFormatted"
:label=init_label
:hint="init_solo ? '' : 'MM/DD/YYYY format'"
hide-details
persistent-hint
readonly
browser-autocomplete="off"
:solo="init_solo"
></v-text-field>
<v-date-picker v-model="init_date" no-title @input="menu2 = false" :max="init_max_date"></v-date-picker>
</v-menu>
</template>
<script>
module.exports = {
props : ['label', 'date', 'data', 'max_date', 'solo'],
data () {
return {
init_date: this.date && this.date != "0000-00-00" ? this.date : null, //new Date().toISOString().substr(0, 10),
init_max_date: this.max_date ? this.max_date : '2999-09-09',
dateFormatted: this.formatDate(new Date().toISOString().substr(0, 10)),
init_solo: this.solo ? true : false,
menu1: false,
menu2: false,
init_label: this.label ? this.label : 'Date',
init_data: this.data ? this.data : ''
}
},
computed: {
computedDateFormatted () {
return this.formatDate(this.init_date)
}
},
watch: {
init_date (n, o) {
this.dateFormatted = this.formatDate(this.init_date)
this.$emit('change', {"old_date":o, "new_date":n, "data":this.init_data});
}
},
methods: {
formatDate (date) {
if (!date) { return null }
const [year, month, day] = date.split('-')
return `${day}-${month}-${year}`
},
parseDate (date) {
if (!date) return null
const [month, day, year] = date.split('/')
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
},
emitChange (n, o) {
console.log("old:"+o)
console.log("new:"+n)
}
}
}
</script>

View File

@@ -0,0 +1,69 @@
<template>
<v-dialog
v-model="dialog"
width="1000px"
>
<v-card>
<v-card-title
class="headline grey lighten-2 pt-2 pb-2"
primary-title
>
Laporan
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout>
<v-flex xs12>
<object :data="rpt_url"
width="100%" height="512px"></object>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color="primary"
@click="dialog = false"
flat
>
Tutup
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<style scoped>
</style>
<script>
module.exports = {
components : {
},
methods : {
},
computed : {
dialog: {
get() {
return this.$store.state.rp_patient.print_dialog;
},
set(val) {
this.$store.commit('rp_patient/update_print_dialog', val);
}
},
rpt_url () {
return this.$store.state.rp_patient.rpt_url
}
}
}
</script>

View File

@@ -0,0 +1,174 @@
<template>
<v-layout class="fill-height" column>
<v-card class="grow">
<!-- <v-subheader>
<h3 class="title">DAFTAR PASIEN</h3>
</v-subheader> -->
<hr style="border-top:0px solid #c8c8c8;" />
<v-data-table
:headers="headers" :items="patients"
:loading="isLoading"
hide-actions class="xelevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2 green--text" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
{{ props.item.T_OrderHeaderLabNumber }}
</td>
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
{{ props.item.M_PatientName }}
</td>
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
{{ resultPromise(props.item.T_OrderPromiseDateTime) }}
</td>
<td class="text-xs-left pa-2" v-bind:class="is_selected(props.item)"
@click="select(props.item)">
<v-btn small :color="btn.color" dark v-for="btn in props.item.buttons" v-bind:key="btn.id" class="ml-1 mr-1 ma-0" @click="printMe(btn.url)">{{btn.label}}</v-btn>
</td>
</template>
</v-data-table>
<v-pagination
v-model="curr_patient_page"
:length="total_patient_page"
:total-visible="5"
@input="change_page"
></v-pagination>
</v-card>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot{
min-height:60px;
}
.searchbox .v-btn {
min-height:60px;
}
table.v-table tbody td,table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
data() {
return {
query: "",
items: [],
headers: [
{
text: "NO LAB",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
value: "mr",
width: "45%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "JANJI HASIL",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "CETAK HASIL",
align: "left",
sortable: false,
value: "mr",
width: "25%",
class: "pa-2 blue lighten-3 white--text"
}
],
isLoading: false
};
},
methods : {
oneMoment : function(d) {
return window.oneMoment(d)
},
select (item) {
this.$store.commit('rp_patient/update_selected_patient', item)
},
is_selected (item) {
let x = this.$store.state.rp_patient.selected_patient
if (!x)
return ''
if (x.T_OrderHeaderID == item.T_OrderHeaderID)
return 'green lighten-4'
return ''
},
change_page(x) {
this.curr_patient_page = x
this.$store.dispatch('rp_patient/search')
},
resultPromise(p) {
let x = p.split(' ')
let y = x[0].split('-').reverse().join('-')
return y + ' ' + x[1]
},
printMe(url) {
this.$store.commit('rp_patient/update_rpt_url', url)
this.$store.commit('rp_patient/update_print_dialog', true)
}
},
computed : {
patients () {
return this.$store.state.rp_patient.patients
},
total_patient () {
return this.$store.state.rp_patient.total_patient
},
total_patient_page () {
return this.$store.state.rp_patient.total_patient_page
},
curr_patient_page : {
get () { return this.$store.state.rp_patient.curr_patient_page },
set (v) { this.$store.commit('rp_patient/update_curr_patient_page', v) }
},
button_print () {
return [
{id:1, label:"Lab", color:"blue"},
{id:2, label:"MDT", color:"green"}
]
}
},
mounted () {
this.$store.dispatch('rp_patient/search')
}
}
</script>

View File

@@ -0,0 +1,127 @@
<template>
<v-card class="mb-1 pa-1">
<v-layout row>
<v-flex xs2 pt-1>
<one-date-picker
label="Tanggal Janji Hasil"
:date="null"
@change="startDateChange"
:solo="true"
:max_date="null"
class="mr-4"
></one-date-picker>
</v-flex>
<v-flex xs4>
<v-layout>
<v-text-field class="flex xs4 ma-1"
placeholder="No Lab"
single-line
solo
hide-details
v-model="nolab"
></v-text-field>
<v-text-field class="flex xs8 ma-1"
label=""
placeholder="Nama"
single-line
solo
hide-details
v-model="search"
></v-text-field>
</v-layout>
</v-flex>
<!-- <v-flex xs3 pt-1 pl-2>
<v-select
:items="groups"
v-model="selected_group"
item-text="name"
item-value="id"
label="Grup Pemeriksaan"
return-object
solo
hide-details
></v-select>
</v-flex> -->
<v-flex xs2>
<v-layout>
<v-btn class="flex xs6 ma-1" color="success" @click="searchs" >
Search
</v-btn>
</v-layout>
</v-flex>
<v-flex xs3 class="text-xs-right">
<!-- <v-btn
color="blue-grey"
class="white--text ma-1"
@click="histories"
>
Histori
</v-btn> -->
<!-- <v-btn
color="blue"
class="white--text ma-1"
@click="save_result"
>
Simpan
<v-icon right dark>save_alt</v-icon>
</v-btn> -->
</v-flex>
</v-layout>
</v-card>
</template>
<style scoped>
button {
height: 48px;
}
</style>
<script>
module.exports = {
components : {
'one-date-picker' : httpVueLoader('./oneDatePicker2.vue')
},
computed : {
nolab : {
get () { return this.$store.state.rp_patient.nolab },
set (v) { return this.$store.commit('rp_patient/update_nolab', v) }
},
search : {
get () { return this.$store.state.rp_patient.search },
set (v) { this.$store.commit('rp_patient/update_search', v) }
},
groups () {
return [] // this.$store.state.re_px.groups
},
selected_group : {
get () { return {} /*this.$store.state.re_px.selected_group*/ },
set (v) { return /*this.$store.commit('re_px/update_selected_group', v)*/ }
}
},
methods : {
searchs() {
this.$store.dispatch('rp_patient/search')
},
startDateChange (prm) {
this.$store.commit('rp_patient/update_sdate', prm.new_date)
}
// save_result() {
// this.$store.dispatch('re_px/save')
// },
// histories() {
// this.$store.commit('re_history/update_dialog_history', true)
// }
}
}
</script>

View File

@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>One</title>
<link rel="stylesheet" href="../../../libs/vendor/css/google-fonts.css">
<link rel="stylesheet" href="../../../libs/vendor/css/vuetify.min.css">
</head>
<body>
<div v-cloak id="app">
<v-app id="smartApp" >
<one-navbar></one-navbar>
<v-content class="blue lighten-5" >
<v-container fluid pt-2 pb-2 pl-1 pr-1>
<v-layout column>
<v-flex>
<!-- <one-process-re-search-box></one-process-re-search-box> -->
</v-flex>
<v-flex>
<v-layout row wrap>
<v-flex xs12>
<one-process-rp-search-box></one-process-rp-search-box>
</v-flex>
<v-flex xs12>
<one-process-rp-patient-list></one-process-rp-patient-list>
</v-flex>
</v-layout>
<v-flex>
</v-layout>
</v-container>
</v-content>
<one-dialog-print></one-dialog-print>
<one-footer> </one-footer>
</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>
<!-- App Script -->
<?php
$ts = "?ts=" . Date("ymdhis");
?>
<script type="module">
import { store } from './store.js<?php echo $ts ?>';
//for testing
window.store = store;
new Vue({
store,
el: '#app',
components: {
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
// 'one-process-re-search-box': httpVueLoader('./components/oneProcessReSearchBox.vue'),
'one-process-rp-patient-list': httpVueLoader('./components/oneProcessRpPatientList.vue'),
'one-process-rp-search-box': httpVueLoader('./components/oneProcessRpSearchBox.vue'),
'one-dialog-print': httpVueLoader('./components/oneDialogPrint.vue')
},
computed : {
tab_active () {
}
},
mounted () {
// store.dispatch('receive_patient/search')
}
})
</script>
<style>
[v-cloak] {
display: none
}
</style>
</body>
</html>

View File

@@ -0,0 +1,110 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/rp_patient.js"
window.api = api
export default {
namespaced: true,
state: {
order_id:0,
search: '',
nolab: '',
sdate: null,
search_status:0,
search_error_message:'',
search_dialog_is_active: false,
patients: [],
total_patient: 0,
total_patient_page: 0,
curr_patient_page: 1,
selected_patient: { },
// PX
total_px: 0,
pxs: [],
// Print
print_dialog: false,
rpt_url: ''
},
mutations: {
update_search_dialog_is_active(state,status) {
state.search_dialog_is_active = status
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_search(state,val) {
state.search=val
},
update_nolab(state, val) {
state.nolab = val
},
update_search_status(state,status) {
state.search_status = status
},
update_patients(state, data) {
state.patients= data.records
state.total_patient = data.total
state.total_patient_page = data.total_page
},
update_curr_patient_page(state, data) {
state.curr_patient_page = data
},
update_selected_patient(state,val) {
state.selected_patient=val
},
update_id(state, id) {
state.order_id = id
},
update_sdate(state, date) {
state.sdate = date
},
update_print_dialog(state, v) {
state.print_dialog = v
},
update_rpt_url(state, v) {
state.rpt_url = v
}
},
actions: {
async search(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.search(one_token(), context.state.sdate, context.state.nolab, context.state.search, context.state.curr_patient_page)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total,
total_page: resp.data.total_page
}
context.commit("update_patients", data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,28 @@
// State
// data ...
// Mutations
//
//
// Actions
import rp_patient from "./modules/rp_patient.js";
import system from "../../../apps/modules/system/system.js";
export const store = new Vuex.Store({
state : {
tab_active : '01',
tabs : [
]
},
mutations : {
change_tab(state, tab) {
state.tab_active = tab;
}
},
modules : {
rp_patient: rp_patient,
system: system
}
});