specimen handling ui

This commit is contained in:
Sas Andy
2024-08-14 18:22:33 +07:00
parent 83c805b4a7
commit a926cfa3b7
8 changed files with 6647 additions and 1 deletions

View File

@@ -8,7 +8,7 @@
max-height="42px"
max-width="132px"
class="bg-white"
src="images/logo.png"
src="../globalimages/logo.png"
></v-img>
</v-list-item>
</v-navigation-drawer>

5689
libraries/moment.js Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,305 @@
<template>
<div>
<v-row>
<v-col cols="12">
<v-container class="bg-white rounded-lg">
<v-row>
<v-col cols="5"
><v-text-field
label="No reg/Nama"
variant="outlined"
hide-details
append-inner-icon="mdi-magnify"
></v-text-field
></v-col>
<v-col cols="5">
<v-autocomplete
label="Specimen"
variant="outlined"
hide-details
menu-icon="mdi-chevron-down"
:items="['California', 'Colorado', 'Florida', 'Georgia', 'Texas', 'Wyoming']"
></v-autocomplete>
</v-col>
</v-row>
<v-row>
<v-col cols="5">
<!-- <v-date-input label="Date input"></v-date-input> -->
<v-menu
v-model="menu"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
max-width="290px"
min-width="290px"
>
<template v-slot:activator="{ props }">
<!-- v-model="formatDate()" -->
<v-text-field
:model-value="formatDate()"
label="Pilih Tanggal"
prepend-inner-icon="mdi-calendar"
hide-details
readonly
variant="outlined"
v-bind="props"
></v-text-field>
</template>
<v-date-picker
hide-header
show-adjacent-months
rounded="lg"
color="primary"
v-model="date"
@update:modelValue="menu=false"
></v-date-picker>
</v-menu>
<!-- <v-menu v-model="menu" transition="scale-transition">
<template v-slot:activator="{ props }">
<v-text-field
v-model="date"
label="Pilih Tanggal"
prepend-inner-icon="mdi-calendar"
readonly
variant="outlined"
v-bind="props"
></v-text-field>
</template>
<div>klsajkls</div>
</v-menu> -->
</v-col>
<v-col cols="5">
<v-autocomplete
label="Kel. Pelanggan"
variant="outlined"
hide-details
menu-icon="mdi-chevron-down"
:items="['California', 'Colorado', 'Florida', 'Georgia', 'Texas', 'Wyoming']"
></v-autocomplete>
</v-col>
<v-col cols="2">
<div style="height: 100%;">
<v-row class="pt-3">
<div
style="height: 100%;"
class="rounded-lg bg-primary pa-2 mr-2 h-100"
>
<!-- <v-icon icon="mdi-magnify"></v-icon> -->
<!-- <Icon icon="" /> -->
<iconify-icon
style="font-size: 2rem;"
icon="fluent:search-20-regular"
></iconify-icon>
</div>
<div class="rounded-lg bg-warning pa-2">
<!-- <v-icon icon="mdi-magnify"></v-icon> -->
<iconify-icon
style="font-size: 2rem;"
icon="fluent:arrow-download-20-regular"
></iconify-icon>
</div>
</v-row>
</div>
</v-col>
</v-row>
</v-container>
</v-col>
<v-col cols="12">
<v-container class="bg-white rounded-lg">
<v-data-table
v-model="selectedItems"
:items="items"
:headers="headers"
show-select
return-object
hide-default-footer
>
<template
v-slot:header.data-table-select="{ allSelected, selectAll, someSelected }"
>
<v-checkbox-btn
:indeterminate="someSelected && !allSelected"
:model-value="allSelected"
color="primary"
@update:model-value="selectAll(!allSelected)"
></v-checkbox-btn>
</template>
<template
v-slot:item.data-table-select="{ internalItem, isSelected, toggleSelect }"
>
<v-checkbox-btn
:model-value="isSelected(internalItem)"
color="primary"
@update:model-value="toggleSelect(internalItem)"
></v-checkbox-btn>
</template>
<template
v-slot:item="{ item, isSelected, index, toggleSelect, internalItem }"
>
<tr>
<td class="px-2">
<v-checkbox-btn
:model-value="isSelected(internalItem)"
color="primary"
@update:model-value="toggleSelect(internalItem)"
></v-checkbox-btn>
</td>
<td>
<p class="font-weight-medium">{{ item.mou }}</p>
</td>
<td>
<div class="text-center">
<p class="font-weight-medium">{{ item.noreg }}</p>
<v-chip class="ma-1" size="small" label>
{{ item.orderdate }}
</v-chip>
<v-chip class="ma-1" size="small" label>
{{ item.regstaff }}
</v-chip>
</div>
</td>
<td>
<p class="text-center">{{ item.pasienname }}</p>
</td>
<td>
<div class="text-center">
<p class="">{{ item.sample }}</p>
<p class="font-weight-medium">{{ item.samplenumber }}</p>
<v-chip class="ma-1" color="primary" size="small" label>
{{ item.sampledate }}
</v-chip>
<v-chip class="ma-1" size="small" label>
{{ item.samplestaff }}
</v-chip>
</div>
</td>
</tr>
</template>
</v-data-table>
</v-container>
</v-col>
</v-row>
</div>
</template>
<script type="module">
export default {
name: "LeftSpecimen",
components: {},
mounted() {},
data() {
return {
menu: false,
visible: false,
items: [
{
mou: "Pasien Dokter",
noreg: "055000035LA",
orderdate: "01-08-2024 15:02",
orderdate: "01-08-2024 15:02",
regstaff: "NOVITA",
pasienname: "Tn. ANDREW ISKANDAR BUDIMAN",
sample: "NaF 2JPP",
samplenumber: "055000035LAEL1",
sampledate: "01-08-2024 15:04",
samplestaff: "ADMIN WESTERINDO",
},
{
mou: "Pasien Dokter",
noreg: "055000036LA",
orderdate: "01-08-2024 15:02",
orderdate: "01-08-2024 15:02",
regstaff: "NOVITA",
pasienname: "Tn. ANDREW ISKANDAR BUDIMAN",
sample: "NaF 2JPP",
samplenumber: "055000035LAEL1",
sampledate: "01-08-2024 15:04",
samplestaff: "ADMIN WESTERINDO",
},
],
selectedItems: [],
headers: [
{
title: "KEL. PELANGGAN",
align: "center",
sortable: false,
key: "name",
width: "25%",
class: "font-weight-bold",
},
{
title: "NO REG",
align: "center",
sortable: false,
key: "name",
width: "25%",
class: "font-weight-bold",
},
{
title: "NAMA",
align: "center",
sortable: false,
key: "name",
width: "25%",
class: "font-weight-bold",
},
{
title: "BARCODE",
align: "center",
sortable: false,
key: "name",
width: "25%",
class: "font-weight-bold",
},
],
};
},
computed: {
// Akses state dari store
count() {
return this.$store.state.login.count;
},
date: {
get() {
return this.$store.state.specimen.date;
},
set(val) {
this.$store.commit("specimen/setDate", val);
// this.menu = false;
console.log(val);
},
},
password: {
get() {
return this.$store.state.login.password;
},
set(val) {
this.$store.commit("login/setPassword", val);
},
},
},
methods: {
// Dispatch action ke store
formatDate() {
if (!this.date) return null;
return moment(this.date).format("DD-MM-YYYY");
},
deFormatedDate(date) {
if (!date) return null;
const [day, month, year] = date.split("-");
return `${year}-${month.padStart(2, "0")}-${day.padStart(2, "0")}`;
},
increment() {
this.$store.dispatch("increment");
},
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,67 @@
<template>
<v-app id="inspire">
<one-navbar></one-navbar>
<v-main>
<div class="pa-5 bg-primary-lighten ml-2 rounded-xl h-100">
<v-row>
<v-col cols="12" md="6" sm="12" xs="12">
<one-left></one-left>
</v-col>
<v-col cols="12" md="6" sm="12" xs="12">
<one-right></one-right>
</v-col>
</v-row>
</div>
</v-main>
</v-app>
</template>
<script type="module">
import NavbarComponent from "../../globalcomponent/one-navbar.vue";
import LeftComponent from "./left.vue";
import RightComponent from "./right.vue";
export default {
name: "Specimen",
components: {
"one-navbar": NavbarComponent,
"one-left": LeftComponent,
"one-right": RightComponent,
},
mounted() {},
data() {
return {
visible: false,
};
},
computed: {
// Akses state dari store
count() {
return this.$store.state.login.count;
},
email: {
get() {
return this.$store.state.login.email;
},
set(val) {
this.$store.commit("login/setEmail", val);
},
},
password: {
get() {
return this.$store.state.login.password;
},
set(val) {
this.$store.commit("login/setPassword", val);
},
},
},
methods: {
// Dispatch action ke store
increment() {
this.$store.dispatch("increment");
},
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,289 @@
<template>
<div>
<v-row>
<v-col cols="12">
<v-container class="bg-white rounded-lg">
<v-row>
<v-col cols="5"
><v-text-field
label="No reg/Nama"
variant="outlined"
hide-details
append-inner-icon="mdi-magnify"
></v-text-field
></v-col>
<v-col cols="5">
<v-autocomplete
label="Specimen"
variant="outlined"
hide-details
menu-icon="mdi-chevron-down"
:items="['California', 'Colorado', 'Florida', 'Georgia', 'Texas', 'Wyoming']"
></v-autocomplete>
</v-col>
</v-row>
<v-row>
<v-col cols="5">
<!-- <v-date-input label="Date input"></v-date-input> -->
<v-menu
v-model="menu"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
max-width="290px"
min-width="290px"
>
<template v-slot:activator="{ props }">
<!-- v-model="formatDate()" -->
<v-text-field
:model-value="formatDate()"
label="Pilih Tanggal"
prepend-inner-icon="mdi-calendar"
hide-details
readonly
variant="outlined"
v-bind="props"
></v-text-field>
</template>
<v-date-picker
hide-header
show-adjacent-months
rounded="lg"
color="primary"
v-model="date"
@update:modelValue="menu=false"
></v-date-picker>
</v-menu>
<!-- <v-menu v-model="menu" transition="scale-transition">
<template v-slot:activator="{ props }">
<v-text-field
v-model="date"
label="Pilih Tanggal"
prepend-inner-icon="mdi-calendar"
readonly
variant="outlined"
v-bind="props"
></v-text-field>
</template>
<div>klsajkls</div>
</v-menu> -->
</v-col>
<v-col cols="5">
<v-autocomplete
label="Kel. Pelanggan"
variant="outlined"
hide-details
menu-icon="mdi-chevron-down"
:items="['California', 'Colorado', 'Florida', 'Georgia', 'Texas', 'Wyoming']"
></v-autocomplete>
</v-col>
<v-col cols="2">
<div style="height: 100%;">
<v-row class="pt-3">
<div
style="height: 100%;"
class="rounded-lg bg-primary pa-2 mr-2 h-100"
>
<iconify-icon
class="text-center"
style="font-size: 2rem;"
icon="fluent:search-20-regular"
></iconify-icon>
</div>
</v-row>
</div>
</v-col>
</v-row>
</v-container>
</v-col>
<v-col cols="12">
<v-container class="bg-white rounded-lg">
<v-data-table
v-model="selectedItems"
:items="items"
:headers="headers"
hide-default-footer
>
<template v-slot:item="{ item }">
<tr>
<td>
<p class="font-weight-medium">{{ item.mou }}</p>
</td>
<td>
<div class="text-center">
<p class="font-weight-medium">{{ item.noreg }}</p>
<v-chip class="ma-1" size="small" label>
{{ item.orderdate }}
</v-chip>
<v-chip class="ma-1" size="small" label>
{{ item.regstaff }}
</v-chip>
</div>
</td>
<td>
<p class="text-center">{{ item.pasienname }}</p>
</td>
<td>
<div class="text-center">
<p class="">{{ item.sample }}</p>
<p class="font-weight-medium">{{ item.samplenumber }}</p>
<v-chip class="ma-1" color="primary" size="small" label>
{{ item.sampledate }}
</v-chip>
<v-chip class="ma-1" size="small" label>
{{ item.samplestaff }}
</v-chip>
</div>
</td>
<td>
<!-- <v-sheet>
</v-sheet> -->
<v-row no-gutterss class="text-center">
<v-col cols="6" class="pa-0">
<v-btn icon="mdi-close" color="error" variant="plain">
</v-btn
></v-col>
<v-col cols="6" class="pa-0">
<v-btn icon="mdi-export" color="success" variant="plain">
</v-btn
></v-col>
</v-row>
</td>
</tr>
</template>
</v-data-table>
</v-container>
</v-col>
</v-row>
</div>
</template>
<script type="module">
export default {
name: "LeftSpecimen",
components: {},
mounted() {},
data() {
return {
menu: false,
visible: false,
items: [
{
mou: "Pasien Dokter",
noreg: "055000035LA",
orderdate: "01-08-2024 15:02",
orderdate: "01-08-2024 15:02",
regstaff: "NOVITA",
pasienname: "Tn. ANDREW ISKANDAR BUDIMAN",
sample: "NaF 2JPP",
samplenumber: "055000035LAEL1",
sampledate: "01-08-2024 15:04",
samplestaff: "ADMIN WESTERINDO",
},
{
mou: "Pasien Dokter",
noreg: "055000036LA",
orderdate: "01-08-2024 15:02",
orderdate: "01-08-2024 15:02",
regstaff: "NOVITA",
pasienname: "Tn. ANDREW ISKANDAR BUDIMAN",
sample: "NaF 2JPP",
samplenumber: "055000035LAEL1",
sampledate: "01-08-2024 15:04",
samplestaff: "ADMIN WESTERINDO",
},
],
selectedItems: [],
headers: [
{
title: "KEL. PELANGGAN",
align: "center",
sortable: false,
key: "name",
width: "20%",
class: "font-weight-bold",
},
{
title: "NO REG",
align: "center",
sortable: false,
key: "name",
width: "20%",
class: "font-weight-bold",
},
{
title: "NAMA",
align: "center",
sortable: false,
key: "name",
width: "20%",
class: "font-weight-bold",
},
{
title: "BARCODE",
align: "center",
sortable: false,
key: "name",
width: "20%",
class: "font-weight-bold",
},
{
title: "PROSES",
align: "center",
sortable: false,
key: "name",
width: "20%",
class: "font-weight-bold",
},
],
};
},
computed: {
// Akses state dari store
count() {
return this.$store.state.login.count;
},
date: {
get() {
return this.$store.state.specimen.date;
},
set(val) {
this.$store.commit("specimen/setDate", val);
// this.menu = false;
console.log(val);
},
},
password: {
get() {
return this.$store.state.login.password;
},
set(val) {
this.$store.commit("login/setPassword", val);
},
},
},
methods: {
// Dispatch action ke store
formatDate() {
if (!this.date) return null;
return moment(this.date).format("DD-MM-YYYY");
},
deFormatedDate(date) {
if (!date) return null;
const [day, month, year] = date.split("-");
return `${year}-${month.padStart(2, "0")}-${day.padStart(2, "0")}`;
},
increment() {
this.$store.dispatch("increment");
},
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,126 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>WESTONE</title>
<!-- Vuetify CSS -->
<link href="../css/vuetify.css" rel="stylesheet" />
<!-- Local Stylesheet for Fonts -->
<link rel="stylesheet" href="../css/styles.css" />
<link href="../css/materialdesignicon.css" rel="stylesheet" />
<script src="https://code.iconify.design/iconify-icon/2.1.0/iconify-icon.min.js"></script>
</head>
<body>
<div id="app"></div>
<!-- Moment -->
<script src="../libraries/moment.js"></script>
<!-- Vue.js -->
<!-- DEV -->
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<!-- PROD -->
<!-- <script src="../libraries/vue3.4.36.global.prod.js"></script> -->
<!-- Vuex -->
<script src="../libraries/vuex.js"></script>
<!-- Vuetify -->
<script src="../libraries/vuetify3.js"></script>
<!-- vue-i18n -->
<script src="../libraries/vue-i18n.global.js"></script>
<!-- Axios -->
<script src="../libraries/axios.js"></script>
<script src="../globalscript/theme.js"></script>
<script src="../globalscript/global.js"></script>
<!-- loader single file component -->
<script src="../libraries/vue3-sfc-loader.js"></script>
<script src="./language.js"></script>
<script type="module">
const { loadModule } = window["vue3-sfc-loader"];
import specimen from "./modules/specimen.js";
import system from "../globalstore/globalstore.js";
// if (one_token()) {
// let usr = JSON.parse(localStorage.getItem("user"));
// location.replace("/" + usr.M_UserGroupDashboard);
// }
const options = {
moduleCache: {
vue: Vue,
},
getFile(url) {
return fetch(url).then((response) =>
response.ok ? response.text() : Promise.reject(response)
);
},
addStyle(textContent) {
const style = document.createElement("style");
style.textContent = textContent;
const ref = document.head.getElementsByTagName("style")[0] || null;
document.head.insertBefore(style, ref);
},
};
// Locale messages
const messages = CustomMessages;
// Get the browser's preferred language
const browserLocale = navigator.language || navigator.languages[0];
// Initialize vue-i18n
const i18n = VueI18n.createI18n({
locale: browserLocale.startsWith("id") ? "id" : "en", // Set locale based on browser setting
fallbackLocale: "en", // Set fallback locale
messages, // Set locale messages
});
window.i18n = i18n;
moment.locale(browserLocale.startsWith("id") ? "id" : "en");
const store = Vuex.createStore({
modules: {
system: system,
specimen: specimen,
},
});
// Vue App
const app = Vue.createApp({
data() {
return {
visible: false,
bg_src: "",
loading: false, // Initialize loading state
};
},
template: `
<main-component></main-component>
`,
});
const vuetify = Vuetify.createVuetify({
theme: {
themes: CustomTheme,
},
});
app.use(store);
app.use(vuetify);
app.use(i18n);
const components = {
"main-component": "./components/main.vue",
};
Promise.all(
Object.entries(components).map(([name, path]) => {
return loadModule(path, options).then((component) => {
app.component(name, component);
});
})
)
.then(() => {
app.mount("#app");
})
.catch((error) => {
console.error("Error loading components:", error);
});
</script>
</body>
</html>

View File

@@ -0,0 +1,32 @@
var CustomMessages = {
en: {
message: {
login: "Log in",
title: "Log in to your account",
sublogin: "Enter your details below",
email: "Email",
password: "Password",
forgotPassword: "Forgot password?",
placeholderEmail: "Enter your email",
placeholderPassword: "Enter your password",
msgInfo: 'Enter the registered account',
errorQuery: "Error get data",
invalid: "Invalid username / password"
},
},
id: {
message: {
login: "Masuk",
title: "Masuk ke akun Anda",
sublogin: "Masukkan detail Anda di bawah ini",
email: "Surel",
password: "Kata Sandi",
forgotPassword: "Lupa kata sandi?",
placeholderEmail: "Isikan email anda",
placeholderPassword: "Isikan kata sandi anda",
msgInfo: "Masukkan akun terdaftar",
errorQuery: "Gagal mendapatkan data",
invalid: "Nama pengguna / kata sandi tidak valid"
},
},
};

View File

@@ -0,0 +1,138 @@
// const URL = "/westone-api/v1/system/auth";
const URL = "https://devcpone.aplikasi.web.id/westone-api/v1/system/auth/";
const store = {
namespaced: true,
state() {
return {
// date: moment(new Date()).format("YYYY-MM-DD"),
// date: new Date().toISOString().substr(0, 10),
date: new Date(),
count: 0,
data: null,
email: "",
password: "",
dialog_success: false,
loading: false,
errorMessage: "",
iin: window.i18n.global.t('message.login'),
alert: {
show: false,
type: 'info',
message: window.i18n.global.t('message.msgInfo')
}
};
},
mutations: {
increment(state) {
state.count++;
},
decrement(state) {
state.count--;
},
setData(state, payload) {
state.data = payload;
},
setEmail(state, data) {
state.email = data;
},
setPassword(state, data) {
state.password = data;
},
setDialogSuccess(state, data) {
state.dialog_success = data;
},
setLoading(state, data) {
state.loading = data;
},
setAlert(state, data) {
state.alert = data;
},
setDate(state, data) {
state.date = data;
}
},
actions: {
increment({ commit }) {
commit('increment');
},
decrement({ commit }) {
commit('decrement');
},
async login({ state, commit }) {
commit('setLoading', true);
let alert = {
show: false,
type: 'info',
message: window.i18n.global.t('message.msgInfo')
}
let params = {
username: state.email,
password: state.password
};
console.log(params);
try {
const response = await axios.post(URL + '/login', params);
console.log(response.data)
if (response.data.status != 'OK') {
commit('setLoading', false);
if (response.data.message !== 'Invalid') {
alert.message = window.i18n.global.t('message.errorQuery');
} else {
alert.message = window.i18n.global.t('message.invalid');
}
alert.type = "error"
} else {
commit('setLoading', false);
commit('setData', response.data.data);
localStorage.setItem("token", response.data.data.token)
localStorage.setItem('user', JSON.stringify(response.data.data.user))
//console.log(localStorage.getItem("token"))
// if (data.user.is_courier === 'Y' && window.innerWidth < 600)
// window.location = "/one-ui/test/vuex/one-courier-mobile/";
// else
// window.location = "/" + response.data.data.user.M_UserGroupDashboard;
}
commit('setAlert', alert)
} catch (error) {
console.log(error)
commit('setLoading', false);
}
},
async loginState({ state, commit }) {
commit('setLoading', true);
const params = {
email: state.email,
password: state.pasword
};
try {
const response = await axios.post(URL + '/login', params);
if (response.status != 'OK') {
commit('setLoading', false);
} else {
commit('setLoading', false);
commit('setData', response.data);
}
} catch (error) {
commit('setLoading', false);
commit('setError', error);
}
},
async LoginParam({ commit }, params) {
try {
const response = await axios.post(URL + '/login', params);
commit('setData', response.data);
} catch (error) {
commit('setError', error);
}
}
}
};
export default store