Initial import

This commit is contained in:
sas.fajri
2026-05-25 20:01:37 +07:00
commit 710d7c1b97
10371 changed files with 2381698 additions and 0 deletions

View File

@@ -0,0 +1,118 @@
// API :
// search bank
// paramater : query , page , rowPerPage
const URL =
"/one-api/mockup/mcu/";
export async function search(search) {
try {
var resp = await axios.post(URL + 'mcu_reporttemplate/search', {
search: search
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search_detail(id) {
try {
var resp = await axios.post(URL + 'mcu_reporttemplate/search_detail', {
template_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
};
}
}
export async function search_px(search) {
try {
var resp = await axios.post(URL + 'mcu_reporttemplate/search_px', {
search: search
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function save(token, template_name) {
try {
var resp = await axios.post(URL + 'mcu_reporttemplate/save', {
token: token,
template_name: template_name
});
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_detail(token, template_id, desc, is_test, test_id, pos, from_id) {
try {
var resp = await axios.post(URL + 'mcu_reporttemplate/save_detail', {
token: token,
template_id: template_id,
desc: desc,
is_test: is_test,
test_id: test_id,
pos: pos,
from_id: from_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
};
}
}

View File

@@ -0,0 +1,129 @@
<template>
<v-layout class="fill-height" column>
<v-card class="grow">
<v-subheader class="pl-1 pr-1">
<v-text-field class="flex ma-1"
label=""
placeholder="Search"
single-line
solo
hide-details
v-model="query"
></v-text-field>
<v-spacer></v-spacer>
<v-btn class="flex ma-1" color="orange" dark @click="search" >
Search
</v-btn>
<v-btn class="flex ma-1" color="success" @click="add_new" >
Tambah
</v-btn>
</v-subheader>
<hr style="border-top:0px solid #c8c8c8;" />
<v-data-table
:headers="headers" :items="templates"
:loading="isLoading"
hide-actions class="xelevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2"
@click="select(props.item)">
{{ props.item.Mcu_ReportTemplateName }}
</td>
</template>
</v-data-table>
</v-card>
<one-dialog-new></one-dialog-new>
</v-layout>
</template>
<style scoped>
.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;
}
.v-subheader {
height: auto
}
</style>
<script>
module.exports = {
components: {
'one-dialog-new': httpVueLoader('./oneMcuReportTemplateDialogNew.vue')
},
data() {
return {
query: "",
items: [],
headers: [
{
text: "NAMA TEMPLATE",
align: "left",
sortable: false,
value: "mr",
width: "100%",
class: "pa-2 blue lighten-3 white--text"
}
],
isLoading: false
};
},
methods : {
oneMoment : function(d) {
return window.oneMoment(d)
},
select (item) {
this.$store.commit('template/update_selected_template', item)
this.$store.commit('template_detail/update_template_id', item.Mcu_ReportTemplateID)
this.$store.dispatch('template_detail/search')
// this.$store.commit('ver_verification/update_selected_sent_sample', item)
},
remove (item) {
// this.$store.commit('receive_patient/update_selected_sent_sample', item)
// this.$store.dispatch('receive_patient/remove')
},
search () {
return
},
add_new() {
this.$store.commit('template/update_dialog_new', true)
}
},
computed : {
templates () {
return this.$store.state.template.templates
}
},
mounted () {
this.$store.dispatch('template/search')
}
}
</script>

View File

@@ -0,0 +1,157 @@
<template>
<v-layout class="fill-height" column>
<v-card class="grow">
<v-subheader class="mb-2">
<h3 class="title">DETAIL TEMPLATE</h3>
<v-spacer></v-spacer>
<v-btn color="success" @click="add_new">Tambah</v-btn>
</v-subheader>
<hr style="border-top:0px solid #c8c8c8;" />
<v-data-table
:headers="headers" :items="templates"
:loading="isLoading"
hide-actions class="xelevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2"
@click="select(props.item)">
<span v-bind:class="['ml-' + (props.item.Mcu_ReportTemplateDetailLeftMargin),
'pl-' + (props.item.Mcu_ReportTemplateDetailLeftMargin) ]">
{{ props.item.Mcu_ReportTemplateDetailDesc }}
</span>
</td>
<td class="text-xs-left pa-2"
@click="select(props.item)">
{{ props.item.Mcu_ReportTemplateDetailIsTest }}
</td>
<td class="text-xs-left pa-2"
@click="select(props.item)">
{{ props.item.Mcu_ReportTemplateDetailT_TestCode }}
</td>
<td class="text-xs-left pa-2">
<v-btn color="primary" small class="ma-0" @click="edit(props.item)">Edit</v-btn>
<v-btn color="red" dark small class="ma-0">Hapus</v-btn>
</td>
</template>
</v-data-table>
</v-card>
<one-dialog-new></one-dialog-new>
</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-new': httpVueLoader('./oneMcuReportTemplateDetailDialogNew.vue')
},
data() {
return {
query: "",
items: [],
headers: [
{
text: "DESKRIPSI",
align: "left",
sortable: false,
value: "mr",
width: "50%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "IS TEST",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "KODE TEST",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "ACTION",
align: "left",
sortable: false,
value: "mr",
width: "20%",
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('receive_patient/update_selected_sent_sample', item)
// this.$store.dispatch('receive_patient/remove')
},
add_new() {
this.$store.commit('template_detail/update_is_edit', false)
this.$store.commit('template_detail/update_dialog_new', true)
},
edit (item) {
this.$store.commit('template_detail/update_template_detail_id', item.Mcu_ReportTemplateDetailID)
this.$store.commit('template_detail/update_is_edit', true)
this.$store.commit('template_detail/update_template_new',
{is_test:item.Mcu_ReportTemplateDetailIsTest, desc:item.Mcu_ReportTemplateDetailDesc})
this.$store.commit('template_detail/update_dialog_new', true)
}
},
computed : {
templates () {
return this.$store.state.template_detail.templates
}
},
mounted () {
// this.$store.dispatch('template/search')
}
}
</script>

View File

@@ -0,0 +1,250 @@
<template>
<v-layout row justify-center>
<v-dialog v-model="dialog" persistent max-width="400px">
<v-card>
<v-card-title>
<span class="headline">Tambah Data Template</span>
</v-card-title>
<v-card-text class="pt-0">
<v-container grid-list-md pa-0>
<v-layout row wrap>
<v-flex xs12 sm12 md12>
<v-text-field v-model="template_new.desc" label="Deskripsi" hide-details required v-on:keyup="update_desc($event)"></v-text-field>
</v-flex>
<v-flex xs4 sm4 md4 v-if="!is_edit">
<v-checkbox
v-model="template_new.is_test"
:label="`Is Test`"
hide-details
@change="update_is_test"
value="Y"
false-value="N"
></v-checkbox>
</v-flex>
<v-flex xs8 sm8 md8 v-if="!is_edit">
<v-autocomplete
label="Pemeriksaan"
v-model="selected_px"
:items="pxs"
:search-input.sync="search_px"
auto-select-first
no-filter
return-object
clearable
item-text="T_TestName"
no-data-text="Pilih Pemeriksaan"
>
<template
slot="item"
slot-scope="{ item }"
>
<v-list-tile-content>
<v-list-tile-title v-text="item.T_TestName"></v-list-tile-title>
<!-- <v-list-tile-sub-title v-text="getMou(item)"></v-list-tile-sub-title> -->
</v-list-tile-content>
</template>
</v-autocomplete>
<!-- <v-text-field v-model="template_new.test" label="Pemeriksaan" required></v-text-field> -->
</v-flex>
<v-flex xs12 sm12 md12>
<v-select
:items="pos"
v-model="selected_pos"
label="Posisi"
return-object
item-text="label"
item-value="code"
hide-details
clearable
></v-select>
</v-flex>
<v-flex xs12 sm12 md12>
<v-select
:items="av_descs"
v-model="selected_av_desc"
label=""
return-object
item-text="Mcu_ReportTemplateDetailDesc"
item-value="Mcu_ReportTemplateDetailID"
solo
clearable
:disabled="!selected_pos || !selected_pos.code || selected_pos.code == 'XX'"
></v-select>
</v-flex>
</v-layout>
</v-container>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="dialog = false">Tutup</v-btn>
<v-btn color="blue darken-1" @click="save">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-layout>
</template>
<style scoped>
</style>
<style>
</style>
<script>
module.exports = {
data () {
return {
}
},
computed : {
template_new : {
get () {
return this.$store.state.template_detail.template_new
},
set (v) {
this.$store.commit('template_detail/update_new_template_new', v)
}
},
dialog : {
get () {
return this.$store.state.template_detail.dialog_new
},
set (v) {
this.$store.commit('template_detail/update_dialog_new', v)
}
},
av_descs () {
return this.$store.state.template_detail.templates
},
pxs () {
return this.$store.state.template_detail.pxs
},
selected_px : {
get() {
return this.$store.state.template_detail.selected_px
},
set (v) {
this.$store.commit('template_detail/update_selected_px', v)
}
},
search_px : {
get () {
return this.$store.state.template_detail.search_px
},
set (v) {
this.$store.commit('template_detail/update_search_px', v)
}
},
pos () {
let x = this.$store.state.template_detail.pos
let is_edit = false
for (let i in x) {
if (x[i].code == "XX")
is_edit = true
}
if (this.is_edit && !is_edit)
x.splice(0, 0, {code:"XX", label:"TETAP"})
if (!this.is_edit && is_edit)
x.splice(0, 1)
return this.$store.state.template_detail.pos
},
selected_pos : {
get() {
return this.$store.state.template_detail.selected_pos
},
set (v) {
this.$store.commit('template_detail/update_selected_pos', v)
}
},
selected_av_desc : {
get() {
return this.$store.state.template_detail.selected_av_desc
},
set (v) {
this.$store.commit('template_detail/update_selected_av_desc', v)
}
},
is_edit () {
return this.$store.state.template_detail.is_edit
}
},
methods : {
save () {
this.$store.dispatch('template_detail/save')
},
thr_search: _.debounce( function () {
this.$store.dispatch("template_detail/search_px")
}, 700),
update_desc(x) {
let y = this.$store.state.template_detail.template_new
y.desc = x.target.value
this.$store.commit('template_detail/update_template_new', y)
},
update_is_test(x) {
if (x == null)
x = "N"
let y = this.$store.state.template_detail.template_new
y.is_test = x
this.$store.commit('template_detail/update_template_new', y)
}
},
watch : {
search_px(val, old) {
if (val == null || typeof val == 'undefined') val = ""
console.log("1-val:"+val)
if (val == old ) return
console.log("2-val:"+val)
// if (! val) return
console.log("3-val:"+val)
// if (val.length < 1 ) return
console.log("4-val:"+val)
if (this.$store.state.template_detail.search_status == 1 ) return
console.log("5-val:"+val)
this.$store.commit("template_detail/update_search_px", val)
this.thr_search()
// if (this.$store.state.doctor.search_status == 1 ) return
// this.$store.commit("doctor/update_search",val)
// this.thr_search()
}
},
mounted () {
}
}
</script>

View File

@@ -0,0 +1,80 @@
<template>
<v-layout row justify-center>
<v-dialog v-model="dialog" persistent max-width="400px">
<v-card>
<v-card-title>
<span class="headline">Tambah Data Template</span>
</v-card-title>
<v-card-text class="pt-0">
<v-container grid-list-md pa-0>
<v-layout row wrap>
<v-flex xs12 sm12 md12>
<v-text-field v-model="template_name" label="Nama" hide-details required></v-text-field>
</v-flex>
</v-layout>
</v-container>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="dialog = false">Tutup</v-btn>
<v-btn color="blue darken-1" @click="save">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-layout>
</template>
<style scoped>
</style>
<style>
</style>
<script>
module.exports = {
data () {
return {
}
},
computed : {
template_name : {
get () {
return this.$store.state.template.new_template_name
},
set (v) {
this.$store.commit('template/update_new_template_name', v)
}
},
dialog : {
get () {
return this.$store.state.template.dialog_new
},
set (v) {
this.$store.commit('template/update_dialog_new', v)
}
}
},
methods : {
save () {
this.$store.dispatch('template/save')
}
},
watch : {
},
mounted () {
}
}
</script>

View File

@@ -0,0 +1,81 @@
<!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>
<v-flex xs3 pr-1>
<one-template></one-template>
</v-flex>
<v-flex xs9 pl-1>
<one-template-detail></one-template-detail>
</v-flex>
</v-layout>
</v-layout>
</v-container>
</v-content>
<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/lodash.js"></script>
<script src="../../../libs/vendor/vue.js"></script>
<script src="../../../libs/vendor/vuex.js"></script>
<script src="../../../libs/vendor/vuetify.js"></script>
<script src="../../../libs/vendor/httpVueLoader.js"></script>
<script src="../../../libs/one_global.js"></script>
<!-- App Script -->
<?php
$ts = "?ts=" . Date("ymdhis");
?>
<script type="module">
import { store } from './store.js<?php echo $ts ?>';
//for testing
window.store = store;
new Vue({
store,
el: '#app',
components: {
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
'one-template': httpVueLoader('./components/oneMcuReportTemplate.vue'),
'one-template-detail': httpVueLoader('./components/oneMcuReportTemplateDetail.vue')
},
computed : {
tab_active () {
}
},
mounted () {
}
})
</script>
<style>
[v-cloak] {
display: none
}
</style>
</body>
</html>

View File

@@ -0,0 +1,100 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/template.js"
window.api = api
export default {
namespaced: true,
state: {
nolab:'',
search: '',
search_status:0,
search_error_message:'',
templates: [],
selected_template: {},
total_template: 0,
dialog_new: false,
new_template_name: ''
},
mutations: {
update_search_error_message(state,status) {
state.search_error_message = status
},
update_search(state,val) {
state.search=val
},
update_search_status(state,status) {
state.search_status = status
},
update_templates(state, data) {
state.templates= data.records
state.total_template = data.total
},
update_selected_template(state, val) {
state.selected_template = val
},
update_dialog_new(state, val) {
state.dialog_new = val
},
update_new_template_name(state, val) {
state.new_template_name = val
}
},
actions: {
async search(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.search(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_templates", data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
},
async save(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.save(one_token(), context.state.new_template_name)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message",resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
context.dispatch('search')
context.commit('update_dialog_new', false)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,177 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/template.js"
window.api = api
export default {
namespaced: true,
state: {
is_edit: false,
template_id:0,
template_detail_id:0,
search: '',
search_px: '',
search_status:0,
search_error_message:'',
templates: [],
selected_template: {},
total_template: 0,
dialog_new: false,
template_new: {desc:'', is_test:'N'},
pos: [{code:"FC", label:"Anak Pertama Dari"},
{code:"LC", label:"Anak Terakhir Dari"},
{code:"AF", label:"Setelah"},
{code:"BF", label:"Sebelum"}],
selected_pos: {},
av_descs: [],
selected_av_desc: {},
pxs: [],
selected_px: {},
total_px: 0
},
mutations: {
update_is_edit(state, val) {
state.is_edit = val
},
update_search_error_message(state,status) {
state.search_error_message = status
},
update_search(state,val) {
state.search=val
},
update_search_px(state,val) {
state.search_px=val
},
update_search_status(state,status) {
state.search_status = status
},
update_templates(state, data) {
state.templates= data.records
state.total_template = data.total
},
update_selected_template(state, val) {
state.selected_template = val
},
update_template_id(state, val) {
state.template_id = val
},
update_template_detail_id(state, val) {
state.template_detail_id = val
},
update_dialog_new(state, val) {
state.dialog_new = val
},
update_template_new(state, val) {
state.template_new = val
},
update_pxs(state, data) {
state.pxs = data.records
state.total_px = data.total
},
update_selected_px(state, val) {
state.selected_px = val
},
update_selected_pos(state, val) {
state.selected_pos = val
},
update_selected_av_desc(state, val) {
state.selected_av_desc = val
}
},
actions: {
async search(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.search_detail(context.state.template_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_templates", data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
},
async search_px(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.search_px(context.state.search_px)
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_pxs", data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
},
async save(context) {
context.commit("update_search_status", 1)
try {
let resp= await api.save_detail(one_token(),
context.state.template_id,
context.state.template_new.desc,
context.state.template_new.is_test,
context.state.selected_px.T_TestID,
context.state.selected_pos.code,
context.state.selected_av_desc.Mcu_ReportTemplateDetailID)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message",resp.message)
} else {
context.commit("update_search_status",2)
context.commit("update_search_error_message","")
context.dispatch("search")
context.commit("update_dialog_new", false)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,26 @@
// State
// data ...
// Mutations
//
//
// Actions
import template from "./modules/template.js";
import template_detail from "./modules/template_detail.js";
import system from "../../../apps/modules/system/system.js";
export const store = new Vuex.Store({
state : {
},
mutations : {
change_tab(state, tab) {
state.tab_active = tab;
}
},
modules : {
template: template,
template_detail: template_detail,
system: system
}
});